Skip to content

Commit 1e471a1

Browse files
committed
X86: Remove LOW32_ADDR_ACCESS_RBPRegClass
This essentially reverts 86098ab. This was introduced for "ABIs like NaCl". Nacl support was recently removed in 0d2e11f. Based on the X86FrameLowering changes there, Is64Bit && TFI->Uses64BitFramePtr are not reachable conditions.
1 parent 3c01ac6 commit 1e471a1

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61512,8 +61512,7 @@ static bool isGRClass(const TargetRegisterClass &RC) {
6151261512
return RC.hasSuperClassEq(&X86::GR8RegClass) ||
6151361513
RC.hasSuperClassEq(&X86::GR16RegClass) ||
6151461514
RC.hasSuperClassEq(&X86::GR32RegClass) ||
61515-
RC.hasSuperClassEq(&X86::GR64RegClass) ||
61516-
RC.hasSuperClassEq(&X86::LOW32_ADDR_ACCESS_RBPRegClass);
61515+
RC.hasSuperClassEq(&X86::GR64RegClass);
6151761516
}
6151861517

6151961518
/// Check if \p RC is a vector register class.

llvm/lib/Target/X86/X86RegisterInfo.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,7 @@ X86RegisterInfo::getPointerRegClass(const MachineFunction &MF,
204204
// we can still use 64-bit register as long as we know the high bits
205205
// are zeros.
206206
// Reflect that in the returned register class.
207-
if (Is64Bit) {
208-
// When the target also allows 64-bit frame pointer and we do have a
209-
// frame, this is fine to use it for the address accesses as well.
210-
const X86FrameLowering *TFI = getFrameLowering(MF);
211-
return TFI->hasFP(MF) && TFI->Uses64BitFramePtr
212-
? &X86::LOW32_ADDR_ACCESS_RBPRegClass
213-
: &X86::LOW32_ADDR_ACCESSRegClass;
214-
}
215-
return &X86::GR32RegClass;
207+
return Is64Bit ? &X86::LOW32_ADDR_ACCESSRegClass : &X86::GR32RegClass;
216208
case 1: // Normal GPRs except the stack pointer (for encoding reasons).
217209
if (Subtarget.isTarget64BitLP64())
218210
return &X86::GR64_NOSPRegClass;

llvm/lib/Target/X86/X86RegisterInfo.td

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -716,13 +716,6 @@ def GR64_NOREX2_NOSP : RegisterClass<"X86", [i64], 64,
716716
// which we do not have right now.
717717
def LOW32_ADDR_ACCESS : RegisterClass<"X86", [i32], 32, (add GR32, RIP)>;
718718

719-
// When RBP is used as a base pointer in a 32-bit addresses environment,
720-
// this is also safe to use the full register to access addresses.
721-
// Since RBP will never be spilled, stick to a 32 alignment to save
722-
// on memory consumption.
723-
def LOW32_ADDR_ACCESS_RBP : RegisterClass<"X86", [i32], 32,
724-
(add LOW32_ADDR_ACCESS, RBP)>;
725-
726719
// A class to support the 'A' assembler constraint: [ER]AX then [ER]DX.
727720
def GR32_AD : RegisterClass<"X86", [i32], 32, (add EAX, EDX)>;
728721
def GR64_AD : RegisterClass<"X86", [i64], 64, (add RAX, RDX)>;

0 commit comments

Comments
 (0)