[PATCH] D54359: [InstCombine] Remove a couple of asserts based on incorrect assumptions

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 13 11:26:53 PST 2018


craig.topper added inline comments.


================
Comment at: Transforms/InstCombine/InstCombineSelect.cpp:1823
             // Swap the metadata if the operands are swapped.
-            if (Swapped) {
-              assert(X == SI.getFalseValue() && Y == SI.getTrueValue() &&
-                     "Unexpected operands.");
+            if (Swapped)
               cast<SelectInst>(NewMinMax)->swapProfMetadata();
----------------
I think "Swapped" in the if should be replace with the condition from the assert "X == SI.getFalseValue() && Y == SI.getTrueValue()".   Which is what I had in the original patch that went up for review, but was asked to just use Swapped. Which was wrong I guess.


https://reviews.llvm.org/D54359





More information about the llvm-commits mailing list