diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2017-03-07 20:34:23 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2017-03-07 20:34:23 +0000 |
commit | c373262d52638cd73763d3ea1e3e1ef41d4e01d6 (patch) | |
tree | 8eb6e693cb0131b9cbeaab3503303439e5badc3c /llvm/lib/CodeGen | |
parent | 4826bae8b493a38c98b29ef833bb4e7244019ebd (diff) | |
download | bcm5719-llvm-c373262d52638cd73763d3ea1e3e1ef41d4e01d6.tar.gz bcm5719-llvm-c373262d52638cd73763d3ea1e3e1ef41d4e01d6.zip |
[GlobalISel] Ignore %noreg when applying default regbank mapping.
When computing the mapping for non-generic instructions, we skipped
%noreg operands, because we can't always reason about their banks.
Also skip them when applying the mapping. Otherwise, we could end
up with mappings that we can't apply.
While there, duplicate an assert to distinguish between the two
error conditions.
llvm-svn: 297201
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp b/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp index 74161e3c6bd..2901761c1cd 100644 --- a/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp +++ b/llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp @@ -352,6 +352,13 @@ void RegisterBankInfo::applyDefaultMapping(const OperandsMapper &OpdMapper) { DEBUG(dbgs() << " is not a register, nothing to be done\n"); continue; } + if (!MO.getReg()) { + DEBUG(dbgs() << " is %%noreg, nothing to be done\n"); + continue; + } + assert(OpdMapper.getInstrMapping().getOperandMapping(OpIdx).NumBreakDowns != + 0 && + "Invalid mapping"); assert(OpdMapper.getInstrMapping().getOperandMapping(OpIdx).NumBreakDowns == 1 && "This mapping is too complex for this function"); |