[llvm] [llvm][AMDGPU] Implemented isProfitableToHoist and isFMAFasterThanFMulAndFAdd (PR #108756)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 15 07:15:01 PDT 2024


================
@@ -1000,6 +1031,33 @@ bool AMDGPUTargetLowering::isTruncateFree(Type *Source, Type *Dest) const {
   return DestSize < SrcSize && DestSize % 32 == 0;
 }
 
+/// Check if it is profitable to hoist instruction in then/else to if.
+/// Not profitable if I and it's user can form a FMA instruction
+/// because we prefer FMSUB/FMADD.
----------------
arsenm wrote:

Comments copied from AArch64

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


More information about the llvm-commits mailing list