[llvm] [AMDGPU] Allow sinking of free vector ops (PR #109172)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 19 23:18:58 PDT 2024


================
@@ -6010,8 +6010,94 @@ bool AMDGPUTargetLowering::shouldSinkOperands(
     if (any_of(Ops, [&](Use *U) { return U->get() == Op.get(); }))
       continue;
 
+    // This helps using several modifiers (abs and neg) more often.
----------------
arsenm wrote:

Looking for all the free operations is already in TargetTransformInfo. I think all of these IR hooks in TargetLowering for CodeGenPrepare are for historical reasons. Can you try just moving it there, and checking for free costs? 

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


More information about the llvm-commits mailing list