[llvm-branch-commits] [llvm-branch] r127609 - in /llvm/branches/release_29: ./ lib/Transforms/InstCombine/InstCombineSelect.cpp test/Transforms/InstCombine/select.ll

Bill Wendling isanbard at gmail.com
Mon Mar 14 13:06:27 PDT 2011


Author: void
Date: Mon Mar 14 15:06:27 2011
New Revision: 127609

URL: http://llvm.org/viewvc/llvm-project?rev=127609&view=rev
Log:
--- Merging r127464 into '.':                                                 
U    test/Transforms/InstCombine/select.ll
U    lib/Transforms/InstCombine/InstCombineSelect.cpp


Modified:
    llvm/branches/release_29/   (props changed)
    llvm/branches/release_29/lib/Transforms/InstCombine/InstCombineSelect.cpp
    llvm/branches/release_29/test/Transforms/InstCombine/select.ll

Propchange: llvm/branches/release_29/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Mar 14 15:06:27 2011
@@ -1,2 +1,2 @@
 /llvm/branches/Apple/Pertwee:110850,110961
-/llvm/trunk:127263-127264,127298,127350-127351,127441
+/llvm/trunk:127263-127264,127298,127350-127351,127441,127464

Modified: llvm/branches/release_29/lib/Transforms/InstCombine/InstCombineSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_29/lib/Transforms/InstCombine/InstCombineSelect.cpp?rev=127609&r1=127608&r2=127609&view=diff
==============================================================================
--- llvm/branches/release_29/lib/Transforms/InstCombine/InstCombineSelect.cpp (original)
+++ llvm/branches/release_29/lib/Transforms/InstCombine/InstCombineSelect.cpp Mon Mar 14 15:06:27 2011
@@ -503,9 +503,8 @@
   if (!IC || !IC->isEquality())
     return 0;
 
-  if (ConstantInt *C = dyn_cast<ConstantInt>(IC->getOperand(1)))
-    if (!C->isZero())
-      return 0;
+  if (!match(IC->getOperand(1), m_Zero()))
+    return 0;
 
   ConstantInt *AndRHS;
   Value *LHS = IC->getOperand(0);

Modified: llvm/branches/release_29/test/Transforms/InstCombine/select.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_29/test/Transforms/InstCombine/select.ll?rev=127609&r1=127608&r2=127609&view=diff
==============================================================================
--- llvm/branches/release_29/test/Transforms/InstCombine/select.ll (original)
+++ llvm/branches/release_29/test/Transforms/InstCombine/select.ll Mon Mar 14 15:06:27 2011
@@ -714,3 +714,13 @@
   ret i32 %storemerge
 }
 
+; PR9454
+define i32 @test53(i32 %x) nounwind {
+  %and = and i32 %x, 2
+  %cmp = icmp eq i32 %and, %x
+  %sel = select i1 %cmp, i32 2, i32 1
+  ret i32 %sel
+; CHECK: @test53
+; CHECK: select i1 %cmp
+; CHECK: ret
+}





More information about the llvm-branch-commits mailing list