[llvm] [AMDGPU] Fix lowering of canonicalize when amdgpu-ieee is disabled (PR #175867)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 5 08:14:45 PST 2026


================
@@ -3603,15 +3603,36 @@ def : GCNPat<
   (V_PK_MUL_F16 0, (i32 CONST.FP16_ONE), $src_mods, $src, DSTCLAMP.NONE)
 >;
 
-def : GCNPat<
-  (fcanonicalize (f32 (VOP3Mods f32:$src, i32:$src_mods))),
-  (V_MUL_F32_e64 0, (i32 CONST.FP32_ONE), $src_mods, $src)
->;
 
-def : GCNPat<
-  (fcanonicalize (f32 (fneg (VOP3Mods f32:$src, i32:$src_mods)))),
-  (V_MUL_F32_e64 0, (i32 CONST.FP32_NEG_ONE), $src_mods, $src)
->;
+let OtherPredicates = [IEEEModeEnabled] in {
----------------
arsenm wrote:

It can lower to copy if nnan and the denormal mode is known IEEE 

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


More information about the llvm-commits mailing list