[llvm] r296935 - NewGVN: Be consistent in what order we compare operands for swapping.
Daniel Berlin via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 3 16:44:43 PST 2017
Author: dannyb
Date: Fri Mar 3 18:44:43 2017
New Revision: 296935
URL: http://llvm.org/viewvc/llvm-project?rev=296935&view=rev
Log:
NewGVN: Be consistent in what order we compare operands for swapping.
NFC.
Modified:
llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp?rev=296935&r1=296934&r2=296935&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Fri Mar 3 18:44:43 2017
@@ -1100,7 +1100,7 @@ const Expression *NewGVN::performSymboli
auto Op0 = lookupOperandLeader(CI->getOperand(0));
auto Op1 = lookupOperandLeader(CI->getOperand(1));
auto OurPredicate = CI->getPredicate();
- if (shouldSwapOperands(Op1, Op0)) {
+ if (shouldSwapOperands(Op0, Op1)) {
std::swap(Op0, Op1);
OurPredicate = CI->getSwappedPredicate();
}
@@ -1162,7 +1162,7 @@ const Expression *NewGVN::performSymboli
auto *BranchOp0 = lookupOperandLeader(BranchCond->getOperand(0));
auto *BranchOp1 = lookupOperandLeader(BranchCond->getOperand(1));
auto BranchPredicate = BranchCond->getPredicate();
- if (shouldSwapOperands(BranchOp1, BranchOp0)) {
+ if (shouldSwapOperands(BranchOp0, BranchOp1)) {
std::swap(BranchOp0, BranchOp1);
BranchPredicate = BranchCond->getSwappedPredicate();
}
More information about the llvm-commits
mailing list