1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00

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 943f4f8da8
commit 210d3e0b90

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();
}