OSDN Git Service

NewGVN: Use shouldSwapOperands in one more place
authorDaniel Berlin <dberlin@dberlin.org>
Sun, 12 Feb 2017 23:24:42 +0000 (23:24 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Sun, 12 Feb 2017 23:24:42 +0000 (23:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294925 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/NewGVN.cpp

index 9920336..25455c7 100644 (file)
@@ -571,7 +571,7 @@ const Expression *NewGVN::createExpression(Instruction *I) {
     // numbers.  Since all commutative instructions have two operands it is more
     // efficient to sort by hand rather than using, say, std::sort.
     assert(I->getNumOperands() == 2 && "Unsupported commutative instruction!");
-    if (E->getOperand(0) > E->getOperand(1))
+    if (shouldSwapOperands(E->getOperand(0), E->getOperand(1)))
       E->swapOperands(0, 1);
   }