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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 03:17:24 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:

It's really arbitrary operations. fmin/fmax are just of particular interest because we're stuck inserting canonicalizes in the lowering for them. The more I think about it, the more I think we'd better of making this a separate transform (but just moving this to selection patterns is a net improvement for now I think)

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


More information about the llvm-commits mailing list