From: Daniel Berlin Date: Sun, 12 Feb 2017 22:02:20 +0000 (+0000) Subject: testing X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4aec1c9b8c2deb0d5290e9bc1eca4e7e4e53c62b;p=llvm testing git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294919 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/NewGVN.cpp b/lib/Transforms/Scalar/NewGVN.cpp index 47627937cfa..d95768216eb 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); } @@ -2425,6 +2425,7 @@ bool NewGVN::eliminateInstructions(Function &F) { // we will simplify an operation with all constants so that it doesn't matter // what order they appear in. unsigned int NewGVN::getRank(const Value *V) const { + assert(V && "What?"); if (isa(V)) return 0; else if (auto *A = dyn_cast(V))