[llvm] [X86] Prevent APX NDD compression when it creates a partial write (PR #132051)
Phoebe Wang via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 20 01:05:27 PDT 2025
================
@@ -237,6 +237,23 @@ static bool CompressEVEXImpl(MachineInstr &MI, const X86Subtarget &ST) {
return 0;
return I->NewOpc;
};
+
+ // Redundant NDD ops cannot be safely compressed if either:
+ // - the legacy op would introduce a partial write that BreakFalseDeps
+ // identified as a potential stall, or
+ // - the op is writing to a subregister of a live register, i.e. the
+ // full (zeroed) result is used.
+ // Both cases are indicated by an implicit def of the superregister.
+ if (IsRedundantNDD) {
+ Register Dst = MI.getOperand(0).getReg();
+ if (Dst &&
+ (X86::GR16RegClass.contains(Dst) || X86::GR8RegClass.contains(Dst))) {
+ Register Super = getX86SubSuperRegister(Dst, ST.is64Bit() ? 64 : 32);
----------------
phoebewang wrote:
No need to check `is64Bit()`, NDD only available under 64bit.
https://github.com/llvm/llvm-project/pull/132051
More information about the llvm-commits
mailing list