]> granicus.if.org Git - llvm/commitdiff
Revert "[X86] Correct the immediate cost for 'add/sub i64 %x, 0x80000000'."
authorDean Michael Berris <dberris@google.com>
Mon, 30 Jul 2018 09:45:09 +0000 (09:45 +0000)
committerDean Michael Berris <dberris@google.com>
Mon, 30 Jul 2018 09:45:09 +0000 (09:45 +0000)
This reverts commit r338204.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338236 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86TargetTransformInfo.cpp

index 0257c42def29250f9b82428b438892a50a037615..1b260d8d45dd0ee0d43f3b9224c88c47f42b695b 100644 (file)
@@ -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.
     if (Idx == 1 && Imm.getBitWidth() == 64 && isUInt<32>(Imm.getZExtValue()))
       return TTI::TCC_Free;
-    ImmIdx = 1;
-    break;
+    LLVM_FALLTHROUGH;
   case Instruction::Add:
   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::UDiv:
   case Instruction::SDiv: