[PATCH] D29081: Use InstCombine's builder in foldSelectCttzCtlz instead of creating a new one.

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 09:59:31 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL292957: Use InstCombine's builder in foldSelectCttzCtlz instead of creating a new one. (authored by deadalnix).

Changed prior to commit:
  https://reviews.llvm.org/D29081?vs=85579&id=85603#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D29081

Files:
  llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp


Index: llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
===================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -395,13 +395,12 @@
   if (match(Count, m_Intrinsic<Intrinsic::cttz>(m_Specific(CmpLHS))) ||
       match(Count, m_Intrinsic<Intrinsic::ctlz>(m_Specific(CmpLHS)))) {
     IntrinsicInst *II = cast<IntrinsicInst>(Count);
-    IRBuilder<> Builder(II);
     // Explicitly clear the 'undef_on_zero' flag.
     IntrinsicInst *NewI = cast<IntrinsicInst>(II->clone());
     Type *Ty = NewI->getArgOperand(1)->getType();
     NewI->setArgOperand(1, Constant::getNullValue(Ty));
-    Builder.Insert(NewI);
-    return Builder.CreateZExtOrTrunc(NewI, ValueOnZero->getType());
+    Builder->Insert(NewI);
+    return Builder->CreateZExtOrTrunc(NewI, ValueOnZero->getType());
   }
 
   return nullptr;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29081.85603.patch
Type: text/x-patch
Size: 954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170124/4ea45457/attachment.bin>


More information about the llvm-commits mailing list