[llvm] [AMDGPU] Fix canonicalization of truncated values. (PR #83054)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 03:20:23 PST 2024


================
@@ -3590,6 +3618,17 @@ FPMinMaxPat<Instruction minmaxInst, ValueType vt, SDPatternOperator min_or_max,
               DSTCLAMP.NONE, DSTOMOD.NONE)
 >;
 
+class
+FPMinCanonMaxPat<Instruction minmaxInst, ValueType vt, SDPatternOperator min_or_max,
+                 SDPatternOperator max_or_min_oneuse> : GCNPat <
+  (min_or_max (is_canonicalized_1<fcanonicalize>
----------------
arsenm wrote:

I'd only consider the min/max legalize case important. There's only a handful of canonicalizes in the math library, they aren't common (and I think we could avoid most of those too if we rewrote the code slightly)

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


More information about the llvm-commits mailing list