[llvm] InstCombine: SimplifyDemandedFPClass multiple use support for select (PR #175548)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 12 08:38:27 PST 2026
================
@@ -1098,13 +1098,11 @@ define nofpclass(nan inf nzero nsub nnorm) float @test_powr_issue64870_2(float n
; CHECK-LABEL: define nofpclass(nan inf nzero nsub nnorm) float @test_powr_issue64870_2
; CHECK-SAME: (float nofpclass(nan inf) [[ARG:%.*]], float nofpclass(nan inf) [[ARG1:%.*]]) {
; CHECK-NEXT: bb:
-; CHECK-NEXT: [[I:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
-; CHECK-NEXT: [[I2:%.*]] = select i1 [[I]], float 0x7FF8000000000000, float [[ARG]]
-; CHECK-NEXT: [[I3:%.*]] = tail call float @llvm.log2.f32(float noundef [[I2]])
+; CHECK-NEXT: [[I3:%.*]] = tail call float @llvm.log2.f32(float noundef [[ARG]])
; CHECK-NEXT: [[I5:%.*]] = fmul float [[ARG1]], [[I3]]
; CHECK-NEXT: [[I6:%.*]] = tail call noundef nofpclass(ninf nzero nsub nnorm) float @llvm.exp2.f32(float noundef [[I5]])
-; CHECK-NEXT: [[I10:%.*]] = fcmp oeq float [[I2]], 0.000000e+00
-; CHECK-NEXT: [[I12:%.*]] = select i1 [[I10]], float 0.000000e+00, float [[I6]]
+; CHECK-NEXT: [[TMP0:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
----------------
arsenm wrote:
The return is marked with nofpclass(nan), so any of the conditions that imply a select return of nan cannot be taken. The violation would result in poison
https://github.com/llvm/llvm-project/pull/175548
More information about the llvm-commits
mailing list