[llvm] [AMDGPU] Fix VOP3P NEG fold to check the use opcode, not the def (PR #219728)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 8 06:12:02 PDT 2026
================
@@ -5163,9 +5164,34 @@ calcNextStatus(std::pair<Register, SrcStatus> Curr,
return std::nullopt;
}
-/// This is used to control valid status that current MI supports. For example,
-/// non floating point intrinsic such as @llvm.amdgcn.sdot2 does not support NEG
-/// bit on VOP3P.
+/// Packed integer VOP3P opcodes ignore NEG/NEG_HI, so folding a G_FNEG into
+/// them would silently drop the negation.
+static bool usesFPSrcMods(const MachineInstr &MI) {
----------------
arsenm wrote:
I really don't like maintaining stuff like this, but the core was already here. This is code that has to predict what other code is going to do, it doesn't actually have the context of the selected instruction
https://github.com/llvm/llvm-project/pull/219728
More information about the llvm-commits
mailing list