[llvm-branch-commits] [llvm] [DAGCombiner][GlobalISel] Extend allMulUsesCanBeContracted with FNEG pattern (PR #188115)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Apr 8 04:07:02 PDT 2026
================
@@ -6328,6 +6329,17 @@ bool CombinerHelper::allMulUsesCanBeContracted(const MachineInstr &MI) const {
if (Opcode == TargetOpcode::G_FADD || Opcode == TargetOpcode::G_FSUB)
continue;
+ // G_FNEG use - contractable if all users of the fneg are G_FSUB.
----------------
arsenm wrote:
The amdgpu logic should be significantly more permissive with this. There's a parallel structure of fneg source modifier folds, so not sure how much this code should be aware of that.
If you loosen this to isFNegFree, does it help? Does that regress cases where the extra use is a store?
https://github.com/llvm/llvm-project/pull/188115
More information about the llvm-branch-commits
mailing list