[clang] [llvm] [ValueTracking] Add dominating condition support in computeKnownBits() (PR #73662)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 1 07:11:14 PST 2023


================
@@ -16,11 +16,15 @@ define i32 @test_asr(i32 %a, i32 %b) {
 ; CHECK-NEXT:    [[C:%.*]] = icmp slt i32 [[A]], 0
 ; CHECK-NEXT:    br i1 [[C]], label [[BB2:%.*]], label [[BB3:%.*]]
 ; CHECK:       bb2:
+; CHECK-NEXT:    [[NOT:%.*]] = xor i32 [[A]], -1
+; CHECK-NEXT:    [[D:%.*]] = lshr i32 [[NOT]], [[B]]
+; CHECK-NEXT:    [[NOT2:%.*]] = xor i32 [[D]], -1
----------------
nikic wrote:

Fixed by https://github.com/llvm/llvm-project/commit/faebb1b2e6891687e4f608b74205985ec78ade40.

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


More information about the cfe-commits mailing list