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

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


================
@@ -2944,6 +2944,34 @@ def : GCNPat<
    (V_BFREV_B32_e64 (i32 (EXTRACT_SUBREG VReg_64:$a, sub1))), sub0,
    (V_BFREV_B32_e64 (i32 (EXTRACT_SUBREG VReg_64:$a, sub0))), sub1)>;
 
+// If fcanonicalize's operand is implicitly canonicalized, we only need a copy.
+let AddedComplexity = 1000 in {
+def : GCNPat<
+  (is_canonicalized_1<fcanonicalize> f16:$src),
----------------
arsenm wrote:

The PatFrag is what owns the predicate; it might be possible to define something using srcvalue as a way of getting a catch-all matcher with a predicate 

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


More information about the llvm-commits mailing list