]> granicus.if.org Git - llvm/commitdiff
[InstCombine] reduce duplicate code; NFC
authorSanjay Patel <spatel@rotateright.com>
Fri, 1 Feb 2019 14:37:49 +0000 (14:37 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 1 Feb 2019 14:37:49 +0000 (14:37 +0000)
An unused variable problem was introduced with rL352870
and stubbed out with rL352871, but we can make a better
fix by actually using the local variable in code rather
than just the assert.

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

lib/Transforms/InstCombine/InstCombineCalls.cpp

index caed651571a635827f0d304fd9e430cbc8c29a4f..811b0fd4f110133835583fa153ea8d9550cc62b1 100644 (file)
@@ -761,7 +761,6 @@ static Value *simplifyX86addcarry(const IntrinsicInst &II,
   assert(RetTy->getStructElementType(0)->isIntegerTy(8) &&
          RetTy->getStructElementType(1) == OpTy && OpTy == Op2->getType() &&
          "Unexpected types for x86 addcarry");
-  (void)RetTy;
 
   // If carry-in is zero, this is just an unsigned add with overflow.
   if (match(CarryIn, m_ZeroInt())) {
@@ -771,7 +770,7 @@ static Value *simplifyX86addcarry(const IntrinsicInst &II,
     Value *UAddResult = Builder.CreateExtractValue(UAdd, 0);
     Value *UAddOV = Builder.CreateZExt(Builder.CreateExtractValue(UAdd, 1),
                                        Builder.getInt8Ty());
-    Value *Res = UndefValue::get(II.getType());
+    Value *Res = UndefValue::get(RetTy);
     Res = Builder.CreateInsertValue(Res, UAddOV, 0);
     return Builder.CreateInsertValue(Res, UAddResult, 1);
   }