[PATCH] D150556: [ValueTracking] Fix computeKnownFPClass with canonicalize
Piotr Sobczak via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 15 05:51:20 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7322d35476c3: [ValueTracking] Fix computeKnownFPClass with canonicalize (authored by piotr).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150556/new/
https://reviews.llvm.org/D150556
Files:
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Transforms/InstCombine/canonicalize.ll
Index: llvm/test/Transforms/InstCombine/canonicalize.ll
===================================================================
--- llvm/test/Transforms/InstCombine/canonicalize.ll
+++ llvm/test/Transforms/InstCombine/canonicalize.ll
@@ -457,5 +457,20 @@
ret i1 %cmp
}
+; --------------------------------------------------------------------
+; Others
+; --------------------------------------------------------------------
+
+; Regression test checking that the vector version of llvm.canonicalize works.
+define <2 x i1> @vec_canonicalize_with_fpclass(<2 x float> %x) {
+; CHECK-LABEL: @vec_canonicalize_with_fpclass(
+; CHECK-NEXT: ret <2 x i1> zeroinitializer
+;
+ %canon = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> %x)
+ %fpclass = call <2 x i1> @llvm.is.fpclass.v2f32(<2 x float> %canon, i32 1)
+ ret <2 x i1> %fpclass
+}
+
declare float @llvm.canonicalize.f32(float)
declare <2 x float> @llvm.canonicalize.v2f32(<2 x float>)
+declare <2 x i1> @llvm.is.fpclass.v2f32(<2 x float>, i32 immarg)
Index: llvm/lib/Analysis/ValueTracking.cpp
===================================================================
--- llvm/lib/Analysis/ValueTracking.cpp
+++ llvm/lib/Analysis/ValueTracking.cpp
@@ -4801,7 +4801,8 @@
// If the parent function flushes denormals, the canonical output cannot
// be a denormal.
- const fltSemantics &FPType = II->getType()->getFltSemantics();
+ const fltSemantics &FPType =
+ II->getType()->getScalarType()->getFltSemantics();
DenormalMode DenormMode = II->getFunction()->getDenormalMode(FPType);
if (DenormMode.inputsAreZero() || DenormMode.outputsAreZero())
Known.knownNot(fcSubnormal);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150556.522147.patch
Type: text/x-patch
Size: 1708 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230515/7b0a734f/attachment.bin>
More information about the llvm-commits
mailing list