[llvm-commits] [llvm] r55292 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/fold-call-2.ll

Bill Wendling isanbard at gmail.com
Sun Aug 24 14:45:55 PDT 2008


Evan,

I think that this patch was causing a bootstrap failure:

/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/xgcc  
-B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./gcc/ - 
B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386- 
apple-darwin9.4.0/bin/ -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/ 
build/llvm-gcc.install/i386-apple-darwin9.4.0/lib/ -isystem /Volumes/ 
Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple- 
darwin9.4.0/include -isystem /Volumes/Sandbox/Buildbot/llvm/full-llvm/ 
build/llvm-gcc.install/i386-apple-darwin9.4.0/sys-include -c - 
DHAVE_CONFIG_H -O2 -g -O2   -m64 -I. -I../../../../llvm-gcc.src/ 
libiberty/../include  -W -Wall -pedantic -Wwrite-strings -Wstrict- 
prototypes -Wc++-compat ../../../../llvm-gcc.src/libiberty/make-temp- 
file.c -o make-temp-file.o
Assertion failed: (Node2Index[SU->NodeNum] > Node2Index[I->Dep- 
 >NodeNum] && "Wrong topological sorting"), function  
InitDAGTopologicalSorting, file /Volumes/Sandbox/Buildbot/llvm/full- 
llvm/build/llvm.src/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp,  
line 508.
../../../../llvm-gcc.src/libiberty/hashtab.c:955: internal compiler  
error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[4]: *** [hashtab.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [multi-do] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-target-libiberty] Error 2
make: *** [all] Error 2

I temporarily reverted it.

-bw

On Aug 24, 2008, at 12:19 PM, Evan Cheng wrote:

> Author: evancheng
> Date: Sun Aug 24 14:19:55 2008
> New Revision: 55292
>
> URL: http://llvm.org/viewvc/llvm-project?rev=55292&view=rev
> Log:
> Move callseq_start above the call address load to allow load to be  
> folded into the call node.
>
> Added:
>    llvm/trunk/test/CodeGen/X86/fold-call-2.ll
> Modified:
>    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
>
> Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=55292&r1=55291&r2=55292&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sun Aug 24  
> 14:19:55 2008
> @@ -1457,12 +1457,12 @@
>
> SDValue X86TargetLowering::LowerCALL(SDValue Op, SelectionDAG &DAG) {
>   MachineFunction &MF = DAG.getMachineFunction();
> -  SDValue Chain     = Op.getOperand(0);
> +  SDValue Chain       = Op.getOperand(0);
>   unsigned CC         = cast<ConstantSDNode>(Op.getOperand(1))- 
> >getValue();
>   bool isVarArg       = cast<ConstantSDNode>(Op.getOperand(2))- 
> >getValue() != 0;
>   bool IsTailCall     = cast<ConstantSDNode>(Op.getOperand(3))- 
> >getValue() != 0
>                         && CC == CallingConv::Fast &&  
> PerformTailCallOpt;
> -  SDValue Callee    = Op.getOperand(4);
> +  SDValue Callee      = Op.getOperand(4);
>   bool Is64Bit        = Subtarget->is64Bit();
>   bool IsStructRet    = CallIsStructReturn(Op);
>
> @@ -1499,6 +1499,11 @@
>       MF.getInfo<X86MachineFunctionInfo>()- 
> >setTCReturnAddrDelta(FPDiff);
>   }
>
> +  // If the address is a load, i.e. indirect function call, move  
> callseq_start
> +  // above the load. This makes it possible for the load to fold  
> into the call.
> +  if (Callee.Val == Chain.Val && ISD::isNormalLoad(Callee.Val) &&
> +      Chain.hasOneUse() && Callee.hasOneUse())
> +    Chain = Chain.getOperand(0);
>   Chain = DAG.getCALLSEQ_START(Chain,  
> DAG.getIntPtrConstant(NumBytes));
>
>   SDValue RetAddrFrIdx;
>
> Added: llvm/trunk/test/CodeGen/X86/fold-call-2.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fold-call-2.ll?rev=55292&view=auto
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/test/CodeGen/X86/fold-call-2.ll (added)
> +++ llvm/trunk/test/CodeGen/X86/fold-call-2.ll Sun Aug 24 14:19:55  
> 2008
> @@ -0,0 +1,10 @@
> +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | grep mov |  
> count 1
> +
> + at f = external global void ()*		; <void ()**> [#uses=1]
> +
> +define i32 @main() nounwind {
> +entry:
> +	load void ()** @f, align 8		; <void ()*>:0 [#uses=1]
> +	tail call void %0( ) nounwind
> +	ret i32 0
> +}
>
>
> _______________________________________________
> 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