forked from OSchip/llvm-project
Revert "[X86] Correct the immediate cost for 'add/sub i64 %x, 0x80000000'."
This reverts commit r338204. llvm-svn: 338236
This commit is contained in:
parent
7f0d05d532
commit
927b3da6c9
|
@ -2332,15 +2332,9 @@ int X86TTIImpl::getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm,
|
||||||
// immediates here as the normal path expects bit 31 to be sign extended.
|
// immediates here as the normal path expects bit 31 to be sign extended.
|
||||||
if (Idx == 1 && Imm.getBitWidth() == 64 && isUInt<32>(Imm.getZExtValue()))
|
if (Idx == 1 && Imm.getBitWidth() == 64 && isUInt<32>(Imm.getZExtValue()))
|
||||||
return TTI::TCC_Free;
|
return TTI::TCC_Free;
|
||||||
ImmIdx = 1;
|
LLVM_FALLTHROUGH;
|
||||||
break;
|
|
||||||
case Instruction::Add:
|
case Instruction::Add:
|
||||||
case Instruction::Sub:
|
case Instruction::Sub:
|
||||||
// For add/sub, we can use the opposite instruction for INT32_MIN.
|
|
||||||
if (Idx == 1 && Imm.getBitWidth() == 64 && isInt<32>(-Imm.getSExtValue()))
|
|
||||||
return TTI::TCC_Free;
|
|
||||||
ImmIdx = 1;
|
|
||||||
break;
|
|
||||||
case Instruction::Mul:
|
case Instruction::Mul:
|
||||||
case Instruction::UDiv:
|
case Instruction::UDiv:
|
||||||
case Instruction::SDiv:
|
case Instruction::SDiv:
|
||||||
|
|
Loading…
Reference in New Issue