Hi Preston, <div><br /></div><div>The test cases are really big. Is there a way to make them smaller and still be able to test the reloading optimization ?</div><div><br /></div><div>Thanks,</div><div>Nadav</div><div><br /><br /><span>On 03/27/13, <b class="name">Preston Gurd </b> <preston.gurd@intel.com> wrote:</span><blockquote cite="mid:20130327231619.4FE0C2A6C029@llvm.org" class="iwcQuote" style="border-left: 1px solid #00F; padding-left: 13px; margin-left: 0;" type="cite"><div class="mimepart text plain">Author: pgurd<br />Date: Wed Mar 27 18:16:18 2013<br />New Revision: 178193<br /><br />URL: <a href="http://llvm.org/viewvc/llvm-project?rev=178193&view=rev" target="l">http://llvm.org/viewvc/llvm-project?rev=178193&view=rev</a><br />Log:<br />This patch follows is a follow up to r178171, which uses the register <br />form of call in preference to memory indirect on Atom.<br /><br />In this case, the patch applies the optimization to the code for reloading<br />spilled registers.<br /><br />The patch also includes changes to sibcall.ll and movgs.ll, which were<br />failing on the Atom buildbot after the first patch was applied.<br /><br />This patch by Sriram Murali.<br /><br /><br />Added:<br />    llvm/trunk/test/CodeGen/X86/atom-call-reg-indirect-foldedreload32.ll<br />    llvm/trunk/test/CodeGen/X86/atom-call-reg-indirect-foldedreload64.ll<br />Modified:<br />    llvm/trunk/lib/Target/X86/X86InstrInfo.cpp<br />    llvm/trunk/test/CodeGen/X86/movgs.ll<br />    llvm/trunk/test/CodeGen/X86/sibcall.ll<br /><br />Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp<br />URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=178193&r1=178192&r2=178193&view=diff" target="l">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=178193&r1=178192&r2=178193&view=diff</a><br />==============================================================================<br />--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)<br />+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Wed Mar 27 18:16:18 2013<br />@@ -3655,7 +3655,16 @@ X86InstrInfo::foldMemoryOperandImpl(Mach<br />                                     const SmallVectorImpl<MachineOperand> &MOs,<br />                                     unsigned Size, unsigned Align) const {<br />   const DenseMap<unsigned, std::pair<unsigned,unsigned> > *OpcodeTablePtr = 0;<br />+  bool isCallRegIndirect = TM.getSubtarget<X86Subtarget>().callRegIndirect();<br />   bool isTwoAddrFold = false;<br />+<br />+  // Atom favors register form of call. So, we do not fold loads into calls<br />+  // when X86Subtarget is Atom.<br />+  if (isCallRegIndirect &&<br />+    (MI->getOpcode() == X86::CALL32r || MI->getOpcode() == X86::CALL64r)) {<br />+    return NULL;<br />+  }<br />+<br />   unsigned NumOps = MI->getDesc().getNumOperands();<br />   bool isTwoAddr = NumOps > 1 &&<br />     MI->getDesc().getOperandConstraint(1, MCOI::TIED_TO) != -1;<br /><br />Added: llvm/trunk/test/CodeGen/X86/atom-call-reg-indirect-foldedreload32.ll<br />URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/atom-call-reg-indirect-foldedreload32.ll?rev=178193&view=auto" target="l">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/atom-call-reg-indirect-foldedreload32.ll?rev=178193&view=auto</a><br />==============================================================================<br />--- llvm/trunk/test/CodeGen/X86/atom-call-reg-indirect-foldedreload32.ll (added)<br />+++ llvm/trunk/test/CodeGen/X86/atom-call-reg-indirect-foldedreload32.ll Wed Mar 27 18:16:18 2013<br />@@ -0,0 +1,204 @@<br />+; RUN: llc < %s -mtriple=i386-linux-gnu -mcpu=atom 2>&1 | \<br />+; RUN:     grep "calll" | not grep "("<br />+; RUN: llc < %s -mtriple=i386-linux-gnu -mcpu=core2 2>&1 | \<br />+; RUN:     grep "calll" | grep "4-byte Folded Reload"<br />+<br />+%struct.targettype = type {i32}<br />+%struct.op_ptr1 = type opaque<br />+%struct.op_ptr2 = type opaque<br />+%union.anon = type { [8 x i32], [48 x i8] }<br />+%struct.const1 = type { [64 x i16], i8 }<br />+%struct.const2 = type { [17 x i8], [256 x i8], i8 }<br />+<br />+%struct.ref1 = type { void (%struct.ref2*)*, i32 (%struct.ref2*)*, void (%struct.ref2*)*, i32 (%struct.ref2*, i8***)*, %struct.op_ptr2** }<br />+%struct.ref2 = type { %struct.localref13*, %struct.localref15*, %struct.localref12*, i8*, i8, i32, %struct.localref11*, i32, i32, i32, i32, i32, i32, i32, double, i8, i8, i32, i8, i8, i8, i32, i8, i32, i8, i8, i8, i32, i32, i32, i32, i32, i32, i8**, i32, i32, i32, i32, i32, [64 x i32]*, [4 x %struct.const1*], [4 x %struct.const2*], [4 x %struct.const2*], i32, %struct.ref3*, i8, i8, [16 x i8], [16 x i8], [16 x i8], i32, i8, i8, i8, i8, i16, i16, i8, i8, i8, %struct.localref10*, i32, i32, i32, i32, i8*, i32, [4 x %struct.ref3*], i32, i32, i32, [10 x i32], i32, i32, i32, i32, i32, %struct.localref8*, %struct.localref9*, %struct.ref1*, %struct.localref7*, %struct.localref6*, %struct.localref5*, %struct.localref1*, %struct.ref4*, %struct.localref2*, %struct.localref3*, %struct.localref4* }<br />+%struct.ref3 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i32, i32, i32, i32, i32, i32, %struct.const1*, i8* }<br />+%struct.ref4 = type { void (%struct.ref2*)*, [5 x void (%struct.ref2*, %struct.ref3*, i16*, i8**, i32)*] }<br />+<br />+%struct.localref1 = type { void (%struct.ref2*)*, i8 (%struct.ref2*, [64 x i16]**)*, i8 }<br />+%struct.localref2 = type { void (%struct.ref2*)*, void (%struct.ref2*, i8***, i32*, i32, i8**, i32*, i32)*, i8 }<br />+%struct.localref3 = type { void (%struct.ref2*)*, void (%struct.ref2*, i8***, i32, i8**, i32)* }<br />+%struct.localref4 = type { {}*, void (%struct.ref2*, i8**, i8**, i32)*, void (%struct.ref2*)*, void (%struct.ref2*)* }<br />+%struct.localref5 = type { void (%struct.ref2*)*, i32 (%struct.ref2*)*, i8 (%struct.ref2*)*, i8, i8, i32, i32 }<br />+%struct.localref6 = type { i32 (%struct.ref2*)*, void (%struct.ref2*)*, void (%struct.ref2*)*, void (%struct.ref2*)*, i8, i8 }<br />+%struct.localref7 = type { void (%struct.ref2*, i32)*, void (%struct.ref2*, i8***, i32*, i32, i8**, i32*, i32)* }<br />+%struct.localref8 = type { void (%struct.ref2*)*, void (%struct.ref2*)*, i8 }<br />+%struct.localref9 = type { void (%struct.ref2*, i32)*, void (%struct.ref2*, i8**, i32*, i32)* }<br />+%struct.localref10 = type { %struct.localref10*, i8, i32, i32, i8* }<br />+%struct.localref11 = type { i8*, %struct.targettype, void (%struct.ref2*)*, i8 (%struct.ref2*)*, void (%struct.ref2*, %struct.targettype)*, i8 (%struct.ref2*, i32)*, void (%struct.ref2*)* }<br />+%struct.localref12 = type { {}*, %struct.targettype, %struct.targettype, i32, i32 }<br />+%struct.localref13 = type { void (%struct.localref14*)*, void (%struct.localref14*, i32)*, void (%struct.localref14*)*, void (%struct.localref14*, i8*)*, void (%struct.localref14*)*, i32, %union.anon, i32, %struct.targettype, i8**, i32, i8**, i32, i32 }<br />+%struct.localref14 = type { %struct.localref13*, %struct.localref15*, %struct.localref12*, i8*, i8, i32 }<br />+%struct.localref15 = type { i8* (%struct.localref14*, i32, %struct.targettype)*, i8* (%struct.localref14*, i32, %struct.targettype)*, i8** (%struct.localref14*, i32, i32, i32)*, [64 x i16]** (%struct.localref14*, i32, i32, i32)*, %struct.op_ptr1* (%struct.localref14*, i32, i8, i32, i32, i32)*, %struct.op_ptr2* (%struct.localref14*, i32, i8, i32, i32, i32)*, {}*, i8** (%struct.localref14*, %struct.op_ptr1*, i32, i32, i8)*, [64 x i16]** (%struct.localref14*, %struct.op_ptr2*, i32, i32, i8)*, void (%struct.localref14*, i32)*, {}*, %struct.targettype, %struct.targettype}<br />+<br />+define internal i32 @foldedreload(%struct.ref2* %cinfo, i8*** nocapture %output1) {<br />+  %1 = getelementptr inbounds %struct.ref2* %cinfo, i32 0, i32 79<br />+  %2 = load %struct.ref1** %1, align 4<br />+  %3 = getelementptr inbounds %struct.ref2* %cinfo, i32 0, i32 68<br />+  %4 = load i32* %3, align 4<br />+  %5 = add i32 %4, -1<br />+  %6 = getelementptr inbounds %struct.ref2* %cinfo, i32 0, i32 64<br />+  %7 = load i32* %6, align 4<br />+  %8 = add i32 %7, -1<br />+  %9 = getelementptr inbounds %struct.ref1* %2, i32 1, i32 1<br />+  %10 = bitcast i32 (%struct.ref2*)** %9 to i32*<br />+  %11 = load i32* %10, align 4<br />+  %12 = getelementptr inbounds %struct.ref1* %2, i32 1, i32 2<br />+  %13 = bitcast void (%struct.ref2*)** %12 to i32*<br />+  %14 = load i32* %13, align 4<br />+  %15 = icmp slt i32 %11, %14<br />+  br i1 %15, label %.lr.ph18, label %._crit_edge19<br />+<br />+.lr.ph18:<br />+  %16 = getelementptr inbounds %struct.ref1* %2, i32 1<br />+  %17 = bitcast %struct.ref1* %16 to i32*<br />+  %18 = getelementptr inbounds %struct.ref1* %16, i32 0, i32 0<br />+  %19 = getelementptr inbounds %struct.ref2* %cinfo, i32 0, i32 66<br />+  %20 = getelementptr inbounds %struct.ref2* %cinfo, i32 0, i32 84<br />+  %21 = getelementptr inbounds %struct.ref2* %cinfo, i32 0, i32 36<br />+  %22 = getelementptr inbounds %struct.ref1* %2, i32 1, i32 3<br />+  %23 = bitcast i32 (%struct.ref2*, i8***)** %22 to [10 x [64 x i16]*]*<br />+  %.pre = load i32* %17, align 4<br />+  br label %24<br />+<br />+; <label>:24<br />+  %25 = phi i32 [ %14, %.lr.ph18 ], [ %89, %88 ]<br />+  %26 = phi i32 [ %.pre, %.lr.ph18 ], [ 0, %88 ]<br />+  %var1.015 = phi i32 [ %11, %.lr.ph18 ], [ %90, %88 ]<br />+  %27 = icmp ugt i32 %26, %5<br />+  br i1 %27, label %88, label %.preheader7.lr.ph<br />+<br />+.preheader7.lr.ph:<br />+  %.pre24 = load i32* %19, align 4<br />+  br label %.preheader7<br />+<br />+.preheader7:<br />+  %28 = phi i32 [ %.pre24, %.preheader7.lr.ph ], [ %85, %._crit_edge11 ]<br />+  %var2.012 = phi i32 [ %26, %.preheader7.lr.ph ], [ %86, %._crit_edge11 ]<br />+  %29 = icmp sgt i32 %28, 0<br />+  br i1 %29, label %.lr.ph10, label %._crit_edge11<br />+<br />+.lr.ph10:<br />+  %30 = phi i32 [ %28, %.preheader7 ], [ %82, %81 ]<br />+  %var4.09 = phi i32 [ 0, %.preheader7 ], [ %var4.1.lcssa, %81 ]<br />+  %ci.08 = phi i32 [ 0, %.preheader7 ], [ %83, %81 ]<br />+  %31 = getelementptr inbounds %struct.ref2* %cinfo, i32 0, i32 67, i32 %ci.08<br />+  %32 = load %struct.ref3** %31, align 4<br />+  %33 = getelementptr inbounds %struct.ref3* %32, i32 0, i32 1<br />+  %34 = load i32* %33, align 4<br />+  %35 = load %struct.ref4** %20, align 4<br />+  %36 = getelementptr inbounds %struct.ref4* %35, i32 0, i32 1, i32 %34<br />+  %37 = load void (%struct.ref2*, %struct.ref3*, i16*, i8**, i32)** %36, align 4<br />+  %38 = getelementptr inbounds %struct.ref3* %32, i32 0, i32 17<br />+  %39 = load i32* %38, align 4<br />+  %40 = getelementptr inbounds %struct.ref3* %32, i32 0, i32 9<br />+  %41 = load i32* %40, align 4<br />+  %42 = getelementptr inbounds %struct.ref3* %32, i32 0, i32 16<br />+  %43 = load i32* %42, align 4<br />+  %44 = mul i32 %43, %var2.012<br />+  %45 = getelementptr inbounds %struct.ref3* %32, i32 0, i32 14<br />+  %46 = load i32* %45, align 4<br />+  %47 = icmp sgt i32 %46, 0<br />+  br i1 %47, label %.lr.ph6, label %81<br />+<br />+.lr.ph6:<br />+  %48 = getelementptr inbounds i8*** %output1, i32 %34<br />+  %49 = mul nsw i32 %41, %var1.015<br />+  %50 = load i8*** %48, align 4<br />+  %51 = getelementptr inbounds i8** %50, i32 %49<br />+  %52 = getelementptr inbounds %struct.ref3* %32, i32 0, i32 13<br />+  %53 = getelementptr inbounds %struct.ref3* %32, i32 0, i32 18<br />+  %54 = icmp sgt i32 %39, 0<br />+  br i1 %54, label %.lr.ph6.split.us, label %.lr.ph6..lr.ph6.split_crit_edge<br />+<br />+.lr.ph6..lr.ph6.split_crit_edge:<br />+  br label %._crit_edge26<br />+<br />+.lr.ph6.split.us:<br />+  %55 = phi i32 [ %63, %._crit_edge28 ], [ %46, %.lr.ph6 ]<br />+  %56 = phi i32 [ %64, %._crit_edge28 ], [ %41, %.lr.ph6 ]<br />+  %var4.15.us = phi i32 [ %66, %._crit_edge28 ], [ %var4.09, %.lr.ph6 ]<br />+  %output2.04.us = phi i8** [ %69, %._crit_edge28 ], [ %51, %.lr.ph6 ]<br />+  %var5.03.us = phi i32 [ %67, %._crit_edge28 ], [ 0, %.lr.ph6 ]<br />+  %57 = load i32* %21, align 4<br />+  %58 = icmp ult i32 %57, %8<br />+  br i1 %58, label %.lr.ph.us, label %59<br />+<br />+; <label>:59<br />+  %60 = add nsw i32 %var5.03.us, %var1.015<br />+  %61 = load i32* %53, align 4<br />+  %62 = icmp slt i32 %60, %61<br />+  br i1 %62, label %.lr.ph.us, label %._crit_edge27<br />+<br />+._crit_edge27:<br />+  %63 = phi i32 [ %.pre23.pre, %.loopexit.us ], [ %55, %59 ]<br />+  %64 = phi i32 [ %74, %.loopexit.us ], [ %56, %59 ]<br />+  %65 = load i32* %52, align 4<br />+  %66 = add nsw i32 %65, %var4.15.us<br />+  %67 = add nsw i32 %var5.03.us, 1<br />+  %68 = icmp slt i32 %67, %63<br />+  br i1 %68, label %._crit_edge28, label %._crit_edge<br />+<br />+._crit_edge28:<br />+  %69 = getelementptr inbounds i8** %output2.04.us, i32 %64<br />+  br label %.lr.ph6.split.us<br />+<br />+.lr.ph.us:<br />+  %var3.02.us = phi i32 [ %75, %.lr.ph.us ], [ %44, %.lr.ph6.split.us ], [ %44, %59 ]<br />+  %xindex.01.us = phi i32 [ %76, %.lr.ph.us ], [ 0, %.lr.ph6.split.us ], [ 0, %59 ]<br />+  %70 = add nsw i32 %xindex.01.us, %var4.15.us<br />+  %71 = getelementptr inbounds [10 x [64 x i16]*]* %23, i32 0, i32 %70<br />+  %72 = load [64 x i16]** %71, align 4<br />+  %73 = getelementptr inbounds [64 x i16]* %72, i32 0, i32 0<br />+  tail call void %37(%struct.ref2* %cinfo, %struct.ref3* %32, i16* %73, i8** %output2.04.us, i32 %var3.02.us) nounwind<br />+  %74 = load i32* %40, align 4<br />+  %75 = add i32 %74, %var3.02.us<br />+  %76 = add nsw i32 %xindex.01.us, 1<br />+  %exitcond = icmp eq i32 %76, %39<br />+  br i1 %exitcond, label %.loopexit.us, label %.lr.ph.us<br />+<br />+.loopexit.us:<br />+  %.pre23.pre = load i32* %45, align 4<br />+  br label %._crit_edge27<br />+<br />+._crit_edge26:<br />+  %var4.15 = phi i32 [ %var4.09, %.lr.ph6..lr.ph6.split_crit_edge ], [ %78, %._crit_edge26 ]<br />+  %var5.03 = phi i32 [ 0, %.lr.ph6..lr.ph6.split_crit_edge ], [ %79, %._crit_edge26 ]<br />+  %77 = load i32* %52, align 4<br />+  %78 = add nsw i32 %77, %var4.15<br />+  %79 = add nsw i32 %var5.03, 1<br />+  %80 = icmp slt i32 %79, %46<br />+  br i1 %80, label %._crit_edge26, label %._crit_edge<br />+<br />+._crit_edge:<br />+  %split = phi i32 [ %66, %._crit_edge27 ], [ %78, %._crit_edge26 ]<br />+  %.pre25 = load i32* %19, align 4<br />+  br label %81<br />+<br />+; <label>:81<br />+  %82 = phi i32 [ %.pre25, %._crit_edge ], [ %30, %.lr.ph10 ]<br />+  %var4.1.lcssa = phi i32 [ %split, %._crit_edge ], [ %var4.09, %.lr.ph10 ]<br />+  %83 = add nsw i32 %ci.08, 1<br />+  %84 = icmp slt i32 %83, %82<br />+  br i1 %84, label %.lr.ph10, label %._crit_edge11<br />+<br />+._crit_edge11:<br />+  %85 = phi i32 [ %28, %.preheader7 ], [ %82, %81 ]<br />+  %86 = add i32 %var2.012, 1<br />+  %87 = icmp ugt i32 %86, %5<br />+  br i1 %87, label %._crit_edge14, label %.preheader7<br />+<br />+._crit_edge14:<br />+  %.pre21 = load i32* %13, align 4<br />+  br label %88<br />+<br />+; <label>:88<br />+  %89 = phi i32 [ %.pre21, %._crit_edge14 ], [ %25, %24 ]<br />+  store void (%struct.ref2*)* null, void (%struct.ref2*)** %18, align 4<br />+  %90 = add nsw i32 %var1.015, 1<br />+  %91 = icmp slt i32 %90, %89<br />+  br i1 %91, label %24, label %._crit_edge19<br />+<br />+._crit_edge19:<br />+  ret i32 3<br />+}<br /><br />Added: llvm/trunk/test/CodeGen/X86/atom-call-reg-indirect-foldedreload64.ll<br />URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/atom-call-reg-indirect-foldedreload64.ll?rev=178193&view=auto" target="l">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/atom-call-reg-indirect-foldedreload64.ll?rev=178193&view=auto</a><br />==============================================================================<br />--- llvm/trunk/test/CodeGen/X86/atom-call-reg-indirect-foldedreload64.ll (added)<br />+++ llvm/trunk/test/CodeGen/X86/atom-call-reg-indirect-foldedreload64.ll Wed Mar 27 18:16:18 2013<br />@@ -0,0 +1,213 @@<br />+; RUN: llc < %s -mtriple=x86_64-linux-gnu -mcpu=atom 2>&1 | \<br />+; RUN:     grep "callq" | not grep "("<br />+; RUN: llc < %s -mtriple=x86_64-linux-gnu -mcpu=core2 2>&1 | \<br />+; RUN:     grep "callq" | grep "8-byte Folded Reload"<br />+<br />+%struct.targettype = type {i64}<br />+%struct.op_ptr1 = type opaque<br />+%struct.op_ptr2 = type opaque<br />+%union.anon = type { [8 x i32], [48 x i8] }<br />+%struct.const1 = type { [64 x i16], i8 }<br />+%struct.const2 = type { [17 x i8], [256 x i8], i8 }<br />+%struct.coef1 = type { %struct.ref1, i32, i32, i32, [10 x [64 x i16]*] }<br />+<br />+%struct.ref1 = type { void (%struct.ref2*)*, i32 (%struct.ref2*)*, void (%struct.ref2*)*, i32 (%struct.ref2*, i8***)*, %struct.op_ptr2** }<br />+%struct.ref2 = type { %struct.localref13*, %struct.localref15*, %struct.localref12*, i8*, i8, i32, %struct.localref11*, i32, i32, i32, i32, i32, i32, i32, double, i8, i8, i32, i8, i8, i8, i32, i8, i32, i8, i8, i8, i32, i32, i32, i32, i32, i32, i8**, i32, i32, i32, i32, i32, [64 x i32]*, [4 x %struct.const1*], [4 x %struct.const2*], [4 x %struct.const2*], i32, %struct.ref3*, i8, i8, [16 x i8], [16 x i8], [16 x i8], i32, i8, i8, i8, i8, i16, i16, i8, i8, i8, %struct.localref10*, i32, i32, i32, i32, i8*, i32, [4 x %struct.ref3*], i32, i32, i32, [10 x i32], i32, i32, i32, i32, i32, %struct.localref8*, %struct.localref9*, %struct.ref1*, %struct.localref7*, %struct.localref6*, %struct.localref5*, %struct.localref1*, %struct.ref4*, %struct.localref2*, %struct.localref3*, %struct.localref4* }<br />+%struct.ref3 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i32, i32, i32, i32, i32, i32, %struct.const1*, i8* }<br />+%struct.ref4 = type { void (%struct.ref2*)*, [5 x void (%struct.ref2*, %struct.ref3*, i16*, i8**, i32)*] }<br />+<br />+%struct.localref1 = type { void (%struct.ref2*)*, i8 (%struct.ref2*, [64 x i16]**)*, i8 }<br />+%struct.localref2 = type { void (%struct.ref2*)*, void (%struct.ref2*, i8***, i32*, i32, i8**, i32*, i32)*, i8 }<br />+%struct.localref3 = type { void (%struct.ref2*)*, void (%struct.ref2*, i8***, i32, i8**, i32)* }<br />+%struct.localref4 = type { {}*, void (%struct.ref2*, i8**, i8**, i32)*, void (%struct.ref2*)*, void (%struct.ref2*)* }<br />+%struct.localref5 = type { void (%struct.ref2*)*, i32 (%struct.ref2*)*, i8 (%struct.ref2*)*, i8, i8, i32, i32 }<br />+%struct.localref6 = type { i32 (%struct.ref2*)*, void (%struct.ref2*)*, void (%struct.ref2*)*, void (%struct.ref2*)*, i8, i8 }<br />+%struct.localref7 = type { void (%struct.ref2*, i32)*, void (%struct.ref2*, i8***, i32*, i32, i8**, i32*, i32)* }<br />+%struct.localref8 = type { void (%struct.ref2*)*, void (%struct.ref2*)*, i8 }<br />+%struct.localref9 = type { void (%struct.ref2*, i32)*, void (%struct.ref2*, i8**, i32*, i32)* }<br />+%struct.localref10 = type { %struct.localref10*, i8, i32, i32, i8* }<br />+%struct.localref11 = type { i8*, %struct.targettype, void (%struct.ref2*)*, i8 (%struct.ref2*)*, void (%struct.ref2*, %struct.targettype)*, i8 (%struct.ref2*, i32)*, void (%struct.ref2*)* }<br />+%struct.localref12 = type { {}*, %struct.targettype, %struct.targettype, i32, i32 }<br />+%struct.localref13 = type { void (%struct.localref14*)*, void (%struct.localref14*, i32)*, void (%struct.localref14*)*, void (%struct.localref14*, i8*)*, void (%struct.localref14*)*, i32, %union.anon, i32, %struct.targettype, i8**, i32, i8**, i32, i32 }<br />+%struct.localref14 = type { %struct.localref13*, %struct.localref15*, %struct.localref12*, i8*, i8, i32 }<br />+%struct.localref15 = type { i8* (%struct.localref14*, i32, %struct.targettype)*, i8* (%struct.localref14*, i32, %struct.targettype)*, i8** (%struct.localref14*, i32, i32, i32)*, [64 x i16]** (%struct.localref14*, i32, i32, i32)*, %struct.op_ptr1* (%struct.localref14*, i32, i8, i32, i32, i32)*, %struct.op_ptr2* (%struct.localref14*, i32, i8, i32, i32, i32)*, {}*, i8** (%struct.localref14*, %struct.op_ptr1*, i32, i32, i8)*, [64 x i16]** (%struct.localref14*, %struct.op_ptr2*, i32, i32, i8)*, void (%struct.localref14*, i32)*, {}*, %struct.targettype, %struct.targettype}<br />+<br />+define internal i32 @foldedreload(%struct.ref2* %cinfo, i8*** nocapture %output1) {<br />+  %1 = getelementptr inbounds %struct.ref2* %cinfo, i64 0, i32 79<br />+  %2 = load %struct.ref1** %1, align 8<br />+  %3 = bitcast %struct.ref1* %2 to %struct.coef1*<br />+  %4 = getelementptr inbounds %struct.ref2* %cinfo, i64 0, i32 68<br />+  %5 = load i32* %4, align 4<br />+  %6 = add i32 %5, -1<br />+  %7 = getelementptr inbounds %struct.ref2* %cinfo, i64 0, i32 64<br />+  %8 = load i32* %7, align 4<br />+  %9 = add i32 %8, -1<br />+  %10 = getelementptr inbounds %struct.coef1* %3, i64 0, i32 2<br />+  %11 = load i32* %10, align 4<br />+  %12 = getelementptr inbounds %struct.ref1* %2, i64 1, i32 1<br />+  %13 = bitcast i32 (%struct.ref2*)** %12 to i32*<br />+  %14 = load i32* %13, align 4<br />+  %15 = icmp slt i32 %11, %14<br />+  br i1 %15, label %.lr.ph18, label %._crit_edge19<br />+<br />+.lr.ph18:<br />+  %16 = getelementptr inbounds %struct.ref1* %2, i64 1<br />+  %17 = bitcast %struct.ref1* %16 to i32*<br />+  %18 = getelementptr inbounds %struct.ref2* %cinfo, i64 0, i32 66<br />+  %19 = getelementptr inbounds %struct.ref2* %cinfo, i64 0, i32 84<br />+  %20 = getelementptr inbounds %struct.ref2* %cinfo, i64 0, i32 36<br />+  %21 = getelementptr inbounds %struct.ref1* %2, i64 1, i32 2<br />+  %22 = bitcast void (%struct.ref2*)** %21 to [10 x [64 x i16]*]*<br />+  %.pre = load i32* %17, align 4<br />+  br label %23<br />+<br />+; <label>:23<br />+  %24 = phi i32 [ %14, %.lr.ph18 ], [ %92, %91 ]<br />+  %25 = phi i32 [ %.pre, %.lr.ph18 ], [ 0, %91 ]<br />+  %var1.015 = phi i32 [ %11, %.lr.ph18 ], [ %93, %91 ]<br />+  %26 = icmp ugt i32 %25, %6<br />+  br i1 %26, label %91, label %.preheader7.lr.ph<br />+<br />+.preheader7.lr.ph:<br />+  %.pre24 = load i32* %18, align 4<br />+  br label %.preheader7<br />+<br />+.preheader7:<br />+  %27 = phi i32 [ %.pre24, %.preheader7.lr.ph ], [ %88, %._crit_edge11 ]<br />+  %var2.012 = phi i32 [ %25, %.preheader7.lr.ph ], [ %89, %._crit_edge11 ]<br />+  %28 = icmp sgt i32 %27, 0<br />+  br i1 %28, label %.lr.ph10, label %._crit_edge11<br />+<br />+.lr.ph10:<br />+  %29 = phi i32 [ %27, %.preheader7 ], [ %85, %84 ]<br />+  %indvars.iv21 = phi i64 [ 0, %.preheader7 ], [ %indvars.iv.next22, %84 ]<br />+  %var4.09 = phi i32 [ 0, %.preheader7 ], [ %var4.1.lcssa, %84 ]<br />+  %30 = getelementptr inbounds %struct.ref2* %cinfo, i64 0, i32 67, i64 %indvars.iv21<br />+  %31 = load %struct.ref3** %30, align 8<br />+  %32 = getelementptr inbounds %struct.ref3* %31, i64 0, i32 1<br />+  %33 = load i32* %32, align 4<br />+  %34 = sext i32 %33 to i64<br />+  %35 = load %struct.ref4** %19, align 8<br />+  %36 = getelementptr inbounds %struct.ref4* %35, i64 0, i32 1, i64 %34<br />+  %37 = load void (%struct.ref2*, %struct.ref3*, i16*, i8**, i32)** %36, align 8<br />+  %38 = getelementptr inbounds %struct.ref3* %31, i64 0, i32 17<br />+  %39 = load i32* %38, align 4<br />+  %40 = getelementptr inbounds %struct.ref3* %31, i64 0, i32 9<br />+  %41 = load i32* %40, align 4<br />+  %42 = getelementptr inbounds %struct.ref3* %31, i64 0, i32 16<br />+  %43 = load i32* %42, align 4<br />+  %44 = mul i32 %43, %var2.012<br />+  %45 = getelementptr inbounds %struct.ref3* %31, i64 0, i32 14<br />+  %46 = load i32* %45, align 4<br />+  %47 = icmp sgt i32 %46, 0<br />+  br i1 %47, label %.lr.ph6, label %84<br />+<br />+.lr.ph6:<br />+  %48 = mul nsw i32 %41, %var1.015<br />+  %49 = getelementptr inbounds i8*** %output1, i64 %34<br />+  %50 = sext i32 %48 to i64<br />+  %51 = load i8*** %49, align 8<br />+  %52 = getelementptr inbounds i8** %51, i64 %50<br />+  %53 = getelementptr inbounds %struct.ref3* %31, i64 0, i32 13<br />+  %54 = getelementptr inbounds %struct.ref3* %31, i64 0, i32 18<br />+  %55 = icmp sgt i32 %39, 0<br />+  br i1 %55, label %.lr.ph6.split.us, label %.lr.ph6..lr.ph6.split_crit_edge<br />+<br />+.lr.ph6..lr.ph6.split_crit_edge:<br />+  br label %._crit_edge28<br />+<br />+.lr.ph6.split.us:<br />+  %56 = phi i32 [ %64, %._crit_edge30 ], [ %46, %.lr.ph6 ]<br />+  %57 = phi i32 [ %65, %._crit_edge30 ], [ %41, %.lr.ph6 ]<br />+  %var4.15.us = phi i32 [ %67, %._crit_edge30 ], [ %var4.09, %.lr.ph6 ]<br />+  %output2.04.us = phi i8** [ %71, %._crit_edge30 ], [ %52, %.lr.ph6 ]<br />+  %var5.03.us = phi i32 [ %68, %._crit_edge30 ], [ 0, %.lr.ph6 ]<br />+  %58 = load i32* %20, align 4<br />+  %59 = icmp ult i32 %58, %9<br />+  br i1 %59, label %.lr.ph.us, label %60<br />+<br />+; <label>:60<br />+  %61 = add nsw i32 %var5.03.us, %var1.015<br />+  %62 = load i32* %54, align 4<br />+  %63 = icmp slt i32 %61, %62<br />+  br i1 %63, label %.lr.ph.us, label %._crit_edge29<br />+<br />+._crit_edge29:<br />+  %64 = phi i32 [ %.pre25.pre, %.loopexit.us ], [ %56, %60 ]<br />+  %65 = phi i32 [ %77, %.loopexit.us ], [ %57, %60 ]<br />+  %66 = load i32* %53, align 4<br />+  %67 = add nsw i32 %66, %var4.15.us<br />+  %68 = add nsw i32 %var5.03.us, 1<br />+  %69 = icmp slt i32 %68, %64<br />+  br i1 %69, label %._crit_edge30, label %._crit_edge<br />+<br />+._crit_edge30:<br />+  %70 = sext i32 %65 to i64<br />+  %71 = getelementptr inbounds i8** %output2.04.us, i64 %70<br />+  br label %.lr.ph6.split.us<br />+<br />+; <label>:72<br />+  %indvars.iv = phi i64 [ 0, %.lr.ph.us ], [ %indvars.iv.next, %72 ]<br />+  %var3.02.us = phi i32 [ %44, %.lr.ph.us ], [ %78, %72 ]<br />+  %73 = add nsw i64 %indvars.iv, %79<br />+  %74 = getelementptr inbounds [10 x [64 x i16]*]* %22, i64 0, i64 %73<br />+  %75 = load [64 x i16]** %74, align 8<br />+  %76 = getelementptr inbounds [64 x i16]* %75, i64 0, i64 0<br />+  tail call void %37(%struct.ref2* %cinfo, %struct.ref3* %31, i16* %76, i8** %output2.04.us, i32 %var3.02.us) nounwind<br />+  %77 = load i32* %40, align 4<br />+  %78 = add i32 %77, %var3.02.us<br />+  %indvars.iv.next = add i64 %indvars.iv, 1<br />+  %lftr.wideiv = trunc i64 %indvars.iv.next to i32<br />+  %exitcond = icmp eq i32 %lftr.wideiv, %39<br />+  br i1 %exitcond, label %.loopexit.us, label %72<br />+<br />+.loopexit.us:<br />+  %.pre25.pre = load i32* %45, align 4<br />+  br label %._crit_edge29<br />+<br />+.lr.ph.us:<br />+  %79 = sext i32 %var4.15.us to i64<br />+  br label %72<br />+<br />+._crit_edge28:<br />+  %var4.15 = phi i32 [ %var4.09, %.lr.ph6..lr.ph6.split_crit_edge ], [ %81, %._crit_edge28 ]<br />+  %var5.03 = phi i32 [ 0, %.lr.ph6..lr.ph6.split_crit_edge ], [ %82, %._crit_edge28 ]<br />+  %80 = load i32* %53, align 4<br />+  %81 = add nsw i32 %80, %var4.15<br />+  %82 = add nsw i32 %var5.03, 1<br />+  %83 = icmp slt i32 %82, %46<br />+  br i1 %83, label %._crit_edge28, label %._crit_edge<br />+<br />+._crit_edge:<br />+  %split = phi i32 [ %67, %._crit_edge29 ], [ %81, %._crit_edge28 ]<br />+  %.pre27 = load i32* %18, align 4<br />+  br label %84<br />+<br />+; <label>:84<br />+  %85 = phi i32 [ %.pre27, %._crit_edge ], [ %29, %.lr.ph10 ]<br />+  %var4.1.lcssa = phi i32 [ %split, %._crit_edge ], [ %var4.09, %.lr.ph10 ]<br />+  %indvars.iv.next22 = add i64 %indvars.iv21, 1<br />+  %86 = trunc i64 %indvars.iv.next22 to i32<br />+  %87 = icmp slt i32 %86, %85<br />+  br i1 %87, label %.lr.ph10, label %._crit_edge11<br />+<br />+._crit_edge11:<br />+  %88 = phi i32 [ %27, %.preheader7 ], [ %85, %84 ]<br />+  %89 = add i32 %var2.012, 1<br />+  %90 = icmp ugt i32 %89, %6<br />+  br i1 %90, label %._crit_edge14, label %.preheader7<br />+<br />+._crit_edge14:<br />+  %.pre23 = load i32* %13, align 4<br />+  br label %91<br />+<br />+; <label>:91<br />+  %92 = phi i32 [ %.pre23, %._crit_edge14 ], [ %24, %23 ]<br />+  store i32 0, i32* %17, align 4<br />+  %93 = add nsw i32 %var1.015, 1<br />+  %94 = icmp slt i32 %93, %92<br />+  br i1 %94, label %23, label %._crit_edge19<br />+<br />+._crit_edge19:<br />+  ret i32 3<br />+}<br /><br />Modified: llvm/trunk/test/CodeGen/X86/movgs.ll<br />URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/movgs.ll?rev=178193&r1=178192&r2=178193&view=diff" target="l">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/movgs.ll?rev=178193&r1=178192&r2=178193&view=diff</a><br />==============================================================================<br />--- llvm/trunk/test/CodeGen/X86/movgs.ll (original)<br />+++ llvm/trunk/test/CodeGen/X86/movgs.ll Wed Mar 27 18:16:18 2013<br />@@ -1,6 +1,6 @@<br />-; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -mattr=sse41 | FileCheck %s --check-prefix=X32<br />-; RUN: llc < %s -mtriple=x86_64-linux -mattr=sse41 | FileCheck %s --check-prefix=X64<br />-; RUN: llc < %s -mtriple=x86_64-win32 -mattr=sse41 | FileCheck %s --check-prefix=X64<br />+; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -mcpu=penryn -mattr=sse41 | FileCheck %s --check-prefix=X32<br />+; RUN: llc < %s -mtriple=x86_64-linux -mcpu=penryn -mattr=sse41 | FileCheck %s --check-prefix=X64<br />+; RUN: llc < %s -mtriple=x86_64-win32 -mcpu=penryn -mattr=sse41 | FileCheck %s --check-prefix=X64<br /> <br /> define i32 @test1() nounwind readonly {<br /> entry:<br /><br />Modified: llvm/trunk/test/CodeGen/X86/sibcall.ll<br />URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sibcall.ll?rev=178193&r1=178192&r2=178193&view=diff" target="l">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sibcall.ll?rev=178193&r1=178192&r2=178193&view=diff</a><br />==============================================================================<br />--- llvm/trunk/test/CodeGen/X86/sibcall.ll (original)<br />+++ llvm/trunk/test/CodeGen/X86/sibcall.ll Wed Mar 27 18:16:18 2013<br />@@ -1,5 +1,5 @@<br />-; RUN: llc < %s -mtriple=i686-linux   -mattr=+sse2 -asm-verbose=false | FileCheck %s -check-prefix=32<br />-; RUN: llc < %s -mtriple=x86_64-linux -mattr=+sse2 -asm-verbose=false | FileCheck %s -check-prefix=64<br />+; RUN: llc < %s -mtriple=i686-linux   -mcpu=core2 -mattr=+sse2 -asm-verbose=false | FileCheck %s -check-prefix=32<br />+; RUN: llc < %s -mtriple=x86_64-linux -mcpu=core2 -mattr=+sse2 -asm-verbose=false | FileCheck %s -check-prefix=64<br /> <br /> define void @t1(i32 %x) nounwind ssp {<br /> entry:<br /><br /><br />_______________________________________________<br />llvm-commits mailing list<br />llvm-commits@cs.uiuc.edu<br /><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="l">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br /></div></blockquote></div>