[llvm-commits] [llvm] r40472 - /llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
Evan Cheng
evan.cheng at apple.com
Wed Jul 25 23:49:20 PDT 2007
Hi Anton,
Can you add an entry to README.txt about this? Please explain it a
little bit because I have no idea what's going on here. :-)
Evan
On Jul 24, 2007, at 2:07 PM, Anton Korobeynikov wrote:
> Author: asl
> Date: Tue Jul 24 16:07:39 2007
> New Revision: 40472
>
> URL: http://llvm.org/viewvc/llvm-project?rev=40472&view=rev
> Log:
> Heal EH handling stuff by emitting correct offsets to callee-saved
> registers.
>
> Pretty hackish, but code itself is dirty mess, so we won't make
> anything worse. :)
>
> Modified:
> llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
>
> Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/
> X86RegisterInfo.cpp?rev=40472&r1=40471&r2=40472&view=diff
>
> ======================================================================
> ========
> --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Tue Jul 24
> 16:07:39 2007
> @@ -1297,9 +1297,21 @@
>
> // Add callee saved registers to move list.
> const std::vector<CalleeSavedInfo> &CSI = MFI-
> >getCalleeSavedInfo();
> - for (unsigned I = 0, E = CSI.size(); I != E; ++I) {
> +
> + // FIXME: This is dirty hack. The code itself is pretty mess
> right now.
> + // It should be rewritten from scratch and generalized sometimes.
> +
> + // Determine maximum offset (minumum due to stack growth)
> + int64_t MaxOffset = 0;
> + for (unsigned I = 0, E = CSI.size(); I!=E; ++I)
> + MaxOffset = std::min(MaxOffset,
> + MFI->getObjectOffset(CSI[I].getFrameIdx
> ()));
> +
> + // Calculate offsets
> + for (unsigned I = 0, E = CSI.size(); I!=E; ++I) {
> int64_t Offset = MFI->getObjectOffset(CSI[I].getFrameIdx());
> unsigned Reg = CSI[I].getReg();
> + Offset = (MaxOffset-Offset+3*stackGrowth);
> MachineLocation CSDst(MachineLocation::VirtualFP, Offset);
> MachineLocation CSSrc(Reg);
> Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc));
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list