[llvm] [CVP] Propagate constant range on icmp at use level (PR #73767)

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


================
@@ -50,10 +50,9 @@ exit:
 define void @test2(i32 %a) {
 ; CHECK-LABEL: @test2(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[CMP:%.*]] = icmp ugt i32 [[A:%.*]], -1
-; CHECK-NEXT:    br i1 [[CMP]], label [[BB:%.*]], label [[EXIT:%.*]]
+; CHECK-NEXT:    br i1 false, label [[BB:%.*]], label [[EXIT:%.*]]
----------------
nikic wrote:

This looks correct to me. It's just that LVI normally doesn't bother handling tautological comparisons at all, and the new implementation happens to handle them.

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


More information about the llvm-commits mailing list