Skip to content

Commit 2e7c26b

Browse files
committed
Merge 98042.
Don't try to fold V_SET0 and V_SETALLONES to loads in medium and large code models. llvm-svn: 98301
1 parent acd2efd commit 2e7c26b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/Target/X86/X86InstrInfo.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,6 +2525,11 @@ MachineInstr* X86InstrInfo::foldMemoryOperandImpl(MachineFunction &MF,
25252525
// Folding a V_SET0 or V_SETALLONES as a load, to ease register pressure.
25262526
// Create a constant-pool entry and operands to load from it.
25272527

2528+
// Medium and large mode can't fold loads this way.
2529+
if (TM.getCodeModel() != CodeModel::Small &&
2530+
TM.getCodeModel() != CodeModel::Kernel)
2531+
return NULL;
2532+
25282533
// x86-32 PIC requires a PIC base register for constant pools.
25292534
unsigned PICBase = 0;
25302535
if (TM.getRelocationModel() == Reloc::PIC_) {

0 commit comments

Comments
 (0)