[llvm] [ConstraintElim] Refactor `checkCondition`. NFC. (PR #75319)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 03:13:58 PST 2023


================
@@ -1293,9 +1291,10 @@ static std::optional<bool> checkCondition(CmpInst *Cmp, ConstraintInfo &Info,
 
     LLVM_DEBUG({
       if (*ImpliedCondition) {
-        dbgs() << "Condition " << *Cmp;
+        dbgs() << "Condition " << CmpInst::getPredicateName(Pred) << " " << *A
----------------
nikic wrote:

ConstraintElim has a bunch of places trying to print an unpacked icmp. I'd suggest to extract a common function for this that uses the logic in https://github.com/llvm/llvm-project/blob/c321316c19b934ef33d0782ae7d8cb303593fca1/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp#L1245C5-L1247 (we should be using as-operand printing and omit the type on the second operand).

https://github.com/llvm/llvm-project/pull/75319


More information about the llvm-commits mailing list