diff options
author | Craig Topper <craig.topper@sifive.com> | 2023-12-05 10:33:44 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-05 10:33:44 -0800 |
commit | 5c3496ff33ce8e4cc6f8c18edd7ae5fc65d23fdf (patch) | |
tree | 7e58f0ddb3095a1329dcd2d7c12ebeff01274b69 /llvm/unittests/Analysis/ValueTrackingTest.cpp | |
parent | 3c5b42acd3e2022da40f6e4b50f5035279b8b93a (diff) | |
download | llvm-5c3496ff33ce8e4cc6f8c18edd7ae5fc65d23fdf.zip llvm-5c3496ff33ce8e4cc6f8c18edd7ae5fc65d23fdf.tar.gz llvm-5c3496ff33ce8e4cc6f8c18edd7ae5fc65d23fdf.tar.bz2 |
[InstCombine] Check isGuaranteedNotToBeUndef in haveNoCommonBitsSetSpecialCases. (#74390)
It's not safe for InstCombine to add disjoint metadata when converting
Add to Or otherwise.
I've added noundef attribute to preserve existing test behavior.
Diffstat (limited to 'llvm/unittests/Analysis/ValueTrackingTest.cpp')
-rw-r--r-- | llvm/unittests/Analysis/ValueTrackingTest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/unittests/Analysis/ValueTrackingTest.cpp b/llvm/unittests/Analysis/ValueTrackingTest.cpp index 1190550..0d3a594 100644 --- a/llvm/unittests/Analysis/ValueTrackingTest.cpp +++ b/llvm/unittests/Analysis/ValueTrackingTest.cpp @@ -2604,7 +2604,7 @@ TEST_F(ValueTrackingTest, HaveNoCommonBitsSet) { { // Check for an inverted mask: (X & ~M) op (Y & M). auto M = parseModule(R"( - define i32 @test(i32 %X, i32 %Y, i32 %M) { + define i32 @test(i32 %X, i32 %Y, i32 noundef %M) { %1 = xor i32 %M, -1 %LHS = and i32 %1, %X %RHS = and i32 %Y, %M @@ -2623,7 +2623,7 @@ TEST_F(ValueTrackingTest, HaveNoCommonBitsSet) { { // Check for (A & B) and ~(A | B) auto M = parseModule(R"( - define void @test(i32 %A, i32 %B) { + define void @test(i32 noundef %A, i32 noundef %B) { %LHS = and i32 %A, %B %or = or i32 %A, %B %RHS = xor i32 %or, -1 @@ -2651,7 +2651,7 @@ TEST_F(ValueTrackingTest, HaveNoCommonBitsSet) { { // Check for (A & B) and ~(A | B) in vector version auto M = parseModule(R"( - define void @test(<2 x i32> %A, <2 x i32> %B) { + define void @test(<2 x i32> noundef %A, <2 x i32> noundef %B) { %LHS = and <2 x i32> %A, %B %or = or <2 x i32> %A, %B %RHS = xor <2 x i32> %or, <i32 -1, i32 -1> |