diff options
author | Nikita Popov <npopov@redhat.com> | 2025-07-04 09:16:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-04 09:16:28 +0200 |
commit | 1d5d1256487c1574e5a8addcf27983fd569966e5 (patch) | |
tree | 03f18119640464d423a78cfec310e70ed0eaa472 /llvm/unittests/Analysis/ValueTrackingTest.cpp | |
parent | 25bf90eaede41156e45f974c772e320758cbb3c8 (diff) | |
download | llvm-1d5d1256487c1574e5a8addcf27983fd569966e5.zip llvm-1d5d1256487c1574e5a8addcf27983fd569966e5.tar.gz llvm-1d5d1256487c1574e5a8addcf27983fd569966e5.tar.bz2 |
[ConstantFolding] Consolidate poison propagation for intrinsics (#146878)
This consolidates the "fold poison arg to poison result" constant
folding logic for intrinsics, based on a common
intrinsicPropagatesPoison() helper, which is also used for poison
propagation reasoning in ValueTracking. This ensures that the set of
supported intrinsics is consistent.
This add ucmp, scmp, smul.fix, smul.fix.sat, canonicalize and sqrt to
the intrinsicPropagatesPoison list, as these were handled by
ConstantFolding but not ValueTracking. The ctpop test is an example of
the converse, where it was handled by ValueTracking but not
ConstantFolding.
Diffstat (limited to 'llvm/unittests/Analysis/ValueTrackingTest.cpp')
-rw-r--r-- | llvm/unittests/Analysis/ValueTrackingTest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/unittests/Analysis/ValueTrackingTest.cpp b/llvm/unittests/Analysis/ValueTrackingTest.cpp index 129052f..e283591 100644 --- a/llvm/unittests/Analysis/ValueTrackingTest.cpp +++ b/llvm/unittests/Analysis/ValueTrackingTest.cpp @@ -910,7 +910,7 @@ TEST(ValueTracking, propagatesPoison) { {false, "call i32 @llvm.fshr.i32(i32 %x, i32 %y, i32 %shamt)", 0}, {false, "call i32 @llvm.fshr.i32(i32 %x, i32 %y, i32 %shamt)", 1}, {false, "call i32 @llvm.fshr.i32(i32 %x, i32 %y, i32 %shamt)", 2}, - {false, "call float @llvm.sqrt.f32(float %fx)", 0}, + {true, "call float @llvm.sqrt.f32(float %fx)", 0}, {false, "call float @llvm.powi.f32.i32(float %fx, i32 %x)", 0}, {false, "call float @llvm.sin.f32(float %fx)", 0}, {false, "call float @llvm.cos.f32(float %fx)", 0}, |