Invalid base register with fast-isel
Ulrich Weigand
Ulrich.Weigand at de.ibm.com
Fri Jun 27 04:47:29 PDT 2014
Hal Finkel <hfinkel at anl.gov> wrote on 27.06.2014 13:07:32:
> > As far as I can see, that latter process took place long after
> > FastISel, and with FastISel having no oppportunity to influence
> > its choices ...
> >
> > Am I missing something here?
>
> You're right; but logically, the restriction does not belong on the
> output from materializeFrameBaseRegister. Can you constrain the
> register class on the store operand near the end of
> PPCRegisterInfo::eliminateFrameIndex?
Hmm, those instructions were not touched by eliminateFrameIndex
either :-)
LocalStackSlotPass::insertFrameReferenceRegisters allocates the
base register here:
BaseReg = Fn.getRegInfo().createVirtualRegister(RC);
It then calls:
// Tell the target to insert the instruction to initialize
// the base register.
// MachineBasicBlock::iterator InsertionPt = Entry->begin
();
TRI->materializeFrameBaseRegister(Entry, BaseReg, FrameIdx,
InstrOffset);
and finally:
// Modify the instruction to use the new base register rather
// than the frame index operand.
TRI->resolveFrameIndex(*I, BaseReg, Offset);
So I guess the only chance to constrain the register are either
materializeFrameBaseRegister or else resolveFrameIndex. Did you
mean to refer to the latter?
Bye,
Ulrich
More information about the llvm-commits
mailing list