From: Daniel Berlin Date: Sun, 12 Feb 2017 23:24:42 +0000 (+0000) Subject: NewGVN: Use shouldSwapOperands in one more place X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d4b68fb9a6dacdf751ade18d204210d43480f9aa;p=llvm NewGVN: Use shouldSwapOperands in one more place git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294925 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/NewGVN.cpp b/lib/Transforms/Scalar/NewGVN.cpp index 99203368664..25455c75b4e 100644 --- a/lib/Transforms/Scalar/NewGVN.cpp +++ b/lib/Transforms/Scalar/NewGVN.cpp @@ -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); }