[llvm] [ConstantFolding] Add edge cases for llvm.log{, 2, 10} (PR #173304)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 23 13:05:24 PST 2025
================
@@ -214,22 +214,96 @@ entry:
ret float %1
}
+define float @test_intrinsic_log() {
+; CHECK-LABEL: @test_intrinsic_log(
+ %v = alloca <3 x float>
+ %f = alloca float
+
; log(0.0) -> -inf
-; Check that log instrinsics fold through cases where libc will throw an exception
-define float @test_intrinsic_log_zero() {
-; CHECK-LABEL: @test_intrinsic_log_zero(
; CHECK-NOT: call
-; CHECK: ret float 0xFFF0000000000000
+; CHECK: store float 0xFFF0000000000000
%1 = call float @llvm.log.f32(float 0.0)
+ store float %1, ptr %f
+
----------------
arsenm wrote:
Ugh that check should be removed or at least sunk, but sure leave it for later. Can still have the tests for it now though
https://github.com/llvm/llvm-project/pull/173304
More information about the llvm-commits
mailing list