NewGVN: Be consistent in what order we compare operands for swapping.

NFC.

llvm-svn: 296935
This commit is contained in:
Daniel Berlin 2017-03-04 00:44:43 +00:00
parent 49f0220086
commit 0350a87ce3
1 changed files with 2 additions and 2 deletions

View File

@ -1100,7 +1100,7 @@ const Expression *NewGVN::performSymbolicCmpEvaluation(Instruction *I) {
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::performSymbolicCmpEvaluation(Instruction *I) {
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();
}