Skip to content

Commit ce663b6

Browse files
[X86] Remove unnecessary casts (NFC) (#148395)
getRegisterInfo() already returns const X86RegisterInfo *.
1 parent 49e021c commit ce663b6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/X86/X86CallFrameOptimization.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ bool X86CallFrameOptimization::runOnMachineFunction(MachineFunction &MF) {
239239
TFL = STI->getFrameLowering();
240240
MRI = &MF.getRegInfo();
241241

242-
const X86RegisterInfo &RegInfo =
243-
*static_cast<const X86RegisterInfo *>(STI->getRegisterInfo());
242+
const X86RegisterInfo &RegInfo = *STI->getRegisterInfo();
244243
SlotSize = RegInfo.getSlotSize();
245244
assert(isPowerOf2_32(SlotSize) && "Expect power of 2 stack slot size");
246245
Log2SlotSize = Log2_32(SlotSize);
@@ -356,8 +355,7 @@ void X86CallFrameOptimization::collectCallInfo(MachineFunction &MF,
356355
CallContext &Context) {
357356
// Check that this particular call sequence is amenable to the
358357
// transformation.
359-
const X86RegisterInfo &RegInfo =
360-
*static_cast<const X86RegisterInfo *>(STI->getRegisterInfo());
358+
const X86RegisterInfo &RegInfo = *STI->getRegisterInfo();
361359

362360
// We expect to enter this at the beginning of a call sequence
363361
assert(I->getOpcode() == TII->getCallFrameSetupOpcode());

0 commit comments

Comments
 (0)