[llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 5 10:48:39 PDT 2024


================
@@ -2690,6 +2690,110 @@ entry:
   ret double %abs
 }
 
+define float @bitcast_to_float_sign_0(i32 %arg) {
+; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
+; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @bitcast_to_float_sign_0
+; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT:    [[TMP1:%.*]] = lshr i32 [[ARG]], 1
+; CHECK-NEXT:    [[TMP2:%.*]] = bitcast i32 [[TMP1]] to float
+; CHECK-NEXT:    ret float [[TMP2]]
+;
+  %1 = lshr i32 %arg, 1
----------------
AlexMaclean wrote:

Fixed.

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


More information about the llvm-commits mailing list