[PATCH] D18905: [ValueTracking] Improve isImpliedCondition for conditions with matching but swapped operands.
Chad Rosier via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 8 14:08:53 PDT 2016
mcrosier marked 3 inline comments as done.
mcrosier added a comment.
Thanks for the speedy feedback, Sanjoy!
================
Comment at: include/llvm/Analysis/ValueTracking.h:433
@@ +432,3 @@
+ /// Return true if RHS is known to be implied by LHS. The implication may be
+ /// either true or false depending on the value of ImpliedTrue.
+ /// A & B must be i1 (boolean) values or a vector of such values. Note that
----------------
I've updated everything to ImpliedTrue. Mind if I defer the second suggestion? :)
================
Comment at: lib/Analysis/ValueTracking.cpp:3796
@@ +3795,3 @@
+ }
+ }
+
----------------
You're absolutely correct. Thanks!!
================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:2733-2735
@@ -2730,3 +2732,5 @@
auto *OldCond = BI->getCondition();
- BI->setCondition(ConstantInt::getTrue(BB->getContext()));
+ ConstantInt *CI = ImpliedTrue ? ConstantInt::getTrue(BB->getContext())
+ : ConstantInt::getFalse(BB->getContext());
+ BI->setCondition(CI);
RecursivelyDeleteTriviallyDeadInstructions(OldCond);
----------------
cut-pasteo. Removed.
http://reviews.llvm.org/D18905
More information about the llvm-commits
mailing list