[llvm-commits] [llvm-gcc-4.2] r44659 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Author: baldrick Date: Thu Dec 6 02:10:52 2007 New Revision: 44659 URL: http://llvm.org/viewvc/llvm-project?rev=44659&view=rev Log: Inspect the nounwind attribute rather than using the special fact that intrinsics cannot throw. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=44659&r1=44658&r2=44659&view=diff == --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Dec 6 02:10:52 2007 @@ -2307,36 +2307,36 @@ /// result, otherwise store it in DestLoc. Value *TreeToLLVM::EmitCallOf(Value *Callee, tree exp, const MemRef *DestLoc, const ParamAttrsList *PAL) { + if (!PAL && isa(Callee)) +PAL = cast(Callee)->getParamAttrs(); + // Determine if we need to generate an invoke instruction (instead of a simple // call) and if so, what the exception destination will be. BasicBlock *LandingPad = 0; - bool NoUnwind = false; - - // Do not turn intrinsic calls into invokes. - if (!isa(Callee) || !cast(Callee)->getIntrinsicID()) { -// Do not turn no-throw calls into invokes; mark them as "nounwind". -NoUnwind = !tree_could_throw_p(exp); - -if (!NoUnwind) { - int RegionNo = lookup_stmt_eh_region(exp); - - // Is the call contained in an exception handling region? - if (RegionNo > 0) { -// Are there any exception handlers for this region? -if (can_throw_internal_1(RegionNo, false)) { - // Turn the call into an invoke. - LandingPads.grow(RegionNo); - BasicBlock *&ThisPad = LandingPads[RegionNo]; - - // Create a landing pad if one didn't exist already. - if (!ThisPad) -ThisPad = new BasicBlock("lpad"); + bool NoUnwind = +(PAL && PAL->paramHasAttr(0, ParamAttr::NoUnwind)) || +!tree_could_throw_p(exp); + + // Do not turn nounwind calls into invokes. + if (!NoUnwind) { +int RegionNo = lookup_stmt_eh_region(exp); + +// Is the call contained in an exception handling region? +if (RegionNo > 0) { + // Are there any exception handlers for this region? + if (can_throw_internal_1(RegionNo, false)) { +// Turn the call into an invoke. +LandingPads.grow(RegionNo); +BasicBlock *&ThisPad = LandingPads[RegionNo]; + +// Create a landing pad if one didn't exist already. +if (!ThisPad) + ThisPad = new BasicBlock("lpad"); - LandingPad = ThisPad; -} else { - // Can this call unwind out of the current function? - NoUnwind = !can_throw_external_1(RegionNo, false); -} +LandingPad = ThisPad; + } else { +// Can this call unwind out of the current function? +NoUnwind = !can_throw_external_1(RegionNo, false); } } } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r44660 - in /llvm/trunk: lib/CodeGen/LiveIntervalAnalysis.cpp test/CodeGen/ARM/remat.ll test/CodeGen/X86/2007-08-13-SpillerReuse.ll test/CodeGen/X86/2007-11-30-TestLoadFolding.ll
Author: evancheng Date: Thu Dec 6 02:54:31 2007 New Revision: 44660 URL: http://llvm.org/viewvc/llvm-project?rev=44660&view=rev Log: Turning simple splitting on. Start testing new coalescer heuristics as new llcbeta. Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/test/CodeGen/ARM/remat.ll llvm/trunk/test/CodeGen/X86/2007-08-13-SpillerReuse.ll llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=44660&r1=44659&r2=44660&view=diff == --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Thu Dec 6 02:54:31 2007 @@ -42,7 +42,7 @@ cl::init(false), cl::Hidden); cl::opt SplitAtBB("split-intervals-at-bb", - cl::init(false), cl::Hidden); + cl::init(true), cl::Hidden); cl::opt SplitLimit("split-limit", cl::init(-1), cl::Hidden); } Modified: llvm/trunk/test/CodeGen/ARM/remat.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/remat.ll?rev=44660&r1=44659&r2=44660&view=diff == --- llvm/trunk/test/CodeGen/ARM/remat.ll (original) +++ llvm/trunk/test/CodeGen/ARM/remat.ll Thu Dec 6 02:54:31 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -stats -info-output-file - | grep "Number of re-materialization" | grep 5 +; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -stats -info-output-file - | grep "Number of re-materialization" | grep 3 %struct.CONTENTBOX = type { i32, i32, i32, i32, i32 } %struct.LOCBOX = type { i32, i32, i32, i32 } Modified: llvm/trunk/test/CodeGen/X86/2007-08-13-SpillerReuse.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-08-13-SpillerReuse.ll?rev=44660&r1=44659&r2=44660&view=diff == --- llvm/trunk/test/CodeGen/X86/2007-08-13-SpillerReuse.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-08-13-SpillerReuse.ll Thu Dec 6 02:54:31 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | grep "48(%esp)" | count 6 +; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | grep "48(%esp)" | count 5 %struct..0anon = type { i32 } %struct.rtvec_def = type { i32, [1 x %struct..0anon] } Modified: llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll?rev=44660&r1=44659&r2=44660&view=diff == --- llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-11-30-TestLoadFolding.ll Thu Dec 6 02:54:31 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -march=x86 -stats |& \ -; RUN: grep {2 .*folded into instructions} +; RUN: grep {1 .*folded into instructions} ; RUN: llvm-as < %s | llc -march=x86 | grep cmp | count 3 %struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [test-suite] r44660 - /test-suite/trunk/Makefile.programs
Author: evancheng Date: Thu Dec 6 02:54:31 2007 New Revision: 44660 URL: http://llvm.org/viewvc/llvm-project?rev=44660&view=rev Log: Turning simple splitting on. Start testing new coalescer heuristics as new llcbeta. Modified: test-suite/trunk/Makefile.programs Modified: test-suite/trunk/Makefile.programs URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=44660&r1=44659&r2=44660&view=diff == --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Thu Dec 6 02:54:31 2007 @@ -209,7 +209,7 @@ endif#DISABLE_DIFFS ifeq ($(ARCH),PowerPC) -LLCBETAOPTION := -split-intervals-at-bb +LLCBETAOPTION := -new-coalescer-heuristic=true #--enable-tail-merge #--enable-ppc-preinc #-regalloc=local -fast @@ -222,8 +222,7 @@ LLCBETAOPTION := -sched=simple endif ifeq ($(ARCH),x86) -LLCBETAOPTION := -split-intervals-at-bb -#-new-coalescer-heuristic=true +LLCBETAOPTION := -new-coalescer-heuristic=true #-tailcallopt #-regalloc=local -fast #-disable-rematerialization @@ -234,9 +233,8 @@ LLCBETAOPTION := -enable-sparc-v9-insts endif ifeq ($(ARCH),ARM) -LLCBETAOPTION := -split-intervals-at-bb +LLCBETAOPTION := -new-coalescer-heuristic=true #-disable-rematerialization -#-enable-arm-if-conversion #-march=thumb endif ifeq ($(ARCH),THUMB) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r44663 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Author: johannes Date: Thu Dec 6 11:53:31 2007 New Revision: 44663 URL: http://llvm.org/viewvc/llvm-project?rev=44663&view=rev Log: Redo previous patch so optimization only done for i1. Simpler and safer. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=44663&r1=44662&r2=44663&view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Dec 6 11:53:31 2007 @@ -2455,10 +2455,6 @@ MVT::ValueType VT = N->getValueType(0); MVT::ValueType VT0 = N0.getValueType(); - - // Some targets have SETCC types bigger than 1 bit, but do not set all the - // bits to 1; identified by getSetCCResultContents. Watch out for these. - // fold select C, X, X -> X if (N1 == N2) return N1; @@ -2483,22 +2479,14 @@ return DAG.getNode(ISD::TRUNCATE, VT, XORNode); } // fold select C, 0, X -> ~C & X - if (VT == VT0 && N1C && N1C->isNullValue() && - (N0.Val->getOpcode()!=ISD::SETCC || VT==MVT::i1 || - TLI.getSetCCResultContents()== - TargetLowering::ZeroOrNegativeOneSetCCResult)) { -SDOperand XORNode; -XORNode = DAG.getNode(ISD::XOR, VT, N0, DAG.getConstant(~0UL, VT)); + if (VT == VT0 && VT == MVT::i1 && N1C && N1C->isNullValue()) { +SDOperand XORNode = DAG.getNode(ISD::XOR, VT, N0, DAG.getConstant(1, VT)); AddToWorkList(XORNode.Val); return DAG.getNode(ISD::AND, VT, XORNode, N2); } // fold select C, X, 1 -> ~C | X - if (VT == VT0 && N2C && N2C->getValue() == 1 && - (N0.Val->getOpcode()!=ISD::SETCC || VT==MVT::i1 || - TLI.getSetCCResultContents()== - TargetLowering::ZeroOrNegativeOneSetCCResult)) { -SDOperand XORNode; -XORNode = DAG.getNode(ISD::XOR, VT, N0, DAG.getConstant(~0UL, VT)); + if (VT == VT0 && VT == MVT::i1 && N2C && N2C->getValue() == 1) { +SDOperand XORNode = DAG.getNode(ISD::XOR, VT, N0, DAG.getConstant(1, VT)); AddToWorkList(XORNode.Val); return DAG.getNode(ISD::OR, VT, XORNode, N1); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.2] r44667 - in /llvm-gcc-4.2/trunk: build_gcc driverdriver.c
Author: void Date: Thu Dec 6 16:10:02 2007 New Revision: 44667 URL: http://llvm.org/viewvc/llvm-project?rev=44667&view=rev Log: Hacked to link the drivers into the ${Fnord}/Developer/usr/bin directory. This isn't optimal, but gets around the hack we had of trying to find the correct driver... Modified: llvm-gcc-4.2/trunk/build_gcc llvm-gcc-4.2/trunk/driverdriver.c Modified: llvm-gcc-4.2/trunk/build_gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build_gcc?rev=44667&r1=44666&r2=44667&view=diff == --- llvm-gcc-4.2/trunk/build_gcc (original) +++ llvm-gcc-4.2/trunk/build_gcc Thu Dec 6 16:10:02 2007 @@ -372,7 +372,7 @@ $DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc || exit 1 # APPLE LOCAL LLVM build_gcc bug with non-/usr $DEST_ROOT lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS -create \ -$DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-llvm-g++ || exit 1 +$DIR/dst-*-$t/$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++ || exit 1 done # lib @@ -524,11 +524,17 @@ ln -s -f ../../../$DEST_ROOT/bin/llvm-gcc-$MAJ_VERS llvm-gcc-$MAJ_VERS || exit 1 ln -s -f ../../../$DEST_ROOT/bin/llvm-g++-$MAJ_VERS llvm-g++-$MAJ_VERS || exit 1 - # Copy one of the libllvmgcc.dylib's up to libexec/gcc. +# FIXME: This is a hack to get things working. +for h in $HOSTS ; do +ln -s -f ../../../$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS $h-apple-darwin$DARWIN_VERS-llvm-gcc-$MAJ_VERS || exit 1 +ln -s -f ../../../$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS $h-apple-darwin$DARWIN_VERS-llvm-g++-$MAJ_VERS || exit 1 +done + +# Copy one of the libllvmgcc.dylib's up to libexec/gcc. cp $DEST_DIR/$DEST_ROOT/libexec/gcc/$BUILD-apple-darwin$DARWIN_VERS/$VERS/libllvmgcc.dylib \ $DEST_DIR/$DEST_ROOT/libexec/gcc/ - # Replace the installed ones with symlinks to the common one. +# Replace the installed ones with symlinks to the common one. for t in $TARGETS ; do cd $DEST_DIR/$DEST_ROOT/libexec/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/ rm libllvmgcc.dylib Modified: llvm-gcc-4.2/trunk/driverdriver.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/driverdriver.c?rev=44667&r1=44666&r2=44667&view=diff == --- llvm-gcc-4.2/trunk/driverdriver.c (original) +++ llvm-gcc-4.2/trunk/driverdriver.c Thu Dec 6 16:10:02 2007 @@ -1253,6 +1253,7 @@ strncpy (curr_dir, argv[0], prefix_len); curr_dir[prefix_len] = '\0'; /* LLVM LOCAL begin - These drivers live in /.../usr/llvm-gcc-4.2/bin */ +#if 0 { size_t curr_dir_len = strlen (curr_dir); const char *llvm_bin_dir = "/usr/llvm-gcc-4.2/bin/"; @@ -1267,6 +1268,9 @@ } else driver_exec_prefix = curr_dir; } +#else + driver_exec_prefix = curr_dir; +#endif /* LLVM LOCAL end - These drivers live in /.../usr/llvm-gcc-4.2/bin */ #ifdef DEBUG @@ -1553,7 +1557,11 @@ final_cleanup (); free (curr_dir); + /* LLVM LOCAL - begin */ +#if 0 if (delete_prefix) free (driver_exec_prefix); +#endif + /* LLVM LOCAL - end */ return greatest_status; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r44668 - /llvm/trunk/test/CodeGen/X86/vec_set-2.ll
Author: evancheng Date: Thu Dec 6 16:12:45 2007 New Revision: 44668 URL: http://llvm.org/viewvc/llvm-project?rev=44668&view=rev Log: Fix a bogus test case. Modified: llvm/trunk/test/CodeGen/X86/vec_set-2.ll Modified: llvm/trunk/test/CodeGen/X86/vec_set-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_set-2.ll?rev=44668&r1=44667&r2=44668&view=diff == --- llvm/trunk/test/CodeGen/X86/vec_set-2.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_set-2.ll Thu Dec 6 16:12:45 2007 @@ -1,23 +1,19 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss | count 1 -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movd | count 1 +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movss | count 1 +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movd | count 1 -<4 x float> %test1(float %a) { - %tmp = insertelement <4 x float> zeroinitializer, float %a, uint 0 - %tmp5 = insertelement <4 x float> %tmp, float 0.00e+00, uint 1 - %tmp6 = insertelement <4 x float> %tmp5, float 0.00e+00, uint 2 - %tmp7 = insertelement <4 x float> %tmp6, float 0.00e+00, uint 3 +define <4 x float> @test1(float %a) { + %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 0 ; <<4 x float>> [#uses=1] + %tmp5 = insertelement <4 x float> %tmp, float 0.00e+00, i32 1 ; <<4 x float>> [#uses=1] + %tmp6 = insertelement <4 x float> %tmp5, float 0.00e+00, i32 2 ; <<4 x float>> [#uses=1] + %tmp7 = insertelement <4 x float> %tmp6, float 0.00e+00, i32 3 ; <<4 x float>> [#uses=1] ret <4 x float> %tmp7 } -<2 x long> %test(short %a) { - %tmp = insertelement <8 x short> zeroinitializer, short %a, uint 0 - %tmp6 = insertelement <8 x short> %tmp, short 0, uint 1 - %tmp8 = insertelement <8 x short> %tmp6, short 0, uint 2 - %tmp10 = insertelement <8 x short> %tmp8, short 0, uint 3 - %tmp12 = insertelement <8 x short> %tmp10, short 0, uint 4 - %tmp14 = insertelement <8 x short> %tmp12, short 0, uint 5 - %tmp16 = insertelement <8 x short> %tmp14, short 0, uint 6 - %tmp18 = insertelement <8 x short> %tmp16, short 0, uint 7 - %tmp19 = cast <8 x short> %tmp18 to <2 x long> - ret <2 x long> %tmp19 +define <2 x i64> @test(i32 %a) { + %tmp = insertelement <4 x i32> zeroinitializer, i32 %a, i32 0 ; <<8 x i16>> [#uses=1] + %tmp6 = insertelement <4 x i32> %tmp, i32 0, i32 1 ; <<8 x i32>> [#uses=1] + %tmp8 = insertelement <4 x i32> %tmp6, i32 0, i32 2 ; <<8 x i32>> [#uses=1] + %tmp10 = insertelement <4 x i32> %tmp8, i32 0, i32 3; <<8 x i32>> [#uses=1] + %tmp19 = bitcast <4 x i32> %tmp10 to <2 x i64> ; <<2 x i64>> [#uses=1] + ret <2 x i64> %tmp19 } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r44669 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86InstrSSE.td
Author: evancheng Date: Thu Dec 6 16:14:22 2007 New Revision: 44669 URL: http://llvm.org/viewvc/llvm-project?rev=44669&view=rev Log: Remove a bogus optimization. It's not possible to do a move to low element to a <8 x i16> or <16 x i8> vector. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=44669&r1=44668&r2=44669&view=diff == --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Dec 6 16:14:22 2007 @@ -2462,7 +2462,7 @@ /// specifies a shuffle of elements that is suitable for input to MOVSS, /// MOVSD, and MOVD, i.e. setting the lowest element. static bool isMOVLMask(const SDOperand *Elts, unsigned NumElts) { - if (NumElts != 2 && NumElts != 4 && NumElts != 8 && NumElts != 16) + if (NumElts != 2 && NumElts != 4) return false; if (!isUndefOrEqual(Elts[0], NumElts)) Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=44669&r1=44668&r2=44669&view=diff == --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Thu Dec 6 16:14:22 2007 @@ -2734,12 +2734,6 @@ // Move scalar to XMM zero-extended // movd to XMM register zero-extends let AddedComplexity = 15 in { -def : Pat<(v8i16 (vector_shuffle immAllZerosV_bc, - (v8i16 (X86s2vec GR32:$src)), MOVL_shuffle_mask)), - (MOVZDI2PDIrr GR32:$src)>, Requires<[HasSSE2]>; -def : Pat<(v16i8 (vector_shuffle immAllZerosV_bc, - (v16i8 (X86s2vec GR32:$src)), MOVL_shuffle_mask)), - (MOVZDI2PDIrr GR32:$src)>, Requires<[HasSSE2]>; // Zeroing a VR128 then do a MOVS{S|D} to the lower bits. def : Pat<(v2f64 (vector_shuffle immAllZerosV_bc, (v2f64 (scalar_to_vector FR64:$src)), MOVL_shuffle_mask)), ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r44671 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
Author: evancheng Date: Thu Dec 6 18:28:32 2007 New Revision: 44671 URL: http://llvm.org/viewvc/llvm-project?rev=44671&view=rev Log: Add an option to control this heuristic tweak so I can test it. Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=44671&r1=44670&r2=44671&view=diff == --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Thu Dec 6 18:28:32 2007 @@ -52,6 +52,11 @@ cl::desc("Use new coalescer heuristic"), cl::init(false)); + static cl::opt + ReMatSpillWeight("tweak-remat-spill-weight", + cl::desc("Tweak spill weight of re-materializable intervals"), + cl::init(true)); + RegisterPass X("simple-register-coalescing", "Simple Register Coalescing"); @@ -1487,7 +1492,7 @@ LI.weight = HUGE_VALF; else { bool isLoad = false; -if (li_->isReMaterializable(LI, isLoad)) { +if (ReMatSpillWeight && li_->isReMaterializable(LI, isLoad)) { // If all of the definitions of the interval are re-materializable, // it is a preferred candidate for spilling. If non of the defs are // loads, then it's potentially very cheap to re-materialize. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r44672 - /llvm/trunk/test/CodeGen/X86/2007-12-05-VectorShuffle.ll
Author: evancheng Date: Thu Dec 6 19:48:46 2007 New Revision: 44672 URL: http://llvm.org/viewvc/llvm-project?rev=44672&view=rev Log: New test case. Added: llvm/trunk/test/CodeGen/X86/2007-12-05-VectorShuffle.ll Added: llvm/trunk/test/CodeGen/X86/2007-12-05-VectorShuffle.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-12-05-VectorShuffle.ll?rev=44672&view=auto == --- llvm/trunk/test/CodeGen/X86/2007-12-05-VectorShuffle.ll (added) +++ llvm/trunk/test/CodeGen/X86/2007-12-05-VectorShuffle.ll Thu Dec 6 19:48:46 2007 @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 + +define void @test(<8 x i16>* %res, <8 x i16>* %A, <8 x i16>* %B) { + %tmp1 = load <8 x i16>* %A + %tmp2 = load <8 x i16>* %B + %tmp3 = shufflevector <8 x i16> %tmp1, <8 x i16> %tmp2, <8 x i32> < i32 8, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7 > + store <8 x i16> %tmp3, <8 x i16>* %res + ret void +} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r44643 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
On Dec 6, 2007, at 5:44 PM, Evan Cheng wrote: > > On Dec 5, 2007, at 4:08 PM, Chris Lattner wrote: > >> On Dec 5, 2007, at 3:58 PM, Evan Cheng wrote: >>> URL: http://llvm.org/viewvc/llvm-project?rev=44643&view=rev >>> Log: >>> If both result of the {s|z}xt and its source are live out, rewrite >>> all uses of the source with result of extension. >> >> I assume this is experimental, right? What sort of case does it >> fix? Testcase please :) > > It's experimental. I'll reduce some a test case when it's enabled. :-) ok -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r44643 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
On Dec 5, 2007, at 4:08 PM, Chris Lattner wrote: > On Dec 5, 2007, at 3:58 PM, Evan Cheng wrote: >> URL: http://llvm.org/viewvc/llvm-project?rev=44643&view=rev >> Log: >> If both result of the {s|z}xt and its source are live out, rewrite >> all uses of the source with result of extension. > > I assume this is experimental, right? What sort of case does it > fix? Testcase please :) It's experimental. I'll reduce some a test case when it's enabled. :-) Evan > > > -Chris > >> Modified: >>llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp >> >> Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/ >> Scalar/CodeGenPrepare.cpp?rev=44643&r1=44642&r2=44643&view=diff >> >> = >> = >> >> --- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) >> +++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Wed Dec 5 >> 17:58:20 2007 >> @@ -28,11 +28,17 @@ >> #include "llvm/Transforms/Utils/Local.h" >> #include "llvm/ADT/DenseMap.h" >> #include "llvm/ADT/SmallSet.h" >> -#include "llvm/Support/Debug.h" >> +#include "llvm/Support/CommandLine.h" >> #include "llvm/Support/Compiler.h" >> +#include "llvm/Support/Debug.h" >> #include "llvm/Support/GetElementPtrTypeIterator.h" >> using namespace llvm; >> >> +namespace { >> + cl::opt OptExtUses("optimize-ext-uses", >> + cl::init(false), cl::Hidden); >> +} >> + >> namespace { >> class VISIBILITY_HIDDEN CodeGenPrepare : public FunctionPass { >> /// TLI - Keep a pointer of a TargetLowering to consult for >> determining >> @@ -52,6 +58,7 @@ >> bool OptimizeLoadStoreInst(Instruction *I, Value *Addr, >>const Type *AccessTy, >>DenseMap &SunkAddrs); >> +bool OptimizeExtUses(Instruction *I); >> }; >> } >> >> @@ -913,6 +920,61 @@ >> return true; >> } >> >> +bool CodeGenPrepare::OptimizeExtUses(Instruction *I) { >> + BasicBlock *DefBB = I->getParent(); >> + >> + // If both result of the {s|z}xt and its source are live out, >> rewrite all >> + // other uses of the source with result of extension. >> + Value *Src = I->getOperand(0); >> + if (Src->hasOneUse()) >> +return false; >> + >> + bool DefIsLiveOut = false; >> + for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); >> + UI != E; ++UI) { >> +Instruction *User = cast(*UI); >> + >> +// Figure out which BB this ext is used in. >> +BasicBlock *UserBB = User->getParent(); >> +if (UserBB == DefBB) continue; >> +DefIsLiveOut = true; >> +break; >> + } >> + if (!DefIsLiveOut) >> +return false; >> + >> + // InsertedTruncs - Only insert one trunc in each block once. >> + DenseMap InsertedTruncs; >> + >> + bool MadeChange = false; >> + for (Value::use_iterator UI = Src->use_begin(), E = Src- >> >use_end(); >> + UI != E; ++UI) { >> +Use &TheUse = UI.getUse(); >> +Instruction *User = cast(*UI); >> + >> +// Figure out which BB this ext is used in. >> +BasicBlock *UserBB = User->getParent(); >> +if (UserBB == DefBB) continue; >> + >> +// Both src and def are live in this block. Rewrite the use. >> +Instruction *&InsertedTrunc = InsertedTruncs[UserBB]; >> + >> +if (!InsertedTrunc) { >> + BasicBlock::iterator InsertPt = UserBB->begin(); >> + while (isa(InsertPt)) ++InsertPt; >> + >> + InsertedTrunc = new TruncInst(I, Src->getType(), "", >> InsertPt); >> +} >> + >> +// Replace a use of the {s|z}ext source with a use of the >> result. >> +TheUse = InsertedTrunc; >> + >> +MadeChange = true; >> + } >> + >> + return MadeChange; >> +} >> + >> // In this pass we look for GEP and cast instructions that are used >> // across basic blocks and rewrite them to improve basic-block-at- >> a-time >> // selection. >> @@ -948,8 +1010,14 @@ >> if (isa(CI->getOperand(0))) >> continue; >> >> - if (TLI) >> -MadeChange |= OptimizeNoopCopyExpression(CI, *TLI); >> + bool Change = false; >> + if (TLI) { >> +Change = OptimizeNoopCopyExpression(CI, *TLI); >> +MadeChange |= Change; >> + } >> + >> + if (OptExtUses && !Change && (isa(I) || >> isa(I))) >> +MadeChange |= OptimizeExtUses(I); >> } else if (CmpInst *CI = dyn_cast(I)) { >> MadeChange |= OptimizeCmpExpression(CI); >> } else if (LoadInst *LI = dyn_cast(I)) { >> >> >> ___ >> llvm-commits mailing list >> llvm-commits@cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo
[llvm-commits] [llvm] r44674 - /llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h
Author: resistor Date: Thu Dec 6 22:04:55 2007 New Revision: 44674 URL: http://llvm.org/viewvc/llvm-project?rev=44674&view=rev Log: Fix a stupid error that Chris pointed out. Modified: llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h Modified: llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h?rev=44674&r1=44673&r2=44674&view=diff == --- llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h Thu Dec 6 22:04:55 2007 @@ -123,8 +123,6 @@ /// runOnFunction - Calculate the natural loop information. /// virtual bool runOnMachineFunction(MachineFunction &F); - - bool runOnFunction(Function& F) { return false; } virtual void releaseMemory() { LI->releaseMemory(); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.2] r44675 - /llvm-gcc-4.2/trunk/build_gcc
Author: dpatel Date: Thu Dec 6 23:30:06 2007 New Revision: 44675 URL: http://llvm.org/viewvc/llvm-project?rev=44675&view=rev Log: Fix broken links that point to assembler and linker. Modified: llvm-gcc-4.2/trunk/build_gcc Modified: llvm-gcc-4.2/trunk/build_gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build_gcc?rev=44675&r1=44674&r2=44675&view=diff == --- llvm-gcc-4.2/trunk/build_gcc (original) +++ llvm-gcc-4.2/trunk/build_gcc Thu Dec 6 23:30:06 2007 @@ -348,8 +348,9 @@ cp -p $DIR/dst-$BUILD-$t$DL/$f .$DL/$f || exit 1 fi done - ln -s ../../../../bin/as .$DL/as - ln -s ../../../../bin/ld .$DL/ld + # LLVM LOCAL fix broken link + ln -s ../../../../../bin/as .$DL/as + ln -s ../../../../../bin/ld .$DL/ld done # bin ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits