[LLVMdev] eliminateCallFramePseudoInstr belongs in TargetRegisterInfo or TargetFrameLowering

Eli Bendersky eliben at google.com
Tue Feb 19 12:31:07 PST 2013


Hi all,

I ran into this while trying to figure out why the X86
getSUBriOpcode/getADDriOpcode functions are duplicated, appearing once
in X86RegisterInfo.cpp and once in X86FrameLowering.cpp,

The method TargetRegisterInfo::eliminateCallFramePseudoInstr doesn't
appear to really belong in this interface. It adds instructions into
the MachineFunction given to it, which isn't what TargetRegisterInfo
is supposed to do.

ISTM that eliminateCallFramePseudoInstr belongs in
TargerFrameLowering, since it's being used during prolog/epilog
insertion. Moving it there would avoid the code duplication and
possibly other layering problems.

What do you think

Eli

P.S. I'm asking in llvmdev before proposing an actual patch because
this change will affect all targets.

P.S.2 Alas, TargetFrameLowering is not documented in
http://llvm.org/docs/CodeGenerator.html



More information about the llvm-dev mailing list