mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
[CodeGenPrepare] Fix the check of the legality of an instruction.
The API expects an ISD opcode, not an IR opcode. Fixes a regression for R600. Related to <rdar://problem/15519855>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201923 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1756,7 +1756,12 @@ AddressingModeMatcher::IsPromotionProfitable(unsigned MatchedSize,
|
||||
Instruction *PromotedInst = dyn_cast<Instruction>(PromotedOperand);
|
||||
if (!PromotedInst)
|
||||
return false;
|
||||
return TLI.isOperationLegalOrCustom(PromotedInst->getOpcode(),
|
||||
int ISDOpcode = TLI.InstructionOpcodeToISD(PromotedInst->getOpcode());
|
||||
// If the ISDOpcode is undefined, it was undefined before the promotion.
|
||||
if (!ISDOpcode)
|
||||
return true;
|
||||
// Otherwise, check if the promoted instruction is legal or not.
|
||||
return TLI.isOperationLegalOrCustom(ISDOpcode,
|
||||
EVT::getEVT(PromotedInst->getType()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user