From evan.cheng at apple.com Mon Sep 8 01:35:17 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 08 Sep 2008 06:35:17 -0000 Subject: [llvm-commits] [llvm] r55891 - /llvm/trunk/lib/Target/X86/X86FastISel.cpp Message-ID: <200809080635.m886ZIfZ007948@zion.cs.uiuc.edu> Author: evancheng Date: Mon Sep 8 01:35:17 2008 New Revision: 55891 URL: http://llvm.org/viewvc/llvm-project?rev=55891&view=rev Log: Add support to extend call operands when needed. Enable x86 fastisel call support. 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=55891&r1=55890&r2=55891&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Mon Sep 8 01:35:17 2008 @@ -70,6 +70,9 @@ bool X86FastEmitStore(MVT VT, unsigned Val, unsigned Ptr, unsigned Offset, Value *V); + + bool X86FastEmitExtend(ISD::NodeType Opc, MVT DstVT, unsigned Src, MVT SrcVT, + unsigned &ResultReg); bool X86SelectConstAddr(Value *V, unsigned &Op0, bool isCall = false); @@ -269,6 +272,16 @@ return true; } +/// X86FastEmitExtend - Emit a machine instruction to extend a value Src of +/// type SrcVT to type DstVT using the specified extension opcode Opc (e.g. +/// ISD::SIGN_EXTEND). +bool X86FastISel::X86FastEmitExtend(ISD::NodeType Opc, MVT DstVT, + unsigned Src, MVT SrcVT, + unsigned &ResultReg) { + ResultReg = FastEmit_r(SrcVT.getSimpleVT(), DstVT.getSimpleVT(), Opc, Src); + return ResultReg != 0; +} + /// X86SelectConstAddr - Select and emit code to materialize constant address. /// bool X86FastISel::X86SelectConstAddr(Value *V, unsigned &Op0, bool isCall) { @@ -300,18 +313,8 @@ /// X86SelectStore - Select and emit code to implement store instructions. bool X86FastISel::X86SelectStore(Instruction* I) { - MVT VT = MVT::getMVT(I->getOperand(0)->getType()); - if (VT == MVT::Other || !VT.isSimple()) - // Unhandled type. Halt "fast" selection and bail. - return false; - if (VT == MVT::iPTR) - // Use pointer type. - VT = TLI.getPointerTy(); - // We only handle legal types. For example, on x86-32 the instruction - // selector contains all of the 64-bit instructions from x86-64, - // under the assumption that i64 won't be used if the target doesn't - // support it. - if (!TLI.isTypeLegal(VT)) + MVT VT; + if (!isTypeLegal(I->getOperand(0)->getType(), TLI, VT)) return false; unsigned Val = getRegForValue(I->getOperand(0)); if (Val == 0) @@ -762,16 +765,28 @@ switch (VA.getLocInfo()) { default: assert(0 && "Unknown loc info!"); case CCValAssign::Full: break; - case CCValAssign::SExt: - abort(); // FIXME + case CCValAssign::SExt: { + bool Emitted = X86FastEmitExtend(ISD::SIGN_EXTEND, VA.getLocVT(), + Arg, ArgVT, Arg); + assert(Emitted && "Failed to emit a sext!"); + ArgVT = VA.getLocVT(); break; - case CCValAssign::ZExt: - abort(); + } + case CCValAssign::ZExt: { + bool Emitted = X86FastEmitExtend(ISD::ZERO_EXTEND, VA.getLocVT(), + Arg, ArgVT, Arg); + assert(Emitted && "Failed to emit a zext!"); + ArgVT = VA.getLocVT(); break; - case CCValAssign::AExt: - abort(); + } + case CCValAssign::AExt: { + bool Emitted = X86FastEmitExtend(ISD::ANY_EXTEND, VA.getLocVT(), + Arg, ArgVT, Arg); + assert(Emitted && "Failed to emit a aext!"); + ArgVT = VA.getLocVT(); break; } + } if (VA.isRegLoc()) { TargetRegisterClass* RC = TLI.getRegClassFor(ArgVT); @@ -802,10 +817,6 @@ BuildMI(MBB, TII.get(X86::ADJCALLSTACKUP)).addImm(NumBytes).addImm(0); // Now handle call return value (if any). -#if 0 // FIXME - bool isSExt = CS.paramHasAttr(0, ParamAttr::SExt); - bool isZExt = CS.paramHasAttr(0, ParamAttr::ZExt); -#endif if (RetVT.getSimpleVT() != MVT::isVoid) { SmallVector RVLocs; CCState CCInfo(CC, false, TM, RVLocs); @@ -870,10 +881,8 @@ return X86SelectZExt(I); case Instruction::Br: return X86SelectBranch(I); -#if 0 case Instruction::Call: return X86SelectCall(I); -#endif case Instruction::LShr: case Instruction::AShr: case Instruction::Shl: From evan.cheng at apple.com Mon Sep 8 02:01:30 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 8 Sep 2008 00:01:30 -0700 Subject: [llvm-commits] [llvm] r55872 - in /llvm/trunk: include/llvm/Analysis/CallGraph.h lib/Analysis/IPA/CallGraph.cpp lib/Transforms/IPO/PruneEH.cpp test/Transforms/PruneEH/2008-09-05-CGUpdate.ll In-Reply-To: <200809061719.m86HJXPM030861@zion.cs.uiuc.edu> References: <200809061719.m86HJXPM030861@zion.cs.uiuc.edu> Message-ID: Hi Duncan, This patch broke 447.dealII on Mac OS X / x86. /Users/echeng/LLVM/llvm/Release/bin/opt -std-compile-opts -time-passes -info-output-file=/Volumes/Vadar/LLVM/llvm/projects/llvm-test/External/ SPEC/CFP2006/447.dealII/Output/447.dealII.linked.bc.in\ fo Output/447.dealII.linked.rbc -o Output/447.dealII.linked.bc -f Assertion failed: (i && "Cannot find callsite to replace!"), function replaceCallSite, file CallGraph.cpp, line 326. 0 opt 0x003f37fc _ZN4llvm3sys18RemoveFileOnSignalERKNS0_4PathEPSs + 844^@ 1 libSystem.B.dylib 0x92a9809b _sigtramp + 43^@ 2 ??? 0xffffffff 0x0 + 4294967295^@ 3 libSystem.B.dylib 0x92b10ec2 raise + 26^@ 4 libSystem.B.dylib 0x92b2047f abort + 73^@ 5 libSystem.B.dylib 0x92b12063 __assert_rtn + 101^@ 6 opt 0x00226cf9 _ZN4llvm13CallGraphNode15replaceCallSiteENS_8CallSiteES1_ + 137^@ 7 opt 0x00046fca _ZN4llvm17createPruneEHPassEv + 3290^@ 8 opt 0x00047648 _ZN4llvm17createPruneEHPassEv + 4952^@ 9 opt 0x0022931a _ZN49_GLOBAL__N_CallGraphSCCPass .cpp_00000000_609D2F1513CGPassManager11runOnModuleERN4llvm6ModuleE + 730^@ 10 opt 0x00373829 _ZN4llvm13MPPassManager11runOnModuleERNS_6ModuleE + 409^@ 11 opt 0x00373b34 _ZN4llvm15PassManagerImpl3runERNS_6ModuleE + 132^@ 12 opt 0x00373bab _ZN4llvm11PassManager3runERNS_6ModuleE + 27^@ 13 opt 0x00009812 main + 2066^@ 14 opt 0x00002766 start + 54^@ make[1]: *** [Output/447.dealII.linked.bc] Abort trap I'll send you the test case in another email. Please take a look. Thanks. Evan On Sep 6, 2008, at 10:19 AM, Duncan Sands wrote: > Author: baldrick > Date: Sat Sep 6 12:19:29 2008 > New Revision: 55872 > > URL: http://llvm.org/viewvc/llvm-project?rev=55872&view=rev > Log: > When PruneEH turned an invoke into an ordinary > call (thus changing the call site) it didn't > inform the callgraph about this. But the > call site does matter - as shown by the testcase, > the callgraph become invalid after the inliner > ran (with an edge between two functions simply > missing), resulting in wrong deductions by > GlobalsModRef. > > Added: > llvm/trunk/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll > Modified: > llvm/trunk/include/llvm/Analysis/CallGraph.h > llvm/trunk/lib/Analysis/IPA/CallGraph.cpp > llvm/trunk/lib/Transforms/IPO/PruneEH.cpp > > Modified: llvm/trunk/include/llvm/Analysis/CallGraph.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CallGraph.h?rev=55872&r1=55871&r2=55872&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Analysis/CallGraph.h (original) > +++ llvm/trunk/include/llvm/Analysis/CallGraph.h Sat Sep 6 12:19:29 > 2008 > @@ -235,6 +235,11 @@ > /// removeCallEdgeTo, so it should not be used unless necessary. > void removeAnyCallEdgeTo(CallGraphNode *Callee); > > + /// replaceCallSite - Make the edge in the node for Old CallSite > be for > + /// New CallSite instead. Note that this method takes linear > time, so it > + /// should be used sparingly. > + void replaceCallSite(CallSite Old, CallSite New); > + > friend class CallGraph; > > // CallGraphNode ctor - Create a node for the specified function. > > Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=55872&r1=55871&r2=55872&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) > +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Sat Sep 6 12:19:29 2008 > @@ -297,7 +297,7 @@ > /// should be used sparingly. > void CallGraphNode::removeCallEdgeFor(CallSite CS) { > for (unsigned i = CalledFunctions.size(); ; --i) { > - assert(i && "Cannot find callee to remove!"); > + assert(i && "Cannot find callsite to remove!"); > if (CalledFunctions[i-1].first == CS) { > CalledFunctions.erase(CalledFunctions.begin()+i-1); > return; > @@ -318,5 +318,18 @@ > } > } > > +/// replaceCallSite - Make the edge in the node for Old CallSite be > for > +/// New CallSite instead. Note that this method takes linear time, > so it > +/// should be used sparingly. > +void CallGraphNode::replaceCallSite(CallSite Old, CallSite New) { > + for (unsigned i = CalledFunctions.size(); ; --i) { > + assert(i && "Cannot find callsite to replace!"); > + if (CalledFunctions[i-1].first == Old) { > + CalledFunctions[i-1].first = New; > + return; > + } > + } > +} > + > // Enuse that users of CallGraph.h also link with this file > DEFINING_FILE_FOR(CallGraph) > > Modified: llvm/trunk/lib/Transforms/IPO/PruneEH.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PruneEH.cpp?rev=55872&r1=55871&r2=55872&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/IPO/PruneEH.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/PruneEH.cpp Sat Sep 6 12:19:29 2008 > @@ -156,6 +156,9 @@ > // function if we have invokes to non-unwinding functions or code > after calls to > // no-return functions. > bool PruneEH::SimplifyFunction(Function *F) { > + CallGraph &CG = getAnalysis(); > + CallGraphNode *CGN = CG[F]; > + > bool MadeChange = false; > for (Function::iterator BB = F->begin(), E = F->end(); BB != E; + > +BB) { > if (InvokeInst *II = dyn_cast(BB->getTerminator())) > @@ -174,6 +177,9 @@ > BasicBlock *UnwindBlock = II->getUnwindDest(); > UnwindBlock->removePredecessor(II->getParent()); > > + // Fix up the call graph. > + CGN->replaceCallSite(II, Call); > + > // Insert a branch to the normal destination right before the > // invoke. > BranchInst::Create(II->getNormalDest(), II); > > Added: llvm/trunk/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll?rev=55872&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll (added) > +++ llvm/trunk/test/Transforms/PruneEH/2008-09-05-CGUpdate.ll Sat > Sep 6 12:19:29 2008 > @@ -0,0 +1,1438 @@ > +; RUN: llvm-as < %s | opt -prune-eh -inline -globalsmodref-aa - > markmodref | llvm-dis | not grep {define.*read} > + %struct.FRAME.ce3806g = type { %struct.string___XUB, > %struct.string___XUB, %struct.string___XUB, %struct.string___XUB } > + %struct.FRAME.ce3806g__fxio__put__4 = type { i32, i32, i32, > %struct.system__file_control_block__pstring*, i32, i32, i8 } > + %struct.RETURN = type { i8, i32 } > + %struct.ada__streams__root_stream_type = type > { %struct.ada__tags__dispatch_table* } > + %struct.ada__tags__dispatch_table = type { [1 x i32] } > + %struct.ada__tags__select_specific_data = type { i32, > %struct.ada__tags__select_specific_data_element } > + %struct.ada__tags__select_specific_data_element = type { i32, i8 } > + %struct.ada__tags__type_specific_data = type { i32, i32, > [2147483647 x i8]*, [2147483647 x i8]*, > %struct.ada__tags__dispatch_table*, i8, i32, i32, i32, i32, [2 x > %struct.ada__tags__dispatch_table*] } > + %struct.ada__text_io__text_afcb = type > { %struct.system__file_control_block__afcb, i32, i32, i32, i32, i32, > %struct.ada__text_io__text_afcb*, i8, i8 } > + %struct.exception = type { i8, i8, i32, i8*, i8*, i32, i8* } > + %struct.long_long_float___PAD = type { x86_fp80, [1 x i32] } > + %struct.string___XUB = type { i32, i32 } > + %struct.system__file_control_block__afcb = type > { %struct.ada__streams__root_stream_type, i32, > %struct.system__file_control_block__pstring, > %struct.system__file_control_block__pstring, i8, i8, i8, i8, i8, i8, > i8, %struct.system__file_control_block__afcb*, > %struct.system__file_control_block__afcb* } > + %struct.system__file_control_block__pstring = type { i8*, > %struct.string___XUB* } > + > %struct > .system__finalization_implementation__limited_record_controller = > type { %struct.system__finalization_root__root_controlled, > %struct.system__finalization_root__root_controlled* } > + %struct.system__finalization_implementation__record_controller = > type > { %struct > .system__finalization_implementation__limited_record_controller, i32 } > + %struct.system__finalization_root__empty_root_controlled = type > { %struct.ada__tags__dispatch_table* } > + %struct.system__finalization_root__root_controlled = type > { %struct.ada__streams__root_stream_type, > %struct.system__finalization_root__root_controlled*, > %struct.system__finalization_root__root_controlled* } > + %struct.system__secondary_stack__mark_id = type { i32, i32 } > + %struct.system__standard_library__exception_data = type { i8, i8, > i32, i32, %struct.system__standard_library__exception_data*, i32, > void ()* } > + at .str = internal constant [12 x i8] c"system.ads\00\00" ; <[12 x > i8]*> [#uses=1] > + at .str1 = internal constant [14 x i8] c"a-tifiio.adb\00\00" ; <[14 > x i8]*> [#uses=1] > + at system__soft_links__abort_undefer = external global void ()* ; > [#uses=6] > + at .str2 = internal constant [47 x i8] c"a-tifiio.adb:327 > instantiated at ce3806g.adb:52" ; <[47 x i8]*> [#uses=1] > + at C.354.2200 = internal constant %struct.string___XUB { i32 1, i32 > 47 } ; <%struct.string___XUB*> [#uses=1] > + at ada__io_exceptions__data_error = external global > %struct.exception ; <%struct.exception*> [#uses=1] > + at constraint_error = external global %struct.exception ; < > %struct.exception*> [#uses=2] > + at __gnat_all_others_value = external constant i32 ; [#uses=21] > + at .str3 = internal constant [10 x i8] c"0123456789" ; <[10 x i8]*> > [#uses=2] > + at ada__text_io__current_out = external global > %struct.ada__text_io__text_afcb* ; < > %struct.ada__text_io__text_afcb**> [#uses=1] > + at .str4 = internal constant [126 x i8] c"CHECK THAT FIXED_IO PUT > OPERATES ON FILES OF MODE OUT_FILE AND IF NO FILE IS SPECIFIED THE > CURRENT DEFAULT OUTPUT FILE IS USED" ; <[126 x i8]*> [#uses=1] > + at C.131.1559 = internal constant %struct.string___XUB { i32 1, i32 > 126 } ; <%struct.string___XUB*> [#uses=1] > + at .str5 = internal constant [7 x i8] c"CE3806G" ; <[7 x i8]*> > [#uses=1] > + at C.132.1562 = internal constant %struct.string___XUB { i32 1, i32 > 7 } ; <%struct.string___XUB*> [#uses=1] > + at incompleteF.1176.b = internal global i1 false ; [#uses=2] > + at incomplete.1177 = internal global %struct.exception { i8 0, i8 65, > i32 23, i8* getelementptr ([23 x i8]* @incompleteE.1174, i32 0, i32 > 0), i8* null, i32 0, i8* null } ; <%struct.exception*> [#uses=15] > + at incompleteE.1174 = internal global [23 x i8] > c"CE3806G.B_1.INCOMPLETE\00" ; <[23 x i8]*> [#uses=1] > + at .str6 = internal constant [0 x i8] zeroinitializer ; <[0 x i8]*> > [#uses=1] > + at C.136.1568 = internal constant %struct.string___XUB { i32 1, i32 > 0 } ; <%struct.string___XUB*> [#uses=1] > + at C.137.1571 = internal constant %struct.string___XUB { i32 1, i32 > 0 } ; <%struct.string___XUB*> [#uses=1] > + at .str7 = internal constant [50 x i8] c"USE_ERROR RAISED ON TEXT > CREATE WITH OUT_FILE MODE" ; <[50 x i8]*> [#uses=1] > + at C.139.1577 = internal constant %struct.string___XUB { i32 1, i32 > 50 } ; <%struct.string___XUB*> [#uses=1] > + at .str8 = internal constant [14 x i8] c"ce3806g.adb:65" ; <[14 x > i8]*> [#uses=1] > + at C.140.1580 = internal constant %struct.string___XUB { i32 1, i32 > 14 } ; <%struct.string___XUB*> [#uses=1] > + at .str9 = internal constant [51 x i8] c"NAME_ERROR RAISED ON TEXT > CREATE WITH OUT_FILE MODE" ; <[51 x i8]*> [#uses=1] > + at C.143.1585 = internal constant %struct.string___XUB { i32 1, i32 > 51 } ; <%struct.string___XUB*> [#uses=1] > + at .str10 = internal constant [14 x i8] c"ce3806g.adb:69" ; <[14 x > i8]*> [#uses=1] > + at C.144.1588 = internal constant %struct.string___XUB { i32 1, i32 > 14 } ; <%struct.string___XUB*> [#uses=1] > + at C.146.1592 = internal constant %struct.string___XUB { i32 1, i32 > 0 } ; <%struct.string___XUB*> [#uses=1] > + at C.147.1595 = internal constant %struct.string___XUB { i32 1, i32 > 0 } ; <%struct.string___XUB*> [#uses=1] > + at C.153.1609 = internal constant %struct.string___XUB { i32 1, i32 > 0 } ; <%struct.string___XUB*> [#uses=1] > + at C.154.1612 = internal constant %struct.string___XUB { i32 1, i32 > 0 } ; <%struct.string___XUB*> [#uses=1] > + at .str12 = internal constant [47 x i8] c"USE_ERROR RAISED ON TEXT > OPEN WITH IN_FILE MODE" ; <[47 x i8]*> [#uses=1] > + at C.156.1618 = internal constant %struct.string___XUB { i32 1, i32 > 47 } ; <%struct.string___XUB*> [#uses=1] > + at .str13 = internal constant [14 x i8] c"ce3806g.adb:88" ; <[14 x > i8]*> [#uses=1] > + at C.157.1621 = internal constant %struct.string___XUB { i32 1, i32 > 14 } ; <%struct.string___XUB*> [#uses=1] > + at C.159.1627 = internal constant %struct.string___XUB { i32 1, i32 > 0 } ; <%struct.string___XUB*> [#uses=1] > + at C.160.1630 = internal constant %struct.string___XUB { i32 1, i32 > 0 } ; <%struct.string___XUB*> [#uses=1] > + at .str14 = internal constant [33 x i8] c"VALUE INCORRECT - FIXED > FROM FILE" ; <[33 x i8]*> [#uses=1] > + at C.162.1637 = internal constant %struct.string___XUB { i32 1, i32 > 33 } ; <%struct.string___XUB*> [#uses=1] > + at .str15 = internal constant [36 x i8] c"VALUE INCORRECT - FIXED > FROM DEFAULT" ; <[36 x i8]*> [#uses=1] > + at C.164.1642 = internal constant %struct.string___XUB { i32 1, i32 > 36 } ; <%struct.string___XUB*> [#uses=1] > + at ada__io_exceptions__use_error = external global > %struct.exception ; <%struct.exception*> [#uses=4] > + at ada__io_exceptions__name_error = external global > %struct.exception ; <%struct.exception*> [#uses=2] > + > +define void @_ada_ce3806g() { > +entry: > + %0 = alloca %struct.system__file_control_block__pstring, align > 8 ; <%struct.system__file_control_block__pstring*> [#uses=3] > + %1 = alloca %struct.system__file_control_block__pstring, align > 8 ; <%struct.system__file_control_block__pstring*> [#uses=3] > + %2 = alloca %struct.system__file_control_block__pstring, align > 8 ; <%struct.system__file_control_block__pstring*> [#uses=3] > + %3 = alloca %struct.system__file_control_block__pstring, align > 8 ; <%struct.system__file_control_block__pstring*> [#uses=3] > + %FRAME.356 = alloca %struct.FRAME.ce3806g ; < > %struct.FRAME.ce3806g*> [#uses=20] > + call void @report__test( i8* getelementptr ([7 x i8]* @.str5, i32 > 0, i32 0), %struct.string___XUB* @C.132.1562, i8* getelementptr > ([126 x i8]* @.str4, i32 0, i32 0), %struct.string___XUB* @C. > 131.1559 ) > + %4 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 3 ; <%struct.string___XUB*> [#uses=1] > + call void @system__secondary_stack__ss_mark( %struct.string___XUB* > noalias sret %4 ) > + %.b = load i1* @incompleteF.1176.b ; [#uses=1] > + br i1 %.b, label %bb11, label %bb > + > +bb: ; preds = %entry > + invoke void > @system__exception_table__register_exception > ( %struct.system__standard_library__exception_data* bitcast > (%struct.exception* @incomplete.1177 to > %struct.system__standard_library__exception_data*) ) > + to label %invcont unwind label %lpad > + > +invcont: ; preds = %bb > + store i1 true, i1* @incompleteF.1176.b > + br label %bb11 > + > +bb11: ; preds = %entry, %invcont > + %5 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 2 ; <%struct.string___XUB*> [#uses=1] > + invoke void > @system__secondary_stack__ss_mark( %struct.string___XUB* noalias > sret %5 ) > + to label %invcont12 unwind label %lpad228 > + > +invcont12: ; preds = %bb11 > + invoke void > @report__legal_file_name > ( %struct.system__file_control_block__pstring* noalias sret %3, i32 > 1, i8* getelementptr ([0 x i8]* @.str6, i32 0, i32 0), > %struct.string___XUB* @C.137.1571 ) > + to label %invcont17 unwind label %lpad232 > + > +invcont17: ; preds = %invcont12 > + %elt18 = getelementptr > %struct.system__file_control_block__pstring* %3, i32 0, i32 0 ; > [#uses=1] > + %val19 = load i8** %elt18, align 8 ; [#uses=1] > + %elt20 = getelementptr > %struct.system__file_control_block__pstring* %3, i32 0, i32 1 ; < > %struct.string___XUB**> [#uses=1] > + %val21 = load %struct.string___XUB** %elt20 ; < > %struct.string___XUB*> [#uses=1] > + %6 = invoke %struct.ada__text_io__text_afcb* > @ada__text_io__create( %struct.ada__text_io__text_afcb* null, i8 2, > i8* %val19, %struct.string___XUB* %val21, i8* getelementptr ([0 x > i8]* @.str6, i32 0, i32 0), %struct.string___XUB* @C.136.1568 ) > + to label %invcont26 unwind label %lpad232 ; < > %struct.ada__text_io__text_afcb*> [#uses=2] > + > +invcont26: ; preds = %invcont17 > + %7 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 2, i32 0 ; [#uses=1] > + %8 = load i32* %7, align 8 ; [#uses=1] > + %9 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 2, i32 1 ; [#uses=1] > + %10 = load i32* %9, align 4 ; [#uses=1] > + invoke void @system__secondary_stack__ss_release( i32 %8, i32 %10 ) > + to label %bb73 unwind label %lpad228 > + > +bb32: ; preds = %lpad232 > + call void @__gnat_begin_handler( i8* %eh_ptr233 ) nounwind > + %11 = load void ()** @system__soft_links__abort_undefer, align > 4 ; [#uses=1] > + invoke void %11( ) > + to label %invcont33 unwind label %lpad240 > + > +invcont33: ; preds = %bb32 > + invoke void @report__not_applicable( i8* getelementptr ([50 x i8]* > @.str7, i32 0, i32 0), %struct.string___XUB* @C.139.1577 ) > + to label %invcont38 unwind label %lpad240 > + > +invcont38: ; preds = %invcont33 > + invoke void > @__gnat_raise_exception > ( %struct.system__standard_library__exception_data* bitcast > (%struct.exception* @incomplete.1177 to > %struct.system__standard_library__exception_data*), i8* > getelementptr ([14 x i8]* @.str8, i32 0, i32 0), > %struct.string___XUB* @C.140.1580 ) noreturn > + to label %invcont43 unwind label %lpad240 > + > +invcont43: ; preds = %invcont38 > + unreachable > + > +bb47: ; preds = %ppad291 > + call void @__gnat_begin_handler( i8* %eh_ptr233 ) nounwind > + %12 = load void ()** @system__soft_links__abort_undefer, align > 4 ; [#uses=1] > + invoke void %12( ) > + to label %invcont49 unwind label %lpad248 > + > +invcont49: ; preds = %bb47 > + invoke void @report__not_applicable( i8* getelementptr ([51 x i8]* > @.str9, i32 0, i32 0), %struct.string___XUB* @C.143.1585 ) > + to label %invcont54 unwind label %lpad248 > + > +invcont54: ; preds = %invcont49 > + invoke void > @__gnat_raise_exception > ( %struct.system__standard_library__exception_data* bitcast > (%struct.exception* @incomplete.1177 to > %struct.system__standard_library__exception_data*), i8* > getelementptr ([14 x i8]* @.str10, i32 0, i32 0), > %struct.string___XUB* @C.144.1588 ) noreturn > + to label %invcont59 unwind label %lpad248 > + > +invcont59: ; preds = %invcont54 > + unreachable > + > +bb73: ; preds = %invcont26 > + invoke void > @report__legal_file_name > ( %struct.system__file_control_block__pstring* noalias sret %2, i32 > 2, i8* getelementptr ([0 x i8]* @.str6, i32 0, i32 0), > %struct.string___XUB* @C.147.1595 ) > + to label %invcont78 unwind label %lpad228 > + > +invcont78: ; preds = %bb73 > + %elt79 = getelementptr > %struct.system__file_control_block__pstring* %2, i32 0, i32 0 ; > [#uses=1] > + %val80 = load i8** %elt79, align 8 ; [#uses=1] > + %elt81 = getelementptr > %struct.system__file_control_block__pstring* %2, i32 0, i32 1 ; < > %struct.string___XUB**> [#uses=1] > + %val82 = load %struct.string___XUB** %elt81 ; < > %struct.string___XUB*> [#uses=1] > + %13 = invoke %struct.ada__text_io__text_afcb* > @ada__text_io__create( %struct.ada__text_io__text_afcb* null, i8 2, > i8* %val80, %struct.string___XUB* %val82, i8* getelementptr ([0 x > i8]* @.str6, i32 0, i32 0), %struct.string___XUB* @C.146.1592 ) > + to label %invcont87 unwind label %lpad228 ; < > %struct.ada__text_io__text_afcb*> [#uses=2] > + > +invcont87: ; preds = %invcont78 > + invoke void > @ada__text_io__set_output( %struct.ada__text_io__text_afcb* %13 ) > + to label %invcont88 unwind label %lpad228 > + > +invcont88: ; preds = %invcont87 > + %14 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 1 ; <%struct.string___XUB*> [#uses=1] > + invoke void > @system__secondary_stack__ss_mark( %struct.string___XUB* noalias > sret %14 ) > + to label %invcont89 unwind label %lpad228 > + > +invcont89: ; preds = %invcont88 > + invoke fastcc void @ce3806g__fxio__put. > 1149( %struct.ada__text_io__text_afcb* %6 ) > + to label %bb94 unwind label %lpad252 > + > +bb94: ; preds = %invcont89 > + invoke fastcc void @ce3806g__fxio__put__2.1155( ) > + to label %invcont95 unwind label %lpad252 > + > +invcont95: ; preds = %bb94 > + %15 = invoke %struct.ada__text_io__text_afcb* > @ada__text_io__close( %struct.ada__text_io__text_afcb* %6 ) > + to label %invcont96 unwind label %lpad252 ; < > %struct.ada__text_io__text_afcb*> [#uses=1] > + > +invcont96: ; preds = %invcont95 > + %16 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 0 ; <%struct.string___XUB*> [#uses=1] > + invoke void > @system__secondary_stack__ss_mark( %struct.string___XUB* noalias > sret %16 ) > + to label %invcont97 unwind label %lpad252 > + > +invcont97: ; preds = %invcont96 > + invoke void > @report__legal_file_name > ( %struct.system__file_control_block__pstring* noalias sret %1, i32 > 1, i8* getelementptr ([0 x i8]* @.str6, i32 0, i32 0), > %struct.string___XUB* @C.154.1612 ) > + to label %invcont102 unwind label %lpad256 > + > +invcont102: ; preds = %invcont97 > + %elt103 = getelementptr > %struct.system__file_control_block__pstring* %1, i32 0, i32 0 ; > [#uses=1] > + %val104 = load i8** %elt103, align 8 ; [#uses=1] > + %elt105 = getelementptr > %struct.system__file_control_block__pstring* %1, i32 0, i32 1 ; < > %struct.string___XUB**> [#uses=1] > + %val106 = load %struct.string___XUB** %elt105 ; < > %struct.string___XUB*> [#uses=1] > + %17 = invoke %struct.ada__text_io__text_afcb* > @ada__text_io__open( %struct.ada__text_io__text_afcb* %15, i8 0, i8* > %val104, %struct.string___XUB* %val106, i8* getelementptr ([0 x i8]* > @.str6, i32 0, i32 0), %struct.string___XUB* @C.153.1609 ) > + to label %invcont111 unwind label %lpad256 ; < > %struct.ada__text_io__text_afcb*> [#uses=2] > + > +invcont111: ; preds = %invcont102 > + %18 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 0, i32 0 ; [#uses=1] > + %19 = load i32* %18, align 8 ; [#uses=1] > + %20 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 0, i32 1 ; [#uses=1] > + %21 = load i32* %20, align 4 ; [#uses=1] > + invoke void @system__secondary_stack__ss_release( i32 %19, i32 %21 ) > + to label %bb143 unwind label %lpad252 > + > +bb117: ; preds = %lpad256 > + call void @__gnat_begin_handler( i8* %eh_ptr257 ) nounwind > + %22 = load void ()** @system__soft_links__abort_undefer, align > 4 ; [#uses=1] > + invoke void %22( ) > + to label %invcont119 unwind label %lpad264 > + > +invcont119: ; preds = %bb117 > + invoke void @report__not_applicable( i8* getelementptr ([47 x i8]* > @.str12, i32 0, i32 0), %struct.string___XUB* @C.156.1618 ) > + to label %invcont124 unwind label %lpad264 > + > +invcont124: ; preds = %invcont119 > + invoke void > @__gnat_raise_exception > ( %struct.system__standard_library__exception_data* bitcast > (%struct.exception* @incomplete.1177 to > %struct.system__standard_library__exception_data*), i8* > getelementptr ([14 x i8]* @.str13, i32 0, i32 0), > %struct.string___XUB* @C.157.1621 ) noreturn > + to label %invcont129 unwind label %lpad264 > + > +invcont129: ; preds = %invcont124 > + unreachable > + > +bb143: ; preds = %invcont111 > + %23 = invoke %struct.ada__text_io__text_afcb* > @ada__text_io__standard_output( ) > + to label %invcont144 unwind label %lpad252 ; < > %struct.ada__text_io__text_afcb*> [#uses=1] > + > +invcont144: ; preds = %bb143 > + invoke void > @ada__text_io__set_output( %struct.ada__text_io__text_afcb* %23 ) > + to label %invcont145 unwind label %lpad252 > + > +invcont145: ; preds = %invcont144 > + %24 = invoke %struct.ada__text_io__text_afcb* > @ada__text_io__close( %struct.ada__text_io__text_afcb* %13 ) > + to label %invcont146 unwind label %lpad252 ; < > %struct.ada__text_io__text_afcb*> [#uses=1] > + > +invcont146: ; preds = %invcont145 > + invoke void > @report__legal_file_name > ( %struct.system__file_control_block__pstring* noalias sret %0, i32 > 2, i8* getelementptr ([0 x i8]* @.str6, i32 0, i32 0), > %struct.string___XUB* @C.160.1630 ) > + to label %invcont151 unwind label %lpad252 > + > +invcont151: ; preds = %invcont146 > + %elt152 = getelementptr > %struct.system__file_control_block__pstring* %0, i32 0, i32 0 ; > [#uses=1] > + %val153 = load i8** %elt152, align 8 ; [#uses=1] > + %elt154 = getelementptr > %struct.system__file_control_block__pstring* %0, i32 0, i32 1 ; < > %struct.string___XUB**> [#uses=1] > + %val155 = load %struct.string___XUB** %elt154 ; < > %struct.string___XUB*> [#uses=1] > + %25 = invoke %struct.ada__text_io__text_afcb* > @ada__text_io__open( %struct.ada__text_io__text_afcb* %24, i8 0, i8* > %val153, %struct.string___XUB* %val155, i8* getelementptr ([0 x i8]* > @.str6, i32 0, i32 0), %struct.string___XUB* @C.159.1627 ) > + to label %invcont160 unwind label %lpad252 ; < > %struct.ada__text_io__text_afcb*> [#uses=2] > + > +invcont160: ; preds = %invcont151 > + %26 = invoke fastcc i8 @ce3806g__fxio__get. > 1137( %struct.ada__text_io__text_afcb* %17 ) signext > + to label %invcont161 unwind label %lpad252 ; [#uses=1] > + > +invcont161: ; preds = %invcont160 > + %27 = icmp eq i8 %26, -3 ; [#uses=1] > + br i1 %27, label %bb169, label %bb163 > + > +bb163: ; preds = %invcont161 > + invoke void @report__failed( i8* getelementptr ([33 x i8]* > @.str14, i32 0, i32 0), %struct.string___XUB* @C.162.1637 ) > + to label %bb169 unwind label %lpad252 > + > +bb169: ; preds = %invcont161, %bb163 > + %28 = invoke fastcc i8 @ce3806g__fxio__get. > 1137( %struct.ada__text_io__text_afcb* %25 ) signext > + to label %invcont170 unwind label %lpad252 ; [#uses=1] > + > +invcont170: ; preds = %bb169 > + %29 = icmp eq i8 %28, -1 ; [#uses=1] > + br i1 %29, label %bb187, label %bb172 > + > +bb172: ; preds = %invcont170 > + invoke void @report__failed( i8* getelementptr ([36 x i8]* > @.str15, i32 0, i32 0), %struct.string___XUB* @C.164.1642 ) > + to label %bb187 unwind label %lpad252 > + > +bb187: ; preds = %invcont170, %bb172 > + %30 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 1, i32 0 ; [#uses=1] > + %31 = load i32* %30, align 8 ; [#uses=1] > + %32 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 1, i32 1 ; [#uses=1] > + %33 = load i32* %32, align 4 ; [#uses=1] > + invoke void @system__secondary_stack__ss_release( i32 %31, i32 %33 ) > + to label %bb193 unwind label %lpad228 > + > +bb193: ; preds = %bb187 > + %34 = invoke %struct.ada__text_io__text_afcb* > @ada__text_io__delete( %struct.ada__text_io__text_afcb* %17 ) > + to label %invcont194 unwind label %lpad268 ; < > %struct.ada__text_io__text_afcb*> [#uses=0] > + > +invcont194: ; preds = %bb193 > + %35 = invoke %struct.ada__text_io__text_afcb* > @ada__text_io__delete( %struct.ada__text_io__text_afcb* %25 ) > + to label %bb221 unwind label %lpad268 ; < > %struct.ada__text_io__text_afcb*> [#uses=0] > + > +bb196: ; preds = %lpad268 > + call void @__gnat_begin_handler( i8* %eh_ptr269 ) nounwind > + %36 = load void ()** @system__soft_links__abort_undefer, align > 4 ; [#uses=1] > + invoke void %36( ) > + to label %bb203 unwind label %lpad276 > + > +bb203: ; preds = %bb196 > + invoke void @__gnat_end_handler( i8* %eh_ptr269 ) > + to label %bb221 unwind label %lpad272 > + > +bb205: ; preds = %ppad304 > + call void @__gnat_begin_handler( i8* %eh_exception.1 ) nounwind > + %37 = load void ()** @system__soft_links__abort_undefer, align > 4 ; [#uses=1] > + invoke void %37( ) > + to label %bb212 unwind label %lpad284 > + > +bb212: ; preds = %bb205 > + invoke void @__gnat_end_handler( i8* %eh_exception.1 ) > + to label %bb221 unwind label %lpad280 > + > +bb221: ; preds = %invcont194, %bb212, %bb203 > + %38 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 3, i32 0 ; [#uses=1] > + %39 = load i32* %38, align 8 ; [#uses=1] > + %40 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 3, i32 1 ; [#uses=1] > + %41 = load i32* %40, align 4 ; [#uses=1] > + call void @system__secondary_stack__ss_release( i32 %39, i32 %41 ) > + call void @report__result( ) > + ret void > + > +lpad: ; preds = %bb > + %eh_ptr = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select227 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), i32* @__gnat_all_others_value ) ; > [#uses=0] > + br label %ppad > + > +lpad228: ; preds = %bb187, %ppad294, %invcont88, %invcont87, > %invcont78, %bb73, %ppad288, %invcont26, %bb11 > + %eh_ptr229 = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select231 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr229, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* @incomplete.1177, > i32* @__gnat_all_others_value ) ; [#uses=1] > + br label %ppad304 > + > +lpad232: ; preds = %invcont17, %invcont12 > + %eh_ptr233 = call i8* @llvm.eh.exception( ) ; [#uses=6] > + %eh_select235 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr233, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* > @ada__io_exceptions__use_error, %struct.exception* > @ada__io_exceptions__name_error, %struct.exception* @incomplete. > 1177, i32* @__gnat_all_others_value ) ; [#uses=3] > + %eh_typeid = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr > (%struct.exception* @ada__io_exceptions__use_error, i32 0, i32 > 0) ) ; [#uses=1] > + %42 = icmp eq i32 %eh_select235, %eh_typeid ; [#uses=1] > + br i1 %42, label %bb32, label %ppad291 > + > +lpad236: ; preds = %lpad240 > + %eh_ptr237 = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select239 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr237, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* @incomplete.1177, > i32* @__gnat_all_others_value ) ; [#uses=1] > + br label %ppad288 > + > +lpad240: ; preds = %invcont38, %invcont33, %bb32 > + %eh_ptr241 = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select243 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr241, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* @incomplete.1177, > i32* @__gnat_all_others_value ) ; [#uses=1] > + invoke void @__gnat_end_handler( i8* %eh_ptr233 ) > + to label %ppad288 unwind label %lpad236 > + > +lpad244: ; preds = %lpad248 > + %eh_ptr245 = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select247 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr245, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* @incomplete.1177, > i32* @__gnat_all_others_value ) ; [#uses=1] > + br label %ppad288 > + > +lpad248: ; preds = %invcont54, %invcont49, %bb47 > + %eh_ptr249 = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select251 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr249, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* @incomplete.1177, > i32* @__gnat_all_others_value ) ; [#uses=1] > + invoke void @__gnat_end_handler( i8* %eh_ptr233 ) > + to label %ppad288 unwind label %lpad244 > + > +lpad252: ; preds = %bb94, %invcont89, %invcont160, %bb169, %bb172, > %bb163, %invcont151, %invcont146, %invcont145, %invcont144, %bb143, > %ppad295, %invcont111, %invcont96, %invcont95 > + %eh_ptr253 = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select255 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr253, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* @incomplete.1177, > i32* @__gnat_all_others_value ) ; [#uses=1] > + br label %ppad294 > + > +lpad256: ; preds = %invcont102, %invcont97 > + %eh_ptr257 = call i8* @llvm.eh.exception( ) ; [#uses=4] > + %eh_select259 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr257, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* > @ada__io_exceptions__use_error, %struct.exception* @incomplete.1177, > i32* @__gnat_all_others_value ) ; [#uses=2] > + %eh_typeid297 = call i32 @llvm.eh.typeid.for.i32( i8* > getelementptr (%struct.exception* @ada__io_exceptions__use_error, > i32 0, i32 0) ) ; [#uses=1] > + %43 = icmp eq i32 %eh_select259, %eh_typeid297 ; [#uses=1] > + br i1 %43, label %bb117, label %ppad295 > + > +lpad260: ; preds = %lpad264 > + %eh_ptr261 = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select263 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr261, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* @incomplete.1177, > i32* @__gnat_all_others_value ) ; [#uses=1] > + br label %ppad295 > + > +lpad264: ; preds = %invcont124, %invcont119, %bb117 > + %eh_ptr265 = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select267 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr265, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* @incomplete.1177, > i32* @__gnat_all_others_value ) ; [#uses=1] > + invoke void @__gnat_end_handler( i8* %eh_ptr257 ) > + to label %ppad295 unwind label %lpad260 > + > +lpad268: ; preds = %invcont194, %bb193 > + %eh_ptr269 = call i8* @llvm.eh.exception( ) ; [#uses=5] > + %eh_select271 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr269, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* > @ada__io_exceptions__use_error, %struct.exception* @incomplete.1177, > i32* @__gnat_all_others_value ) ; [#uses=2] > + %eh_typeid301 = call i32 @llvm.eh.typeid.for.i32( i8* > getelementptr (%struct.exception* @ada__io_exceptions__use_error, > i32 0, i32 0) ) ; [#uses=1] > + %44 = icmp eq i32 %eh_select271, %eh_typeid301 ; [#uses=1] > + br i1 %44, label %bb196, label %ppad304 > + > +lpad272: ; preds = %bb203, %lpad276 > + %eh_ptr273 = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select275 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr273, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* @incomplete.1177, > i32* @__gnat_all_others_value ) ; [#uses=1] > + br label %ppad304 > + > +lpad276: ; preds = %bb196 > + %eh_ptr277 = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select279 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr277, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* @incomplete.1177, > i32* @__gnat_all_others_value ) ; [#uses=1] > + invoke void @__gnat_end_handler( i8* %eh_ptr269 ) > + to label %ppad304 unwind label %lpad272 > + > +lpad280: ; preds = %bb212, %lpad284 > + %eh_ptr281 = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select283 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr281, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), i32* @__gnat_all_others_value ) ; > [#uses=0] > + br label %ppad > + > +lpad284: ; preds = %bb205 > + %eh_ptr285 = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select287 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr285, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), i32* @__gnat_all_others_value ) ; > [#uses=0] > + invoke void @__gnat_end_handler( i8* %eh_exception.1 ) > + to label %ppad unwind label %lpad280 > + > +ppad: ; preds = %lpad284, %ppad304, %lpad280, %lpad > + %eh_exception.2 = phi i8* [ %eh_exception.1, %ppad304 ], > [ %eh_ptr281, %lpad280 ], [ %eh_ptr, %lpad ], [ %eh_ptr285, > %lpad284 ] ; [#uses=1] > + %45 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 3, i32 0 ; [#uses=1] > + %46 = load i32* %45, align 8 ; [#uses=1] > + %47 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 3, i32 1 ; [#uses=1] > + %48 = load i32* %47, align 4 ; [#uses=1] > + call void @system__secondary_stack__ss_release( i32 %46, i32 %48 ) > + %49 = call i32 (...)* @_Unwind_Resume( i8* %eh_exception.2 ) ; > [#uses=0] > + unreachable > + > +ppad288: ; preds = %lpad248, %lpad240, %ppad291, %lpad244, %lpad236 > + %eh_exception.0 = phi i8* [ %eh_ptr233, %ppad291 ], [ %eh_ptr245, > %lpad244 ], [ %eh_ptr237, %lpad236 ], [ %eh_ptr241, %lpad240 ], > [ %eh_ptr249, %lpad248 ] ; [#uses=1] > + %eh_selector.0 = phi i32 [ %eh_select235, %ppad291 ], > [ %eh_select247, %lpad244 ], [ %eh_select239, %lpad236 ], > [ %eh_select243, %lpad240 ], [ %eh_select251, %lpad248 ] ; > [#uses=1] > + %50 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 2, i32 0 ; [#uses=1] > + %51 = load i32* %50, align 8 ; [#uses=1] > + %52 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 2, i32 1 ; [#uses=1] > + %53 = load i32* %52, align 4 ; [#uses=1] > + invoke void @system__secondary_stack__ss_release( i32 %51, i32 %53 ) > + to label %ppad304 unwind label %lpad228 > + > +ppad291: ; preds = %lpad232 > + %eh_typeid292 = call i32 @llvm.eh.typeid.for.i32( i8* > getelementptr (%struct.exception* @ada__io_exceptions__name_error, > i32 0, i32 0) ) ; [#uses=1] > + %54 = icmp eq i32 %eh_select235, %eh_typeid292 ; [#uses=1] > + br i1 %54, label %bb47, label %ppad288 > + > +ppad294: ; preds = %ppad295, %lpad252 > + %eh_exception.4 = phi i8* [ %eh_ptr253, %lpad252 ], > [ %eh_exception.3, %ppad295 ] ; [#uses=1] > + %eh_selector.4 = phi i32 [ %eh_select255, %lpad252 ], > [ %eh_selector.3, %ppad295 ] ; [#uses=1] > + %55 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 1, i32 0 ; [#uses=1] > + %56 = load i32* %55, align 8 ; [#uses=1] > + %57 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 1, i32 1 ; [#uses=1] > + %58 = load i32* %57, align 4 ; [#uses=1] > + invoke void @system__secondary_stack__ss_release( i32 %56, i32 %58 ) > + to label %ppad304 unwind label %lpad228 > + > +ppad295: ; preds = %lpad264, %lpad256, %lpad260 > + %eh_exception.3 = phi i8* [ %eh_ptr257, %lpad256 ], [ %eh_ptr261, > %lpad260 ], [ %eh_ptr265, %lpad264 ] ; [#uses=1] > + %eh_selector.3 = phi i32 [ %eh_select259, %lpad256 ], > [ %eh_select263, %lpad260 ], [ %eh_select267, %lpad264 ] ; > [#uses=1] > + %59 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 0, i32 0 ; [#uses=1] > + %60 = load i32* %59, align 8 ; [#uses=1] > + %61 = getelementptr %struct.FRAME.ce3806g* %FRAME.356, i32 0, i32 > 0, i32 1 ; [#uses=1] > + %62 = load i32* %61, align 4 ; [#uses=1] > + invoke void @system__secondary_stack__ss_release( i32 %60, i32 %62 ) > + to label %ppad294 unwind label %lpad252 > + > +ppad304: ; preds = %lpad276, %ppad294, %ppad288, %lpad268, > %lpad272, %lpad228 > + %eh_exception.1 = phi i8* [ %eh_ptr229, %lpad228 ], [ %eh_ptr269, > %lpad268 ], [ %eh_ptr273, %lpad272 ], [ %eh_exception.0, %ppad288 ], > [ %eh_exception.4, %ppad294 ], [ %eh_ptr277, %lpad276 ] ; > [#uses=4] > + %eh_selector.1 = phi i32 [ %eh_select231, %lpad228 ], > [ %eh_select271, %lpad268 ], [ %eh_select275, %lpad272 ], > [ %eh_selector.0, %ppad288 ], [ %eh_selector.4, %ppad294 ], > [ %eh_select279, %lpad276 ] ; [#uses=1] > + %eh_typeid305 = call i32 @llvm.eh.typeid.for.i32( i8* > getelementptr (%struct.exception* @incomplete.1177, i32 0, i32 > 0) ) ; [#uses=1] > + %63 = icmp eq i32 %eh_selector.1, %eh_typeid305 ; [#uses=1] > + br i1 %63, label %bb205, label %ppad > +} > + > +define internal fastcc i8 @ce3806g__fxio__get. > 1137(%struct.ada__text_io__text_afcb* %file) signext { > +entry: > + %0 = invoke x86_fp80 > @ada__text_io__float_aux__get( %struct.ada__text_io__text_afcb* > %file, i32 0 ) > + to label %invcont unwind label %lpad ; [#uses=5] > + > +invcont: ; preds = %entry > + %1 = fcmp ult x86_fp80 %0, 0xKFFFEFFFFFFFFFFFFFFFF ; [#uses=1] > + %2 = fcmp ugt x86_fp80 %0, 0xK7FFEFFFFFFFFFFFFFFFF ; [#uses=1] > + %or.cond = or i1 %1, %2 ; [#uses=1] > + br i1 %or.cond, label %bb2, label %bb4 > + > +bb2: ; preds = %invcont > + invoke void @__gnat_rcheck_12( i8* getelementptr ([12 x i8]* > @.str, i32 0, i32 0), i32 1 ) noreturn > + to label %invcont3 unwind label %lpad > + > +invcont3: ; preds = %bb2 > + unreachable > + > +bb4: ; preds = %invcont > + %3 = mul x86_fp80 %0, 0xK40008000000000000000 ; > [#uses=1] > + %4 = fcmp ult x86_fp80 %3, 0xKC0068000000000000000 ; [#uses=1] > + br i1 %4, label %bb8, label %bb6 > + > +bb6: ; preds = %bb4 > + %5 = mul x86_fp80 %0, 0xK40008000000000000000 ; > [#uses=1] > + %6 = fcmp ugt x86_fp80 %5, 0xK4005FE00000000000000 ; [#uses=1] > + br i1 %6, label %bb8, label %bb10 > + > +bb8: ; preds = %bb4, %bb6 > + invoke void @__gnat_rcheck_10( i8* getelementptr ([14 x i8]* > @.str1, i32 0, i32 0), i32 324 ) noreturn > + to label %invcont9 unwind label %lpad > + > +invcont9: ; preds = %bb8 > + unreachable > + > +bb10: ; preds = %bb6 > + %7 = mul x86_fp80 %0, 0xK40008000000000000000 ; > [#uses=3] > + %8 = fcmp ult x86_fp80 %7, 0xK00000000000000000000 ; [#uses=1] > + br i1 %8, label %bb13, label %bb12 > + > +bb12: ; preds = %bb10 > + %9 = add x86_fp80 %7, 0xK3FFDFFFFFFFFFFFFFFFF ; > [#uses=1] > + br label %bb14 > + > +bb13: ; preds = %bb10 > + %10 = sub x86_fp80 %7, 0xK3FFDFFFFFFFFFFFFFFFF ; > [#uses=1] > + br label %bb14 > + > +bb14: ; preds = %bb13, %bb12 > + %iftmp.339.0.in = phi x86_fp80 [ %10, %bb13 ], [ %9, %bb12 ] ; > [#uses=1] > + %iftmp.339.0 = fptosi x86_fp80 %iftmp.339.0.in to i8 ; > [#uses=3] > + %11 = add i8 %iftmp.339.0, 20 ; [#uses=1] > + %12 = icmp ugt i8 %11, 40 ; [#uses=1] > + br i1 %12, label %bb16, label %bb18 > + > +bb16: ; preds = %bb14 > + invoke void @__gnat_rcheck_12( i8* getelementptr ([14 x i8]* > @.str1, i32 0, i32 0), i32 324 ) noreturn > + to label %invcont17 unwind label %lpad > + > +invcont17: ; preds = %bb16 > + unreachable > + > +bb18: ; preds = %bb14 > + %13 = add i8 %iftmp.339.0, 20 ; [#uses=1] > + %14 = icmp ugt i8 %13, 40 ; [#uses=1] > + br i1 %14, label %bb20, label %bb22 > + > +bb20: ; preds = %bb18 > + invoke void @__gnat_rcheck_12( i8* getelementptr ([14 x i8]* > @.str1, i32 0, i32 0), i32 324 ) noreturn > + to label %invcont21 unwind label %lpad > + > +invcont21: ; preds = %bb20 > + unreachable > + > +bb22: ; preds = %bb18 > + ret i8 %iftmp.339.0 > + > +bb23: ; preds = %lpad > + call void @__gnat_begin_handler( i8* %eh_ptr ) nounwind > + %15 = load void ()** @system__soft_links__abort_undefer, align > 4 ; [#uses=1] > + invoke void %15( ) > + to label %invcont24 unwind label %lpad33 > + > +invcont24: ; preds = %bb23 > + invoke void > @__gnat_raise_exception > ( %struct.system__standard_library__exception_data* bitcast > (%struct.exception* @ada__io_exceptions__data_error to > %struct.system__standard_library__exception_data*), i8* > getelementptr ([47 x i8]* @.str2, i32 0, i32 0), > %struct.string___XUB* @C.354.2200 ) noreturn > + to label %invcont27 unwind label %lpad33 > + > +invcont27: ; preds = %invcont24 > + unreachable > + > +lpad: ; preds = %bb20, %bb16, %bb8, %bb2, %entry > + %eh_ptr = call i8* @llvm.eh.exception( ) ; [#uses=4] > + %eh_select32 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), %struct.exception* > @constraint_error, i32* @__gnat_all_others_value ) ; [#uses=1] > + %eh_typeid = call i32 @llvm.eh.typeid.for.i32( i8* getelementptr > (%struct.exception* @constraint_error, i32 0, i32 0) ) ; > [#uses=1] > + %16 = icmp eq i32 %eh_select32, %eh_typeid ; [#uses=1] > + br i1 %16, label %bb23, label %Unwind > + > +lpad33: ; preds = %invcont24, %bb23 > + %eh_ptr34 = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select36 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr34, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), i32* @__gnat_all_others_value ) ; > [#uses=0] > + call void @__gnat_end_handler( i8* %eh_ptr ) > + br label %Unwind > + > +Unwind: ; preds = %lpad, %lpad33 > + %eh_exception.0 = phi i8* [ %eh_ptr, %lpad ], [ %eh_ptr34, > %lpad33 ] ; [#uses=1] > + %17 = call i32 (...)* @_Unwind_Resume( i8* %eh_exception.0 ) ; > [#uses=0] > + unreachable > +} > + > +define internal fastcc void @ce3806g__fxio__put. > 1149(%struct.ada__text_io__text_afcb* %file) { > +entry: > + %A.301 = alloca %struct.string___XUB ; <%struct.string___XUB*> > [#uses=3] > + %A.292 = alloca %struct.string___XUB ; <%struct.string___XUB*> > [#uses=3] > + %0 = call i8* @llvm.stacksave( ) ; [#uses=1] > + %1 = alloca [12 x i8] ; <[12 x i8]*> [#uses=1] > + %.sub = getelementptr [12 x i8]* %1, i32 0, i32 0 ; [#uses=2] > + %2 = getelementptr %struct.string___XUB* %A.292, i32 0, i32 0 ; > [#uses=1] > + store i32 1, i32* %2, align 8 > + %3 = getelementptr %struct.string___XUB* %A.292, i32 0, i32 1 ; > [#uses=1] > + store i32 12, i32* %3, align 4 > + %4 = invoke fastcc i32 @ce3806g__fxio__put__4.1215( i8* %.sub, > %struct.string___XUB* %A.292, i8 signext -3 ) > + to label %invcont unwind label %lpad ; [#uses=1] > + > +invcont: ; preds = %entry > + %5 = getelementptr %struct.string___XUB* %A.301, i32 0, i32 0 ; > [#uses=1] > + store i32 1, i32* %5, align 8 > + %6 = getelementptr %struct.string___XUB* %A.301, i32 0, i32 1 ; > [#uses=1] > + store i32 %4, i32* %6, align 4 > + invoke void > @ada__text_io__generic_aux__put_item > ( %struct.ada__text_io__text_afcb* %file, i8* %.sub, > %struct.string___XUB* %A.301 ) > + to label %bb60 unwind label %lpad > + > +bb60: ; preds = %invcont > + ret void > + > +lpad: ; preds = %entry, %invcont > + %eh_ptr = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select62 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), i32* @__gnat_all_others_value ) ; > [#uses=0] > + call void @llvm.stackrestore( i8* %0 ) > + %7 = call i32 (...)* @_Unwind_Resume( i8* %eh_ptr ) ; > [#uses=0] > + unreachable > +} > + > +define internal fastcc void @ce3806g__fxio__put__2.1155() { > +entry: > + %A.266 = alloca %struct.string___XUB ; <%struct.string___XUB*> > [#uses=3] > + %A.257 = alloca %struct.string___XUB ; <%struct.string___XUB*> > [#uses=3] > + %0 = call i8* @llvm.stacksave( ) ; [#uses=1] > + %1 = alloca [12 x i8] ; <[12 x i8]*> [#uses=1] > + %.sub = getelementptr [12 x i8]* %1, i32 0, i32 0 ; [#uses=2] > + %2 = getelementptr %struct.string___XUB* %A.257, i32 0, i32 0 ; > [#uses=1] > + store i32 1, i32* %2, align 8 > + %3 = getelementptr %struct.string___XUB* %A.257, i32 0, i32 1 ; > [#uses=1] > + store i32 12, i32* %3, align 4 > + %4 = invoke fastcc i32 @ce3806g__fxio__put__4.1215( i8* %.sub, > %struct.string___XUB* %A.257, i8 signext -1 ) > + to label %invcont unwind label %lpad ; [#uses=1] > + > +invcont: ; preds = %entry > + %5 = getelementptr %struct.string___XUB* %A.266, i32 0, i32 0 ; > [#uses=1] > + store i32 1, i32* %5, align 8 > + %6 = getelementptr %struct.string___XUB* %A.266, i32 0, i32 1 ; > [#uses=1] > + store i32 %4, i32* %6, align 4 > + %7 = load %struct.ada__text_io__text_afcb** > @ada__text_io__current_out, align 4 ; < > %struct.ada__text_io__text_afcb*> [#uses=1] > + invoke void > @ada__text_io__generic_aux__put_item > ( %struct.ada__text_io__text_afcb* %7, i8* %.sub, > %struct.string___XUB* %A.266 ) > + to label %bb60 unwind label %lpad > + > +bb60: ; preds = %invcont > + ret void > + > +lpad: ; preds = %entry, %invcont > + %eh_ptr = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select62 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), i32* @__gnat_all_others_value ) ; > [#uses=0] > + call void @llvm.stackrestore( i8* %0 ) > + %8 = call i32 (...)* @_Unwind_Resume( i8* %eh_ptr ) ; > [#uses=0] > + unreachable > +} > + > +define internal fastcc i32 @ce3806g__fxio__put__4.1215(i8* %to.0, > %struct.string___XUB* %to.1, i8 signext %item) { > +entry: > + %to_addr = alloca %struct.system__file_control_block__pstring ; < > %struct.system__file_control_block__pstring*> [#uses=4] > + %FRAME.358 = alloca %struct.FRAME.ce3806g__fxio__put__4 ; < > %struct.FRAME.ce3806g__fxio__put__4*> [#uses=65] > + %0 = getelementptr %struct.system__file_control_block__pstring* > %to_addr, i32 0, i32 0 ; [#uses=1] > + store i8* %to.0, i8** %0, align 8 > + %1 = getelementptr %struct.system__file_control_block__pstring* > %to_addr, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1] > + store %struct.string___XUB* %to.1, %struct.string___XUB** %1 > + %2 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + store %struct.system__file_control_block__pstring* %to_addr, > %struct.system__file_control_block__pstring** %2, align 4 > + %3 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 0 ; [#uses=1] > + store i32 3, i32* %3, align 8 > + %4 = getelementptr %struct.system__file_control_block__pstring* > %to_addr, i32 0, i32 1 ; <%struct.string___XUB**> [#uses=1] > + %5 = load %struct.string___XUB** %4, align 4 ; < > %struct.string___XUB*> [#uses=1] > + %6 = getelementptr %struct.string___XUB* %5, i32 0, i32 0 ; > [#uses=1] > + %7 = load i32* %6, align 4 ; [#uses=1] > + %8 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 2 ; [#uses=1] > + store i32 %7, i32* %8, align 8 > + %9 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 2 ; [#uses=1] > + %10 = load i32* %9, align 8 ; [#uses=1] > + %11 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 4 ; [#uses=1] > + store i32 %10, i32* %11, align 8 > + %item.lobit = lshr i8 %item, 7 ; [#uses=1] > + %12 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 6 ; [#uses=1] > + store i8 %item.lobit, i8* %12, align 8 > + %13 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 2 ; [#uses=1] > + %14 = load i32* %13, align 8 ; [#uses=1] > + %15 = add i32 %14, -1 ; [#uses=1] > + %16 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + store i32 %15, i32* %16, align 4 > + %17 = sext i8 %item to i64 ; [#uses=1] > + %18 = call i64 @system__exn_lli__exn_long_long_integer( i64 10, > i32 1 ) readnone ; [#uses=1] > + %19 = sub i64 0, %18 ; [#uses=1] > + %20 = call i64 @system__exn_lli__exn_long_long_integer( i64 10, > i32 0 ) readnone ; [#uses=1] > + %21 = mul i64 %20, -2 ; [#uses=1] > + call fastcc void > @ce3806g__fxio__put__put_scaled__4.1346 > ( %struct.FRAME.ce3806g__fxio__put__4* %FRAME.358, i64 %17, i64 %19, > i64 %21, i32 0, i32 -1 ) > + %22 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %23 = load i32* %22, align 4 ; [#uses=1] > + %24 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 2 ; [#uses=1] > + %25 = load i32* %24, align 8 ; [#uses=1] > + %26 = icmp slt i32 %23, %25 ; [#uses=1] > + br i1 %26, label %bb71, label %bb72 > + > +bb71: ; preds = %entry > + %27 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 1 ; [#uses=1] > + store i32 0, i32* %27, align 4 > + br label %bb72 > + > +bb72: ; preds = %entry, %bb102, %bb71 > + %28 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 1 ; [#uses=1] > + %29 = load i32* %28, align 4 ; [#uses=1] > + %30 = icmp slt i32 %29, -1 ; [#uses=1] > + %31 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %32 = load i32* %31, align 4 ; [#uses=2] > + br i1 %30, label %bb103, label %bb74 > + > +bb74: ; preds = %bb72 > + %33 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 2 ; [#uses=1] > + %34 = load i32* %33, align 8 ; [#uses=1] > + %35 = add i32 %34, -1 ; [#uses=1] > + %36 = icmp eq i32 %32, %35 ; [#uses=1] > + %37 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 1 ; [#uses=1] > + %38 = load i32* %37, align 4 ; [#uses=2] > + br i1 %36, label %bb76, label %bb98 > + > +bb76: ; preds = %bb74 > + %39 = icmp slt i32 %38, 1 ; [#uses=1] > + br i1 %39, label %bb80, label %bb102 > + > +bb80: ; preds = %bb76 > + %40 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 1 ; [#uses=1] > + %41 = load i32* %40, align 4 ; [#uses=2] > + %42 = icmp sgt i32 %41, -1 ; [#uses=1] > + %.op = add i32 %41, 2 ; [#uses=1] > + %43 = select i1 %42, i32 %.op, i32 2 ; [#uses=1] > + %44 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 6 ; [#uses=1] > + %45 = load i8* %44, align 8 ; [#uses=1] > + %46 = zext i8 %45 to i32 ; [#uses=1] > + %47 = add i32 %43, %46 ; [#uses=2] > + %48 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 0 ; [#uses=1] > + %49 = load i32* %48, align 8 ; [#uses=1] > + %50 = icmp sgt i32 %47, %49 ; [#uses=1] > + br i1 %50, label %bb88, label %bb85 > + > +bb85: ; preds = %bb80, %bb87 > + %j.0 = phi i32 [ %68, %bb87 ], [ %47, %bb80 ] ; [#uses=2] > + %51 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %52 = load i32* %51, align 4 ; [#uses=1] > + %53 = add i32 %52, 1 ; [#uses=1] > + %54 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + store i32 %53, i32* %54, align 4 > + %55 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 4 ; [#uses=1] > + %56 = load i32* %55, align 8 ; [#uses=1] > + %57 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %58 = load %struct.system__file_control_block__pstring** %57, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %59 = getelementptr %struct.system__file_control_block__pstring* > %58, i32 0, i32 0 ; [#uses=1] > + %60 = load i8** %59, align 4 ; [#uses=1] > + %61 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %62 = load i32* %61, align 4 ; [#uses=1] > + %63 = sub i32 %62, %56 ; [#uses=1] > + %64 = getelementptr i8* %60, i32 %63 ; [#uses=1] > + store i8 32, i8* %64, align 1 > + %65 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 0 ; [#uses=1] > + %66 = load i32* %65, align 8 ; [#uses=1] > + %67 = icmp eq i32 %66, %j.0 ; [#uses=1] > + br i1 %67, label %bb88, label %bb87 > + > +bb87: ; preds = %bb85 > + %68 = add i32 %j.0, 1 ; [#uses=1] > + br label %bb85 > + > +bb88: ; preds = %bb80, %bb85 > + %69 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 6 ; [#uses=1] > + %70 = load i8* %69, align 8 ; [#uses=1] > + %toBool89 = icmp eq i8 %70, 0 ; [#uses=1] > + br i1 %toBool89, label %bb91, label %bb90 > + > +bb90: ; preds = %bb88 > + %71 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %72 = load i32* %71, align 4 ; [#uses=1] > + %73 = add i32 %72, 1 ; [#uses=1] > + %74 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + store i32 %73, i32* %74, align 4 > + %75 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 4 ; [#uses=1] > + %76 = load i32* %75, align 8 ; [#uses=1] > + %77 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %78 = load %struct.system__file_control_block__pstring** %77, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %79 = getelementptr %struct.system__file_control_block__pstring* > %78, i32 0, i32 0 ; [#uses=1] > + %80 = load i8** %79, align 4 ; [#uses=1] > + %81 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %82 = load i32* %81, align 4 ; [#uses=1] > + %83 = sub i32 %82, %76 ; [#uses=1] > + %84 = getelementptr i8* %80, i32 %83 ; [#uses=1] > + store i8 45, i8* %84, align 1 > + br label %bb91 > + > +bb91: ; preds = %bb88, %bb90 > + %85 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 1 ; [#uses=1] > + %86 = load i32* %85, align 4 ; [#uses=1] > + %87 = icmp slt i32 %86, 0 ; [#uses=1] > + br i1 %87, label %bb93, label %bb97 > + > +bb93: ; preds = %bb91 > + %88 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %89 = load i32* %88, align 4 ; [#uses=1] > + %90 = add i32 %89, 1 ; [#uses=1] > + %91 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + store i32 %90, i32* %91, align 4 > + %92 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 4 ; [#uses=1] > + %93 = load i32* %92, align 8 ; [#uses=1] > + %94 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %95 = load %struct.system__file_control_block__pstring** %94, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %96 = getelementptr %struct.system__file_control_block__pstring* > %95, i32 0, i32 0 ; [#uses=1] > + %97 = load i8** %96, align 4 ; [#uses=1] > + %98 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %99 = load i32* %98, align 4 ; [#uses=1] > + %100 = sub i32 %99, %93 ; [#uses=1] > + %101 = getelementptr i8* %97, i32 %100 ; [#uses=1] > + store i8 48, i8* %101, align 1 > + %102 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %103 = load i32* %102, align 4 ; [#uses=1] > + %104 = add i32 %103, 1 ; [#uses=1] > + %105 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + store i32 %104, i32* %105, align 4 > + %106 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 4 ; [#uses=1] > + %107 = load i32* %106, align 8 ; [#uses=1] > + %108 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %109 = load %struct.system__file_control_block__pstring** %108, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %110 = getelementptr %struct.system__file_control_block__pstring* > %109, i32 0, i32 0 ; [#uses=1] > + %111 = load i8** %110, align 4 ; [#uses=1] > + %112 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %113 = load i32* %112, align 4 ; [#uses=1] > + %114 = sub i32 %113, %107 ; [#uses=1] > + %115 = getelementptr i8* %111, i32 %114 ; [#uses=1] > + store i8 46, i8* %115, align 1 > + %116 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 1 ; [#uses=1] > + %117 = load i32* %116, align 4 ; [#uses=1] > + br label %bb94 > + > +bb94: ; preds = %bb96, %bb93 > + %j8.0 = phi i32 [ %117, %bb93 ], [ %133, %bb96 ] ; [#uses=2] > + %118 = icmp sgt i32 %j8.0, -2 ; [#uses=1] > + br i1 %118, label %bb97, label %bb96 > + > +bb96: ; preds = %bb94 > + %119 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %120 = load i32* %119, align 4 ; [#uses=1] > + %121 = add i32 %120, 1 ; [#uses=1] > + %122 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + store i32 %121, i32* %122, align 4 > + %123 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 4 ; [#uses=1] > + %124 = load i32* %123, align 8 ; [#uses=1] > + %125 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %126 = load %struct.system__file_control_block__pstring** %125, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %127 = getelementptr %struct.system__file_control_block__pstring* > %126, i32 0, i32 0 ; [#uses=1] > + %128 = load i8** %127, align 4 ; [#uses=1] > + %129 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %130 = load i32* %129, align 4 ; [#uses=1] > + %131 = sub i32 %130, %124 ; [#uses=1] > + %132 = getelementptr i8* %128, i32 %131 ; [#uses=1] > + store i8 48, i8* %132, align 1 > + %133 = add i32 %j8.0, 1 ; [#uses=1] > + br label %bb94 > + > +bb97: ; preds = %bb91, %bb94 > + %134 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %135 = load i32* %134, align 4 ; [#uses=1] > + %136 = add i32 %135, 1 ; [#uses=1] > + %137 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + store i32 %136, i32* %137, align 4 > + %138 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 4 ; [#uses=1] > + %139 = load i32* %138, align 8 ; [#uses=1] > + %140 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %141 = load %struct.system__file_control_block__pstring** %140, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %142 = getelementptr %struct.system__file_control_block__pstring* > %141, i32 0, i32 0 ; [#uses=1] > + %143 = load i8** %142, align 4 ; [#uses=1] > + %144 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %145 = load i32* %144, align 4 ; [#uses=1] > + %146 = sub i32 %145, %139 ; [#uses=1] > + %147 = getelementptr i8* %143, i32 %146 ; [#uses=1] > + store i8 48, i8* %147, align 1 > + br label %bb102 > + > +bb98: ; preds = %bb74 > + %148 = icmp eq i32 %38, -1 ; [#uses=1] > + br i1 %148, label %bb100, label %bb101 > + > +bb100: ; preds = %bb98 > + %149 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %150 = load i32* %149, align 4 ; [#uses=1] > + %151 = add i32 %150, 1 ; [#uses=1] > + %152 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + store i32 %151, i32* %152, align 4 > + %153 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 4 ; [#uses=1] > + %154 = load i32* %153, align 8 ; [#uses=1] > + %155 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %156 = load %struct.system__file_control_block__pstring** %155, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %157 = getelementptr %struct.system__file_control_block__pstring* > %156, i32 0, i32 0 ; [#uses=1] > + %158 = load i8** %157, align 4 ; [#uses=1] > + %159 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %160 = load i32* %159, align 4 ; [#uses=1] > + %161 = sub i32 %160, %154 ; [#uses=1] > + %162 = getelementptr i8* %158, i32 %161 ; [#uses=1] > + store i8 46, i8* %162, align 1 > + br label %bb101 > + > +bb101: ; preds = %bb98, %bb100 > + %163 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %164 = load i32* %163, align 4 ; [#uses=1] > + %165 = add i32 %164, 1 ; [#uses=1] > + %166 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + store i32 %165, i32* %166, align 4 > + %167 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 4 ; [#uses=1] > + %168 = load i32* %167, align 8 ; [#uses=1] > + %169 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %170 = load %struct.system__file_control_block__pstring** %169, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %171 = getelementptr %struct.system__file_control_block__pstring* > %170, i32 0, i32 0 ; [#uses=1] > + %172 = load i8** %171, align 4 ; [#uses=1] > + %173 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 5 ; [#uses=1] > + %174 = load i32* %173, align 4 ; [#uses=1] > + %175 = sub i32 %174, %168 ; [#uses=1] > + %176 = getelementptr i8* %172, i32 %175 ; [#uses=1] > + store i8 48, i8* %176, align 1 > + br label %bb102 > + > +bb102: ; preds = %bb76, %bb101, %bb97 > + %177 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 1 ; [#uses=1] > + %178 = load i32* %177, align 4 ; [#uses=1] > + %179 = add i32 %178, -1 ; [#uses=1] > + %180 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %FRAME. > 358, i32 0, i32 1 ; [#uses=1] > + store i32 %179, i32* %180, align 4 > + br label %bb72 > + > +bb103: ; preds = %bb72 > + ret i32 %32 > +} > + > +declare x86_fp80 > @ada__text_io__float_aux__get(%struct.ada__text_io__text_afcb*, i32) > + > +declare void @__gnat_rcheck_12(i8*, i32) noreturn > + > +declare void @__gnat_rcheck_10(i8*, i32) noreturn > + > +declare i8* @llvm.eh.exception() nounwind > + > +declare i32 @llvm.eh.selector.i32(i8*, i8*, ...) nounwind > + > +declare i32 @llvm.eh.typeid.for.i32(i8*) nounwind > + > +declare void @__gnat_begin_handler(i8*) nounwind > + > +declare void > @__gnat_raise_exception > (%struct.system__standard_library__exception_data*, i8*, > %struct.string___XUB*) noreturn > + > +declare void @__gnat_end_handler(i8*) > + > +declare i32 @__gnat_eh_personality(...) > + > +declare i32 @_Unwind_Resume(...) > + > +define internal fastcc void > @ce3806g__fxio__put__put_int64__4.1339 > (%struct.FRAME.ce3806g__fxio__put__4* %CHAIN.361, i64 %x, i32 > %scale) { > +entry: > + %0 = icmp eq i64 %x, 0 ; [#uses=1] > + br i1 %0, label %return, label %bb > + > +bb: ; preds = %entry > + %1 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 1 ; [#uses=1] > + store i32 %scale, i32* %1, align 4 > + %2 = add i64 %x, 9 ; [#uses=1] > + %3 = icmp ugt i64 %2, 18 ; [#uses=1] > + br i1 %3, label %bb18, label %bb19 > + > +bb18: ; preds = %bb > + %4 = add i32 %scale, 1 ; [#uses=1] > + %5 = sdiv i64 %x, 10 ; [#uses=1] > + call fastcc void > @ce3806g__fxio__put__put_int64__4.1339 > ( %struct.FRAME.ce3806g__fxio__put__4* %CHAIN.361, i64 %5, i32 %4 ) > + br label %bb19 > + > +bb19: ; preds = %bb, %bb18 > + %6 = srem i64 %x, 10 ; [#uses=3] > + %neg = sub i64 0, %6 ; [#uses=1] > + %abscond = icmp sgt i64 %6, -1 ; [#uses=1] > + %abs = select i1 %abscond, i64 %6, i64 %neg ; [#uses=3] > + %7 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %8 = load i32* %7, align 4 ; [#uses=1] > + %9 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 2 ; [#uses=1] > + %10 = load i32* %9, align 4 ; [#uses=1] > + %11 = add i32 %10, -1 ; [#uses=1] > + %12 = icmp eq i32 %8, %11 ; [#uses=1] > + br i1 %12, label %bb23, label %bb44 > + > +bb23: ; preds = %bb19 > + %13 = icmp ne i64 %abs, 0 ; [#uses=1] > + %14 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 1 ; [#uses=1] > + %15 = load i32* %14, align 4 ; [#uses=1] > + %16 = icmp slt i32 %15, 1 ; [#uses=1] > + %17 = or i1 %13, %16 ; [#uses=1] > + br i1 %17, label %bb27, label %bb48 > + > +bb27: ; preds = %bb23 > + %18 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 1 ; [#uses=1] > + %19 = load i32* %18, align 4 ; [#uses=2] > + %20 = icmp sgt i32 %19, -1 ; [#uses=1] > + %.op = add i32 %19, 2 ; [#uses=1] > + %21 = select i1 %20, i32 %.op, i32 2 ; [#uses=1] > + %22 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 6 ; [#uses=1] > + %23 = load i8* %22, align 1 ; [#uses=1] > + %24 = zext i8 %23 to i32 ; [#uses=1] > + %25 = add i32 %21, %24 ; [#uses=2] > + %26 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 0 ; [#uses=1] > + %27 = load i32* %26, align 4 ; [#uses=1] > + %28 = icmp sgt i32 %25, %27 ; [#uses=1] > + br i1 %28, label %bb34, label %bb31 > + > +bb31: ; preds = %bb27, %bb33 > + %j.0 = phi i32 [ %46, %bb33 ], [ %25, %bb27 ] ; [#uses=2] > + %29 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %30 = load i32* %29, align 4 ; [#uses=1] > + %31 = add i32 %30, 1 ; [#uses=1] > + %32 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + store i32 %31, i32* %32, align 4 > + %33 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 4 ; [#uses=1] > + %34 = load i32* %33, align 4 ; [#uses=1] > + %35 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %36 = load %struct.system__file_control_block__pstring** %35, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %37 = getelementptr %struct.system__file_control_block__pstring* > %36, i32 0, i32 0 ; [#uses=1] > + %38 = load i8** %37, align 4 ; [#uses=1] > + %39 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %40 = load i32* %39, align 4 ; [#uses=1] > + %41 = sub i32 %40, %34 ; [#uses=1] > + %42 = getelementptr i8* %38, i32 %41 ; [#uses=1] > + store i8 32, i8* %42, align 1 > + %43 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 0 ; [#uses=1] > + %44 = load i32* %43, align 4 ; [#uses=1] > + %45 = icmp eq i32 %44, %j.0 ; [#uses=1] > + br i1 %45, label %bb34, label %bb33 > + > +bb33: ; preds = %bb31 > + %46 = add i32 %j.0, 1 ; [#uses=1] > + br label %bb31 > + > +bb34: ; preds = %bb27, %bb31 > + %47 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 6 ; [#uses=1] > + %48 = load i8* %47, align 1 ; [#uses=1] > + %toBool35 = icmp eq i8 %48, 0 ; [#uses=1] > + br i1 %toBool35, label %bb37, label %bb36 > + > +bb36: ; preds = %bb34 > + %49 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %50 = load i32* %49, align 4 ; [#uses=1] > + %51 = add i32 %50, 1 ; [#uses=1] > + %52 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + store i32 %51, i32* %52, align 4 > + %53 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 4 ; [#uses=1] > + %54 = load i32* %53, align 4 ; [#uses=1] > + %55 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %56 = load %struct.system__file_control_block__pstring** %55, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %57 = getelementptr %struct.system__file_control_block__pstring* > %56, i32 0, i32 0 ; [#uses=1] > + %58 = load i8** %57, align 4 ; [#uses=1] > + %59 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %60 = load i32* %59, align 4 ; [#uses=1] > + %61 = sub i32 %60, %54 ; [#uses=1] > + %62 = getelementptr i8* %58, i32 %61 ; [#uses=1] > + store i8 45, i8* %62, align 1 > + br label %bb37 > + > +bb37: ; preds = %bb34, %bb36 > + %63 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 1 ; [#uses=1] > + %64 = load i32* %63, align 4 ; [#uses=1] > + %65 = icmp slt i32 %64, 0 ; [#uses=1] > + br i1 %65, label %bb39, label %bb43 > + > +bb39: ; preds = %bb37 > + %66 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %67 = load i32* %66, align 4 ; [#uses=1] > + %68 = add i32 %67, 1 ; [#uses=1] > + %69 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + store i32 %68, i32* %69, align 4 > + %70 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 4 ; [#uses=1] > + %71 = load i32* %70, align 4 ; [#uses=1] > + %72 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %73 = load %struct.system__file_control_block__pstring** %72, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %74 = getelementptr %struct.system__file_control_block__pstring* > %73, i32 0, i32 0 ; [#uses=1] > + %75 = load i8** %74, align 4 ; [#uses=1] > + %76 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %77 = load i32* %76, align 4 ; [#uses=1] > + %78 = sub i32 %77, %71 ; [#uses=1] > + %79 = getelementptr i8* %75, i32 %78 ; [#uses=1] > + store i8 48, i8* %79, align 1 > + %80 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %81 = load i32* %80, align 4 ; [#uses=1] > + %82 = add i32 %81, 1 ; [#uses=1] > + %83 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + store i32 %82, i32* %83, align 4 > + %84 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 4 ; [#uses=1] > + %85 = load i32* %84, align 4 ; [#uses=1] > + %86 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %87 = load %struct.system__file_control_block__pstring** %86, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %88 = getelementptr %struct.system__file_control_block__pstring* > %87, i32 0, i32 0 ; [#uses=1] > + %89 = load i8** %88, align 4 ; [#uses=1] > + %90 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %91 = load i32* %90, align 4 ; [#uses=1] > + %92 = sub i32 %91, %85 ; [#uses=1] > + %93 = getelementptr i8* %89, i32 %92 ; [#uses=1] > + store i8 46, i8* %93, align 1 > + %94 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 1 ; [#uses=1] > + %95 = load i32* %94, align 4 ; [#uses=1] > + br label %bb40 > + > +bb40: ; preds = %bb42, %bb39 > + %j15.0 = phi i32 [ %95, %bb39 ], [ %111, %bb42 ] ; [#uses=2] > + %96 = icmp sgt i32 %j15.0, -2 ; [#uses=1] > + br i1 %96, label %bb43, label %bb42 > + > +bb42: ; preds = %bb40 > + %97 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %98 = load i32* %97, align 4 ; [#uses=1] > + %99 = add i32 %98, 1 ; [#uses=1] > + %100 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + store i32 %99, i32* %100, align 4 > + %101 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 4 ; [#uses=1] > + %102 = load i32* %101, align 4 ; [#uses=1] > + %103 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %104 = load %struct.system__file_control_block__pstring** %103, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %105 = getelementptr %struct.system__file_control_block__pstring* > %104, i32 0, i32 0 ; [#uses=1] > + %106 = load i8** %105, align 4 ; [#uses=1] > + %107 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %108 = load i32* %107, align 4 ; [#uses=1] > + %109 = sub i32 %108, %102 ; [#uses=1] > + %110 = getelementptr i8* %106, i32 %109 ; [#uses=1] > + store i8 48, i8* %110, align 1 > + %111 = add i32 %j15.0, 1 ; [#uses=1] > + br label %bb40 > + > +bb43: ; preds = %bb37, %bb40 > + %112 = trunc i64 %abs to i32 ; [#uses=1] > + %113 = getelementptr [10 x i8]* @.str3, i32 0, i32 %112 ; > [#uses=1] > + %114 = load i8* %113, align 1 ; [#uses=1] > + %115 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %116 = load i32* %115, align 4 ; [#uses=1] > + %117 = add i32 %116, 1 ; [#uses=1] > + %118 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + store i32 %117, i32* %118, align 4 > + %119 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 4 ; [#uses=1] > + %120 = load i32* %119, align 4 ; [#uses=1] > + %121 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %122 = load %struct.system__file_control_block__pstring** %121, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %123 = getelementptr %struct.system__file_control_block__pstring* > %122, i32 0, i32 0 ; [#uses=1] > + %124 = load i8** %123, align 4 ; [#uses=1] > + %125 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %126 = load i32* %125, align 4 ; [#uses=1] > + %127 = sub i32 %126, %120 ; [#uses=1] > + %128 = getelementptr i8* %124, i32 %127 ; [#uses=1] > + store i8 %114, i8* %128, align 1 > + br label %bb48 > + > +bb44: ; preds = %bb19 > + %129 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 1 ; [#uses=1] > + %130 = load i32* %129, align 4 ; [#uses=1] > + %131 = icmp eq i32 %130, -1 ; [#uses=1] > + br i1 %131, label %bb46, label %bb47 > + > +bb46: ; preds = %bb44 > + %132 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %133 = load i32* %132, align 4 ; [#uses=1] > + %134 = add i32 %133, 1 ; [#uses=1] > + %135 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + store i32 %134, i32* %135, align 4 > + %136 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 4 ; [#uses=1] > + %137 = load i32* %136, align 4 ; [#uses=1] > + %138 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %139 = load %struct.system__file_control_block__pstring** %138, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %140 = getelementptr %struct.system__file_control_block__pstring* > %139, i32 0, i32 0 ; [#uses=1] > + %141 = load i8** %140, align 4 ; [#uses=1] > + %142 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %143 = load i32* %142, align 4 ; [#uses=1] > + %144 = sub i32 %143, %137 ; [#uses=1] > + %145 = getelementptr i8* %141, i32 %144 ; [#uses=1] > + store i8 46, i8* %145, align 1 > + br label %bb47 > + > +bb47: ; preds = %bb44, %bb46 > + %146 = trunc i64 %abs to i32 ; [#uses=1] > + %147 = getelementptr [10 x i8]* @.str3, i32 0, i32 %146 ; > [#uses=1] > + %148 = load i8* %147, align 1 ; [#uses=1] > + %149 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %150 = load i32* %149, align 4 ; [#uses=1] > + %151 = add i32 %150, 1 ; [#uses=1] > + %152 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + store i32 %151, i32* %152, align 4 > + %153 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 4 ; [#uses=1] > + %154 = load i32* %153, align 4 ; [#uses=1] > + %155 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 3 ; <%struct.system__file_control_block__pstring**> > [#uses=1] > + %156 = load %struct.system__file_control_block__pstring** %155, > align 4 ; <%struct.system__file_control_block__pstring*> [#uses=1] > + %157 = getelementptr %struct.system__file_control_block__pstring* > %156, i32 0, i32 0 ; [#uses=1] > + %158 = load i8** %157, align 4 ; [#uses=1] > + %159 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 5 ; [#uses=1] > + %160 = load i32* %159, align 4 ; [#uses=1] > + %161 = sub i32 %160, %154 ; [#uses=1] > + %162 = getelementptr i8* %158, i32 %161 ; [#uses=1] > + store i8 %148, i8* %162, align 1 > + br label %bb48 > + > +bb48: ; preds = %bb23, %bb47, %bb43 > + %163 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 1 ; [#uses=1] > + %164 = load i32* %163, align 4 ; [#uses=1] > + %165 = add i32 %164, -1 ; [#uses=1] > + %166 = getelementptr %struct.FRAME.ce3806g__fxio__put__4* %CHAIN. > 361, i32 0, i32 1 ; [#uses=1] > + store i32 %165, i32* %166, align 4 > + ret void > + > +return: ; preds = %entry > + ret void > +} > + > +define internal fastcc void > @ce3806g__fxio__put__put_scaled__4.1346 > (%struct.FRAME.ce3806g__fxio__put__4* %CHAIN.365, i64 %x, i64 %y, > i64 %z, i32 %a, i32 %e) { > +entry: > + %0 = alloca { i64, i64 } ; <{ i64, i64 }*> [#uses=3] > + %1 = call i8* @llvm.stacksave( ) ; [#uses=1] > + %2 = add i32 %a, 17 ; [#uses=2] > + %3 = sdiv i32 %2, 18 ; [#uses=3] > + %4 = add i32 %3, 1 ; [#uses=7] > + %5 = icmp sgt i32 %4, -1 ; [#uses=1] > + %max53 = select i1 %5, i32 %4, i32 0 ; [#uses=1] > + %6 = alloca i64, i32 %max53 ; [#uses=21] > + %7 = icmp sgt i32 %4, 0 ; [#uses=1] > + br i1 %7, label %bb55, label %bb58 > + > +bb55: ; preds = %entry, %bb57 > + %J60b.0 = phi i32 [ %11, %bb57 ], [ 1, %entry ] ; [#uses=3] > + %8 = add i32 %J60b.0, -1 ; [#uses=1] > + %9 = getelementptr i64* %6, i32 %8 ; [#uses=1] > + store i64 0, i64* %9, align 8 > + %10 = icmp eq i32 %4, %J60b.0 ; [#uses=1] > + br i1 %10, label %bb58, label %bb57 > + > +bb57: ; preds = %bb55 > + %11 = add i32 %J60b.0, 1 ; [#uses=1] > + br label %bb55 > + > +bb58: ; preds = %entry, %bb55 > + %12 = icmp sgt i32 %4, 0 ; [#uses=1] > + br i1 %12, label %bb61, label %bb91 > + > +bb61: ; preds = %bb58, %bb90 > + %j2.0 = phi i32 [ %88, %bb90 ], [ 1, %bb58 ] ; [#uses=11] > + %aa.0 = phi i32 [ %86, %bb90 ], [ %a, %bb58 ] ; [#uses=6] > + %yy.0 = phi i64 [ %84, %bb90 ], [ %y, %bb58 ] ; [#uses=3] > + %xx.0 = phi i64 [ %21, %bb90 ], [ %x, %bb58 ] ; [#uses=2] > + %13 = icmp eq i64 %xx.0, 0 ; [#uses=1] > + br i1 %13, label %bb91, label %bb63 > + > +bb63: ; preds = %bb61 > + %14 = icmp eq i32 %aa.0, 0 ; [#uses=1] > + %15 = zext i1 %14 to i8 ; [#uses=1] > + invoke void @system__arith_64__scaled_divide( { i64, i64 }* > noalias sret %0, i64 %xx.0, i64 %yy.0, i64 %z, i8 %15 ) > + to label %invcont unwind label %lpad > + > +invcont: ; preds = %bb63 > + %16 = getelementptr { i64, i64 }* %0, i32 0, i32 0 ; > [#uses=1] > + %17 = load i64* %16, align 8 ; [#uses=1] > + %18 = add i32 %j2.0, -1 ; [#uses=1] > + %19 = getelementptr i64* %6, i32 %18 ; [#uses=1] > + store i64 %17, i64* %19, align 8 > + %20 = getelementptr { i64, i64 }* %0, i32 0, i32 1 ; > [#uses=1] > + %21 = load i64* %20, align 8 ; [#uses=1] > + %22 = add i32 %j2.0, -1 ; [#uses=1] > + %23 = getelementptr i64* %6, i32 %22 ; [#uses=1] > + %24 = load i64* %23, align 8 ; [#uses=1] > + %25 = icmp eq i64 %24, %yy.0 ; [#uses=1] > + %26 = add i32 %j2.0, -1 ; [#uses=1] > + %27 = getelementptr i64* %6, i32 %26 ; [#uses=1] > + %28 = load i64* %27, align 8 ; [#uses=1] > + %29 = sub i64 0, %28 ; [#uses=1] > + %30 = icmp eq i64 %yy.0, %29 ; [#uses=1] > + %31 = or i1 %25, %30 ; [#uses=1] > + %32 = icmp sgt i32 %j2.0, 1 ; [#uses=1] > + %or.cond = and i1 %31, %32 ; [#uses=1] > + br i1 %or.cond, label %bb69, label %bb83 > + > +bb69: ; preds = %invcont > + %33 = add i32 %j2.0, -1 ; [#uses=1] > + %34 = getelementptr i64* %6, i32 %33 ; [#uses=1] > + %35 = load i64* %34, align 8 ; [#uses=1] > + %36 = icmp slt i64 %35, 0 ; [#uses=1] > + %37 = add i32 %j2.0, -2 ; [#uses=1] > + %38 = getelementptr i64* %6, i32 %37 ; [#uses=1] > + %39 = load i64* %38, align 8 ; [#uses=2] > + br i1 %36, label %bb71, label %bb72 > + > +bb71: ; preds = %bb69 > + %40 = add i64 %39, 1 ; [#uses=1] > + %41 = add i32 %j2.0, -2 ; [#uses=1] > + %42 = getelementptr i64* %6, i32 %41 ; [#uses=1] > + store i64 %40, i64* %42, align 8 > + br label %bb73 > + > +bb72: ; preds = %bb69 > + %43 = add i64 %39, -1 ; [#uses=1] > + %44 = add i32 %j2.0, -2 ; [#uses=1] > + %45 = getelementptr i64* %6, i32 %44 ; [#uses=1] > + store i64 %43, i64* %45, align 8 > + br label %bb73 > + > +bb73: ; preds = %bb72, %bb71 > + %46 = add i32 %j2.0, -1 ; [#uses=1] > + %47 = getelementptr i64* %6, i32 %46 ; [#uses=1] > + store i64 0, i64* %47, align 8 > + br label %bb74 > + > +bb74: ; preds = %bb82, %bb73 > + %j1.0 = phi i32 [ %4, %bb73 ], [ %81, %bb82 ] ; [#uses=12] > + %48 = icmp slt i32 %j1.0, 2 ; [#uses=1] > + br i1 %48, label %bb83, label %bb76 > + > +bb76: ; preds = %bb74 > + %49 = add i32 %j1.0, -1 ; [#uses=1] > + %50 = getelementptr i64* %6, i32 %49 ; [#uses=1] > + %51 = load i64* %50, align 8 ; [#uses=1] > + %52 = icmp sgt i64 %51, 999999999999999999 ; [#uses=1] > + br i1 %52, label %bb78, label %bb79 > + > +bb78: ; preds = %bb76 > + %53 = add i32 %j1.0, -2 ; [#uses=1] > + %54 = getelementptr i64* %6, i32 %53 ; [#uses=1] > + %55 = load i64* %54, align 8 ; [#uses=1] > + %56 = add i64 %55, 1 ; [#uses=1] > + %57 = add i32 %j1.0, -2 ; [#uses=1] > + %58 = getelementptr i64* %6, i32 %57 ; [#uses=1] > + store i64 %56, i64* %58, align 8 > + %59 = add i32 %j1.0, -1 ; [#uses=1] > + %60 = getelementptr i64* %6, i32 %59 ; [#uses=1] > + %61 = load i64* %60, align 8 ; [#uses=1] > + %62 = add i64 %61, -1000000000000000000 ; [#uses=1] > + %63 = add i32 %j1.0, -1 ; [#uses=1] > + %64 = getelementptr i64* %6, i32 %63 ; [#uses=1] > + store i64 %62, i64* %64, align 8 > + br label %bb82 > + > +bb79: ; preds = %bb76 > + %65 = add i32 %j1.0, -1 ; [#uses=1] > + %66 = getelementptr i64* %6, i32 %65 ; [#uses=1] > + %67 = load i64* %66, align 8 ; [#uses=1] > + %68 = icmp slt i64 %67, -999999999999999999 ; [#uses=1] > + br i1 %68, label %bb81, label %bb82 > + > +bb81: ; preds = %bb79 > + %69 = add i32 %j1.0, -2 ; [#uses=1] > + %70 = getelementptr i64* %6, i32 %69 ; [#uses=1] > + %71 = load i64* %70, align 8 ; [#uses=1] > + %72 = add i64 %71, -1 ; [#uses=1] > + %73 = add i32 %j1.0, -2 ; [#uses=1] > + %74 = getelementptr i64* %6, i32 %73 ; [#uses=1] > + store i64 %72, i64* %74, align 8 > + %75 = add i32 %j1.0, -1 ; [#uses=1] > + %76 = getelementptr i64* %6, i32 %75 ; [#uses=1] > + %77 = load i64* %76, align 8 ; [#uses=1] > + %78 = add i64 %77, 1000000000000000000 ; [#uses=1] > + %79 = add i32 %j1.0, -1 ; [#uses=1] > + %80 = getelementptr i64* %6, i32 %79 ; [#uses=1] > + store i64 %78, i64* %80, align 8 > + br label %bb82 > + > +bb82: ; preds = %bb79, %bb81, %bb78 > + %81 = add i32 %j1.0, -1 ; [#uses=1] > + br label %bb74 > + > +bb83: ; preds = %invcont, %bb74 > + %82 = icmp slt i32 %aa.0, 19 ; [#uses=1] > + %min = select i1 %82, i32 %aa.0, i32 18 ; [#uses=1] > + %83 = invoke i64 @system__exn_lli__exn_long_long_integer( i64 10, > i32 %min ) readnone > + to label %invcont86 unwind label %lpad ; [#uses=1] > + > +invcont86: ; preds = %bb83 > + %84 = sub i64 0, %83 ; [#uses=1] > + %85 = icmp slt i32 %aa.0, 19 ; [#uses=1] > + %min87 = select i1 %85, i32 %aa.0, i32 18 ; [#uses=1] > + %86 = sub i32 %aa.0, %min87 ; [#uses=1] > + %87 = icmp eq i32 %4, %j2.0 ; [#uses=1] > + br i1 %87, label %bb91, label %bb90 > + > +bb90: ; preds = %invcont86 > + %88 = add i32 %j2.0, 1 ; [#uses=1] > + br label %bb61 > + > +bb91: ; preds = %bb58, %bb61, %invcont86 > + %89 = icmp slt i32 %2, 18 ; [#uses=1] > + br i1 %89, label %bb98, label %bb94 > + > +bb94: ; preds = %bb91, %bb97 > + %j.0 = phi i32 [ %97, %bb97 ], [ 1, %bb91 ] ; [#uses=4] > + %90 = mul i32 %j.0, 18 ; [#uses=1] > + %91 = add i32 %90, -18 ; [#uses=1] > + %92 = sub i32 %e, %91 ; [#uses=1] > + %93 = add i32 %j.0, -1 ; [#uses=1] > + %94 = getelementptr i64* %6, i32 %93 ; [#uses=1] > + %95 = load i64* %94, align 8 ; [#uses=1] > + invoke fastcc void > @ce3806g__fxio__put__put_int64__4.1339 > ( %struct.FRAME.ce3806g__fxio__put__4* %CHAIN.365, i64 %95, i32 %92 ) > + to label %invcont95 unwind label %lpad > + > +invcont95: ; preds = %bb94 > + %96 = icmp eq i32 %3, %j.0 ; [#uses=1] > + br i1 %96, label %bb98, label %bb97 > + > +bb97: ; preds = %invcont95 > + %97 = add i32 %j.0, 1 ; [#uses=1] > + br label %bb94 > + > +bb98: ; preds = %bb91, %invcont95 > + %98 = sub i32 %e, %a ; [#uses=1] > + %99 = getelementptr i64* %6, i32 %3 ; [#uses=1] > + %100 = load i64* %99, align 8 ; [#uses=1] > + invoke fastcc void > @ce3806g__fxio__put__put_int64__4.1339 > ( %struct.FRAME.ce3806g__fxio__put__4* %CHAIN.365, i64 %100, i32 %98 ) > + to label %bb101 unwind label %lpad > + > +bb101: ; preds = %bb98 > + ret void > + > +lpad: ; preds = %bb98, %bb94, %bb83, %bb63 > + %eh_ptr = call i8* @llvm.eh.exception( ) ; [#uses=2] > + %eh_select103 = call i32 (i8*, i8*, ...)* > @llvm.eh.selector.i32( i8* %eh_ptr, i8* bitcast (i32 (...)* > @__gnat_eh_personality to i8*), i32* @__gnat_all_others_value ) ; > [#uses=0] > + call void @llvm.stackrestore( i8* %1 ) > + %101 = call i32 (...)* @_Unwind_Resume( i8* %eh_ptr ) ; > [#uses=0] > + unreachable > +} > + > +declare i8* @llvm.stacksave() nounwind > + > +declare void @system__arith_64__scaled_divide({ i64, i64 }* noalias > sret, i64, i64, i64, i8) > + > +declare i64 @system__exn_lli__exn_long_long_integer(i64, i32) > readnone > + > +declare void @llvm.stackrestore(i8*) nounwind > + > +declare i32 @system__img_real__set_image_real(x86_fp80, i8*, > %struct.string___XUB*, i32, i32, i32, i32) > + > +declare void > @ada__text_io__generic_aux__put_item > (%struct.ada__text_io__text_afcb*, i8*, %struct.string___XUB*) > + > +declare void @report__test(i8*, %struct.string___XUB*, i8*, > %struct.string___XUB*) > + > +declare void > @system__secondary_stack__ss_mark(%struct.string___XUB* noalias sret) > + > +declare void > @system__exception_table__register_exception > (%struct.system__standard_library__exception_data*) > + > +declare void > @report__legal_file_name > (%struct.system__file_control_block__pstring* noalias sret, i32, > i8*, %struct.string___XUB*) > + > +declare %struct.ada__text_io__text_afcb* > @ada__text_io__create(%struct.ada__text_io__text_afcb*, i8, i8*, > %struct.string___XUB*, i8*, %struct.string___XUB*) > + > +declare void @system__secondary_stack__ss_release(i32, i32) > + > +declare void @report__not_applicable(i8*, %struct.string___XUB*) > + > +declare void > @ada__text_io__set_output(%struct.ada__text_io__text_afcb*) > + > +declare %struct.ada__text_io__text_afcb* > @ada__text_io__close(%struct.ada__text_io__text_afcb*) > + > +declare %struct.ada__text_io__text_afcb* > @ada__text_io__open(%struct.ada__text_io__text_afcb*, i8, i8*, > %struct.string___XUB*, i8*, %struct.string___XUB*) > + > +declare %struct.ada__text_io__text_afcb* > @ada__text_io__standard_output() > + > +declare void @report__failed(i8*, %struct.string___XUB*) > + > +declare %struct.ada__text_io__text_afcb* > @ada__text_io__delete(%struct.ada__text_io__text_afcb*) > + > +declare void @report__result() > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Mon Sep 8 03:16:06 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 8 Sep 2008 01:16:06 -0700 Subject: [llvm-commits] [llvm] r55886 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp In-Reply-To: <92447DCF-2A3A-4474-A5B1-92B824F57C00@gmail.com> References: <200809071134.m87BYmME005825@zion.cs.uiuc.edu> <92447DCF-2A3A-4474-A5B1-92B824F57C00@gmail.com> Message-ID: <0A5ED1F5-C521-4E1E-9124-49065900B137@apple.com> On Sep 7, 2008, at 5:35 PM, Bill Wendling wrote: > It's not a bug in that this wasn't being done. I was doing a static > analysis of the DAG combiner and noticed that this wasn't doing what > the comment claimed it should be doing. If this transformation is > performed in the selection DAG code, then it should probably be > removed from here entirely (along with the analogous "ADD" > transformation). What do you think? No. The dag combiner xforms can still trigger. The issue is the operand can be updated by something like ReplaceAllUsesWith which will not transform the uses. Evan > > > -bw > > On Sep 7, 2008, at 5:19 PM, Evan Cheng wrote: > >> Is this fixing a bug? getNode should be performing constant folding. >> See SelectionDAG.cpp line 2441. If somehow that wasn't happening, >> please fix it there and provide a test case. >> >> Thanks, >> >> Evan >> >> On Sep 7, 2008, at 4:34 AM, Bill Wendling wrote: >> >>> Author: void >>> Date: Sun Sep 7 06:34:47 2008 >>> New Revision: 55886 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=55886&view=rev >>> Log: >>> Convert >>> >>> // fold (sub c1, c2) -> c1-c2 >>> >>> from a no-op into an actual transformation. >>> >>> 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=55886&r1=55885&r2=55886&view=diff >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) >>> +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Sep 7 >>> 06:34:47 2008 >>> @@ -1111,7 +1111,7 @@ >>> return DAG.getConstant(0, N->getValueType(0)); >>> // fold (sub c1, c2) -> c1-c2 >>> if (N0C && N1C) >>> - return DAG.getNode(ISD::SUB, VT, N0, N1); >>> + return DAG.getConstant(N0C->getAPIntValue() - N1C- >>>> getAPIntValue(), VT); >>> // fold (sub x, c) -> (add x, -c) >>> if (N1C) >>> return DAG.getNode(ISD::ADD, VT, N0, >>> >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From anton at korobeynikov.info Mon Sep 8 03:19:36 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 8 Sep 2008 12:19:36 +0400 Subject: [llvm-commits] LLVM IR change for review or committal In-Reply-To: <1220644043.23229.30.camel@Remington> References: <1220644043.23229.30.camel@Remington> Message-ID: Hello, Preston > Could someone please review these changes and either advise me what > additional changes you might want or else commit the patch for me? Please remove auto-generated stuff from patch, this simplifies review greatly. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From evan.cheng at apple.com Mon Sep 8 03:38:22 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 08 Sep 2008 08:38:22 -0000 Subject: [llvm-commits] [llvm] r55892 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Message-ID: <200809080838.m888cM9E026036@zion.cs.uiuc.edu> Author: evancheng Date: Mon Sep 8 03:38:20 2008 New Revision: 55892 URL: http://llvm.org/viewvc/llvm-project?rev=55892&view=rev Log: Add fast isel physical register definition support. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=55892&r1=55891&r2=55892&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Mon Sep 8 03:38:20 2008 @@ -576,7 +576,16 @@ unsigned ResultReg = createResultReg(RC); const TargetInstrDesc &II = TII.get(MachineInstOpcode); - BuildMI(MBB, II, ResultReg).addReg(Op0); + if (II.getNumDefs() >= 1) + BuildMI(MBB, II, ResultReg).addReg(Op0); + else { + BuildMI(MBB, II).addReg(Op0); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC); + if (!InsertedCopy) + ResultReg = 0; + } + return ResultReg; } @@ -586,7 +595,15 @@ unsigned ResultReg = createResultReg(RC); const TargetInstrDesc &II = TII.get(MachineInstOpcode); - BuildMI(MBB, II, ResultReg).addReg(Op0).addReg(Op1); + if (II.getNumDefs() >= 1) + BuildMI(MBB, II, ResultReg).addReg(Op0).addReg(Op1); + else { + BuildMI(MBB, II).addReg(Op0).addReg(Op1); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC); + if (!InsertedCopy) + ResultReg = 0; + } return ResultReg; } @@ -596,7 +613,15 @@ unsigned ResultReg = createResultReg(RC); const TargetInstrDesc &II = TII.get(MachineInstOpcode); - BuildMI(MBB, II, ResultReg).addReg(Op0).addImm(Imm); + if (II.getNumDefs() >= 1) + BuildMI(MBB, II, ResultReg).addReg(Op0).addImm(Imm); + else { + BuildMI(MBB, II).addReg(Op0).addImm(Imm); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC); + if (!InsertedCopy) + ResultReg = 0; + } return ResultReg; } @@ -606,7 +631,15 @@ unsigned ResultReg = createResultReg(RC); const TargetInstrDesc &II = TII.get(MachineInstOpcode); - BuildMI(MBB, II, ResultReg).addReg(Op0).addFPImm(FPImm); + if (II.getNumDefs() >= 1) + BuildMI(MBB, II, ResultReg).addReg(Op0).addFPImm(FPImm); + else { + BuildMI(MBB, II).addReg(Op0).addFPImm(FPImm); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC); + if (!InsertedCopy) + ResultReg = 0; + } return ResultReg; } @@ -616,7 +649,15 @@ unsigned ResultReg = createResultReg(RC); const TargetInstrDesc &II = TII.get(MachineInstOpcode); - BuildMI(MBB, II, ResultReg).addReg(Op0).addReg(Op1).addImm(Imm); + if (II.getNumDefs() >= 1) + BuildMI(MBB, II, ResultReg).addReg(Op0).addReg(Op1).addImm(Imm); + else { + BuildMI(MBB, II).addReg(Op0).addReg(Op1).addImm(Imm); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC); + if (!InsertedCopy) + ResultReg = 0; + } return ResultReg; } @@ -626,7 +667,15 @@ unsigned ResultReg = createResultReg(RC); const TargetInstrDesc &II = TII.get(MachineInstOpcode); - BuildMI(MBB, II, ResultReg).addImm(Imm); + if (II.getNumDefs() >= 1) + BuildMI(MBB, II, ResultReg).addImm(Imm); + else { + BuildMI(MBB, II).addImm(Imm); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC); + if (!InsertedCopy) + ResultReg = 0; + } return ResultReg; } @@ -637,6 +686,14 @@ unsigned ResultReg = createResultReg(SRC); const TargetInstrDesc &II = TII.get(TargetInstrInfo::EXTRACT_SUBREG); - BuildMI(MBB, II, ResultReg).addReg(Op0).addImm(Idx); + if (II.getNumDefs() >= 1) + BuildMI(MBB, II, ResultReg).addReg(Op0).addImm(Idx); + else { + BuildMI(MBB, II).addReg(Op0).addImm(Idx); + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + II.ImplicitDefs[0], RC, RC); + if (!InsertedCopy) + ResultReg = 0; + } return ResultReg; } From evan.cheng at apple.com Mon Sep 8 03:39:33 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 08 Sep 2008 08:39:33 -0000 Subject: [llvm-commits] [llvm] r55893 - in /llvm/trunk: test/CodeGen/X86/fast-isel-phys.ll utils/TableGen/FastISelEmitter.cpp Message-ID: <200809080839.m888dXdr026083@zion.cs.uiuc.edu> Author: evancheng Date: Mon Sep 8 03:39:33 2008 New Revision: 55893 URL: http://llvm.org/viewvc/llvm-project?rev=55893&view=rev Log: Correctly handle physical register inputs. They are not explicit input operands in the resulting machine instrs. Added: llvm/trunk/test/CodeGen/X86/fast-isel-phys.ll Modified: llvm/trunk/utils/TableGen/FastISelEmitter.cpp Added: llvm/trunk/test/CodeGen/X86/fast-isel-phys.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-phys.ll?rev=55893&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-phys.ll (added) +++ llvm/trunk/test/CodeGen/X86/fast-isel-phys.ll Mon Sep 8 03:39:33 2008 @@ -0,0 +1,11 @@ +; RUN: llvm-as < %s | llc -fast-isel -march=x86 + +define i8 @t2(i8 %a, i8 %c) nounwind { + %tmp = shl i8 %a, %c + ret i8 %tmp +} + +define i8 @t1(i8 %a) nounwind { + %tmp = mul i8 %a, 17 + ret i8 %tmp +} Modified: llvm/trunk/utils/TableGen/FastISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FastISelEmitter.cpp?rev=55893&r1=55892&r2=55893&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/FastISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/FastISelEmitter.cpp Mon Sep 8 03:39:33 2008 @@ -114,7 +114,7 @@ return false; Record *OpLeafRec = OpDI->getDef(); // For now, the only other thing we accept is register operands. - + const CodeGenRegisterClass *RC = 0; if (OpLeafRec->isSubClassOf("RegisterClass")) RC = &Target.getRegisterClass(OpLeafRec); @@ -157,21 +157,27 @@ void PrintArguments(std::ostream &OS, const std::vector& PR) const { assert(PR.size() == Operands.size()); + bool PrintedArg = false; for (unsigned i = 0, e = Operands.size(); i != e; ++i) { - if (PR[i] != "") { - OS << PR[i]; - } else if (Operands[i] == "r") { + if (PR[i] != "") + // Implicit physical register operand. + continue; + + if (PrintedArg) + OS << ", "; + if (Operands[i] == "r") { OS << "Op" << i; + PrintedArg = true; } else if (Operands[i] == "i") { OS << "imm" << i; + PrintedArg = true; } else if (Operands[i] == "f") { OS << "f" << i; + PrintedArg = true; } else { assert("Unknown operand kind!"); abort(); } - if (i + 1 != e) - OS << ", "; } } @@ -193,6 +199,20 @@ } + void PrintManglingSuffix(std::ostream &OS, + const std::vector& PR) const { + for (unsigned i = 0, e = Operands.size(); i != e; ++i) { + if (PR[i] != "") + // Implicit physical register operand. e.g. Instruction::Mul expect to + // select to a binary op. On x86, mul may take a single operand with + // the other operand being implicit. We must emit something that looks + // like a binary instruction except for the very inner FastEmitInst_* + // call. + continue; + OS << Operands[i]; + } + } + void PrintManglingSuffix(std::ostream &OS) const { for (unsigned i = 0, e = Operands.size(); i != e; ++i) { OS << Operands[i]; @@ -430,7 +450,7 @@ OS << " return FastEmitInst_"; if (Memo.SubRegNo == (unsigned char)~0) { - Operands.PrintManglingSuffix(OS); + Operands.PrintManglingSuffix(OS, *Memo.PhysRegs); OS << "(" << InstNS << Memo.Name << ", "; OS << InstNS << Memo.RC->getName() << "RegisterClass"; if (!Operands.empty()) @@ -497,7 +517,8 @@ // Emit code for each possible instruction. There may be // multiple if there are subtarget concerns. - for (PredMap::const_iterator PI = PM.begin(), PE = PM.end(); PI != PE; ++PI) { + for (PredMap::const_iterator PI = PM.begin(), PE = PM.end(); PI != PE; + ++PI) { std::string PredicateCheck = PI->first; const InstructionMemo &Memo = PI->second; @@ -523,7 +544,7 @@ OS << " return FastEmitInst_"; if (Memo.SubRegNo == (unsigned char)~0) { - Operands.PrintManglingSuffix(OS); + Operands.PrintManglingSuffix(OS, *Memo.PhysRegs); OS << "(" << InstNS << Memo.Name << ", "; OS << InstNS << Memo.RC->getName() << "RegisterClass"; if (!Operands.empty()) From baldrick at free.fr Mon Sep 8 06:05:59 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 08 Sep 2008 11:05:59 -0000 Subject: [llvm-commits] [llvm] r55894 - in /llvm/trunk: include/llvm/Analysis/CallGraph.h lib/Analysis/IPA/CallGraph.cpp lib/Transforms/IPO/PruneEH.cpp lib/Transforms/Utils/InlineFunction.cpp Message-ID: <200809081105.m88B5xnu031192@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 8 06:05:51 2008 New Revision: 55894 URL: http://llvm.org/viewvc/llvm-project?rev=55894&view=rev Log: Reapply 55859. This doesn't change anything as long as the callgraph is correct. It checks for wrong callgraphs more strictly. Modified: llvm/trunk/include/llvm/Analysis/CallGraph.h llvm/trunk/lib/Analysis/IPA/CallGraph.cpp llvm/trunk/lib/Transforms/IPO/PruneEH.cpp llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Modified: llvm/trunk/include/llvm/Analysis/CallGraph.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/CallGraph.h?rev=55894&r1=55893&r2=55894&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/CallGraph.h (original) +++ llvm/trunk/include/llvm/Analysis/CallGraph.h Mon Sep 8 06:05:51 2008 @@ -214,17 +214,12 @@ CalledFunctions.clear(); } - /// addCalledFunction add a function to the list of functions called by this + /// addCalledFunction - Add a function to the list of functions called by this /// one. void addCalledFunction(CallSite CS, CallGraphNode *M) { CalledFunctions.push_back(std::make_pair(CS, M)); } - /// removeCallEdgeTo - This method removes a *single* edge to the specified - /// callee function. Note that this method takes linear time, so it should be - /// used sparingly. - void removeCallEdgeTo(CallGraphNode *Callee); - /// removeCallEdgeFor - This method removes the edge in the node for the /// specified call site. Note that this method takes linear time, so it /// should be used sparingly. Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=55894&r1=55893&r2=55894&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Mon Sep 8 06:05:51 2008 @@ -272,26 +272,20 @@ else OS << "Call graph node <>:\n"; - for (const_iterator I = begin(), E = end(); I != E; ++I) + for (const_iterator I = begin(), E = end(); I != E; ++I) { if (I->second->getFunction()) - OS << " Calls function '" << I->second->getFunction()->getName() <<"'\n"; - else - OS << " Calls external node\n"; + OS << " Calls function '" << I->second->getFunction()->getName() << "'"; + else + OS << " Calls external node"; + if (I->first.getInstruction()) + OS << " from '" << *I->first.getInstruction() << "'"; + OS << "\n"; + } OS << "\n"; } void CallGraphNode::dump() const { print(cerr); } -void CallGraphNode::removeCallEdgeTo(CallGraphNode *Callee) { - for (unsigned i = CalledFunctions.size(); ; --i) { - assert(i && "Cannot find callee to remove!"); - if (CalledFunctions[i-1].second == Callee) { - CalledFunctions.erase(CalledFunctions.begin()+i-1); - return; - } - } -} - /// removeCallEdgeFor - This method removes the edge in the node for the /// specified call site. Note that this method takes linear time, so it /// should be used sparingly. Modified: llvm/trunk/lib/Transforms/IPO/PruneEH.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PruneEH.cpp?rev=55894&r1=55893&r2=55894&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PruneEH.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PruneEH.cpp Mon Sep 8 06:05:51 2008 @@ -228,13 +228,10 @@ CallGraphNode *CGN = CG[BB->getParent()]; for (BasicBlock::iterator I = BB->end(), E = BB->begin(); I != E; ) { --I; - if (CallInst *CI = dyn_cast(I)) { - if (Function *Callee = CI->getCalledFunction()) - CGN->removeCallEdgeTo(CG[Callee]); - } else if (InvokeInst *II = dyn_cast(I)) { - if (Function *Callee = II->getCalledFunction()) - CGN->removeCallEdgeTo(CG[Callee]); - } + if (CallInst *CI = dyn_cast(I)) + CGN->removeCallEdgeFor(CI); + else if (InvokeInst *II = dyn_cast(I)) + CGN->removeCallEdgeFor(II); if (!I->use_empty()) I->replaceAllUsesWith(UndefValue::get(I->getType())); } Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=55894&r1=55893&r2=55894&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Mon Sep 8 06:05:51 2008 @@ -143,16 +143,18 @@ /// UpdateCallGraphAfterInlining - Once we have cloned code over from a callee /// into the caller, update the specified callgraph to reflect the changes we /// made. Note that it's possible that not all code was copied over, so only -/// some edges of the callgraph will be remain. -static void UpdateCallGraphAfterInlining(const Function *Caller, - const Function *Callee, +/// some edges of the callgraph may remain. +static void UpdateCallGraphAfterInlining(CallSite CS, Function::iterator FirstNewBlock, DenseMap &ValueMap, CallGraph &CG) { + const Function *Caller = CS.getInstruction()->getParent()->getParent(); + const Function *Callee = CS.getCalledFunction(); + // Update the call graph by deleting the edge from Callee to Caller CallGraphNode *CalleeNode = CG[Callee]; CallGraphNode *CallerNode = CG[Caller]; - CallerNode->removeCallEdgeTo(CalleeNode); + CallerNode->removeCallEdgeFor(CS); // Since we inlined some uninlined call sites in the callee into the caller, // add edges from the caller to all of the callees of the callee. @@ -302,8 +304,7 @@ // Update the callgraph if requested. if (CG) - UpdateCallGraphAfterInlining(Caller, CalledFunc, FirstNewBlock, ValueMap, - *CG); + UpdateCallGraphAfterInlining(CS, FirstNewBlock, ValueMap, *CG); } // If there are any alloca instructions in the block that used to be the entry From baldrick at free.fr Mon Sep 8 06:07:35 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 08 Sep 2008 11:07:35 -0000 Subject: [llvm-commits] [llvm] r55895 - in /llvm/trunk: lib/Transforms/IPO/ArgumentPromotion.cpp test/Transforms/ArgumentPromotion/2008-09-07-CGUpdate.ll test/Transforms/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll Message-ID: <200809081107.m88B7aYh031270@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 8 06:07:35 2008 New Revision: 55895 URL: http://llvm.org/viewvc/llvm-project?rev=55895&view=rev Log: Update the callgraph correctly in ArgumentPromotion. Added: llvm/trunk/test/Transforms/ArgumentPromotion/2008-09-07-CGUpdate.ll llvm/trunk/test/Transforms/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=55895&r1=55894&r2=55895&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Mon Sep 8 06:07:35 2008 @@ -607,6 +607,10 @@ // changes. AliasAnalysis &AA = getAnalysis(); + // Get the callgraph information that we need to update to reflect our + // changes. + CallGraph &CG = getAnalysis(); + // Loop over all of the callers of the function, transforming the call sites // to pass in the loaded pointers. // @@ -710,6 +714,9 @@ // the old call with a new one. AA.replaceWithNewValue(Call, New); + // Update the callgraph to know that the callsite has been transformed. + CG[Call->getParent()->getParent()]->replaceCallSite(Call, New); + if (!Call->use_empty()) { Call->replaceAllUsesWith(New); New->takeName(Call); Added: llvm/trunk/test/Transforms/ArgumentPromotion/2008-09-07-CGUpdate.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ArgumentPromotion/2008-09-07-CGUpdate.ll?rev=55895&view=auto ============================================================================== --- llvm/trunk/test/Transforms/ArgumentPromotion/2008-09-07-CGUpdate.ll (added) +++ llvm/trunk/test/Transforms/ArgumentPromotion/2008-09-07-CGUpdate.ll Mon Sep 8 06:07:35 2008 @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | opt -inline -argpromotion -disable-output + +define internal fastcc i32 @hash(i32* %ts, i32 %mod) nounwind { +entry: + unreachable +} + +define void @encode(i32* %m, i32* %ts, i32* %new) nounwind { +entry: + %0 = call fastcc i32 @hash( i32* %ts, i32 0 ) nounwind ; [#uses=0] + unreachable +} Added: llvm/trunk/test/Transforms/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll?rev=55895&view=auto ============================================================================== --- llvm/trunk/test/Transforms/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll (added) +++ llvm/trunk/test/Transforms/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll Mon Sep 8 06:07:35 2008 @@ -0,0 +1,25 @@ +; RUN: llvm-as < %s | opt -argpromotion -disable-output + +define internal fastcc i32 @term_SharingList(i32* %Term, i32* %List) nounwind { +entry: + br i1 false, label %bb, label %bb5 + +bb: ; preds = %entry + %0 = call fastcc i32 @term_SharingList( i32* null, i32* %List ) nounwind ; [#uses=0] + unreachable + +bb5: ; preds = %entry + ret i32 0 +} + +define i32 @term_Sharing(i32* %Term) nounwind { +entry: + br i1 false, label %bb.i, label %bb14 + +bb.i: ; preds = %entry + %0 = call fastcc i32 @term_SharingList( i32* null, i32* null ) nounwind ; [#uses=0] + ret i32 1 + +bb14: ; preds = %entry + ret i32 0 +} From baldrick at free.fr Mon Sep 8 06:08:09 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 08 Sep 2008 11:08:09 -0000 Subject: [llvm-commits] [llvm] r55896 - /llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Message-ID: <200809081108.m88B89se031302@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 8 06:08:09 2008 New Revision: 55896 URL: http://llvm.org/viewvc/llvm-project?rev=55896&view=rev Log: Update the callgraph correctly. Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp?rev=55896&r1=55895&r2=55896&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Mon Sep 8 06:08:09 2008 @@ -252,7 +252,7 @@ /// updateCallSites - Update all sites that call F to use NF. void SRETPromotion::updateCallSites(Function *F, Function *NF) { - + CallGraph &CG = getAnalysis(); SmallVector Args; // ParamAttrs - Keep track of the parameter attributes for the arguments. @@ -303,6 +303,9 @@ ArgAttrsVec.clear(); New->takeName(Call); + // Update the callgraph to know that the callsite has been transformed. + CG[Call->getParent()->getParent()]->replaceCallSite(Call, New); + // Update all users of sret parameter to extract value using extractvalue. for (Value::use_iterator UI = FirstCArg->use_begin(), UE = FirstCArg->use_end(); UI != UE; ) { From rafael.espindola at gmail.com Mon Sep 8 06:17:54 2008 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 08 Sep 2008 11:17:54 -0000 Subject: [llvm-commits] [llvm] r55897 - /llvm/trunk/test/CodeGen/Generic/fastcall.ll Message-ID: <200809081117.m88BHsUS031612@zion.cs.uiuc.edu> Author: rafael Date: Mon Sep 8 06:17:54 2008 New Revision: 55897 URL: http://llvm.org/viewvc/llvm-project?rev=55897&view=rev Log: Add testcase from bug 2770. Added: llvm/trunk/test/CodeGen/Generic/fastcall.ll Added: llvm/trunk/test/CodeGen/Generic/fastcall.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/fastcall.ll?rev=55897&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/fastcall.ll (added) +++ llvm/trunk/test/CodeGen/Generic/fastcall.ll Mon Sep 8 06:17:54 2008 @@ -0,0 +1,14 @@ +; Test fastcc works. Test from bug 2770. +; RUN: llvm-as < %s | llc -relocation-model=pic + + +%struct.__gcov_var = type { i32 } + at __gcov_var = external global %struct.__gcov_var + +define fastcc void @gcov_read_words(i32 %words) { +entry: + store i32 %words, i32* getelementptr (%struct.__gcov_var* + at __gcov_var, +i32 0, i32 0) + ret void +} From asl at math.spbu.ru Mon Sep 8 09:21:11 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 14:21:11 -0000 Subject: [llvm-commits] [llvm] r55898 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200809081421.m88ELB1A005241@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 09:21:10 2008 New Revision: 55898 URL: http://llvm.org/viewvc/llvm-project?rev=55898&view=rev Log: Implement FRAME_TO_ARGS_OFFSET for x86-64 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=55898&r1=55897&r2=55898&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Sep 8 09:21:10 2008 @@ -258,8 +258,7 @@ } // X86 ret instruction may pop stack. setOperationAction(ISD::RET , MVT::Other, Custom); - if (!Subtarget->is64Bit()) - setOperationAction(ISD::EH_RETURN , MVT::Other, Custom); + setOperationAction(ISD::EH_RETURN , MVT::Other, Custom); // Darwin ABI issue. setOperationAction(ISD::ConstantPool , MVT::i32 , Custom); @@ -325,7 +324,8 @@ setExceptionSelectorRegister(X86::EDX); } setOperationAction(ISD::FRAME_TO_ARGS_OFFSET, MVT::i32, Custom); - + setOperationAction(ISD::FRAME_TO_ARGS_OFFSET, MVT::i64, Custom); + setOperationAction(ISD::TRAMPOLINE, MVT::Other, Custom); setOperationAction(ISD::TRAP, MVT::Other, Legal); @@ -5593,19 +5593,15 @@ // Depths > 0 not supported yet! if (cast(Op.getOperand(0))->getValue() > 0) return SDValue(); - + SDValue RetAddrFI = getReturnAddressFrameIndex(DAG); - return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI, + return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI, DAG.getIntPtrConstant(!Subtarget->is64Bit() ? 4 : 8)); } SDValue X86TargetLowering::LowerFRAME_TO_ARGS_OFFSET(SDValue Op, - SelectionDAG &DAG) { - // Is not yet supported on x86-64 - if (Subtarget->is64Bit()) - return SDValue(); - - return DAG.getIntPtrConstant(8); + SelectionDAG &DAG) { + return DAG.getIntPtrConstant(Subtarget->is64Bit() ? 16 : 8); } SDValue X86TargetLowering::LowerEH_RETURN(SDValue Op, SelectionDAG &DAG) From asl at math.spbu.ru Mon Sep 8 09:21:54 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 14:21:54 -0000 Subject: [llvm-commits] [llvm] r55899 - in /llvm/trunk: include/llvm/Intrinsics.td lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86Instr64bit.td lib/Target/X86/X86RegisterInfo.cpp Message-ID: <200809081421.m88ELsDc005277@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 09:21:53 2008 New Revision: 55899 URL: http://llvm.org/viewvc/llvm-project?rev=55899&view=rev Log: First draft of EH support on x86/64-linux Modified: llvm/trunk/include/llvm/Intrinsics.td llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Modified: llvm/trunk/include/llvm/Intrinsics.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=55899&r1=55898&r2=55899&view=diff ============================================================================== --- llvm/trunk/include/llvm/Intrinsics.td (original) +++ llvm/trunk/include/llvm/Intrinsics.td Mon Sep 8 09:21:53 2008 @@ -255,8 +255,8 @@ def int_eh_typeid_for_i32 : Intrinsic<[llvm_i32_ty, llvm_ptr_ty]>; def int_eh_typeid_for_i64 : Intrinsic<[llvm_i64_ty, llvm_ptr_ty]>; -def int_eh_return : Intrinsic<[llvm_void_ty, llvm_i32_ty, llvm_ptr_ty]>, - GCCBuiltin<"__builtin_eh_return">; +def int_eh_return_i32 : Intrinsic<[llvm_void_ty, llvm_i32_ty, llvm_ptr_ty]>; +def int_eh_return_i64 : Intrinsic<[llvm_void_ty, llvm_i64_ty, llvm_ptr_ty]>; def int_eh_unwind_init: Intrinsic<[llvm_void_ty]>, GCCBuiltin<"__builtin_unwind_init">; Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=55899&r1=55898&r2=55899&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Sep 8 09:21:53 2008 @@ -316,7 +316,6 @@ setOperationAction(ISD::EXCEPTIONADDR, MVT::i32, Expand); setOperationAction(ISD::EHSELECTION, MVT::i32, Expand); if (Subtarget->is64Bit()) { - // FIXME: Verify setExceptionPointerRegister(X86::RAX); setExceptionSelectorRegister(X86::RDX); } else { @@ -5596,7 +5595,7 @@ SDValue RetAddrFI = getReturnAddressFrameIndex(DAG); return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI, - DAG.getIntPtrConstant(!Subtarget->is64Bit() ? 4 : 8)); + DAG.getIntPtrConstant(Subtarget->is64Bit() ? 8 : 4)); } SDValue X86TargetLowering::LowerFRAME_TO_ARGS_OFFSET(SDValue Op, @@ -5606,26 +5605,26 @@ SDValue X86TargetLowering::LowerEH_RETURN(SDValue Op, SelectionDAG &DAG) { - assert(!Subtarget->is64Bit() && - "Lowering of eh_return builtin is not supported yet on x86-64"); - MachineFunction &MF = DAG.getMachineFunction(); SDValue Chain = Op.getOperand(0); SDValue Offset = Op.getOperand(1); SDValue Handler = Op.getOperand(2); - SDValue Frame = DAG.getRegister(RegInfo->getFrameRegister(MF), - getPointerTy()); + SDValue Frame = DAG.getRegister(Subtarget->is64Bit() ? X86::RBP : X86::EBP, + getPointerTy()); + unsigned StoreAddrReg = (Subtarget->is64Bit() ? X86::RCX : X86::ECX); SDValue StoreAddr = DAG.getNode(ISD::SUB, getPointerTy(), Frame, - DAG.getIntPtrConstant(-4UL)); + DAG.getIntPtrConstant(Subtarget->is64Bit() ? + -8UL: -4UL)); StoreAddr = DAG.getNode(ISD::ADD, getPointerTy(), StoreAddr, Offset); Chain = DAG.getStore(Chain, Handler, StoreAddr, NULL, 0); - Chain = DAG.getCopyToReg(Chain, X86::ECX, StoreAddr); - MF.getRegInfo().addLiveOut(X86::ECX); + Chain = DAG.getCopyToReg(Chain, StoreAddrReg, StoreAddr); + MF.getRegInfo().addLiveOut(StoreAddrReg); - return DAG.getNode(X86ISD::EH_RETURN, MVT::Other, - Chain, DAG.getRegister(X86::ECX, getPointerTy())); + return DAG.getNode(X86ISD::EH_RETURN, + MVT::Other, + Chain, DAG.getRegister(StoreAddrReg, getPointerTy())); } SDValue X86TargetLowering::LowerTRAMPOLINE(SDValue Op, Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=55899&r1=55898&r2=55899&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Mon Sep 8 09:21:53 2008 @@ -130,6 +130,17 @@ } //===----------------------------------------------------------------------===// +// EH Pseudo Instructions +// +let isTerminator = 1, isReturn = 1, isBarrier = 1, + hasCtrlDep = 1 in { +def EH_RETURN64 : I<0xC3, RawFrm, (outs), (ins GR64:$addr), + "ret\t#eh_return, addr: $addr", + [(X86ehret GR64:$addr)]>; + +} + +//===----------------------------------------------------------------------===// // Miscellaneous Instructions... // let Defs = [RBP,RSP], Uses = [RBP,RSP], mayLoad = 1, neverHasSideEffects = 1 in Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=55899&r1=55898&r2=55899&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Mon Sep 8 09:21:53 2008 @@ -159,6 +159,14 @@ const unsigned * X86RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const { + bool callsEHReturn = false; + + if (MF) { + const MachineFrameInfo *MFI = MF->getFrameInfo(); + const MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); + callsEHReturn = (MMI ? MMI->callsEHReturn() : false); + } + static const unsigned CalleeSavedRegs32Bit[] = { X86::ESI, X86::EDI, X86::EBX, X86::EBP, 0 }; @@ -171,6 +179,11 @@ X86::RBX, X86::R12, X86::R13, X86::R14, X86::R15, X86::RBP, 0 }; + static const unsigned CalleeSavedRegs64EHRet[] = { + X86::RAX, X86::RDX, X86::RBX, X86::R12, + X86::R13, X86::R14, X86::R15, X86::RBP, 0 + }; + static const unsigned CalleeSavedRegsWin64[] = { X86::RBX, X86::RBP, X86::RDI, X86::RSI, X86::R12, X86::R13, X86::R14, X86::R15, 0 @@ -180,20 +193,22 @@ if (IsWin64) return CalleeSavedRegsWin64; else - return CalleeSavedRegs64Bit; + return (callsEHReturn ? CalleeSavedRegs64EHRet : CalleeSavedRegs64Bit); } else { - if (MF) { - const MachineFrameInfo *MFI = MF->getFrameInfo(); - const MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); - if (MMI && MMI->callsEHReturn()) - return CalleeSavedRegs32EHRet; - } - return CalleeSavedRegs32Bit; + return (callsEHReturn ? CalleeSavedRegs32EHRet : CalleeSavedRegs32Bit); } } const TargetRegisterClass* const* X86RegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const { + bool callsEHReturn = false; + + if (MF) { + const MachineFrameInfo *MFI = MF->getFrameInfo(); + const MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); + callsEHReturn = (MMI ? MMI->callsEHReturn() : false); + } + static const TargetRegisterClass * const CalleeSavedRegClasses32Bit[] = { &X86::GR32RegClass, &X86::GR32RegClass, &X86::GR32RegClass, &X86::GR32RegClass, 0 @@ -208,6 +223,12 @@ &X86::GR64RegClass, &X86::GR64RegClass, &X86::GR64RegClass, &X86::GR64RegClass, 0 }; + static const TargetRegisterClass * const CalleeSavedRegClasses64EHRet[] = { + &X86::GR64RegClass, &X86::GR64RegClass, + &X86::GR64RegClass, &X86::GR64RegClass, + &X86::GR64RegClass, &X86::GR64RegClass, + &X86::GR64RegClass, &X86::GR64RegClass, 0 + }; static const TargetRegisterClass * const CalleeSavedRegClassesWin64[] = { &X86::GR64RegClass, &X86::GR64RegClass, &X86::GR64RegClass, &X86::GR64RegClass, @@ -219,17 +240,12 @@ if (IsWin64) return CalleeSavedRegClassesWin64; else - return CalleeSavedRegClasses64Bit; + return (callsEHReturn ? + CalleeSavedRegClasses64EHRet : CalleeSavedRegClasses64Bit); } else { - if (MF) { - const MachineFrameInfo *MFI = MF->getFrameInfo(); - const MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); - if (MMI && MMI->callsEHReturn()) - return CalleeSavedRegClasses32EHRet; - } - return CalleeSavedRegClasses32Bit; + return (callsEHReturn ? + CalleeSavedRegClasses32EHRet : CalleeSavedRegClasses32Bit); } - } BitVector X86RegisterInfo::getReservedRegs(const MachineFunction &MF) const { @@ -787,6 +803,7 @@ case X86::TCRETURNri64: case X86::TCRETURNdi64: case X86::EH_RETURN: + case X86::EH_RETURN64: case X86::TAILJMPd: case X86::TAILJMPr: case X86::TAILJMPm: break; // These are ok @@ -860,12 +877,13 @@ } // We're returning from function via eh_return. - if (RetOpcode == X86::EH_RETURN) { + if (RetOpcode == X86::EH_RETURN || RetOpcode == X86::EH_RETURN64) { MBBI = prior(MBB.end()); MachineOperand &DestAddr = MBBI->getOperand(0); assert(DestAddr.isRegister() && "Offset should be in register!"); - BuildMI(MBB, MBBI, TII.get(Is64Bit ? X86::MOV64rr : X86::MOV32rr),StackPtr). - addReg(DestAddr.getReg()); + BuildMI(MBB, MBBI, + TII.get(Is64Bit ? X86::MOV64rr : X86::MOV32rr), + StackPtr).addReg(DestAddr.getReg()); // Tail call return: adjust the stack pointer and jump to callee } else if (RetOpcode == X86::TCRETURNri || RetOpcode == X86::TCRETURNdi || RetOpcode== X86::TCRETURNri64 || RetOpcode == X86::TCRETURNdi64) { From asl at math.spbu.ru Mon Sep 8 09:22:16 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 14:22:16 -0000 Subject: [llvm-commits] [llvm] r55900 - /llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Message-ID: <200809081422.m88EMGcI005300@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 09:22:16 2008 New Revision: 55900 URL: http://llvm.org/viewvc/llvm-project?rev=55900&view=rev Log: We do support EH on x86-64! Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=55900&r1=55899&r2=55900&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Mon Sep 8 09:22:16 2008 @@ -261,8 +261,7 @@ DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\", at progbits"; // Exceptions handling - if (!is64Bit) - SupportsExceptionHandling = true; + SupportsExceptionHandling = true; AbsoluteEHSectionOffsets = false; DwarfEHFrameSection = "\t.section\t.eh_frame,\"aw\", at progbits"; DwarfExceptionSection = "\t.section\t.gcc_except_table,\"a\", at progbits"; From asl at math.spbu.ru Mon Sep 8 09:22:39 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 14:22:39 -0000 Subject: [llvm-commits] [llvm] r55901 - /llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Message-ID: <200809081422.m88EMdih005320@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 09:22:38 2008 New Revision: 55901 URL: http://llvm.org/viewvc/llvm-project?rev=55901&view=rev Log: Drop unused variable Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=55901&r1=55900&r2=55901&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Mon Sep 8 09:22:38 2008 @@ -230,7 +230,6 @@ X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM): X86TargetAsmInfo(TM), ELFTargetAsmInfo(TM) { - bool is64Bit = ETM->getSubtarget().is64Bit(); ReadOnlySection = ".rodata"; FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\", at progbits,4"; From asl at math.spbu.ru Mon Sep 8 09:22:57 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 14:22:57 -0000 Subject: [llvm-commits] [llvm] r55902 - /llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll Message-ID: <200809081422.m88EMvtI005341@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 09:22:57 2008 New Revision: 55902 URL: http://llvm.org/viewvc/llvm-project?rev=55902&view=rev Log: Add test for checking proper lowering of eh_return & unwind init intrinsics on 32bit x86 targets Added: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll Added: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll?rev=55902&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll Mon Sep 8 09:22:57 2008 @@ -0,0 +1,17 @@ +; Check that eh_return & unwind_init were properly lowered +; RUN: llvm-as < %s | llc | grep %ebp | count 9 +; RUN: llvm-as < %s | llc | grep %ecx | count 5 + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" +target triple = "i386-pc-linux" + +define i8* @test(i32 %a, i8* %b) { +entry: + call void @llvm.eh.unwind.init() + %foo = alloca i32 + call void @llvm.eh.return.i32(i32 %a, i8* %b) + unreachable +} + +declare void @llvm.eh.return.i32(i32, i8*) +declare void @llvm.eh.unwind.init() From asl at math.spbu.ru Mon Sep 8 09:23:16 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 14:23:16 -0000 Subject: [llvm-commits] [llvm] r55903 - /llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll Message-ID: <200809081423.m88ENGB4005362@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 09:23:16 2008 New Revision: 55903 URL: http://llvm.org/viewvc/llvm-project?rev=55903&view=rev Log: Testcase for 64-bit lowering of eh_return & unwind_init Added: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll Added: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll?rev=55903&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll Mon Sep 8 09:23:16 2008 @@ -0,0 +1,17 @@ +; Check that eh_return & unwind_init were properly lowered +; RUN: llvm-as < %s | llc | grep %rbp | count 7 +; RUN: llvm-as < %s | llc | grep %rcx | count 3 + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" +target triple = "x86_64-unknown-linux-gnu" + +define i8* @test(i64 %a, i8* %b) { +entry: + call void @llvm.eh.unwind.init() + %foo = alloca i32 + call void @llvm.eh.return.i64(i64 %a, i8* %b) + unreachable +} + +declare void @llvm.eh.return.i64(i64, i8*) +declare void @llvm.eh.unwind.init() From asl at math.spbu.ru Mon Sep 8 09:23:34 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 14:23:34 -0000 Subject: [llvm-commits] [llvm] r55904 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200809081423.m88ENZKt005381@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 09:23:34 2008 New Revision: 55904 URL: http://llvm.org/viewvc/llvm-project?rev=55904&view=rev Log: Unbreak and fix indentation Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=55904&r1=55903&r2=55904&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Sep 8 09:23:34 2008 @@ -3115,7 +3115,7 @@ MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); MVT VT = (Intrinsic == Intrinsic::eh_typeid_for_i32 ? MVT::i32 : MVT::i64); - + if (MMI) { // Find the type id for the given typeinfo. GlobalVariable *GV = ExtractTypeInfo(I.getOperand(1)); @@ -3130,10 +3130,9 @@ return 0; } - case Intrinsic::eh_return: { - MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); - - if (MMI) { + case Intrinsic::eh_return_i32: + case Intrinsic::eh_return_i64: + if (MachineModuleInfo *MMI = DAG.getMachineModuleInfo()) { MMI->setCallsEHReturn(true); DAG.setRoot(DAG.getNode(ISD::EH_RETURN, MVT::Other, @@ -3145,39 +3144,36 @@ } return 0; - } + case Intrinsic::eh_unwind_init: + if (MachineModuleInfo *MMI = DAG.getMachineModuleInfo()) { + MMI->setCallsUnwindInit(true); + } - case Intrinsic::eh_unwind_init: { - if (MachineModuleInfo *MMI = DAG.getMachineModuleInfo()) { - MMI->setCallsUnwindInit(true); - } - - return 0; - } - - case Intrinsic::eh_dwarf_cfa: { - MVT VT = getValue(I.getOperand(1)).getValueType(); - SDValue CfaArg; - if (VT.bitsGT(TLI.getPointerTy())) - CfaArg = DAG.getNode(ISD::TRUNCATE, - TLI.getPointerTy(), getValue(I.getOperand(1))); - else - CfaArg = DAG.getNode(ISD::SIGN_EXTEND, - TLI.getPointerTy(), getValue(I.getOperand(1))); - - SDValue Offset = DAG.getNode(ISD::ADD, - TLI.getPointerTy(), - DAG.getNode(ISD::FRAME_TO_ARGS_OFFSET, - TLI.getPointerTy()), - CfaArg); - setValue(&I, DAG.getNode(ISD::ADD, - TLI.getPointerTy(), - DAG.getNode(ISD::FRAMEADDR, - TLI.getPointerTy(), - DAG.getConstant(0, - TLI.getPointerTy())), - Offset)); - return 0; + return 0; + + case Intrinsic::eh_dwarf_cfa: { + MVT VT = getValue(I.getOperand(1)).getValueType(); + SDValue CfaArg; + if (VT.bitsGT(TLI.getPointerTy())) + CfaArg = DAG.getNode(ISD::TRUNCATE, + TLI.getPointerTy(), getValue(I.getOperand(1))); + else + CfaArg = DAG.getNode(ISD::SIGN_EXTEND, + TLI.getPointerTy(), getValue(I.getOperand(1))); + + SDValue Offset = DAG.getNode(ISD::ADD, + TLI.getPointerTy(), + DAG.getNode(ISD::FRAME_TO_ARGS_OFFSET, + TLI.getPointerTy()), + CfaArg); + setValue(&I, DAG.getNode(ISD::ADD, + TLI.getPointerTy(), + DAG.getNode(ISD::FRAMEADDR, + TLI.getPointerTy(), + DAG.getConstant(0, + TLI.getPointerTy())), + Offset)); + return 0; } case Intrinsic::sqrt: From evan.cheng at apple.com Mon Sep 8 09:35:19 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 08 Sep 2008 14:35:19 -0000 Subject: [llvm-commits] [test-suite] r55905 - /test-suite/trunk/Makefile.programs Message-ID: <200809081435.m88EZJjp005786@zion.cs.uiuc.edu> Author: evancheng Date: Mon Sep 8 09:35:18 2008 New Revision: 55905 URL: http://llvm.org/viewvc/llvm-project?rev=55905&view=rev Log: Don't do -aggressive-remat as llcbeta. It's causing llc to hang on sqlite3. Switch to -fast-isel on x86, -machine-licm on ppc. 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=55905&r1=55904&r2=55905&view=diff ============================================================================== --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Mon Sep 8 09:35:18 2008 @@ -205,8 +205,8 @@ endif#DISABLE_DIFFS ifeq ($(ARCH),PowerPC) -LLCBETAOPTION := -aggressive-remat -#-machine-licm +LLCBETAOPTION := -machine-licm +#-aggressive-remat #-enable-sinking #--enable-tail-merge #--enable-ppc-preinc @@ -220,7 +220,8 @@ LLCBETAOPTION := -sched=simple endif ifeq ($(ARCH),x86) -LLCBETAOPTION := -aggressive-remat +LLCBETAOPTION := -fast-isel +#-aggressive-remat #-machine-licm #-new-spilling-heuristic #-enable-value-prop From asl at math.spbu.ru Mon Sep 8 09:36:25 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 14:36:25 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55906 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200809081436.m88EaPlI005835@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 09:36:25 2008 New Revision: 55906 URL: http://llvm.org/viewvc/llvm-project?rev=55906&view=rev Log: Provide i64 version of eh_return 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=55906&r1=55905&r2=55906&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Sep 8 09:36:25 2008 @@ -5273,9 +5273,10 @@ int cfa_offset = ARG_POINTER_CFA_OFFSET(exp); + // FIXME: is i32 always enough here? Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, - Intrinsic::eh_dwarf_cfa), - ConstantInt::get(Type::Int32Ty, cfa_offset)); + Intrinsic::eh_dwarf_cfa), + ConstantInt::get(Type::Int32Ty, cfa_offset)); return true; } @@ -5324,17 +5325,21 @@ if (!validate_arglist(arglist, INTEGER_TYPE, POINTER_TYPE, VOID_TYPE)) return false; + const Type *IntPtr = TD.getIntPtrType(); Value *Offset = Emit(TREE_VALUE(arglist), 0); Value *Handler = Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0); - Offset = Builder.CreateIntCast(Offset, Type::Int32Ty, true); + + Intrinsic::ID IID = (IntPtr == Type::Int32Ty ? + Intrinsic::eh_return_i32 : Intrinsic::eh_return_i64); + + Offset = Builder.CreateIntCast(Offset, IntPtr, true); Handler = BitCastToType(Handler, PointerType::getUnqual(Type::Int8Ty)); SmallVector Args; Args.push_back(Offset); Args.push_back(Handler); - Builder.CreateCall(Intrinsic::getDeclaration(TheModule, - Intrinsic::eh_return), - Args.begin(), Args.end()); + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, IID), + Args.begin(), Args.end()); Result = Builder.CreateUnreachable(); EmitBlock(BasicBlock::Create("")); From asl at math.spbu.ru Mon Sep 8 09:36:39 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 14:36:39 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55907 - /llvm-gcc-4.2/trunk/README.LLVM Message-ID: <200809081436.m88Ead9v005854@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 09:36:38 2008 New Revision: 55907 URL: http://llvm.org/viewvc/llvm-project?rev=55907&view=rev Log: We do support PIC on x86-64! Modified: llvm-gcc-4.2/trunk/README.LLVM Modified: llvm-gcc-4.2/trunk/README.LLVM URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/README.LLVM?rev=55907&r1=55906&r2=55907&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/README.LLVM (original) +++ llvm-gcc-4.2/trunk/README.LLVM Mon Sep 8 09:36:38 2008 @@ -57,10 +57,7 @@ //===----------------------- X86-64/AMD-64/EM64-T for any OS other than Darwin/Mac OS X: -When targeting non-darwin X86-64/AMD-64/EM64-T, configure with ---disable-shared. The LLVM X86-64 backend doesn't support PIC codegen on -non-darwin systems yet. If you get a build error, try configuring with ---disable-multilib. +If you get a build error, try configuring with --disable-multilib. //===----------------------- From asl at math.spbu.ru Mon Sep 8 09:36:51 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 14:36:51 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55908 - /llvm-gcc-4.2/trunk/README.LLVM Message-ID: <200809081436.m88EapgF005871@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 09:36:51 2008 New Revision: 55908 URL: http://llvm.org/viewvc/llvm-project?rev=55908&view=rev Log: Do not confuse users with darwin-specific hacks Modified: llvm-gcc-4.2/trunk/README.LLVM Modified: llvm-gcc-4.2/trunk/README.LLVM URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/README.LLVM?rev=55908&r1=55907&r2=55908&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/README.LLVM (original) +++ llvm-gcc-4.2/trunk/README.LLVM Mon Sep 8 09:36:51 2008 @@ -116,12 +116,18 @@ --enable-llvm=$LLVMOBJDIR --enable-languages=c,c++$EXTRALANGS $TARGETOPTIONS $ make $BUILDOPTIONS $ make install + +//===----------------------- +Darwin/Mac OS X Specific part: + $ ln -sf /usr/lib/libstdc++.6.dylib `pwd`/../install/lib $ ln -sf /usr/lib/libstdc++.6.dylib `pwd`/../install/lib/libstdc++.dylib That last step, "ln -sf ..." is required so that the linker (collect2) can find libstdc++ ('-lstdc++') and subsequently link C++ executables correctly. +//===----------------------- + Note that if you prefer to bootstrap llvm-gcc (so that the final llvm-gcc executables have been compiled with llvm-gcc itself), replace "make" with "make bootstrap". From asl at math.spbu.ru Mon Sep 8 09:37:04 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 14:37:04 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55909 - /llvm-gcc-4.2/trunk/README.LLVM Message-ID: <200809081437.m88Eb4er005890@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 09:37:03 2008 New Revision: 55909 URL: http://llvm.org/viewvc/llvm-project?rev=55909&view=rev Log: We do support multilib! Clarify possible issues & fixes. Modified: llvm-gcc-4.2/trunk/README.LLVM Modified: llvm-gcc-4.2/trunk/README.LLVM URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/README.LLVM?rev=55909&r1=55908&r2=55909&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/README.LLVM (original) +++ llvm-gcc-4.2/trunk/README.LLVM Mon Sep 8 09:37:03 2008 @@ -57,8 +57,42 @@ //===----------------------- X86-64/AMD-64/EM64-T for any OS other than Darwin/Mac OS X: -If you get a build error, try configuring with --disable-multilib. +If you want to build multilib-enabled llvm-gcc (so, it will be able to generate +32 and 64 bit executables) you need to consider you system default lib directory +layout. + +Usually, your system uses one of these layouts: + +I. /usr/lib => 32 bit libraries (also in /usr/lib32) + /usr/lib64 => 64 bit libraries + +You're lucky and don't need to do anything, just proceed to usual configure +steps. + +II. /usr/lib => 64 bit libraries (also in /usr/lib64) + /usr/lib32 => 32 bit libraries + +You need to apply the following patch: + +<==cut==> +--- gcc/config/i386/t-linux64 ++++ gcc/config/i386/t-linux64 +@@ -6,7 +6,7 @@ SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \ + + MULTILIB_OPTIONS = m64/m32 + MULTILIB_DIRNAMES = 64 32 +-MULTILIB_OSDIRNAMES = ../lib64 ../lib ++MULTILIB_OSDIRNAMES = ../lib64 ../lib32 + + LIBGCC = stmp-multilib + INSTALL_LIBGCC = install-multilib +<==cut==> + +Note, that usually you don't notice such patching with your native gcc, since +it's done automatically by your favourite system package manager. Maybe we'll +add some layout detection routine in the future. +If you want just pure 64 bit compiler, configure with with --disable-multilib. //===----------------------- Darwin/Mac OS X Instructions: From baldrick at free.fr Mon Sep 8 09:38:49 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 8 Sep 2008 16:38:49 +0200 Subject: [llvm-commits] [llvm] r55898 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp In-Reply-To: <200809081421.m88ELB1A005241@zion.cs.uiuc.edu> References: <200809081421.m88ELB1A005241@zion.cs.uiuc.edu> Message-ID: <200809081638.49469.baldrick@free.fr> Hi Anton, > DAG.getIntPtrConstant(!Subtarget->is64Bit() ? 4 : 8)); how about using getPointerSize() here instead? (Likewise below). That way it will also handle 16 bit machines :) Ciao, Duncan. From baldrick at free.fr Mon Sep 8 09:48:34 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 8 Sep 2008 16:48:34 +0200 Subject: [llvm-commits] [llvm] r55899 - in /llvm/trunk: include/llvm/Intrinsics.td lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86Instr64bit.td lib/Target/X86/X86RegisterInfo.cpp In-Reply-To: <200809081421.m88ELsDc005277@zion.cs.uiuc.edu> References: <200809081421.m88ELsDc005277@zion.cs.uiuc.edu> Message-ID: <200809081648.34821.baldrick@free.fr> Hi Anton, > + bool callsEHReturn = false; > + > + if (MF) { > + const MachineFrameInfo *MFI = MF->getFrameInfo(); > + const MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); > + callsEHReturn = (MMI ? MMI->callsEHReturn() : false); how about if (MMI && MMI->callsEHReturn()) callsEHReturn = true; ? Likewise below. Ciao, Duncan. From anton at korobeynikov.info Mon Sep 8 09:54:08 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 8 Sep 2008 18:54:08 +0400 Subject: [llvm-commits] [llvm] r55898 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp In-Reply-To: <200809081638.49469.baldrick@free.fr> References: <200809081421.m88ELB1A005241@zion.cs.uiuc.edu> <200809081638.49469.baldrick@free.fr> Message-ID: Hi, Duncan > how about using getPointerSize() here instead? (Likewise below). > That way it will also handle 16 bit machines :) Yeah, I thought about this, no idea, why I didn't find this function :) -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From baldrick at free.fr Mon Sep 8 09:56:36 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 08 Sep 2008 14:56:36 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55910 - /llvm-gcc-4.2/trunk/README.LLVM Message-ID: <200809081456.m88Eua1X006718@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 8 09:56:35 2008 New Revision: 55910 URL: http://llvm.org/viewvc/llvm-project?rev=55910&view=rev Log: Fix some typos. Modified: llvm-gcc-4.2/trunk/README.LLVM Modified: llvm-gcc-4.2/trunk/README.LLVM URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/README.LLVM?rev=55910&r1=55909&r2=55910&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/README.LLVM (original) +++ llvm-gcc-4.2/trunk/README.LLVM Mon Sep 8 09:56:35 2008 @@ -58,7 +58,7 @@ X86-64/AMD-64/EM64-T for any OS other than Darwin/Mac OS X: If you want to build multilib-enabled llvm-gcc (so, it will be able to generate -32 and 64 bit executables) you need to consider you system default lib directory +32 and 64 bit executables) you need to consider your system default lib directory layout. Usually, your system uses one of these layouts: @@ -92,7 +92,7 @@ it's done automatically by your favourite system package manager. Maybe we'll add some layout detection routine in the future. -If you want just pure 64 bit compiler, configure with with --disable-multilib. +If you want just pure 64 bit compiler, configure with --disable-multilib. //===----------------------- Darwin/Mac OS X Instructions: From evan.cheng at apple.com Mon Sep 8 11:01:28 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 08 Sep 2008 16:01:28 -0000 Subject: [llvm-commits] [llvm] r55911 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200809081601.m88G1Spx009500@zion.cs.uiuc.edu> Author: evancheng Date: Mon Sep 8 11:01:27 2008 New Revision: 55911 URL: http://llvm.org/viewvc/llvm-project?rev=55911&view=rev Log: Avoid redefinition and nnbreak windows build. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=55911&r1=55910&r2=55911&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Sep 8 11:01:27 2008 @@ -718,7 +718,7 @@ BasicBlock::iterator const Begin = LLVMBB->begin(); BasicBlock::iterator const End = LLVMBB->end(); - BasicBlock::iterator I = Begin; + BasicBlock::iterator BI = Begin; // Lower any arguments needed in this block if this is the entry block. if (LLVMBB == &Fn.getEntryBlock()) @@ -738,7 +738,7 @@ } F->setCurrentBlock(BB); // Do FastISel on as many instructions as possible. - for (; I != End; ++I) { + for (; BI != End; ++BI) { // Just before the terminator instruction, insert instructions to // feed PHI nodes in successor blocks. if (isa(I)) @@ -746,41 +746,41 @@ if (DisableFastISelAbort) break; #ifndef NDEBUG - I->dump(); + BI->dump(); #endif assert(0 && "FastISel didn't handle a PHI in a successor"); } // First try normal tablegen-generated "fast" selection. - if (F->SelectInstruction(I)) + if (F->SelectInstruction(BI)) continue; // Next, try calling the target to attempt to handle the instruction. - if (F->TargetSelectInstruction(I)) + if (F->TargetSelectInstruction(BI)) continue; // Then handle certain instructions as single-LLVM-Instruction blocks. - if (isa(I) || isa(I) || - isa(I)) { - if (I->getType() != Type::VoidTy) { + if (isa(BI) || isa(BI) || + isa(BI)) { + if (BI->getType() != Type::VoidTy) { unsigned &R = FuncInfo->ValueMap[I]; if (!R) - R = FuncInfo->CreateRegForValue(I); + R = FuncInfo->CreateRegForValue(BI); } - SelectBasicBlock(LLVMBB, I, next(I)); + SelectBasicBlock(LLVMBB, BI, next(BI)); continue; } if (!DisableFastISelAbort && // For now, don't abort on non-conditional-branch terminators. - (!isa(I) || - (isa(I) && - cast(I)->isUnconditional()))) { + (!isa(BI) || + (isa(BI) && + cast(BI)->isUnconditional()))) { // The "fast" selector couldn't handle something and bailed. // For the purpose of debugging, just abort. #ifndef NDEBUG - I->dump(); + BI->dump(); #endif assert(0 && "FastISel didn't select the entire block"); } @@ -793,8 +793,8 @@ // Run SelectionDAG instruction selection on the remainder of the block // not handled by FastISel. If FastISel is not run, this is the entire // block. - if (I != End) - SelectBasicBlock(LLVMBB, I, End); + if (BI != End) + SelectBasicBlock(LLVMBB, BI, End); FinishBasicBlock(); } From baldrick at free.fr Mon Sep 8 11:04:03 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 08 Sep 2008 16:04:03 -0000 Subject: [llvm-commits] [llvm] r55912 - /llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Message-ID: <200809081604.m88G43Dd009585@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 8 11:04:03 2008 New Revision: 55912 URL: http://llvm.org/viewvc/llvm-project?rev=55912&view=rev Log: Didn't mean to commit this change to how the callgraph is printed. Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=55912&r1=55911&r2=55912&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Mon Sep 8 11:04:03 2008 @@ -272,15 +272,11 @@ else OS << "Call graph node <>:\n"; - for (const_iterator I = begin(), E = end(); I != E; ++I) { + for (const_iterator I = begin(), E = end(); I != E; ++I) if (I->second->getFunction()) - OS << " Calls function '" << I->second->getFunction()->getName() << "'"; - else - OS << " Calls external node"; - if (I->first.getInstruction()) - OS << " from '" << *I->first.getInstruction() << "'"; - OS << "\n"; - } + OS << " Calls function '" << I->second->getFunction()->getName() <<"'\n"; + else + OS << " Calls external node\n"; OS << "\n"; } From dpatel at apple.com Mon Sep 8 11:13:28 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 08 Sep 2008 16:13:28 -0000 Subject: [llvm-commits] [llvm] r55913 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <200809081613.m88GDSiK009915@zion.cs.uiuc.edu> Author: dpatel Date: Mon Sep 8 11:13:27 2008 New Revision: 55913 URL: http://llvm.org/viewvc/llvm-project?rev=55913&view=rev Log: Remove OptimizeIVType() Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=55913&r1=55912&r2=55913&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Sep 8 11:13:27 2008 @@ -185,10 +185,6 @@ /// inside the loop then try to eliminate the cast opeation. void OptimizeShadowIV(Loop *L); - /// OptimizeIVType - If IV is always sext'ed or zext'ed then - /// change the type of IV, if possible. - void OptimizeIVType(Loop *L); - bool FindIVUserForCond(ICmpInst *Cond, IVStrideUse *&CondUse, const SCEVHandle *&CondStride); bool RequiresTypeConversion(const Type *Ty, const Type *NewTy); @@ -1813,206 +1809,6 @@ } } -/// suitableExtInstruction - Helper function used by OptimizeIVType. -/// If I is a suitable SEXT or ZEXT instruction then return type -/// to which I is extended to. Otherwise return NULL. -const Type *suitableExtInstruction(Instruction *I, bool isSigned, - const Type *ExtType) { - - const Type *DestType = NULL; - if (ZExtInst *ZI = dyn_cast(I)) - DestType = ZI->getDestTy(); - else if (SExtInst *SI = dyn_cast(I)) { - // If the inital value is signed then this is not suitable for - // OptimizeIVType transformation. - if (isSigned) - return NULL; - DestType = SI->getDestTy(); - } - - if (!DestType) return NULL; - - if (!ExtType) - return DestType; - - // If another use of IV extended to some other type then the IV is not - // suitable for OptimizeIVType transformation. - if (ExtType != DestType) - return NULL; - - return DestType; -} - -/// suitableIVIncr - Helper function used by OptimizeIVType. If I is -/// a suitable binary operator whose all uses are either SEXT or ZEXT -/// then return the type to which all uses are extended to. Otherwise -/// return NULL. -const Type *suitableIVIncr(Instruction *I, - Instruction *PHI, bool isSigned, - const Type *ExtType) { - - BinaryOperator *Incr = dyn_cast(I); - if (!Incr) return NULL; - - if (Incr->getOpcode() != Instruction::Add) - return NULL; - - ConstantInt *C = NULL; - if (Incr->getOperand(0) == PHI) - C = dyn_cast(Incr->getOperand(1)); - else if (Incr->getOperand(1) == PHI) - C = dyn_cast(Incr->getOperand(0)); - - if (!C) return NULL; - - const Type *RExtType = NULL; - for (Value::use_iterator IncUI = Incr->use_begin(), - IncUE = Incr->use_end(); IncUI != IncUE; ++IncUI) { - - Instruction *U2 = dyn_cast(*IncUI); - if (U2 == PHI) - continue; - const Type *DestType = suitableExtInstruction(U2, isSigned, ExtType); - if (!DestType) - return NULL; - - if (!RExtType) - RExtType = DestType; - - if (DestType != RExtType) - return NULL; - } - - return RExtType; - -} - -/// getNewPHIIncrement - Create a new increment instruction for newPHI -/// using type Ty based on increment instruction Incr. -/// Helper function used by OptimizeIVType. -BinaryOperator *getNewPHIIncrement(BinaryOperator *Incr, PHINode *PHI, - PHINode *NewPHI, const Type *Ty) { - ConstantInt *C = NULL; - if (Incr->getOperand(0) == PHI) - C = dyn_cast(Incr->getOperand(1)); - else if (Incr->getOperand(1) == PHI) - C = dyn_cast(Incr->getOperand(0)); - - assert (C && "Unexpected Incr operand!"); - return BinaryOperator::Create(Incr->getOpcode(), NewPHI, - ConstantInt::get(Ty, C->getZExtValue()), - "IV.next", Incr); -} - -/// OptimizeIVType - If IV is always sext'ed or zext'ed then -/// change the type of IV, if possible. -void LoopStrengthReduce::OptimizeIVType(Loop *L) { - - SCEVHandle IterationCount = SE->getIterationCount(L); - if (isa(IterationCount)) - return; - - BasicBlock *LPH = L->getLoopPreheader(); - BasicBlock *LatchBB = L->getLoopLatch(); - SmallVector PHIs; - for (BasicBlock::iterator BI = L->getHeader()->begin(), - BE = L->getHeader()->end(); BI != BE; ++BI) { - if (PHINode *PHI = dyn_cast(BI)) - PHIs.push_back(PHI); - else - break; - } - - while(!PHIs.empty()) { - PHINode *PHI = PHIs.back(); PHIs.pop_back(); - if (PHI->getNumIncomingValues() != 2) continue; - - unsigned Entry = 0, Latch = 1; - if (PHI->getIncomingBlock(0) != LPH) { - Entry = 1; - Latch = 0; - } - - ConstantInt *CInit = dyn_cast(PHI->getIncomingValue(Entry)); - if (!CInit) return; - if (!CInit->isZero()) return; - - bool signedInit = CInit->getValue().isNegative(); - - bool TransformPhi = true; - const Type *ExtType = NULL; - BinaryOperator *Incr = NULL; - SmallVector PHIUses; - - // Collect all IV uses. - for (Value::use_iterator UI = PHI->use_begin(), - UE = PHI->use_end(); UI != UE; ++UI) { - Instruction *Use = dyn_cast(*UI); - if (!Use) { - TransformPhi = false; - break; - } - - ExtType = suitableIVIncr(Use, PHI, signedInit, ExtType); - if (ExtType) { - Incr = cast(Use); - continue; - } - ExtType = suitableExtInstruction(Use, signedInit, ExtType); - if (ExtType) { - PHIUses.push_back(Use); - continue; - } - - TransformPhi = false; - break; - } - - if (!TransformPhi || Incr == false || PHIUses.empty()) - continue; - - // Apply transformation. Extend IV type and eliminate SEXT or ZEXT - // instructions. - NumIVType++; - - PHINode *NewPH = PHINode::Create(ExtType, "IV", PHI); - ConstantInt *NewCInit = ConstantInt::get(ExtType, CInit->getZExtValue()); - BinaryOperator *NewIncr = getNewPHIIncrement(Incr, PHI, NewPH, ExtType); - - NewPH->addIncoming(NewCInit, PHI->getIncomingBlock(Entry)); - NewPH->addIncoming(NewIncr, PHI->getIncomingBlock(Latch)); - - // Replace all SEXT or ZEXT uses with new IV directly. - while (!PHIUses.empty()) { - Instruction *Use = PHIUses.back(); PHIUses.pop_back(); - SE->deleteValueFromRecords(Use); - Use->replaceAllUsesWith(NewPH); - Use->eraseFromParent(); - } - - // Replace all uses of IV increment with new increment. - SmallVector IncrUses; - for (Value::use_iterator UI2 = Incr->use_begin(), - UE2 = Incr->use_end(); UI2 != UE2; ++UI2) - IncrUses.push_back(cast(*UI2)); - - while (!IncrUses.empty()) { - Instruction *Use = IncrUses.back(); IncrUses.pop_back(); - if (Use == PHI) continue; - SE->deleteValueFromRecords(Use); - Use->replaceAllUsesWith(NewIncr); - Use->eraseFromParent(); - } - - // Remove old PHI and increment instruction. - SE->deleteValueFromRecords(PHI); - PHI->removeIncomingValue(LatchBB); - PHI->removeIncomingValue(LPH); - SE->deleteValueFromRecords(Incr); - Incr->eraseFromParent(); - } -} - // OptimizeIndvars - Now that IVUsesByStride is set up with all of the indvar // uses in the loop, look to see if we can eliminate some, in favor of using // common indvars for the different uses. @@ -2082,8 +1878,6 @@ UIntPtrTy = TD->getIntPtrType(); Changed = false; - OptimizeIVType(L); - // Find all uses of induction variables in this loop, and catagorize // them by stride. Start by finding all of the PHI nodes in the header for // this loop. If they are induction variables, inspect their uses. From dpatel at apple.com Mon Sep 8 11:20:09 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 8 Sep 2008 09:20:09 -0700 Subject: [llvm-commits] [llvm] r55896 - /llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp In-Reply-To: <200809081108.m88B89se031302@zion.cs.uiuc.edu> References: <200809081108.m88B89se031302@zion.cs.uiuc.edu> Message-ID: On Sep 8, 2008, at 4:08 AM, Duncan Sands wrote: > Author: baldrick > Date: Mon Sep 8 06:08:09 2008 > New Revision: 55896 > > URL: http://llvm.org/viewvc/llvm-project?rev=55896&view=rev > Log: > Update the callgraph correctly. Duncan, I'm seeing following errors while building llvm using llvm-gcc. Can you take a look ? Thanks, - Devang llvm[2]: Compiling CodeGenTarget.cpp for Release build Assertion failed: (i && "Cannot find callsite to replace!"), function replaceCallSite, file /Volumes/SandBox/Dolphin/surat.20080907-040501/ llvmCore.roots/llvmCore~obj/src/llvm/lib/Analysis/IPA/CallGraph.cpp, line 326. /Volumes/SandBox/Dolphin/llvmCore/llvm/utils/TableGen/ CodeGenTarget.cpp:511: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See for instructions. rm: /Volumes/SandBox/Dolphin/surat.20080907-040501/llvm.sh.build/utils/ TableGen/Release/CodeGenTarget.d.tmp: No such file or directory make[2]: *** [/Volumes/SandBox/Dolphin/surat.20080907-040501/ llvm.sh.build/utils/TableGen/Release/CodeGenTarget.o] Error 1 make[2]: *** Waiting for unfinished jobs.... Assertion failed: (i && "Cannot find callsite to replace!"), function replaceCallSite, file /Volumes/SandBox/Dolphin/surat.20080907-040501/ llvmCore.roots/llvmCore~obj/src/llvm/lib/Analysis/IPA/CallGraph.cpp, line 326. /Volumes/SandBox/Dolphin/llvmCore/llvm/utils/TableGen/ CodeGenDAGPatterns.cpp:2398: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See for instructions. rm: /Volumes/SandBox/Dolphin/surat.20080907-040501/llvm.sh.build/utils/ TableGen/Release/CodeGenDAGPatterns.d.tmp: No such file or directory make[2]: *** [/Volumes/SandBox/Dolphin/surat.20080907-040501/ llvm.sh.build/utils/TableGen/Release/CodeGenDAGPatterns.o] Error 1 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080908/fcbdc7c1/attachment.html From dpatel at apple.com Mon Sep 8 11:24:31 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 08 Sep 2008 16:24:31 -0000 Subject: [llvm-commits] [llvm] r55914 - /llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll Message-ID: <200809081624.m88GOV5F010535@zion.cs.uiuc.edu> Author: dpatel Date: Mon Sep 8 11:24:30 2008 New Revision: 55914 URL: http://llvm.org/viewvc/llvm-project?rev=55914&view=rev Log: xfail Modified: llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll Modified: llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll?rev=55914&r1=55913&r2=55914&view=diff ============================================================================== --- llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll (original) +++ llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll Mon Sep 8 11:24:30 2008 @@ -1,5 +1,6 @@ ; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep sext | count 1 ; ModuleID = '' +; XFAIL: * %struct.App1Marker = type <{ i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }> %struct.ComponentInstanceRecord = type <{ [1 x i32] }> %struct.DCPredictors = type { [5 x i16] } From gohman at apple.com Mon Sep 8 11:26:33 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 8 Sep 2008 09:26:33 -0700 (PDT) Subject: [llvm-commits] [llvm] r55878 - /llvm/trunk/utils/TableGen/CodeEmitterGen.cpp In-Reply-To: <200809070900.m8790vR1008738@zion.cs.uiuc.edu> References: <200809070900.m8790vR1008738@zion.cs.uiuc.edu> Message-ID: <48040.76.220.41.203.1220891193.squirrel@webmail.apple.com> On Sun, September 7, 2008 2:00 am, Evan Cheng wrote: > Author: evancheng > Date: Sun Sep 7 04:00:57 2008 > New Revision: 55878 > > URL: http://llvm.org/viewvc/llvm-project?rev=55878&view=rev > Log: > Eliminate a compile time warning. > - << " unsigned op;\n" > + << " unsigned op = 0;\n" > << " op = op; // suppress warning\n" This obviates the "op = op" line. Dan From gohman at apple.com Mon Sep 8 11:28:22 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 08 Sep 2008 16:28:22 -0000 Subject: [llvm-commits] [llvm] r55915 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200809081628.m88GSMow010705@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 11:28:17 2008 New Revision: 55915 URL: http://llvm.org/viewvc/llvm-project?rev=55915&view=rev Log: Delete an unused variable. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=55915&r1=55914&r2=55915&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Mon Sep 8 11:28:17 2008 @@ -927,7 +927,6 @@ MachineFunction &MF = DAG.getMachineFunction(); MVT ObjectVT = Op.getValue(ArgNo).getValueType(); SDValue Root = Op.getOperand(0); - std::vector ArgValues; MachineRegisterInfo &RegInfo = MF.getRegInfo(); static const unsigned GPRArgRegs[] = { From gohman at apple.com Mon Sep 8 11:29:38 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 08 Sep 2008 16:29:38 -0000 Subject: [llvm-commits] [llvm] r55916 - /llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Message-ID: <200809081629.m88GTdd0010762@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 11:29:36 2008 New Revision: 55916 URL: http://llvm.org/viewvc/llvm-project?rev=55916&view=rev Log: Fix typos in (generated) comments. Modified: llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Modified: llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp?rev=55916&r1=55915&r2=55916&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Mon Sep 8 11:29:36 2008 @@ -251,7 +251,7 @@ std::string Name = RC.TheDef->getName(); OS << " // " << Name - << " Sub-register Classess...\n" + << " Sub-register Classes...\n" << " static const TargetRegisterClass* const " << Name << "SubRegClasses [] = {\n "; @@ -296,7 +296,7 @@ std::string Name = RC.TheDef->getName(); OS << " // " << Name - << " Super-register Classess...\n" + << " Super-register Classes...\n" << " static const TargetRegisterClass* const " << Name << "SuperRegClasses [] = {\n "; From gohman at apple.com Mon Sep 8 11:30:29 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 08 Sep 2008 16:30:29 -0000 Subject: [llvm-commits] [llvm] r55917 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200809081630.m88GUT46010806@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 11:30:29 2008 New Revision: 55917 URL: http://llvm.org/viewvc/llvm-project?rev=55917&view=rev Log: Fix the string for ISD::UDIVREM. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=55917&r1=55916&r2=55917&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Sep 8 11:30:29 2008 @@ -4933,7 +4933,7 @@ case ISD::SMUL_LOHI: return "smul_lohi"; case ISD::UMUL_LOHI: return "umul_lohi"; case ISD::SDIVREM: return "sdivrem"; - case ISD::UDIVREM: return "divrem"; + case ISD::UDIVREM: return "udivrem"; case ISD::AND: return "and"; case ISD::OR: return "or"; case ISD::XOR: return "xor"; From gohman at apple.com Mon Sep 8 11:31:35 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 08 Sep 2008 16:31:35 -0000 Subject: [llvm-commits] [llvm] r55918 - /llvm/trunk/lib/Target/X86/X86FastISel.cpp Message-ID: <200809081631.m88GVZ97010848@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 11:31:35 2008 New Revision: 55918 URL: http://llvm.org/viewvc/llvm-project?rev=55918&view=rev Log: Fix copy+pastos in comments. 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=55918&r1=55917&r2=55918&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Mon Sep 8 11:31:35 2008 @@ -215,7 +215,7 @@ bool X86FastISel::X86FastEmitStore(MVT VT, unsigned Val, unsigned Ptr, unsigned Offset, Value *V) { - // Get opcode and regclass of the output for the given load instruction. + // Get opcode and regclass of the output for the given store instruction. unsigned Opc = 0; const TargetRegisterClass *RC = NULL; switch (VT.getSimpleVT()) { @@ -324,7 +324,7 @@ Value *V = I->getOperand(1); unsigned Ptr = getRegForValue(V); if (Ptr == 0) { - // Handle constant load address. + // Handle constant store address. if (!isa(V) || !X86SelectConstAddr(V, Ptr)) // Unhandled operand. Halt "fast" selection and bail. return false; From gohman at apple.com Mon Sep 8 11:40:13 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 08 Sep 2008 16:40:13 -0000 Subject: [llvm-commits] [llvm] r55919 - in /llvm/trunk: lib/CodeGen/AsmPrinter/AsmPrinter.cpp test/CodeGen/Generic/i128-and-beyond.ll Message-ID: <200809081640.m88GeESa011214@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 11:40:13 2008 New Revision: 55919 URL: http://llvm.org/viewvc/llvm-project?rev=55919&view=rev Log: Add AsmPrinter support for i128 and larger static initializer data. Added: llvm/trunk/test/CodeGen/Generic/i128-and-beyond.ll Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=55919&r1=55918&r2=55919&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Sep 8 11:40:13 2008 @@ -1062,26 +1062,41 @@ } return; } else assert(0 && "Floating point constant type not handled"); - } else if (CV->getType() == Type::Int64Ty) { + } else if (CV->getType()->isInteger() && + cast(CV->getType())->getBitWidth() >= 64) { if (const ConstantInt *CI = dyn_cast(CV)) { - uint64_t Val = CI->getZExtValue(); - - if (TAI->getData64bitsDirective()) - O << TAI->getData64bitsDirective() << Val << '\n'; - else if (TD->isBigEndian()) { - O << TAI->getData32bitsDirective() << unsigned(Val >> 32) - << '\t' << TAI->getCommentString() - << " Double-word most significant word " << Val << '\n'; - O << TAI->getData32bitsDirective() << unsigned(Val) - << '\t' << TAI->getCommentString() - << " Double-word least significant word " << Val << '\n'; - } else { - O << TAI->getData32bitsDirective() << unsigned(Val) - << '\t' << TAI->getCommentString() - << " Double-word least significant word " << Val << '\n'; - O << TAI->getData32bitsDirective() << unsigned(Val >> 32) - << '\t' << TAI->getCommentString() - << " Double-word most significant word " << Val << '\n'; + unsigned BitWidth = CI->getBitWidth(); + assert(isPowerOf2_32(BitWidth) && + "Non-power-of-2-sized integers not handled!"); + + // We don't expect assemblers to support integer data directives + // for more than 64 bits, so we emit the data in at most 64-bit + // quantities at a time. + const uint64_t *RawData = CI->getValue().getRawData(); + for (unsigned i = 0, e = BitWidth / 64; i != e; ++i) { + uint64_t Val; + if (TD->isBigEndian()) + Val = RawData[e - i - 1]; + else + Val = RawData[i]; + + if (TAI->getData64bitsDirective()) + O << TAI->getData64bitsDirective() << Val << '\n'; + else if (TD->isBigEndian()) { + O << TAI->getData32bitsDirective() << unsigned(Val >> 32) + << '\t' << TAI->getCommentString() + << " Double-word most significant word " << Val << '\n'; + O << TAI->getData32bitsDirective() << unsigned(Val) + << '\t' << TAI->getCommentString() + << " Double-word least significant word " << Val << '\n'; + } else { + O << TAI->getData32bitsDirective() << unsigned(Val) + << '\t' << TAI->getCommentString() + << " Double-word least significant word " << Val << '\n'; + O << TAI->getData32bitsDirective() << unsigned(Val >> 32) + << '\t' << TAI->getCommentString() + << " Double-word most significant word " << Val << '\n'; + } } return; } @@ -1440,6 +1455,8 @@ assert(TAI->getData64bitsDirective() && "Target cannot handle 64-bit constant exprs!"); O << TAI->getData64bitsDirective(); + } else { + assert(0 && "Target cannot handle given data directive width!"); } break; } Added: llvm/trunk/test/CodeGen/Generic/i128-and-beyond.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/i128-and-beyond.ll?rev=55919&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/i128-and-beyond.ll (added) +++ llvm/trunk/test/CodeGen/Generic/i128-and-beyond.ll Mon Sep 8 11:40:13 2008 @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | llc -march=x86 | grep 18446744073709551615 | count 14 +; RUN: llvm-as < %s | llc -march=ppc32 | grep 4294967295 | count 28 + +; These static initializers are too big to hand off to assemblers +; as monolithic blobs. + + at x = global i128 -1 + at y = global i256 -1 + at z = global i512 -1 From evan.cheng at apple.com Mon Sep 8 11:42:43 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 8 Sep 2008 09:42:43 -0700 Subject: [llvm-commits] [llvm] r55878 - /llvm/trunk/utils/TableGen/CodeEmitterGen.cpp In-Reply-To: <48040.76.220.41.203.1220891193.squirrel@webmail.apple.com> References: <200809070900.m8790vR1008738@zion.cs.uiuc.edu> <48040.76.220.41.203.1220891193.squirrel@webmail.apple.com> Message-ID: <3678DF48-9B95-4AA7-8D2D-D50A29ADA0BB@apple.com> Does it? One is to suppress a "use of undefined value", the other is "defined but not used". Evan On Sep 8, 2008, at 9:26 AM, Dan Gohman wrote: > On Sun, September 7, 2008 2:00 am, Evan Cheng wrote: >> Author: evancheng >> Date: Sun Sep 7 04:00:57 2008 >> New Revision: 55878 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=55878&view=rev >> Log: >> Eliminate a compile time warning. > >> - << " unsigned op;\n" >> + << " unsigned op = 0;\n" >> << " op = op; // suppress warning\n" > > This obviates the "op = op" line. > > Dan > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Mon Sep 8 11:42:56 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 08 Sep 2008 16:42:56 -0000 Subject: [llvm-commits] [llvm] r55920 - /llvm/trunk/lib/Target/X86/README-X86-64.txt Message-ID: <200809081642.m88GguOT011323@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 11:42:56 2008 New Revision: 55920 URL: http://llvm.org/viewvc/llvm-project?rev=55920&view=rev Log: i128 and f80 are implemented for x86-64 now. Modified: llvm/trunk/lib/Target/X86/README-X86-64.txt Modified: llvm/trunk/lib/Target/X86/README-X86-64.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-X86-64.txt?rev=55920&r1=55919&r2=55920&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/README-X86-64.txt (original) +++ llvm/trunk/lib/Target/X86/README-X86-64.txt Mon Sep 8 11:42:56 2008 @@ -9,10 +9,6 @@ //===---------------------------------------------------------------------===// -Implement __int128 and long double support. - -//===---------------------------------------------------------------------===// - For this: extern void xx(void); From evan.cheng at apple.com Mon Sep 8 11:44:32 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 8 Sep 2008 09:44:32 -0700 Subject: [llvm-commits] [llvm] r55846 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp In-Reply-To: <200809051844.m85IiMCD006851@zion.cs.uiuc.edu> References: <200809051844.m85IiMCD006851@zion.cs.uiuc.edu> Message-ID: <681A9059-4326-47E6-B4CA-96239D891A10@apple.com> Can we and the value with a mask for other kinds of uses? Evan On Sep 5, 2008, at 11:44 AM, Dan Gohman wrote: > Author: djg > Date: Fri Sep 5 13:44:22 2008 > New Revision: 55846 > > URL: http://llvm.org/viewvc/llvm-project?rev=55846&view=rev > Log: > FastISel support for AND and OR with type i1. > > Modified: > llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=55846&r1=55845&r2=55846&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Fri Sep 5 > 13:44:22 2008 > @@ -103,12 +103,20 @@ > if (VT == MVT::Other || !VT.isSimple()) > // Unhandled type. Halt "fast" selection and bail. > return false; > + > // We only handle legal types. For example, on x86-32 the > instruction > // selector contains all of the 64-bit instructions from x86-64, > // under the assumption that i64 won't be used if the target doesn't > // support it. > - if (!TLI.isTypeLegal(VT)) > - return false; > + if (!TLI.isTypeLegal(VT)) { > + // MVT::i1 is special. Allow AND and OR (but not XOR) because > they > + // don't require additional zeroing, which makes them easy. > + if (VT == MVT::i1 && > + (ISDOpcode == ISD::AND || ISDOpcode == ISD::OR)) > + VT = TLI.getTypeToTransformTo(VT); > + else > + return false; > + } > > unsigned Op0 = getRegForValue(I->getOperand(0)); > if (Op0 == 0) > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Mon Sep 8 11:45:59 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 08 Sep 2008 16:45:59 -0000 Subject: [llvm-commits] [llvm] r55921 - in /llvm/trunk: docs/LangRef.html lib/VMCore/Verifier.cpp Message-ID: <200809081646.m88Gk0O9011443@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 11:45:59 2008 New Revision: 55921 URL: http://llvm.org/viewvc/llvm-project?rev=55921&view=rev Log: Bitcasting two or from aggregate types is not permitted. Update LangRef.html, and teach the verifier to check bitcast instructions. Modified: llvm/trunk/docs/LangRef.html llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=55921&r1=55920&r2=55921&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Mon Sep 8 11:45:59 2008 @@ -1729,7 +1729,8 @@ was stored to memory and read back as TYPE. In other words, no bits change with this operator, just the type. This can be used for conversion of vector types to any other type, as long as they have the same bit width. For - pointers it is only valid to cast to another pointer type. + pointers it is only valid to cast to another pointer type. It is not valid + to bitcast to or from an aggregate type.
getelementptr ( CSTPTR, IDX0, IDX1, ... )
@@ -3808,8 +3809,9 @@
Arguments:

The 'bitcast' instruction takes a value to cast, which must be -a first class value, and a type to cast it to, which must also be a first class type. The bit sizes of value +a non-aggregate first class value, and a type to cast it to, which must also be +a non-aggregate first class type. The bit sizes of +value and the destination type, ty2, must be identical. If the source type is a pointer, the destination type must also be a pointer. This instruction supports bitwise conversion of vectors to integers and to vectors Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=55921&r1=55920&r2=55921&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Mon Sep 8 11:45:59 2008 @@ -883,6 +883,12 @@ "Bitcast requires both operands to be pointer or neither", &I); Assert1(SrcBitSize == DestBitSize, "Bitcast requies types of same width", &I); + // Disallow aggregates. + Assert1(!SrcTy->isAggregateType(), + "Bitcast operand must not be aggregate", &I); + Assert1(!DestTy->isAggregateType(), + "Bitcast type must not be aggregate", &I); + visitInstruction(I); } From daniel at zuster.org Mon Sep 8 11:56:11 2008 From: daniel at zuster.org (Daniel Dunbar) Date: Mon, 08 Sep 2008 16:56:11 -0000 Subject: [llvm-commits] [llvm] r55922 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200809081656.m88GuBSm011807@zion.cs.uiuc.edu> Author: ddunbar Date: Mon Sep 8 11:56:08 2008 New Revision: 55922 URL: http://llvm.org/viewvc/llvm-project?rev=55922&view=rev Log: Add VISIBILITY_HIDDEN on SDISelAsmOperandInfo Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=55922&r1=55921&r2=55922&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Sep 8 11:56:08 2008 @@ -3882,7 +3882,7 @@ namespace llvm { /// AsmOperandInfo - This contains information for each constraint that we are /// lowering. -struct SDISelAsmOperandInfo : public TargetLowering::AsmOperandInfo { +struct VISIBILITY_HIDDEN SDISelAsmOperandInfo : public TargetLowering::AsmOperandInfo { /// CallOperand - If this is the result output operand or a clobber /// this is null, otherwise it is the incoming operand to the CallInst. /// This gets modified as the asm is processed. From gohman at apple.com Mon Sep 8 11:57:14 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 8 Sep 2008 09:57:14 -0700 (PDT) Subject: [llvm-commits] [llvm] r55846 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp In-Reply-To: <681A9059-4326-47E6-B4CA-96239D891A10@apple.com> References: <200809051844.m85IiMCD006851@zion.cs.uiuc.edu> <681A9059-4326-47E6-B4CA-96239D891A10@apple.com> Message-ID: <49018.76.220.41.203.1220893034.squirrel@webmail.apple.com> Yes, but that's a little more work. I was just implementing the cases which are both very common and very easy :-). Dan On Mon, September 8, 2008 9:44 am, Evan Cheng wrote: > Can we and the value with a mask for other kinds of uses? > > Evan > > On Sep 5, 2008, at 11:44 AM, Dan Gohman wrote: > >> Author: djg >> Date: Fri Sep 5 13:44:22 2008 >> New Revision: 55846 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=55846&view=rev >> Log: >> FastISel support for AND and OR with type i1. >> >> Modified: >> llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp >> >> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp >> URL: >> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=55846&r1=55845&r2=55846&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> ====================================================================== >> --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) >> +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Fri Sep 5 >> 13:44:22 2008 >> @@ -103,12 +103,20 @@ >> if (VT == MVT::Other || !VT.isSimple()) >> // Unhandled type. Halt "fast" selection and bail. >> return false; >> + >> // We only handle legal types. For example, on x86-32 the >> instruction >> // selector contains all of the 64-bit instructions from x86-64, >> // under the assumption that i64 won't be used if the target doesn't >> // support it. >> - if (!TLI.isTypeLegal(VT)) >> - return false; >> + if (!TLI.isTypeLegal(VT)) { >> + // MVT::i1 is special. Allow AND and OR (but not XOR) because >> they >> + // don't require additional zeroing, which makes them easy. >> + if (VT == MVT::i1 && >> + (ISDOpcode == ISD::AND || ISDOpcode == ISD::OR)) >> + VT = TLI.getTypeToTransformTo(VT); >> + else >> + return false; >> + } >> >> unsigned Op0 = getRegForValue(I->getOperand(0)); >> if (Op0 == 0) >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From gohman at apple.com Mon Sep 8 11:59:02 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 08 Sep 2008 16:59:02 -0000 Subject: [llvm-commits] [llvm] r55923 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200809081659.m88Gx2Ca011897@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 11:59:01 2008 New Revision: 55923 URL: http://llvm.org/viewvc/llvm-project?rev=55923&view=rev Log: In visitUREM, arrange for the temporary UDIV node to be revisited, consistent with the code in visitSREM. 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=55923&r1=55922&r2=55923&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Sep 8 11:59:01 2008 @@ -1423,6 +1423,7 @@ // X%C to the equivalent of X-X/C*C. if (N1C && !N1C->isNullValue()) { SDValue Div = DAG.getNode(ISD::UDIV, VT, N0, N1); + AddToWorkList(Div.getNode()); SDValue OptimizedDiv = combine(Div.getNode()); if (OptimizedDiv.getNode() && OptimizedDiv.getNode() != Div.getNode()) { SDValue Mul = DAG.getNode(ISD::MUL, VT, OptimizedDiv, N1); From dalej at apple.com Mon Sep 8 12:03:03 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 8 Sep 2008 10:03:03 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r55796 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200809061907.24993.baldrick@free.fr> References: <200809042123.m84LNekC013647@zion.cs.uiuc.edu> <200809052309.08997.baldrick@free.fr> <4612121D-CFDE-4791-9373-D4DB6077159B@apple.com> <200809061907.24993.baldrick@free.fr> Message-ID: <106476C8-8DBF-4B11-9595-FEDA920E40AD@apple.com> On Sep 6, 2008, at 10:07 AMPDT, Duncan Sands wrote: > Hi Dale, thinking about this more, I started wondering > why you want to produce llvm.pow and friends at all. > Does it actually bring any advantage? Functionally, no, the point is to get C semantics out of the optimizers. From evan.cheng at apple.com Mon Sep 8 12:13:22 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 8 Sep 2008 10:13:22 -0700 Subject: [llvm-commits] [llvm] r55913 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp In-Reply-To: <200809081613.m88GDSiK009915@zion.cs.uiuc.edu> References: <200809081613.m88GDSiK009915@zion.cs.uiuc.edu> Message-ID: Now NumIVType is defined but not used. Evan On Sep 8, 2008, at 9:13 AM, Devang Patel wrote: > Author: dpatel > Date: Mon Sep 8 11:13:27 2008 > New Revision: 55913 > > URL: http://llvm.org/viewvc/llvm-project?rev=55913&view=rev > Log: > Remove OptimizeIVType() > > Modified: > llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp > > Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=55913&r1=55912&r2=55913&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) > +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Sep > 8 11:13:27 2008 > @@ -185,10 +185,6 @@ > /// inside the loop then try to eliminate the cast opeation. > void OptimizeShadowIV(Loop *L); > > - /// OptimizeIVType - If IV is always sext'ed or zext'ed then > - /// change the type of IV, if possible. > - void OptimizeIVType(Loop *L); > - > bool FindIVUserForCond(ICmpInst *Cond, IVStrideUse *&CondUse, > const SCEVHandle *&CondStride); > bool RequiresTypeConversion(const Type *Ty, const Type *NewTy); > @@ -1813,206 +1809,6 @@ > } > } > > -/// suitableExtInstruction - Helper function used by OptimizeIVType. > -/// If I is a suitable SEXT or ZEXT instruction then return type > -/// to which I is extended to. Otherwise return NULL. > -const Type *suitableExtInstruction(Instruction *I, bool isSigned, > - const Type *ExtType) { > - > - const Type *DestType = NULL; > - if (ZExtInst *ZI = dyn_cast(I)) > - DestType = ZI->getDestTy(); > - else if (SExtInst *SI = dyn_cast(I)) { > - // If the inital value is signed then this is not suitable for > - // OptimizeIVType transformation. > - if (isSigned) > - return NULL; > - DestType = SI->getDestTy(); > - } > - > - if (!DestType) return NULL; > - > - if (!ExtType) > - return DestType; > - > - // If another use of IV extended to some other type then the IV > is not > - // suitable for OptimizeIVType transformation. > - if (ExtType != DestType) > - return NULL; > - > - return DestType; > -} > - > -/// suitableIVIncr - Helper function used by OptimizeIVType. If I is > -/// a suitable binary operator whose all uses are either SEXT or ZEXT > -/// then return the type to which all uses are extended to. Otherwise > -/// return NULL. > -const Type *suitableIVIncr(Instruction *I, > - Instruction *PHI, bool isSigned, > - const Type *ExtType) { > - > - BinaryOperator *Incr = dyn_cast(I); > - if (!Incr) return NULL; > - > - if (Incr->getOpcode() != Instruction::Add) > - return NULL; > - > - ConstantInt *C = NULL; > - if (Incr->getOperand(0) == PHI) > - C = dyn_cast(Incr->getOperand(1)); > - else if (Incr->getOperand(1) == PHI) > - C = dyn_cast(Incr->getOperand(0)); > - > - if (!C) return NULL; > - > - const Type *RExtType = NULL; > - for (Value::use_iterator IncUI = Incr->use_begin(), > - IncUE = Incr->use_end(); IncUI != IncUE; ++IncUI) { > - > - Instruction *U2 = dyn_cast(*IncUI); > - if (U2 == PHI) > - continue; > - const Type *DestType = suitableExtInstruction(U2, isSigned, > ExtType); > - if (!DestType) > - return NULL; > - > - if (!RExtType) > - RExtType = DestType; > - > - if (DestType != RExtType) > - return NULL; > - } > - > - return RExtType; > - > -} > - > -/// getNewPHIIncrement - Create a new increment instruction for > newPHI > -/// using type Ty based on increment instruction Incr. > -/// Helper function used by OptimizeIVType. > -BinaryOperator *getNewPHIIncrement(BinaryOperator *Incr, PHINode > *PHI, > - PHINode *NewPHI, const Type *Ty) { > - ConstantInt *C = NULL; > - if (Incr->getOperand(0) == PHI) > - C = dyn_cast(Incr->getOperand(1)); > - else if (Incr->getOperand(1) == PHI) > - C = dyn_cast(Incr->getOperand(0)); > - > - assert (C && "Unexpected Incr operand!"); > - return BinaryOperator::Create(Incr->getOpcode(), NewPHI, > - ConstantInt::get(Ty, C- > >getZExtValue()), > - "IV.next", Incr); > -} > - > -/// OptimizeIVType - If IV is always sext'ed or zext'ed then > -/// change the type of IV, if possible. > -void LoopStrengthReduce::OptimizeIVType(Loop *L) { > - > - SCEVHandle IterationCount = SE->getIterationCount(L); > - if (isa(IterationCount)) > - return; > - > - BasicBlock *LPH = L->getLoopPreheader(); > - BasicBlock *LatchBB = L->getLoopLatch(); > - SmallVector PHIs; > - for (BasicBlock::iterator BI = L->getHeader()->begin(), > - BE = L->getHeader()->end(); BI != BE; ++BI) { > - if (PHINode *PHI = dyn_cast(BI)) > - PHIs.push_back(PHI); > - else > - break; > - } > - > - while(!PHIs.empty()) { > - PHINode *PHI = PHIs.back(); PHIs.pop_back(); > - if (PHI->getNumIncomingValues() != 2) continue; > - > - unsigned Entry = 0, Latch = 1; > - if (PHI->getIncomingBlock(0) != LPH) { > - Entry = 1; > - Latch = 0; > - } > - > - ConstantInt *CInit = dyn_cast(PHI- > >getIncomingValue(Entry)); > - if (!CInit) return; > - if (!CInit->isZero()) return; > - > - bool signedInit = CInit->getValue().isNegative(); > - > - bool TransformPhi = true; > - const Type *ExtType = NULL; > - BinaryOperator *Incr = NULL; > - SmallVector PHIUses; > - > - // Collect all IV uses. > - for (Value::use_iterator UI = PHI->use_begin(), > - UE = PHI->use_end(); UI != UE; ++UI) { > - Instruction *Use = dyn_cast(*UI); > - if (!Use) { > - TransformPhi = false; > - break; > - } > - > - ExtType = suitableIVIncr(Use, PHI, signedInit, ExtType); > - if (ExtType) { > - Incr = cast(Use); > - continue; > - } > - ExtType = suitableExtInstruction(Use, signedInit, ExtType); > - if (ExtType) { > - PHIUses.push_back(Use); > - continue; > - } > - > - TransformPhi = false; > - break; > - } > - > - if (!TransformPhi || Incr == false || PHIUses.empty()) > - continue; > - > - // Apply transformation. Extend IV type and eliminate SEXT or > ZEXT > - // instructions. > - NumIVType++; > - > - PHINode *NewPH = PHINode::Create(ExtType, "IV", PHI); > - ConstantInt *NewCInit = ConstantInt::get(ExtType, CInit- > >getZExtValue()); > - BinaryOperator *NewIncr = getNewPHIIncrement(Incr, PHI, NewPH, > ExtType); > - > - NewPH->addIncoming(NewCInit, PHI->getIncomingBlock(Entry)); > - NewPH->addIncoming(NewIncr, PHI->getIncomingBlock(Latch)); > - > - // Replace all SEXT or ZEXT uses with new IV directly. > - while (!PHIUses.empty()) { > - Instruction *Use = PHIUses.back(); PHIUses.pop_back(); > - SE->deleteValueFromRecords(Use); > - Use->replaceAllUsesWith(NewPH); > - Use->eraseFromParent(); > - } > - > - // Replace all uses of IV increment with new increment. > - SmallVector IncrUses; > - for (Value::use_iterator UI2 = Incr->use_begin(), > - UE2 = Incr->use_end(); UI2 != UE2; ++UI2) > - IncrUses.push_back(cast(*UI2)); > - > - while (!IncrUses.empty()) { > - Instruction *Use = IncrUses.back(); IncrUses.pop_back(); > - if (Use == PHI) continue; > - SE->deleteValueFromRecords(Use); > - Use->replaceAllUsesWith(NewIncr); > - Use->eraseFromParent(); > - } > - > - // Remove old PHI and increment instruction. > - SE->deleteValueFromRecords(PHI); > - PHI->removeIncomingValue(LatchBB); > - PHI->removeIncomingValue(LPH); > - SE->deleteValueFromRecords(Incr); > - Incr->eraseFromParent(); > - } > -} > - > // OptimizeIndvars - Now that IVUsesByStride is set up with all of > the indvar > // uses in the loop, look to see if we can eliminate some, in favor > of using > // common indvars for the different uses. > @@ -2082,8 +1878,6 @@ > UIntPtrTy = TD->getIntPtrType(); > Changed = false; > > - OptimizeIVType(L); > - > // Find all uses of induction variables in this loop, and catagorize > // them by stride. Start by finding all of the PHI nodes in the > header for > // this loop. If they are induction variables, inspect their uses. > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Mon Sep 8 12:14:57 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 08 Sep 2008 17:14:57 -0000 Subject: [llvm-commits] [llvm] r55924 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <200809081714.m88HEvTb012568@zion.cs.uiuc.edu> Author: dpatel Date: Mon Sep 8 12:14:54 2008 New Revision: 55924 URL: http://llvm.org/viewvc/llvm-project?rev=55924&view=rev Log: Remove unused counter. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=55924&r1=55923&r2=55924&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Sep 8 12:14:54 2008 @@ -46,7 +46,6 @@ STATISTIC(NumVariable, "Number of PHIs with variable strides"); STATISTIC(NumEliminated, "Number of strides eliminated"); STATISTIC(NumShadow, "Number of Shadow IVs optimized"); -STATISTIC(NumIVType, "Number of IV types optimized"); namespace { From dpatel at apple.com Mon Sep 8 12:15:17 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 8 Sep 2008 10:15:17 -0700 Subject: [llvm-commits] [llvm] r55913 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp In-Reply-To: References: <200809081613.m88GDSiK009915@zion.cs.uiuc.edu> Message-ID: On Sep 8, 2008, at 10:13 AM, Evan Cheng wrote: > Now NumIVType is defined but not used. oops. Fixed. - Devang > > > Evan > > On Sep 8, 2008, at 9:13 AM, Devang Patel wrote: > >> Author: dpatel >> Date: Mon Sep 8 11:13:27 2008 >> New Revision: 55913 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=55913&view=rev >> Log: >> Remove OptimizeIVType() >> >> Modified: >> llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp >> >> Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=55913&r1=55912&r2=55913&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp >> (original) >> +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Sep >> 8 11:13:27 2008 >> @@ -185,10 +185,6 @@ >> /// inside the loop then try to eliminate the cast opeation. >> void OptimizeShadowIV(Loop *L); >> >> - /// OptimizeIVType - If IV is always sext'ed or zext'ed then >> - /// change the type of IV, if possible. >> - void OptimizeIVType(Loop *L); >> - >> bool FindIVUserForCond(ICmpInst *Cond, IVStrideUse *&CondUse, >> const SCEVHandle *&CondStride); >> bool RequiresTypeConversion(const Type *Ty, const Type *NewTy); >> @@ -1813,206 +1809,6 @@ >> } >> } >> >> -/// suitableExtInstruction - Helper function used by OptimizeIVType. >> -/// If I is a suitable SEXT or ZEXT instruction then return type >> -/// to which I is extended to. Otherwise return NULL. >> -const Type *suitableExtInstruction(Instruction *I, bool isSigned, >> - const Type *ExtType) { >> - >> - const Type *DestType = NULL; >> - if (ZExtInst *ZI = dyn_cast(I)) >> - DestType = ZI->getDestTy(); >> - else if (SExtInst *SI = dyn_cast(I)) { >> - // If the inital value is signed then this is not suitable for >> - // OptimizeIVType transformation. >> - if (isSigned) >> - return NULL; >> - DestType = SI->getDestTy(); >> - } >> - >> - if (!DestType) return NULL; >> - >> - if (!ExtType) >> - return DestType; >> - >> - // If another use of IV extended to some other type then the IV >> is not >> - // suitable for OptimizeIVType transformation. >> - if (ExtType != DestType) >> - return NULL; >> - >> - return DestType; >> -} >> - >> -/// suitableIVIncr - Helper function used by OptimizeIVType. If I >> is >> -/// a suitable binary operator whose all uses are either SEXT or >> ZEXT >> -/// then return the type to which all uses are extended to. >> Otherwise >> -/// return NULL. >> -const Type *suitableIVIncr(Instruction *I, >> - Instruction *PHI, bool isSigned, >> - const Type *ExtType) { >> - >> - BinaryOperator *Incr = dyn_cast(I); >> - if (!Incr) return NULL; >> - >> - if (Incr->getOpcode() != Instruction::Add) >> - return NULL; >> - >> - ConstantInt *C = NULL; >> - if (Incr->getOperand(0) == PHI) >> - C = dyn_cast(Incr->getOperand(1)); >> - else if (Incr->getOperand(1) == PHI) >> - C = dyn_cast(Incr->getOperand(0)); >> - >> - if (!C) return NULL; >> - >> - const Type *RExtType = NULL; >> - for (Value::use_iterator IncUI = Incr->use_begin(), >> - IncUE = Incr->use_end(); IncUI != IncUE; ++IncUI) { >> - >> - Instruction *U2 = dyn_cast(*IncUI); >> - if (U2 == PHI) >> - continue; >> - const Type *DestType = suitableExtInstruction(U2, isSigned, >> ExtType); >> - if (!DestType) >> - return NULL; >> - >> - if (!RExtType) >> - RExtType = DestType; >> - >> - if (DestType != RExtType) >> - return NULL; >> - } >> - >> - return RExtType; >> - >> -} >> - >> -/// getNewPHIIncrement - Create a new increment instruction for >> newPHI >> -/// using type Ty based on increment instruction Incr. >> -/// Helper function used by OptimizeIVType. >> -BinaryOperator *getNewPHIIncrement(BinaryOperator *Incr, PHINode >> *PHI, >> - PHINode *NewPHI, const Type >> *Ty) { >> - ConstantInt *C = NULL; >> - if (Incr->getOperand(0) == PHI) >> - C = dyn_cast(Incr->getOperand(1)); >> - else if (Incr->getOperand(1) == PHI) >> - C = dyn_cast(Incr->getOperand(0)); >> - >> - assert (C && "Unexpected Incr operand!"); >> - return BinaryOperator::Create(Incr->getOpcode(), NewPHI, >> - ConstantInt::get(Ty, C- >>> getZExtValue()), >> - "IV.next", Incr); >> -} >> - >> -/// OptimizeIVType - If IV is always sext'ed or zext'ed then >> -/// change the type of IV, if possible. >> -void LoopStrengthReduce::OptimizeIVType(Loop *L) { >> - >> - SCEVHandle IterationCount = SE->getIterationCount(L); >> - if (isa(IterationCount)) >> - return; >> - >> - BasicBlock *LPH = L->getLoopPreheader(); >> - BasicBlock *LatchBB = L->getLoopLatch(); >> - SmallVector PHIs; >> - for (BasicBlock::iterator BI = L->getHeader()->begin(), >> - BE = L->getHeader()->end(); BI != BE; ++BI) { >> - if (PHINode *PHI = dyn_cast(BI)) >> - PHIs.push_back(PHI); >> - else >> - break; >> - } >> - >> - while(!PHIs.empty()) { >> - PHINode *PHI = PHIs.back(); PHIs.pop_back(); >> - if (PHI->getNumIncomingValues() != 2) continue; >> - >> - unsigned Entry = 0, Latch = 1; >> - if (PHI->getIncomingBlock(0) != LPH) { >> - Entry = 1; >> - Latch = 0; >> - } >> - >> - ConstantInt *CInit = dyn_cast(PHI- >>> getIncomingValue(Entry)); >> - if (!CInit) return; >> - if (!CInit->isZero()) return; >> - >> - bool signedInit = CInit->getValue().isNegative(); >> - >> - bool TransformPhi = true; >> - const Type *ExtType = NULL; >> - BinaryOperator *Incr = NULL; >> - SmallVector PHIUses; >> - >> - // Collect all IV uses. >> - for (Value::use_iterator UI = PHI->use_begin(), >> - UE = PHI->use_end(); UI != UE; ++UI) { >> - Instruction *Use = dyn_cast(*UI); >> - if (!Use) { >> - TransformPhi = false; >> - break; >> - } >> - >> - ExtType = suitableIVIncr(Use, PHI, signedInit, ExtType); >> - if (ExtType) { >> - Incr = cast(Use); >> - continue; >> - } >> - ExtType = suitableExtInstruction(Use, signedInit, ExtType); >> - if (ExtType) { >> - PHIUses.push_back(Use); >> - continue; >> - } >> - >> - TransformPhi = false; >> - break; >> - } >> - >> - if (!TransformPhi || Incr == false || PHIUses.empty()) >> - continue; >> - >> - // Apply transformation. Extend IV type and eliminate SEXT or >> ZEXT >> - // instructions. >> - NumIVType++; >> - >> - PHINode *NewPH = PHINode::Create(ExtType, "IV", PHI); >> - ConstantInt *NewCInit = ConstantInt::get(ExtType, CInit- >>> getZExtValue()); >> - BinaryOperator *NewIncr = getNewPHIIncrement(Incr, PHI, NewPH, >> ExtType); >> - >> - NewPH->addIncoming(NewCInit, PHI->getIncomingBlock(Entry)); >> - NewPH->addIncoming(NewIncr, PHI->getIncomingBlock(Latch)); >> - >> - // Replace all SEXT or ZEXT uses with new IV directly. >> - while (!PHIUses.empty()) { >> - Instruction *Use = PHIUses.back(); PHIUses.pop_back(); >> - SE->deleteValueFromRecords(Use); >> - Use->replaceAllUsesWith(NewPH); >> - Use->eraseFromParent(); >> - } >> - >> - // Replace all uses of IV increment with new increment. >> - SmallVector IncrUses; >> - for (Value::use_iterator UI2 = Incr->use_begin(), >> - UE2 = Incr->use_end(); UI2 != UE2; ++UI2) >> - IncrUses.push_back(cast(*UI2)); >> - >> - while (!IncrUses.empty()) { >> - Instruction *Use = IncrUses.back(); IncrUses.pop_back(); >> - if (Use == PHI) continue; >> - SE->deleteValueFromRecords(Use); >> - Use->replaceAllUsesWith(NewIncr); >> - Use->eraseFromParent(); >> - } >> - >> - // Remove old PHI and increment instruction. >> - SE->deleteValueFromRecords(PHI); >> - PHI->removeIncomingValue(LatchBB); >> - PHI->removeIncomingValue(LPH); >> - SE->deleteValueFromRecords(Incr); >> - Incr->eraseFromParent(); >> - } >> -} >> - >> // OptimizeIndvars - Now that IVUsesByStride is set up with all of >> the indvar >> // uses in the loop, look to see if we can eliminate some, in favor >> of using >> // common indvars for the different uses. >> @@ -2082,8 +1878,6 @@ >> UIntPtrTy = TD->getIntPtrType(); >> Changed = false; >> >> - OptimizeIVType(L); >> - >> // Find all uses of induction variables in this loop, and catagorize >> // them by stride. Start by finding all of the PHI nodes in the >> header for >> // this loop. If they are induction variables, inspect their uses. >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Mon Sep 8 12:15:42 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 08 Sep 2008 17:15:42 -0000 Subject: [llvm-commits] [llvm] r55925 - in /llvm/trunk: lib/Target/X86/X86FastISel.cpp test/CodeGen/X86/fast-isel-call.ll Message-ID: <200809081715.m88HFgDb012599@zion.cs.uiuc.edu> Author: evancheng Date: Mon Sep 8 12:15:42 2008 New Revision: 55925 URL: http://llvm.org/viewvc/llvm-project?rev=55925&view=rev Log: Handle calls which produce i1 results: promote to i8 but and it with 1 to get the low bit. Added: llvm/trunk/test/CodeGen/X86/fast-isel-call.ll 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=55925&r1=55924&r2=55925&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Mon Sep 8 12:15:42 2008 @@ -107,7 +107,8 @@ }; -static bool isTypeLegal(const Type *Ty, const TargetLowering &TLI, MVT &VT) { +static bool isTypeLegal(const Type *Ty, const TargetLowering &TLI, MVT &VT, + bool AllowI1 = false) { VT = MVT::getMVT(Ty, /*HandleUnknown=*/true); if (VT == MVT::Other || !VT.isSimple()) // Unhandled type. Halt "fast" selection and bail. @@ -119,7 +120,7 @@ // selector contains all of the 64-bit instructions from x86-64, // under the assumption that i64 won't be used if the target doesn't // support it. - return TLI.isTypeLegal(VT); + return (AllowI1 && VT == MVT::i1) || TLI.isTypeLegal(VT); } #include "X86GenCallingConv.inc" @@ -701,9 +702,16 @@ // Handle *simple* calls for now. const Type *RetTy = CS.getType(); MVT RetVT; - if (!isTypeLegal(RetTy, TLI, RetVT)) + if (!isTypeLegal(RetTy, TLI, RetVT, true)) return false; + // Allow calls which produce i1 results. + bool AndToI1 = false; + if (RetVT == MVT::i1) { + RetVT = MVT::i8; + AndToI1 = true; + } + // Deal with call operands first. SmallVector Args; SmallVector ArgVTs; @@ -859,6 +867,13 @@ addFrameReference(BuildMI(MBB, TII.get(Opc), ResultReg), FI); } + if (AndToI1) { + // Mask out all but lowest bit for some call which produces an i1. + unsigned AndResult = createResultReg(X86::GR8RegisterClass); + BuildMI(MBB, TII.get(X86::AND8ri), AndResult).addReg(ResultReg).addImm(1); + ResultReg = AndResult; + } + UpdateValueMap(I, ResultReg); } Added: llvm/trunk/test/CodeGen/X86/fast-isel-call.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-call.ll?rev=55925&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-call.ll (added) +++ llvm/trunk/test/CodeGen/X86/fast-isel-call.ll Mon Sep 8 12:15:42 2008 @@ -0,0 +1,13 @@ +; RUN: llvm-as < %s | llc -fast-isel -march=x86 | grep and + +define i32 @t() nounwind { +tak: + %tmp = call i1 @foo() + br i1 %tmp, label %BB1, label %BB2 +BB1: + ret i32 1 +BB2: + ret i32 0 +} + +declare i1 @foo() zeroext nounwind From isanbard at gmail.com Mon Sep 8 12:51:11 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 17:51:11 -0000 Subject: [llvm-commits] [llvm] r55926 - /llvm/tags/Apple/llvmCore-2068/ Message-ID: <200809081751.m88HpCpm013887@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 12:51:10 2008 New Revision: 55926 URL: http://llvm.org/viewvc/llvm-project?rev=55926&view=rev Log: Creating llvmCore-2068 branch Added: llvm/tags/Apple/llvmCore-2068/ - copied from r55925, llvm/trunk/ From isanbard at gmail.com Mon Sep 8 12:51:21 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 17:51:21 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55927 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ Message-ID: <200809081751.m88HpMVw013900@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 12:51:21 2008 New Revision: 55927 URL: http://llvm.org/viewvc/llvm-project?rev=55927&view=rev Log: Creating llvmgcc42-2068 branch Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ - copied from r55926, llvm-gcc-4.2/trunk/ From isanbard at gmail.com Mon Sep 8 12:55:04 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 8 Sep 2008 10:55:04 -0700 Subject: [llvm-commits] [llvm] r55898 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp In-Reply-To: <200809081421.m88ELB1A005241@zion.cs.uiuc.edu> References: <200809081421.m88ELB1A005241@zion.cs.uiuc.edu> Message-ID: <16e5fdf90809081055v43fa0c83p673b5de0f2bd9e41@mail.gmail.com> Anton, One of your changes between r 55898 and r 55909 is causing an internal compiler error during a full bootstrap: /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 -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DSHARED -m64 -DL_negdi2 -c ../../llvm-gcc.src/gcc/libgcc2.c -o libgcc/x86_64/_negdi2_s.o Assertion failed: (TargetRegisterInfo::isVirtualRegister(regA) && TargetRegisterInfo::isVirtualRegister(regB) && "cannot update physical register live information"), function runOnMachineFunction, file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/lib/CodeGen/TwoAddressInstructionPass.cpp, line 311. /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 -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DSHARED -m64 -DL_lshrdi3 -c ../../llvm-gcc.src/gcc/libgcc2.c -o libgcc/x86_64/_lshrdi3_s.o ../../llvm-gcc.src/gcc/unwind-dw2.c:1527: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See for instructions. {standard input}:unknown:Undefined local symbol LBB21_11 {standard input}:unknown:Undefined local symbol LBB21_12 {standard input}:unknown:Undefined local symbol LBB21_13 {standard input}:unknown:Undefined local symbol LBB21_8 I'm going to revert your changes for now. Please investigate and fix. Thanks! -bw On Mon, Sep 8, 2008 at 7:21 AM, Anton Korobeynikov wrote: > Author: asl > Date: Mon Sep 8 09:21:10 2008 > New Revision: 55898 > > URL: http://llvm.org/viewvc/llvm-project?rev=55898&view=rev > Log: > Implement FRAME_TO_ARGS_OFFSET for x86-64 > > 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=55898&r1=55897&r2=55898&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Sep 8 09:21:10 2008 > @@ -258,8 +258,7 @@ > } > // X86 ret instruction may pop stack. > setOperationAction(ISD::RET , MVT::Other, Custom); > - if (!Subtarget->is64Bit()) > - setOperationAction(ISD::EH_RETURN , MVT::Other, Custom); > + setOperationAction(ISD::EH_RETURN , MVT::Other, Custom); > > // Darwin ABI issue. > setOperationAction(ISD::ConstantPool , MVT::i32 , Custom); > @@ -325,7 +324,8 @@ > setExceptionSelectorRegister(X86::EDX); > } > setOperationAction(ISD::FRAME_TO_ARGS_OFFSET, MVT::i32, Custom); > - > + setOperationAction(ISD::FRAME_TO_ARGS_OFFSET, MVT::i64, Custom); > + > setOperationAction(ISD::TRAMPOLINE, MVT::Other, Custom); > > setOperationAction(ISD::TRAP, MVT::Other, Legal); > @@ -5593,19 +5593,15 @@ > // Depths > 0 not supported yet! > if (cast(Op.getOperand(0))->getValue() > 0) > return SDValue(); > - > + > SDValue RetAddrFI = getReturnAddressFrameIndex(DAG); > - return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI, > + return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI, > DAG.getIntPtrConstant(!Subtarget->is64Bit() ? 4 : 8)); > } > > SDValue X86TargetLowering::LowerFRAME_TO_ARGS_OFFSET(SDValue Op, > - SelectionDAG &DAG) { > - // Is not yet supported on x86-64 > - if (Subtarget->is64Bit()) > - return SDValue(); > - > - return DAG.getIntPtrConstant(8); > + SelectionDAG &DAG) { > + return DAG.getIntPtrConstant(Subtarget->is64Bit() ? 16 : 8); > } > > SDValue X86TargetLowering::LowerEH_RETURN(SDValue Op, SelectionDAG &DAG) > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From isanbard at gmail.com Mon Sep 8 12:59:13 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 17:59:13 -0000 Subject: [llvm-commits] [llvm] r55928 - in /llvm/trunk: include/llvm/Intrinsics.td include/llvm/Target/TargetMachine.h lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp lib/Target/TargetMachine.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86Instr64bit.td lib/Target/X86/X86RegisterInfo.cpp lib/Target/X86/X86TargetAsmInfo.cpp test/CodeGen/X86/2008-08-31-EH_RETURN32.ll test/CodeGen/X86/2008-08-31-EH_RETURN64.ll Message-ID: <200809081759.m88HxDEU014180@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 12:59:12 2008 New Revision: 55928 URL: http://llvm.org/viewvc/llvm-project?rev=55928&view=rev Log: Reverting r55898 to r55909. One of these patches was causing an ICE during the full bootstrap on Darwin: /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 -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DSHARED -m64 -DL_negdi2 -c ../../llvm-gcc.src/gcc/libgcc2.c -o libgcc/x86_64/_negdi2_s.o Assertion failed: (TargetRegisterInfo::isVirtualRegister(regA) && TargetRegisterInfo::isVirtualRegister(regB) && "cannot update physical register live information"), function runOnMachineFunction, file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/lib/CodeGen/TwoAddressInstructionPass.cpp, line 311. /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 -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DSHARED -m64 -DL_lshrdi3 -c ../../llvm-gcc.src/gcc/libgcc2.c -o libgcc/x86_64/_lshrdi3_s.o ./../llvm-gcc.src/gcc/unwind-dw2.c:1527: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See for instructions. {standard input}:unknown:Undefined local symbol LBB21_11 {standard input}:unknown:Undefined local symbol LBB21_12 {standard input}:unknown:Undefined local symbol LBB21_13 {standard input}:unknown:Undefined local symbol LBB21_8 Modified: llvm/trunk/include/llvm/Intrinsics.td llvm/trunk/include/llvm/Target/TargetMachine.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp llvm/trunk/lib/Target/TargetMachine.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll Modified: llvm/trunk/include/llvm/Intrinsics.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=55928&r1=55927&r2=55928&view=diff ============================================================================== --- llvm/trunk/include/llvm/Intrinsics.td (original) +++ llvm/trunk/include/llvm/Intrinsics.td Mon Sep 8 12:59:12 2008 @@ -255,8 +255,8 @@ def int_eh_typeid_for_i32 : Intrinsic<[llvm_i32_ty, llvm_ptr_ty]>; def int_eh_typeid_for_i64 : Intrinsic<[llvm_i64_ty, llvm_ptr_ty]>; -def int_eh_return_i32 : Intrinsic<[llvm_void_ty, llvm_i32_ty, llvm_ptr_ty]>; -def int_eh_return_i64 : Intrinsic<[llvm_void_ty, llvm_i64_ty, llvm_ptr_ty]>; +def int_eh_return : Intrinsic<[llvm_void_ty, llvm_i32_ty, llvm_ptr_ty]>, + GCCBuiltin<"__builtin_eh_return">; def int_eh_unwind_init: Intrinsic<[llvm_void_ty]>, GCCBuiltin<"__builtin_unwind_init">; Modified: llvm/trunk/include/llvm/Target/TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=55928&r1=55927&r2=55928&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetMachine.h (original) +++ llvm/trunk/include/llvm/Target/TargetMachine.h Mon Sep 8 12:59:12 2008 @@ -68,6 +68,15 @@ }; } +// Stack canary model types. +namespace StackCanaries { + enum Model { + Default, + On, + Always + }; +} + //===----------------------------------------------------------------------===// /// /// TargetMachine - Primary interface to the complete machine description for Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=55928&r1=55927&r2=55928&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Sep 8 12:59:12 2008 @@ -3115,7 +3115,7 @@ MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); MVT VT = (Intrinsic == Intrinsic::eh_typeid_for_i32 ? MVT::i32 : MVT::i64); - + if (MMI) { // Find the type id for the given typeinfo. GlobalVariable *GV = ExtractTypeInfo(I.getOperand(1)); @@ -3130,9 +3130,10 @@ return 0; } - case Intrinsic::eh_return_i32: - case Intrinsic::eh_return_i64: - if (MachineModuleInfo *MMI = DAG.getMachineModuleInfo()) { + case Intrinsic::eh_return: { + MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); + + if (MMI) { MMI->setCallsEHReturn(true); DAG.setRoot(DAG.getNode(ISD::EH_RETURN, MVT::Other, @@ -3144,36 +3145,39 @@ } return 0; - case Intrinsic::eh_unwind_init: - if (MachineModuleInfo *MMI = DAG.getMachineModuleInfo()) { - MMI->setCallsUnwindInit(true); - } - - return 0; + } - case Intrinsic::eh_dwarf_cfa: { - MVT VT = getValue(I.getOperand(1)).getValueType(); - SDValue CfaArg; - if (VT.bitsGT(TLI.getPointerTy())) - CfaArg = DAG.getNode(ISD::TRUNCATE, - TLI.getPointerTy(), getValue(I.getOperand(1))); - else - CfaArg = DAG.getNode(ISD::SIGN_EXTEND, - TLI.getPointerTy(), getValue(I.getOperand(1))); - - SDValue Offset = DAG.getNode(ISD::ADD, - TLI.getPointerTy(), - DAG.getNode(ISD::FRAME_TO_ARGS_OFFSET, - TLI.getPointerTy()), - CfaArg); - setValue(&I, DAG.getNode(ISD::ADD, - TLI.getPointerTy(), - DAG.getNode(ISD::FRAMEADDR, - TLI.getPointerTy(), - DAG.getConstant(0, - TLI.getPointerTy())), - Offset)); - return 0; + case Intrinsic::eh_unwind_init: { + if (MachineModuleInfo *MMI = DAG.getMachineModuleInfo()) { + MMI->setCallsUnwindInit(true); + } + + return 0; + } + + case Intrinsic::eh_dwarf_cfa: { + MVT VT = getValue(I.getOperand(1)).getValueType(); + SDValue CfaArg; + if (VT.bitsGT(TLI.getPointerTy())) + CfaArg = DAG.getNode(ISD::TRUNCATE, + TLI.getPointerTy(), getValue(I.getOperand(1))); + else + CfaArg = DAG.getNode(ISD::SIGN_EXTEND, + TLI.getPointerTy(), getValue(I.getOperand(1))); + + SDValue Offset = DAG.getNode(ISD::ADD, + TLI.getPointerTy(), + DAG.getNode(ISD::FRAME_TO_ARGS_OFFSET, + TLI.getPointerTy()), + CfaArg); + setValue(&I, DAG.getNode(ISD::ADD, + TLI.getPointerTy(), + DAG.getNode(ISD::FRAMEADDR, + TLI.getPointerTy(), + DAG.getConstant(0, + TLI.getPointerTy())), + Offset)); + return 0; } case Intrinsic::sqrt: Modified: llvm/trunk/lib/Target/TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=55928&r1=55927&r2=55928&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/TargetMachine.cpp Mon Sep 8 12:59:12 2008 @@ -40,6 +40,7 @@ bool RealignStack; bool VerboseAsm; bool DisableJumpTables; + StackCanaries::Model StackProtectors; } static cl::opt PrintCode("print-machineinstrs", @@ -163,6 +164,21 @@ cl::location(DisableJumpTables), cl::init(false)); +static cl::opt +GenerateStackProtectors("stack-protector", + cl::desc("Generate stack protectors"), + cl::location(StackProtectors), + cl::init(StackCanaries::Default), + cl::values( + clEnumValN(StackCanaries::Default, "default", + " No stack protectors"), + clEnumValN(StackCanaries::On, "on", + " Generate stack protectors for functions that" + "need them"), + clEnumValN(StackCanaries::Always, "all", + " Generate stack protectors for all functions"), + clEnumValEnd)); + //--------------------------------------------------------------------------- // TargetMachine Class // Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=55928&r1=55927&r2=55928&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Sep 8 12:59:12 2008 @@ -316,6 +316,7 @@ setOperationAction(ISD::EXCEPTIONADDR, MVT::i32, Expand); setOperationAction(ISD::EHSELECTION, MVT::i32, Expand); if (Subtarget->is64Bit()) { + // FIXME: Verify setExceptionPointerRegister(X86::RAX); setExceptionSelectorRegister(X86::RDX); } else { @@ -5595,7 +5596,7 @@ SDValue RetAddrFI = getReturnAddressFrameIndex(DAG); return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI, - DAG.getIntPtrConstant(Subtarget->is64Bit() ? 8 : 4)); + DAG.getIntPtrConstant(!Subtarget->is64Bit() ? 4 : 8)); } SDValue X86TargetLowering::LowerFRAME_TO_ARGS_OFFSET(SDValue Op, @@ -5605,26 +5606,26 @@ SDValue X86TargetLowering::LowerEH_RETURN(SDValue Op, SelectionDAG &DAG) { + assert(!Subtarget->is64Bit() && + "Lowering of eh_return builtin is not supported yet on x86-64"); + MachineFunction &MF = DAG.getMachineFunction(); SDValue Chain = Op.getOperand(0); SDValue Offset = Op.getOperand(1); SDValue Handler = Op.getOperand(2); - SDValue Frame = DAG.getRegister(Subtarget->is64Bit() ? X86::RBP : X86::EBP, - getPointerTy()); - unsigned StoreAddrReg = (Subtarget->is64Bit() ? X86::RCX : X86::ECX); + SDValue Frame = DAG.getRegister(RegInfo->getFrameRegister(MF), + getPointerTy()); SDValue StoreAddr = DAG.getNode(ISD::SUB, getPointerTy(), Frame, - DAG.getIntPtrConstant(Subtarget->is64Bit() ? - -8UL: -4UL)); + DAG.getIntPtrConstant(-4UL)); StoreAddr = DAG.getNode(ISD::ADD, getPointerTy(), StoreAddr, Offset); Chain = DAG.getStore(Chain, Handler, StoreAddr, NULL, 0); - Chain = DAG.getCopyToReg(Chain, StoreAddrReg, StoreAddr); - MF.getRegInfo().addLiveOut(StoreAddrReg); + Chain = DAG.getCopyToReg(Chain, X86::ECX, StoreAddr); + MF.getRegInfo().addLiveOut(X86::ECX); - return DAG.getNode(X86ISD::EH_RETURN, - MVT::Other, - Chain, DAG.getRegister(StoreAddrReg, getPointerTy())); + return DAG.getNode(X86ISD::EH_RETURN, MVT::Other, + Chain, DAG.getRegister(X86::ECX, getPointerTy())); } SDValue X86TargetLowering::LowerTRAMPOLINE(SDValue Op, Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=55928&r1=55927&r2=55928&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Mon Sep 8 12:59:12 2008 @@ -130,17 +130,6 @@ } //===----------------------------------------------------------------------===// -// EH Pseudo Instructions -// -let isTerminator = 1, isReturn = 1, isBarrier = 1, - hasCtrlDep = 1 in { -def EH_RETURN64 : I<0xC3, RawFrm, (outs), (ins GR64:$addr), - "ret\t#eh_return, addr: $addr", - [(X86ehret GR64:$addr)]>; - -} - -//===----------------------------------------------------------------------===// // Miscellaneous Instructions... // let Defs = [RBP,RSP], Uses = [RBP,RSP], mayLoad = 1, neverHasSideEffects = 1 in Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=55928&r1=55927&r2=55928&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Mon Sep 8 12:59:12 2008 @@ -159,14 +159,6 @@ const unsigned * X86RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const { - bool callsEHReturn = false; - - if (MF) { - const MachineFrameInfo *MFI = MF->getFrameInfo(); - const MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); - callsEHReturn = (MMI ? MMI->callsEHReturn() : false); - } - static const unsigned CalleeSavedRegs32Bit[] = { X86::ESI, X86::EDI, X86::EBX, X86::EBP, 0 }; @@ -179,11 +171,6 @@ X86::RBX, X86::R12, X86::R13, X86::R14, X86::R15, X86::RBP, 0 }; - static const unsigned CalleeSavedRegs64EHRet[] = { - X86::RAX, X86::RDX, X86::RBX, X86::R12, - X86::R13, X86::R14, X86::R15, X86::RBP, 0 - }; - static const unsigned CalleeSavedRegsWin64[] = { X86::RBX, X86::RBP, X86::RDI, X86::RSI, X86::R12, X86::R13, X86::R14, X86::R15, 0 @@ -193,22 +180,20 @@ if (IsWin64) return CalleeSavedRegsWin64; else - return (callsEHReturn ? CalleeSavedRegs64EHRet : CalleeSavedRegs64Bit); + return CalleeSavedRegs64Bit; } else { - return (callsEHReturn ? CalleeSavedRegs32EHRet : CalleeSavedRegs32Bit); + if (MF) { + const MachineFrameInfo *MFI = MF->getFrameInfo(); + const MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); + if (MMI && MMI->callsEHReturn()) + return CalleeSavedRegs32EHRet; + } + return CalleeSavedRegs32Bit; } } const TargetRegisterClass* const* X86RegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const { - bool callsEHReturn = false; - - if (MF) { - const MachineFrameInfo *MFI = MF->getFrameInfo(); - const MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); - callsEHReturn = (MMI ? MMI->callsEHReturn() : false); - } - static const TargetRegisterClass * const CalleeSavedRegClasses32Bit[] = { &X86::GR32RegClass, &X86::GR32RegClass, &X86::GR32RegClass, &X86::GR32RegClass, 0 @@ -223,12 +208,6 @@ &X86::GR64RegClass, &X86::GR64RegClass, &X86::GR64RegClass, &X86::GR64RegClass, 0 }; - static const TargetRegisterClass * const CalleeSavedRegClasses64EHRet[] = { - &X86::GR64RegClass, &X86::GR64RegClass, - &X86::GR64RegClass, &X86::GR64RegClass, - &X86::GR64RegClass, &X86::GR64RegClass, - &X86::GR64RegClass, &X86::GR64RegClass, 0 - }; static const TargetRegisterClass * const CalleeSavedRegClassesWin64[] = { &X86::GR64RegClass, &X86::GR64RegClass, &X86::GR64RegClass, &X86::GR64RegClass, @@ -240,12 +219,17 @@ if (IsWin64) return CalleeSavedRegClassesWin64; else - return (callsEHReturn ? - CalleeSavedRegClasses64EHRet : CalleeSavedRegClasses64Bit); + return CalleeSavedRegClasses64Bit; } else { - return (callsEHReturn ? - CalleeSavedRegClasses32EHRet : CalleeSavedRegClasses32Bit); + if (MF) { + const MachineFrameInfo *MFI = MF->getFrameInfo(); + const MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); + if (MMI && MMI->callsEHReturn()) + return CalleeSavedRegClasses32EHRet; + } + return CalleeSavedRegClasses32Bit; } + } BitVector X86RegisterInfo::getReservedRegs(const MachineFunction &MF) const { @@ -803,7 +787,6 @@ case X86::TCRETURNri64: case X86::TCRETURNdi64: case X86::EH_RETURN: - case X86::EH_RETURN64: case X86::TAILJMPd: case X86::TAILJMPr: case X86::TAILJMPm: break; // These are ok @@ -877,13 +860,12 @@ } // We're returning from function via eh_return. - if (RetOpcode == X86::EH_RETURN || RetOpcode == X86::EH_RETURN64) { + if (RetOpcode == X86::EH_RETURN) { MBBI = prior(MBB.end()); MachineOperand &DestAddr = MBBI->getOperand(0); assert(DestAddr.isRegister() && "Offset should be in register!"); - BuildMI(MBB, MBBI, - TII.get(Is64Bit ? X86::MOV64rr : X86::MOV32rr), - StackPtr).addReg(DestAddr.getReg()); + BuildMI(MBB, MBBI, TII.get(Is64Bit ? X86::MOV64rr : X86::MOV32rr),StackPtr). + addReg(DestAddr.getReg()); // Tail call return: adjust the stack pointer and jump to callee } else if (RetOpcode == X86::TCRETURNri || RetOpcode == X86::TCRETURNdi || RetOpcode== X86::TCRETURNri64 || RetOpcode == X86::TCRETURNdi64) { Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=55928&r1=55927&r2=55928&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Mon Sep 8 12:59:12 2008 @@ -230,6 +230,7 @@ X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM): X86TargetAsmInfo(TM), ELFTargetAsmInfo(TM) { + bool is64Bit = ETM->getSubtarget().is64Bit(); ReadOnlySection = ".rodata"; FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\", at progbits,4"; @@ -260,7 +261,8 @@ DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\", at progbits"; // Exceptions handling - SupportsExceptionHandling = true; + if (!is64Bit) + SupportsExceptionHandling = true; AbsoluteEHSectionOffsets = false; DwarfEHFrameSection = "\t.section\t.eh_frame,\"aw\", at progbits"; DwarfExceptionSection = "\t.section\t.gcc_except_table,\"a\", at progbits"; Modified: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll?rev=55928&r1=55927&r2=55928&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll Mon Sep 8 12:59:12 2008 @@ -1,17 +0,0 @@ -; Check that eh_return & unwind_init were properly lowered -; RUN: llvm-as < %s | llc | grep %ebp | count 9 -; RUN: llvm-as < %s | llc | grep %ecx | count 5 - -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" -target triple = "i386-pc-linux" - -define i8* @test(i32 %a, i8* %b) { -entry: - call void @llvm.eh.unwind.init() - %foo = alloca i32 - call void @llvm.eh.return.i32(i32 %a, i8* %b) - unreachable -} - -declare void @llvm.eh.return.i32(i32, i8*) -declare void @llvm.eh.unwind.init() Modified: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll?rev=55928&r1=55927&r2=55928&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll Mon Sep 8 12:59:12 2008 @@ -1,17 +0,0 @@ -; Check that eh_return & unwind_init were properly lowered -; RUN: llvm-as < %s | llc | grep %rbp | count 7 -; RUN: llvm-as < %s | llc | grep %rcx | count 3 - -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" -target triple = "x86_64-unknown-linux-gnu" - -define i8* @test(i64 %a, i8* %b) { -entry: - call void @llvm.eh.unwind.init() - %foo = alloca i32 - call void @llvm.eh.return.i64(i64 %a, i8* %b) - unreachable -} - -declare void @llvm.eh.return.i64(i64, i8*) -declare void @llvm.eh.unwind.init() From isanbard at gmail.com Mon Sep 8 12:59:39 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 17:59:39 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55929 - in /llvm-gcc-4.2/trunk: README.LLVM gcc/llvm-convert.cpp Message-ID: <200809081759.m88HxeTU014208@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 12:59:39 2008 New Revision: 55929 URL: http://llvm.org/viewvc/llvm-project?rev=55929&view=rev Log: Reverting r55898 to r55909. One of these patches was causing an ICE during the full bootstrap on Darwin: /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 -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DSHARED -m64 -DL_negdi2 -c ../../llvm-gcc.src/gcc/libgcc2.c -o libgcc/x86_64/_negdi2_s.o Assertion failed: (TargetRegisterInfo::isVirtualRegister(regA) && TargetRegisterInfo::isVirtualRegister(regB) && "cannot update physical register live information"), function runOnMachineFunction, file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/lib/CodeGen/TwoAddressInstructionPass.cpp, line 311. /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 -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DSHARED -m64 -DL_lshrdi3 -c ../../llvm-gcc.src/gcc/libgcc2.c -o libgcc/x86_64/_lshrdi3_s.o ./../llvm-gcc.src/gcc/unwind-dw2.c:1527: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See for instructions. {standard input}:unknown:Undefined local symbol LBB21_11 {standard input}:unknown:Undefined local symbol LBB21_12 {standard input}:unknown:Undefined local symbol LBB21_13 {standard input}:unknown:Undefined local symbol LBB21_8 Modified: llvm-gcc-4.2/trunk/README.LLVM llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/README.LLVM URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/README.LLVM?rev=55929&r1=55928&r2=55929&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/README.LLVM (original) +++ llvm-gcc-4.2/trunk/README.LLVM Mon Sep 8 12:59:39 2008 @@ -150,18 +150,12 @@ --enable-llvm=$LLVMOBJDIR --enable-languages=c,c++$EXTRALANGS $TARGETOPTIONS $ make $BUILDOPTIONS $ make install - -//===----------------------- -Darwin/Mac OS X Specific part: - $ ln -sf /usr/lib/libstdc++.6.dylib `pwd`/../install/lib $ ln -sf /usr/lib/libstdc++.6.dylib `pwd`/../install/lib/libstdc++.dylib That last step, "ln -sf ..." is required so that the linker (collect2) can find libstdc++ ('-lstdc++') and subsequently link C++ executables correctly. -//===----------------------- - Note that if you prefer to bootstrap llvm-gcc (so that the final llvm-gcc executables have been compiled with llvm-gcc itself), replace "make" with "make bootstrap". 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=55929&r1=55928&r2=55929&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Sep 8 12:59:39 2008 @@ -5273,10 +5273,9 @@ int cfa_offset = ARG_POINTER_CFA_OFFSET(exp); - // FIXME: is i32 always enough here? Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, - Intrinsic::eh_dwarf_cfa), - ConstantInt::get(Type::Int32Ty, cfa_offset)); + Intrinsic::eh_dwarf_cfa), + ConstantInt::get(Type::Int32Ty, cfa_offset)); return true; } @@ -5325,21 +5324,17 @@ if (!validate_arglist(arglist, INTEGER_TYPE, POINTER_TYPE, VOID_TYPE)) return false; - const Type *IntPtr = TD.getIntPtrType(); Value *Offset = Emit(TREE_VALUE(arglist), 0); Value *Handler = Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0); - - Intrinsic::ID IID = (IntPtr == Type::Int32Ty ? - Intrinsic::eh_return_i32 : Intrinsic::eh_return_i64); - - Offset = Builder.CreateIntCast(Offset, IntPtr, true); + Offset = Builder.CreateIntCast(Offset, Type::Int32Ty, true); Handler = BitCastToType(Handler, PointerType::getUnqual(Type::Int8Ty)); SmallVector Args; Args.push_back(Offset); Args.push_back(Handler); - Builder.CreateCall(Intrinsic::getDeclaration(TheModule, IID), - Args.begin(), Args.end()); + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, + Intrinsic::eh_return), + Args.begin(), Args.end()); Result = Builder.CreateUnreachable(); EmitBlock(BasicBlock::Create("")); From dalej at apple.com Mon Sep 8 13:00:27 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 08 Sep 2008 18:00:27 -0000 Subject: [llvm-commits] [llvm] r55930 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200809081800.m88I0Rp1014252@zion.cs.uiuc.edu> Author: johannes Date: Mon Sep 8 13:00:26 2008 New Revision: 55930 URL: http://llvm.org/viewvc/llvm-project?rev=55930&view=rev Log: Redo the 3 existing low-precision expansions to use float constants. An oversight by the numerics people who supplied this. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=55930&r1=55929&r2=55930&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Sep 8 13:00:26 2008 @@ -2801,28 +2801,25 @@ SDValue t5 = DAG.getNode(ISD::AND, MVT::i32, t4, DAG.getConstant(1073741823, MVT::i32)); SDValue t6 = DAG.getNode(ISD::BIT_CONVERT, MVT::f32, t5); - SDValue t7 = DAG.getNode(ISD::FP_EXTEND, MVT::f64, t6); - SDValue t8 = DAG.getNode(ISD::FMUL, MVT::f64, t7, + SDValue t7 = DAG.getNode(ISD::FMUL, MVT::f32, t6, DAG.getConstantFP(APFloat( - APInt(64, 0xbfb4e4c5b6dfced3ULL)), MVT::f64)); - SDValue t9 = DAG.getNode(ISD::FADD, MVT::f64, t8, + APInt(32, 0xbda7262e)), MVT::f32)); + SDValue t8 = DAG.getNode(ISD::FADD, MVT::f32, t7, DAG.getConstantFP(APFloat( - APInt(64, 0x3fe4a5015b0db188ULL)), MVT::f64)); - SDValue t10 = DAG.getNode(ISD::FMUL, MVT::f64, t9, t7); - SDValue t11 = DAG.getNode(ISD::FSUB, MVT::f64, t10, + APInt(32, 0x3f25280b)), MVT::f32)); + SDValue t9 = DAG.getNode(ISD::FMUL, MVT::f32, t8, t6); + SDValue t10 = DAG.getNode(ISD::FSUB, MVT::f32, t9, DAG.getConstantFP(APFloat( - APInt(64, 0x4000f724658ffcb8ULL)), MVT::f64)); - SDValue t12 = DAG.getNode(ISD::FMUL, MVT::f64, t11, t7); - SDValue t13 = DAG.getNode(ISD::FADD, MVT::f64, t12, + APInt(32, 0x4007b923)), MVT::f32)); + SDValue t11 = DAG.getNode(ISD::FMUL, MVT::f32, t10, t6); + SDValue t12 = DAG.getNode(ISD::FADD, MVT::f32, t11, DAG.getConstantFP(APFloat( - APInt(64, 0x401047c5d1dbd553ULL)), MVT::f64)); - SDValue t14 = DAG.getNode(ISD::FMUL, MVT::f64, t13, t7); - SDValue t15 = DAG.getNode(ISD::FSUB, MVT::f64, t14, + APInt(32, 0x40823e2f)), MVT::f32)); + SDValue t13 = DAG.getNode(ISD::FMUL, MVT::f32, t12, t6); + SDValue t14 = DAG.getNode(ISD::FSUB, MVT::f32, t13, DAG.getConstantFP(APFloat( - APInt(64, 0x40041a537b273db2ULL)), MVT::f64)); - SDValue t16 = DAG.getNode(ISD::FP_ROUND, MVT::f32, t15, - DAG.getConstant(0, MVT::i32)); - result = DAG.getNode(ISD::FADD, MVT::f32, t3, t16); + APInt(32, 0x4020d29c)), MVT::f32)); + result = DAG.getNode(ISD::FADD, MVT::f32, t3, t14); } else { // No special expansion. result = DAG.getNode(ISD::FLOG2, @@ -2857,24 +2854,21 @@ SDValue t6 = DAG.getNode(ISD::AND, MVT::i32, t5, DAG.getConstant(1073741823, MVT::i32)); SDValue t7 = DAG.getNode(ISD::BIT_CONVERT, MVT::f32, t6); - SDValue t8 = DAG.getNode(ISD::FP_EXTEND, MVT::f64, t7); - SDValue t9 = DAG.getNode(ISD::FMUL, MVT::f64, t8, + SDValue t8 = DAG.getNode(ISD::FMUL, MVT::f32, t7, DAG.getConstantFP(APFloat( - APInt(64, 0x3fa863e61d44a337ULL)), MVT::f64)); - SDValue t10 = DAG.getNode(ISD::FSUB, MVT::f64, t9, + APInt(32, 0x3d431f31)), MVT::f32)); + SDValue t9 = DAG.getNode(ISD::FSUB, MVT::f32, t8, DAG.getConstantFP(APFloat( - APInt(64, 0x3fd443f63982ad9aULL)), MVT::f64)); - SDValue t11 = DAG.getNode(ISD::FMUL, MVT::f64, t10, t8); - SDValue t12 = DAG.getNode(ISD::FADD, MVT::f64, t11, + APInt(32, 0x3ea21fb2)), MVT::f32)); + SDValue t10 = DAG.getNode(ISD::FMUL, MVT::f32, t9, t7); + SDValue t11 = DAG.getNode(ISD::FADD, MVT::f32, t10, DAG.getConstantFP(APFloat( - APInt(64, 0x3fed5c4641d8bd71ULL)), MVT::f64)); - SDValue t13 = DAG.getNode(ISD::FMUL, MVT::f64, t12, t8); - SDValue t14 = DAG.getNode(ISD::FSUB, MVT::f64, t13, + APInt(32, 0x3f6ae232)), MVT::f32)); + SDValue t12 = DAG.getNode(ISD::FMUL, MVT::f32, t11, t7); + SDValue t13 = DAG.getNode(ISD::FSUB, MVT::f32, t12, DAG.getConstantFP(APFloat( - APInt(64, 0x3fe4bef863538c6fULL)), MVT::f64)); - SDValue t15 = DAG.getNode(ISD::FP_ROUND, MVT::f32, t14, - DAG.getConstant(0, MVT::i32)); - result = DAG.getNode(ISD::FADD, MVT::f32, t4, t15); + APInt(32, 0x3f25f7c3)), MVT::f32)); + result = DAG.getNode(ISD::FADD, MVT::f32, t4, t13); } else { // No special expansion. result = DAG.getNode(ISD::FLOG10, @@ -2898,26 +2892,23 @@ SDValue t2 = DAG.getNode(ISD::FSUB, MVT::f32, operand, t1); SDValue t3 = DAG.getNode(ISD::SHL, MVT::i32, t0, DAG.getConstant(23, MVT::i32)); - SDValue t4 = DAG.getNode(ISD::FP_EXTEND, MVT::f64, t2); - SDValue t5 = DAG.getNode(ISD::FMUL, MVT::f64, t4, + SDValue t4 = DAG.getNode(ISD::FMUL, MVT::f32, t2, DAG.getConstantFP(APFloat( - APInt(64, 0x3fb446bc609aa9cdULL)), MVT::f64)); - SDValue t6 = DAG.getNode(ISD::FADD, MVT::f64, t5, + APInt(32, 0x3da235e3)), MVT::f32)); + SDValue t5 = DAG.getNode(ISD::FADD, MVT::f32, t4, DAG.getConstantFP(APFloat( - APInt(64, 0x3fccb71e629f3a20ULL)), MVT::f64)); - SDValue t7 = DAG.getNode(ISD::FMUL, MVT::f64, t6, t4); - SDValue t8 = DAG.getNode(ISD::FADD, MVT::f64, t7, + APInt(32, 0x3e65b8f3)), MVT::f32)); + SDValue t6 = DAG.getNode(ISD::FMUL, MVT::f32, t5, t2); + SDValue t7 = DAG.getNode(ISD::FADD, MVT::f32, t6, DAG.getConstantFP(APFloat( - APInt(64, 0x3fe64960db7bd5feULL)), MVT::f64)); - SDValue t9 = DAG.getNode(ISD::FMUL, MVT::f64, t8, t4); - SDValue t10 = DAG.getNode(ISD::FADD, MVT::f64, t9, + APInt(32, 0x3f324b07)), MVT::f32)); + SDValue t8 = DAG.getNode(ISD::FMUL, MVT::f32, t7, t2); + SDValue t9 = DAG.getNode(ISD::FADD, MVT::f32, t8, DAG.getConstantFP(APFloat( - APInt(64, 0x3fefff1f934bd549ULL)), MVT::f64)); - SDValue t11 = DAG.getNode(ISD::FP_ROUND, MVT::f32, t10, - DAG.getConstant(0, MVT::i32)); - SDValue t12 = DAG.getNode(ISD::BIT_CONVERT, MVT::i32, t11); - SDValue t13 = DAG.getNode(ISD::ADD, MVT::i32, t12, t3); - result = DAG.getNode(ISD::BIT_CONVERT, MVT::f32, t13); + APInt(32, 0x3f7ff8fd)), MVT::f32)); + SDValue t10 = DAG.getNode(ISD::BIT_CONVERT, MVT::i32, t9); + SDValue t11 = DAG.getNode(ISD::ADD, MVT::i32, t10, t3); + result = DAG.getNode(ISD::BIT_CONVERT, MVT::f32, t11); } else { // No special expansion. result = DAG.getNode(ISD::FEXP2, From isanbard at gmail.com Mon Sep 8 13:00:39 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 18:00:39 -0000 Subject: [llvm-commits] [llvm] r55931 - in /llvm/trunk/test/CodeGen/X86: 2008-08-31-EH_RETURN32.ll 2008-08-31-EH_RETURN64.ll Message-ID: <200809081800.m88I0dQW014270@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 13:00:39 2008 New Revision: 55931 URL: http://llvm.org/viewvc/llvm-project?rev=55931&view=rev Log: Remove these testcases associated with changes between r 55898 and r 55909. Removed: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll Removed: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll?rev=55930&view=auto ============================================================================== (empty) Removed: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll?rev=55930&view=auto ============================================================================== (empty) From isanbard at gmail.com Mon Sep 8 13:00:55 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 18:00:55 -0000 Subject: [llvm-commits] [llvm] r55932 - /llvm/tags/Apple/llvmCore-2068/ Message-ID: <200809081800.m88I0trk014288@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 13:00:55 2008 New Revision: 55932 URL: http://llvm.org/viewvc/llvm-project?rev=55932&view=rev Log: Bad tag Removed: llvm/tags/Apple/llvmCore-2068/ From isanbard at gmail.com Mon Sep 8 13:01:04 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 18:01:04 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55933 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ Message-ID: <200809081801.m88I14sL014315@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 13:01:04 2008 New Revision: 55933 URL: http://llvm.org/viewvc/llvm-project?rev=55933&view=rev Log: Bad tag Removed: llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ From isanbard at gmail.com Mon Sep 8 13:01:37 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 18:01:37 -0000 Subject: [llvm-commits] [llvm] r55935 - /llvm/tags/Apple/llvmCore-2068/ Message-ID: <200809081801.m88I1blk014380@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 13:01:37 2008 New Revision: 55935 URL: http://llvm.org/viewvc/llvm-project?rev=55935&view=rev Log: Creating llvmCore-2068 branch Added: llvm/tags/Apple/llvmCore-2068/ - copied from r55934, llvm/trunk/ From isanbard at gmail.com Mon Sep 8 13:01:53 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 18:01:53 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55936 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ Message-ID: <200809081801.m88I1rZp014398@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 13:01:53 2008 New Revision: 55936 URL: http://llvm.org/viewvc/llvm-project?rev=55936&view=rev Log: Creating llvmgcc42-2068 branch Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ - copied from r55935, llvm-gcc-4.2/trunk/ From isanbard at gmail.com Mon Sep 8 13:03:22 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 8 Sep 2008 11:03:22 -0700 Subject: [llvm-commits] [llvm] r55886 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp In-Reply-To: <0A5ED1F5-C521-4E1E-9124-49065900B137@apple.com> References: <200809071134.m87BYmME005825@zion.cs.uiuc.edu> <92447DCF-2A3A-4474-A5B1-92B824F57C00@gmail.com> <0A5ED1F5-C521-4E1E-9124-49065900B137@apple.com> Message-ID: <16e5fdf90809081103h1832019bt78930bcb23d4cc7a@mail.gmail.com> On Mon, Sep 8, 2008 at 1:16 AM, Evan Cheng wrote: > > On Sep 7, 2008, at 5:35 PM, Bill Wendling wrote: > >> It's not a bug in that this wasn't being done. I was doing a static >> analysis of the DAG combiner and noticed that this wasn't doing what >> the comment claimed it should be doing. If this transformation is >> performed in the selection DAG code, then it should probably be >> removed from here entirely (along with the analogous "ADD" >> transformation). What do you think? > > No. The dag combiner xforms can still trigger. The issue is the > operand can be updated by something like ReplaceAllUsesWith which will > not transform the uses. > Okay, so should the dag combiner transforms be no-ops or actually do something? -bw From isanbard at gmail.com Mon Sep 8 13:12:01 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 18:12:01 -0000 Subject: [llvm-commits] [llvm] r55937 - in /llvm/trunk: include/llvm/Target/TargetMachine.h lib/Target/TargetMachine.cpp Message-ID: <200809081812.m88IC2EV014833@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 13:12:00 2008 New Revision: 55937 URL: http://llvm.org/viewvc/llvm-project?rev=55937&view=rev Log: Accidental commit of partial 'stack canaries' code Modified: llvm/trunk/include/llvm/Target/TargetMachine.h llvm/trunk/lib/Target/TargetMachine.cpp Modified: llvm/trunk/include/llvm/Target/TargetMachine.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=55937&r1=55936&r2=55937&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetMachine.h (original) +++ llvm/trunk/include/llvm/Target/TargetMachine.h Mon Sep 8 13:12:00 2008 @@ -68,15 +68,6 @@ }; } -// Stack canary model types. -namespace StackCanaries { - enum Model { - Default, - On, - Always - }; -} - //===----------------------------------------------------------------------===// /// /// TargetMachine - Primary interface to the complete machine description for Modified: llvm/trunk/lib/Target/TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=55937&r1=55936&r2=55937&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/TargetMachine.cpp Mon Sep 8 13:12:00 2008 @@ -40,7 +40,6 @@ bool RealignStack; bool VerboseAsm; bool DisableJumpTables; - StackCanaries::Model StackProtectors; } static cl::opt PrintCode("print-machineinstrs", @@ -164,21 +163,6 @@ cl::location(DisableJumpTables), cl::init(false)); -static cl::opt -GenerateStackProtectors("stack-protector", - cl::desc("Generate stack protectors"), - cl::location(StackProtectors), - cl::init(StackCanaries::Default), - cl::values( - clEnumValN(StackCanaries::Default, "default", - " No stack protectors"), - clEnumValN(StackCanaries::On, "on", - " Generate stack protectors for functions that" - "need them"), - clEnumValN(StackCanaries::Always, "all", - " Generate stack protectors for all functions"), - clEnumValEnd)); - //--------------------------------------------------------------------------- // TargetMachine Class // From gohman at apple.com Mon Sep 8 13:30:27 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 8 Sep 2008 11:30:27 -0700 Subject: [llvm-commits] [llvm] r55886 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp In-Reply-To: <16e5fdf90809081103h1832019bt78930bcb23d4cc7a@mail.gmail.com> References: <200809071134.m87BYmME005825@zion.cs.uiuc.edu> <92447DCF-2A3A-4474-A5B1-92B824F57C00@gmail.com> <0A5ED1F5-C521-4E1E-9124-49065900B137@apple.com> <16e5fdf90809081103h1832019bt78930bcb23d4cc7a@mail.gmail.com> Message-ID: On Sep 8, 2008, at 11:03 AM, Bill Wendling wrote: > On Mon, Sep 8, 2008 at 1:16 AM, Evan Cheng > wrote: >> >> On Sep 7, 2008, at 5:35 PM, Bill Wendling wrote: >> >>> It's not a bug in that this wasn't being done. I was doing a static >>> analysis of the DAG combiner and noticed that this wasn't doing what >>> the comment claimed it should be doing. If this transformation is >>> performed in the selection DAG code, then it should probably be >>> removed from here entirely (along with the analogous "ADD" >>> transformation). What do you think? >> >> No. The dag combiner xforms can still trigger. The issue is the >> operand can be updated by something like ReplaceAllUsesWith which >> will >> not transform the uses. >> > Okay, so should the dag combiner transforms be no-ops or actually do > something? We want folding to happen both at getNode time and DAGCombiner time. I think it would be possible to refactor the code to eliminate the code redundancy though, by moving getNode's folding code out into something like this: SDValue foldBinaryOp(ISD::NodeType Opcode, SDValue LHS, SDValue RHS); It would return a null SDValue instead of creating a new node in the case that it doesn't do a fold. Then getNode and DAGCombiner could both use it. This would also have the advantage of making it easier to do more folding at getNode time, which would make SelectionDAG more efficient and make some existing optimizations more effective. What do you think? Dan From gohman at apple.com Mon Sep 8 13:35:21 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 8 Sep 2008 11:35:21 -0700 Subject: [llvm-commits] LLVM IR change for review or committal - resubmitted In-Reply-To: <1220886601.23229.38.camel@Remington> References: <1220644043.23229.30.camel@Remington> <1220886601.23229.38.camel@Remington> Message-ID: Hi Preston, This looks good to me. The FUNC_CODE_INST_VCMP thing is a little counter-intuitive. I guess it's necessary in order to remain compatible with exiting vector FUNC_CODE_INST_CMP usage though, right? Thanks! Dan On Sep 8, 2008, at 8:10 AM, Preston Gurd wrote: > Resubmitted without auto-generated stuff, as requested... > > This proposed change is intended to accomplish the following: > > - extend the vcmp/fcmp LLVM IR instructions to take vectors as > arguments > and, if so, to return a vector of boolean as a result; > > - extend the select LLVM IR instruction to allow you to specify a > result > type which is a vector of boolean, in which case the result will be an > element-wise selection instead of choosing one vector or the other; > and > > - updated LangRef.html to describe these changes. > > Could someone please review these changes and either advise me what > additional changes you might want or else commit the patch for me? > > Thanks, > > Preston Gurd > > > On Mon, 2008-08-09 at 04:19 -0400, Anton Korobeynikov wrote: >> Hello, Preston >> >>> Could someone please review these changes and either advise me what >>> additional changes you might want or else commit the patch for me? >> Please remove auto-generated stuff from patch, this simplifies >> review greatly. >> >> -- >> With best regards, Anton Korobeynikov >> Faculty of Mathematics and Mechanics, Saint Petersburg State >> University >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From baldrick at free.fr Mon Sep 8 13:49:21 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 8 Sep 2008 20:49:21 +0200 Subject: [llvm-commits] [llvm] r55896 - /llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp In-Reply-To: References: <200809081108.m88B89se031302@zion.cs.uiuc.edu> Message-ID: <200809082049.22272.baldrick@free.fr> > > Author: baldrick > > Date: Mon Sep 8 06:08:09 2008 > > New Revision: 55896 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=55896&view=rev > > Log: > > Update the callgraph correctly. > > Duncan, > > I'm seeing following errors while building llvm using llvm-gcc. Can > you take a look ? I can't reproduce it so hopefully it is fixed. Sorry for not committing all these changes together (I tested them together, not individually). Ciao, Duncan. From anton at korobeynikov.info Mon Sep 8 14:11:32 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 8 Sep 2008 23:11:32 +0400 Subject: [llvm-commits] [llvm-gcc-4.2] r55929 - in /llvm-gcc-4.2/trunk: README.LLVM gcc/llvm-convert.cpp In-Reply-To: <200809081759.m88HxeTU014208@zion.cs.uiuc.edu> References: <200809081759.m88HxeTU014208@zion.cs.uiuc.edu> Message-ID: > - > -//===----------------------- > -Darwin/Mac OS X Specific part: > - It's pretty funny to see totally unrelated parts of readme stuff reverted :) -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From isanbard at gmail.com Mon Sep 8 14:42:33 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 19:42:33 -0000 Subject: [llvm-commits] [llvm] r55938 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200809081942.m88JgX6R018057@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 14:42:32 2008 New Revision: 55938 URL: http://llvm.org/viewvc/llvm-project?rev=55938&view=rev Log: Reverting r55898 as well. This wasn't reverted in the original revert... 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=55938&r1=55937&r2=55938&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Sep 8 14:42:32 2008 @@ -258,7 +258,8 @@ } // X86 ret instruction may pop stack. setOperationAction(ISD::RET , MVT::Other, Custom); - setOperationAction(ISD::EH_RETURN , MVT::Other, Custom); + if (!Subtarget->is64Bit()) + setOperationAction(ISD::EH_RETURN , MVT::Other, Custom); // Darwin ABI issue. setOperationAction(ISD::ConstantPool , MVT::i32 , Custom); @@ -324,8 +325,7 @@ setExceptionSelectorRegister(X86::EDX); } setOperationAction(ISD::FRAME_TO_ARGS_OFFSET, MVT::i32, Custom); - setOperationAction(ISD::FRAME_TO_ARGS_OFFSET, MVT::i64, Custom); - + setOperationAction(ISD::TRAMPOLINE, MVT::Other, Custom); setOperationAction(ISD::TRAP, MVT::Other, Legal); @@ -5593,15 +5593,19 @@ // Depths > 0 not supported yet! if (cast(Op.getOperand(0))->getValue() > 0) return SDValue(); - + SDValue RetAddrFI = getReturnAddressFrameIndex(DAG); - return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI, + return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI, DAG.getIntPtrConstant(!Subtarget->is64Bit() ? 4 : 8)); } SDValue X86TargetLowering::LowerFRAME_TO_ARGS_OFFSET(SDValue Op, - SelectionDAG &DAG) { - return DAG.getIntPtrConstant(Subtarget->is64Bit() ? 16 : 8); + SelectionDAG &DAG) { + // Is not yet supported on x86-64 + if (Subtarget->is64Bit()) + return SDValue(); + + return DAG.getIntPtrConstant(8); } SDValue X86TargetLowering::LowerEH_RETURN(SDValue Op, SelectionDAG &DAG) From isanbard at gmail.com Mon Sep 8 14:45:28 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 19:45:28 -0000 Subject: [llvm-commits] [llvm] r55939 - /llvm/tags/Apple/llvmCore-2068/trunk/ Message-ID: <200809081945.m88JjScR018189@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 14:45:27 2008 New Revision: 55939 URL: http://llvm.org/viewvc/llvm-project?rev=55939&view=rev Log: Creating llvmCore-2068 branch Added: llvm/tags/Apple/llvmCore-2068/trunk/ - copied from r55938, llvm/trunk/ From isanbard at gmail.com Mon Sep 8 14:48:45 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 8 Sep 2008 12:48:45 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r55929 - in /llvm-gcc-4.2/trunk: README.LLVM gcc/llvm-convert.cpp In-Reply-To: References: <200809081759.m88HxeTU014208@zion.cs.uiuc.edu> Message-ID: <16e5fdf90809081248p388eb746y62ad11bea312a437@mail.gmail.com> On Mon, Sep 8, 2008 at 12:11 PM, Anton Korobeynikov wrote: >> - >> -//===----------------------- >> -Darwin/Mac OS X Specific part: >> - > It's pretty funny to see totally unrelated parts of readme stuff reverted :) > I blame SVN ;-) -bw From gohman at apple.com Mon Sep 8 15:16:19 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 08 Sep 2008 20:16:19 -0000 Subject: [llvm-commits] [llvm] r55941 - /llvm/trunk/test/CodeGen/Generic/i128-and-beyond.ll Message-ID: <200809082016.m88KGJnV019364@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 15:16:18 2008 New Revision: 55941 URL: http://llvm.org/viewvc/llvm-project?rev=55941&view=rev Log: Add a target triple; apparently LLVM doesn't use 64-bit data directives on darwin. Modified: llvm/trunk/test/CodeGen/Generic/i128-and-beyond.ll Modified: llvm/trunk/test/CodeGen/Generic/i128-and-beyond.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/i128-and-beyond.ll?rev=55941&r1=55940&r2=55941&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/i128-and-beyond.ll (original) +++ llvm/trunk/test/CodeGen/Generic/i128-and-beyond.ll Mon Sep 8 15:16:18 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep 18446744073709551615 | count 14 +; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | grep 18446744073709551615 | count 14 ; RUN: llvm-as < %s | llc -march=ppc32 | grep 4294967295 | count 28 ; These static initializers are too big to hand off to assemblers From gohman at apple.com Mon Sep 8 15:37:59 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 08 Sep 2008 20:37:59 -0000 Subject: [llvm-commits] [llvm] r55942 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200809082037.m88KbxXW020237@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 15:37:59 2008 New Revision: 55942 URL: http://llvm.org/viewvc/llvm-project?rev=55942&view=rev Log: Fix a few I's that were meant to be renamed to BI's. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=55942&r1=55941&r2=55942&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Sep 8 15:37:59 2008 @@ -741,7 +741,7 @@ for (; BI != End; ++BI) { // Just before the terminator instruction, insert instructions to // feed PHI nodes in successor blocks. - if (isa(I)) + if (isa(BI)) if (!HandlePHINodesInSuccessorBlocksFast(LLVMBB, F)) { if (DisableFastISelAbort) break; @@ -763,7 +763,7 @@ if (isa(BI) || isa(BI) || isa(BI)) { if (BI->getType() != Type::VoidTy) { - unsigned &R = FuncInfo->ValueMap[I]; + unsigned &R = FuncInfo->ValueMap[BI]; if (!R) R = FuncInfo->CreateRegForValue(BI); } From isanbard at gmail.com Mon Sep 8 15:42:55 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 20:42:55 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55943 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ Message-ID: <200809082042.m88KgtQq020450@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 15:42:54 2008 New Revision: 55943 URL: http://llvm.org/viewvc/llvm-project?rev=55943&view=rev Log: Bad tag Removed: llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ From isanbard at gmail.com Mon Sep 8 15:43:07 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 20:43:07 -0000 Subject: [llvm-commits] [llvm] r55944 - /llvm/tags/Apple/llvmCore-2068/trunk/ Message-ID: <200809082043.m88Kh7FO020479@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 15:43:07 2008 New Revision: 55944 URL: http://llvm.org/viewvc/llvm-project?rev=55944&view=rev Log: Bad tag Removed: llvm/tags/Apple/llvmCore-2068/trunk/ From isanbard at gmail.com Mon Sep 8 15:43:35 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 20:43:35 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55947 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ Message-ID: <200809082043.m88KhZgF020525@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 15:43:35 2008 New Revision: 55947 URL: http://llvm.org/viewvc/llvm-project?rev=55947&view=rev Log: Creating llvmgcc42-2068 branch Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ - copied from r55946, llvm-gcc-4.2/trunk/ From isanbard at gmail.com Mon Sep 8 15:43:16 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 20:43:16 -0000 Subject: [llvm-commits] [llvm] r55945 - /llvm/tags/Apple/llvmCore-2068/ Message-ID: <200809082043.m88KhGbX020496@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 15:43:16 2008 New Revision: 55945 URL: http://llvm.org/viewvc/llvm-project?rev=55945&view=rev Log: Bad tag Removed: llvm/tags/Apple/llvmCore-2068/ From isanbard at gmail.com Mon Sep 8 15:43:28 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 20:43:28 -0000 Subject: [llvm-commits] [llvm] r55946 - /llvm/tags/Apple/llvmCore-2068/ Message-ID: <200809082043.m88KhS5J020513@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 15:43:28 2008 New Revision: 55946 URL: http://llvm.org/viewvc/llvm-project?rev=55946&view=rev Log: Creating llvmCore-2068 branch Added: llvm/tags/Apple/llvmCore-2068/ - copied from r55945, llvm/trunk/ From isanbard at gmail.com Mon Sep 8 15:49:06 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 20:49:06 -0000 Subject: [llvm-commits] [llvm] r55948 - /llvm/tags/Apple/llvmCore-2068/trunk/ Message-ID: <200809082049.m88Kn6LO020827@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 15:49:06 2008 New Revision: 55948 URL: http://llvm.org/viewvc/llvm-project?rev=55948&view=rev Log: Creating llvmCore-2068 branch Added: llvm/tags/Apple/llvmCore-2068/trunk/ - copied from r55947, llvm/trunk/ From isanbard at gmail.com Mon Sep 8 15:49:16 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 20:49:16 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55949 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/trunk/ Message-ID: <200809082049.m88KnG8w020850@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 15:49:15 2008 New Revision: 55949 URL: http://llvm.org/viewvc/llvm-project?rev=55949&view=rev Log: Creating llvmgcc42-2068 branch Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/trunk/ - copied from r55948, llvm-gcc-4.2/trunk/ From isanbard at gmail.com Mon Sep 8 16:00:10 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 21:00:10 -0000 Subject: [llvm-commits] [llvm] r55950 - /llvm/tags/Apple/llvmCore-2068/ Message-ID: <200809082100.m88L0AaP021230@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 16:00:10 2008 New Revision: 55950 URL: http://llvm.org/viewvc/llvm-project?rev=55950&view=rev Log: Bad tag Removed: llvm/tags/Apple/llvmCore-2068/ From isanbard at gmail.com Mon Sep 8 16:00:28 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 21:00:28 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55951 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ Message-ID: <200809082100.m88L0SsH021257@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 16:00:28 2008 New Revision: 55951 URL: http://llvm.org/viewvc/llvm-project?rev=55951&view=rev Log: Bad tag Removed: llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ From isanbard at gmail.com Mon Sep 8 16:03:27 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 21:03:27 -0000 Subject: [llvm-commits] [llvm] r55952 - /llvm/tags/Apple/llvmCore-2068/ Message-ID: <200809082103.m88L3Rp1021371@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 16:03:27 2008 New Revision: 55952 URL: http://llvm.org/viewvc/llvm-project?rev=55952&view=rev Log: Creating llvmCore-2068 branch Added: llvm/tags/Apple/llvmCore-2068/ - copied from r55951, llvm/trunk/ From isanbard at gmail.com Mon Sep 8 16:03:35 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 08 Sep 2008 21:03:35 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55953 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ Message-ID: <200809082103.m88L3ZM2021384@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 16:03:35 2008 New Revision: 55953 URL: http://llvm.org/viewvc/llvm-project?rev=55953&view=rev Log: Creating llvmgcc42-2068 branch Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2068/ - copied from r55952, llvm-gcc-4.2/trunk/ From asl at math.spbu.ru Mon Sep 8 16:12:11 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 21:12:11 -0000 Subject: [llvm-commits] [llvm] r55954 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200809082112.m88LCCLH021676@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 16:12:11 2008 New Revision: 55954 URL: http://llvm.org/viewvc/llvm-project?rev=55954&view=rev Log: Reapply blindly reverted 55898: Implement FRAME_TO_ARGS_OFFSET for x86-64 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=55954&r1=55953&r2=55954&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Sep 8 16:12:11 2008 @@ -258,8 +258,7 @@ } // X86 ret instruction may pop stack. setOperationAction(ISD::RET , MVT::Other, Custom); - if (!Subtarget->is64Bit()) - setOperationAction(ISD::EH_RETURN , MVT::Other, Custom); + setOperationAction(ISD::EH_RETURN , MVT::Other, Custom); // Darwin ABI issue. setOperationAction(ISD::ConstantPool , MVT::i32 , Custom); @@ -325,7 +324,8 @@ setExceptionSelectorRegister(X86::EDX); } setOperationAction(ISD::FRAME_TO_ARGS_OFFSET, MVT::i32, Custom); - + setOperationAction(ISD::FRAME_TO_ARGS_OFFSET, MVT::i64, Custom); + setOperationAction(ISD::TRAMPOLINE, MVT::Other, Custom); setOperationAction(ISD::TRAP, MVT::Other, Legal); @@ -5593,19 +5593,15 @@ // Depths > 0 not supported yet! if (cast(Op.getOperand(0))->getValue() > 0) return SDValue(); - + SDValue RetAddrFI = getReturnAddressFrameIndex(DAG); - return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI, + return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI, DAG.getIntPtrConstant(!Subtarget->is64Bit() ? 4 : 8)); } SDValue X86TargetLowering::LowerFRAME_TO_ARGS_OFFSET(SDValue Op, - SelectionDAG &DAG) { - // Is not yet supported on x86-64 - if (Subtarget->is64Bit()) - return SDValue(); - - return DAG.getIntPtrConstant(8); + SelectionDAG &DAG) { + return DAG.getIntPtrConstant(Subtarget->is64Bit() ? 16 : 8); } SDValue X86TargetLowering::LowerEH_RETURN(SDValue Op, SelectionDAG &DAG) From asl at math.spbu.ru Mon Sep 8 16:12:47 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 21:12:47 -0000 Subject: [llvm-commits] [llvm] r55955 - in /llvm/trunk: include/llvm/Intrinsics.td lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86Instr64bit.td lib/Target/X86/X86RegisterInfo.cpp Message-ID: <200809082112.m88LClEc021712@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 16:12:47 2008 New Revision: 55955 URL: http://llvm.org/viewvc/llvm-project?rev=55955&view=rev Log: Reapply 55899: First draft of EH support on x86/64-linux Now with fix, which prevents subtle codegen bug to trigger on darwin. No fix for bug though, it's still there. Modified: llvm/trunk/include/llvm/Intrinsics.td llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Modified: llvm/trunk/include/llvm/Intrinsics.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=55955&r1=55954&r2=55955&view=diff ============================================================================== --- llvm/trunk/include/llvm/Intrinsics.td (original) +++ llvm/trunk/include/llvm/Intrinsics.td Mon Sep 8 16:12:47 2008 @@ -255,8 +255,8 @@ def int_eh_typeid_for_i32 : Intrinsic<[llvm_i32_ty, llvm_ptr_ty]>; def int_eh_typeid_for_i64 : Intrinsic<[llvm_i64_ty, llvm_ptr_ty]>; -def int_eh_return : Intrinsic<[llvm_void_ty, llvm_i32_ty, llvm_ptr_ty]>, - GCCBuiltin<"__builtin_eh_return">; +def int_eh_return_i32 : Intrinsic<[llvm_void_ty, llvm_i32_ty, llvm_ptr_ty]>; +def int_eh_return_i64 : Intrinsic<[llvm_void_ty, llvm_i64_ty, llvm_ptr_ty]>; def int_eh_unwind_init: Intrinsic<[llvm_void_ty]>, GCCBuiltin<"__builtin_unwind_init">; Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=55955&r1=55954&r2=55955&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Sep 8 16:12:47 2008 @@ -316,7 +316,6 @@ setOperationAction(ISD::EXCEPTIONADDR, MVT::i32, Expand); setOperationAction(ISD::EHSELECTION, MVT::i32, Expand); if (Subtarget->is64Bit()) { - // FIXME: Verify setExceptionPointerRegister(X86::RAX); setExceptionSelectorRegister(X86::RDX); } else { @@ -5596,7 +5595,7 @@ SDValue RetAddrFI = getReturnAddressFrameIndex(DAG); return DAG.getNode(ISD::SUB, getPointerTy(), RetAddrFI, - DAG.getIntPtrConstant(!Subtarget->is64Bit() ? 4 : 8)); + DAG.getIntPtrConstant(Subtarget->is64Bit() ? 8 : 4)); } SDValue X86TargetLowering::LowerFRAME_TO_ARGS_OFFSET(SDValue Op, @@ -5606,26 +5605,26 @@ SDValue X86TargetLowering::LowerEH_RETURN(SDValue Op, SelectionDAG &DAG) { - assert(!Subtarget->is64Bit() && - "Lowering of eh_return builtin is not supported yet on x86-64"); - MachineFunction &MF = DAG.getMachineFunction(); SDValue Chain = Op.getOperand(0); SDValue Offset = Op.getOperand(1); SDValue Handler = Op.getOperand(2); - SDValue Frame = DAG.getRegister(RegInfo->getFrameRegister(MF), - getPointerTy()); + SDValue Frame = DAG.getRegister(Subtarget->is64Bit() ? X86::RBP : X86::EBP, + getPointerTy()); + unsigned StoreAddrReg = (Subtarget->is64Bit() ? X86::RCX : X86::ECX); SDValue StoreAddr = DAG.getNode(ISD::SUB, getPointerTy(), Frame, - DAG.getIntPtrConstant(-4UL)); + DAG.getIntPtrConstant(Subtarget->is64Bit() ? + -8ULL: -4ULL)); StoreAddr = DAG.getNode(ISD::ADD, getPointerTy(), StoreAddr, Offset); Chain = DAG.getStore(Chain, Handler, StoreAddr, NULL, 0); - Chain = DAG.getCopyToReg(Chain, X86::ECX, StoreAddr); - MF.getRegInfo().addLiveOut(X86::ECX); + Chain = DAG.getCopyToReg(Chain, StoreAddrReg, StoreAddr); + MF.getRegInfo().addLiveOut(StoreAddrReg); - return DAG.getNode(X86ISD::EH_RETURN, MVT::Other, - Chain, DAG.getRegister(X86::ECX, getPointerTy())); + return DAG.getNode(X86ISD::EH_RETURN, + MVT::Other, + Chain, DAG.getRegister(StoreAddrReg, getPointerTy())); } SDValue X86TargetLowering::LowerTRAMPOLINE(SDValue Op, Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=55955&r1=55954&r2=55955&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Mon Sep 8 16:12:47 2008 @@ -130,6 +130,17 @@ } //===----------------------------------------------------------------------===// +// EH Pseudo Instructions +// +let isTerminator = 1, isReturn = 1, isBarrier = 1, + hasCtrlDep = 1 in { +def EH_RETURN64 : I<0xC3, RawFrm, (outs), (ins GR64:$addr), + "ret\t#eh_return, addr: $addr", + [(X86ehret GR64:$addr)]>; + +} + +//===----------------------------------------------------------------------===// // Miscellaneous Instructions... // let Defs = [RBP,RSP], Uses = [RBP,RSP], mayLoad = 1, neverHasSideEffects = 1 in Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=55955&r1=55954&r2=55955&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Mon Sep 8 16:12:47 2008 @@ -159,6 +159,14 @@ const unsigned * X86RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const { + bool callsEHReturn = false; + + if (MF) { + const MachineFrameInfo *MFI = MF->getFrameInfo(); + const MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); + callsEHReturn = (MMI ? MMI->callsEHReturn() : false); + } + static const unsigned CalleeSavedRegs32Bit[] = { X86::ESI, X86::EDI, X86::EBX, X86::EBP, 0 }; @@ -171,6 +179,11 @@ X86::RBX, X86::R12, X86::R13, X86::R14, X86::R15, X86::RBP, 0 }; + static const unsigned CalleeSavedRegs64EHRet[] = { + X86::RAX, X86::RDX, X86::RBX, X86::R12, + X86::R13, X86::R14, X86::R15, X86::RBP, 0 + }; + static const unsigned CalleeSavedRegsWin64[] = { X86::RBX, X86::RBP, X86::RDI, X86::RSI, X86::R12, X86::R13, X86::R14, X86::R15, 0 @@ -180,20 +193,22 @@ if (IsWin64) return CalleeSavedRegsWin64; else - return CalleeSavedRegs64Bit; + return (callsEHReturn ? CalleeSavedRegs64EHRet : CalleeSavedRegs64Bit); } else { - if (MF) { - const MachineFrameInfo *MFI = MF->getFrameInfo(); - const MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); - if (MMI && MMI->callsEHReturn()) - return CalleeSavedRegs32EHRet; - } - return CalleeSavedRegs32Bit; + return (callsEHReturn ? CalleeSavedRegs32EHRet : CalleeSavedRegs32Bit); } } const TargetRegisterClass* const* X86RegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const { + bool callsEHReturn = false; + + if (MF) { + const MachineFrameInfo *MFI = MF->getFrameInfo(); + const MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); + callsEHReturn = (MMI ? MMI->callsEHReturn() : false); + } + static const TargetRegisterClass * const CalleeSavedRegClasses32Bit[] = { &X86::GR32RegClass, &X86::GR32RegClass, &X86::GR32RegClass, &X86::GR32RegClass, 0 @@ -208,6 +223,12 @@ &X86::GR64RegClass, &X86::GR64RegClass, &X86::GR64RegClass, &X86::GR64RegClass, 0 }; + static const TargetRegisterClass * const CalleeSavedRegClasses64EHRet[] = { + &X86::GR64RegClass, &X86::GR64RegClass, + &X86::GR64RegClass, &X86::GR64RegClass, + &X86::GR64RegClass, &X86::GR64RegClass, + &X86::GR64RegClass, &X86::GR64RegClass, 0 + }; static const TargetRegisterClass * const CalleeSavedRegClassesWin64[] = { &X86::GR64RegClass, &X86::GR64RegClass, &X86::GR64RegClass, &X86::GR64RegClass, @@ -219,17 +240,12 @@ if (IsWin64) return CalleeSavedRegClassesWin64; else - return CalleeSavedRegClasses64Bit; + return (callsEHReturn ? + CalleeSavedRegClasses64EHRet : CalleeSavedRegClasses64Bit); } else { - if (MF) { - const MachineFrameInfo *MFI = MF->getFrameInfo(); - const MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); - if (MMI && MMI->callsEHReturn()) - return CalleeSavedRegClasses32EHRet; - } - return CalleeSavedRegClasses32Bit; + return (callsEHReturn ? + CalleeSavedRegClasses32EHRet : CalleeSavedRegClasses32Bit); } - } BitVector X86RegisterInfo::getReservedRegs(const MachineFunction &MF) const { @@ -787,6 +803,7 @@ case X86::TCRETURNri64: case X86::TCRETURNdi64: case X86::EH_RETURN: + case X86::EH_RETURN64: case X86::TAILJMPd: case X86::TAILJMPr: case X86::TAILJMPm: break; // These are ok @@ -860,12 +877,13 @@ } // We're returning from function via eh_return. - if (RetOpcode == X86::EH_RETURN) { + if (RetOpcode == X86::EH_RETURN || RetOpcode == X86::EH_RETURN64) { MBBI = prior(MBB.end()); MachineOperand &DestAddr = MBBI->getOperand(0); assert(DestAddr.isRegister() && "Offset should be in register!"); - BuildMI(MBB, MBBI, TII.get(Is64Bit ? X86::MOV64rr : X86::MOV32rr),StackPtr). - addReg(DestAddr.getReg()); + BuildMI(MBB, MBBI, + TII.get(Is64Bit ? X86::MOV64rr : X86::MOV32rr), + StackPtr).addReg(DestAddr.getReg()); // Tail call return: adjust the stack pointer and jump to callee } else if (RetOpcode == X86::TCRETURNri || RetOpcode == X86::TCRETURNdi || RetOpcode== X86::TCRETURNri64 || RetOpcode == X86::TCRETURNdi64) { From asl at math.spbu.ru Mon Sep 8 16:13:08 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 21:13:08 -0000 Subject: [llvm-commits] [llvm] r55956 - /llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Message-ID: <200809082113.m88LD84J021732@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 16:13:08 2008 New Revision: 55956 URL: http://llvm.org/viewvc/llvm-project?rev=55956&view=rev Log: Reapply 55900: We do support EH on x86-64! Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=55956&r1=55955&r2=55956&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Mon Sep 8 16:13:08 2008 @@ -261,8 +261,7 @@ DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\", at progbits"; // Exceptions handling - if (!is64Bit) - SupportsExceptionHandling = true; + SupportsExceptionHandling = true; AbsoluteEHSectionOffsets = false; DwarfEHFrameSection = "\t.section\t.eh_frame,\"aw\", at progbits"; DwarfExceptionSection = "\t.section\t.gcc_except_table,\"a\", at progbits"; From asl at math.spbu.ru Mon Sep 8 16:13:33 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 21:13:33 -0000 Subject: [llvm-commits] [llvm] r55957 - /llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Message-ID: <200809082113.m88LDXPk021756@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 16:13:33 2008 New Revision: 55957 URL: http://llvm.org/viewvc/llvm-project?rev=55957&view=rev Log: Reapply 55901: Drop unused variable Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=55957&r1=55956&r2=55957&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Mon Sep 8 16:13:33 2008 @@ -230,7 +230,6 @@ X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM): X86TargetAsmInfo(TM), ELFTargetAsmInfo(TM) { - bool is64Bit = ETM->getSubtarget().is64Bit(); ReadOnlySection = ".rodata"; FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\", at progbits,4"; From asl at math.spbu.ru Mon Sep 8 16:13:56 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 21:13:56 -0000 Subject: [llvm-commits] [llvm] r55958 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200809082113.m88LDucp021776@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 16:13:56 2008 New Revision: 55958 URL: http://llvm.org/viewvc/llvm-project?rev=55958&view=rev Log: Reapply 55904: Unbreak and fix indentation Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=55958&r1=55957&r2=55958&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Sep 8 16:13:56 2008 @@ -3106,7 +3106,7 @@ MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); MVT VT = (Intrinsic == Intrinsic::eh_typeid_for_i32 ? MVT::i32 : MVT::i64); - + if (MMI) { // Find the type id for the given typeinfo. GlobalVariable *GV = ExtractTypeInfo(I.getOperand(1)); @@ -3121,10 +3121,9 @@ return 0; } - case Intrinsic::eh_return: { - MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); - - if (MMI) { + case Intrinsic::eh_return_i32: + case Intrinsic::eh_return_i64: + if (MachineModuleInfo *MMI = DAG.getMachineModuleInfo()) { MMI->setCallsEHReturn(true); DAG.setRoot(DAG.getNode(ISD::EH_RETURN, MVT::Other, @@ -3136,39 +3135,36 @@ } return 0; - } + case Intrinsic::eh_unwind_init: + if (MachineModuleInfo *MMI = DAG.getMachineModuleInfo()) { + MMI->setCallsUnwindInit(true); + } - case Intrinsic::eh_unwind_init: { - if (MachineModuleInfo *MMI = DAG.getMachineModuleInfo()) { - MMI->setCallsUnwindInit(true); - } - - return 0; - } - - case Intrinsic::eh_dwarf_cfa: { - MVT VT = getValue(I.getOperand(1)).getValueType(); - SDValue CfaArg; - if (VT.bitsGT(TLI.getPointerTy())) - CfaArg = DAG.getNode(ISD::TRUNCATE, - TLI.getPointerTy(), getValue(I.getOperand(1))); - else - CfaArg = DAG.getNode(ISD::SIGN_EXTEND, - TLI.getPointerTy(), getValue(I.getOperand(1))); - - SDValue Offset = DAG.getNode(ISD::ADD, - TLI.getPointerTy(), - DAG.getNode(ISD::FRAME_TO_ARGS_OFFSET, - TLI.getPointerTy()), - CfaArg); - setValue(&I, DAG.getNode(ISD::ADD, - TLI.getPointerTy(), - DAG.getNode(ISD::FRAMEADDR, - TLI.getPointerTy(), - DAG.getConstant(0, - TLI.getPointerTy())), - Offset)); - return 0; + return 0; + + case Intrinsic::eh_dwarf_cfa: { + MVT VT = getValue(I.getOperand(1)).getValueType(); + SDValue CfaArg; + if (VT.bitsGT(TLI.getPointerTy())) + CfaArg = DAG.getNode(ISD::TRUNCATE, + TLI.getPointerTy(), getValue(I.getOperand(1))); + else + CfaArg = DAG.getNode(ISD::SIGN_EXTEND, + TLI.getPointerTy(), getValue(I.getOperand(1))); + + SDValue Offset = DAG.getNode(ISD::ADD, + TLI.getPointerTy(), + DAG.getNode(ISD::FRAME_TO_ARGS_OFFSET, + TLI.getPointerTy()), + CfaArg); + setValue(&I, DAG.getNode(ISD::ADD, + TLI.getPointerTy(), + DAG.getNode(ISD::FRAMEADDR, + TLI.getPointerTy(), + DAG.getConstant(0, + TLI.getPointerTy())), + Offset)); + return 0; } case Intrinsic::sqrt: From asl at math.spbu.ru Mon Sep 8 16:14:20 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 21:14:20 -0000 Subject: [llvm-commits] [llvm] r55959 - /llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll Message-ID: <200809082114.m88LEK8C021799@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 16:14:19 2008 New Revision: 55959 URL: http://llvm.org/viewvc/llvm-project?rev=55959&view=rev Log: Reapply 55903: Testcase for 64-bit lowering of eh_return & unwind_init Added: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll Added: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll?rev=55959&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll Mon Sep 8 16:14:19 2008 @@ -0,0 +1,17 @@ +; Check that eh_return & unwind_init were properly lowered +; RUN: llvm-as < %s | llc | grep %rbp | count 7 +; RUN: llvm-as < %s | llc | grep %rcx | count 3 + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" +target triple = "x86_64-unknown-linux-gnu" + +define i8* @test(i64 %a, i8* %b) { +entry: + call void @llvm.eh.unwind.init() + %foo = alloca i32 + call void @llvm.eh.return.i64(i64 %a, i8* %b) + unreachable +} + +declare void @llvm.eh.return.i64(i64, i8*) +declare void @llvm.eh.unwind.init() From asl at math.spbu.ru Mon Sep 8 16:14:37 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 21:14:37 -0000 Subject: [llvm-commits] [llvm] r55960 - /llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll Message-ID: <200809082114.m88LEbHt021820@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 16:14:36 2008 New Revision: 55960 URL: http://llvm.org/viewvc/llvm-project?rev=55960&view=rev Log: Reapply 55902: Add test for checking proper lowering of eh_return & unwind init intrinsics on 32bit x86 targets Added: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll Added: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll?rev=55960&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll Mon Sep 8 16:14:36 2008 @@ -0,0 +1,17 @@ +; Check that eh_return & unwind_init were properly lowered +; RUN: llvm-as < %s | llc | grep %ebp | count 9 +; RUN: llvm-as < %s | llc | grep %ecx | count 5 + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" +target triple = "i386-pc-linux" + +define i8* @test(i32 %a, i8* %b) { +entry: + call void @llvm.eh.unwind.init() + %foo = alloca i32 + call void @llvm.eh.return.i32(i32 %a, i8* %b) + unreachable +} + +declare void @llvm.eh.return.i32(i32, i8*) +declare void @llvm.eh.unwind.init() From asl at math.spbu.ru Mon Sep 8 16:16:43 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 08 Sep 2008 21:16:43 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55961 - in /llvm-gcc-4.2/trunk: README.LLVM gcc/llvm-convert.cpp Message-ID: <200809082116.m88LGhvu021906@zion.cs.uiuc.edu> Author: asl Date: Mon Sep 8 16:16:42 2008 New Revision: 55961 URL: http://llvm.org/viewvc/llvm-project?rev=55961&view=rev Log: Reapply 55909. Modified: llvm-gcc-4.2/trunk/README.LLVM llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/README.LLVM URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/README.LLVM?rev=55961&r1=55960&r2=55961&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/README.LLVM (original) +++ llvm-gcc-4.2/trunk/README.LLVM Mon Sep 8 16:16:42 2008 @@ -150,12 +150,18 @@ --enable-llvm=$LLVMOBJDIR --enable-languages=c,c++$EXTRALANGS $TARGETOPTIONS $ make $BUILDOPTIONS $ make install + +//===----------------------- +Darwin/Mac OS X Specific part: + $ ln -sf /usr/lib/libstdc++.6.dylib `pwd`/../install/lib $ ln -sf /usr/lib/libstdc++.6.dylib `pwd`/../install/lib/libstdc++.dylib That last step, "ln -sf ..." is required so that the linker (collect2) can find libstdc++ ('-lstdc++') and subsequently link C++ executables correctly. +//===----------------------- + Note that if you prefer to bootstrap llvm-gcc (so that the final llvm-gcc executables have been compiled with llvm-gcc itself), replace "make" with "make bootstrap". 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=55961&r1=55960&r2=55961&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Sep 8 16:16:42 2008 @@ -5273,9 +5273,10 @@ int cfa_offset = ARG_POINTER_CFA_OFFSET(exp); + // FIXME: is i32 always enough here? Result = Builder.CreateCall(Intrinsic::getDeclaration(TheModule, - Intrinsic::eh_dwarf_cfa), - ConstantInt::get(Type::Int32Ty, cfa_offset)); + Intrinsic::eh_dwarf_cfa), + ConstantInt::get(Type::Int32Ty, cfa_offset)); return true; } @@ -5324,17 +5325,21 @@ if (!validate_arglist(arglist, INTEGER_TYPE, POINTER_TYPE, VOID_TYPE)) return false; + const Type *IntPtr = TD.getIntPtrType(); Value *Offset = Emit(TREE_VALUE(arglist), 0); Value *Handler = Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0); - Offset = Builder.CreateIntCast(Offset, Type::Int32Ty, true); + + Intrinsic::ID IID = (IntPtr == Type::Int32Ty ? + Intrinsic::eh_return_i32 : Intrinsic::eh_return_i64); + + Offset = Builder.CreateIntCast(Offset, IntPtr, true); Handler = BitCastToType(Handler, PointerType::getUnqual(Type::Int8Ty)); SmallVector Args; Args.push_back(Offset); Args.push_back(Handler); - Builder.CreateCall(Intrinsic::getDeclaration(TheModule, - Intrinsic::eh_return), - Args.begin(), Args.end()); + Builder.CreateCall(Intrinsic::getDeclaration(TheModule, IID), + Args.begin(), Args.end()); Result = Builder.CreateUnreachable(); EmitBlock(BasicBlock::Create("")); From dalej at apple.com Mon Sep 8 16:21:49 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 08 Sep 2008 21:21:49 -0000 Subject: [llvm-commits] [llvm] r55962 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Message-ID: <200809082121.m88LLnGf022080@zion.cs.uiuc.edu> Author: johannes Date: Mon Sep 8 16:21:49 2008 New Revision: 55962 URL: http://llvm.org/viewvc/llvm-project?rev=55962&view=rev Log: Don't suppress no-dead-strip for used static functions. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=55962&r1=55961&r2=55962&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Sep 8 16:21:49 2008 @@ -462,7 +462,7 @@ for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) { const GlobalValue *GV = findGlobalValue(InitList->getOperand(i)); - if (GV && !GV->hasInternalLinkage()) { + if (GV && (!GV->hasInternalLinkage() || isa(GV))) { O << Directive; EmitConstantValueOnly(InitList->getOperand(i)); O << '\n'; From dalej at apple.com Mon Sep 8 16:41:03 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 08 Sep 2008 21:41:03 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55964 - /llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c Message-ID: <200809082141.m88Lf3j0022729@zion.cs.uiuc.edu> Author: johannes Date: Mon Sep 8 16:41:02 2008 New Revision: 55964 URL: http://llvm.org/viewvc/llvm-project?rev=55964&view=rev Log: Add a space to allow for differing llvm output. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c?rev=55964&r1=55963&r2=55964&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c Mon Sep 8 16:41:02 2008 @@ -1,6 +1,6 @@ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-options "-O" } */ -/* { dg-final { scan-assembler "li r3,12345\n\t(bl|jbsr) " } } */ +/* { dg-final { scan-assembler "li r3,( )?12345\n\t(bl|jbsr) " } } */ /* Check that zero-size structures don't affect parameter passing. */ From anton at korobeynikov.info Mon Sep 8 16:58:09 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Tue, 9 Sep 2008 01:58:09 +0400 Subject: [llvm-commits] [llvm] r55962 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp In-Reply-To: <200809082121.m88LLnGf022080@zion.cs.uiuc.edu> References: <200809082121.m88LLnGf022080@zion.cs.uiuc.edu> Message-ID: Hi Dale, > Don't suppress no-dead-strip for used static functions. This contradicts with the comment of function. Please update it. Also, it seems, that gcc (at least, apple gcc 4.0.1) does not look to linkage in this such situation at all: void bar(); static int __attribute__((used)) a; static void __attribute__((used)) foo() { bar(); } compiles into: .text .align 4,0x90 .no_dead_strip _foo _foo: pushl %ebp movl %esp, %ebp leave jmp L_bar$stub .no_dead_strip _a .lcomm _a,4,2 Note, that both foo and a are 'used' here -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From dalej at apple.com Mon Sep 8 17:06:25 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 8 Sep 2008 15:06:25 -0700 Subject: [llvm-commits] [llvm] r55962 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp In-Reply-To: References: <200809082121.m88LLnGf022080@zion.cs.uiuc.edu> Message-ID: <497B43B7-A0DE-4EB3-8D52-11ABCC63BF61@apple.com> On Sep 8, 2008, at 2:58 PMPDT, Anton Korobeynikov wrote: > Hi Dale, > >> Don't suppress no-dead-strip for used static functions. > This contradicts with the comment of function. Please update it. Also, > it seems, that gcc (at least, apple gcc 4.0.1) does not look to > linkage in this such situation at all: > > void bar(); > > static int __attribute__((used)) a; Thanks, you are right. gcc does suppress the directive in some cases involving ObjC metadata, which is what I was trying to fix originally (the used attribute is created internally). Evidently linkage is not the right thing to look at. I'll fix it. > static void __attribute__((used)) foo() { > bar(); > } > > compiles into: > > .text > .align 4,0x90 > .no_dead_strip _foo > _foo: > pushl %ebp > movl %esp, %ebp > leave > jmp L_bar$stub > .no_dead_strip _a > .lcomm _a,4,2 > > Note, that both foo and a are 'used' here > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State > University > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Mon Sep 8 17:14:18 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 08 Sep 2008 22:14:18 -0000 Subject: [llvm-commits] [llvm] r55965 - /llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp Message-ID: <200809082214.m88MEI25023850@zion.cs.uiuc.edu> Author: dpatel Date: Mon Sep 8 17:14:17 2008 New Revision: 55965 URL: http://llvm.org/viewvc/llvm-project?rev=55965&view=rev Log: s/RemoveUnreachableBlocks/RemoveUnreachableBlocksFromFn/g Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp?rev=55965&r1=55964&r2=55965&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SimplifyCFGPass.cpp Mon Sep 8 17:14:17 2008 @@ -148,9 +148,10 @@ return Changed; } -/// RemoveUnreachableBlocks - Remove blocks that are not reachable, even if they -/// are in a dead cycle. Return true if a change was made, false otherwise. -static bool RemoveUnreachableBlocks(Function &F) { +/// RemoveUnreachableBlocksFromFn - Remove blocks that are not reachable, even +/// if they are in a dead cycle. Return true if a change was made, false +/// otherwise. +static bool RemoveUnreachableBlocksFromFn(Function &F) { SmallPtrSet Reachable; bool Changed = MarkAliveBlocks(F.begin(), Reachable); @@ -208,23 +209,23 @@ // simplify the CFG. // bool CFGSimplifyPass::runOnFunction(Function &F) { - bool EverChanged = RemoveUnreachableBlocks(F); + bool EverChanged = RemoveUnreachableBlocksFromFn(F); EverChanged |= IterativeSimplifyCFG(F); // If neither pass changed anything, we're done. if (!EverChanged) return false; // IterativeSimplifyCFG can (rarely) make some loops dead. If this happens, - // RemoveUnreachableBlocks is needed to nuke them, which means we should + // RemoveUnreachableBlocksFromFn is needed to nuke them, which means we should // iterate between the two optimizations. We structure the code like this to // avoid reruning IterativeSimplifyCFG if the second pass of - // RemoveUnreachableBlocks doesn't do anything. - if (!RemoveUnreachableBlocks(F)) + // RemoveUnreachableBlocksFromFn doesn't do anything. + if (!RemoveUnreachableBlocksFromFn(F)) return true; do { EverChanged = IterativeSimplifyCFG(F); - EverChanged |= RemoveUnreachableBlocks(F); + EverChanged |= RemoveUnreachableBlocksFromFn(F); } while (EverChanged); return true; From isanbard at gmail.com Mon Sep 8 18:42:14 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 8 Sep 2008 16:42:14 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r55964 - /llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c In-Reply-To: <200809082141.m88Lf3j0022729@zion.cs.uiuc.edu> References: <200809082141.m88Lf3j0022729@zion.cs.uiuc.edu> Message-ID: <16e5fdf90809081642g3e543cr4154441e43848bd7@mail.gmail.com> LLVM local tags? :-) -bw On Mon, Sep 8, 2008 at 2:41 PM, Dale Johannesen wrote: > Author: johannes > Date: Mon Sep 8 16:41:02 2008 > New Revision: 55964 > > URL: http://llvm.org/viewvc/llvm-project?rev=55964&view=rev > Log: > Add a space to allow for differing llvm output. > > > Modified: > llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c > > Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c > URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c?rev=55964&r1=55963&r2=55964&view=diff > > ============================================================================== > --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c (original) > +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c Mon Sep 8 16:41:02 2008 > @@ -1,6 +1,6 @@ > /* { dg-do compile { target powerpc*-*-darwin* } } */ > /* { dg-options "-O" } */ > -/* { dg-final { scan-assembler "li r3,12345\n\t(bl|jbsr) " } } */ > +/* { dg-final { scan-assembler "li r3,( )?12345\n\t(bl|jbsr) " } } */ > > /* Check that zero-size structures don't affect parameter passing. */ > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From isanbard at gmail.com Mon Sep 8 19:28:24 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 09 Sep 2008 00:28:24 -0000 Subject: [llvm-commits] [llvm] r55968 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200809090028.m890SO7g008287@zion.cs.uiuc.edu> Author: void Date: Mon Sep 8 19:28:24 2008 New Revision: 55968 URL: http://llvm.org/viewvc/llvm-project?rev=55968&view=rev Log: Add support for floating-point calculations of log2 with limited precisions of 6 and 18. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=55968&r1=55967&r2=55968&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Sep 8 19:28:24 2008 @@ -2755,7 +2755,6 @@ /// visitExp - lower an exp intrinsic. Handles the special sequences /// for limited-precision mode. - void SelectionDAGLowering::visitExp(CallInst &I) { SDValue result; @@ -2768,7 +2767,6 @@ /// visitLog - lower a log intrinsic. Handles the special sequences /// for limited-precision mode. - void SelectionDAGLowering::visitLog(CallInst &I) { SDValue result; @@ -2779,108 +2777,225 @@ setValue(&I, result); } -/// visitLog2 - lower a log2 intrinsic. Handles the special sequences -/// for limited-precision mode. - +/// visitLog2 - Lower a log2 intrinsic. Handles the special sequences for +/// limited-precision mode. void SelectionDAGLowering::visitLog2(CallInst &I) { SDValue result; + if (getValue(I.getOperand(1)).getValueType() == MVT::f32 && - LimitFloatPrecision>0 && LimitFloatPrecision<=12) { - SDValue operand = getValue(I.getOperand(1)); - SDValue operand1 = DAG.getNode(ISD::BIT_CONVERT, MVT::i32, operand); - SDValue t0 = DAG.getNode(ISD::SRL, MVT::i32, operand1, - DAG.getConstant(23, MVT::i32)); - SDValue t1 = DAG.getNode(ISD::AND, MVT::i32, t0, - DAG.getConstant(255, MVT::i32)); + LimitFloatPrecision > 0 && LimitFloatPrecision <= 18) { + SDValue Op = getValue(I.getOperand(1)); + SDValue Op1 = DAG.getNode(ISD::BIT_CONVERT, MVT::i32, Op); + + // Get the exponent, which is most of log and scale by log(2): + // + // LogOfExponent = (float) (((Op1 & 0x7f800000) >> 23) - 127); + // + // where Op1 is the hexidecimal representation of floating point value. + SDValue t0 = DAG.getNode(ISD::AND, MVT::i32, Op1, + DAG.getConstant(0x7f800000, MVT::i32)); + SDValue t1 = DAG.getNode(ISD::SRL, MVT::i32, t0, + DAG.getConstant(23, MVT::i32)); SDValue t2 = DAG.getNode(ISD::SUB, MVT::i32, t1, - DAG.getConstant(127, MVT::i32)); - SDValue t3 = DAG.getNode(ISD::UINT_TO_FP, MVT::f32, t2); - SDValue t4 = DAG.getNode(ISD::OR, MVT::i32, operand1, - DAG.getConstant(1065353216, MVT::i32)); - SDValue t5 = DAG.getNode(ISD::AND, MVT::i32, t4, - DAG.getConstant(1073741823, MVT::i32)); - SDValue t6 = DAG.getNode(ISD::BIT_CONVERT, MVT::f32, t5); - SDValue t7 = DAG.getNode(ISD::FMUL, MVT::f32, t6, - DAG.getConstantFP(APFloat( - APInt(32, 0xbda7262e)), MVT::f32)); - SDValue t8 = DAG.getNode(ISD::FADD, MVT::f32, t7, - DAG.getConstantFP(APFloat( - APInt(32, 0x3f25280b)), MVT::f32)); - SDValue t9 = DAG.getNode(ISD::FMUL, MVT::f32, t8, t6); - SDValue t10 = DAG.getNode(ISD::FSUB, MVT::f32, t9, - DAG.getConstantFP(APFloat( - APInt(32, 0x4007b923)), MVT::f32)); - SDValue t11 = DAG.getNode(ISD::FMUL, MVT::f32, t10, t6); - SDValue t12 = DAG.getNode(ISD::FADD, MVT::f32, t11, - DAG.getConstantFP(APFloat( - APInt(32, 0x40823e2f)), MVT::f32)); - SDValue t13 = DAG.getNode(ISD::FMUL, MVT::f32, t12, t6); - SDValue t14 = DAG.getNode(ISD::FSUB, MVT::f32, t13, - DAG.getConstantFP(APFloat( - APInt(32, 0x4020d29c)), MVT::f32)); - result = DAG.getNode(ISD::FADD, MVT::f32, t3, t14); + DAG.getConstant(127, MVT::i32)); + SDValue LogOfExponent = DAG.getNode(ISD::UINT_TO_FP, MVT::f32, t2); + + // Get the significand and build it into a floating-point number with + // exponent of 1: + // + // Op1 = (Op1 & 0x007fffff) | 0x3f800000; + // + // where Op1 is the hexidecimal representation of floating point value. + SDValue t4 = DAG.getNode(ISD::AND, MVT::i32, Op1, + DAG.getConstant(0x007fffff, MVT::i32)); + SDValue t5 = DAG.getNode(ISD::OR, MVT::i32, t4, + DAG.getConstant(0x3f800000, MVT::i32)); + SDValue X = DAG.getNode(ISD::BIT_CONVERT, MVT::f32, t5); + + // Different possible minimax approximations of significand in + // floating-point for various degrees of accuracy over [1,2]. + if (LimitFloatPrecision <= 6) { + // For floating-point precision of 6: + // + // Log2ofMantissa = -1.6749035f + (2.0246817f - .34484768f * x) * x; + // + // error 0.0049451742, which is more than 7 bits + SDValue t8 = DAG.getNode(ISD::FMUL, MVT::f32, X, + DAG.getConstantFP(APFloat( + APInt(32, 0xbeb08fe0)), MVT::f32)); + SDValue t9 = DAG.getNode(ISD::FADD, MVT::f32, t8, + DAG.getConstantFP(APFloat( + APInt(32, 0x40019463)), MVT::f32)); + SDValue t10 = DAG.getNode(ISD::FMUL, MVT::f32, t9, X); + SDValue Log2ofMantissa = DAG.getNode(ISD::FSUB, MVT::f32, t10, + DAG.getConstantFP(APFloat( + APInt(32, 0x3fd6633d)), MVT::f32)); + + result = DAG.getNode(ISD::FADD, MVT::f32, LogOfExponent, Log2ofMantissa); + } else if (LimitFloatPrecision > 6 && LimitFloatPrecision <= 12) { + // For floating-point precision of 12: + // + // Log2ofMantissa = + // -2.51285454f + + // (4.07009056f + + // (-2.12067489f + + // (.645142248f - 0.816157886e-1f * x) * x) * x) * x; + // + // error 0.0000876136000, which is better than 13 bits + SDValue t8 = DAG.getNode(ISD::FMUL, MVT::f32, X, + DAG.getConstantFP(APFloat( + APInt(32, 0xbda7262e)), MVT::f32)); + SDValue t9 = DAG.getNode(ISD::FADD, MVT::f32, t8, + DAG.getConstantFP(APFloat( + APInt(32, 0x3f25280b)), MVT::f32)); + SDValue t10 = DAG.getNode(ISD::FMUL, MVT::f32, t9, X); + SDValue t11 = DAG.getNode(ISD::FSUB, MVT::f32, t10, + DAG.getConstantFP(APFloat( + APInt(32, 0x4007b923)), MVT::f32)); + SDValue t12 = DAG.getNode(ISD::FMUL, MVT::f32, t11, X); + SDValue t13 = DAG.getNode(ISD::FADD, MVT::f32, t12, + DAG.getConstantFP(APFloat( + APInt(32, 0x40823e2f)), MVT::f32)); + SDValue t14 = DAG.getNode(ISD::FMUL, MVT::f32, t13, X); + SDValue Log2ofMantissa = DAG.getNode(ISD::FSUB, MVT::f32, t14, + DAG.getConstantFP(APFloat( + APInt(32, 0x4020d29c)), MVT::f32)); + + result = DAG.getNode(ISD::FADD, MVT::f32, LogOfExponent, Log2ofMantissa); + } else { // LimitFloatPrecision > 12 && LimitFloatPrecision <= 18 + // For floating-point precision of 18: + // + // Log2ofMantissa = + // -3.0400495f + + // (6.1129976f + + // (-5.3420409f + + // (3.2865683f + + // (-1.2669343f + + // (0.27515199f - + // 0.25691327e-1f * x) * x) * x) * x) * x) * x; + // + // error 0.0000018516, which is better than 18 bits + SDValue t8 = DAG.getNode(ISD::FMUL, MVT::f32, X, + DAG.getConstantFP(APFloat( + APInt(32, 0xbcd2769e)), MVT::f32)); + SDValue t9 = DAG.getNode(ISD::FADD, MVT::f32, t8, + DAG.getConstantFP(APFloat( + APInt(32, 0x3e8ce0b9)), MVT::f32)); + SDValue t10 = DAG.getNode(ISD::FMUL, MVT::f32, t9, X); + SDValue t11 = DAG.getNode(ISD::FSUB, MVT::f32, t10, + DAG.getConstantFP(APFloat( + APInt(32, 0x3fa22ae7)), MVT::f32)); + SDValue t12 = DAG.getNode(ISD::FMUL, MVT::f32, t11, X); + SDValue t13 = DAG.getNode(ISD::FADD, MVT::f32, t12, + DAG.getConstantFP(APFloat( + APInt(32, 0x40525723)), MVT::f32)); + SDValue t14 = DAG.getNode(ISD::FMUL, MVT::f32, t13, X); + SDValue t15 = DAG.getNode(ISD::FSUB, MVT::f32, t14, + DAG.getConstantFP(APFloat( + APInt(32, 0x40aaf200)), MVT::f32)); + SDValue t16 = DAG.getNode(ISD::FMUL, MVT::f32, t15, X); + SDValue t17 = DAG.getNode(ISD::FADD, MVT::f32, t16, + DAG.getConstantFP(APFloat( + APInt(32, 0x40c39dad)), MVT::f32)); + SDValue t18 = DAG.getNode(ISD::FMUL, MVT::f32, t17, X); + SDValue Log2ofMantissa = DAG.getNode(ISD::FSUB, MVT::f32, t18, + DAG.getConstantFP(APFloat( + APInt(32, 0x4042902c)), MVT::f32)); + + result = DAG.getNode(ISD::FADD, MVT::f32, LogOfExponent, Log2ofMantissa); + } } else { - // No special expansion. + // No special expansion. result = DAG.getNode(ISD::FLOG2, getValue(I.getOperand(1)).getValueType(), getValue(I.getOperand(1))); } + setValue(&I, result); } -/// visitLog10 - lower a log10 intrinsic. Handles the special sequences -/// for limited-precision mode. - +/// visitLog10 - Lower a log10 intrinsic. Handles the special sequences for +/// limited-precision mode. void SelectionDAGLowering::visitLog10(CallInst &I) { SDValue result; if (getValue(I.getOperand(1)).getValueType() == MVT::f32 && - LimitFloatPrecision>0 && LimitFloatPrecision<=12) { - SDValue operand = getValue(I.getOperand(1)); - SDValue operand1 = DAG.getNode(ISD::BIT_CONVERT, MVT::i32, operand); - SDValue t0 = DAG.getNode(ISD::SRL, MVT::i32, operand1, - DAG.getConstant(23, MVT::i32)); - SDValue t1 = DAG.getNode(ISD::AND, MVT::i32, t0, - DAG.getConstant(255, MVT::i32)); + LimitFloatPrecision > 0 && LimitFloatPrecision <= 18) { + SDValue Op = getValue(I.getOperand(1)); + SDValue Op1 = DAG.getNode(ISD::BIT_CONVERT, MVT::i32, Op); + + // Get the exponent, which is most of log10 and scale by log10(2). + // + // #define LOG10OF2 0.30102999f + // Log10ofExponent = (float)(((Op1 & 0x7f800000) >> 23) - 127) * LOG10OF2; + // + // where Op1 is the hexidecimal value of the floating-point number. + SDValue t0 = DAG.getNode(ISD::AND, MVT::i32, Op1, + DAG.getConstant(0x7f800000, MVT::i32)); + SDValue t1 = DAG.getNode(ISD::SRL, MVT::i32, t0, + DAG.getConstant(23, MVT::i32)); SDValue t2 = DAG.getNode(ISD::SUB, MVT::i32, t1, - DAG.getConstant(127, MVT::i32)); + DAG.getConstant(127, MVT::i32)); SDValue t3 = DAG.getNode(ISD::UINT_TO_FP, MVT::f32, t2); - SDValue t4 = DAG.getNode(ISD::FMUL, MVT::f32, t3, - DAG.getConstantFP(APFloat( - APInt(32, 0x3e9a209a)), MVT::f32)); - SDValue t5 = DAG.getNode(ISD::OR, MVT::i32, operand1, - DAG.getConstant(1065353216, MVT::i32)); - SDValue t6 = DAG.getNode(ISD::AND, MVT::i32, t5, - DAG.getConstant(1073741823, MVT::i32)); - SDValue t7 = DAG.getNode(ISD::BIT_CONVERT, MVT::f32, t6); - SDValue t8 = DAG.getNode(ISD::FMUL, MVT::f32, t7, - DAG.getConstantFP(APFloat( - APInt(32, 0x3d431f31)), MVT::f32)); - SDValue t9 = DAG.getNode(ISD::FSUB, MVT::f32, t8, - DAG.getConstantFP(APFloat( - APInt(32, 0x3ea21fb2)), MVT::f32)); - SDValue t10 = DAG.getNode(ISD::FMUL, MVT::f32, t9, t7); - SDValue t11 = DAG.getNode(ISD::FADD, MVT::f32, t10, - DAG.getConstantFP(APFloat( - APInt(32, 0x3f6ae232)), MVT::f32)); - SDValue t12 = DAG.getNode(ISD::FMUL, MVT::f32, t11, t7); - SDValue t13 = DAG.getNode(ISD::FSUB, MVT::f32, t12, - DAG.getConstantFP(APFloat( - APInt(32, 0x3f25f7c3)), MVT::f32)); - result = DAG.getNode(ISD::FADD, MVT::f32, t4, t13); + SDValue LogOfExponent = DAG.getNode(ISD::FMUL, MVT::f32, t3, + DAG.getConstantFP(APFloat( + APInt(32, 0x3e9a209a)), MVT::f32)); + + // Get the significand and build it into a floating-point number with + // exponent of 1: + // + // Op1 = (Op1 & 0x007fffff) | 0x3f800000; + // + // where Op1 is the hexidecimal representation of floating point value. + SDValue t4 = DAG.getNode(ISD::AND, MVT::i32, Op1, + DAG.getConstant(0x007fffff, MVT::i32)); + SDValue t5 = DAG.getNode(ISD::OR, MVT::i32, t4, + DAG.getConstant(0x3f800000, MVT::i32)); + SDValue X = DAG.getNode(ISD::BIT_CONVERT, MVT::f32, t5); + + if (LimitFloatPrecision <= 6) { + } else if (LimitFloatPrecision > 6 && LimitFloatPrecision <= 12) { + // For floating-point precision of 12: + // + // Log10ofMantissa = + // -0.64831180f + + // (0.91751397f + + // (-0.31664806f + 0.47637168e-1f * x) * x) * x; + // + // error 0.00019228036, which is better than 12 bits + SDValue t6 = DAG.getNode(ISD::FMUL, MVT::f32, X, + DAG.getConstantFP(APFloat( + APInt(32, 0x3d431f31)), MVT::f32)); + SDValue t7 = DAG.getNode(ISD::FSUB, MVT::f32, t6, + DAG.getConstantFP(APFloat( + APInt(32, 0x3ea21fb2)), MVT::f32)); + SDValue t8 = DAG.getNode(ISD::FMUL, MVT::f32, t7, X); + SDValue t9 = DAG.getNode(ISD::FADD, MVT::f32, t8, + DAG.getConstantFP(APFloat( + APInt(32, 0x3f6ae232)), MVT::f32)); + SDValue t10 = DAG.getNode(ISD::FMUL, MVT::f32, t9, X); + SDValue t11 = DAG.getNode(ISD::FSUB, MVT::f32, t10, + DAG.getConstantFP(APFloat( + APInt(32, 0x3f25f7c3)), MVT::f32)); + SDValue Log10ofMantissa = DAG.getNode(ISD::FP_ROUND, MVT::f32, t11, + DAG.getConstant(0, MVT::i32)); + + result = DAG.getNode(ISD::FADD, MVT::f32, LogOfExponent, Log10ofMantissa); + } else { // LimitFloatPrecision > 12 && LimitFloatPrecision <= 18 + } } else { - // No special expansion. + // No special expansion. result = DAG.getNode(ISD::FLOG10, getValue(I.getOperand(1)).getValueType(), getValue(I.getOperand(1))); } + setValue(&I, result); } /// visitExp2 - lower an exp2 intrinsic. Handles the special sequences /// for limited-precision mode. - void SelectionDAGLowering::visitExp2(CallInst &I) { SDValue result; @@ -2910,7 +3025,7 @@ SDValue t11 = DAG.getNode(ISD::ADD, MVT::i32, t10, t3); result = DAG.getNode(ISD::BIT_CONVERT, MVT::f32, t11); } else { - // No special expansion. + // No special expansion. result = DAG.getNode(ISD::FEXP2, getValue(I.getOperand(1)).getValueType(), getValue(I.getOperand(1))); From gohman at apple.com Mon Sep 8 20:02:47 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 09 Sep 2008 01:02:47 -0000 Subject: [llvm-commits] [llvm] r55969 - in /llvm/trunk: docs/LangRef.html include/llvm/Bitcode/LLVMBitCodes.h include/llvm/InstrTypes.h include/llvm/Instructions.h lib/AsmParser/llvmAsmParser.y lib/Bitcode/Reader/BitcodeReader.cpp lib/Bitcode/Writer/BitcodeWriter.cpp lib/VMCore/Verifier.cpp test/Assembler/vbool-cmp.ll test/Assembler/vector-select.ll Message-ID: <200809090102.m8912lLd009502@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 20:02:47 2008 New Revision: 55969 URL: http://llvm.org/viewvc/llvm-project?rev=55969&view=rev Log: Extend the vcmp/fcmp LLVM IR instructions to take vectors as arguments and, if so, to return a vector of boolean as a result; Extend the select LLVM IR instruction to allow you to specify a result type which is a vector of boolean, in which case the result will be an element-wise selection instead of choosing one vector or the other; and Update LangRef.html to describe these changes. This patch was contributed by Preston Gurd! Added: llvm/trunk/test/Assembler/vbool-cmp.ll llvm/trunk/test/Assembler/vector-select.ll Modified: llvm/trunk/docs/LangRef.html llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h llvm/trunk/include/llvm/InstrTypes.h llvm/trunk/include/llvm/Instructions.h llvm/trunk/lib/AsmParser/llvmAsmParser.y llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=55969&r1=55968&r2=55969&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Mon Sep 8 20:02:47 2008 @@ -3846,11 +3846,12 @@

Syntax:
-
  <result> = icmp <cond> <ty> <op1>, <op2>   ; yields {i1}:result
+
  <result> = icmp <cond> <ty> <op1>, <op2>   ; yields {i1} or {<N x i1>}:result
 
Overview:
-

The 'icmp' instruction returns a boolean value based on comparison -of its two integer or pointer operands.

+

The 'icmp' instruction returns a boolean value or +a vector of boolean values based on comparison +of its two integer, integer vector, or pointer operands.

Arguments:

The 'icmp' instruction takes three operands. The first operand is the condition code indicating the kind of comparison to perform. It is not @@ -3868,11 +3869,13 @@

  • sle: signed less or equal
  • The remaining two arguments must be integer or -pointer typed. They must also be identical types.

    +pointer +or integer vector typed. +They must also be identical types.

    Semantics:

    The 'icmp' compares op1 and op2 according to the condition code given as cond. The comparison performed always -yields a i1 result, as follows: +yields either an i1 or vector of i1 result, as follows:

    1. eq: yields true if the operands are equal, false otherwise. No sign interpretation is necessary or performed. @@ -3898,6 +3901,11 @@

    If the operands are pointer typed, the pointer values are compared as if they were integers.

    +

    If the operands are integer vectors, then they are compared +element by element. The result is an i1 vector with +the same number of elements as the values being compared. +Otherwise, the result is an i1. +

    Example:
      <result> = icmp eq i32 4, 5          ; yields: result=false
    @@ -3914,11 +3922,19 @@
     
    Syntax:
    -
      <result> = fcmp <cond> <ty> <op1>, <op2>     ; yields {i1}:result
    +
      <result> = fcmp <cond> <ty> <op1>, <op2>     ; yields {i1} or {<N x i1>}:result
     
    Overview:
    -

    The 'fcmp' instruction returns a boolean value based on comparison -of its floating point operands.

    +

    The 'fcmp' instruction returns a boolean value +or vector of boolean values based on comparison +of its operands. +

    +If the operands are floating point scalars, then the result +type is a boolean (i1). +

    +

    If the operands are floating point vectors, then the result type +is a vector of boolean with the same number of elements as the +operands being compared.

    Arguments:

    The 'fcmp' instruction takes three operands. The first operand is the condition code indicating the kind of comparison to perform. It is not @@ -3943,13 +3959,17 @@

    Ordered means that neither operand is a QNAN while unordered means that either operand may be a QNAN.

    -

    The val1 and val2 arguments must be -floating point typed. They must have identical -types.

    +

    Each of val1 and val2 arguments must be +either a floating point type +or a vector of floating point type. +They must have identical types.

    Semantics:

    The 'fcmp' instruction compares op1 and op2 -according to the condition code given as cond. The comparison performed -always yields a i1 result, as follows: +according to the condition code given as cond. +If the operands are vectors, then the vectors are compared +element by element. +Each comparison performed +always yields an i1 result, as follows:

    1. false: always yields false, regardless of operands.
    2. oeq: yields true if both operands are not a QNAN and @@ -3983,9 +4003,9 @@
      Example:
        <result> = fcmp oeq float 4.0, 5.0    ; yields: result=false
      -  <result> = icmp one float 4.0, 5.0    ; yields: result=true
      -  <result> = icmp olt float 4.0, 5.0    ; yields: result=true
      -  <result> = icmp ueq double 1.0, 2.0   ; yields: result=false
      +  <result> = fcmp one float 4.0, 5.0    ; yields: result=true
      +  <result> = fcmp olt float 4.0, 5.0    ; yields: result=true
      +  <result> = fcmp ueq double 1.0, 2.0   ; yields: result=false
       
    @@ -4016,7 +4036,7 @@
  • slt: signed less than
  • sle: signed less or equal
  • -

    The remaining two arguments must be vector of +

    The remaining two arguments must be vector or integer typed. They must also be identical types.

    Semantics:

    The 'vicmp' instruction compares op1 and op2 @@ -4140,7 +4160,9 @@

    Syntax:
    -  <result> = select i1 <cond>, <ty> <val1>, <ty> <val2>             ; yields ty
    +  <result> = select selty <cond>, <ty> <val1>, <ty> <val2>             ; yields ty
    +
    +  selty is either i1 or {<N x i1>}
     
    Overview:
    @@ -4154,18 +4176,25 @@
    Arguments:

    -The 'select' instruction requires an 'i1' value indicating the +The 'select' instruction requires an 'i1' value or +a vector of 'i1' values indicating the condition, and two values of the same first class -type. If the val1/val2 are vectors, the entire vectors are selected, not +type. If the val1/val2 are vectors and +the condition is a scalar, then entire vectors are selected, not individual elements.

    Semantics:

    -If the i1 condition evaluates is 1, the instruction returns the first +If the condition is an i1 and it evaluates to 1, the instruction returns the first value argument; otherwise, it returns the second value argument.

    +

    +If the condition is a vector of i1, then the value arguments must +be vectors of the same size, and the selection is done element +by element. +

    Example:
    Modified: llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h?rev=55969&r1=55968&r2=55969&view=diff ============================================================================== --- llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h (original) +++ llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h Mon Sep 8 20:02:47 2008 @@ -205,7 +205,9 @@ // FIXME: Remove GETRESULT in favor of EXTRACTVAL in LLVM 3.0 FUNC_CODE_INST_GETRESULT = 25, // GETRESULT: [ty, opval, n] FUNC_CODE_INST_EXTRACTVAL = 26, // EXTRACTVAL: [n x operands] - FUNC_CODE_INST_INSERTVAL = 27 // INSERTVAL: [n x operands] + FUNC_CODE_INST_INSERTVAL = 27, // INSERTVAL: [n x operands] + // fcmp/icmp returning vector of Int1Ty, NOT for vicmp/vfcmp + FUNC_CODE_INST_VCMP = 28 // VCMP: [opty, opval, opval, pred] }; } // End bitc namespace } // End llvm namespace Modified: llvm/trunk/include/llvm/InstrTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InstrTypes.h?rev=55969&r1=55968&r2=55969&view=diff ============================================================================== --- llvm/trunk/include/llvm/InstrTypes.h (original) +++ llvm/trunk/include/llvm/InstrTypes.h Mon Sep 8 20:02:47 2008 @@ -18,6 +18,7 @@ #include "llvm/Instruction.h" #include "llvm/OperandTraits.h" +#include "llvm/DerivedTypes.h" namespace llvm { @@ -732,6 +733,13 @@ static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); } + /// @brief Create a result type for fcmp/icmp (but not vicmp/vfcmp) + static const Type* makeCmpResultType(const Type* opnd_type) { + if (const VectorType* vt = dyn_cast(opnd_type)) { + return VectorType::get(Type::Int1Ty, vt->getNumElements()); + } + return Type::Int1Ty; + } /// Backward-compatible interfaces /// @deprecated in 2.4, do not use, will disappear soon static CmpInst *create(OtherOps Op, unsigned short predicate, Value *S1, Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=55969&r1=55968&r2=55969&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Mon Sep 8 20:02:47 2008 @@ -621,7 +621,8 @@ Value *RHS, ///< The right-hand-side of the expression const std::string &NameStr = "", ///< Name of the instruction Instruction *InsertBefore = 0 ///< Where to insert - ) : CmpInst(Type::Int1Ty, Instruction::ICmp, pred, LHS, RHS, NameStr, + ) : CmpInst(makeCmpResultType(LHS->getType()), + Instruction::ICmp, pred, LHS, RHS, NameStr, InsertBefore) { assert(pred >= CmpInst::FIRST_ICMP_PREDICATE && pred <= CmpInst::LAST_ICMP_PREDICATE && @@ -629,7 +630,7 @@ assert(getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"); // Check that the operands are the right type - assert((getOperand(0)->getType()->isInteger() || + assert((getOperand(0)->getType()->isIntOrIntVector() || isa(getOperand(0)->getType())) && "Invalid operand types for ICmp instruction"); } @@ -641,7 +642,8 @@ Value *RHS, ///< The right-hand-side of the expression const std::string &NameStr, ///< Name of the instruction BasicBlock *InsertAtEnd ///< Block to insert into. - ) : CmpInst(Type::Int1Ty, Instruction::ICmp, pred, LHS, RHS, NameStr, + ) : CmpInst(makeCmpResultType(LHS->getType()), + Instruction::ICmp, pred, LHS, RHS, NameStr, InsertAtEnd) { assert(pred >= CmpInst::FIRST_ICMP_PREDICATE && pred <= CmpInst::LAST_ICMP_PREDICATE && @@ -649,7 +651,7 @@ assert(getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"); // Check that the operands are the right type - assert((getOperand(0)->getType()->isInteger() || + assert((getOperand(0)->getType()->isIntOrIntVector() || isa(getOperand(0)->getType())) && "Invalid operand types for ICmp instruction"); } @@ -754,6 +756,7 @@ static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); } + }; //===----------------------------------------------------------------------===// @@ -773,14 +776,15 @@ Value *RHS, ///< The right-hand-side of the expression const std::string &NameStr = "", ///< Name of the instruction Instruction *InsertBefore = 0 ///< Where to insert - ) : CmpInst(Type::Int1Ty, Instruction::FCmp, pred, LHS, RHS, NameStr, + ) : CmpInst(makeCmpResultType(LHS->getType()), + Instruction::FCmp, pred, LHS, RHS, NameStr, InsertBefore) { assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && "Invalid FCmp predicate value"); assert(getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to FCmp instruction are not of the same type!"); // Check that the operands are the right type - assert(getOperand(0)->getType()->isFloatingPoint() && + assert(getOperand(0)->getType()->isFPOrFPVector() && "Invalid operand types for FCmp instruction"); } @@ -791,14 +795,15 @@ Value *RHS, ///< The right-hand-side of the expression const std::string &NameStr, ///< Name of the instruction BasicBlock *InsertAtEnd ///< Block to insert into. - ) : CmpInst(Type::Int1Ty, Instruction::FCmp, pred, LHS, RHS, NameStr, + ) : CmpInst(makeCmpResultType(LHS->getType()), + Instruction::FCmp, pred, LHS, RHS, NameStr, InsertAtEnd) { assert(pred <= FCmpInst::LAST_FCMP_PREDICATE && "Invalid FCmp predicate value"); assert(getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to FCmp instruction are not of the same type!"); // Check that the operands are the right type - assert(getOperand(0)->getType()->isFloatingPoint() && + assert(getOperand(0)->getType()->isFPOrFPVector() && "Invalid operand types for FCmp instruction"); } @@ -837,6 +842,7 @@ static inline bool classof(const Value *V) { return isa(V) && classof(cast(V)); } + }; //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=55969&r1=55968&r2=55969&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Mon Sep 8 20:02:47 2008 @@ -1102,7 +1102,7 @@ %token ADD SUB MUL UDIV SDIV FDIV UREM SREM FREM AND OR XOR %token SHL LSHR ASHR -%token ICMP FCMP VICMP VFCMP +%token ICMP FCMP VICMP VFCMP %type IPredicates %type FPredicates %token EQ NE SLT SGT SLE SGE ULT UGT ULE UGE @@ -3097,8 +3097,6 @@ | ICMP IPredicates Types ValueRef ',' ValueRef { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription()); - if (isa((*$3).get())) - GEN_ERROR("Vector types not supported by icmp instruction"); Value* tmpVal1 = getVal(*$3, $4); CHECK_FOR_ERROR Value* tmpVal2 = getVal(*$3, $6); @@ -3111,8 +3109,6 @@ | FCMP FPredicates Types ValueRef ',' ValueRef { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription()); - if (isa((*$3).get())) - GEN_ERROR("Vector types not supported by fcmp instruction"); Value* tmpVal1 = getVal(*$3, $4); CHECK_FOR_ERROR Value* tmpVal2 = getVal(*$3, $6); @@ -3133,7 +3129,7 @@ CHECK_FOR_ERROR $$ = CmpInst::Create($1, $2, tmpVal1, tmpVal2); if ($$ == 0) - GEN_ERROR("icmp operator returned null"); + GEN_ERROR("vicmp operator returned null"); delete $3; } | VFCMP FPredicates Types ValueRef ',' ValueRef { @@ -3147,7 +3143,7 @@ CHECK_FOR_ERROR $$ = CmpInst::Create($1, $2, tmpVal1, tmpVal2); if ($$ == 0) - GEN_ERROR("fcmp operator returned null"); + GEN_ERROR("vfcmp operator returned null"); delete $3; } | CastOps ResolvedVal TO Types { @@ -3163,10 +3159,23 @@ delete $4; } | SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal { - if ($2->getType() != Type::Int1Ty) - GEN_ERROR("select condition must be boolean"); + if (isa($2->getType())) { + // vector select + if (!isa($4->getType()) + || !isa($6->getType()) ) + GEN_ERROR("vector select value types must be vector types"); + const VectorType* cond_type = cast($2->getType()); + const VectorType* select_type = cast($4->getType()); + if (cond_type->getElementType() != Type::Int1Ty) + GEN_ERROR("vector select condition element type must be boolean"); + if (cond_type->getNumElements() != select_type->getNumElements()) + GEN_ERROR("vector select number of elements must be the same"); + } else { + if ($2->getType() != Type::Int1Ty) + GEN_ERROR("select condition must be boolean"); + } if ($4->getType() != $6->getType()) - GEN_ERROR("select value types should match"); + GEN_ERROR("select value types must match"); $$ = SelectInst::Create($2, $4, $6); CHECK_FOR_ERROR } Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=55969&r1=55968&r2=55969&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon Sep 8 20:02:47 2008 @@ -1499,8 +1499,19 @@ Value *TrueVal, *FalseVal, *Cond; if (getValueTypePair(Record, OpNum, NextValueNo, TrueVal) || getValue(Record, OpNum, TrueVal->getType(), FalseVal) || - getValue(Record, OpNum, Type::Int1Ty, Cond)) + getValue(Record, OpNum, 0 /*skip type check*/, Cond)) return Error("Invalid SELECT record"); + + // select condition can be either i1 or [N x i1] + if (const VectorType* vector_type = dyn_cast(Cond->getType())) { + // expect + if (vector_type->getElementType() != Type::Int1Ty) + return Error("Invalid SELECT condition type"); + } else { + // expect i1 + if (Cond->getType() != Type::Int1Ty) + return Error("Invalid SELECT condition type"); + } I = SelectInst::Create(Cond, TrueVal, FalseVal); break; @@ -1563,6 +1574,22 @@ I = new VICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS); break; } + case bitc::FUNC_CODE_INST_VCMP: { // VCMP: [opty, opval, opval, pred] + // Fcmp/ICmp returning vector of bool + unsigned OpNum = 0; + Value *LHS, *RHS; + if (getValueTypePair(Record, OpNum, NextValueNo, LHS) || + getValue(Record, OpNum, LHS->getType(), RHS) || + OpNum+1 != Record.size()) + return Error("Invalid VCMP record"); + + // will always be vector + if (LHS->getType()->isFPOrFPVector()) + I = new FCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, RHS); + else + I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS); + break; + } case bitc::FUNC_CODE_INST_GETRESULT: { // GETRESULT: [ty, val, n] if (Record.size() != 2) return Error("Invalid GETRESULT record"); Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=55969&r1=55968&r2=55969&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Mon Sep 8 20:02:47 2008 @@ -641,7 +641,14 @@ case Instruction::FCmp: case Instruction::VICmp: case Instruction::VFCmp: - Code = bitc::CST_CODE_CE_CMP; + if (isa(C->getOperand(0)->getType()) + && (CE->getOpcode() == Instruction::ICmp + || CE->getOpcode() == Instruction::FCmp)) { + // compare returning vector of Int1Ty + assert(0 && "Unsupported constant!"); + } else { + Code = bitc::CST_CODE_CE_CMP; + } Record.push_back(VE.getTypeID(C->getOperand(0)->getType())); Record.push_back(VE.getValueID(C->getOperand(0))); Record.push_back(VE.getValueID(C->getOperand(1))); @@ -765,7 +772,14 @@ case Instruction::FCmp: case Instruction::VICmp: case Instruction::VFCmp: - Code = bitc::FUNC_CODE_INST_CMP; + if (isa(I.getOperand(0)->getType()) + && (I.getOpcode() == Instruction::ICmp + || I.getOpcode() == Instruction::FCmp)) { + // compare returning vector of Int1Ty + Code = bitc::FUNC_CODE_INST_VCMP; + } else { + Code = bitc::FUNC_CODE_INST_CMP; + } PushValueAndType(I.getOperand(0), InstID, Vals, VE); Vals.push_back(VE.getValueID(I.getOperand(1))); Vals.push_back(cast(I).getPredicate()); Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=55969&r1=55968&r2=55969&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Mon Sep 8 20:02:47 2008 @@ -659,8 +659,21 @@ } void Verifier::visitSelectInst(SelectInst &SI) { - Assert1(SI.getCondition()->getType() == Type::Int1Ty, - "Select condition type must be bool!", &SI); + if (const VectorType* vt + = dyn_cast(SI.getCondition()->getType())) { + Assert1( vt->getElementType() == Type::Int1Ty, + "Select condition type must be vector of bool!", &SI); + if (const VectorType* val_vt + = dyn_cast(SI.getTrueValue()->getType())) { + Assert1( vt->getNumElements() == val_vt->getNumElements(), + "Select vector size != value vector size", &SI); + } else { + Assert1(0, "Vector select values must have vector types", &SI); + } + } else { + Assert1(SI.getCondition()->getType() == Type::Int1Ty, + "Select condition type must be bool!", &SI); + } Assert1(SI.getTrueValue()->getType() == SI.getFalseValue()->getType(), "Select values must have identical types!", &SI); Assert1(SI.getTrueValue()->getType() == SI.getType(), @@ -1028,7 +1041,7 @@ Assert1(Op0Ty == Op1Ty, "Both operands to ICmp instruction are not of the same type!", &IC); // Check that the operands are the right type - Assert1(Op0Ty->isInteger() || isa(Op0Ty), + Assert1(Op0Ty->isIntOrIntVector() || isa(Op0Ty), "Invalid operand types for ICmp instruction", &IC); visitInstruction(IC); } @@ -1040,7 +1053,7 @@ Assert1(Op0Ty == Op1Ty, "Both operands to FCmp instruction are not of the same type!", &FC); // Check that the operands are the right type - Assert1(Op0Ty->isFloatingPoint(), + Assert1(Op0Ty->isFPOrFPVector(), "Invalid operand types for FCmp instruction", &FC); visitInstruction(FC); } Added: llvm/trunk/test/Assembler/vbool-cmp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/vbool-cmp.ll?rev=55969&view=auto ============================================================================== --- llvm/trunk/test/Assembler/vbool-cmp.ll (added) +++ llvm/trunk/test/Assembler/vbool-cmp.ll Mon Sep 8 20:02:47 2008 @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep {icmp slt} +; rudimentary test of fcmp/icmp on vectors returning vector of bool + +define <4 x i1> @ffoo(<4 x float> %a, <4 x float> %b) nounwind { +entry: + %cmp = fcmp olt <4 x float> %a, %b ; <4 x i1> [#uses=1] + ret <4 x i1> %cmp +} + +define <4 x i1> @ifoo(<4 x i32> %a, <4 x i32> %b) nounwind { +entry: + %cmp = icmp slt <4 x i32> %a, %b ; <4 x i1> [#uses=1] + ret <4 x i1> %cmp +} + Added: llvm/trunk/test/Assembler/vector-select.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/vector-select.ll?rev=55969&view=auto ============================================================================== --- llvm/trunk/test/Assembler/vector-select.ll (added) +++ llvm/trunk/test/Assembler/vector-select.ll Mon Sep 8 20:02:47 2008 @@ -0,0 +1,11 @@ +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep select +; rudimentary test of select on vectors returning vector of bool + +define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b, + <4 x i1> %cond) nounwind { +entry: + %cmp = select <4 x i1> %cond, <4 x i32> %a, <4 x i32> %b + ; <4 x i32> [#uses=1] + ret <4 x i32> %cmp +} + From dpatel at apple.com Mon Sep 8 20:06:56 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 09 Sep 2008 01:06:56 -0000 Subject: [llvm-commits] [llvm] r55971 - in /llvm/trunk: lib/Transforms/Utils/BasicBlockUtils.cpp test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll Message-ID: <200809090106.m8916uRZ009778@zion.cs.uiuc.edu> Author: dpatel Date: Mon Sep 8 20:06:56 2008 New Revision: 55971 URL: http://llvm.org/viewvc/llvm-project?rev=55971&view=rev Log: Fix simplifycfg crash in handing block merge. Added: llvm/trunk/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Modified: llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp?rev=55971&r1=55970&r2=55971&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BasicBlockUtils.cpp Mon Sep 8 20:06:56 2008 @@ -54,7 +54,17 @@ // Can't merge if there are multiple successors. if (!OnlySucc) return false; - + + // Can't merge if there is PHI loop. + for (BasicBlock::iterator BI = BB->begin(), BE = BB->end(); BI != BE; ++BI) { + if (PHINode *PN = dyn_cast(BI)) { + for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) + if (PN->getIncomingValue(i) == PN) + return false; + } else + break; + } + // Begin by getting rid of unneeded PHIs. while (PHINode *PN = dyn_cast(&BB->front())) { PN->replaceAllUsesWith(PN->getIncomingValue(0)); Added: llvm/trunk/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll?rev=55971&view=auto ============================================================================== --- llvm/trunk/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll (added) +++ llvm/trunk/test/Transforms/SimplifyCFG/2008-09-08-MultiplePred.ll Mon Sep 8 20:06:56 2008 @@ -0,0 +1,60 @@ +; RUN: llvm-as < %s | opt -simplifycfg -disable-output +; PR 2777 + at g_103 = common global i32 0 ; [#uses=1] + +define i32 @func_127(i32 %p_129) nounwind { +entry: + load i32* @g_103, align 4 ; :0 [#uses=1] + icmp eq i32 %0, 0 ; :1 [#uses=2] + br i1 %1, label %bb6.preheader, label %entry.return_crit_edge + +entry.return_crit_edge: ; preds = %entry + br label %return + +bb6.preheader: ; preds = %entry + br i1 %1, label %bb6.preheader.split.us, label %bb6.preheader.split + +bb6.preheader.split.us: ; preds = %bb6.preheader + br label %return.loopexit.split + +bb6.preheader.split: ; preds = %bb6.preheader + br label %bb6 + +bb6: ; preds = %bb17.bb6_crit_edge, %bb6.preheader.split + %indvar35 = phi i32 [ 0, %bb6.preheader.split ], [ %indvar.next36, %bb17.bb6_crit_edge ] ; [#uses=1] + %p_129_addr.3.reg2mem.0 = phi i32 [ %p_129_addr.2, %bb17.bb6_crit_edge ], [ %p_129, %bb6.preheader.split ] ; [#uses=3] + icmp eq i32 %p_129_addr.3.reg2mem.0, 0 ; :2 [#uses=1] + br i1 %2, label %bb6.bb17_crit_edge, label %bb8 + +bb6.bb17_crit_edge: ; preds = %bb6 + br label %bb17 + +bb8: ; preds = %bb6 + br label %bb13 + +bb13: ; preds = %bb8 + br label %bb17 + +bb17: ; preds = %bb13, %bb6.bb17_crit_edge + %p_129_addr.2 = phi i32 [ %p_129_addr.3.reg2mem.0, %bb13 ], [ %p_129_addr.3.reg2mem.0, %bb6.bb17_crit_edge ] ; [#uses=1] + %indvar.next36 = add i32 %indvar35, 1 ; [#uses=2] + %exitcond37 = icmp eq i32 %indvar.next36, -1 ; [#uses=1] + br i1 %exitcond37, label %return.loopexit, label %bb17.bb6_crit_edge + +bb17.bb6_crit_edge: ; preds = %bb17 + br label %bb6 + +return.loopexit: ; preds = %bb17 + br label %return.loopexit.split + +return.loopexit.split: ; preds = %return.loopexit, %bb6.preheader.split.us + br label %return + +return: ; preds = %return.loopexit.split, %entry.return_crit_edge + ret i32 1 +} + +define i32 @func_135(i8 zeroext %p_137, i32 %p_138, i32 %p_140) nounwind { +entry: + ret i32 undef +} From gohman at apple.com Mon Sep 8 20:13:24 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 09 Sep 2008 01:13:24 -0000 Subject: [llvm-commits] [llvm] r55972 - in /llvm/trunk/lib/AsmParser: llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200809090113.m891DPCQ009983@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 20:13:24 2008 New Revision: 55972 URL: http://llvm.org/viewvc/llvm-project?rev=55972&view=rev Log: Update generated files. Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=55972&r1=55971&r2=55972&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Mon Sep 8 20:13:24 2008 @@ -400,7 +400,7 @@ /* Copy the first part of user declarations. */ -#line 14 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 14 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1377,7 +1377,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 970 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 970 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1918,10 +1918,10 @@ 2685, 2694, 2699, 2704, 2708, 2717, 2726, 2739, 2748, 2752, 2760, 2780, 2784, 2789, 2800, 2819, 2828, 2914, 2918, 2925, 2936, 2949, 2958, 2971, 2982, 2992, 3003, 3011, 3021, 3028, - 3031, 3032, 3040, 3046, 3055, 3059, 3064, 3080, 3097, 3111, - 3125, 3139, 3153, 3165, 3173, 3180, 3186, 3192, 3198, 3213, - 3303, 3308, 3312, 3319, 3326, 3336, 3343, 3353, 3361, 3375, - 3392, 3406, 3421, 3436 + 3031, 3032, 3040, 3046, 3055, 3059, 3064, 3080, 3097, 3109, + 3121, 3135, 3149, 3161, 3182, 3189, 3195, 3201, 3207, 3222, + 3312, 3317, 3321, 3328, 3335, 3345, 3352, 3362, 3370, 3384, + 3401, 3415, 3430, 3445 }; #endif @@ -3662,152 +3662,152 @@ switch (yyn) { case 29: -#line 1148 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1148 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1148 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1148 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1149 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1149 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1150 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1150 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1150 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1150 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1151 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1151 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1151 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1151 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1152 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1152 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1152 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1152 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1156 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1156 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1156 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1156 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1157 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1157 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1158 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1158 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1159 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1159 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1159 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1159 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1160 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1160 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1160 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1160 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1161 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1161 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1161 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1161 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1162 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1162 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1162 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1162 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1163 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1163 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1164 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1164 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 65: -#line 1173 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1173 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 66: -#line 1175 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1175 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} break; case 67: -#line 1176 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1176 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=0; ;} break; case 68: -#line 1180 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1180 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3815,7 +3815,7 @@ break; case 69: -#line 1184 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1184 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3823,7 +3823,7 @@ break; case 70: -#line 1189 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1189 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal); CHECK_FOR_ERROR @@ -3831,7 +3831,7 @@ break; case 74: -#line 1198 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1198 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3839,7 +3839,7 @@ break; case 75: -#line 1203 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1203 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3847,162 +3847,162 @@ break; case 76: -#line 1209 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1209 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 77: -#line 1210 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1210 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 78: -#line 1211 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1211 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 79: -#line 1212 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1212 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 80: -#line 1213 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1213 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 81: -#line 1214 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1214 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::CommonLinkage; ;} break; case 82: -#line 1218 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1218 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 83: -#line 1219 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1219 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 84: -#line 1220 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1220 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 85: -#line 1224 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1224 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 86: -#line 1225 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1225 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 87: -#line 1226 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1226 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 88: -#line 1227 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1227 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} break; case 89: -#line 1231 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1231 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 90: -#line 1232 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1232 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 91: -#line 1233 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1233 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 92: -#line 1237 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1237 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 93: -#line 1238 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1238 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 94: -#line 1239 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1239 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 95: -#line 1240 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1240 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 96: -#line 1241 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1241 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 97: -#line 1245 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1245 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 98: -#line 1246 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1246 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 99: -#line 1247 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1247 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 100: -#line 1250 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1250 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 101: -#line 1251 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1251 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 102: -#line 1252 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1252 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 103: -#line 1253 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1253 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 104: -#line 1254 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1254 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 105: -#line 1255 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1255 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 106: -#line 1256 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1256 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_SSECall; ;} break; case 107: -#line 1257 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1257 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) GEN_ERROR("Calling conv too large"); @@ -4012,117 +4012,117 @@ break; case 108: -#line 1264 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1264 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 109: -#line 1265 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1265 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 110: -#line 1266 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1266 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 111: -#line 1267 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1267 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 112: -#line 1268 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1268 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::InReg; ;} break; case 113: -#line 1269 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1269 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} break; case 114: -#line 1270 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1270 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;} break; case 115: -#line 1271 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1271 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ByVal; ;} break; case 116: -#line 1272 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1272 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::Nest; ;} break; case 117: -#line 1273 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1273 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;} break; case 118: -#line 1277 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1277 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 119: -#line 1278 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1278 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; case 120: -#line 1283 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1283 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} break; case 121: -#line 1284 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1284 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} break; case 122: -#line 1285 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1285 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 123: -#line 1286 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1286 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 124: -#line 1287 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1287 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;} break; case 125: -#line 1288 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1288 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;} break; case 126: -#line 1291 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1291 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 127: -#line 1292 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1292 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; case 128: -#line 1297 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1297 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionNotes) = (yyvsp[(1) - (1)].FunctionNotes); ;} break; case 129: -#line 1298 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1298 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { FunctionNotes tmp = (yyvsp[(1) - (3)].FunctionNotes) | (yyvsp[(3) - (3)].FunctionNotes); if ((yyvsp[(3) - (3)].FunctionNotes) == FN_NOTE_NoInline && ((yyvsp[(1) - (3)].FunctionNotes) & FN_NOTE_AlwaysInline)) @@ -4135,51 +4135,51 @@ break; case 130: -#line 1309 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1309 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionNotes) = FN_NOTE_NoInline; ;} break; case 131: -#line 1310 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1310 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionNotes) = FN_NOTE_AlwaysInline; ;} break; case 132: -#line 1311 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1311 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionNotes) = FN_NOTE_OptimizeForSize; ;} break; case 133: -#line 1314 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1314 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionNotes) = FN_NOTE_None; ;} break; case 134: -#line 1315 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1315 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionNotes) = (yyvsp[(3) - (4)].FunctionNotes); ;} break; case 135: -#line 1320 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1320 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 136: -#line 1321 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1321 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); ;} break; case 137: -#line 1328 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1328 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 138: -#line 1329 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1329 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4189,12 +4189,12 @@ break; case 139: -#line 1335 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1335 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 140: -#line 1336 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1336 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4204,7 +4204,7 @@ break; case 141: -#line 1345 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1345 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i) if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\') @@ -4215,27 +4215,27 @@ break; case 142: -#line 1353 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1353 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 143: -#line 1354 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1354 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} break; case 144: -#line 1359 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1359 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 145: -#line 1360 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1360 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 146: -#line 1361 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1361 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -4244,7 +4244,7 @@ break; case 147: -#line 1366 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1366 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); @@ -4254,7 +4254,7 @@ break; case 155: -#line 1382 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1382 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR @@ -4262,7 +4262,7 @@ break; case 156: -#line 1386 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1386 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR @@ -4270,7 +4270,7 @@ break; case 157: -#line 1390 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1390 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Pointer type? if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); @@ -4281,7 +4281,7 @@ break; case 158: -#line 1397 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1397 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); CHECK_FOR_ERROR @@ -4290,7 +4290,7 @@ break; case 159: -#line 1402 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1402 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Type UpReference if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder @@ -4302,7 +4302,7 @@ break; case 160: -#line 1410 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1410 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4335,7 +4335,7 @@ break; case 161: -#line 1439 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1439 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4363,7 +4363,7 @@ break; case 162: -#line 1464 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1464 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Sized array type? (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val)))); delete (yyvsp[(4) - (5)].TypeVal); @@ -4372,7 +4372,7 @@ break; case 163: -#line 1469 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1469 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) @@ -4386,7 +4386,7 @@ break; case 164: -#line 1479 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1479 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), @@ -4400,7 +4400,7 @@ break; case 165: -#line 1489 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1489 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR @@ -4408,7 +4408,7 @@ break; case 166: -#line 1493 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1493 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), @@ -4422,7 +4422,7 @@ break; case 167: -#line 1503 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1503 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR @@ -4430,7 +4430,7 @@ break; case 168: -#line 1510 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1510 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4440,7 +4440,7 @@ break; case 169: -#line 1519 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1519 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); @@ -4451,14 +4451,14 @@ break; case 170: -#line 1526 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1526 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; case 171: -#line 1531 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1531 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); @@ -4467,7 +4467,7 @@ break; case 172: -#line 1536 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1536 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR @@ -4475,7 +4475,7 @@ break; case 174: -#line 1544 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1544 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -4486,7 +4486,7 @@ break; case 175: -#line 1551 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1551 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -4497,7 +4497,7 @@ break; case 176: -#line 1558 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1558 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR @@ -4505,7 +4505,7 @@ break; case 177: -#line 1566 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1566 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); @@ -4515,7 +4515,7 @@ break; case 178: -#line 1572 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1572 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal); @@ -4524,7 +4524,7 @@ break; case 179: -#line 1584 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1584 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4556,7 +4556,7 @@ break; case 180: -#line 1612 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1612 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4576,7 +4576,7 @@ break; case 181: -#line 1628 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1628 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4607,7 +4607,7 @@ break; case 182: -#line 1655 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1655 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4639,7 +4639,7 @@ break; case 183: -#line 1683 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1683 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (STy == 0) @@ -4669,7 +4669,7 @@ break; case 184: -#line 1709 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1709 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4693,7 +4693,7 @@ break; case 185: -#line 1729 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1729 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); if (STy == 0) @@ -4723,7 +4723,7 @@ break; case 186: -#line 1755 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1755 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); @@ -4747,7 +4747,7 @@ break; case 187: -#line 1775 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1775 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4763,7 +4763,7 @@ break; case 188: -#line 1787 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1787 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4774,7 +4774,7 @@ break; case 189: -#line 1794 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1794 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4844,7 +4844,7 @@ break; case 190: -#line 1860 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1860 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4858,7 +4858,7 @@ break; case 191: -#line 1870 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1870 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4872,7 +4872,7 @@ break; case 192: -#line 1880 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1880 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4882,7 +4882,7 @@ break; case 193: -#line 1886 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1886 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4896,7 +4896,7 @@ break; case 194: -#line 1896 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1896 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4906,7 +4906,7 @@ break; case 195: -#line 1902 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1902 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4920,7 +4920,7 @@ break; case 196: -#line 1912 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1912 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if (cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1) GEN_ERROR("Constant true must have type i1"); @@ -4930,7 +4930,7 @@ break; case 197: -#line 1918 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1918 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if (cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1) GEN_ERROR("Constant false must have type i1"); @@ -4940,7 +4940,7 @@ break; case 198: -#line 1924 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1924 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Floating point constants if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); @@ -4955,7 +4955,7 @@ break; case 199: -#line 1937 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1937 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); @@ -4971,7 +4971,7 @@ break; case 200: -#line 1949 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1949 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); @@ -4996,7 +4996,7 @@ break; case 201: -#line 1970 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1970 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); @@ -5008,7 +5008,7 @@ break; case 202: -#line 1978 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1978 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); @@ -5018,7 +5018,7 @@ break; case 203: -#line 1984 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1984 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); @@ -5033,7 +5033,7 @@ break; case 204: -#line 1995 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1995 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); @@ -5042,7 +5042,7 @@ break; case 205: -#line 2000 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2000 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); @@ -5051,7 +5051,7 @@ break; case 206: -#line 2005 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2005 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vicmp operand types must match"); @@ -5060,7 +5060,7 @@ break; case 207: -#line 2010 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2010 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vfcmp operand types must match"); @@ -5069,7 +5069,7 @@ break; case 208: -#line 2015 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2015 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) GEN_ERROR("Invalid extractelement operands"); @@ -5079,7 +5079,7 @@ break; case 209: -#line 2021 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2021 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid insertelement operands"); @@ -5089,7 +5089,7 @@ break; case 210: -#line 2027 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2027 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -5099,7 +5099,7 @@ break; case 211: -#line 2033 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2033 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("ExtractValue requires an aggregate operand"); @@ -5111,7 +5111,7 @@ break; case 212: -#line 2041 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2041 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa((yyvsp[(3) - (7)].ConstVal)->getType())) GEN_ERROR("InsertValue requires an aggregate operand"); @@ -5123,7 +5123,7 @@ break; case 213: -#line 2052 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2052 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR @@ -5131,7 +5131,7 @@ break; case 214: -#line 2056 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2056 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); @@ -5140,27 +5140,27 @@ break; case 215: -#line 2064 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2064 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 216: -#line 2064 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2064 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 217: -#line 2067 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2067 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 218: -#line 2067 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2067 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 219: -#line 2070 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2070 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); @@ -5176,7 +5176,7 @@ break; case 220: -#line 2082 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2082 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { Constant *Val = (yyvsp[(3) - (6)].ConstVal); const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); @@ -5192,7 +5192,7 @@ break; case 221: -#line 2103 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2103 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5201,7 +5201,7 @@ break; case 222: -#line 2108 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2108 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5210,12 +5210,12 @@ break; case 225: -#line 2121 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2121 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; case 226: -#line 2121 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2121 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR @@ -5223,26 +5223,26 @@ break; case 227: -#line 2125 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2125 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; case 228: -#line 2125 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2125 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 229: -#line 2128 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2128 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 230: -#line 2131 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2131 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); @@ -5270,7 +5270,7 @@ break; case 231: -#line 2155 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2155 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); @@ -5285,7 +5285,7 @@ break; case 232: -#line 2167 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2167 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ if ((yyvsp[(5) - (6)].ConstVal) == 0) @@ -5297,14 +5297,14 @@ break; case 233: -#line 2174 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2174 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 234: -#line 2178 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2178 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(6) - (7)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); @@ -5314,14 +5314,14 @@ break; case 235: -#line 2183 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2183 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 236: -#line 2187 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2187 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription()); @@ -5332,7 +5332,7 @@ break; case 237: -#line 2193 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2193 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -5340,7 +5340,7 @@ break; case 238: -#line 2197 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2197 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { std::string Name; if ((yyvsp[(1) - (5)].StrVal)) { @@ -5384,21 +5384,21 @@ break; case 239: -#line 2237 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2237 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 240: -#line 2240 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2240 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 241: -#line 2246 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2246 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) @@ -5411,7 +5411,7 @@ break; case 242: -#line 2256 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2256 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5419,7 +5419,7 @@ break; case 243: -#line 2260 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2260 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5427,7 +5427,7 @@ break; case 245: -#line 2267 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2267 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5436,7 +5436,7 @@ break; case 246: -#line 2272 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2272 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5445,14 +5445,14 @@ break; case 247: -#line 2277 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2277 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 248: -#line 2286 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2286 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -5466,7 +5466,7 @@ break; case 249: -#line 2296 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2296 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -5480,7 +5480,7 @@ break; case 250: -#line 2307 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2307 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); CHECK_FOR_ERROR @@ -5488,7 +5488,7 @@ break; case 251: -#line 2311 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2311 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; @@ -5501,7 +5501,7 @@ break; case 252: -#line 2320 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2320 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; @@ -5514,7 +5514,7 @@ break; case 253: -#line 2329 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2329 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR @@ -5522,7 +5522,7 @@ break; case 254: -#line 2335 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2335 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { std::string FunctionName(*(yyvsp[(3) - (11)].StrVal)); delete (yyvsp[(3) - (11)].StrVal); // Free strdup'd memory! @@ -5656,7 +5656,7 @@ break; case 257: -#line 2468 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2468 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5668,7 +5668,7 @@ break; case 260: -#line 2479 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2479 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -5676,7 +5676,7 @@ break; case 261: -#line 2484 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2484 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); @@ -5687,7 +5687,7 @@ break; case 262: -#line 2496 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2496 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5695,7 +5695,7 @@ break; case 263: -#line 2500 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2500 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5703,7 +5703,7 @@ break; case 264: -#line 2505 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2505 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR @@ -5711,7 +5711,7 @@ break; case 265: -#line 2509 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2509 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR @@ -5719,7 +5719,7 @@ break; case 266: -#line 2513 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2513 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true); delete (yyvsp[(1) - (1)].APIntVal); @@ -5728,7 +5728,7 @@ break; case 267: -#line 2518 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2518 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false); delete (yyvsp[(1) - (1)].APIntVal); @@ -5737,7 +5737,7 @@ break; case 268: -#line 2523 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2523 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR @@ -5745,7 +5745,7 @@ break; case 269: -#line 2527 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2527 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR @@ -5753,7 +5753,7 @@ break; case 270: -#line 2531 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2531 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR @@ -5761,7 +5761,7 @@ break; case 271: -#line 2535 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2535 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR @@ -5769,7 +5769,7 @@ break; case 272: -#line 2539 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2539 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR @@ -5777,7 +5777,7 @@ break; case 273: -#line 2543 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2543 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR @@ -5785,7 +5785,7 @@ break; case 274: -#line 2547 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2547 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5811,7 +5811,7 @@ break; case 275: -#line 2569 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2569 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5837,7 +5837,7 @@ break; case 276: -#line 2591 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2591 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Use undef instead of an array because it's inconvenient to determine // the element type at this point, there being no elements to examine. @@ -5847,7 +5847,7 @@ break; case 277: -#line 2597 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2597 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length(); const Type *ETy = Type::Int8Ty; @@ -5864,7 +5864,7 @@ break; case 278: -#line 2610 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2610 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(2) - (3)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i) @@ -5880,7 +5880,7 @@ break; case 279: -#line 2622 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2622 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector()); (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector())); @@ -5889,7 +5889,7 @@ break; case 280: -#line 2627 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2627 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(3) - (5)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i) @@ -5905,7 +5905,7 @@ break; case 281: -#line 2639 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2639 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector(), /*isPacked=*/true); @@ -5915,7 +5915,7 @@ break; case 282: -#line 2645 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2645 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR @@ -5923,7 +5923,7 @@ break; case 283: -#line 2649 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2649 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); delete (yyvsp[(3) - (5)].StrVal); @@ -5933,7 +5933,7 @@ break; case 284: -#line 2659 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2659 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5941,7 +5941,7 @@ break; case 285: -#line 2663 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2663 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5949,7 +5949,7 @@ break; case 286: -#line 2667 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2667 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5958,7 +5958,7 @@ break; case 287: -#line 2672 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2672 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5967,7 +5967,7 @@ break; case 290: -#line 2685 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2685 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -5978,7 +5978,7 @@ break; case 291: -#line 2694 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2694 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); @@ -5987,7 +5987,7 @@ break; case 292: -#line 2699 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2699 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR @@ -5995,7 +5995,7 @@ break; case 293: -#line 2704 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2704 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -6003,7 +6003,7 @@ break; case 294: -#line 2708 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2708 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -6011,7 +6011,7 @@ break; case 295: -#line 2717 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2717 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); CHECK_FOR_ERROR @@ -6023,7 +6023,7 @@ break; case 296: -#line 2726 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2726 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal)); @@ -6038,7 +6038,7 @@ break; case 297: -#line 2739 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2739 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) @@ -6051,7 +6051,7 @@ break; case 298: -#line 2748 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2748 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR @@ -6059,7 +6059,7 @@ break; case 299: -#line 2752 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2752 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); delete (yyvsp[(1) - (1)].StrVal); @@ -6069,7 +6069,7 @@ break; case 300: -#line 2760 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2760 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with a result... ValueList &VL = *(yyvsp[(2) - (2)].ValueList); assert(!VL.empty() && "Invalid ret operands!"); @@ -6093,7 +6093,7 @@ break; case 301: -#line 2780 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2780 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = ReturnInst::Create(); CHECK_FOR_ERROR @@ -6101,7 +6101,7 @@ break; case 302: -#line 2784 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2784 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); CHECK_FOR_ERROR @@ -6110,7 +6110,7 @@ break; case 303: -#line 2789 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2789 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1) GEN_ERROR("Branch condition must have type i1"); @@ -6125,7 +6125,7 @@ break; case 304: -#line 2800 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2800 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR @@ -6148,7 +6148,7 @@ break; case 305: -#line 2819 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2819 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); CHECK_FOR_ERROR @@ -6161,7 +6161,7 @@ break; case 306: -#line 2829 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2829 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6250,7 +6250,7 @@ break; case 307: -#line 2914 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2914 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR @@ -6258,7 +6258,7 @@ break; case 308: -#line 2918 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2918 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR @@ -6266,7 +6266,7 @@ break; case 309: -#line 2925 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2925 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); @@ -6281,7 +6281,7 @@ break; case 310: -#line 2936 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2936 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); @@ -6297,7 +6297,7 @@ break; case 311: -#line 2949 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2949 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); @@ -6309,7 +6309,7 @@ break; case 312: -#line 2958 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2958 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal)); @@ -6324,7 +6324,7 @@ break; case 313: -#line 2971 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2971 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); @@ -6339,7 +6339,7 @@ break; case 314: -#line 2982 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2982 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); @@ -6351,7 +6351,7 @@ break; case 315: -#line 2992 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2992 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6366,7 +6366,7 @@ break; case 316: -#line 3003 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3003 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 // Labels are only valid in ASMs @@ -6378,7 +6378,7 @@ break; case 317: -#line 3011 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3011 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6392,7 +6392,7 @@ break; case 318: -#line 3021 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3021 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); @@ -6403,17 +6403,17 @@ break; case 319: -#line 3028 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3028 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamList) = new ParamList(); ;} break; case 320: -#line 3031 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3031 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 321: -#line 3032 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3032 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); @@ -6422,7 +6422,7 @@ break; case 322: -#line 3040 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3040 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstantList) = new std::vector(); if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) @@ -6432,7 +6432,7 @@ break; case 323: -#line 3046 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3046 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList); if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val)) @@ -6443,7 +6443,7 @@ break; case 324: -#line 3055 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3055 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -6451,7 +6451,7 @@ break; case 325: -#line 3059 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3059 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -6459,7 +6459,7 @@ break; case 326: -#line 3064 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3064 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6479,7 +6479,7 @@ break; case 327: -#line 3080 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3080 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6500,12 +6500,10 @@ break; case 328: -#line 3097 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3097 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); - if (isa((*(yyvsp[(3) - (6)].TypeVal)).get())) - GEN_ERROR("Vector types not supported by icmp instruction"); Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); CHECK_FOR_ERROR Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); @@ -6518,12 +6516,10 @@ break; case 329: -#line 3111 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3109 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); - if (isa((*(yyvsp[(3) - (6)].TypeVal)).get())) - GEN_ERROR("Vector types not supported by fcmp instruction"); Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); CHECK_FOR_ERROR Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); @@ -6536,7 +6532,7 @@ break; case 330: -#line 3125 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3121 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6548,13 +6544,13 @@ CHECK_FOR_ERROR (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2); if ((yyval.InstVal) == 0) - GEN_ERROR("icmp operator returned null"); + GEN_ERROR("vicmp operator returned null"); delete (yyvsp[(3) - (6)].TypeVal); ;} break; case 331: -#line 3139 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3135 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6566,13 +6562,13 @@ CHECK_FOR_ERROR (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2); if ((yyval.InstVal) == 0) - GEN_ERROR("fcmp operator returned null"); + GEN_ERROR("vfcmp operator returned null"); delete (yyvsp[(3) - (6)].TypeVal); ;} break; case 332: -#line 3153 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3149 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6588,19 +6584,32 @@ break; case 333: -#line 3165 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3161 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) - GEN_ERROR("select condition must be boolean"); + if (isa((yyvsp[(2) - (6)].ValueVal)->getType())) { + // vector select + if (!isa((yyvsp[(4) - (6)].ValueVal)->getType()) + || !isa((yyvsp[(6) - (6)].ValueVal)->getType()) ) + GEN_ERROR("vector select value types must be vector types"); + const VectorType* cond_type = cast((yyvsp[(2) - (6)].ValueVal)->getType()); + const VectorType* select_type = cast((yyvsp[(4) - (6)].ValueVal)->getType()); + if (cond_type->getElementType() != Type::Int1Ty) + GEN_ERROR("vector select condition element type must be boolean"); + if (cond_type->getNumElements() != select_type->getNumElements()) + GEN_ERROR("vector select number of elements must be the same"); + } else { + if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) + GEN_ERROR("select condition must be boolean"); + } if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType()) - GEN_ERROR("select value types should match"); + GEN_ERROR("select value types must match"); (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); CHECK_FOR_ERROR ;} break; case 334: -#line 3173 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3182 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6611,7 +6620,7 @@ break; case 335: -#line 3180 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3189 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) GEN_ERROR("Invalid extractelement operands"); @@ -6621,7 +6630,7 @@ break; case 336: -#line 3186 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3195 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid insertelement operands"); @@ -6631,7 +6640,7 @@ break; case 337: -#line 3192 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3201 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -6641,7 +6650,7 @@ break; case 338: -#line 3198 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3207 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) @@ -6660,7 +6669,7 @@ break; case 339: -#line 3214 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3223 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6753,7 +6762,7 @@ break; case 340: -#line 3303 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3312 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); CHECK_FOR_ERROR @@ -6761,7 +6770,7 @@ break; case 341: -#line 3308 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3317 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -6769,7 +6778,7 @@ break; case 342: -#line 3312 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3321 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -6777,7 +6786,7 @@ break; case 343: -#line 3319 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3328 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6788,7 +6797,7 @@ break; case 344: -#line 3326 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3335 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6802,7 +6811,7 @@ break; case 345: -#line 3336 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3345 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6813,7 +6822,7 @@ break; case 346: -#line 3343 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3352 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6827,7 +6836,7 @@ break; case 347: -#line 3353 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3362 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + @@ -6838,7 +6847,7 @@ break; case 348: -#line 3361 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3370 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -6856,7 +6865,7 @@ break; case 349: -#line 3375 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3384 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); @@ -6877,7 +6886,7 @@ break; case 350: -#line 3392 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3401 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6895,7 +6904,7 @@ break; case 351: -#line 3406 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3415 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -6914,7 +6923,7 @@ break; case 352: -#line 3421 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3430 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -6933,7 +6942,7 @@ break; case 353: -#line 3436 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3445 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription()); @@ -6955,7 +6964,7 @@ /* Line 1267 of yacc.c. */ -#line 6959 "llvmAsmParser.tab.c" +#line 6968 "llvmAsmParser.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -7169,7 +7178,7 @@ } -#line 3455 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3464 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=55972&r1=55971&r2=55972&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Mon Sep 8 20:13:24 2008 @@ -366,7 +366,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 970 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" +#line 970 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=55972&r1=55971&r2=55972&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Mon Sep 8 20:13:24 2008 @@ -1102,7 +1102,7 @@ %token ADD SUB MUL UDIV SDIV FDIV UREM SREM FREM AND OR XOR %token SHL LSHR ASHR -%token ICMP FCMP VICMP VFCMP +%token ICMP FCMP VICMP VFCMP %type IPredicates %type FPredicates %token EQ NE SLT SGT SLE SGE ULT UGT ULE UGE @@ -3097,8 +3097,6 @@ | ICMP IPredicates Types ValueRef ',' ValueRef { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription()); - if (isa((*$3).get())) - GEN_ERROR("Vector types not supported by icmp instruction"); Value* tmpVal1 = getVal(*$3, $4); CHECK_FOR_ERROR Value* tmpVal2 = getVal(*$3, $6); @@ -3111,8 +3109,6 @@ | FCMP FPredicates Types ValueRef ',' ValueRef { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription()); - if (isa((*$3).get())) - GEN_ERROR("Vector types not supported by fcmp instruction"); Value* tmpVal1 = getVal(*$3, $4); CHECK_FOR_ERROR Value* tmpVal2 = getVal(*$3, $6); @@ -3133,7 +3129,7 @@ CHECK_FOR_ERROR $$ = CmpInst::Create($1, $2, tmpVal1, tmpVal2); if ($$ == 0) - GEN_ERROR("icmp operator returned null"); + GEN_ERROR("vicmp operator returned null"); delete $3; } | VFCMP FPredicates Types ValueRef ',' ValueRef { @@ -3147,7 +3143,7 @@ CHECK_FOR_ERROR $$ = CmpInst::Create($1, $2, tmpVal1, tmpVal2); if ($$ == 0) - GEN_ERROR("fcmp operator returned null"); + GEN_ERROR("vfcmp operator returned null"); delete $3; } | CastOps ResolvedVal TO Types { @@ -3163,10 +3159,23 @@ delete $4; } | SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal { - if ($2->getType() != Type::Int1Ty) - GEN_ERROR("select condition must be boolean"); + if (isa($2->getType())) { + // vector select + if (!isa($4->getType()) + || !isa($6->getType()) ) + GEN_ERROR("vector select value types must be vector types"); + const VectorType* cond_type = cast($2->getType()); + const VectorType* select_type = cast($4->getType()); + if (cond_type->getElementType() != Type::Int1Ty) + GEN_ERROR("vector select condition element type must be boolean"); + if (cond_type->getNumElements() != select_type->getNumElements()) + GEN_ERROR("vector select number of elements must be the same"); + } else { + if ($2->getType() != Type::Int1Ty) + GEN_ERROR("select condition must be boolean"); + } if ($4->getType() != $6->getType()) - GEN_ERROR("select value types should match"); + GEN_ERROR("select value types must match"); $$ = SelectInst::Create($2, $4, $6); CHECK_FOR_ERROR } From dalej at apple.com Mon Sep 8 20:21:22 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 09 Sep 2008 01:21:22 -0000 Subject: [llvm-commits] [llvm] r55973 - in /llvm/trunk: include/llvm/Target/TargetAsmInfo.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/Target/ARM/ARMTargetAsmInfo.cpp lib/Target/PowerPC/PPCTargetAsmInfo.cpp lib/Target/TargetAsmInfo.cpp lib/Target/X86/X86TargetAsmInfo.cpp Message-ID: <200809090121.m891LMQL010215@zion.cs.uiuc.edu> Author: johannes Date: Mon Sep 8 20:21:22 2008 New Revision: 55973 URL: http://llvm.org/viewvc/llvm-project?rev=55973&view=rev Log: Fix logic for not emitting no-dead-strip for some objects in llvm.used (thanks Anton). Makes visible the magic 'l' prefix for symbols on Darwin which are to be passed through the assembler, then removed at linktime (previously all references to this had been hidden in the ObjC FE code, oh well). Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp llvm/trunk/lib/Target/TargetAsmInfo.cpp llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Modified: llvm/trunk/include/llvm/Target/TargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetAsmInfo.h?rev=55973&r1=55972&r2=55973&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetAsmInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetAsmInfo.h Mon Sep 8 20:21:22 2008 @@ -216,10 +216,15 @@ const char *GlobalPrefix; // Defaults to "" /// PrivateGlobalPrefix - This prefix is used for globals like constant - /// pool entries that are completely private to the .o file and should not + /// pool entries that are completely private to the .s file and should not /// have names in the .o file. This is often "." or "L". const char *PrivateGlobalPrefix; // Defaults to "." + /// LessPrivateGlobalPrefix - This prefix is used for some Objective C + /// metadata symbols that should be passed through the assembler but be + /// removed by the linker. This is "l" on Darwin. + const char *LessPrivateGlobalPrefix; // Defaults to "" + /// JumpTableSpecialLabelPrefix - If not null, a extra (dead) label is /// emitted before jump tables with the specified prefix. const char *JumpTableSpecialLabelPrefix; // Default to null. @@ -653,6 +658,9 @@ const char *getPrivateGlobalPrefix() const { return PrivateGlobalPrefix; } + const char *getLessPrivateGlobalPrefix() const { + return LessPrivateGlobalPrefix; + } const char *getJumpTableSpecialLabelPrefix() const { return JumpTableSpecialLabelPrefix; } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=55973&r1=55972&r2=55973&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Sep 8 20:21:22 2008 @@ -452,7 +452,9 @@ /// EmitLLVMUsedList - For targets that define a TAI::UsedDirective, mark each /// global in the specified llvm.used list as being used with this directive. -/// Non-globals (i.e. internal linkage) should not be emitted. +/// Internally linked data beginning with the PrivateGlobalPrefix or the +/// LessPrivateGlobalPrefix does not have the directive emitted (this +/// occurs in ObjC metadata). void AsmPrinter::EmitLLVMUsedList(Constant *List) { const char *Directive = TAI->getUsedDirective(); @@ -462,7 +464,17 @@ for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) { const GlobalValue *GV = findGlobalValue(InitList->getOperand(i)); - if (GV && (!GV->hasInternalLinkage() || isa(GV))) { + if (GV) { + if (GV->hasInternalLinkage() && !isa(GV) && + ((strlen(TAI->getPrivateGlobalPrefix()) != 0 && + Mang->getValueName(GV) + .substr(0,strlen(TAI->getPrivateGlobalPrefix())) == + TAI->getPrivateGlobalPrefix()) || + (strlen(TAI->getLessPrivateGlobalPrefix()) != 0 && + Mang->getValueName(GV) + .substr(0,strlen(TAI->getLessPrivateGlobalPrefix())) == + TAI->getLessPrivateGlobalPrefix()))) + continue; O << Directive; EmitConstantValueOnly(InitList->getOperand(i)); O << '\n'; Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp?rev=55973&r1=55972&r2=55973&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp Mon Sep 8 20:21:22 2008 @@ -62,6 +62,7 @@ GlobalPrefix = "_"; PrivateGlobalPrefix = "L"; + LessPrivateGlobalPrefix = "l"; StringConstantPrefix = "\1LC"; BSSSection = 0; // no BSS section ZeroDirective = "\t.space\t"; Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp?rev=55973&r1=55972&r2=55973&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Mon Sep 8 20:21:22 2008 @@ -38,6 +38,7 @@ CommentString = ";"; GlobalPrefix = "_"; PrivateGlobalPrefix = "L"; + LessPrivateGlobalPrefix = "l"; StringConstantPrefix = "\1LC"; ConstantPoolSection = "\t.const\t"; JumpTableDataSection = ".const"; Modified: llvm/trunk/lib/Target/TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetAsmInfo.cpp?rev=55973&r1=55972&r2=55973&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/TargetAsmInfo.cpp Mon Sep 8 20:21:22 2008 @@ -50,6 +50,7 @@ CommentString("#"), GlobalPrefix(""), PrivateGlobalPrefix("."), + LessPrivateGlobalPrefix(""), JumpTableSpecialLabelPrefix(0), GlobalVarAddrPrefix(""), GlobalVarAddrSuffix(""), Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=55973&r1=55972&r2=55973&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Mon Sep 8 20:21:22 2008 @@ -136,6 +136,7 @@ Data64bitsDirective = 0; // we can't emit a 64-bit unit ZeroDirective = "\t.space\t"; // ".space N" emits N zeros. PrivateGlobalPrefix = "L"; // Marker for constant pool idxs + LessPrivateGlobalPrefix = "l"; // Marker for some ObjC metadata BSSSection = 0; // no BSS section. ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill if (DTM->getRelocationModel() != Reloc::Static) From dalej at apple.com Mon Sep 8 20:23:00 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 09 Sep 2008 01:23:00 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55974 - /llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c Message-ID: <200809090123.m891N0E6010280@zion.cs.uiuc.edu> Author: johannes Date: Mon Sep 8 20:22:59 2008 New Revision: 55974 URL: http://llvm.org/viewvc/llvm-project?rev=55974&view=rev Log: Add LOCAL tag. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c?rev=55974&r1=55973&r2=55974&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/powerpc/darwin-abi-1.c Mon Sep 8 20:22:59 2008 @@ -1,5 +1,6 @@ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-options "-O" } */ +/* LLVM LOCAL */ /* { dg-final { scan-assembler "li r3,( )?12345\n\t(bl|jbsr) " } } */ /* Check that zero-size structures don't affect parameter passing. */ From evan.cheng at apple.com Mon Sep 8 20:26:59 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 09 Sep 2008 01:26:59 -0000 Subject: [llvm-commits] [llvm] r55975 - in /llvm/trunk: include/llvm/CodeGen/FastISel.h lib/CodeGen/SelectionDAG/FastISel.cpp lib/Target/X86/X86FastISel.cpp test/CodeGen/X86/fast-isel-mem.ll Message-ID: <200809090126.m891QxJZ010396@zion.cs.uiuc.edu> Author: evancheng Date: Mon Sep 8 20:26:59 2008 New Revision: 55975 URL: http://llvm.org/viewvc/llvm-project?rev=55975&view=rev Log: Fix a constant lowering bug. Now we can do load and store instructions with funky getelementptr embedded in the address operand. Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/lib/Target/X86/X86FastISel.cpp llvm/trunk/test/CodeGen/X86/fast-isel-mem.ll Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/FastISel.h?rev=55975&r1=55974&r2=55975&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/FastISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/FastISel.h Mon Sep 8 20:26:59 2008 @@ -80,6 +80,11 @@ /// be assigned the value for the given LLVM value. unsigned getRegForValue(Value *V); + /// lookUpRegForValue - Look up the value to see if its value is already + /// cached in a register. It may be defined by instructions across blocks or + /// defined locally. + unsigned lookUpRegForValue(Value *V); + virtual ~FastISel(); protected: Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=55975&r1=55974&r2=55975&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Mon Sep 8 20:26:59 2008 @@ -40,6 +40,9 @@ // Don't cache constant materializations. To do so would require // tracking what uses they dominate. Reg = FastEmit_i(VT, VT, ISD::Constant, CI->getZExtValue()); + } else if (isa(V)) { + return TargetMaterializeConstant(dyn_cast(V), + MBB->getParent()->getConstantPool()); } else if (isa(V)) { Reg = FastEmit_i(VT, VT, ISD::Constant, 0); } else if (ConstantFP *CF = dyn_cast(V)) { @@ -85,6 +88,16 @@ return Reg; } +unsigned FastISel::lookUpRegForValue(Value *V) { + // Look up the value to see if we already have a register for it. We + // cache values defined by Instructions across blocks, and other values + // only locally. This is because Instructions already have the SSA + // def-dominatess-use requirement enforced. + if (ValueMap.count(V)) + return ValueMap[V]; + return LocalValueMap[V]; +} + /// UpdateValueMap - Update the value map to include the new mapping for this /// instruction, or insert an extra copy to get the result in a previous /// determined register. Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=55975&r1=55974&r2=55975&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Mon Sep 8 20:26:59 2008 @@ -74,7 +74,8 @@ bool X86FastEmitExtend(ISD::NodeType Opc, MVT DstVT, unsigned Src, MVT SrcVT, unsigned &ResultReg); - bool X86SelectConstAddr(Value *V, unsigned &Op0, bool isCall = false); + bool X86SelectConstAddr(Value *V, unsigned &Op0, + bool isCall = false, bool inReg = false); bool X86SelectLoad(Instruction *I); @@ -285,7 +286,8 @@ /// X86SelectConstAddr - Select and emit code to materialize constant address. /// -bool X86FastISel::X86SelectConstAddr(Value *V, unsigned &Op0, bool isCall) { +bool X86FastISel::X86SelectConstAddr(Value *V, unsigned &Op0, + bool isCall, bool inReg) { // FIXME: Only GlobalAddress for now. GlobalValue *GV = dyn_cast(V); if (!GV) @@ -308,7 +310,24 @@ addFullAddress(BuildMI(MBB, TII.get(Opc), Op0), AM); // Prevent loading GV stub multiple times in same MBB. LocalValueMap[V] = Op0; + } else if (inReg) { + unsigned Opc = 0; + const TargetRegisterClass *RC = NULL; + if (TLI.getPointerTy() == MVT::i32) { + Opc = X86::LEA32r; + RC = X86::GR32RegisterClass; + } else { + Opc = X86::LEA64r; + RC = X86::GR64RegisterClass; + } + Op0 = createResultReg(RC); + X86AddressMode AM; + AM.GV = GV; + addFullAddress(BuildMI(MBB, TII.get(Opc), Op0), AM); + // Prevent materializing GV address multiple times in same MBB. + LocalValueMap[V] = Op0; } + return true; } @@ -323,12 +342,17 @@ return false; Value *V = I->getOperand(1); - unsigned Ptr = getRegForValue(V); - if (Ptr == 0) { - // Handle constant store address. - if (!isa(V) || !X86SelectConstAddr(V, Ptr)) - // Unhandled operand. Halt "fast" selection and bail. - return false; + unsigned Ptr = lookUpRegForValue(V); + if (!Ptr) { + // Handle constant load address. + // FIXME: If load type is something we can't handle, this can result in + // a dead stub load instruction. + if (!isa(V) || !X86SelectConstAddr(V, Ptr)) { + Ptr = getRegForValue(V); + if (Ptr == 0) + // Unhandled operand. Halt "fast" selection and bail. + return false; + } } return X86FastEmitStore(VT, Val, Ptr, 0, V); @@ -342,14 +366,17 @@ return false; Value *V = I->getOperand(0); - unsigned Ptr = getRegForValue(V); - if (Ptr == 0) { + unsigned Ptr = lookUpRegForValue(V); + if (!Ptr) { // Handle constant load address. // FIXME: If load type is something we can't handle, this can result in // a dead stub load instruction. - if (!isa(V) || !X86SelectConstAddr(V, Ptr)) - // Unhandled operand. Halt "fast" selection and bail. - return false; + if (!isa(V) || !X86SelectConstAddr(V, Ptr)) { + Ptr = getRegForValue(V); + if (Ptr == 0) + // Unhandled operand. Halt "fast" selection and bail. + return false; + } } unsigned ResultReg = 0; @@ -917,18 +944,8 @@ if (TM.getRelocationModel() == Reloc::PIC_) return 0; - MVT VT = MVT::getMVT(C->getType(), /*HandleUnknown=*/true); - if (VT == MVT::Other || !VT.isSimple()) - // Unhandled type. Halt "fast" selection and bail. - return false; - if (VT == MVT::iPTR) - // Use pointer type. - VT = TLI.getPointerTy(); - // We only handle legal types. For example, on x86-32 the instruction - // selector contains all of the 64-bit instructions from x86-64, - // under the assumption that i64 won't be used if the target doesn't - // support it. - if (!TLI.isTypeLegal(VT)) + MVT VT; + if (!isTypeLegal(C->getType(), TLI, VT)) return false; // Get opcode and regclass of the output for the given load instruction. @@ -979,9 +996,7 @@ unsigned ResultReg = createResultReg(RC); if (isa(C)) { - // FIXME: If store value type is something we can't handle, this can result - // in a dead stub load instruction. - if (X86SelectConstAddr(C, ResultReg)) + if (X86SelectConstAddr(C, ResultReg, false, true)) return ResultReg; return 0; } Modified: llvm/trunk/test/CodeGen/X86/fast-isel-mem.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-mem.ll?rev=55975&r1=55974&r2=55975&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-mem.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel-mem.ll Mon Sep 8 20:26:59 2008 @@ -1,5 +1,7 @@ -; RUN: llvm-as < %s | llc -fast-isel -mtriple=i386-apple-darwin -mattr=sse2 | \ -; RUN: grep mov | grep lazy_ptr | count 1 +; RUN: llvm-as < %s | llc -fast-isel -mtriple=i386-apple-darwin | \ +; RUN: grep mov | grep lazy_ptr | count 2 +; RUN: llvm-as < %s | llc -fast-isel -march=x86 -relocation-model=static | \ +; RUN: grep lea @src = external global i32 @@ -8,6 +10,15 @@ %0 = load i32* @src, align 4 %1 = load i32* @src, align 4 %2 = add i32 %0, %1 - store i32 %2, i32* @src + store i32 %2, i32* @src ret i32 %2 } + +%stuff = type { i32 (...)** } + at LotsStuff = external constant [4 x i32 (...)*] + +define void @t(%stuff* %this) nounwind { +entry: + store i32 (...)** getelementptr ([4 x i32 (...)*]* @LotsStuff, i32 0, i32 2), i32 (...)*** null, align 4 + ret void +} From gohman at apple.com Mon Sep 8 21:08:49 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 09 Sep 2008 02:08:49 -0000 Subject: [llvm-commits] [llvm] r55976 - in /llvm/trunk: lib/Bitcode/Reader/BitcodeReader.cpp test/Assembler/vector-select.ll Message-ID: <200809090208.m8928oEY011663@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 21:08:49 2008 New Revision: 55976 URL: http://llvm.org/viewvc/llvm-project?rev=55976&view=rev Log: Temporarily disable vector select in the bitcode reader. The way it handles the type of the condition is breaking plain scalar select in the case that the value is a forward-reference. Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/test/Assembler/vector-select.ll Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=55976&r1=55975&r2=55976&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon Sep 8 21:08:49 2008 @@ -1499,7 +1499,7 @@ Value *TrueVal, *FalseVal, *Cond; if (getValueTypePair(Record, OpNum, NextValueNo, TrueVal) || getValue(Record, OpNum, TrueVal->getType(), FalseVal) || - getValue(Record, OpNum, 0 /*skip type check*/, Cond)) + getValue(Record, OpNum, Type::Int1Ty, Cond)) return Error("Invalid SELECT record"); // select condition can be either i1 or [N x i1] Modified: llvm/trunk/test/Assembler/vector-select.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/vector-select.ll?rev=55976&r1=55975&r2=55976&view=diff ============================================================================== --- llvm/trunk/test/Assembler/vector-select.ll (original) +++ llvm/trunk/test/Assembler/vector-select.ll Mon Sep 8 21:08:49 2008 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep select +; XFAIL: * ; rudimentary test of select on vectors returning vector of bool define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b, From gohman at apple.com Mon Sep 8 21:31:57 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 8 Sep 2008 19:31:57 -0700 Subject: [llvm-commits] LLVM IR change for review or committal - resubmitted In-Reply-To: <1220909802.23229.50.camel@Remington> References: <1220644043.23229.30.camel@Remington> <1220886601.23229.38.camel@Remington> <1220909802.23229.50.camel@Remington> Message-ID: On Sep 8, 2008, at 2:36 PM, Preston Gurd wrote: > On Mon, 2008-08-09 at 14:35 -0400, Dan Gohman wrote: >> Hi Preston, >> >> This looks good to me. > > Great! > >> >> The FUNC_CODE_INST_VCMP thing is a little counter-intuitive. I guess >> it's necessary in order to remain compatible with exiting vector >> FUNC_CODE_INST_CMP usage though, right? > > Correct. Since FUNC_CODE_INST_CMP with vector arguments is used for > the > vfcmp and vicmp instructions, it was necessary to add > FUNC_CODE_INST_VCMP to support the vector forms of fcmp/icmp. It would > probably have made more sense in the bitcode reader/writer to switch > vicmp/vfcmp to use a newly defined bitcode operator, but I did not > because it seemed likely that it would break existing code. > >> >> Thanks! >> >> Dan > > You are most welcome! Please commit the patch when you have a chance. I've now committed it. However, there's a problem with the bitcode reader change for vector select, so I reverted that part of it for now. The problem is that the trick of passing 0 for the type to getValue doesn't work if the value is being forward-referenced. This comes up in the following tests, for example: SingleSource/Benchmarks/McGill/misr MultiSource/Applications/d The bitcode reader fails saying "Invalid SELECT record". Because a select with vector left and right values can have either an i1 or a vector-of-i1 condition, it looks like we need to introduce another BitCode opcode to solve this. I think the way to do it is to have a new opcode with which we explicitly store the type of the condition. This way, it could someday also be used when the condition is i1, and we could phase out FUNC_CODE_INST_SELECT and just use the new opcode for everything. On that note, it might also make sense to rename FUNC_CODE_INST_VCMP to FUNC_CODE_INST_CMP2 (following the example of FUNC_CODE_INST_STORE2) and eventually migrate to a situation where vfcmp/vicmp use the old FUNC_CODE_INST_CMP and both vector and scalar fcmp/icmp use the new FUNC_CODE_INST_CMP2. What do you think? Dan From gohman at apple.com Mon Sep 8 21:40:05 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 09 Sep 2008 02:40:05 -0000 Subject: [llvm-commits] [llvm] r55977 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200809090240.m892e6mr012667@zion.cs.uiuc.edu> Author: djg Date: Mon Sep 8 21:40:04 2008 New Revision: 55977 URL: http://llvm.org/viewvc/llvm-project?rev=55977&view=rev Log: Remove the code that protected FastISel from aborting in the case of loads, stores, and conditional branches. It can handle those now, so any that aren't handled should trigger the abort. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=55977&r1=55976&r2=55977&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Sep 8 21:40:04 2008 @@ -760,8 +760,7 @@ continue; // Then handle certain instructions as single-LLVM-Instruction blocks. - if (isa(BI) || isa(BI) || - isa(BI)) { + if (isa(BI)) { if (BI->getType() != Type::VoidTy) { unsigned &R = FuncInfo->ValueMap[BI]; if (!R) @@ -774,9 +773,7 @@ if (!DisableFastISelAbort && // For now, don't abort on non-conditional-branch terminators. - (!isa(BI) || - (isa(BI) && - cast(BI)->isUnconditional()))) { + (!isa(BI) || isa(BI))) { // The "fast" selector couldn't handle something and bailed. // For the purpose of debugging, just abort. #ifndef NDEBUG From evan.cheng at apple.com Tue Sep 9 01:11:27 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 09 Sep 2008 06:11:27 -0000 Subject: [llvm-commits] [llvm] r55979 - in /llvm/trunk/tools/bugpoint: ToolRunner.cpp ToolRunner.h Message-ID: <200809090611.m896BRai019128@zion.cs.uiuc.edu> Author: evancheng Date: Tue Sep 9 01:11:26 2008 New Revision: 55979 URL: http://llvm.org/viewvc/llvm-project?rev=55979&view=rev Log: Allow use of ssh to perform remote execution. Modified: llvm/trunk/tools/bugpoint/ToolRunner.cpp llvm/trunk/tools/bugpoint/ToolRunner.h Modified: llvm/trunk/tools/bugpoint/ToolRunner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ToolRunner.cpp?rev=55979&r1=55978&r2=55979&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ToolRunner.cpp (original) +++ llvm/trunk/tools/bugpoint/ToolRunner.cpp Tue Sep 9 01:11:26 2008 @@ -25,12 +25,20 @@ namespace { cl::opt - RSHHost("rsh-host", - cl::desc("Remote execution (rsh) host")); + RemoteClient("remote-client", + cl::desc("Remote execution client (rsh/ssh)")); cl::opt - RSHUser("rsh-user", - cl::desc("Remote execution (rsh) user id")); + RemoteHost("remote-host", + cl::desc("Remote execution (rsh/ssh) host")); + + cl::opt + RemoteUser("remote-user", + cl::desc("Remote execution (rsh/ssh) user id")); + + cl::opt + RemoteExtra("remote-extra-options", + cl::desc("Remote execution (rsh/ssh) extra options")); } ToolExecutionError::~ToolExecutionError() throw() { } @@ -597,13 +605,16 @@ std::vector ProgramArgs; - if (RSHPath.isEmpty()) + if (RemoteClientPath.isEmpty()) ProgramArgs.push_back(OutputBinary.c_str()); else { - ProgramArgs.push_back(RSHPath.c_str()); - ProgramArgs.push_back(RSHHost.c_str()); + ProgramArgs.push_back(RemoteClientPath.c_str()); + ProgramArgs.push_back(RemoteHost.c_str()); ProgramArgs.push_back("-l"); - ProgramArgs.push_back(RSHUser.c_str()); + ProgramArgs.push_back(RemoteUser.c_str()); + if (!RemoteExtra.empty()) { + ProgramArgs.push_back(RemoteExtra.c_str()); + } char* env_pwd = getenv("PWD"); std::string Exec = "cd "; @@ -628,12 +639,12 @@ FileRemover OutputBinaryRemover(OutputBinary); - if (RSHPath.isEmpty()) + if (RemoteClientPath.isEmpty()) return RunProgramWithTimeout(OutputBinary, &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), Timeout, MemoryLimit); else - return RunProgramWithTimeout(sys::Path(RSHPath), &ProgramArgs[0], + return RunProgramWithTimeout(sys::Path(RemoteClientPath), &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), Timeout, MemoryLimit); } @@ -721,10 +732,10 @@ return 0; } - sys::Path RSHPath; - if (!RSHHost.empty()) - RSHPath = FindExecutable("rsh", ProgramPath); + sys::Path RemoteClientPath; + if (!RemoteClient.empty()) + RemoteClientPath = FindExecutable(RemoteClient.c_str(), ProgramPath); Message = "Found gcc: " + GCCPath.toString() + "\n"; - return new GCC(GCCPath, RSHPath); + return new GCC(GCCPath, RemoteClientPath); } Modified: llvm/trunk/tools/bugpoint/ToolRunner.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ToolRunner.h?rev=55979&r1=55978&r2=55979&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ToolRunner.h (original) +++ llvm/trunk/tools/bugpoint/ToolRunner.h Tue Sep 9 01:11:26 2008 @@ -44,9 +44,9 @@ // class GCC { sys::Path GCCPath; // The path to the gcc executable - sys::Path RSHPath; // The path to the rsh executable - GCC(const sys::Path &gccPath, const sys::Path &rshPath) - : GCCPath(gccPath), RSHPath(rshPath) { } + sys::Path RemoteClientPath; // The path to the rsh / ssh executable + GCC(const sys::Path &gccPath, const sys::Path &RemotePath) + : GCCPath(gccPath), RemoteClientPath(RemotePath) { } public: enum FileType { AsmFile, CFile }; From evan.cheng at apple.com Tue Sep 9 01:12:33 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 09 Sep 2008 06:12:33 -0000 Subject: [llvm-commits] [test-suite] r55980 - in /test-suite/trunk: Makefile.programs RunSafely.sh Message-ID: <200809090612.m896CXBd019181@zion.cs.uiuc.edu> Author: evancheng Date: Tue Sep 9 01:12:33 2008 New Revision: 55980 URL: http://llvm.org/viewvc/llvm-project?rev=55980&view=rev Log: Allow use of ssh to perform remote execution. Modified: test-suite/trunk/Makefile.programs test-suite/trunk/RunSafely.sh Modified: test-suite/trunk/Makefile.programs URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=55980&r1=55979&r2=55980&view=diff ============================================================================== --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Tue Sep 9 01:12:33 2008 @@ -86,10 +86,21 @@ RUNSAFELY := $(PROGDIR)/RunSafelyAndStable.sh $(RUNTIMELIMIT) $(EXIT_OK) else ifdef REMOTE_HOST +ifndef REMOTE_CLIENT +REMOTE_CLIENT := rsh +endif ifdef REMOTE_USER -RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) -l $(REMOTE_USER) $(RUNTIMELIMIT) $(EXIT_OK) +ifdef REMOTE_OPTIONS +RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) -l $(REMOTE_USER) -rc $(REMOTE_CLIENT) -ro "$(REMOTE_OPTIONS)" $(RUNTIMELIMIT) $(EXIT_OK) +else +RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) -l $(REMOTE_USER) -rc $(REMOTE_CLIENT) $(RUNTIMELIMIT) $(EXIT_OK) +endif else -RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) $(RUNTIMELIMIT) $(EXIT_OK) +ifdef REMOTE_OPTIONS +RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) -rc $(REMOTE_CLIENT) -ro "$(REMOTE_OPTIONS)" $(RUNTIMELIMIT) $(EXIT_OK) +else +RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) -rc $(REMOTE_CLIENT) $(RUNTIMELIMIT) $(EXIT_OK) +endif endif else RUNSAFELY := $(PROGDIR)/RunSafely.sh $(RUNTIMELIMIT) $(EXIT_OK) Modified: test-suite/trunk/RunSafely.sh URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/RunSafely.sh?rev=55980&r1=55979&r2=55980&view=diff ============================================================================== --- test-suite/trunk/RunSafely.sh (original) +++ test-suite/trunk/RunSafely.sh Tue Sep 9 01:12:33 2008 @@ -22,12 +22,14 @@ # # Syntax: # -# RunSafely.sh [-r ] [-l ] +# RunSafely.sh [-r ] [-l ] [-rc ] [-ro ] # # # where: # is the remote host to execute the program # is the username on the remote host +# is the remote client used to execute the program +# is the extra options passed to the remote client # is the maximum number of seconds to let the run # is 1 if the program must exit with 0 return code # is a file from which standard input is directed @@ -44,7 +46,8 @@ RHOST= RUSER=`id -un` -FLAG=$1 +RCLIENT=rsh +ROPTIONS="" if [ $1 = "-r" ]; then RHOST=$2 shift 2 @@ -53,6 +56,14 @@ RUSER=$2 shift 2 fi +if [ $1 = "-rc" ]; then + RCLIENT=$2 + shift 2 +fi +if [ $1 = "-ro" ]; then + ROPTIONS=$2 + shift 2 +fi ULIMIT=$1 EXITOK=$2 @@ -119,8 +130,8 @@ echo "$ULIMITCMD cd $PWD; (time -p ($COMMAND > $OUTFILE.remote 2>&1 < $INFILE;); echo exit $?) > $OUTFILE.remote.time 2>&1" > "$PWD/${PROGRAM}.command" chmod +x "$PWD/${PROGRAM}.command" - ( rsh -l $RUSER $RHOST "ls $PWD/${PROGRAM}.command" ) > /dev/null 2>&1 - ( rsh -l $RUSER $RHOST "$PWD/${PROGRAM}.command" ) + ( $RCLIENT -l $RUSER $RHOST $ROPTIONS "ls $PWD/${PROGRAM}.command" ) > /dev/null 2>&1 + ( $RCLIENT -l $RUSER $RHOST $ROPTIONS "$PWD/${PROGRAM}.command" ) cat $OUTFILE.remote.time | awk -- '\ BEGIN { cpu = 0.0; } /^user/ { cpu += $2; print; } From evan.cheng at apple.com Tue Sep 9 01:24:43 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 09 Sep 2008 06:24:43 -0000 Subject: [llvm-commits] [test-suite] r55981 - /test-suite/trunk/Makefile.programs Message-ID: <200809090624.m896OhGA019516@zion.cs.uiuc.edu> Author: evancheng Date: Tue Sep 9 01:24:43 2008 New Revision: 55981 URL: http://llvm.org/viewvc/llvm-project?rev=55981&view=rev Log: Need -fast-isel-no-abort in addition to -fast-isel or a whole bunch of tests will fail. 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=55981&r1=55980&r2=55981&view=diff ============================================================================== --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Tue Sep 9 01:24:43 2008 @@ -231,7 +231,7 @@ LLCBETAOPTION := -sched=simple endif ifeq ($(ARCH),x86) -LLCBETAOPTION := -fast-isel +LLCBETAOPTION := -fast-isel -fast-isel-no-abort #-aggressive-remat #-machine-licm #-new-spilling-heuristic From resistor at mac.com Tue Sep 9 01:32:02 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 09 Sep 2008 06:32:02 -0000 Subject: [llvm-commits] [llvm] r55982 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Message-ID: <200809090632.m896W23I019720@zion.cs.uiuc.edu> Author: resistor Date: Tue Sep 9 01:32:02 2008 New Revision: 55982 URL: http://llvm.org/viewvc/llvm-project?rev=55982&view=rev Log: Check for type legality before materializing integer constants in fast isel. With this change, all of MultiSource/Applications passes on Darwin/X86 under FastISel. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=55982&r1=55981&r2=55982&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Tue Sep 9 01:32:02 2008 @@ -39,6 +39,8 @@ MBB->getParent()->getConstantPool()); // Don't cache constant materializations. To do so would require // tracking what uses they dominate. + if (!TLI.isTypeLegal(VT)) + return false; Reg = FastEmit_i(VT, VT, ISD::Constant, CI->getZExtValue()); } else if (isa(V)) { return TargetMaterializeConstant(dyn_cast(V), From evan.cheng at apple.com Tue Sep 9 01:52:20 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 8 Sep 2008 23:52:20 -0700 Subject: [llvm-commits] [llvm] r55982 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp In-Reply-To: <200809090632.m896W23I019720@zion.cs.uiuc.edu> References: <200809090632.m896W23I019720@zion.cs.uiuc.edu> Message-ID: <0F98DE27-F96A-4624-942D-BE8770725E60@apple.com> Nice. I was about to check in the same fix. :-) The only MultiSource test that's still failing for me is ASCI_Purple/ SMG2000. Evan On Sep 8, 2008, at 11:32 PM, Owen Anderson wrote: > Author: resistor > Date: Tue Sep 9 01:32:02 2008 > New Revision: 55982 > > URL: http://llvm.org/viewvc/llvm-project?rev=55982&view=rev > Log: > Check for type legality before materializing integer constants in > fast isel. With this change, > all of MultiSource/Applications passes on Darwin/X86 under FastISel. > > Modified: > llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=55982&r1=55981&r2=55982&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Tue Sep 9 > 01:32:02 2008 > @@ -39,6 +39,8 @@ > MBB->getParent()- > >getConstantPool()); > // Don't cache constant materializations. To do so would require > // tracking what uses they dominate. > + if (!TLI.isTypeLegal(VT)) > + return false; > Reg = FastEmit_i(VT, VT, ISD::Constant, CI->getZExtValue()); > } else if (isa(V)) { > return TargetMaterializeConstant(dyn_cast(V), > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Tue Sep 9 01:54:52 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 8 Sep 2008 23:54:52 -0700 Subject: [llvm-commits] [llvm] r55982 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp In-Reply-To: <200809090632.m896W23I019720@zion.cs.uiuc.edu> References: <200809090632.m896W23I019720@zion.cs.uiuc.edu> Message-ID: <63267043-4AE8-4691-9AA4-FEA322A84AD1@apple.com> Actually my patch isn't quite the same. :-) Why is the check only needed for ConstantInt? Isn't it needed for all cases. Also, why do you return "false" when the function is supposed to return an unsigned? I think the check should be here: MVT::SimpleValueType VT = TLI.getValueType(V- >getType()).getSimpleVT(); if (!TLI.isTypeLegal(VT)) return 0; What do you think? Evan On Sep 8, 2008, at 11:32 PM, Owen Anderson wrote: > Author: resistor > Date: Tue Sep 9 01:32:02 2008 > New Revision: 55982 > > URL: http://llvm.org/viewvc/llvm-project?rev=55982&view=rev > Log: > Check for type legality before materializing integer constants in > fast isel. With this change, > all of MultiSource/Applications passes on Darwin/X86 under FastISel. > > Modified: > llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=55982&r1=55981&r2=55982&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Tue Sep 9 > 01:32:02 2008 > @@ -39,6 +39,8 @@ > MBB->getParent()- > >getConstantPool()); > // Don't cache constant materializations. To do so would require > // tracking what uses they dominate. > + if (!TLI.isTypeLegal(VT)) > + return false; > Reg = FastEmit_i(VT, VT, ISD::Constant, CI->getZExtValue()); > } else if (isa(V)) { > return TargetMaterializeConstant(dyn_cast(V), > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From baldrick at free.fr Tue Sep 9 02:06:00 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 9 Sep 2008 09:06:00 +0200 Subject: [llvm-commits] [llvm] r55922 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp In-Reply-To: <200809081656.m88GuBSm011807@zion.cs.uiuc.edu> References: <200809081656.m88GuBSm011807@zion.cs.uiuc.edu> Message-ID: <200809090906.01386.baldrick@free.fr> Hi Daniel, > -struct SDISelAsmOperandInfo : public TargetLowering::AsmOperandInfo { > +struct VISIBILITY_HIDDEN SDISelAsmOperandInfo : public TargetLowering::AsmOperandInfo { thanks for fixing this. Unfortunately this line is too long (> 80 columns)... Ciao, Duncan. From anton at korobeynikov.info Tue Sep 9 03:02:42 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Tue, 9 Sep 2008 12:02:42 +0400 Subject: [llvm-commits] [llvm] r55973 - in /llvm/trunk: include/llvm/Target/TargetAsmInfo.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/Target/ARM/ARMTargetAsmInfo.cpp lib/Target/PowerPC/PPCTargetAsmInfo.cpp lib/Target/TargetAsmInfo.cpp lib/Target/X86/X86Ta Message-ID: Hi, Dale > the magic 'l' prefix for symbols on Darwin which are > to be passed through the assembler, then removed at > linktime (previously all references to this had been > hidden in the ObjC FE code, oh well). Sorry for bothering you again, but changing semantics of llvm.used in such target- and language- specific way is a bit... uhm... questionable. I know, that objc fe is very fragile, but can't it be fixed in such way? Also, could you please show and example, when the change you introduced is needed? If fe cannot be fixed, why don't leave generic code in place and just override it in asmprinters? I think you can introduce new hook inside DarwinTargetAssemblerInfo to control 'dead code stripping directive emission' and handle everything without need to introduce some objc-related things into generic TAI. Does this sound reasonable? -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From baldrick at free.fr Tue Sep 9 03:07:28 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 9 Sep 2008 10:07:28 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r55796 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <106476C8-8DBF-4B11-9595-FEDA920E40AD@apple.com> References: <200809042123.m84LNekC013647@zion.cs.uiuc.edu> <200809061907.24993.baldrick@free.fr> <106476C8-8DBF-4B11-9595-FEDA920E40AD@apple.com> Message-ID: <200809091007.28699.baldrick@free.fr> > > Hi Dale, thinking about this more, I started wondering > > why you want to produce llvm.pow and friends at all. > > Does it actually bring any advantage? > > Functionally, no, the point is to get C semantics out of the optimizers. Well, given that you have several versions of each routine (eg: pow that writes errno, pow that does not write errno but uses the rounding mode, pow that does not write errno and does not use the rounding mode), that makes for a lot of intrinsics! Don't forget that SimplifyLibcalls performs simplifications that apply to all those different pow variants. That said, I think it is useful to distinguish between SimplifyLibcalls (SLC) and the rest of the compiler. The SLC pass is special in that it only exists to muck around with the standard system library, so it's not unreasonable that it recognizes standard library functions. It can always be turned off (llvm-gcc has logic for that). So, excluding SLC, what about the rest of the compiler? Well, ConstantFolding.cpp will constant fold a range of libcalls too. That's not so great - something should be done about this (not sure what). Probably llvm-gcc's logic should turn this off too, but it currently doesn't... The other place is codegen: SelectionDAGBuild.cpp turns several things into SDNodes: not just pow and cos intrinsics but also functions called "cos". Two comments about this: (1) it implies that the llvm intrinsics must be readnone and not readonly; (2) I think the recognizing of names like "sin" should be dropped and only intrinsics used here (this is maybe what you had in mind). Let me explain (1): why an SDNode shouldn't be generated unless the function is readnone. Consider the following program: declare double @cos( double ) readonly nounwind declare void @change_the_rounding_mode() nounwind define double @f(double %X) readonly nounwind { %a = call double @cos( double %X ) readonly nounwind call void @change_the_rounding_mode() nounwind %b = call double @cos( double %X ) readonly nounwind %c = add double %a, %b ret double %c } Then the bitcode optimizers like GVN (correctly) do not remove the second call, even though it is the same as the first, because the change_rounding_mode call may change the result. But codegen does! Here is the result: f: subq $8, %rsp movsd %xmm0, (%rsp) call change_the_rounding_mode movsd (%rsp), %xmm0 call cos addsd %xmm0, %xmm0 addq $8, %rsp ret The reason is simple enough: the call to "cos" is turned into an SDNode, then CSE collapses the two "cos" calls into one. This is only correct if "cos" is readnone. I think things should work like this: (a) codegen should only turn llvm math intrinsics into SDNodes (b) llvm math intrinsics should be readnone (c) llvm-gcc should generate an llvm intrinsic for a gcc builtin only when the builtin is "const" (= readnone). (d) maybe SimplifyLibcalls should also automagically turn readnone calls to "cos" etc into calls to llvm.cos etc. Ciao, Duncan. From akyrtzi at gmail.com Tue Sep 9 06:38:44 2008 From: akyrtzi at gmail.com (Argiris Kirtzidis) Date: Tue, 09 Sep 2008 11:38:44 -0000 Subject: [llvm-commits] [llvm] r55985 - in /llvm/trunk/win32: CodeGen/CodeGen.vcproj Transforms/Transforms.vcproj x86/x86.vcproj Message-ID: <200809091138.m89Bcjst012559@zion.cs.uiuc.edu> Author: akirtzidis Date: Tue Sep 9 06:38:37 2008 New Revision: 55985 URL: http://llvm.org/viewvc/llvm-project?rev=55985&view=rev Log: Update VC++ project files. Modified: llvm/trunk/win32/CodeGen/CodeGen.vcproj llvm/trunk/win32/Transforms/Transforms.vcproj llvm/trunk/win32/x86/x86.vcproj Modified: llvm/trunk/win32/CodeGen/CodeGen.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/CodeGen/CodeGen.vcproj?rev=55985&r1=55984&r2=55985&view=diff ============================================================================== --- llvm/trunk/win32/CodeGen/CodeGen.vcproj (original) +++ llvm/trunk/win32/CodeGen/CodeGen.vcproj Tue Sep 9 06:38:37 2008 @@ -1,7 +1,7 @@ + + @@ -548,6 +552,14 @@ > + + + + Modified: llvm/trunk/win32/Transforms/Transforms.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/Transforms/Transforms.vcproj?rev=55985&r1=55984&r2=55985&view=diff ============================================================================== --- llvm/trunk/win32/Transforms/Transforms.vcproj (original) +++ llvm/trunk/win32/Transforms/Transforms.vcproj Tue Sep 9 06:38:37 2008 @@ -1,7 +1,7 @@ + + @@ -392,6 +396,10 @@ > + + @@ -492,6 +500,10 @@ > + + Modified: llvm/trunk/win32/x86/x86.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/x86/x86.vcproj?rev=55985&r1=55984&r2=55985&view=diff ============================================================================== --- llvm/trunk/win32/x86/x86.vcproj (original) +++ llvm/trunk/win32/x86/x86.vcproj Tue Sep 9 06:38:37 2008 @@ -1,7 +1,7 @@ + + From baldrick at free.fr Tue Sep 9 07:40:50 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 09 Sep 2008 12:40:50 -0000 Subject: [llvm-commits] [llvm] r55987 - in /llvm/trunk: lib/Analysis/IPA/CallGraph.cpp test/Analysis/CallGraph/ test/Analysis/CallGraph/2008-09-09-DirectCall.ll test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll test/Analysis/CallGraph/dg.exp Message-ID: <200809091240.m89Cepbi014677@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 9 07:40:47 2008 New Revision: 55987 URL: http://llvm.org/viewvc/llvm-project?rev=55987&view=rev Log: Correct callgraph construction. It has two problems: (1) code left over from the days of ConstantPointerRef: if a use of a function is a GlobalValue then that is not considered a reason to add an edge from the external node, even though the use may be as an initializer for an externally visible global! There might be some point to this behaviour when the use is by an alias (though the code predated aliases by some centuries), but I think PR2782 is a better way of handling that. (2) If function F calls function G, and also G is a parameter to the call, then an F->G edge is not added to the callgraph. While this doesn't seem to matter much, adding such an edge makes the callgraph more regular. In addition, the new code should be faster as well as simpler. Added: llvm/trunk/test/Analysis/CallGraph/ (with props) llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll llvm/trunk/test/Analysis/CallGraph/dg.exp Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=55987&r1=55986&r2=55987&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Tue Sep 9 07:40:47 2008 @@ -21,14 +21,6 @@ #include using namespace llvm; -/// isOnlyADirectCall - Return true if this callsite is *just* a direct call to -/// the specified function. Specifically return false if the callsite also -/// takes the address of the function. -static bool isOnlyADirectCall(Function *F, CallSite CS) { - if (!CS.getInstruction()) return false; - return !CS.hasArgument(F); -} - namespace { //===----------------------------------------------------------------------===// @@ -137,44 +129,32 @@ if (F->isDeclaration() && !F->isIntrinsic()) Node->addCalledFunction(CallSite(), CallsExternalNode); - // Loop over all of the users of the function... looking for callers... - // + // Loop over all of the users of the function, looking for non-call uses. bool isUsedExternally = false; - for (Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E; ++I){ + for (Value::use_iterator I = F->use_begin(), E = F->use_end(); + I != E && !isUsedExternally; ++I) { if (Instruction *Inst = dyn_cast(*I)) { CallSite CS = CallSite::get(Inst); - if (isOnlyADirectCall(F, CS)) - getOrInsertFunction(Inst->getParent()->getParent()) - ->addCalledFunction(CS, Node); - else - isUsedExternally = true; - } else if (GlobalValue *GV = dyn_cast(*I)) { - for (Value::use_iterator I = GV->use_begin(), E = GV->use_end(); - I != E; ++I) - if (Instruction *Inst = dyn_cast(*I)) { - CallSite CS = CallSite::get(Inst); - if (isOnlyADirectCall(F, CS)) - getOrInsertFunction(Inst->getParent()->getParent()) - ->addCalledFunction(CS, Node); - else - isUsedExternally = true; - } else { - isUsedExternally = true; - } - } else { // Can't classify the user! + isUsedExternally = !CS.getInstruction() || CS.hasArgument(F); + } else { // User is not a direct call! isUsedExternally = true; } } if (isUsedExternally) ExternalCallingNode->addCalledFunction(CallSite(), Node); - // Look for an indirect function call. + // Look for calls by this function. for (Function::iterator BB = F->begin(), BBE = F->end(); BB != BBE; ++BB) for (BasicBlock::iterator II = BB->begin(), IE = BB->end(); II != IE; ++II) { - CallSite CS = CallSite::get(II); - if (CS.getInstruction() && !CS.getCalledFunction()) - Node->addCalledFunction(CS, CallsExternalNode); + CallSite CS = CallSite::get(II); + if (CS.getInstruction()) { + const Function *Callee = CS.getCalledFunction(); + if (Callee) + Node->addCalledFunction(CS, getOrInsertFunction(Callee)); + else + Node->addCalledFunction(CS, CallsExternalNode); + } } } Propchange: llvm/trunk/test/Analysis/CallGraph/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Sep 9 07:40:47 2008 @@ -0,0 +1,3 @@ +Output +*.log +*.sum Added: llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll?rev=55987&view=auto ============================================================================== --- llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll (added) +++ llvm/trunk/test/Analysis/CallGraph/2008-09-09-DirectCall.ll Tue Sep 9 07:40:47 2008 @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | opt -analyze -callgraph -disable-output | grep {Calls function 'callee'} | count 2 + +define internal void @callee(...) { +entry: + unreachable +} + +define void @caller() { +entry: + call void (...)* @callee( void (...)* @callee ) + unreachable +} Added: llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll?rev=55987&view=auto ============================================================================== --- llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll (added) +++ llvm/trunk/test/Analysis/CallGraph/2008-09-09-UsedByGlobal.ll Tue Sep 9 07:40:47 2008 @@ -0,0 +1,7 @@ +; RUN: llvm-as < %s | opt -analyze -callgraph -disable-output | grep {Calls function} + + at a = global void ()* @f ; [#uses=0] + +define internal void @f() { + unreachable +} Added: llvm/trunk/test/Analysis/CallGraph/dg.exp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CallGraph/dg.exp?rev=55987&view=auto ============================================================================== --- llvm/trunk/test/Analysis/CallGraph/dg.exp (added) +++ llvm/trunk/test/Analysis/CallGraph/dg.exp Tue Sep 9 07:40:47 2008 @@ -0,0 +1,3 @@ +load_lib llvm.exp + +RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] From baldrick at free.fr Tue Sep 9 08:44:28 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 09 Sep 2008 13:44:28 -0000 Subject: [llvm-commits] [llvm] r55988 - /llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Message-ID: <200809091344.m89DiTwB016580@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 9 08:44:24 2008 New Revision: 55988 URL: http://llvm.org/viewvc/llvm-project?rev=55988&view=rev Log: Optimization suggested by Matthijs Kooijman. Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=55988&r1=55987&r2=55988&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Tue Sep 9 08:44:24 2008 @@ -135,7 +135,8 @@ I != E && !isUsedExternally; ++I) { if (Instruction *Inst = dyn_cast(*I)) { CallSite CS = CallSite::get(Inst); - isUsedExternally = !CS.getInstruction() || CS.hasArgument(F); + // Not a call? Or F being passed as a parameter not as the callee? + isUsedExternally = !CS.getInstruction() || I.getOperandNo(); } else { // User is not a direct call! isUsedExternally = true; } From criswell at cs.uiuc.edu Tue Sep 9 10:16:29 2008 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue, 9 Sep 2008 10:16:29 -0500 Subject: [llvm-commits] CVS: llvm-www/Users.html Message-ID: <200809091516.m89FGTLd024621@maute.cs.uiuc.edu> Changes in directory llvm-www: Users.html updated: 1.35 -> 1.36 --- Log message: Added Electronic Arts to the Commercial Users list. Added Python Bindings for LLVM to the Open Source List. --- Diffs of the changes: (+19 -2) Users.html | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) Index: llvm-www/Users.html diff -u llvm-www/Users.html:1.35 llvm-www/Users.html:1.36 --- llvm-www/Users.html:1.35 Sun Aug 17 12:39:37 2008 +++ llvm-www/Users.html Tue Sep 9 10:15:18 2008 @@ -71,6 +71,12 @@ Backend for the Cray Cascade Compiler + + + Electronic Arts + Experimental backend for custom language implementation + + Hue AS @@ -308,23 +314,34 @@ PyPy Project Python interpreter written in Python. Targets LLVM and C. + Faust Signal Processing Language Signal processing language, uses the LLVM JIT for runtime codegen. + + iPhone tool chain llvm-gcc Compiler for iPhone Dev Wiki toolchain. - + IOQuake3 IOQuake3 Raytracing Patch, uses LLVM for runtime shader compilation. + + + + + llvm-pty: Python Bindings for LLVM + Python bindings for LLVM. + + @@ -339,6 +356,6 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
    LLVM Development List
    - Last modified: $Date: 2008/08/17 17:39:37 $ + Last modified: $Date: 2008/09/09 15:15:18 $ From dpatel at apple.com Tue Sep 9 12:15:52 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 9 Sep 2008 10:15:52 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r55796 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200809091007.28699.baldrick@free.fr> References: <200809042123.m84LNekC013647@zion.cs.uiuc.edu> <200809061907.24993.baldrick@free.fr> <106476C8-8DBF-4B11-9595-FEDA920E40AD@apple.com> <200809091007.28699.baldrick@free.fr> Message-ID: <12233C4B-4E84-4859-A646-B699A3A17A6C@apple.com> On Sep 9, 2008, at 1:07 AM, Duncan Sands wrote: > Well, ConstantFolding.cpp will constant fold a range of > libcalls too. That's not so great - something should be > done about this (not sure what). Probably llvm-gcc's > logic should turn this off too, but it currently doesn't... IMO, depending on llvm-gcc to not use ConstantFolding is not a good idea. The info. should be encoded in LLVM IR. - Devang From ggreif at gmail.com Tue Sep 9 12:52:17 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 09 Sep 2008 17:52:17 -0000 Subject: [llvm-commits] [llvm] r55992 - /llvm/trunk/include/llvm/CodeGen/ValueTypes.h Message-ID: <200809091752.m89HqIfp025393@zion.cs.uiuc.edu> Author: ggreif Date: Tue Sep 9 12:52:13 2008 New Revision: 55992 URL: http://llvm.org/viewvc/llvm-project?rev=55992&view=rev Log: fit in 80 cols, minor tweaks Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.h?rev=55992&r1=55991&r2=55992&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ValueTypes.h (original) +++ llvm/trunk/include/llvm/CodeGen/ValueTypes.h Tue Sep 9 12:52:13 2008 @@ -29,7 +29,7 @@ enum SimpleValueType { // If you change this numbering, you must change the values in - // ValueTypes.td well! + // ValueTypes.td as well! Other = 0, // This is a non-standard value i1 = 1, // This is a 1 bit integer value i8 = 2, // This is an 8 bit integer value @@ -103,10 +103,11 @@ /// Extended types are either vector types or arbitrary precision integers. /// Arbitrary precision integers have iAny in the first SimpleTypeBits bits, /// and the bit-width in the next PrecisionBits bits, offset by minus one. - /// Vector types are encoded by having the first SimpleTypeBits+PrecisionBits - /// bits encode the vector element type (which must be a scalar type, possibly - /// an arbitrary precision integer) and the remaining VectorBits upper bits - /// encode the vector length, offset by one. + /// Vector types are encoded by having the first + /// SimpleTypeBits+PrecisionBits bits encode the vector element type + /// (which must be a scalar type, possibly an arbitrary precision integer) + /// and the remaining VectorBits upper bits encode the vector length, offset + /// by one. /// /// 32--------------16-----------8-------------0 /// | Vector length | Precision | Simple type | @@ -136,7 +137,7 @@ public: MVT() {} - MVT(SimpleValueType S) { V = S; } + MVT(SimpleValueType S) : V(S) {} inline bool operator== (const MVT VT) const { return V == VT.V; } inline bool operator!= (const MVT VT) const { return V != VT.V; } From dpatel at apple.com Tue Sep 9 12:56:50 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 09 Sep 2008 17:56:50 -0000 Subject: [llvm-commits] [llvm] r55993 - /llvm/trunk/lib/VMCore/PassManager.cpp Message-ID: <200809091756.m89HuoLs025554@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 9 12:56:50 2008 New Revision: 55993 URL: http://llvm.org/viewvc/llvm-project?rev=55993&view=rev Log: Simplify. Fix outdated comment. Modified: llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=55993&r1=55992&r2=55993&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Tue Sep 9 12:56:50 2008 @@ -1590,7 +1590,7 @@ void FunctionPass::assignPassManager(PMStack &PMS, PassManagerType PreferredType) { - // Find Module Pass Manager (TODO : Or Call Graph Pass Manager) + // Find Module Pass Manager while(!PMS.empty()) { if (PMS.top()->getPassManagerType() > PMT_FunctionPassManager) PMS.pop(); @@ -1614,13 +1614,7 @@ // [3] Assign manager to manage this new manager. This may create // and push new managers into PMS - - // If Call Graph Pass Manager is active then use it to manage - // this new Function Pass manager. - if (PMD->getPassManagerType() == PMT_CallGraphPassManager) - FPP->assignPassManager(PMS, PMT_CallGraphPassManager); - else - FPP->assignPassManager(PMS); + FPP->assignPassManager(PMS, PMD->getPassManagerType()); // [4] Push new manager into PMS PMS.push(FPP); From gohman at apple.com Tue Sep 9 13:11:14 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 09 Sep 2008 18:11:14 -0000 Subject: [llvm-commits] [llvm] r55995 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/pr2645.ll Message-ID: <200809091811.m89IBFYx026037@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 9 13:11:14 2008 New Revision: 55995 URL: http://llvm.org/viewvc/llvm-project?rev=55995&view=rev Log: Make SimplifyDemandedVectorElts simplify vectors with multiple users, and teach it about shufflevector instructions. Also, fix a subtle bug in SimplifyDemandedVectorElts' insertelement code. This is a patch that was originally written by Eli Friedman, with some fixes and cleanup by me. Added: llvm/trunk/test/Transforms/InstCombine/pr2645.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=55995&r1=55994&r2=55995&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Sep 9 13:11:14 2008 @@ -1355,8 +1355,7 @@ unsigned VWidth = cast(V->getType())->getNumElements(); assert(VWidth <= 64 && "Vector too wide to analyze!"); uint64_t EltMask = ~0ULL >> (64-VWidth); - assert(DemandedElts != EltMask && (DemandedElts & ~EltMask) == 0 && - "Invalid DemandedElts!"); + assert((DemandedElts & ~EltMask) == 0 && "Invalid DemandedElts!"); if (isa(V)) { // If the entire vector is undefined, just return this info. @@ -1400,14 +1399,23 @@ return ConstantVector::get(Elts); } - if (!V->hasOneUse()) { // Other users may use these bits. - if (Depth != 0) { // Not at the root. + // Limit search depth. + if (Depth == 10) + return false; + + // If multiple users are using the root value, procede with + // simplification conservatively assuming that all elements + // are needed. + if (!V->hasOneUse()) { + // Quit if we find multiple users of a non-root value though. + // They'll be handled when it's their turn to be visited by + // the main instcombine process. + if (Depth != 0) // TODO: Just compute the UndefElts information recursively. return false; - } - return false; - } else if (Depth == 10) { // Limit search depth. - return false; + + // Conservatively assume that all elements are needed. + DemandedElts = EltMask; } Instruction *I = dyn_cast(V); @@ -1446,7 +1454,65 @@ if (TmpV) { I->setOperand(0, TmpV); MadeChange = true; } // The inserted element is defined. - UndefElts |= 1ULL << IdxNo; + UndefElts &= ~(1ULL << IdxNo); + break; + } + case Instruction::ShuffleVector: { + ShuffleVectorInst *Shuffle = cast(I); + uint64_t LeftDemanded = 0, RightDemanded = 0; + for (unsigned i = 0; i < VWidth; i++) { + if (DemandedElts & (1ULL << i)) { + unsigned MaskVal = Shuffle->getMaskValue(i); + if (MaskVal != -1u) { + assert(MaskVal < VWidth * 2 && + "shufflevector mask index out of range!"); + if (MaskVal < VWidth) + LeftDemanded |= 1ULL << MaskVal; + else + RightDemanded |= 1ULL << (MaskVal - VWidth); + } + } + } + + TmpV = SimplifyDemandedVectorElts(I->getOperand(0), LeftDemanded, + UndefElts2, Depth+1); + if (TmpV) { I->setOperand(0, TmpV); MadeChange = true; } + + uint64_t UndefElts3; + TmpV = SimplifyDemandedVectorElts(I->getOperand(1), RightDemanded, + UndefElts3, Depth+1); + if (TmpV) { I->setOperand(1, TmpV); MadeChange = true; } + + bool NewUndefElts = false; + for (unsigned i = 0; i < VWidth; i++) { + unsigned MaskVal = Shuffle->getMaskValue(i); + if (MaskVal == -1) { + uint64_t NewBit = 1ULL << i; + UndefElts |= NewBit; + } else if (MaskVal < VWidth) { + uint64_t NewBit = ((UndefElts2 >> MaskVal) & 1) << i; + NewUndefElts |= NewBit; + UndefElts |= NewBit; + } else { + uint64_t NewBit = ((UndefElts3 >> (MaskVal - VWidth)) & 1) << i; + NewUndefElts |= NewBit; + UndefElts |= NewBit; + } + } + + if (NewUndefElts) { + // Add additional discovered undefs. + std::vector Elts; + for (unsigned i = 0; i < VWidth; ++i) { + if (UndefElts & (1ULL << i)) + Elts.push_back(UndefValue::get(Type::Int32Ty)); + else + Elts.push_back(ConstantInt::get(Type::Int32Ty, + Shuffle->getMaskValue(i))); + } + I->setOperand(2, ConstantVector::get(Elts)); + MadeChange = true; + } break; } case Instruction::BitCast: { @@ -11224,31 +11290,13 @@ // Undefined shuffle mask -> undefined value. if (isa(SVI.getOperand(2))) return ReplaceInstUsesWith(SVI, UndefValue::get(SVI.getType())); - - // If we have shuffle(x, undef, mask) and any elements of mask refer to - // the undef, change them to undefs. - if (isa(SVI.getOperand(1))) { - // Scan to see if there are any references to the RHS. If so, replace them - // with undef element refs and set MadeChange to true. - for (unsigned i = 0, e = Mask.size(); i != e; ++i) { - if (Mask[i] >= e && Mask[i] != 2*e) { - Mask[i] = 2*e; - MadeChange = true; - } - } - - if (MadeChange) { - // Remap any references to RHS to use LHS. - std::vector Elts; - for (unsigned i = 0, e = Mask.size(); i != e; ++i) { - if (Mask[i] == 2*e) - Elts.push_back(UndefValue::get(Type::Int32Ty)); - else - Elts.push_back(ConstantInt::get(Type::Int32Ty, Mask[i])); - } - SVI.setOperand(2, ConstantVector::get(Elts)); - } - } + + uint64_t UndefElts; + unsigned VWidth = cast(SVI.getType())->getNumElements(); + uint64_t AllOnesEltMask = ~0ULL >> (64-VWidth); + if (VWidth <= 64 && + SimplifyDemandedVectorElts(&SVI, AllOnesEltMask, UndefElts)) + MadeChange = true; // Canonicalize shuffle(x ,x,mask) -> shuffle(x, undef,mask') // Canonicalize shuffle(undef,x,mask) -> shuffle(x, undef,mask'). Added: llvm/trunk/test/Transforms/InstCombine/pr2645.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/pr2645.ll?rev=55995&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/pr2645.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/pr2645.ll Tue Sep 9 13:11:14 2008 @@ -0,0 +1,33 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {insertelement <4 x float> undef} + +; Instcombine should be able to prove that none of the +; insertelement's first operand's elements are needed. + +define internal void @""(i8*) { +;