[llvm] [CodeGen][Spill2Reg] Initial patch (PR #118832)
Wei Xiao via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 25 04:50:02 PST 2024
================
@@ -10893,5 +10947,208 @@ void X86InstrInfo::getFrameIndexOperands(SmallVectorImpl<MachineOperand> &Ops,
M.getFullAddress(Ops);
}
+bool X86InstrInfo::isLegalToSpill2Reg(Register Reg,
+ const TargetRegisterInfo *TRI,
+ const MachineRegisterInfo *MRI) const {
+ // Skip instructions like `$k1 = KMOVWkm %stack.1` because replacing stack
+ // with xmm0 results in an illegal instruction `movq %k1, %xmm0`.
+ if (X86::VK16RegClass.contains(Reg))
+ return false;
+
+ switch (unsigned Bits = TRI->getRegSizeInBits(Reg, *MRI)) {
----------------
williamweixiao wrote:
Are "double" and "float" legal here?
https://github.com/llvm/llvm-project/pull/118832
More information about the llvm-commits
mailing list