[PATCH] D47922: unsigned foo(unsigned x, unsigned y) { return x > y && x != 0; } should fold to x > y

Li Jia He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 8 22:12:16 PDT 2018


HLJ2009 updated this revision to Diff 150607.
HLJ2009 added a comment.

Move the test file to https://reviews.llvm.org/D47972 for submission


Repository:
  rL LLVM

https://reviews.llvm.org/D47922

Files:
  lib/Analysis/InstructionSimplify.cpp


Index: lib/Analysis/InstructionSimplify.cpp
===================================================================
--- lib/Analysis/InstructionSimplify.cpp
+++ lib/Analysis/InstructionSimplify.cpp
@@ -1313,7 +1313,7 @@
       ICmpInst::isUnsigned(UnsignedPred))
     ;
   else if (match(UnsignedICmp,
-                 m_ICmp(UnsignedPred, m_Value(Y), m_Specific(X))) &&
+                 m_ICmp(UnsignedPred, m_Specific(Y), m_Value(X))) &&
            ICmpInst::isUnsigned(UnsignedPred))
     UnsignedPred = ICmpInst::getSwappedPredicate(UnsignedPred);
   else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47922.150607.patch
Type: text/x-patch
Size: 559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180609/e53881d3/attachment.bin>


More information about the llvm-commits mailing list