[llvm-commits] [llvm] r160724 - /llvm/trunk/lib/Target/X86/X86FastISel.cpp
Matt Beaumont-Gay
matthewbg at google.com
Wed Jul 25 08:15:25 PDT 2012
On Wed, Jul 25, 2012 at 6:35 AM, Rafael Espindola <
rafael.espindola at gmail.com> wrote:
> Author: rafael
> Date: Wed Jul 25 08:35:45 2012
> New Revision: 160724
>
> URL: http://llvm.org/viewvc/llvm-project?rev=160724&view=rev
> Log:
> Factor a long list of conditions into a predicate function. No
> functionality
> change.
>
> Modified:
> llvm/trunk/lib/Target/X86/X86FastISel.cpp
>
> Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=160724&r1=160723&r2=160724&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Wed Jul 25 08:35:45 2012
> @@ -1516,6 +1516,20 @@
> return DoSelectCall(I, 0);
> }
>
> +static unsigned computeBytesPopedByCalle(const X86Subtarget &Subtarget,
>
Spelling: "Popped", "Callee"
> + const ImmutableCallSite &CS) {
> + if (Subtarget.is64Bit())
> + return 0;
> + if (Subtarget.isTargetWindows())
> + return 0;
> + CallingConv::ID CC = CS.getCallingConv();
> + if (CC == CallingConv::Fast || CC == CallingConv::GHC)
> + return 0;
> + if (!CS.paramHasAttr(1, Attribute::StructRet))
> + return 0;
> + return 4;
> +}
> +
> // Select either a call, or an llvm.memcpy/memmove/memset intrinsic
> bool X86FastISel::DoSelectCall(const Instruction *I, const char
> *MemIntName) {
> const CallInst *CI = cast<CallInst>(I);
> @@ -1862,12 +1876,7 @@
>
> // Issue CALLSEQ_END
> unsigned AdjStackUp = TII.getCallFrameDestroyOpcode();
> - unsigned NumBytesCallee = 0;
> - if (!Subtarget->is64Bit() && !Subtarget->isTargetWindows() &&
> - !(CS.getCallingConv() == CallingConv::Fast ||
> - CS.getCallingConv() == CallingConv::GHC) &&
> - CS.paramHasAttr(1, Attribute::StructRet))
> - NumBytesCallee = 4;
> + const unsigned NumBytesCallee = computeBytesPopedByCalle(*Subtarget,
> CS);
> BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(AdjStackUp))
> .addImm(NumBytes).addImm(NumBytesCallee);
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120725/2414b10b/attachment.html>
More information about the llvm-commits
mailing list