From reid at x10sys.com Mon Apr 30 00:12:22 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 30 Apr 2007 00:12:22 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/2006-11-10-DAGCombineMiscompile.ll ispositive.ll vector-identity-shuffle.ll Message-ID: <200704300512.l3U5CM8k031591@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: 2006-11-10-DAGCombineMiscompile.ll added (r1.1) ispositive.ll added (r1.1) vector-identity-shuffle.ll added (r1.1) --- Log message: For PR1370: http://llvm.org/PR1370 : Rearrange some tests so that if PowerPC is not being built we don't try to run PowerPC specific tests. --- Diffs of the changes: (+40 -0) 2006-11-10-DAGCombineMiscompile.ll | 14 ++++++++++++++ ispositive.ll | 10 ++++++++++ vector-identity-shuffle.ll | 16 ++++++++++++++++ 3 files changed, 40 insertions(+) Index: llvm/test/CodeGen/PowerPC/2006-11-10-DAGCombineMiscompile.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/2006-11-10-DAGCombineMiscompile.ll:1.1 *** /dev/null Mon Apr 30 00:12:08 2007 --- llvm/test/CodeGen/PowerPC/2006-11-10-DAGCombineMiscompile.ll Mon Apr 30 00:11:58 2007 *************** *** 0 **** --- 1,14 ---- + ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwimi + + void %test(short %div.0.i.i.i.i, int %L_num.0.i.i.i.i, int %tmp1.i.i206.i.i, short* %P) { + %X = shl short %div.0.i.i.i.i, ubyte 1 ; [#uses=1] + %tmp28.i.i.i.i = shl int %L_num.0.i.i.i.i, ubyte 1 ; [#uses=2] + %tmp31.i.i.i.i = setlt int %tmp28.i.i.i.i, %tmp1.i.i206.i.i ; [#uses=2] + + %tmp31.i.i.i.i = cast bool %tmp31.i.i.i.i to short ; [#uses=1] + %tmp371.i.i.i.i1 = or short %tmp31.i.i.i.i, %X ; [#uses=1] + %div.0.be.i.i.i.i = xor short %tmp371.i.i.i.i1, 1 ; [#uses=1] + store short %div.0.be.i.i.i.i, short* %P + ret void + } + Index: llvm/test/CodeGen/PowerPC/ispositive.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/ispositive.ll:1.1 *** /dev/null Mon Apr 30 00:12:22 2007 --- llvm/test/CodeGen/PowerPC/ispositive.ll Mon Apr 30 00:11:58 2007 *************** *** 0 **** --- 1,10 ---- + ; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | \ + ; RUN: grep {srwi r3, r3, 31} + + define i32 @test1(i32 %X) { + entry: + icmp slt i32 %X, 0 ; :0 [#uses=1] + zext i1 %0 to i32 ; :1 [#uses=1] + ret i32 %1 + } + Index: llvm/test/CodeGen/PowerPC/vector-identity-shuffle.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/vector-identity-shuffle.ll:1.1 *** /dev/null Mon Apr 30 00:12:22 2007 --- llvm/test/CodeGen/PowerPC/vector-identity-shuffle.ll Mon Apr 30 00:11:58 2007 *************** *** 0 **** --- 1,16 ---- + ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep test: + ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vperm + + void %test(<4 x float> *%tmp2.i) { + %tmp2.i = load <4x float>* %tmp2.i + %xFloat0.48 = extractelement <4 x float> %tmp2.i, uint 0 ; [#uses=1] + %inFloat0.49 = insertelement <4 x float> undef, float %xFloat0.48, uint 0 ; <<4 x float>> [#uses=1] + %xFloat1.50 = extractelement <4 x float> %tmp2.i, uint 1 ; [#uses=1] + %inFloat1.52 = insertelement <4 x float> %inFloat0.49, float %xFloat1.50, uint 1 ; <<4 x float>> [#uses=1] + %xFloat2.53 = extractelement <4 x float> %tmp2.i, uint 2 ; [#uses=1] + %inFloat2.55 = insertelement <4 x float> %inFloat1.52, float %xFloat2.53, uint 2 ; <<4 x float>> [#uses=1] + %xFloat3.56 = extractelement <4 x float> %tmp2.i, uint 3 ; [#uses=1] + %inFloat3.58 = insertelement <4 x float> %inFloat2.55, float %xFloat3.56, uint 3 ; <<4 x float>> [#uses=4] + store <4 x float> %inFloat3.58, <4x float>* %tmp2.i + ret void + } From reid at x10sys.com Mon Apr 30 00:12:26 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 30 Apr 2007 00:12:26 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/vector-identity-shuffle.ll 2006-11-10-DAGCombineMiscompile.ll ispositive.ll Message-ID: <200704300512.l3U5CQ8k031596@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: vector-identity-shuffle.ll updated: 1.5 -> 1.6 2006-11-10-DAGCombineMiscompile.ll (r1.2) removed ispositive.ll (r1.5) removed --- Log message: For PR1370: http://llvm.org/PR1370 : Rearrange some tests so that if PowerPC is not being built we don't try to run PowerPC specific tests. --- Diffs of the changes: (+0 -2) vector-identity-shuffle.ll | 2 -- 1 files changed, 2 deletions(-) Index: llvm/test/CodeGen/Generic/vector-identity-shuffle.ll diff -u llvm/test/CodeGen/Generic/vector-identity-shuffle.ll:1.5 llvm/test/CodeGen/Generic/vector-identity-shuffle.ll:1.6 --- llvm/test/CodeGen/Generic/vector-identity-shuffle.ll:1.5 Mon Apr 16 12:36:06 2007 +++ llvm/test/CodeGen/Generic/vector-identity-shuffle.ll Mon Apr 30 00:11:58 2007 @@ -1,5 +1,3 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep test: -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | not grep vperm ; RUN: llvm-upgrade < %s | llvm-as | llc void %test(<4 x float> *%tmp2.i) { From reid at x10sys.com Mon Apr 30 00:12:28 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 30 Apr 2007 00:12:28 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/ispositive.ll Message-ID: <200704300512.l3U5CSHP031606@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: ispositive.ll added (r1.1) --- Log message: For PR1370: http://llvm.org/PR1370 : Rearrange some tests so that if PowerPC is not being built we don't try to run PowerPC specific tests. --- Diffs of the changes: (+10 -0) ispositive.ll | 10 ++++++++++ 1 files changed, 10 insertions(+) Index: llvm/test/CodeGen/ARM/ispositive.ll diff -c /dev/null llvm/test/CodeGen/ARM/ispositive.ll:1.1 *** /dev/null Mon Apr 30 00:12:08 2007 --- llvm/test/CodeGen/ARM/ispositive.ll Mon Apr 30 00:11:58 2007 *************** *** 0 **** --- 1,10 ---- + ; RUN: llvm-as < %s | llc -march=arm | grep {mov r0, r0, lsr #31} + ; RUN: llvm-as < %s | llc -march=thumb | grep {lsr r0, r0, #31} + + define i32 @test1(i32 %X) { + entry: + icmp slt i32 %X, 0 ; :0 [#uses=1] + zext i1 %0 to i32 ; :1 [#uses=1] + ret i32 %1 + } + From reid at x10sys.com Mon Apr 30 00:12:28 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 30 Apr 2007 00:12:28 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/ispositive.ll Message-ID: <200704300512.l3U5CSQe031603@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: ispositive.ll added (r1.1) --- Log message: For PR1370: http://llvm.org/PR1370 : Rearrange some tests so that if PowerPC is not being built we don't try to run PowerPC specific tests. --- Diffs of the changes: (+9 -0) ispositive.ll | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm/test/CodeGen/X86/ispositive.ll diff -c /dev/null llvm/test/CodeGen/X86/ispositive.ll:1.1 *** /dev/null Mon Apr 30 00:12:08 2007 --- llvm/test/CodeGen/X86/ispositive.ll Mon Apr 30 00:11:58 2007 *************** *** 0 **** --- 1,9 ---- + ; RUN: llvm-as < %s | llc -march=x86 | grep {shrl.*31} + + define i32 @test1(i32 %X) { + entry: + icmp slt i32 %X, 0 ; :0 [#uses=1] + zext i1 %0 to i32 ; :1 [#uses=1] + ret i32 %1 + } + From clattner at apple.com Mon Apr 30 00:29:17 2007 From: clattner at apple.com (Chris Lattner) Date: Sun, 29 Apr 2007 22:29:17 -0700 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/ispositive.ll In-Reply-To: <200704300512.l3U5CSQe031603@zion.cs.uiuc.edu> References: <200704300512.l3U5CSQe031603@zion.cs.uiuc.edu> Message-ID: <05E51D6B-B2C0-401E-A544-C070DB085D0F@apple.com> Reid, why are you duplicating these tests? -Chris On Apr 29, 2007, at 10:12 PM, Reid Spencer wrote: > > > Changes in directory llvm/test/CodeGen/X86: > > ispositive.ll added (r1.1) > --- > Log message: > > For PR1370: http://llvm.org/PR1370 : > Rearrange some tests so that if PowerPC is not being built we don't > try to > run PowerPC specific tests. > > > --- > Diffs of the changes: (+9 -0) > > ispositive.ll | 9 +++++++++ > 1 files changed, 9 insertions(+) > > > Index: llvm/test/CodeGen/X86/ispositive.ll > diff -c /dev/null llvm/test/CodeGen/X86/ispositive.ll:1.1 > *** /dev/null Mon Apr 30 00:12:08 2007 > --- llvm/test/CodeGen/X86/ispositive.ll Mon Apr 30 00:11:58 2007 > *************** > *** 0 **** > --- 1,9 ---- > + ; RUN: llvm-as < %s | llc -march=x86 | grep {shrl.*31} > + > + define i32 @test1(i32 %X) { > + entry: > + icmp slt i32 %X, 0 ; :0 [#uses=1] > + zext i1 %0 to i32 ; :1 [#uses=1] > + ret i32 %1 > + } > + > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From asl at math.spbu.ru Mon Apr 30 05:29:00 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 30 Apr 2007 05:29:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Globals.cpp Message-ID: <200704301029.l3UAT0m4013798@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Globals.cpp updated: 1.22 -> 1.23 --- Log message: Fix typo. Interesting, but old variant worked too :) --- Diffs of the changes: (+1 -1) Globals.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/VMCore/Globals.cpp diff -u llvm/lib/VMCore/Globals.cpp:1.22 llvm/lib/VMCore/Globals.cpp:1.23 --- llvm/lib/VMCore/Globals.cpp:1.22 Sun Apr 29 13:02:48 2007 +++ llvm/lib/VMCore/Globals.cpp Mon Apr 30 05:28:40 2007 @@ -217,7 +217,7 @@ return GV; else { const ConstantExpr *CE = 0; - if ((CE = dyn_cast(Aliasee)) && + if ((CE = dyn_cast(C)) && (CE->getOpcode() == Instruction::BitCast)) return cast(CE->getOperand(0)); else From rspencer at reidspencer.com Mon Apr 30 05:41:38 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Mon, 30 Apr 2007 06:41:38 -0400 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/ispositive.ll In-Reply-To: <05E51D6B-B2C0-401E-A544-C070DB085D0F@apple.com> References: <200704300512.l3U5CSQe031603@zion.cs.uiuc.edu> <05E51D6B-B2C0-401E-A544-C070DB085D0F@apple.com> Message-ID: On Sun, 29 Apr 2007 22:29:17 -0700 Chris Lattner wrote: > >Reid, why are you duplicating these tests? Because they need to be. Such tests will cause false regressions if LLVM is not built with support for all the targets used in the test case. Duplicating them into the various target sub-directories (instead of in the Generic directory) eliminates the "false positives" when fewer targets are built. Please see PR1370 for a more complete description. If you still have a problem with this, call me on my cell phone to discuss. > >-Chris > >On Apr 29, 2007, at 10:12 PM, Reid Spencer wrote: > >> >> >> Changes in directory llvm/test/CodeGen/X86: >> >> ispositive.ll added (r1.1) >> --- >> Log message: >> >> For PR1370: http://llvm.org/PR1370 : >> Rearrange some tests so that if PowerPC is not being built we don't >> try to >> run PowerPC specific tests. >> >> >> --- >> Diffs of the changes: (+9 -0) >> >> ispositive.ll | 9 +++++++++ >> 1 files changed, 9 insertions(+) >> >> >> Index: llvm/test/CodeGen/X86/ispositive.ll >> diff -c /dev/null llvm/test/CodeGen/X86/ispositive.ll:1.1 >> *** /dev/null Mon Apr 30 00:12:08 2007 >> --- llvm/test/CodeGen/X86/ispositive.ll Mon Apr 30 00:11:58 2007 >> *************** >> *** 0 **** >> --- 1,9 ---- >> + ; RUN: llvm-as < %s | llc -march=x86 | grep {shrl.*31} >> + >> + define i32 @test1(i32 %X) { >> + entry: >> + icmp slt i32 %X, 0 ; :0 [#uses=1] >> + zext i1 %0 to i32 ; :1 [#uses=1] >> + ret i32 %1 >> + } >> + >> >> >> >> _______________________________________________ >> 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 lauro.venancio at gmail.com Mon Apr 30 08:55:52 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Mon, 30 Apr 2007 10:55:52 -0300 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp In-Reply-To: References: <200704271758.l3RHwOvn001069@zion.cs.uiuc.edu> Message-ID: <9c10c9f0704300655j5da5e8b9p2c958f6e542040fe@mail.gmail.com> Evan, The problem is the semantics. A possible solution is rename UseThumbBacktraces to UseThumbFramePtrReg. Lauro 2007/4/27, Evan Cheng : > > Hi Lauro, > > It would be better to fix ARMSubtarget.cpp instead. Just initialize > UseThumbBacktraces to the value of input parameter thumb to the > ARMSubtarget ctor. > > Evan > > On Apr 27, 2007, at 10:58 AM, Lauro Ramos Venancio wrote: > > > > > > > Changes in directory llvm/lib/Target/ARM: > > > > ARMRegisterInfo.cpp updated: 1.88 -> 1.89 > > --- > > Log message: > > > > In Thumb mode, the frame register must be R7. > > > > > > --- > > Diffs of the changes: (+2 -2) > > > > ARMRegisterInfo.cpp | 4 ++-- > > 1 files changed, 2 insertions(+), 2 deletions(-) > > > > > > Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp > > diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.88 llvm/lib/ > > Target/ARM/ARMRegisterInfo.cpp:1.89 > > --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.88 Wed Apr 25 > > 17:13:27 2007 > > +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Fri Apr 27 12:58:03 2007 > > @@ -85,7 +85,7 @@ > > const ARMSubtarget &sti) > > : ARMGenRegisterInfo(ARM::ADJCALLSTACKDOWN, ARM::ADJCALLSTACKUP), > > TII(tii), STI(sti), > > - FramePtr(STI.useThumbBacktraces() ? ARM::R7 : ARM::R11) { > > + FramePtr(STI.useThumbBacktraces() || STI.isThumb() ? ARM::R7 : > > ARM::R11) { > > } > > > > bool ARMRegisterInfo::spillCalleeSavedRegisters(MachineBasicBlock > > &MBB, > > @@ -1472,7 +1472,7 @@ > > > > unsigned ARMRegisterInfo::getFrameRegister(MachineFunction &MF) > > const { > > if (STI.isTargetDarwin() || hasFP(MF)) > > - return STI.useThumbBacktraces() ? ARM::R7 : ARM::R11; > > + return STI.useThumbBacktraces() || STI.isThumb() ? ARM::R7 : > > ARM::R11; > > else > > return ARM::SP; > > } > > > > > > > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070430/893e2fc7/attachment.html From jlh at gmx.ch Mon Apr 30 08:45:54 2007 From: jlh at gmx.ch (jlh) Date: Mon, 30 Apr 2007 15:45:54 +0200 Subject: [llvm-commits] Patch for bug in llvm-ld Message-ID: <4635F312.5040301@gmx.ch> Hello! I've been told to send this here. In tools/llvm-ld/llvm-ld.cpp, line 360, a const char* to a temporary std::string is being stored, with the string going out of scope right after, making that pointer invalid. std::string lib_name = "-l" + LinkItems[index].first; args.push_back(lib_name.c_str()); The attached patch fixes this in a simple way. jlh -------------- next part -------------- A non-text attachment was scrubbed... Name: patch.txt Type: text/x-patch Size: 1197 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070430/620cefab/attachment.bin From sabre at nondot.org Mon Apr 30 12:00:49 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 30 Apr 2007 12:00:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp Message-ID: <200704301700.l3UH0nme021396@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.159 -> 1.160 --- Log message: Clean up multi-line asam string printing. Instead of printing: # InlineAsm Start subfc r3,r5,r4 subfze r4,r3 # InlineAsm End print: # InlineAsm Start subfc r3,r5,r4 subfze r4,r3 # InlineAsm End --- Diffs of the changes: (+1 -1) AsmPrinter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.159 llvm/lib/CodeGen/AsmPrinter.cpp:1.160 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.159 Sun Apr 29 13:02:48 2007 +++ llvm/lib/CodeGen/AsmPrinter.cpp Mon Apr 30 12:00:18 2007 @@ -954,7 +954,7 @@ } case '\n': ++LastEmitted; // Consume newline character. - O << "\n\t"; // Indent code with newline. + O << "\n"; // Indent code with newline. break; case '$': { ++LastEmitted; // Consume '$' character. From sabre at nondot.org Mon Apr 30 12:16:45 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 30 Apr 2007 12:16:45 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704301716.l3UHGjiL021797@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.439 -> 1.440 --- Log message: refactor some code, no functionality change --- Diffs of the changes: (+52 -44) SelectionDAGISel.cpp | 96 +++++++++++++++++++++++++++------------------------ 1 files changed, 52 insertions(+), 44 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.439 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.440 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.439 Sun Apr 29 13:58:03 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Apr 30 12:16:27 2007 @@ -3134,44 +3134,6 @@ return RegsForValue(); } -/// getConstraintGenerality - Return an integer indicating how general CT is. -static unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) { - switch (CT) { - default: assert(0 && "Unknown constraint type!"); - case TargetLowering::C_Other: - case TargetLowering::C_Unknown: - return 0; - case TargetLowering::C_Register: - return 1; - case TargetLowering::C_RegisterClass: - return 2; - case TargetLowering::C_Memory: - return 3; - } -} - -static std::string GetMostGeneralConstraint(std::vector &C, - const TargetLowering &TLI) { - assert(!C.empty() && "Must have at least one constraint"); - if (C.size() == 1) return C[0]; - - std::string *Current = &C[0]; - // If we have multiple constraints, try to pick the most general one ahead - // of time. This isn't a wonderful solution, but handles common cases. - TargetLowering::ConstraintType Flavor = TLI.getConstraintType(Current[0]); - for (unsigned j = 1, e = C.size(); j != e; ++j) { - TargetLowering::ConstraintType ThisFlavor = TLI.getConstraintType(C[j]); - if (getConstraintGenerality(ThisFlavor) > - getConstraintGenerality(Flavor)) { - // This constraint letter is more general than the previous one, - // use it. - Flavor = ThisFlavor; - Current = &C[j]; - } - } - return *Current; -} - namespace { /// AsmOperandInfo - This contains information for each constraint that we are /// lowering. @@ -3197,9 +3159,59 @@ ConstraintType(TargetLowering::C_Unknown), CallOperand(0,0), CallOperandVal(0), ConstraintVT(MVT::Other) { } + + void ComputeConstraintToUse(const TargetLowering &TLI); }; } // end anon namespace. +/// getConstraintGenerality - Return an integer indicating how general CT is. +static unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) { + switch (CT) { + default: assert(0 && "Unknown constraint type!"); + case TargetLowering::C_Other: + case TargetLowering::C_Unknown: + return 0; + case TargetLowering::C_Register: + return 1; + case TargetLowering::C_RegisterClass: + return 2; + case TargetLowering::C_Memory: + return 3; + } +} + +void AsmOperandInfo::ComputeConstraintToUse(const TargetLowering &TLI) { + assert(!Codes.empty() && "Must have at least one constraint"); + + std::string *Current = &Codes[0]; + TargetLowering::ConstraintType CurType = TLI.getConstraintType(*Current); + if (Codes.size() == 1) { // Single-letter constraints ('r') are very common. + ConstraintCode = *Current; + ConstraintType = CurType; + return; + } + + unsigned CurGenerality = getConstraintGenerality(CurType); + + // If we have multiple constraints, try to pick the most general one ahead + // of time. This isn't a wonderful solution, but handles common cases. + for (unsigned j = 1, e = Codes.size(); j != e; ++j) { + TargetLowering::ConstraintType ThisType = TLI.getConstraintType(Codes[j]); + unsigned ThisGenerality = getConstraintGenerality(ThisType); + if (ThisGenerality > CurGenerality) { + // This constraint letter is more general than the previous one, + // use it. + CurType = ThisType; + Current = &Codes[j]; + CurGenerality = ThisGenerality; + } + } + + ConstraintCode = *Current; + ConstraintType = CurType; +} + + /// visitInlineAsm - Handle a call to an InlineAsm object. /// void SelectionDAGLowering::visitInlineAsm(CallInst &I) { @@ -3274,12 +3286,8 @@ OpInfo.ConstraintVT = OpVT; - // Compute the constraint code to use. - OpInfo.ConstraintCode = GetMostGeneralConstraint(OpInfo.Codes, TLI); - - // Compute the constraint type. - // FIXME: merge this into GetMostGeneralConstraint. - OpInfo.ConstraintType = TLI.getConstraintType(OpInfo.ConstraintCode); + // Compute the constraint code and ConstraintType to use. + OpInfo.ComputeConstraintToUse(TLI); // If this is a memory input, and if the operand is not indirect, do what we From tonic at nondot.org Mon Apr 30 12:29:03 2007 From: tonic at nondot.org (Tanya Lattner) Date: Mon, 30 Apr 2007 12:29:03 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/AcceptTestResults.php Message-ID: <200704301729.l3UHT3kS022103@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: AcceptTestResults.php updated: 1.1 -> 1.2 --- Log message: Removed extra call to function. --- Diffs of the changes: (+1 -2) AcceptTestResults.php | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: nightlytest-serverside/AcceptTestResults.php diff -u nightlytest-serverside/AcceptTestResults.php:1.1 nightlytest-serverside/AcceptTestResults.php:1.2 --- nightlytest-serverside/AcceptTestResults.php:1.1 Sun Apr 29 13:56:27 2007 +++ nightlytest-serverside/AcceptTestResults.php Mon Apr 30 12:28:47 2007 @@ -548,5 +548,4 @@ shutdown($mysql_link); } -acceptTestResults(); -?> \ No newline at end of file +?> From sabre at nondot.org Mon Apr 30 12:29:48 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 30 Apr 2007 12:29:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704301729.l3UHTmis022145@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.440 -> 1.441 --- Log message: refactor GetRegistersForValue to take OpInfo as an argument instead of various pieces of it. No functionality change. --- Diffs of the changes: (+101 -98) SelectionDAGISel.cpp | 199 +++++++++++++++++++++++++-------------------------- 1 files changed, 101 insertions(+), 98 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.440 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.441 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.440 Mon Apr 30 12:16:27 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Apr 30 12:29:31 2007 @@ -82,6 +82,8 @@ createDefaultScheduler); } // namespace +namespace { struct AsmOperandInfo; } + namespace { /// RegsForValue - This struct represents the physical registers that a /// particular value is assigned and the type information about the value. @@ -516,8 +518,7 @@ N = NewN; } - RegsForValue GetRegistersForValue(const std::string &ConstrCode, - MVT::ValueType VT, + RegsForValue GetRegistersForValue(AsmOperandInfo &OpInfo, bool OutReg, bool InReg, std::set &OutputRegs, std::set &InputRegs); @@ -3013,23 +3014,105 @@ return FoundRC; } + +namespace { +/// AsmOperandInfo - This contains information for each constraint that we are +/// lowering. +struct AsmOperandInfo : public InlineAsm::ConstraintInfo { + /// ConstraintCode - This contains the actual string for the code, like "m". + std::string ConstraintCode; + + /// ConstraintType - Information about the constraint code, e.g. Register, + /// RegisterClass, Memory, Other, Unknown. + TargetLowering::ConstraintType ConstraintType; + + /// CallOperand/CallOperandval - 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. + SDOperand CallOperand; + Value *CallOperandVal; + + /// ConstraintVT - The ValueType for the operand value. + MVT::ValueType ConstraintVT; + + AsmOperandInfo(const InlineAsm::ConstraintInfo &info) + : InlineAsm::ConstraintInfo(info), + ConstraintType(TargetLowering::C_Unknown), + CallOperand(0,0), CallOperandVal(0), ConstraintVT(MVT::Other) { + } + + void ComputeConstraintToUse(const TargetLowering &TLI); +}; +} // end anon namespace. + +/// getConstraintGenerality - Return an integer indicating how general CT is. +static unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) { + switch (CT) { + default: assert(0 && "Unknown constraint type!"); + case TargetLowering::C_Other: + case TargetLowering::C_Unknown: + return 0; + case TargetLowering::C_Register: + return 1; + case TargetLowering::C_RegisterClass: + return 2; + case TargetLowering::C_Memory: + return 3; + } +} + +void AsmOperandInfo::ComputeConstraintToUse(const TargetLowering &TLI) { + assert(!Codes.empty() && "Must have at least one constraint"); + + std::string *Current = &Codes[0]; + TargetLowering::ConstraintType CurType = TLI.getConstraintType(*Current); + if (Codes.size() == 1) { // Single-letter constraints ('r') are very common. + ConstraintCode = *Current; + ConstraintType = CurType; + return; + } + + unsigned CurGenerality = getConstraintGenerality(CurType); + + // If we have multiple constraints, try to pick the most general one ahead + // of time. This isn't a wonderful solution, but handles common cases. + for (unsigned j = 1, e = Codes.size(); j != e; ++j) { + TargetLowering::ConstraintType ThisType = TLI.getConstraintType(Codes[j]); + unsigned ThisGenerality = getConstraintGenerality(ThisType); + if (ThisGenerality > CurGenerality) { + // This constraint letter is more general than the previous one, + // use it. + CurType = ThisType; + Current = &Codes[j]; + CurGenerality = ThisGenerality; + } + } + + ConstraintCode = *Current; + ConstraintType = CurType; +} + + RegsForValue SelectionDAGLowering:: -GetRegistersForValue(const std::string &ConstrCode, - MVT::ValueType VT, bool isOutReg, bool isInReg, +GetRegistersForValue(AsmOperandInfo &OpInfo, bool isOutReg, bool isInReg, std::set &OutputRegs, std::set &InputRegs) { std::pair PhysReg = - TLI.getRegForInlineAsmConstraint(ConstrCode, VT); + TLI.getRegForInlineAsmConstraint(OpInfo.ConstraintCode,OpInfo.ConstraintVT); std::vector Regs; - unsigned NumRegs = VT != MVT::Other ? TLI.getNumElements(VT) : 1; + unsigned NumRegs = 1; + if (OpInfo.ConstraintVT != MVT::Other) + NumRegs = TLI.getNumElements(OpInfo.ConstraintVT); MVT::ValueType RegVT; - MVT::ValueType ValueVT = VT; + MVT::ValueType ValueVT = OpInfo.ConstraintVT; + MachineFunction &MF = DAG.getMachineFunction(); + // If this is a constraint for a specific physical register, like {r17}, // assign it now. if (PhysReg.first) { - if (VT == MVT::Other) + if (OpInfo.ConstraintVT == MVT::Other) ValueVT = *PhysReg.second->vt_begin(); // Get the actual register value type. This is important, because the user @@ -3067,11 +3150,11 @@ if (!isOutReg || !isInReg) { RegVT = *PhysReg.second->vt_begin(); - if (VT == MVT::Other) + if (OpInfo.ConstraintVT == MVT::Other) ValueVT = RegVT; // Create the appropriate number of virtual registers. - SSARegMap *RegMap = DAG.getMachineFunction().getSSARegMap(); + SSARegMap *RegMap = MF.getSSARegMap(); for (; NumRegs; --NumRegs) Regs.push_back(RegMap->createVirtualRegister(PhysReg.second)); @@ -3086,11 +3169,11 @@ // This is a reference to a register class that doesn't directly correspond // to an LLVM register class. Allocate NumRegs consecutive, available, // registers from the class. - RegClassRegs = TLI.getRegClassForInlineAsmConstraint(ConstrCode, VT); + RegClassRegs = TLI.getRegClassForInlineAsmConstraint(OpInfo.ConstraintCode, + OpInfo.ConstraintVT); } const MRegisterInfo *MRI = DAG.getTarget().getRegisterInfo(); - MachineFunction &MF = *CurMBB->getParent(); unsigned NumAllocated = 0; for (unsigned i = 0, e = RegClassRegs.size(); i != e; ++i) { unsigned Reg = RegClassRegs[i]; @@ -3126,7 +3209,7 @@ if (isInReg) InputRegs.insert(Reg); // Mark reg used. } - return RegsForValue(Regs, *RC->vt_begin(), VT); + return RegsForValue(Regs, *RC->vt_begin(), OpInfo.ConstraintVT); } } @@ -3134,83 +3217,6 @@ return RegsForValue(); } -namespace { -/// AsmOperandInfo - This contains information for each constraint that we are -/// lowering. -struct AsmOperandInfo : public InlineAsm::ConstraintInfo { - /// ConstraintCode - This contains the actual string for the code, like "m". - std::string ConstraintCode; - - /// ConstraintType - Information about the constraint code, e.g. Register, - /// RegisterClass, Memory, Other, Unknown. - TargetLowering::ConstraintType ConstraintType; - - /// CallOperand/CallOperandval - 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. - SDOperand CallOperand; - Value *CallOperandVal; - - /// ConstraintVT - The ValueType for the operand value. - MVT::ValueType ConstraintVT; - - AsmOperandInfo(const InlineAsm::ConstraintInfo &info) - : InlineAsm::ConstraintInfo(info), - ConstraintType(TargetLowering::C_Unknown), - CallOperand(0,0), CallOperandVal(0), ConstraintVT(MVT::Other) { - } - - void ComputeConstraintToUse(const TargetLowering &TLI); -}; -} // end anon namespace. - -/// getConstraintGenerality - Return an integer indicating how general CT is. -static unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) { - switch (CT) { - default: assert(0 && "Unknown constraint type!"); - case TargetLowering::C_Other: - case TargetLowering::C_Unknown: - return 0; - case TargetLowering::C_Register: - return 1; - case TargetLowering::C_RegisterClass: - return 2; - case TargetLowering::C_Memory: - return 3; - } -} - -void AsmOperandInfo::ComputeConstraintToUse(const TargetLowering &TLI) { - assert(!Codes.empty() && "Must have at least one constraint"); - - std::string *Current = &Codes[0]; - TargetLowering::ConstraintType CurType = TLI.getConstraintType(*Current); - if (Codes.size() == 1) { // Single-letter constraints ('r') are very common. - ConstraintCode = *Current; - ConstraintType = CurType; - return; - } - - unsigned CurGenerality = getConstraintGenerality(CurType); - - // If we have multiple constraints, try to pick the most general one ahead - // of time. This isn't a wonderful solution, but handles common cases. - for (unsigned j = 1, e = Codes.size(); j != e; ++j) { - TargetLowering::ConstraintType ThisType = TLI.getConstraintType(Codes[j]); - unsigned ThisGenerality = getConstraintGenerality(ThisType); - if (ThisGenerality > CurGenerality) { - // This constraint letter is more general than the previous one, - // use it. - CurType = ThisType; - Current = &Codes[j]; - CurGenerality = ThisGenerality; - } - } - - ConstraintCode = *Current; - ConstraintType = CurType; -} - /// visitInlineAsm - Handle a call to an InlineAsm object. /// @@ -3336,8 +3342,7 @@ // Build a list of regs that this operand uses. This always has a single // element for promoted/expanded operands. - RegsForValue Regs = GetRegistersForValue(OpInfo.ConstraintCode, OpVT, - false, false, + RegsForValue Regs = GetRegistersForValue(OpInfo, false, false, OutputRegs, InputRegs); switch (OpInfo.Type) { @@ -3407,8 +3412,7 @@ // Copy the output from the appropriate register. Find a register that // we can use. RegsForValue Regs = - GetRegistersForValue(OpInfo.ConstraintCode, OpInfo.ConstraintVT, - true, UsesInputRegister, + GetRegistersForValue(OpInfo, true, UsesInputRegister, OutputRegs, InputRegs); if (Regs.Regs.empty()) { cerr << "Couldn't allocate output reg for contraint '" @@ -3515,8 +3519,7 @@ // Copy the input into the appropriate registers. RegsForValue InRegs = - GetRegistersForValue(OpInfo.ConstraintCode, OpInfo.ConstraintVT, - false, true, OutputRegs, InputRegs); + GetRegistersForValue(OpInfo, false, true, OutputRegs, InputRegs); // FIXME: should be match fail. assert(!InRegs.Regs.empty() && "Couldn't allocate input reg!"); @@ -3527,8 +3530,8 @@ } case InlineAsm::isClobber: { RegsForValue ClobberedRegs = - GetRegistersForValue(OpInfo.ConstraintCode, MVT::Other, false, false, - OutputRegs, InputRegs); + GetRegistersForValue(OpInfo, false, + false, OutputRegs, InputRegs); // Add the clobbered value to the operand list, so that the register // allocator is aware that the physreg got clobbered. if (!ClobberedRegs.Regs.empty()) From tonic at nondot.org Mon Apr 30 13:05:35 2007 From: tonic at nondot.org (Tanya Lattner) Date: Mon, 30 Apr 2007 13:05:35 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/AcceptTestResults.php Message-ID: <200704301805.l3UI5Z7A022886@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: AcceptTestResults.php updated: 1.2 -> 1.3 --- Log message: Adding target triple. --- Diffs of the changes: (+7 -1) AcceptTestResults.php | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: nightlytest-serverside/AcceptTestResults.php diff -u nightlytest-serverside/AcceptTestResults.php:1.2 nightlytest-serverside/AcceptTestResults.php:1.3 --- nightlytest-serverside/AcceptTestResults.php:1.2 Mon Apr 30 12:28:47 2007 +++ nightlytest-serverside/AcceptTestResults.php Mon Apr 30 13:05:20 2007 @@ -367,7 +367,7 @@ $machine_data = $_POST['machine_data']; if (!isset($_POST['machine_data'])) { - shutdown(); + shutdown($mysql_link); } $MACHINE_DATA = split("\n", $machine_data); @@ -379,6 +379,12 @@ $time = matchOne("/time\:\s*(.+)/", $MACHINE_DATA[5], ""); $nickname = $_POST['nickname']; +if(!isset($_POST['target_triple'])) { + shutdown($mysql_link); +} + +$targetTriple = $_POST['target_triple']; + //Get machine id or add new machine $machineId = getMachineID($targetTriple, $hostname, $nickname); From evan.cheng at apple.com Mon Apr 30 13:42:29 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 30 Apr 2007 13:42:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/README.txt Message-ID: <200704301842.l3UIgTZI023562@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: README.txt updated: 1.4 -> 1.5 --- Log message: Updates. --- Diffs of the changes: (+57 -1) README.txt | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 57 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/README.txt diff -u llvm/lib/CodeGen/README.txt:1.4 llvm/lib/CodeGen/README.txt:1.5 --- llvm/lib/CodeGen/README.txt:1.4 Mon Apr 16 13:10:22 2007 +++ llvm/lib/CodeGen/README.txt Mon Apr 30 13:42:09 2007 @@ -85,4 +85,60 @@ //===---------------------------------------------------------------------===// -Re-Materialize load from frame index. +Use local info (i.e. register scavenger) to assign it a free register to allow +reuse: + ldr r3, [sp, #+4] + add r3, r3, #3 + ldr r2, [sp, #+8] + add r2, r2, #2 + ldr r1, [sp, #+4] <== + add r1, r1, #1 + ldr r0, [sp, #+4] + add r0, r0, #2 + +//===---------------------------------------------------------------------===// + +LLVM aggressively lift CSE out of loop. Sometimes this can be negative side- +effects: + +R1 = X + 4 +R2 = X + 7 +R3 = X + 15 + +loop: +load [i + R1] +... +load [i + R2] +... +load [i + R3] + +Suppose there is high register pressure, R1, R2, R3, can be spilled. We need +to implement proper re-materialization to handle this: + +R1 = X + 4 +R2 = X + 7 +R3 = X + 15 + +loop: +R1 = X + 4 @ re-materialized +load [i + R1] +... +R2 = X + 7 @ re-materialized +load [i + R2] +... +R3 = X + 15 @ re-materialized +load [i + R3] + +Furthermore, with re-association, we can enable sharing: + +R1 = X + 4 +R2 = X + 7 +R3 = X + 15 + +loop: +T = i + X +load [T + 4] +... +load [T + 7] +... +load [T + 15] From tonic at nondot.org Mon Apr 30 14:12:57 2007 From: tonic at nondot.org (Tanya Lattner) Date: Mon, 30 Apr 2007 14:12:57 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/AcceptTestResults.php Message-ID: <200704301912.l3UJCv7X024145@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: AcceptTestResults.php updated: 1.3 -> 1.4 --- Log message: target triple not require for now. --- Diffs of the changes: (+0 -4) AcceptTestResults.php | 4 ---- 1 files changed, 4 deletions(-) Index: nightlytest-serverside/AcceptTestResults.php diff -u nightlytest-serverside/AcceptTestResults.php:1.3 nightlytest-serverside/AcceptTestResults.php:1.4 --- nightlytest-serverside/AcceptTestResults.php:1.3 Mon Apr 30 13:05:20 2007 +++ nightlytest-serverside/AcceptTestResults.php Mon Apr 30 14:12:42 2007 @@ -379,10 +379,6 @@ $time = matchOne("/time\:\s*(.+)/", $MACHINE_DATA[5], ""); $nickname = $_POST['nickname']; -if(!isset($_POST['target_triple'])) { - shutdown($mysql_link); -} - $targetTriple = $_POST['target_triple']; //Get machine id or add new machine From bwendlin at apple.com Mon Apr 30 14:14:36 2007 From: bwendlin at apple.com (bwendlin at apple.com) Date: Mon, 30 Apr 2007 12:14:36 -0700 (PDT) Subject: [llvm-commits] [126737] Fix the race condition where a dylib is used before it' s actually created. Message-ID: <20070430191436.392A13EFC5B@src> Revision: 126737 Author: bwendlin Date: 2007-04-30 12:14:35 -0700 (Mon, 30 Apr 2007) Log Message: ----------- Fix the race condition where a dylib is used before it's actually created. Naming it a unique name for each stage will fix this. Modified Paths: -------------- apple-local/branches/llvm/gcc/Makefile.in Modified: apple-local/branches/llvm/gcc/Makefile.in =================================================================== --- apple-local/branches/llvm/gcc/Makefile.in 2007-04-30 19:04:35 UTC (rev 126736) +++ apple-local/branches/llvm/gcc/Makefile.in 2007-04-30 19:14:35 UTC (rev 126737) @@ -1124,16 +1124,16 @@ # llvm-linker-hack.cpp DYLIB_COMPILE_FLAGS := $(filter-out -mdynamic-no-pic, \ $(ALL_CXXFLAGS) $(ALL_CPPFLAGS)) -libllvmgcc.dylib: llvm-linker-hack.cpp $(LLVMLIBFILES) +libllvmgcc$(LLVM_STAGE).dylib: llvm-linker-hack.cpp $(LLVMLIBFILES) echo $(LLVMLIBFILES) $(CXX) $(DYLIB_COMPILE_FLAGS) $(INCLUDES) -o $@ \ $< $(LLVMLIBFILES) -dynamiclib -single_module \ -install_name @executable_path/$@ -LLVMBACKENDFILES := libllvmgcc.dylib +LLVMBACKENDFILES := libllvmgcc$(LLVM_STAGE).dylib # Make sure that 'make install' knows about the dylib. -EXTRA_PROGRAMS += libllvmgcc.dylib +EXTRA_PROGRAMS += libllvmgcc$(LLVM_STAGE).dylib # APPLE LOCAL begin LLVM - set DYLD path SET_DYLIB_PATH=1 @@ -4073,7 +4073,8 @@ $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \ CFLAGS="$(STAGE1_CFLAGS) $(STAGE1_CHECKING)" \ MAKEINFO="$(MAKEINFO)" MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \ - COVERAGE_FLAGS= OBJS-onestep="$(OBJS)" + COVERAGE_FLAGS= OBJS-onestep="$(OBJS)" \ + LLVM_STAGE="-stage1" $(STAMP) stage1_build echo stage1_build > stage_last @@ -4083,13 +4084,11 @@ echo stage2_build > stage_last stage2_build: stage1_copy - if test "${SET_DYLIB_PATH}" = "1"; then \ - DYLD_LIBRARY_PATH="`${PWD_COMMAND}`/stage1"; \ - fi; \ $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \ STAGE_PREFIX=stage1/ \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(STAGE2_FLAGS_TO_PASS) + $(STAGE2_FLAGS_TO_PASS) \ + LLVM_STAGE="-stage2" $(STAMP) stage2_build echo stage2_build > stage_last @@ -4099,13 +4098,11 @@ echo stage3_build > stage_last stageprofile_build: stage1_copy - if test "${SET_DYLIB_PATH}" = "1"; then \ - DYLD_LIBRARY_PATH="`${PWD_COMMAND}`/stage1"; \ - fi; \ $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \ STAGE_PREFIX=stage1/ \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(STAGEPROFILE_FLAGS_TO_PASS) + $(STAGEPROFILE_FLAGS_TO_PASS) \ + LLVM_STAGE="-stage_profile" $(STAMP) stageprofile_build echo stageprofile_build > stage_last @@ -4115,24 +4112,20 @@ echo stagefeedback_build > stage_last stage3_build: stage2_copy - if test "${SET_DYLIB_PATH}" = "1"; then \ - DYLD_LIBRARY_PATH="`${PWD_COMMAND}`/stage2"; \ - fi; \ $(MAKE) CC="$(STAGE_CC_WRAPPER) stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" \ STAGE_PREFIX=stage2/ \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(STAGE2_FLAGS_TO_PASS) + $(STAGE2_FLAGS_TO_PASS) \ + LLVM_STAGE="" $(STAMP) stage3_build echo stage3_build > stage_last stagefeedback_build: stageprofile_copy stage1_copy - if test "${SET_DYLIB_PATH}" = "1"; then \ - DYLD_LIBRARY_PATH="`${PWD_COMMAND}`/stage1"; \ - fi; \ $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \ STAGE_PREFIX=stage1/ \ $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(STAGEFEEDBACK_FLAGS_TO_PASS) + $(STAGEFEEDBACK_FLAGS_TO_PASS) \ + LLVM_STAGE="-stage_feedback" $(STAMP) stagefeedback_build echo stagefeedback_build > stage_last @@ -4148,9 +4141,6 @@ echo stage4_build > stage_last stage4_build: stage3_copy - if test "${SET_DYLIB_PATH}" = "1"; then \ - DYLD_LIBRARY_PATH="`${PWD_COMMAND}`/stage3"; \ - fi; \ $(MAKE) CC="$(STAGE_CC_WRAPPER) stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" \ STAGE_PREFIX=stage3/ \ $(POSTSTAGE1_FLAGS_TO_PASS) \ From asl at math.spbu.ru Mon Apr 30 14:15:14 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 30 Apr 2007 14:15:14 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/GlobalValue.h Message-ID: <200704301915.l3UJFDFr024195@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: GlobalValue.h updated: 1.41 -> 1.42 --- Log message: Fix comment --- Diffs of the changes: (+4 -3) GlobalValue.h | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/include/llvm/GlobalValue.h diff -u llvm/include/llvm/GlobalValue.h:1.41 llvm/include/llvm/GlobalValue.h:1.42 --- llvm/include/llvm/GlobalValue.h:1.41 Sun Apr 29 13:35:00 2007 +++ llvm/include/llvm/GlobalValue.h Mon Apr 30 14:14:56 2007 @@ -8,9 +8,10 @@ //===----------------------------------------------------------------------===// // // This file is a common base class of all globally definable objects. As such, -// it is subclassed by GlobalVariable and by Function. This is used because you -// can do certain things with these global objects that you can't do to anything -// else. For example, use the address of one as a constant. +// it is subclassed by GlobalVariable, GlobalAlias and by Function. This is +// used because you can do certain things with these global objects that you +// can't do to anything else. For example, use the address of one as a +// constant. // //===----------------------------------------------------------------------===// From evan.cheng at apple.com Mon Apr 30 15:28:58 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 30 Apr 2007 13:28:58 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp In-Reply-To: <9c10c9f0704300655j5da5e8b9p2c958f6e542040fe@mail.gmail.com> References: <200704271758.l3RHwOvn001069@zion.cs.uiuc.edu> <9c10c9f0704300655j5da5e8b9p2c958f6e542040fe@mail.gmail.com> Message-ID: <190CA316-74E3-4D67-90F7-BBD0871CD5E4@apple.com> That's fine. Thanks. Evan On Apr 30, 2007, at 6:55 AM, Lauro Ramos Venancio wrote: > Evan, > > The problem is the semantics. A possible solution is rename > UseThumbBacktraces to UseThumbFramePtrReg. > > Lauro > > 2007/4/27, Evan Cheng < evan.cheng at apple.com>: > Hi Lauro, > > It would be better to fix ARMSubtarget.cpp instead. Just initialize > UseThumbBacktraces to the value of input parameter thumb to the > ARMSubtarget ctor. > > Evan > > On Apr 27, 2007, at 10:58 AM, Lauro Ramos Venancio wrote: > > > > > > > Changes in directory llvm/lib/Target/ARM: > > > > ARMRegisterInfo.cpp updated: 1.88 -> 1.89 > > --- > > Log message: > > > > In Thumb mode, the frame register must be R7. > > > > > > --- > > Diffs of the changes: (+2 -2) > > > > ARMRegisterInfo.cpp | 4 ++-- > > 1 files changed, 2 insertions(+), 2 deletions(-) > > > > > > Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp > > diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp: 1.88 llvm/lib/ > > Target/ARM/ARMRegisterInfo.cpp:1.89 > > --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.88 Wed Apr 25 > > 17:13:27 2007 > > +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Fri Apr 27 12:58:03 > 2007 > > @@ -85,7 +85,7 @@ > > const ARMSubtarget &sti) > > : ARMGenRegisterInfo(ARM::ADJCALLSTACKDOWN, ARM::ADJCALLSTACKUP), > > TII(tii), STI(sti), > > - FramePtr( STI.useThumbBacktraces() ? ARM::R7 : ARM::R11) { > > + FramePtr(STI.useThumbBacktraces() || STI.isThumb() ? ARM::R7 : > > ARM::R11) { > > } > > > > bool ARMRegisterInfo::spillCalleeSavedRegisters(MachineBasicBlock > > &MBB, > > @@ -1472,7 +1472,7 @@ > > > > unsigned ARMRegisterInfo::getFrameRegister(MachineFunction &MF) > > const { > > if (STI.isTargetDarwin() || hasFP(MF)) > > - return STI.useThumbBacktraces () ? ARM::R7 : ARM::R11; > > + return STI.useThumbBacktraces() || STI.isThumb() ? ARM::R7 : > > ARM::R11; > > else > > return ARM::SP; > > } > > > > > > > > _______________________________________________ > > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070430/548878d2/attachment.html From christopher.lamb at gmail.com Mon Apr 30 15:41:38 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Mon, 30 Apr 2007 15:41:38 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/ELFRelocation.h Message-ID: <200704302041.l3UKfcR8025811@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: ELFRelocation.h added (r1.1) --- Log message: Header file for ELF relocations. --- Diffs of the changes: (+49 -0) ELFRelocation.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+) Index: llvm/include/llvm/CodeGen/ELFRelocation.h diff -c /dev/null llvm/include/llvm/CodeGen/ELFRelocation.h:1.1 *** /dev/null Mon Apr 30 15:41:18 2007 --- llvm/include/llvm/CodeGen/ELFRelocation.h Mon Apr 30 15:41:08 2007 *************** *** 0 **** --- 1,49 ---- + //=== ELFRelocation.h - ELF Relocation Info ---------------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Christopher Lamb and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the ELFRelocation class. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_CODEGEN_ELF_RELOCATION_H + #define LLVM_CODEGEN_ELF_RELOCATION_H + + namespace llvm { + + /// ELFRelocation - This class contains all the information necessary to + /// to generate any 32-bit or 64-bit ELF relocation entry. + class ELFRelocation { + uint64_t r_offset; // offset in the section of the object this applies to + uint32_t r_symidx; // symbol table index of the symbol to use + uint32_t r_type; // machine specific relocation type + int64_t r_add; // explicit relocation addend + bool r_rela; // if true then the addend is part of the entry + // otherwise the addend is at the location specified + // by r_offset + public: + + uint64_t getInfo(bool is64Bit = false) const { + if (is64Bit) + return ((uint64_t)r_symidx << 32) + ((uint64_t)r_type & 0xFFFFFFFFL); + else + return (r_symidx << 8) + (r_type & 0xFFL); + } + + uint64_t getOffset() const { return r_offset; } + uint64_t getAddress() const { return r_add; } + + ELFRelocation(uint64_t off, uint32_t sym, uint32_t type, + bool rela = true, int64_t addend = 0) : + r_offset(off), r_symidx(sym), r_type(type), + r_add(addend), r_rela(rela) {} + }; + + } // end llvm namespace + + #endif // LLVM_CODEGEN_ELF_RELOCATION_H \ No newline at end of file From sabre at nondot.org Mon Apr 30 16:10:32 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 30 Apr 2007 16:10:32 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll Message-ID: <200704302110.l3ULAWHq026349@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: 2007-04-30-InlineAsmEarlyClobber.ll added (r1.1) --- Log message: testcase for PR1357: http://llvm.org/PR1357 --- Diffs of the changes: (+27 -0) 2007-04-30-InlineAsmEarlyClobber.ll | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+) Index: llvm/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll:1.1 *** /dev/null Mon Apr 30 16:10:23 2007 --- llvm/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll Mon Apr 30 16:10:13 2007 *************** *** 0 **** --- 1,27 ---- + ; RUN: llvm-as < %s | llc | grep {subfc r2,r5,r4} + ; RUN: llvm-as < %s | llc | grep {subfze r4,r3} + + ; PR1357 + + 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 = "powerpc-apple-darwin8.8.0" + + ;long long test(int A, int B, int C) { + ; unsigned X, Y; + ; __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2" + ; : "=r" (X), "=&r" (Y) + ; : "r" (A), "rI" (B), "r" (C)); + ; return ((long long)Y << 32) | X; + ;} + + define i64 @test(i32 %A, i32 %B, i32 %C) { + entry: + %Y = alloca i32, align 4 ; [#uses=2] + %tmp4 = call i32 asm "subf${3:I}c $1,$4,$3\0A\09subfze $0,$2", "=r,=*&r,r,rI,r"( i32* %Y, i32 %A, i32 %B, i32 %C ) ; [#uses=1] + %tmp5 = load i32* %Y ; [#uses=1] + %tmp56 = zext i32 %tmp5 to i64 ; [#uses=1] + %tmp7 = shl i64 %tmp56, 32 ; [#uses=1] + %tmp89 = zext i32 %tmp4 to i64 ; [#uses=1] + %tmp10 = or i64 %tmp7, %tmp89 ; [#uses=1] + ret i64 %tmp10 + } From sabre at nondot.org Mon Apr 30 16:11:35 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 30 Apr 2007 16:11:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704302111.l3ULBZnG026373@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.441 -> 1.442 --- Log message: Continue refactoring inline asm code. If there is an earlyclobber output register, preallocate all input registers and the early clobbered output. This fixes PR1357: http://llvm.org/PR1357 and CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll --- Diffs of the changes: (+108 -79) SelectionDAGISel.cpp | 187 +++++++++++++++++++++++++++++---------------------- 1 files changed, 108 insertions(+), 79 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.441 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.442 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.441 Mon Apr 30 12:29:31 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Apr 30 16:11:17 2007 @@ -518,10 +518,9 @@ N = NewN; } - RegsForValue GetRegistersForValue(AsmOperandInfo &OpInfo, - bool OutReg, bool InReg, - std::set &OutputRegs, - std::set &InputRegs); + void GetRegistersForValue(AsmOperandInfo &OpInfo, bool HasEarlyClobber, + std::set &OutputRegs, + std::set &InputRegs); void FindMergedConditions(Value *Cond, MachineBasicBlock *TBB, MachineBasicBlock *FBB, MachineBasicBlock *CurBB, @@ -3035,6 +3034,10 @@ /// ConstraintVT - The ValueType for the operand value. MVT::ValueType ConstraintVT; + /// AssignedRegs - If this is a register or register class operand, this + /// contains the set of register corresponding to the operand. + RegsForValue AssignedRegs; + AsmOperandInfo(const InlineAsm::ConstraintInfo &info) : InlineAsm::ConstraintInfo(info), ConstraintType(TargetLowering::C_Unknown), @@ -3042,6 +3045,17 @@ } void ComputeConstraintToUse(const TargetLowering &TLI); + + /// MarkAllocatedRegs - Once AssignedRegs is set, mark the assigned registers + /// busy in OutputRegs/InputRegs. + void MarkAllocatedRegs(bool isOutReg, bool isInReg, + std::set &OutputRegs, + std::set &InputRegs) const { + if (isOutReg) + OutputRegs.insert(AssignedRegs.Regs.begin(), AssignedRegs.Regs.end()); + if (isInReg) + InputRegs.insert(AssignedRegs.Regs.begin(), AssignedRegs.Regs.end()); + } }; } // end anon namespace. @@ -3093,13 +3107,42 @@ } -RegsForValue SelectionDAGLowering:: -GetRegistersForValue(AsmOperandInfo &OpInfo, bool isOutReg, bool isInReg, +void SelectionDAGLowering:: +GetRegistersForValue(AsmOperandInfo &OpInfo, bool HasEarlyClobber, std::set &OutputRegs, std::set &InputRegs) { - std::pair PhysReg = - TLI.getRegForInlineAsmConstraint(OpInfo.ConstraintCode,OpInfo.ConstraintVT); + // Compute whether this value requires an input register, an output register, + // or both. + bool isOutReg = false; + bool isInReg = false; + switch (OpInfo.Type) { + case InlineAsm::isOutput: + isOutReg = true; + + // If this is an early-clobber output, or if there is an input + // constraint that matches this, we need to reserve the input register + // so no other inputs allocate to it. + isInReg = OpInfo.isEarlyClobber || OpInfo.hasMatchingInput; + break; + case InlineAsm::isInput: + isInReg = true; + isOutReg = false; + break; + case InlineAsm::isClobber: + isOutReg = true; + isInReg = true; + break; + } + + + MachineFunction &MF = DAG.getMachineFunction(); std::vector Regs; + + // If this is a constraint for a single physreg, or a constraint for a + // register class, find it. + std::pair PhysReg = + TLI.getRegForInlineAsmConstraint(OpInfo.ConstraintCode, + OpInfo.ConstraintVT); unsigned NumRegs = 1; if (OpInfo.ConstraintVT != MVT::Other) @@ -3107,7 +3150,6 @@ MVT::ValueType RegVT; MVT::ValueType ValueVT = OpInfo.ConstraintVT; - MachineFunction &MF = DAG.getMachineFunction(); // If this is a constraint for a specific physical register, like {r17}, // assign it now. @@ -3137,7 +3179,9 @@ Regs.push_back(*I); } } - return RegsForValue(Regs, RegVT, ValueVT); + OpInfo.AssignedRegs = RegsForValue(Regs, RegVT, ValueVT); + OpInfo.MarkAllocatedRegs(isOutReg, isInReg, OutputRegs, InputRegs); + return; } // Otherwise, if this was a reference to an LLVM register class, create vregs @@ -3147,7 +3191,11 @@ // If this is an early clobber or tied register, our regalloc doesn't know // how to maintain the constraint. If it isn't, go ahead and create vreg // and let the regalloc do the right thing. - if (!isOutReg || !isInReg) { + if (!OpInfo.hasMatchingInput && !OpInfo.isEarlyClobber && + // If there is some other early clobber and this is an input register, + // then we are forced to pre-allocate the input reg so it doesn't + // conflict with the earlyclobber. + !(OpInfo.Type == InlineAsm::isInput && HasEarlyClobber)) { RegVT = *PhysReg.second->vt_begin(); if (OpInfo.ConstraintVT == MVT::Other) @@ -3158,7 +3206,9 @@ for (; NumRegs; --NumRegs) Regs.push_back(RegMap->createVirtualRegister(PhysReg.second)); - return RegsForValue(Regs, RegVT, ValueVT); + OpInfo.AssignedRegs = RegsForValue(Regs, RegVT, ValueVT); + OpInfo.MarkAllocatedRegs(isOutReg, isInReg, OutputRegs, InputRegs); + return; } // Otherwise, we can't allocate it. Let the code below figure out how to @@ -3172,7 +3222,7 @@ RegClassRegs = TLI.getRegClassForInlineAsmConstraint(OpInfo.ConstraintCode, OpInfo.ConstraintVT); } - + const MRegisterInfo *MRI = DAG.getTarget().getRegisterInfo(); unsigned NumAllocated = 0; for (unsigned i = 0, e = RegClassRegs.size(); i != e; ++i) { @@ -3202,19 +3252,18 @@ unsigned RegStart = (i-NumAllocated)+1; unsigned RegEnd = i+1; // Mark all of the allocated registers used. - for (unsigned i = RegStart; i != RegEnd; ++i) { - unsigned Reg = RegClassRegs[i]; - Regs.push_back(Reg); - if (isOutReg) OutputRegs.insert(Reg); // Mark reg used. - if (isInReg) InputRegs.insert(Reg); // Mark reg used. - } + for (unsigned i = RegStart; i != RegEnd; ++i) + Regs.push_back(RegClassRegs[i]); - return RegsForValue(Regs, *RC->vt_begin(), OpInfo.ConstraintVT); + OpInfo.AssignedRegs = RegsForValue(Regs, *RC->vt_begin(), + OpInfo.ConstraintVT); + OpInfo.MarkAllocatedRegs(isOutReg, isInReg, OutputRegs, InputRegs); + return; } } // Otherwise, we couldn't allocate enough registers for this. - return RegsForValue(); + return; } @@ -3235,7 +3284,13 @@ // ConstraintOperands list. std::vector ConstraintInfos = IA->ParseConstraints(); - unsigned OpNo = 1; + + // SawEarlyClobber - Keep track of whether we saw an earlyclobber output + // constraint. If so, we can't let the register allocator allocate any input + // registers, because it will not know to avoid the earlyclobbered output reg. + bool SawEarlyClobber = false; + + unsigned OpNo = 1; // OpNo - The operand of the CallInst. for (unsigned i = 0, e = ConstraintInfos.size(); i != e; ++i) { ConstraintOperands.push_back(AsmOperandInfo(ConstraintInfos[i])); AsmOperandInfo &OpInfo = ConstraintOperands.back(); @@ -3295,6 +3350,8 @@ // Compute the constraint code and ConstraintType to use. OpInfo.ComputeConstraintToUse(TLI); + // Keep track of whether we see an earlyclobber. + SawEarlyClobber |= OpInfo.isEarlyClobber; // If this is a memory input, and if the operand is not indirect, do what we // need to to provide an address for the memory input. @@ -3333,42 +3390,25 @@ OpInfo.isIndirect = true; } - - if (TLI.getRegForInlineAsmConstraint(OpInfo.ConstraintCode, OpVT).first ==0) - continue; // Not assigned a fixed reg. - - // For GCC register classes where we don't have a direct match, we fully - // assign registers at isel time. This is not optimal, but works. - - // Build a list of regs that this operand uses. This always has a single - // element for promoted/expanded operands. - RegsForValue Regs = GetRegistersForValue(OpInfo, false, false, - OutputRegs, InputRegs); - - switch (OpInfo.Type) { - case InlineAsm::isOutput: - // We can't assign any other output to this register. - OutputRegs.insert(Regs.Regs.begin(), Regs.Regs.end()); - // If this is an early-clobber output, it cannot be assigned to the same - // value as the input reg. - if (OpInfo.isEarlyClobber || OpInfo.hasMatchingInput) - InputRegs.insert(Regs.Regs.begin(), Regs.Regs.end()); - break; - case InlineAsm::isInput: - // We can't assign any other input to this register. - InputRegs.insert(Regs.Regs.begin(), Regs.Regs.end()); - break; - case InlineAsm::isClobber: - // Clobbered regs cannot be used as inputs or outputs. - InputRegs.insert(Regs.Regs.begin(), Regs.Regs.end()); - OutputRegs.insert(Regs.Regs.begin(), Regs.Regs.end()); - break; - } + // If this constraint is for a specific register, allocate it before + // anything else. + if (OpInfo.ConstraintType == TargetLowering::C_Register) + GetRegistersForValue(OpInfo, SawEarlyClobber, OutputRegs, InputRegs); } - ConstraintInfos.clear(); + // Second pass - Loop over all of the operands, assigning virtual or physregs + // to registerclass operands. + for (unsigned i = 0, e = ConstraintOperands.size(); i != e; ++i) { + AsmOperandInfo &OpInfo = ConstraintOperands[i]; + + // C_Register operands have already been allocated, Other/Memory don't need + // to be. + if (OpInfo.ConstraintType == TargetLowering::C_RegisterClass) + GetRegistersForValue(OpInfo, SawEarlyClobber, OutputRegs, InputRegs); + } + // AsmNodeOperands - The operands for the ISD::INLINEASM node. std::vector AsmNodeOperands; AsmNodeOperands.push_back(SDOperand()); // reserve space for input chain @@ -3402,19 +3442,9 @@ // Otherwise, this is a register or register class output. - // If this is an early-clobber output, or if there is an input - // constraint that matches this, we need to reserve the input register - // so no other inputs allocate to it. - bool UsesInputRegister = false; - if (OpInfo.isEarlyClobber || OpInfo.hasMatchingInput) - UsesInputRegister = true; - // Copy the output from the appropriate register. Find a register that // we can use. - RegsForValue Regs = - GetRegistersForValue(OpInfo, true, UsesInputRegister, - OutputRegs, InputRegs); - if (Regs.Regs.empty()) { + if (OpInfo.AssignedRegs.Regs.empty()) { cerr << "Couldn't allocate output reg for contraint '" << OpInfo.ConstraintCode << "'!\n"; exit(1); @@ -3425,15 +3455,16 @@ assert(RetValRegs.Regs.empty() && "Cannot have multiple output constraints yet!"); assert(I.getType() != Type::VoidTy && "Bad inline asm!"); - RetValRegs = Regs; + RetValRegs = OpInfo.AssignedRegs; } else { - IndirectStoresToEmit.push_back(std::make_pair(Regs, + IndirectStoresToEmit.push_back(std::make_pair(OpInfo.AssignedRegs, OpInfo.CallOperandVal)); } // Add information to the INLINEASM node to know that this register is // set. - Regs.AddInlineAsmOperands(2 /*REGDEF*/, DAG, AsmNodeOperands); + OpInfo.AssignedRegs.AddInlineAsmOperands(2 /*REGDEF*/, DAG, + AsmNodeOperands); break; } case InlineAsm::isInput: { @@ -3518,24 +3549,22 @@ "Don't know how to handle indirect register inputs yet!"); // Copy the input into the appropriate registers. - RegsForValue InRegs = - GetRegistersForValue(OpInfo, false, true, OutputRegs, InputRegs); - // FIXME: should be match fail. - assert(!InRegs.Regs.empty() && "Couldn't allocate input reg!"); + assert(!OpInfo.AssignedRegs.Regs.empty() && + "Couldn't allocate input reg!"); - InRegs.getCopyToRegs(InOperandVal, DAG, Chain, Flag, TLI.getPointerTy()); + OpInfo.AssignedRegs.getCopyToRegs(InOperandVal, DAG, Chain, Flag, + TLI.getPointerTy()); - InRegs.AddInlineAsmOperands(1/*REGUSE*/, DAG, AsmNodeOperands); + OpInfo.AssignedRegs.AddInlineAsmOperands(1/*REGUSE*/, DAG, + AsmNodeOperands); break; } case InlineAsm::isClobber: { - RegsForValue ClobberedRegs = - GetRegistersForValue(OpInfo, false, - false, OutputRegs, InputRegs); // Add the clobbered value to the operand list, so that the register // allocator is aware that the physreg got clobbered. - if (!ClobberedRegs.Regs.empty()) - ClobberedRegs.AddInlineAsmOperands(2/*REGDEF*/, DAG, AsmNodeOperands); + if (!OpInfo.AssignedRegs.Regs.empty()) + OpInfo.AssignedRegs.AddInlineAsmOperands(2/*REGDEF*/, DAG, + AsmNodeOperands); break; } } From bwendlin at apple.com Mon Apr 30 16:36:54 2007 From: bwendlin at apple.com (bwendlin at apple.com) Date: Mon, 30 Apr 2007 14:36:54 -0700 (PDT) Subject: [llvm-commits] [126738] This function isn't used when ENABLE_LLVM is defined. Message-ID: <20070430213654.1FC7A484C94@src> Revision: 126738 Author: bwendlin Date: 2007-04-30 14:36:53 -0700 (Mon, 30 Apr 2007) Log Message: ----------- This function isn't used when ENABLE_LLVM is defined. Modified Paths: -------------- apple-local/branches/llvm/gcc/varasm.c Modified: apple-local/branches/llvm/gcc/varasm.c =================================================================== --- apple-local/branches/llvm/gcc/varasm.c 2007-04-30 19:14:35 UTC (rev 126737) +++ apple-local/branches/llvm/gcc/varasm.c 2007-04-30 21:36:53 UTC (rev 126738) @@ -4634,6 +4634,8 @@ /* Given an assembly name, find the decl it is associated with. At the same time, mark it needed for cgraph. */ +/* APPLE LOCAL LLVM */ +#ifndef ENABLE_LLVM static tree find_decl_and_mark_needed (tree decl, tree target) { @@ -4671,6 +4673,8 @@ else return NULL_TREE; } +/* APPLE LOCAL LLVM */ +#endif static void do_assemble_alias (tree decl, tree target) From bwendlin at apple.com Mon Apr 30 17:03:23 2007 From: bwendlin at apple.com (bwendlin at apple.com) Date: Mon, 30 Apr 2007 15:03:23 -0700 (PDT) Subject: [llvm-commits] [126739] Merged revisions 122105, 122108, 122111, 122302, 122305, 122339, 122341, 122345-122346, 122350, 122406, 122408-122410, 122488-122489, Message-ID: <20070430220323.8E4FE4A314F@src> Revision: 126739 Author: bwendlin Date: 2007-04-30 15:03:04 -0700 (Mon, 30 Apr 2007) Log Message: ----------- Merged revisions 122105,122108,122111,122302,122305,122339,122341,122345-122346,122350,122406,122408-122410,122488-122489, 122493-122494,122654-122655,122659-122660,122673,122675,122792-122793,122797,122799,122828-122829,122858,122867-122869, 122888,122891,122893,122895-122897,122900,122903,123082,123127,123132,123134,123270,123293,123297,123338,123439,123488, 123490,123499,123501,123504,123556-123557,123560,123594,123612-123616,123618,123744,123746,123749,123792,123795,123801, 123803,123872-123873,123925-123926,123928,123930,123983,123985,123992,124029,124088,124121-124122,124124,124165,124272,124326, 124366,124368,124370,124409,124489,124496,124575,124652-124653,124655,124697-124698,124793-124794,124886,124922,124932, 124971,124974,124996-124997,125029,125031-125033,125078,125230,125233,125366,125369,125412,125415,125419,125422,125467, 125469,125526,125746-125747,125877,125916-125921,125924-125925,125949,125964,125966,126021,126083,126118,126247, 126283-126284,126286,126313,126315,126320,126347,126429,126433,126483-126484,126487,126547,126549,126624 via svnmerge from svn+ssh://src.apple.com/svn/fsf-gcc/apple-local/branches/positron Modified Paths: -------------- apple-local/branches/llvm/ChangeLog.apple apple-local/branches/llvm/build_gcc apple-local/branches/llvm/fixincludes/ChangeLog apple-local/branches/llvm/fixincludes/mkheaders.in apple-local/branches/llvm/gcc/ChangeLog apple-local/branches/llvm/gcc/ChangeLog.apple apple-local/branches/llvm/gcc/Makefile.in apple-local/branches/llvm/gcc/ada/ChangeLog apple-local/branches/llvm/gcc/ada/Makefile.in apple-local/branches/llvm/gcc/ada/adaint.c apple-local/branches/llvm/gcc/builtin-attrs.def apple-local/branches/llvm/gcc/builtin-types.def apple-local/branches/llvm/gcc/builtins.c apple-local/branches/llvm/gcc/builtins.def apple-local/branches/llvm/gcc/c-common.c apple-local/branches/llvm/gcc/c-common.h apple-local/branches/llvm/gcc/c-cppbuiltin.c apple-local/branches/llvm/gcc/c-format.c apple-local/branches/llvm/gcc/c-incpath.c apple-local/branches/llvm/gcc/c-opts.c apple-local/branches/llvm/gcc/c-parse.in apple-local/branches/llvm/gcc/c.opt apple-local/branches/llvm/gcc/calls.c apple-local/branches/llvm/gcc/cfgexpand.c apple-local/branches/llvm/gcc/collect2.c apple-local/branches/llvm/gcc/combine.c apple-local/branches/llvm/gcc/common.opt apple-local/branches/llvm/gcc/config/alpha/osf.h apple-local/branches/llvm/gcc/config/darwin-c.c apple-local/branches/llvm/gcc/config/darwin-driver.c apple-local/branches/llvm/gcc/config/darwin-protos.h apple-local/branches/llvm/gcc/config/darwin.c apple-local/branches/llvm/gcc/config/darwin.h apple-local/branches/llvm/gcc/config/fr30/fr30.h apple-local/branches/llvm/gcc/config/i386/beos-elf.h apple-local/branches/llvm/gcc/config/i386/cygwin.h apple-local/branches/llvm/gcc/config/i386/darwin.h apple-local/branches/llvm/gcc/config/i386/i386-protos.h apple-local/branches/llvm/gcc/config/i386/i386.c apple-local/branches/llvm/gcc/config/i386/i386.h apple-local/branches/llvm/gcc/config/i386/i386.md apple-local/branches/llvm/gcc/config/i386/nto.h apple-local/branches/llvm/gcc/config/i386/sol2.h apple-local/branches/llvm/gcc/config/i386/sse.md apple-local/branches/llvm/gcc/config/pa/pa-hpux10.h apple-local/branches/llvm/gcc/config/pa/pa-hpux11.h apple-local/branches/llvm/gcc/config/pa/pa64-hpux.h apple-local/branches/llvm/gcc/config/rs6000/aix.h apple-local/branches/llvm/gcc/config/rs6000/darwin.h apple-local/branches/llvm/gcc/config/rs6000/linux64.h apple-local/branches/llvm/gcc/config/rs6000/lynx.h apple-local/branches/llvm/gcc/config/rs6000/rs6000.c apple-local/branches/llvm/gcc/config/rs6000/rs6000.h apple-local/branches/llvm/gcc/config/rs6000/rs6000.md apple-local/branches/llvm/gcc/config/rs6000/sysv4.h apple-local/branches/llvm/gcc/config/svr4.h apple-local/branches/llvm/gcc/config/t-darwin apple-local/branches/llvm/gcc/config.gcc apple-local/branches/llvm/gcc/configure apple-local/branches/llvm/gcc/configure.ac apple-local/branches/llvm/gcc/cp/ChangeLog.apple apple-local/branches/llvm/gcc/cp/Make-lang.in apple-local/branches/llvm/gcc/cp/cp-tree.h apple-local/branches/llvm/gcc/cp/except.c apple-local/branches/llvm/gcc/cp/g++spec.c apple-local/branches/llvm/gcc/cp/lex.c apple-local/branches/llvm/gcc/cp/parser.c apple-local/branches/llvm/gcc/cp/rtti.c apple-local/branches/llvm/gcc/cppdefault.c apple-local/branches/llvm/gcc/defaults.h apple-local/branches/llvm/gcc/df.c apple-local/branches/llvm/gcc/doc/cpp.texi apple-local/branches/llvm/gcc/doc/extend.texi apple-local/branches/llvm/gcc/doc/invoke.texi apple-local/branches/llvm/gcc/doc/md.texi apple-local/branches/llvm/gcc/doc/tm.texi apple-local/branches/llvm/gcc/dwarf2.h apple-local/branches/llvm/gcc/dwarf2out.c apple-local/branches/llvm/gcc/function.c apple-local/branches/llvm/gcc/function.h apple-local/branches/llvm/gcc/gcc.c apple-local/branches/llvm/gcc/gimplify.c apple-local/branches/llvm/gcc/gsyslimits.h apple-local/branches/llvm/gcc/libgcc2.c apple-local/branches/llvm/gcc/limitx.h apple-local/branches/llvm/gcc/limity.h apple-local/branches/llvm/gcc/mips-tdump.c apple-local/branches/llvm/gcc/mips-tfile.c apple-local/branches/llvm/gcc/objc/ChangeLog.apple apple-local/branches/llvm/gcc/objc/objc-act.c apple-local/branches/llvm/gcc/objc/objc-act.h apple-local/branches/llvm/gcc/params.def apple-local/branches/llvm/gcc/real.c apple-local/branches/llvm/gcc/reload1.c apple-local/branches/llvm/gcc/stub-objc.c apple-local/branches/llvm/gcc/target-def.h apple-local/branches/llvm/gcc/target.h apple-local/branches/llvm/gcc/targhooks.c apple-local/branches/llvm/gcc/targhooks.h apple-local/branches/llvm/gcc/testsuite/ChangeLog apple-local/branches/llvm/gcc/testsuite/ChangeLog.apple apple-local/branches/llvm/gcc/testsuite/bugs/powerpc/g++.xfail apple-local/branches/llvm/gcc/testsuite/bugs/powerpc/gcc.xfail apple-local/branches/llvm/gcc/testsuite/bugs/powerpc/obj-c++.xfail apple-local/branches/llvm/gcc/testsuite/bugs/powerpc/objc.xfail apple-local/branches/llvm/gcc/testsuite/g++.apple/asm-block-59.C apple-local/branches/llvm/gcc/testsuite/gcc.apple/4861528.c apple-local/branches/llvm/gcc/testsuite/gcc.apple/asm-block-59.c apple-local/branches/llvm/gcc/testsuite/gcc.apple/i386-bitmask1.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/darwin64-abi.c apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/basic.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/bitfield-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/bitfield-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/bitfield-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/bitfield-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/class-attribute-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/comp-types-11.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/comp-types-12.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/comp-types-13.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/comp-types-9.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/const-cfstring-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/const-cfstring-5.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/const-cfstring-6.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/const-str-13.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/const-str-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/const-str-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/const-str-7.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/const-str-8.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/const-str-9.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/cxx-ivars-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/cxx-ivars-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/cxx-scope-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/cxx-scope-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/defs-warn-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/defs.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/dwarf-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/dwarf-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/encode-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/encode-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/encode-6.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/encode-7.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/fix-and-continue-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/gnu-runtime-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/gnu-runtime-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/gnu-runtime-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/isa-field-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/ivar-list-semi.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/layout-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/local-decl-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/lookup-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/lvalue-cast-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/message-metadata-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/method-10.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/method-11.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/method-13.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/method-15.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/method-17.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/method-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/method-21.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/method-22.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/method-23.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/method-6.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/method-attribute-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-copy-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-copy-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-deprecated-attr-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-dot-syntax-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-dotsyntax-setter-getter-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-dotsyntax-setter-getter-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-impl-nowarn-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-lookup-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-lookup-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-lookup-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-lookup-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-lookup-5.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-lookup-6.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-neg-ivar-check-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-neg-warn-ro-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-neg-warn-unimp-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-nowarn-compound-exp.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-redundant-decl-accessor.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-retain-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-retain-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-setter-getter-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-syntax-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-type-conv-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-unimplementd-property-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-weak-attribute-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-weak-attribute-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-weak-attribute-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/no-extra-load.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/no-typedef-ivar.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-10.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-11.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-5.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-6.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-7.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-8.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-9.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-nil-collection-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-gc-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-gc-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-gc-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-gc-5.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-gc-6.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-gc-8.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-gc-9.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-gc-section-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-gc-section-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-static-cast-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-static-cast-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-stret-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-4698856.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-defs-ok.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-ivar-test-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-protocol-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-protocol-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-protocol-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-protocol-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-protocol-5.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-protocol-7.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-protocol-9.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-super-class-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-visibility-hidden-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-visibility-hidden-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-10.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-11.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-12.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-13.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-14.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-15.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-16.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-17.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-18.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-19.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-20.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-5.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-6.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-7.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-8.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-9.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-bycopy-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-bycopy-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-bycopy-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-byref-default-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-dwarf-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-incr-decr-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-metadata-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-metadata-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-metadata-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-metadata-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-metadata-5.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-neg-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-neg-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-neg-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-neg-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-neg-5.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-neg-6.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-neg-7.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-neg-8.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-weak-attribute-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-weak-attribute-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-weak-attribute-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-weak-attribute-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/proto-lossage-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/proto-lossage-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/proto-lossage-7.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/qual-types-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/selector-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/selector-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/stabs-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/stabs-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/stabs-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/stubify-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/super-class-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/syntax-error-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/template-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/template-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/template-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/template-objc2-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/try-catch-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/try-catch-11.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/try-catch-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/try-catch-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/try-catch-7.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/try-catch-8.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/try-catch-9.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/typedef-alias-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/unknown-receiver.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/va-meth-1.mm apple-local/branches/llvm/gcc/testsuite/objc/execute/Object2.h apple-local/branches/llvm/gcc/testsuite/objc.dg/bitfield-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/category-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/class-attribute-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/const-cfstring-4-64bit.m apple-local/branches/llvm/gcc/testsuite/objc.dg/const-cfstring-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/const-cfstring-6.m apple-local/branches/llvm/gcc/testsuite/objc.dg/const-str-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/const-str-13.m apple-local/branches/llvm/gcc/testsuite/objc.dg/const-str-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/const-str-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/const-str-7.m apple-local/branches/llvm/gcc/testsuite/objc.dg/const-str-8.m apple-local/branches/llvm/gcc/testsuite/objc.dg/encode-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/encode-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/encode-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/encode-5.m apple-local/branches/llvm/gcc/testsuite/objc.dg/encode-7a.m apple-local/branches/llvm/gcc/testsuite/objc.dg/func-ptr-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/gnu-runtime-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/gnu-runtime-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/image-info.m apple-local/branches/llvm/gcc/testsuite/objc.dg/layout-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/message-metadata-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/method-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/method-attribute-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-copy-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-copy-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-deprecated-attr-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-dot-syntax-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-dotsyntax-setter-getter-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-dotsyntax-setter-getter-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-dotsyntax-warn-setter-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-impl-nowarn-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-lookup-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-lookup-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-lookup-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-lookup-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-lookup-5.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-lookup-6.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-neg-ivar-check-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-neg-warn-ro-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-neg-warn-unimp-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-nowarn-compound-exp.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-nowarn-readonly-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-redundant-decl-accessor.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-retain-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-retain-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-setter-getter-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-syntax-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-type-conv-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-unimplementd-property-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-warn-weak-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-weak-attribute-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-weak-attribute-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-weak-attribute-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/next-runtime-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-dir-dispatch.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-10.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-11.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-5.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-6.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-7.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-8.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-9.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-nil-collection-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-fpret-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-fpret-64bit-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-gc-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-gc-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-gc-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-gc-5.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-gc-7.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-gc-section-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-gc-section-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-4698856.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-alignment-test-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-const-str-64bit-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-defs-ok.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-ivar-test-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-protocol-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-protocol-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-protocol-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-protocol-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-protocol-5.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-protocol-7.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-protocol-9.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-protocol-enc-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-super-class-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-visibility-hidden-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-visibility-hidden-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-warn-prev-osx-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-10.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-11.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-12.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-13.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-14.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-15.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-16.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-17.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-18.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-5.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-6.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-7.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-8.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-9.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-bycopy-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-bycopy-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-bycopy-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-bycopy-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-byref-default-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-dwarf-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-incr-decr-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-metadata-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-metadata-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-metadata-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-metadata-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-metadata-5.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-neg-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-neg-10.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-neg-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-neg-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-neg-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-neg-5.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-neg-6.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-neg-7.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-neg-8.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-neg-9.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-weak-attribute-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-weak-attribute-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-weak-attribute-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-weak-attribute-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/propperty-neg-8.m apple-local/branches/llvm/gcc/testsuite/objc.dg/proto-qual-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/selector-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/special/unclaimed-category-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/stret-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/stubify-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/symtab-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/threedotthree-abi-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/try-catch-15.m apple-local/branches/llvm/gcc/testsuite/objc.dg/type-size-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/volatile-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/zero-link-2.m apple-local/branches/llvm/gcc/tlink.c apple-local/branches/llvm/gcc/toplev.c apple-local/branches/llvm/gcc/toplev.h apple-local/branches/llvm/gcc/tree-optimize.c apple-local/branches/llvm/gcc/tree-pass.h apple-local/branches/llvm/gcc/tree-ssa-ccp.c apple-local/branches/llvm/gcc/tree.h apple-local/branches/llvm/gcc/version.c Added Paths: ----------- apple-local/branches/llvm/driverdriver.c apple-local/branches/llvm/gcc/testsuite/g++.apple/4905666.C apple-local/branches/llvm/gcc/testsuite/g++.apple/format-security-attribute-1.C apple-local/branches/llvm/gcc/testsuite/g++.apple/format-security-attribute-2.C apple-local/branches/llvm/gcc/testsuite/g++.apple/r5119788.C apple-local/branches/llvm/gcc/testsuite/g++.dg/eh/cond3.C apple-local/branches/llvm/gcc/testsuite/g++.dg/other/darwin-minversion-1.C apple-local/branches/llvm/gcc/testsuite/g++.dg/rtti/darwin-builtin-linkage.C apple-local/branches/llvm/gcc/testsuite/gcc.apple/4134510.c apple-local/branches/llvm/gcc/testsuite/gcc.apple/4639472.c apple-local/branches/llvm/gcc/testsuite/gcc.apple/4968055.c apple-local/branches/llvm/gcc/testsuite/gcc.apple/format-security-attribute-1.c apple-local/branches/llvm/gcc/testsuite/gcc.apple/format-security-attribute-2.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/chk.h apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/lib/chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/memcpy-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/memcpy-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/memmove-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/memmove-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/mempcpy-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/mempcpy-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/memset-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/memset-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/pr23484-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/pr23484-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/snprintf-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/snprintf-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/sprintf-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/sprintf-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/stpcpy-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/stpcpy-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/strcat-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/strcat-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/strcpy-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/strcpy-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/strncat-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/strncat-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/strncpy-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/strncpy-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/vsnprintf-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/vsnprintf-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/vsprintf-chk-lib.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/builtins/vsprintf-chk.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/fprintf-1.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/fprintf-chk-1.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/pr29302-1.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/printf-1.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/printf-chk-1.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/vfprintf-1.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/vfprintf-chk-1.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/vprintf-1.c apple-local/branches/llvm/gcc/testsuite/gcc.c-torture/execute/vprintf-chk-1.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/builtin-stringop-chk-1.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/builtin-stringop-chk-2.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/darwin-comm.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/darwin-minversion-1.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/darwin-minversion-2.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/ssp-1.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/ssp-2.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/tree-ssa/builtin-fprintf-1.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/tree-ssa/builtin-fprintf-chk-1.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/tree-ssa/builtin-printf-1.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/tree-ssa/builtin-printf-chk-1.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/tree-ssa/builtin-vfprintf-1.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/tree-ssa/builtin-vfprintf-chk-1.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/tree-ssa/builtin-vprintf-1.c apple-local/branches/llvm/gcc/testsuite/gcc.dg/tree-ssa/builtin-vprintf-chk-1.c apple-local/branches/llvm/gcc/testsuite/gcc.target/i386/5131847.c apple-local/branches/llvm/gcc/testsuite/gcc.target/i386/reload-1.c apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/cxx-ivars-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/format-security-attribute-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/format-security-attribute-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/format-security-attribute-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/method-copyctor-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-anon-category-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-anon-category-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-anon-category-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-anon-category-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-anon-category-5.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-anon-category-6.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-atomic-neg-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-atomiccopy-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-atomiccopy.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-atomicretained-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-atomicretained.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-category-impl-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-compound-setter-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-nested-synthesis-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-no-protocol-warn-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-protocol-lookup-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-setter-decl-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-typedef-mangle-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-elem-collection-elem.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-foreach-lvalue-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-gc-11.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-gc-assign-ivar-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-gc-section-3.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-visibility-hidden-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc-weak-pointer.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-bitfield-abi-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-cplus-try-catch-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-ivar-test-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-none-fragile-ivar-use.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-package-ivar-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/objc2-try-catch-neg-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/try-catch-20.mm apple-local/branches/llvm/gcc/testsuite/objc.dg/format-security-attribute-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/format-security-attribute-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/format-security-attribute-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/format-security-attribute-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-anon-category-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-anon-category-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-anon-category-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-anon-category-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-anon-category-5.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-anon-category-6.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-atomic-neg-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-atomiccopy-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-atomiccopy.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-atomicretained-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-atomicretained.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-category-impl-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-compound-setter-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-forward-class-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-nested-synthesis-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-no-protocol-warn-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-protocol-lookup-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-setter-decl-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-typedef-mangle-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-elem-collection-elem.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-foreach-lvalue-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-gc-9.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-gc-assign-ivar-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-gc-section-3.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-visibility-hidden-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-weak-pointer.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-bitfield-abi-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-ivar-layout-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-ivar-test-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-none-fragile-ivar-use.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-package-ivar-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-try-catch-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc2-try-catch-neg-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/try-catch-17.m apple-local/branches/llvm/gcc/testsuite/objc.dg/volatile-1-x86-64.m apple-local/branches/llvm/gcc/tree-object-size.c Removed Paths: ------------- apple-local/branches/llvm/gcc/testsuite/gcc.dg/darwin-ld-6.c apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/hybrid-abi-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/hybrid-abi-2.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-copy-1.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/newproperty-copy-4.mm apple-local/branches/llvm/gcc/testsuite/obj-c++.dg/property-metadata-6.mm apple-local/branches/llvm/gcc/testsuite/objc.dg/hybrid-abi-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/hybrid-abi-2.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-copy-1.m apple-local/branches/llvm/gcc/testsuite/objc.dg/newproperty-copy-4.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-gc-1-64bit.m apple-local/branches/llvm/gcc/testsuite/objc.dg/objc-gc-5-64bit.m apple-local/branches/llvm/gcc/testsuite/objc.dg/property-metadata-6.m apple-local/branches/llvm/sdk apple-local/branches/llvm/sdk-test Property Changed: ---------------- apple-local/branches/llvm/ Property changes on: apple-local/branches/llvm ___________________________________________________________________ Name: svnmerge-integrated - /apple-local/branches/positron:1-122101 + /apple-local/branches/positron:1-126649 Modified: apple-local/branches/llvm/ChangeLog.apple =================================================================== --- apple-local/branches/llvm/ChangeLog.apple 2007-04-30 21:36:53 UTC (rev 126738) +++ apple-local/branches/llvm/ChangeLog.apple 2007-04-30 22:03:04 UTC (rev 126739) @@ -1,3 +1,14 @@ +2007-03-21 Mike Stump + + Radar 5048438 + * build_gcc: Add links for as and ld so the driver can find them + even when they aren't in the path. + +2007-03-15 Mike Stump + + Radar 5020628 + * build_gcc: Stubify libstdc++.dylib instead of symlinking. + 2007-03-15 Geoffrey Keating * build_gcc: Unset RC_DEBUG_OPTIONS when bootstrapping. Modified: apple-local/branches/llvm/build_gcc =================================================================== --- apple-local/branches/llvm/build_gcc 2007-04-30 21:36:53 UTC (rev 126738) +++ apple-local/branches/llvm/build_gcc 2007-04-30 22:03:04 UTC (rev 126739) @@ -387,6 +387,8 @@ cp -p $DIR/dst-$BUILD-$t$SL/$f .$DL/$f || exit 1 fi done + ln -s ../../../../bin/as .$DL/as + ln -s ../../../../bin/ld .$DL/ld done # bin @@ -452,9 +454,10 @@ done for t in $TARGETS ; do - ln -s ../../../libstdc++.6.dylib \ + cp -p /usr/lib/libstdc++.6.dylib \ .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib \ || exit 1 + strip -x -c .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib || exit 1 done # include @@ -494,7 +497,7 @@ # Build driver-driver using fully-named drivers for h in $HOSTS ; do $h-apple-darwin$DARWIN_VERS-gcc-$VERS \ - $ORIG_SRC_DIR/gcc/config/darwin-driver.c \ + $ORIG_SRC_DIR/driverdriver.c \ -DPDN="\"-apple-darwin$DARWIN_VERS-gcc-$VERS\"" \ -DIL="\"$DEST_ROOT/bin/\"" -I $ORIG_SRC_DIR/include \ -I $ORIG_SRC_DIR/gcc -I $ORIG_SRC_DIR/gcc/config \ @@ -504,7 +507,7 @@ -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-gcc-$MAJ_VERS || exit 1 $h-apple-darwin$DARWIN_VERS-gcc-$VERS \ - $ORIG_SRC_DIR/gcc/config/darwin-driver.c \ + $ORIG_SRC_DIR/driverdriver.c \ -DPDN="\"-apple-darwin$DARWIN_VERS-g++-$VERS\"" \ -DIL="\"$DEST_ROOT/bin/\"" -I $ORIG_SRC_DIR/include \ -I $ORIG_SRC_DIR/gcc -I $ORIG_SRC_DIR/gcc/config \ @@ -525,9 +528,6 @@ rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-gcc-$MAJ_VERS || exit 1 rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-g++-$MAJ_VERS || exit 1 -# Build sdk bits -#$SRC_DIR/sdk "$DEST_DIR" "$MAJ_VERS" "$VERS" "$TARGETS" || exit 1 - ######################################## # Create SYM_DIR with information required for debugging. @@ -542,7 +542,7 @@ # Save .dSYM files and .a archives cd $DEST_DIR || exit 1 -find . \( -name \*.dSYM -or -name \*.a \) -print \ +find . \( -path \*.dSYM/\* -or -name \*.a \) -print \ | cpio -pdml $SYM_DIR || exit 1 # Save source files. mkdir $SYM_DIR/src || exit 1 @@ -553,7 +553,7 @@ # Remove debugging information from DEST_DIR. find $DEST_DIR -perm -0111 \! -name \*.dylib \! -name fixinc.sh \ - \! -name mkheaders -type f -print \ + \! -name mkheaders \! -name libstdc++.dylib -type f -print \ | xargs strip || exit 1 # APPLE LOCAL begin LLVM - Strip with -Sx instead of -SX find $DEST_DIR \( -name \*.a -or -name \*.dylib \) \ Copied: apple-local/branches/llvm/driverdriver.c (from rev 126624, apple-local/branches/positron/driverdriver.c) =================================================================== --- apple-local/branches/llvm/driverdriver.c (rev 0) +++ apple-local/branches/llvm/driverdriver.c 2007-04-30 22:03:04 UTC (rev 126739) @@ -0,0 +1,1550 @@ +/* APPLE LOCAL file driver driver */ +/* Darwin driver program that handles -arch commands and invokes + appropriate compiler driver. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "libiberty.h" +#include "filenames.h" +#include "stdbool.h" +/* Hack!. + Pay the price for including darwin.h. */ +typedef int tree; +#define GTY(x) /* nothing */ +/* Include darwin.h for SWITCH_TAKES_ARG and + WORD_SWIATCH_TAKES_ARG. */ + +#include "darwin.h" + +/* Include gcc.h for DEFAULT_SWITCH_TAKES_ARG and + DEFAULT_WORD_SWIATCH_TAKES_ARG. */ + +#include "gcc.h" + +/* This program name. */ +const char *progname; + +/* driver prefix. */ +const char *driver_exec_prefix; + +/* driver prefix length. */ +int prefix_len; + +/* current working directory. */ +char *curr_dir; + +/* Use if -o flag is absent. */ +const char *final_output = "a.out"; + +/* Variabless to track presence and/or absence of important command + line options. */ +int compile_only_request = 0; +int asm_output_request = 0; +int dash_capital_m_seen = 0; +int preprocessed_output_request = 0; +int ima_is_used = 0; +int dash_dynamiclib_seen = 0; +int verbose_flag = 0; +int save_temps_seen = 0; + +/* Support at the max 10 arch. at a time. This is historical limit. */ +#define MAX_ARCHES 10 + +/* Name of user supplied architectures. */ +const char *arches[MAX_ARCHES]; + +/* -arch counter. */ +static int num_arches; + +/* Input filenames. */ +struct input_filename +{ + const char *name; + int index; + struct input_filename *next; +}; +struct input_filename *in_files; +struct input_filename *last_infile; + +static int num_infiles; + +/* User specified output file name. */ +const char *output_filename = NULL; + +/* Output file names used for arch specific driver invocation. These + are input file names for 'lipo'. */ +const char **out_files; +static int num_outfiles; + +/* Architecture names used by config.guess does not match the names + used by NXGet... Use this hand coded mapping to connect them. */ +struct arch_config_guess_map +{ + const char *arch_name; + const char *config_string; +}; + +struct arch_config_guess_map arch_config_map [] = +{ + {"i386", "i686"}, + {"ppc", "powerpc"}, + {"ppc64", "powerpc"}, + /* APPLE LOCAL x86_64 support 2006-02-02 */ + {"x86_64", "i686"}, + {NULL, NULL} +}; + +/* List of interpreted command line flags. Supply this to gcc driver. */ +const char **new_argv; +int new_argc; + +/* Argument list for 'lipo'. */ +const char **lipo_argv; + +/* Info about the sub process. Need one subprocess for each arch plus + additional one for 'lipo'. */ +struct command +{ + const char *prog; + const char **argv; + int pid; +} commands[MAX_ARCHES+1]; + +/* total number of argc. */ +static int total_argc; + +static int greatest_status = 0; +static int signal_count = 0; + +#ifndef SWITCH_TAKES_ARG +#define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG(CHAR) +#endif + +#ifndef WORD_SWITCH_TAKES_ARG +#define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR) +#endif + + +/* Local function prototypes. */ +static const char * get_arch_name (const char *); +static char * get_driver_name (const char *); +static void delete_out_files (void); +static char * strip_path_and_suffix (const char *, const char *); +static void initialize (void); +static void final_cleanup (void); +static int do_wait (int, const char *); +static int do_lipo (int, const char *); +static int do_compile (const char **, int); +static int do_compile_separately (void); +static int do_lipo_separately (void); +static int add_arch_options (int, const char **, int); +static int remove_arch_options (const char**, int); +static void add_arch (const char *); +static const char *resolve_symlink (const char *, char *, int, int); +static const char *resolve_path_to_executable (const char *filename); +static int get_prog_name_len (const char *prog); + +/* Find arch name for the given input string. If input name is NULL then local + arch name is used. */ + +static const char * +get_arch_name (const char *name) +{ + const NXArchInfo * a_info; + const NXArchInfo * all_info; + cpu_type_t cputype; + struct arch_config_guess_map *map; + const char *aname; + + if (name) + { + /* Find config name based on arch name. */ + aname = NULL; + map = arch_config_map; + while (map->arch_name) + { + if (!strcmp (map->arch_name, name)) + return name; + else map++; + } + a_info = NXGetArchInfoFromName (name); + } + else + a_info = NXGetLocalArchInfo (); + + if (!a_info) + fatal ("Invalid arch name : %s", name); + + all_info = NXGetAllArchInfos(); + + if (!all_info) + fatal ("Unable to get architecture information"); + + /* Find first arch. that matches cputype. */ + cputype = a_info->cputype; + + while (all_info->name) + { + if (all_info->cputype == cputype) + break; + else + all_info++; + } + + return all_info->name; +} + +/* Find driver name based on input arch name. */ + +static char * +get_driver_name (const char *arch_name) +{ + char *driver_name; + const char *config_name; + int len; + int index; + struct arch_config_guess_map *map; + + /* find config name based on arch name. */ + config_name = NULL; + map = arch_config_map; + while (map->arch_name) + { + if (!strcmp (map->arch_name, arch_name)) + { + config_name = map->config_string; + break; + } + else map++; + } + + if (!config_name) + fatal ("Unable to guess config name for arch %s", arch_name); + + len = strlen (config_name) + strlen (PDN) + prefix_len + 1; + driver_name = (char *) malloc (sizeof (char) * len); + driver_name[0] = '\0'; + + if (driver_exec_prefix) + strcpy (driver_name, driver_exec_prefix); + strcat (driver_name, config_name); + strcat (driver_name, PDN); + + return driver_name; +} + +/* Delete out_files. */ + +static void +delete_out_files (void) +{ + const char *temp; + struct stat st; + int i = 0; + + for (i = 0, temp = out_files[i]; + temp && i < total_argc * MAX_ARCHES; + temp = out_files[++i]) + if (stat (temp, &st) >= 0 && S_ISREG (st.st_mode)) + unlink (temp); + +} + +/* Put fatal error message on stderr and exit. */ + +void +fatal (const char *msgid, ...) +{ + va_list ap; + + va_start (ap, msgid); + + fprintf (stderr, "%s: ", progname); + vfprintf (stderr, msgid, ap); + va_end (ap); + fprintf (stderr, "\n"); + delete_out_files (); + exit (1); +} + +/* Print error message and exit. */ + +static void +pfatal_pexecute (const char *errmsg_fmt, const char *errmsg_arg) +{ + if (errmsg_arg) + { + int save_errno = errno; + + /* Space for trailing '\0' is in %s. */ + char *msg = (char *) malloc (strlen (errmsg_fmt) + strlen (errmsg_arg)); + sprintf (msg, errmsg_fmt, errmsg_arg); + errmsg_fmt = msg; + + errno = save_errno; + } + + fprintf (stderr,"%s: %s: %s", progname, errmsg_fmt, xstrerror (errno)); + delete_out_files (); + exit (1); +} + +#ifdef DEBUG +static void +debug_command_line (const char **debug_argv, int debug_argc) +{ + int i; + + fprintf (stderr,"%s: debug_command_line\n", progname); + fprintf (stderr,"%s: arg count = %d\n", progname, debug_argc); + + for (i = 0; debug_argv[i]; i++) + fprintf (stderr,"%s: arg [%d] %s\n", progname, i, debug_argv[i]); +} +#endif + +/* Strip directory name from the input file name and replace file name + suffix with new. */ + +static char * +strip_path_and_suffix (const char *full_name, const char *new_suffix) +{ + char *name; + char *p; + + if (!full_name || !new_suffix) + return NULL; + + /* Strip path name. */ + p = (char *)full_name + strlen (full_name); + while (p != full_name && !IS_DIR_SEPARATOR (p[-1])) + --p; + + /* Now 'p' is a file name with suffix. */ + name = (char *) malloc (strlen (p) + 1 + strlen (new_suffix)); + + strcpy (name, p); + + p = name + strlen (name); + while (p != name && *p != '.') + --p; + + /* If did not reach at the beginning of name then '.' is found. + Replace '.' with NULL. */ + if (p != name) + *p = '\0'; + + strcat (name, new_suffix); + return name; +} + +/* Initialization */ + +static void +initialize (void) +{ + + int i; + + /* Let's count, how many additional arguments driver driver will supply + to compiler driver: + + Each "-arch" "" is replaced by approriate "-mcpu=". + That leaves one additional arg space available. + + Note that only one -m* is supplied to each compiler driver. Which + means, extra "-arch" "" are removed from the original command + line. But lets not count how many additional slots are available. + + Driver driver may need to specify temp. output file name, say + "-o" "foobar". That needs two extra argments. + + Sometimes linker wants one additional "-Wl,-arch_multiple". + + Sometimes linker wants to see "-final_output" "outputname". + + In the end, we may need five extra arguments, plus one extra + space for the NULL terminator. */ + + new_argv = (const char **) malloc ((total_argc + 6) * sizeof (const char *)); + if (!new_argv) + abort (); + + /* First slot, new_argv[0] is reserved for the driver name. */ + new_argc = 1; + + /* For each -arch, three arguments are needed. + For example, "-arch" "ppc" "file". Additional slots are for + "lipo" "-create" "-o" "outputfilename" and the NULL. */ + lipo_argv = (const char **) malloc ((total_argc * 3 + 5) * sizeof (const char *)); + if (!lipo_argv) + abort (); + + /* Need separate out_files for each arch, max is MAX_ARCHES. + Need separate out_files for each input file. */ + + out_files = (const char **) malloc ((total_argc * MAX_ARCHES) * sizeof (const char *)); + if (!out_files) + abort (); + + num_arches = 0; + num_infiles = 0; + + in_files = NULL; + last_infile = NULL; + + for (i = 0; i < (MAX_ARCHES + 1); i++) + { + commands[i].prog = NULL; + commands[i].argv = NULL; + commands[i].pid = 0; + } +} + +/* Cleanup. */ + +static void +final_cleanup (void) +{ + int i; + struct input_filename *next; + delete_out_files (); + free (new_argv); + free (lipo_argv); + free (out_files); + + for (i = 0, next = in_files; + i < num_infiles && next; + i++) + { + next = in_files->next; + free (in_files); + in_files = next; + } +} + +/* Wait for the process pid and return appropriate code. */ + +static int +do_wait (int pid, const char *prog) +{ + int status = 0; + int ret = 0; + + pid = pwait (pid, &status, 0); + + if (WIFSIGNALED (status)) + { + if (!signal_count && + WEXITSTATUS (status) > greatest_status) + greatest_status = WEXITSTATUS (status); + ret = -1; + } + else if (WIFEXITED (status) + && WEXITSTATUS (status) >= 1) + { + if (WEXITSTATUS (status) > greatest_status) + greatest_status = WEXITSTATUS (status); + signal_count++; + ret = -1; + } + return ret; +} + +/* Invoke 'lipo' and combine and all output files. */ + +static int +do_lipo (int start_outfile_index, const char *out_file) +{ + int i, j, pid; + char *errmsg_fmt, *errmsg_arg; + + /* Populate lipo arguments. */ + lipo_argv[0] = "lipo"; + lipo_argv[1] = "-create"; + lipo_argv[2] = "-o"; + lipo_argv[3] = out_file; + + /* Already 4 lipo arguments are set. Now add all lipo inputs. */ + j = 4; + for (i = 0; i < num_arches; i++) + lipo_argv[j++] = out_files[start_outfile_index + i]; + + /* Add the NULL at the end. */ + lipo_argv[j++] = NULL; + +#ifdef DEBUG + debug_command_line (lipo_argv, j); +#endif + + if (verbose_flag) + { + for (i = 0; lipo_argv[i]; i++) + fprintf (stderr, "%s ", lipo_argv[i]); + fprintf (stderr, "\n"); + } + pid = pexecute (lipo_argv[0], (char *const *)lipo_argv, progname, NULL, &errmsg_fmt, + &errmsg_arg, PEXECUTE_SEARCH | PEXECUTE_LAST); + + if (pid == -1) + pfatal_pexecute (errmsg_fmt, errmsg_arg); + + return do_wait (pid, lipo_argv[0]); +} + +/* Invoke compiler for all architectures. */ + +static int +do_compile (const char **current_argv, int current_argc) +{ + char *errmsg_fmt, *errmsg_arg; + int index = 0; + int ret = 0; + + int dash_o_index = current_argc; + int of_index = current_argc + 1; + int argc_count = current_argc + 2; + + while (index < num_arches) + { + int additional_arch_options = 0; + + current_argv[0] = get_driver_name (get_arch_name (arches[index])); + + /* setup output file. */ + out_files[num_outfiles] = make_temp_file (".out"); + current_argv[dash_o_index] = "-o"; + current_argv[of_index] = out_files [num_outfiles]; + num_outfiles++; + + /* Add arch option as the last option. Do not add any other option + before removing this option. */ + additional_arch_options = add_arch_options (index, current_argv, argc_count); + argc_count += additional_arch_options; + + commands[index].prog = current_argv[0]; + commands[index].argv = current_argv; + + current_argv[argc_count] = NULL; + +#ifdef DEBUG + debug_command_line (current_argv, argc_count); +#endif + commands[index].pid = pexecute (current_argv[0], + (char *const *)current_argv, + progname, NULL, + &errmsg_fmt, + &errmsg_arg, + PEXECUTE_SEARCH | PEXECUTE_LAST); + + if (commands[index].pid == -1) + pfatal_pexecute (errmsg_fmt, errmsg_arg); + + /* Remove the last arch option added in the current_argv list. */ + if (additional_arch_options) + argc_count -= remove_arch_options (current_argv, argc_count); + index++; + } + + index = 0; + while (index < num_arches) + { + ret = do_wait (commands[index].pid, commands[index].prog); + fflush (stdout); + index++; + } + return ret; +} + +/* Invoke compiler for each input file separately. + Construct command line for each invocation with one input file. */ + +static int +do_compile_separately (void) +{ + const char **new_new_argv; + int i, new_new_argc; + struct input_filename *current_ifn; + + if (num_infiles == 1 || ima_is_used) + abort (); + + /* Total number of arguments in separate compiler invocation is : + total number of original arguments - total no input files + one input + file + "-o" + output file . */ + new_new_argv = (const char **) malloc ((new_argc - num_infiles + 4) * sizeof (const char *)); + if (!new_new_argv) + abort (); + + for (current_ifn = in_files; current_ifn && current_ifn->name; + current_ifn = current_ifn->next) + { + struct input_filename *ifn = in_files; + int go_back = 0; + new_new_argc = 1; + + for (i = 1; i < new_argc; i++) + { + + if (ifn && ifn->name && !strcmp (new_argv[i], ifn->name)) + { + /* This argument is one of the input file. */ + + if (!strcmp (new_argv[i], current_ifn->name)) + { + /* If it is current input file name then add it in the new + list. */ + new_new_argv[new_new_argc++] = new_argv[i]; + } + /* This input file can not appear in + again on the command line so next time look for next input + file. */ + ifn = ifn->next; + } + else + { + /* This argument is not a input file name. Add it into new + list. */ + new_new_argv[new_new_argc++] = new_argv[i]; + } + } + + /* OK now we have only one input file and all other arguments. */ + do_compile (new_new_argv, new_new_argc); + } +} + +/* Invoke 'lipo' on set of output files and create multile FAT binaries. */ + +static int +do_lipo_separately (void) +{ + int ifn_index; + struct input_filename *ifn; + for (ifn_index = 0, ifn = in_files; + ifn_index < num_infiles && ifn && ifn->name; + ifn_index++, ifn = ifn->next) + do_lipo (ifn_index * num_arches, + strip_path_and_suffix (ifn->name, ".o")); +} + +/* Replace -arch options with appropriate "-mcpu=" OR + "-march=". INDEX is the index in arches[] table. */ + +static int +add_arch_options (int index, const char **current_argv, int arch_index) +{ + + int count; + + /* We are adding 1 argument for selected arches. */ + count = 1; + +#ifdef DEBUG + fprintf (stderr, "%s: add_arch_options: %s\n", progname, arches[index]); +#endif + + if (!strcmp (arches[index], "ppc601")) + current_argv[arch_index] = "-mcpu=601"; + else if (!strcmp (arches[index], "ppc603")) + current_argv[arch_index] = "-mcpu=603"; + else if (!strcmp (arches[index], "ppc604")) + current_argv[arch_index] = "-mcpu=604"; + else if (!strcmp (arches[index], "ppc604e")) + current_argv[arch_index] = "-mcpu=604e"; + else if (!strcmp (arches[index], "ppc750")) + current_argv[arch_index] = "-mcpu=750"; + else if (!strcmp (arches[index], "ppc7400")) + current_argv[arch_index] = "-mcpu=7400"; + else if (!strcmp (arches[index], "ppc7450")) + current_argv[arch_index] = "-mcpu=7450"; + else if (!strcmp (arches[index], "ppc970")) + current_argv[arch_index] = "-mcpu=970"; + else if (!strcmp (arches[index], "ppc64")) + current_argv[arch_index] = "-m64"; + else if (!strcmp (arches[index], "i486")) + current_argv[arch_index] = "-march=i486"; + else if (!strcmp (arches[index], "i586")) + current_argv[arch_index] = "-march=i586"; + else if (!strcmp (arches[index], "i686")) + current_argv[arch_index] = "-march=i686"; + else if (!strcmp (arches[index], "pentium")) + current_argv[arch_index] = "-march=pentium"; + else if (!strcmp (arches[index], "pentium2")) + current_argv[arch_index] = "-march=pentium2"; + else if (!strcmp (arches[index], "pentpro")) + current_argv[arch_index] = "-march=pentiumpro"; + else if (!strcmp (arches[index], "pentIIm3")) + current_argv[arch_index] = "-march=pentium2"; + /* APPLE LOCAL begin x86_64 support 2006-02-02 */ + else if (!strcmp (arches[index], "x86_64")) + current_argv[arch_index] = "-m64"; + /* APPLE LOCAL end x86_64 support 2006-02-02 */ + else + count = 0; + + return count; +} + +/* Remove the last option, which is arch option, added by + add_arch_options. Return how count of arguments removed. */ +static int +remove_arch_options (const char **current_argv, int arch_index) +{ +#ifdef DEBUG + fprintf (stderr, "%s: Removing argument no %d\n", progname, arch_index); +#endif + + current_argv[arch_index] = '\0'; + +#ifdef DEBUG + debug_command_line (current_argv, arch_index); +#endif + + return 1; +} + +/* Add new arch request. */ +void +add_arch (const char *new_arch) +{ + int i; + + /* User can say cc -arch ppc -arch ppc foo.c + Do not invoke ppc compiler twice in this case. */ + for (i = 0; i < num_arches; i++) + { + if (!strcmp (arches[i], new_arch)) + return; + } + + arches[num_arches] = new_arch; + num_arches++; +} + +/* Rewrite the command line as requested in the QA_OVERRIDE_GCC3_OPTIONS + environment variable -- used for testing the compiler, working around bugs + in the Apple build environment, etc. + + The override string is made up of a set of space-separated clauses. The + first letter of each clause describes what's to be done: + +string Add string as a new argument (at the end of the command line). + Multi-word command lines can be added with +x +y + s/x/y/ substitute x for y in the command line. X must be an entire + argument, and can be a regular expression as accepted by the + POSIX regexp code. Y will be substituted as a single argument, + and will not have regexp replacements added in. + xoption Removes argument matching option + Xoption Removes argument matching option and following word + Ox Removes any optimization flags in command line and replaces + with -Ox. + + + Here's some examples: + O2 + s/precomp-trustfile=foo// + +-fexplore-antartica + +-fast + s/-fsetvalue=* // + x-fwritable-strings + s/-O[0-2]/-Osize/ + x-v + X-o +-o +foo.o + + Option substitutions are processed from left to right; matches and changes + are cumulative. An error in processing one element (such as trying to + remove an element and successor when the match is at the end) cause the + particular change to stop, but additional changes in the environment + variable to be applied. + + Key details: + * we always want to be able to adjust optimization levels for testing + * adding options is a common task + * substitution and deletion are less common. + + If the first character of the environment variable is #, changes are + silent. If not, diagnostics are written to stderr explaining what + changes are being performed. + +*/ + +char **arg_array; +int arg_array_size=0; +int arg_count = 0; +int confirm_changes = 1; +const int ARG_ARRAY_INCREMENT_SIZE = 8; +#define FALSE 0 + +/* Routines for the argument array. The argument array routines are + responsible for allocation and deallocation of all objects in the + array */ + +void read_args (int argc, char **argv) +{ + int i; + + arg_array_size = argc+10; + arg_count = argc; + arg_array = (char**) malloc(sizeof(char*)*arg_array_size); + + for (i=0;i pos; i--) { + arg_array[i+1] = arg_array[i]; + } + + arg_array[pos] = newArg; + arg_count++; + + if (confirm_changes) + fprintf(stderr,"### Adding argument %s at position %d\n",arg_to_insert, pos); +} + + +void replace_arg (char *str, int pos) { + char *newArg = malloc(strlen(str)+1); + strcpy(newArg,str); + + if (confirm_changes) + fprintf (stderr,"### Replacing %s with %s\n",arg_array[pos], str); + + free (arg_array[pos]); + arg_array[pos] = newArg; +} + +void append_arg (char *str) +{ + char *new_arg = malloc (strlen (str)+1); + strcpy (new_arg, str); + if (confirm_changes) + fprintf(stderr,"### Adding argument %s at end\n", str); + + if (arg_count == arg_array_size) { + /* expand array */ + arg_array_size = arg_count + ARG_ARRAY_INCREMENT_SIZE; + arg_array = (char**) realloc (arg_array, arg_array_size); + } + + arg_array[arg_count++] = new_arg; +} + +void delete_arg(int pos) { + int i; + + if (confirm_changes) + fprintf(stderr,"### Deleting argument %s\n",arg_array[pos]); + + free (arg_array[pos]); + + for (i=pos; i < arg_count; i++) + arg_array[i] = arg_array[i+1]; + + arg_count--; +} + +/* Changing optimization levels is a common testing pattern -- + we've got a special option that searches for and replaces anything + beginning with -O */ +void replace_optimization_level (char *new_level) { + int i; + int optionFound = 0; + char *new_opt = malloc(strlen(new_opt)+3); + sprintf(new_opt, "-O%s",new_level); + + + for (i=0;i= arg_count -1) { + if (confirm_changes) + fprintf(stderr,"Not enough arguments to do X\n"); + } else { + delete_arg(search_index); /* Delete the matching argument */ + delete_arg(search_index); /* Delete the following argument */ + } + } + free (searchStr); + break; + + case 'O': + /* Change the optimization level to the specified value, and + remove any optimization arguments. This is a separate command + because we often want is to substitute our favorite + optimization level for whatever the project normally wants. + As we probably care about this a lot (for things like + testing file sizes at different optimization levels) we + make a special rewrite clause. */ + arg = arg_string (override_options_line, line_pos, arg_len); + replace_optimization_level(arg); + free (arg); + break; + case 's': + /* Search for the regexp passed in, and replace a matching argument + with the provided replacement string */ + searchStr = arg_string (override_options_line, line_pos, arg_len); + search_and_replace (searchStr); + free (searchStr); + break; + + default: + fprintf(stderr,"### QA_OVERRIDE_GCC3_OPTIONS: invalid string (pos %d)\n", + line_pos); + break; + } + line_pos += arg_len; + } + *argc = arg_count; + *argv = arg_array; +} + +/* Given a path to a file, potentially containing a directory name, return the + number of characters at the end of the path that make up the filename part of + the path. */ + +static int +get_prog_name_len (const char *prog) +{ + int result = 0; + const char *progend = prog + strlen(prog); + const char *progname = progend; + while (progname != prog && !IS_DIR_SEPARATOR (progname[-1])) + --progname; + return progend-progname; +} + +/* Return true iff the path is an executable file and not a directory. */ + +static bool +is_x_file (const char *path) +{ + struct stat st; + if (access (path, X_OK)) + return false; + if (stat (path, &st) == -1) + return false; + if (S_ISDIR (st.st_mode)) + return false; + return true; +} + +/* Given a FILENAME of an executable (for example "gcc") search the PATH + environment variable to find out which directory it is in and return a fully + qualified path to the executable. + */ + +static const char * +resolve_path_to_executable (const char *filename) +{ + char path_buffer[2*PATH_MAX+1]; + char *PATH = getenv ("PATH"); + if (PATH == 0) return filename; /* PATH not set */ + + do { + unsigned prefix_size; + struct stat st; + char *colon = strchr (PATH, ':'); + + /* If we didn't find a :, use the whole last chunk. */ + prefix_size = colon ? colon-PATH : strlen (PATH); + + /* Form the full path. */ + memcpy (path_buffer, PATH, prefix_size); + path_buffer[prefix_size] = '/'; + strcpy (path_buffer+prefix_size+1, filename); + + /* Check to see if this file is executable, if so, return it. */ + if (is_x_file (path_buffer)) + return strdup (path_buffer); + PATH = colon ? colon+1 : PATH+prefix_size; + } while (PATH[0]); + + return filename; +} + +/* If prog is a symlink, we want to rewrite prog to an absolute location, + symlink_buffer contains the destination of the symlink. Glue these pieces + together to form an absolute path. */ + +static const char * +resolve_symlink (const char *prog, char *symlink_buffer, + int argv_0_len, int prog_len) +{ + /* If the link isn't to an absolute path, prefix it with the argv[0] + directory. */ + if (!IS_ABSOLUTE_PATH (symlink_buffer)) + { + int prefix_len = argv_0_len - prog_len; + memmove (symlink_buffer+prefix_len, symlink_buffer, + PATH_MAX-prefix_len+1); + memcpy (symlink_buffer, prog, prefix_len); + } + return strdup(symlink_buffer); +} + +/* Main entry point. This is gcc driver driver! + Interpret -arch flag from the list of input arguments. Invoke appropriate + compiler driver. 'lipo' the results if more than one -arch is supplied. */ +int +main (int argc, const char **argv) +{ + size_t i; + int l, pid, ret, argv_0_len, prog_len; + char *errmsg_fmt, *errmsg_arg; + char *override_option_str = NULL; + char path_buffer[2*PATH_MAX+1]; + int linklen; + + total_argc = argc; + prog_len = 0; + + argv_0_len = strlen (argv[0]); + + /* Get the progname, required by pexecute () and program location. */ + prog_len = get_prog_name_len (argv[0]); + + /* If argv[0] is all program name (no slashes), search the PATH environment + variable to get the fully resolved path to the executable. */ + if (prog_len == argv_0_len) + { +#ifdef DEBUG + progname = argv[0] + argv_0_len - prog_len; + fprintf (stderr,"%s: before PATH resolution, full progname = %s\n", + argv[0]+argv_0_len-prog_len, argv[0]); +#endif + argv[0] = resolve_path_to_executable (argv[0]); + prog_len = get_prog_name_len (argv[0]); + argv_0_len = strlen(argv[0]); + } + + /* If argv[0] is a symbolic link, use the directory of the pointed-to file + to find compiler components. */ + + if ((linklen = readlink (argv[0], path_buffer, PATH_MAX)) != -1) + { + /* readlink succeeds if argv[0] is a symlink. path_buffer now contains + the file referenced. */ + path_buffer[linklen] = '\0'; +#ifdef DEBUG + progname = argv[0] + argv_0_len - prog_len; + fprintf (stderr, "%s: before symlink, full prog = %s target = %s\n", + progname, argv[0], path_buffer); +#endif + argv[0] = resolve_symlink(argv[0], path_buffer, argv_0_len, prog_len); + argv_0_len = strlen(argv[0]); + + /* Get the progname, required by pexecute () and program location. */ + prog_len = get_prog_name_len (argv[0]); + +#ifdef DEBUG + progname = argv[0] + argv_0_len - prog_len; + printf("%s: ARGV[0] after symlink = %s\n", progname, argv[0]); +#endif + } + + progname = argv[0] + argv_0_len - prog_len; + + /* Setup driver prefix. */ + prefix_len = argv_0_len - prog_len; + curr_dir = (char *) malloc (sizeof (char) * (prefix_len + 1)); + strncpy (curr_dir, argv[0], prefix_len); + curr_dir[prefix_len] = '\0'; + driver_exec_prefix = (argv[0], "/usr/bin", curr_dir); + +#ifdef DEBUG + fprintf (stderr,"%s: full progname = %s\n", progname, argv[0]); + fprintf (stderr,"%s: progname = %s\n", progname, progname); + fprintf (stderr,"%s: driver_exec_prefix = %s\n", progname, driver_exec_prefix); +#endif + + /* Before we get too far, rewrite the command line with any requested overrides */ + if ((override_option_str = getenv ("QA_OVERRIDE_GCC3_OPTIONS")) != NULL) + rewrite_command_line(override_option_str, &argc, (char***)&argv); + + + + initialize (); + + /* Process arguments. Take appropriate actions when + -arch, -c, -S, -E, -o is encountered. Find input file name. */ + for (i = 1; i < argc; i++) + { + if (!strcmp (argv[i], "-arch")) + { + if (i + 1 >= argc) + abort (); + + add_arch (argv[i+1]); + i++; + } + else if (!strcmp (argv[i], "-c")) + { + new_argv[new_argc++] = argv[i]; + compile_only_request = 1; + } + else if (!strcmp (argv[i], "-S")) + { + new_argv[new_argc++] = argv[i]; + asm_output_request = 1; + } + else if (!strcmp (argv[i], "-E")) + { + new_argv[new_argc++] = argv[i]; + preprocessed_output_request = 1; + } + else if (!strcmp (argv[i], "-MD") || !strcmp (argv[i], "-MMD")) + { + new_argv[new_argc++] = argv[i]; + dash_capital_m_seen = 1; + } + else if (!strcmp (argv[i], "-dynamiclib")) + { + new_argv[new_argc++] = argv[i]; + dash_dynamiclib_seen = 1; + } + else if (!strcmp (argv[i], "-v")) + { + new_argv[new_argc++] = argv[i]; + verbose_flag = 1; + } + else if (!strcmp (argv[i], "-o")) + { + if (i + 1 >= argc) + abort (); + + output_filename = argv[i+1]; + i++; + } + else if ((! strcmp (argv[i], "-pass-exit-codes")) + || (! strcmp (argv[i], "-print-search-dirs")) + || (! strcmp (argv[i], "-print-libgcc-file-name")) + || (! strncmp (argv[i], "-print-file-name=", 17)) + || (! strncmp (argv[i], "-print-prog-name=", 17)) + || (! strcmp (argv[i], "-print-multi-lib")) + || (! strcmp (argv[i], "-print-multi-directory")) + || (! strcmp (argv[i], "-print-multi-os-directory")) + || (! strcmp (argv[i], "-ftarget-help")) + || (! strcmp (argv[i], "-fhelp")) + || (! strcmp (argv[i], "+e")) + || (! strncmp (argv[i], "-Wa,",4)) + || (! strncmp (argv[i], "-Wp,",4)) + || (! strncmp (argv[i], "-Wl,",4)) + || (! strncmp (argv[i], "-l", 2)) + || (! strncmp (argv[i], "-weak-l", 7)) + || (! strncmp (argv[i], "-specs=", 7)) + || (! strcmp (argv[i], "-ObjC")) + || (! strcmp (argv[i], "-fobjC")) + || (! strcmp (argv[i], "-ObjC++")) + || (! strcmp (argv[i], "-time")) + || (! strcmp (argv[i], "-###")) + || (! strcmp (argv[i], "-fconstant-cfstrings")) + || (! strcmp (argv[i], "-fno-constant-cfstrings")) + || (! strcmp (argv[i], "-static-libgcc")) + || (! strcmp (argv[i], "-shared-libgcc")) + || (! strcmp (argv[i], "-pipe")) + ) + { + new_argv[new_argc++] = argv[i]; + } + else if (! strcmp (argv[i], "-save-temps") + || ! strcmp (argv[i], "--save-temps")) + { + new_argv[new_argc++] = argv[i]; + save_temps_seen = 1; + } + else if ((! strcmp (argv[i], "-Xlinker")) + || (! strcmp (argv[i], "-Xassembler")) + || (! strcmp (argv[i], "-Xpreprocessor")) + || (! strcmp (argv[i], "-l")) + || (! strcmp (argv[i], "-weak_library")) + || (! strcmp (argv[i], "-weak_framework")) + || (! strcmp (argv[i], "-specs")) + || (! strcmp (argv[i], "-framework")) + ) + { + new_argv[new_argc++] = argv[i]; + i++; + new_argv[new_argc++] = argv[i]; + } + else if (argv[i][0] == '-' && argv[i][1] != 0) + { + const char *p = &argv[i][1]; + int c = *p; + + /* First copy this flag itself. */ + new_argv[new_argc++] = argv[i]; + + if (argv[i][1] == 'M') + dash_capital_m_seen = 1; + + /* Now copy this flag's arguments, if any, appropriately. */ + if ((SWITCH_TAKES_ARG (c) > (p[1] != 0)) + || WORD_SWITCH_TAKES_ARG (p)) + { + int j = 0; + int n_args = WORD_SWITCH_TAKES_ARG (p); + if (n_args == 0) + { + /* Count only the option arguments in separate argv elements. */ + n_args = SWITCH_TAKES_ARG (c) - (p[1] != 0); + } + if (i + n_args >= argc) + fatal ("argument to `-%s' is missing", p); + + + while ( j < n_args) + { + i++; + new_argv[new_argc++] = argv[i]; + j++; + } + } + + } + else + { + struct input_filename *ifn; + new_argv[new_argc++] = argv[i]; + ifn = (struct input_filename *) malloc (sizeof (struct input_filename)); + ifn->name = argv[i]; + ifn->index = i; + ifn->next = NULL; + num_infiles++; + + if (last_infile) + last_infile->next = ifn; + else + in_files = ifn; + + last_infile = ifn; + } + } + +#if 0 + if (num_infiles == 0) + fatal ("no input files"); +#endif + + if (num_arches > 1) + { + if (preprocessed_output_request + || save_temps_seen + || asm_output_request + || dash_capital_m_seen) + fatal ("-E, -S, -save-temps and -M options are not allowed with multiple -arch flags"); + } + /* If -arch is not present OR Only one -arch is specified. + Invoke appropriate compiler driver. FAT build is not required in this + case. */ + + if (num_arches == 0 || num_arches == 1) + { + + /* If no -arch is specified than use host compiler driver. */ + if (num_arches == 0) + new_argv[0] = get_driver_name (get_arch_name (NULL)); + else if (num_arches == 1) + { + /* Find compiler driver based on -arch and add approriate + -m* argument. */ + new_argv[0] = get_driver_name (get_arch_name (arches[0])); + new_argc = new_argc + add_arch_options (0, new_argv, new_argc); + } + + +#ifdef DEBUG + printf ("%s: invoking single driver name = %s\n", progname, new_argv[0]); +#endif + + /* Re insert output file name. */ + if (output_filename) + { + new_argv[new_argc++] = "-o"; + new_argv[new_argc++] = output_filename; + } + + /* Add the NULL. */ + new_argv[new_argc] = NULL; + +#ifdef DEBUG + debug_command_line (new_argv, new_argc); +#endif + + pid = pexecute (new_argv[0], (char *const *)new_argv, progname, NULL, + &errmsg_fmt, &errmsg_arg, PEXECUTE_SEARCH | PEXECUTE_LAST); + + if (pid == -1) + pfatal_pexecute (errmsg_fmt, errmsg_arg); + + ret = do_wait (pid, new_argv[0]); + } + else + { + /* Handle multiple -arch . */ + + /* If more than one input files are supplied but only one output filename + is present then IMA will be used. */ + if (num_infiles > 1 && !compile_only_request) + ima_is_used = 1; + + /* Linker wants to know this in case of multiple -arch. */ + if (!compile_only_request && !dash_dynamiclib_seen) + new_argv[new_argc++] = "-Wl,-arch_multiple"; + + + /* If only one input file is specified OR IMA is used then expected output + is one FAT binary. */ + if (num_infiles == 1 || ima_is_used) + { + const char *out_file; + + /* Create output file name based on + input filename, if required. */ + if (compile_only_request && !output_filename && num_infiles == 1) + out_file = strip_path_and_suffix (in_files->name, ".o"); + else + out_file = (output_filename ? output_filename : final_output); + + + /* Linker wants to know name of output file using one extra arg. */ + if (!compile_only_request) + { + char *oname = (char *)(output_filename ? output_filename : final_output); + char *n = malloc (sizeof (char) * (strlen (oname) + 5)); + strcpy (n, "-Wl,"); + strcat (n, oname); + new_argv[new_argc++] = "-Wl,-final_output"; + new_argv[new_argc++] = n; + } + + /* Compile file(s) for each arch and lipo 'em together. */ + ret = do_compile (new_argv, new_argc); + + /* Make FAT binary by combining individual output files for each + architecture, using 'lipo'. */ + ret = do_lipo (0, out_file); + } + else + { + /* Multiple input files are present and IMA is not used. + Which means need to generate multiple FAT files. */ + ret = do_compile_separately (); + ret = do_lipo_separately (); + } + } + + final_cleanup (); + free (curr_dir); + return greatest_status; +} Modified: apple-local/branches/llvm/fixincludes/ChangeLog =================================================================== --- apple-local/branches/llvm/fixincludes/ChangeLog 2007-04-30 21:36:53 UTC (rev 126738) +++ apple-local/branches/llvm/fixincludes/ChangeLog 2007-04-30 22:03:04 UTC (rev 126739) @@ -1,3 +1,7 @@ +2007-02-04 Mike Stump + + * mkheaders.in: Allow optional isysroot parameter. + 2005-06-24 Geoffrey Keating * inclhack.def (AAB_darwin7_9_long_double_funcs): New. Modified: apple-local/branches/llvm/fixincludes/mkheaders.in =================================================================== --- apple-local/branches/llvm/fixincludes/mkheaders.in 2007-04-30 21:36:53 UTC (rev 126738) +++ apple-local/branches/llvm/fixincludes/mkheaders.in 2007-04-30 22:03:04 UTC (rev 126739) @@ -1,6 +1,7 @@ #!/bin/sh -# Copyright (C) 2002 Free Software Foundation, Inc. +# APPLE LOCAL mainline +# Copyright (C) 2002, 2007 Free Software Foundation, Inc. #This file is part of GCC. @@ -32,7 +33,8 @@ export VERBOSE if [ x$1 = x--help ] ; then - echo "Usage: mkheaders [options] [prefix]" + # APPLE LOCAL mainline + echo "Usage: mkheaders [options] [prefix [isysroot]]" echo "Options:" echo " -v Print more output (may be repeated for even more output)" echo " --help This help" @@ -42,7 +44,8 @@ if [ x$1 = x--version ] ; then echo "mkheaders (GCC) version $version" - echo "Copyright 2002 Free Software Foundation, Inc." + # APPLE LOCAL mainline + echo "Copyright 2002, 2007 Free Software Foundation, Inc." echo "This program is free software; you may redistribute it under the" echo "terms of the GNU General Public License. This program has" echo "absolutely no warranty." @@ -52,9 +55,22 @@ # Common prefix for installation directories. if [ x$1 != x ] ; then prefix=$1 + # APPLE LOCAL mainline + shift else prefix=@prefix@ fi + +# APPLE LOCAL begin mainline +# Allow for alternate isysroot in which to find headers +if [ x$1 != x ] ; then + isysroot=$1 + shift +else + isysroot= +fi +# APPLE LOCAL end mainline + # Directory in which to put host dependent programs and libraries exec_prefix=@exec_prefix@ # Directory in which to put the directories used by the compiler. @@ -74,11 +90,12 @@ cd ${itoolsdir} rm -rf ${incdir}/* +# APPLE LOCAL begin mainline if [ x${STMP_FIXINC} != x ] ; then TARGET_MACHINE="${target}" target_canonical="${target}" \ MACRO_LIST="${itoolsdatadir}/macro_list" \ @SHELL@ ./fixinc.sh ${incdir} \ - ${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS} + ${isysroot}${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS} rm -f ${incdir}/syslimits.h if [ -f ${incdir}/limits.h ]; then mv ${incdir}/limits.h ${incdir}/syslimits.h @@ -92,5 +109,6 @@ if [ x${STMP_FIXPROTO} != x ] ; then mkinstalldirs="@SHELL@ ${itoolsdir}/mkinstalldirs" export FIXPROTO_DEFINES mkinstalldirs - @SHELL@ fixproto ${incdir} ${incdir} ${SYSTEM_HEADER_DIR} || exit 1 + @SHELL@ fixproto ${incdir} ${incdir} ${isysroot}${SYSTEM_HEADER_DIR} || exit 1 fi +# APPLE LOCAL end mainline Modified: apple-local/branches/llvm/gcc/ChangeLog =================================================================== --- apple-local/branches/llvm/gcc/ChangeLog 2007-04-30 21:36:53 UTC (rev 126738) +++ apple-local/branches/llvm/gcc/ChangeLog 2007-04-30 22:03:04 UTC (rev 126739) @@ -1,3 +1,127 @@ +2007-04-09 Jan Hubicka + + Radar 5097839 + PR target/27869 + * config/i386/sse.md + (sse_vmaddv4sf3, sse_vmmulv4sf3): Remove '%' modifier. + (sse_vmsmaxv4sf3_finite, sse_vmsminv4sf3_finite): Remove. + (sse2_vmaddv2df3, sse2_vmmulv2df3): Remove '%' modifier. + (sse2_vmsmaxv2df3_finite, sse2_vmsminv2df3_finite): Remove. + +2007-03-28 Mike Stump + + Radar 5077358 + * config/darwin9.h (ASM_OUTPUT_ALIGNED_COMMON): Add. + * config/darwin.h (MAX_OFILE_ALIGNMENT): Fix. + * config/rs6000/darwin.h (ASM_OUTPUT_ALIGNED_COMMON): Removed #undef. + +2006-12-13 Geoffrey Keating + + Radar 4697325 + * doc/invoke.texi (Darwin Options): Update documentation for + -mmacosx-version-min. + * config.gcc (*-*-darwin*): Set extra_gcc_objs. + * config/darwin-driver.c: New file. + * config/darwin.h (GCC_DRIVER_HOST_INITIALIZATION): New. + * config/t-darwin (darwin-driver.o): New rule. + +2006-12-12 Geoffrey Keating + + * mips-tdump.c: Replace CROSS_COMPILE with + CROSS_DIRECTORY_STRUCTURE. + * mips-tfile.c: Likewise. + * gcc.c: Likewise. + * configure.ac: Likewise. + * cppdefault.c: Likewise. + * Makefile.in: Likewise. + * config/alpha/osf.h: Likewise. + * config/i386/cygwin.h: Likewise. + * config/i386/beos-elf.h: Likewise. + * config/i386/nto.h: Likewise. + * config/fr30/fr30.h: Likewise. + * config/svr4.h: Likewise. + * config/rs6000/aix.h: Likewise. + * config/rs6000/sysv4.h: Likewise. + * config/pa/pa64-hpux.h: Likewise. + * config/pa/pa-hpux10.h: Likewise. + * config/pa/pa-hpux11.h: Likewise. + * collect2.c: Likewise. + * configure: Regenerate. + +2007-03-13 Geoffrey Keating + + * doc/invoke.texi (Spec Files): Update for '%{,' spec. + From clattner at apple.com Mon Apr 30 17:22:13 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 30 Apr 2007 15:22:13 -0700 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/ELFRelocation.h In-Reply-To: <200704302041.l3UKfcR8025811@zion.cs.uiuc.edu> References: <200704302041.l3UKfcR8025811@zion.cs.uiuc.edu> Message-ID: <07AB8B75-4A19-4A19-8DF2-09F47018CC34@apple.com> > > Header file for ELF relocations. Oooh cool > + #ifndef LLVM_CODEGEN_ELF_RELOCATION_H > + #define LLVM_CODEGEN_ELF_RELOCATION_H Please #include "llvm/Support/DataTypes.h", since this file uses int64_t etc. > + > + namespace llvm { ... > + ELFRelocation(uint64_t off, uint32_t sym, uint32_t type, > + bool rela = true, int64_t addend = 0) : > + r_offset(off), r_symidx(sym), r_type(type), > + r_add(addend), r_rela(rela) {} > + }; > + > + } // end llvm namespace > + > + #endif // LLVM_CODEGEN_ELF_RELOCATION_H > \ No newline at end of file Please add a newline at eof :) -Chris From bwendlin at apple.com Mon Apr 30 17:37:52 2007 From: bwendlin at apple.com (bwendlin at apple.com) Date: Mon, 30 Apr 2007 15:37:52 -0700 (PDT) Subject: [llvm-commits] [126740] Don't strip the libstdc++.dylib thingy. Message-ID: <20070430223752.ADFA74C5D19@src> Revision: 126740 Author: bwendlin Date: 2007-04-30 15:37:52 -0700 (Mon, 30 Apr 2007) Log Message: ----------- Don't strip the libstdc++.dylib thingy. Modified Paths: -------------- apple-local/branches/llvm/build_gcc Modified: apple-local/branches/llvm/build_gcc =================================================================== --- apple-local/branches/llvm/build_gcc 2007-04-30 22:03:04 UTC (rev 126739) +++ apple-local/branches/llvm/build_gcc 2007-04-30 22:37:52 UTC (rev 126740) @@ -457,7 +457,8 @@ cp -p /usr/lib/libstdc++.6.dylib \ .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib \ || exit 1 - strip -x -c .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib || exit 1 +# APPLE LOCAL LLVM +# strip -x -c .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib || exit 1 done # include From sabre at nondot.org Mon Apr 30 18:13:12 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 30 Apr 2007 18:13:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineBasicBlock.cpp Message-ID: <200704302313.l3UNDCr7028978@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineBasicBlock.cpp updated: 1.43 -> 1.44 --- Log message: print isLandingPad() for MBBs --- Diffs of the changes: (+5 -3) MachineBasicBlock.cpp | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/MachineBasicBlock.cpp diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.43 llvm/lib/CodeGen/MachineBasicBlock.cpp:1.44 --- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.43 Fri Mar 9 02:29:08 2007 +++ llvm/lib/CodeGen/MachineBasicBlock.cpp Mon Apr 30 18:12:53 2007 @@ -111,9 +111,11 @@ const BasicBlock *LBB = getBasicBlock(); OS << "\n"; - if (LBB) OS << LBB->getName(); - OS << " (" << (const void*)this - << ", LLVM BB @" << (const void*) LBB << ", ID#" << getNumber()<< "):\n"; + if (LBB) OS << LBB->getName() << ": "; + OS << (const void*)this + << ", LLVM BB @" << (const void*) LBB << ", ID#" << getNumber(); + if (isLandingPad()) OS << ", EH LANDING PAD"; + OS << ":\n"; const MRegisterInfo *MRI = MF->getTarget().getRegisterInfo(); if (livein_begin() != livein_end()) { From sabre at nondot.org Mon Apr 30 18:35:05 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 30 Apr 2007 18:35:05 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/2007-04-30-LandingPadBranchFolding.ll Message-ID: <200704302335.l3UNZ5nh029526@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: 2007-04-30-LandingPadBranchFolding.ll added (r1.1) --- Log message: testcase for PR1228: http://llvm.org/PR1228 --- Diffs of the changes: (+59 -0) 2007-04-30-LandingPadBranchFolding.ll | 59 ++++++++++++++++++++++++++++++++++ 1 files changed, 59 insertions(+) Index: llvm/test/CodeGen/Generic/2007-04-30-LandingPadBranchFolding.ll diff -c /dev/null llvm/test/CodeGen/Generic/2007-04-30-LandingPadBranchFolding.ll:1.1 *** /dev/null Mon Apr 30 18:34:56 2007 --- llvm/test/CodeGen/Generic/2007-04-30-LandingPadBranchFolding.ll Mon Apr 30 18:34:46 2007 *************** *** 0 **** --- 1,59 ---- + ; RUN: llvm-as < %s | llc + ; PR1228 + + "struct.std::basic_string,std::allocator >::_Alloc_hider" = type { i8* } + "struct.std::locale" = type { "struct.std::locale::_Impl"* } + "struct.std::locale::_Impl" = type { i32, "struct.std::locale::facet"**, i32, "struct.std::locale::facet"**, i8** } + "struct.std::locale::facet" = type { i32 (...)**, i32 } + "struct.std::string" = type { "struct.std::basic_string,std::allocator >::_Alloc_hider" } + + define void @_ZNKSt6locale4nameEv("struct.std::string"* %agg.result) { + entry: + %tmp105 = icmp eq i8* null, null ; [#uses=1] + br i1 %tmp105, label %cond_true, label %cond_true222 + + cond_true: ; preds = %entry + invoke void @_ZNSs14_M_replace_auxEjjjc( ) + to label %cond_next1328 unwind label %cond_true1402 + + cond_true222: ; preds = %cond_true222, %entry + %tmp207 = call i32 @strcmp( ) ; [#uses=1] + %tmp208 = icmp eq i32 %tmp207, 0 ; [#uses=2] + %bothcond1480 = and i1 %tmp208, false ; [#uses=1] + br i1 %bothcond1480, label %cond_true222, label %cond_next226.loopexit + + cond_next226.loopexit: ; preds = %cond_true222 + %phitmp = xor i1 %tmp208, true ; [#uses=1] + br i1 %phitmp, label %cond_false280, label %cond_true235 + + cond_true235: ; preds = %cond_next226.loopexit + invoke void @_ZNSs6assignEPKcj( ) + to label %cond_next1328 unwind label %cond_true1402 + + cond_false280: ; preds = %cond_next226.loopexit + invoke void @_ZNSs7reserveEj( ) + to label %invcont282 unwind label %cond_true1402 + + invcont282: ; preds = %cond_false280 + invoke void @_ZNSs6appendEPKcj( ) + to label %invcont317 unwind label %cond_true1402 + + invcont317: ; preds = %invcont282 + ret void + + cond_next1328: ; preds = %cond_true235, %cond_true + ret void + + cond_true1402: ; preds = %invcont282, %cond_false280, %cond_true235, %cond_true + ret void + } + + declare void @_ZNSs14_M_replace_auxEjjjc() + + declare i32 @strcmp() + + declare void @_ZNSs6assignEPKcj() + + declare void @_ZNSs7reserveEj() + + declare void @_ZNSs6appendEPKcj() From sabre at nondot.org Mon Apr 30 18:35:19 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 30 Apr 2007 18:35:19 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/BranchFolding.cpp Message-ID: <200704302335.l3UNZJd2029566@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: BranchFolding.cpp updated: 1.45 -> 1.46 --- Log message: Fix PR1228: http://llvm.org/PR1228 and CodeGen/Generic/2007-04-30-LandingPadBranchFolding.ll --- Diffs of the changes: (+8 -2) BranchFolding.cpp | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/BranchFolding.cpp diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.45 llvm/lib/CodeGen/BranchFolding.cpp:1.46 --- llvm/lib/CodeGen/BranchFolding.cpp:1.45 Tue Mar 20 16:35:06 2007 +++ llvm/lib/CodeGen/BranchFolding.cpp Mon Apr 30 18:35:00 2007 @@ -877,7 +877,7 @@ // Now we know that there was no fall-through into this block, check to // see if it has a fall-through into its successor. bool CurFallsThru = CanFallThrough(MBB, CurUnAnalyzable, CurTBB, CurFBB, - CurCond); + CurCond); if (!MBB->isLandingPad()) { // Check all the predecessors of this block. If one of them has no fall @@ -914,7 +914,13 @@ MachineBasicBlock *SuccBB = *SI; MachineFunction::iterator SuccPrev = SuccBB; --SuccPrev; std::vector SuccPrevCond; - if (SuccBB != MBB && !CanFallThrough(SuccPrev)) { + + // If this block doesn't already fall-through to that successor, and if + // the succ doesn't already have a block that can fall through into it, + // and if the successor isn't an EH destination, we can arrange for the + // fallthrough to happen. + if (SuccBB != MBB && !CanFallThrough(SuccPrev) && + !SuccBB->isLandingPad()) { MBB->moveBefore(SuccBB); MadeChange = true; return OptimizeBlock(MBB); From christopher.lamb at gmail.com Mon Apr 30 18:54:30 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Mon, 30 Apr 2007 18:54:30 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/ELFRelocation.h Message-ID: <200704302354.l3UNsUro030067@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: ELFRelocation.h updated: 1.1 -> 1.2 --- Log message: Implement review feedback. --- Diffs of the changes: (+4 -1) ELFRelocation.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/ELFRelocation.h diff -u llvm/include/llvm/CodeGen/ELFRelocation.h:1.1 llvm/include/llvm/CodeGen/ELFRelocation.h:1.2 --- llvm/include/llvm/CodeGen/ELFRelocation.h:1.1 Mon Apr 30 15:41:08 2007 +++ llvm/include/llvm/CodeGen/ELFRelocation.h Mon Apr 30 18:54:10 2007 @@ -14,6 +14,8 @@ #ifndef LLVM_CODEGEN_ELF_RELOCATION_H #define LLVM_CODEGEN_ELF_RELOCATION_H +#include "llvm/Support/DataTypes.h" + namespace llvm { /// ELFRelocation - This class contains all the information necessary to @@ -46,4 +48,5 @@ } // end llvm namespace -#endif // LLVM_CODEGEN_ELF_RELOCATION_H \ No newline at end of file +#endif // LLVM_CODEGEN_ELF_RELOCATION_H + From evan.cheng at apple.com Mon Apr 30 19:38:39 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 30 Apr 2007 19:38:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200705010038.l410ccOi031037@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.296 -> 1.297 --- Log message: * Only turn a load to UNDEF if all of its outputs have no uses (indexed loads produce two results.) * Do not touch volatile loads. --- Diffs of the changes: (+20 -5) DAGCombiner.cpp | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.296 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.297 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.296 Sun Apr 22 18:15:30 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Apr 30 19:38:21 2007 @@ -3326,11 +3326,26 @@ LoadSDNode *LD = cast(N); SDOperand Chain = LD->getChain(); SDOperand Ptr = LD->getBasePtr(); - - // If there are no uses of the loaded value, change uses of the chain value - // into uses of the chain input (i.e. delete the dead load). - if (N->hasNUsesOfValue(0, 0)) - return CombineTo(N, DAG.getNode(ISD::UNDEF, N->getValueType(0)), Chain); + + // If load is not volatile and there are no uses of the loaded value (and + // the updated indexed value in case of indexed loads), change uses of the + // chain value into uses of the chain input (i.e. delete the dead load). + if (!LD->isVolatile()) { + bool HasUses = false; + SmallVector VTs; + for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) { + if (!N->hasNUsesOfValue(0, i)) { + HasUses = true; + break; + } + VTs.push_back(N->getValueType(i)); + } + if (!HasUses) { + SmallVector Ops; + return CombineTo(N, DAG.getNode(ISD::UNDEF, &VTs[0], VTs.size(), 0, 0), + Chain); + } + } // If this load is directly stored, replace the load value with the stored // value. From evan.cheng at apple.com Mon Apr 30 19:40:57 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 30 Apr 2007 19:40:57 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-04-30-CombinerCrash.ll Message-ID: <200705010040.l410evM8031092@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: 2007-04-30-CombinerCrash.ll added (r1.1) --- Log message: Test a dag combiner crasher. --- Diffs of the changes: (+32 -0) 2007-04-30-CombinerCrash.ll | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+) Index: llvm/test/CodeGen/ARM/2007-04-30-CombinerCrash.ll diff -c /dev/null llvm/test/CodeGen/ARM/2007-04-30-CombinerCrash.ll:1.1 *** /dev/null Mon Apr 30 19:40:48 2007 --- llvm/test/CodeGen/ARM/2007-04-30-CombinerCrash.ll Mon Apr 30 19:40:38 2007 *************** *** 0 **** --- 1,32 ---- + ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin -mattr=+v6,+vfp2 + + target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64" + target triple = "arm-apple-darwin8" + %struct.CHESS_POSITION = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i32, i32, i8, i8, [64 x i8], i8, i8, i8, i8, i8 } + @search = external global %struct.CHESS_POSITION ; <%struct.CHESS_POSITION*> [#uses=3] + @file_mask = external global [8 x i64] ; <[8 x i64]*> [#uses=1] + @rank_mask.1.b = external global i1 ; [#uses=1] + + define fastcc void @EvaluateDevelopment() { + entry: + %tmp7 = load i64* getelementptr (%struct.CHESS_POSITION* @search, i32 0, i32 7) ; [#uses=1] + %tmp50 = load i64* getelementptr (%struct.CHESS_POSITION* @search, i32 0, i32 0) ; [#uses=1] + %tmp52 = load i64* getelementptr (%struct.CHESS_POSITION* @search, i32 0, i32 1) ; [#uses=1] + %tmp53 = or i64 %tmp52, %tmp50 ; [#uses=1] + %tmp57.b = load i1* @rank_mask.1.b ; [#uses=1] + %tmp57 = select i1 %tmp57.b, i64 71776119061217280, i64 0 ; [#uses=1] + %tmp58 = and i64 %tmp57, %tmp7 ; [#uses=1] + %tmp59 = lshr i64 %tmp58, 8 ; [#uses=1] + %tmp63 = load i64* getelementptr ([8 x i64]* @file_mask, i32 0, i32 4) ; [#uses=1] + %tmp64 = or i64 %tmp63, 0 ; [#uses=1] + %tmp65 = and i64 %tmp59, %tmp53 ; [#uses=1] + %tmp66 = and i64 %tmp65, %tmp64 ; [#uses=1] + %tmp67 = icmp eq i64 %tmp66, 0 ; [#uses=1] + br i1 %tmp67, label %cond_next145, label %cond_true70 + + cond_true70: ; preds = %entry + ret void + + cond_next145: ; preds = %entry + ret void + } From evan.cheng at apple.com Mon Apr 30 19:48:03 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 30 Apr 2007 19:48:03 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h Message-ID: <200705010048.l410m3k2031215@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.107 -> 1.108 --- Log message: Added hook hasReservedCallFrame(). It returns true if the call frame is included as part of the stack frame. --- Diffs of the changes: (+9 -0) MRegisterInfo.h | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.107 llvm/include/llvm/Target/MRegisterInfo.h:1.108 --- llvm/include/llvm/Target/MRegisterInfo.h:1.107 Wed Apr 25 02:24:50 2007 +++ llvm/include/llvm/Target/MRegisterInfo.h Mon Apr 30 19:47:46 2007 @@ -451,6 +451,15 @@ /// variable sized allocas or if frame pointer elimination is disabled. virtual bool hasFP(const MachineFunction &MF) const = 0; + // hasReservedCallFrame - Under normal circumstances, when a frame pointer is + // not required, we reserve argument space for call sites in the function + // immediately on entry to the current function. This eliminates the need for + // add/sub sp brackets around call sites. Returns true if the call frame is + // included as part of the stack frame. + virtual bool hasReservedCallFrame(MachineFunction &MF) const { + return !hasFP(MF); + } + /// getCallFrameSetup/DestroyOpcode - These methods return the opcode of the /// frame setup/destroy instructions if they exist (-1 otherwise). Some /// targets use pseudo instructions in order to abstract away the difference From evan.cheng at apple.com Mon Apr 30 19:51:48 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 30 Apr 2007 19:51:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/PrologEpilogInserter.cpp Message-ID: <200705010051.l410pmW5031285@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: PrologEpilogInserter.cpp updated: 1.82 -> 1.83 --- Log message: Under normal circumstances, when a frame pointer is not required, we reserve argument space for call sites in the function immediately on entry to the current function. This eliminates the need for add/sub sp brackets around call sites. However, this is not always a good idea. If the "call frame" is large and the target load / store instructions have small immediate field to encode sp offset, this can cause poor codegen. In the worst case, this can make it impossible to scavenge a register if the reserved spill slot is pushed too far apart from sp / fp. --- Diffs of the changes: (+14 -17) PrologEpilogInserter.cpp | 31 ++++++++++++++----------------- 1 files changed, 14 insertions(+), 17 deletions(-) Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.82 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.83 --- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.82 Wed Apr 25 17:11:48 2007 +++ llvm/lib/CodeGen/PrologEpilogInserter.cpp Mon Apr 30 19:51:28 2007 @@ -135,8 +135,9 @@ unsigned MaxCallFrameSize = 0; bool HasCalls = false; + std::vector FrameSDOps; for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) - for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ) + for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ++I) if (I->getOpcode() == FrameSetupOpcode || I->getOpcode() == FrameDestroyOpcode) { assert(I->getNumOperands() >= 1 && "Call Frame Setup/Destroy Pseudo" @@ -144,14 +145,16 @@ unsigned Size = I->getOperand(0).getImmedValue(); if (Size > MaxCallFrameSize) MaxCallFrameSize = Size; HasCalls = true; - RegInfo->eliminateCallFramePseudoInstr(Fn, *BB, I++); - } else { - ++I; + FrameSDOps.push_back(I); } MachineFrameInfo *FFI = Fn.getFrameInfo(); FFI->setHasCalls(HasCalls); FFI->setMaxCallFrameSize(MaxCallFrameSize); + for (unsigned i = 0, e = FrameSDOps.size(); i != e; ++i) { + MachineBasicBlock::iterator I = FrameSDOps[i]; + RegInfo->eliminateCallFramePseudoInstr(Fn, *I->getParent(), I); + } // Now figure out which *callee saved* registers are modified by the current // function, thus needing to be saved and restored in the prolog/epilog. @@ -333,10 +336,7 @@ // First assign frame offsets to stack objects that are used to spill // callee saved registers. if (StackGrowsDown) { - for (unsigned i = 0, e = FFI->getObjectIndexEnd(); i != e; ++i) { - if (i < MinCSFrameIndex || i > MaxCSFrameIndex) - continue; - + for (unsigned i = MinCSFrameIndex; i <= MaxCSFrameIndex; ++i) { // If stack grows down, we need to add size of find the lowest // address of the object. Offset += FFI->getObjectSize(i); @@ -351,10 +351,7 @@ FFI->setObjectOffset(i, -Offset); // Set the computed offset } } else { - for (int i = FFI->getObjectIndexEnd()-1; i >= 0; --i) { - if ((unsigned)i < MinCSFrameIndex || (unsigned)i > MaxCSFrameIndex) - continue; - + for (unsigned i = MaxCSFrameIndex; i >= MinCSFrameIndex; --i) { unsigned Align = FFI->getObjectAlignment(i); // If the alignment of this object is greater than that of the stack, then // increase the stack alignment to match. @@ -373,7 +370,7 @@ if (RS && RegInfo->hasFP(Fn)) { int SFI = RS->getScavengingFrameIndex(); if (SFI >= 0) { - // If stack grows down, we need to add size of find the lowest + // If stack grows down, we need to add size of the lowest // address of the object. if (StackGrowsDown) Offset += FFI->getObjectSize(SFI); @@ -447,10 +444,10 @@ // subroutines have their stack frames suitable aligned. if (!RegInfo->targetHandlesStackFrameRounding() && (FFI->hasCalls() || FFI->hasVarSizedObjects())) { - // When we have no frame pointer, we reserve argument space for call sites - // in the function immediately on entry to the current function. This - // eliminates the need for add/sub sp brackets around call sites. - if (!RegInfo->hasFP(Fn)) + // If we have reserved argument space for call sites in the function + // immediately on entry to the current function, count it as part of the + // overall stack size. + if (RegInfo->hasReservedCallFrame(Fn)) Offset += FFI->getMaxCallFrameSize(); unsigned AlignMask = TFI.getStackAlignment() - 1; From evan.cheng at apple.com Mon Apr 30 19:52:26 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 30 Apr 2007 19:52:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp ARMRegisterInfo.h Message-ID: <200705010052.l410qQVu031311@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.90 -> 1.91 ARMRegisterInfo.h updated: 1.17 -> 1.18 --- Log message: Under normal circumstances, when a frame pointer is not required, we reserve argument space for call sites in the function immediately on entry to the current function. This eliminates the need for add/sub sp brackets around call sites. However, this is not always a good idea. If the "call frame" is large and the target load / store instructions have small immediate field to encode sp offset, this can cause poor codegen. In the worst case, this can make it impossible to scavenge a register if the reserved spill slot is pushed too far apart from sp / fp. --- Diffs of the changes: (+29 -3) ARMRegisterInfo.cpp | 30 +++++++++++++++++++++++++++--- ARMRegisterInfo.h | 2 ++ 2 files changed, 29 insertions(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.90 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.91 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.90 Fri Apr 27 15:10:08 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Mon Apr 30 19:52:08 2007 @@ -386,6 +386,29 @@ return NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects(); } +// hasReservedCallFrame - Under normal circumstances, when a frame pointer is +// not required, we reserve argument space for call sites in the function +// immediately on entry to the current function. This eliminates the need for +// add/sub sp brackets around call sites. Returns true if the call frame is +// included as part of the stack frame. +bool ARMRegisterInfo::hasReservedCallFrame(MachineFunction &MF) const { + const MachineFrameInfo *FFI = MF.getFrameInfo(); + unsigned CFSize = FFI->getMaxCallFrameSize(); + ARMFunctionInfo *AFI = MF.getInfo(); + // It's not always a good idea to include the call frame as part of the + // stack frame. ARM (especially Thumb) has small immediate offset to + // address the stack frame. So a large call frame can cause poor codegen + // and may even makes it impossible to scavenge a register. + if (AFI->isThumbFunction()) { + if (CFSize >= ((1 << 8) - 1) * 4 / 2) // Half of imm8 * 4 + return false; + } else { + if (CFSize >= ((1 << 12) - 1) / 2) // Half of imm12 + return false; + } + return !hasFP(MF); +} + /// emitARMRegPlusImmediate - Emits a series of instructions to materialize /// a destreg = basereg + immediate in ARM code. static @@ -605,7 +628,7 @@ void ARMRegisterInfo:: eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const { - if (hasFP(MF)) { + if (!hasReservedCallFrame(MF)) { // If we have alloca, convert as follows: // ADJCALLSTACKDOWN -> sub, sp, sp, amount // ADJCALLSTACKUP -> add, sp, sp, amount @@ -1146,8 +1169,9 @@ Limit = (1 << 8) - 1; goto DoneEstimating; } else if (AddrMode == ARMII::AddrMode5) { - Limit = ((1 << 8) - 1) * 4; - goto DoneEstimating; + unsigned ThisLimit = ((1 << 8) - 1) * 4; + if (ThisLimit < Limit) + Limit = ThisLimit; } } } Index: llvm/lib/Target/ARM/ARMRegisterInfo.h diff -u llvm/lib/Target/ARM/ARMRegisterInfo.h:1.17 llvm/lib/Target/ARM/ARMRegisterInfo.h:1.18 --- llvm/lib/Target/ARM/ARMRegisterInfo.h:1.17 Tue Mar 20 03:07:04 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.h Mon Apr 30 19:52:08 2007 @@ -78,6 +78,8 @@ bool hasFP(const MachineFunction &MF) const; + bool hasReservedCallFrame(MachineFunction &MF) const; + void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const; From sabre at nondot.org Mon Apr 30 21:12:23 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 30 Apr 2007 21:12:23 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/LLVMBitCodes.h Message-ID: <200705010212.l412CNGX032621@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: LLVMBitCodes.h updated: 1.9 -> 1.10 --- Log message: add missing opcode. --- Diffs of the changes: (+10 -9) LLVMBitCodes.h | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) Index: llvm/include/llvm/Bitcode/LLVMBitCodes.h diff -u llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.9 llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.10 --- llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.9 Sun Apr 29 16:49:05 2007 +++ llvm/include/llvm/Bitcode/LLVMBitCodes.h Mon Apr 30 21:12:05 2007 @@ -164,20 +164,21 @@ FUNC_CODE_INST_SHUFFLEVEC = 8, // SHUFFLEVEC: [ty, opval, opval, opval] FUNC_CODE_INST_CMP = 9, // CMP: [opty, opval, opval, pred] - FUNC_CODE_INST_RET = 10, // RET: [opval] + FUNC_CODE_INST_RET = 10, // RET: [opty,opval] FUNC_CODE_INST_BR = 11, // BR: [opval, bb#, bb#] or [bb#] FUNC_CODE_INST_SWITCH = 12, // SWITCH: [opty, opval, n, n x ops] - FUNC_CODE_INST_INVOKE = 13, // INVOKE: + FUNC_CODE_INST_INVOKE = 13, // INVOKE: [fnty, op0,op1,op2, ...] FUNC_CODE_INST_UNWIND = 14, // UNWIND FUNC_CODE_INST_UNREACHABLE = 15, // UNREACHABLE - FUNC_CODE_INST_MALLOC = 16, // MALLOC: .. - FUNC_CODE_INST_FREE = 17, // FREE: .. - FUNC_CODE_INST_ALLOCA = 18, // ALLOCA: .. - FUNC_CODE_INST_LOAD = 19, // LOAD: .. - FUNC_CODE_INST_STORE = 20, // STORE: .. - FUNC_CODE_INST_CALL = 21, // CALL: .. - FUNC_CODE_INST_VAARG = 22 // VAARG: .. + FUNC_CODE_INST_PHI = 16, // PHI: [ty, #ops, val0,bb0, ...] + FUNC_CODE_INST_MALLOC = 17, // MALLOC: [instty, op, align] + FUNC_CODE_INST_FREE = 18, // FREE: [opty, op] + FUNC_CODE_INST_ALLOCA = 19, // ALLOCA: [instty, op, align] + FUNC_CODE_INST_LOAD = 20, // LOAD: [opty, op, align, vol] + FUNC_CODE_INST_STORE = 21, // STORE: [ptrty,val,ptr, align, vol] + FUNC_CODE_INST_CALL = 22, // CALL: [fnty, fnid, arg0, arg1...] + FUNC_CODE_INST_VAARG = 23 // VAARG: [valistty, valist, instty] }; } // End bitc namespace } // End llvm namespace From sabre at nondot.org Mon Apr 30 21:13:43 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 30 Apr 2007 21:13:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705010213.l412Dhwv032726@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.16 -> 1.17 --- Log message: encode all of the instructions. --- Diffs of the changes: (+166 -3) BitcodeWriter.cpp | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 166 insertions(+), 3 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.16 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.17 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.16 Sun Apr 29 15:56:48 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Mon Apr 30 21:13:26 2007 @@ -485,13 +485,12 @@ static void WriteInstruction(const Instruction &I, ValueEnumerator &VE, BitstreamWriter &Stream, SmallVector &Vals) { - return; // FIXME: REMOVE unsigned Code = 0; unsigned AbbrevToUse = 0; switch (I.getOpcode()) { default: if (Instruction::isCast(I.getOpcode())) { - Code = bitc::FUNC_CODE_INST_BINOP; + Code = bitc::FUNC_CODE_INST_CAST; Vals.push_back(GetEncodedCastOpcode(I.getOpcode())); Vals.push_back(VE.getTypeID(I.getType())); Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); @@ -505,15 +504,179 @@ Vals.push_back(VE.getValueID(I.getOperand(1))); } break; + + case Instruction::GetElementPtr: + Code = bitc::FUNC_CODE_INST_GEP; + Vals.push_back(I.getNumOperands()); + for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) { + Vals.push_back(VE.getTypeID(I.getOperand(i)->getType())); + Vals.push_back(VE.getValueID(I.getOperand(i))); + } + break; + case Instruction::Select: + Code = bitc::FUNC_CODE_INST_SELECT; + Vals.push_back(VE.getTypeID(I.getType())); + Vals.push_back(VE.getValueID(I.getOperand(0))); + Vals.push_back(VE.getValueID(I.getOperand(1))); + Vals.push_back(VE.getValueID(I.getOperand(2))); + break; + case Instruction::ExtractElement: + Code = bitc::FUNC_CODE_INST_EXTRACTELT; + Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); + Vals.push_back(VE.getValueID(I.getOperand(0))); + Vals.push_back(VE.getValueID(I.getOperand(1))); + break; + case Instruction::InsertElement: + Code = bitc::FUNC_CODE_INST_INSERTELT; + Vals.push_back(VE.getTypeID(I.getType())); + Vals.push_back(VE.getValueID(I.getOperand(0))); + Vals.push_back(VE.getValueID(I.getOperand(1))); + Vals.push_back(VE.getValueID(I.getOperand(2))); + break; + case Instruction::ShuffleVector: + Code = bitc::FUNC_CODE_INST_SHUFFLEVEC; + Vals.push_back(VE.getTypeID(I.getType())); + Vals.push_back(VE.getValueID(I.getOperand(0))); + Vals.push_back(VE.getValueID(I.getOperand(1))); + Vals.push_back(VE.getValueID(I.getOperand(2))); + break; + case Instruction::ICmp: + case Instruction::FCmp: + Code = bitc::FUNC_CODE_INST_CMP; + Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); + Vals.push_back(VE.getValueID(I.getOperand(0))); + Vals.push_back(VE.getValueID(I.getOperand(1))); + Vals.push_back(cast(I).getPredicate()); + break; + + case Instruction::Ret: + Code = bitc::FUNC_CODE_INST_RET; + if (I.getNumOperands()) { + Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); + Vals.push_back(VE.getValueID(I.getOperand(0))); + } + break; + case Instruction::Br: + Code = bitc::FUNC_CODE_INST_BR; + Vals.push_back(VE.getValueID(I.getOperand(0))); + if (cast(I).isConditional()) { + Vals.push_back(VE.getValueID(I.getOperand(1))); + Vals.push_back(VE.getValueID(I.getOperand(2))); + } + break; + case Instruction::Switch: + Code = bitc::FUNC_CODE_INST_SWITCH; + Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); + Vals.push_back(I.getNumOperands()); + for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) + Vals.push_back(VE.getValueID(I.getOperand(i))); + break; + case Instruction::Invoke: + Code = bitc::FUNC_CODE_INST_INVOKE; + // FIXME: param attrs + Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); + Vals.push_back(VE.getValueID(I.getOperand(0))); // callee + Vals.push_back(VE.getValueID(I.getOperand(1))); // normal + Vals.push_back(VE.getValueID(I.getOperand(2))); // unwind - + // Emit value #'s for the fixed parameters. + const PointerType *PTy = cast(I.getOperand(0)->getType()); + const FunctionType *FTy = cast(PTy->getElementType()); + for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) + Vals.push_back(VE.getValueID(I.getOperand(i+3))); // fixed param. + + // Emit type/value pairs for varargs params. + if (FTy->isVarArg()) { + unsigned NumVarargs = I.getNumOperands()-3-FTy->getNumParams(); + Vals.push_back(NumVarargs); + for (unsigned i = I.getNumOperands()-NumVarargs, e = I.getNumOperands(); + i != e; ++i) { + Vals.push_back(VE.getTypeID(I.getOperand(i)->getType())); + Vals.push_back(VE.getValueID(I.getOperand(i))); + } + } + break; case Instruction::Unwind: Code = bitc::FUNC_CODE_INST_UNWIND; break; case Instruction::Unreachable: Code = bitc::FUNC_CODE_INST_UNREACHABLE; break; + + case Instruction::PHI: + Code = bitc::FUNC_CODE_INST_PHI; + Vals.push_back(VE.getTypeID(I.getType())); + Vals.push_back(I.getNumOperands()); + for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) + Vals.push_back(VE.getValueID(I.getOperand(i))); + break; + + case Instruction::Malloc: + Code = bitc::FUNC_CODE_INST_MALLOC; + Vals.push_back(VE.getTypeID(I.getType())); + Vals.push_back(VE.getValueID(I.getOperand(0))); // size. + Vals.push_back(Log2_32(cast(I).getAlignment())+1); + break; + + case Instruction::Free: + Code = bitc::FUNC_CODE_INST_FREE; + Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); + Vals.push_back(VE.getValueID(I.getOperand(0))); + break; + case Instruction::Alloca: + Code = bitc::FUNC_CODE_INST_ALLOCA; + Vals.push_back(VE.getTypeID(I.getType())); + Vals.push_back(VE.getValueID(I.getOperand(0))); // size. + Vals.push_back(Log2_32(cast(I).getAlignment())+1); + break; + + case Instruction::Load: + Code = bitc::FUNC_CODE_INST_LOAD; + Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); + Vals.push_back(VE.getValueID(I.getOperand(0))); // ptr. + Vals.push_back(Log2_32(cast(I).getAlignment())+1); + Vals.push_back(cast(I).isVolatile()); + break; + case Instruction::Store: + Code = bitc::FUNC_CODE_INST_STORE; + Vals.push_back(VE.getTypeID(I.getOperand(1)->getType())); // Pointer + Vals.push_back(VE.getValueID(I.getOperand(0))); // val. + Vals.push_back(VE.getValueID(I.getOperand(1))); // ptr. + Vals.push_back(Log2_32(cast(I).getAlignment())+1); + Vals.push_back(cast(I).isVolatile()); + break; + case Instruction::Call: { + Code = bitc::FUNC_CODE_INST_CALL; + // FIXME: param attrs + Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); + Vals.push_back(VE.getValueID(I.getOperand(0))); // callee + + // Emit value #'s for the fixed parameters. + const PointerType *PTy = cast(I.getOperand(0)->getType()); + const FunctionType *FTy = cast(PTy->getElementType()); + for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) + Vals.push_back(VE.getValueID(I.getOperand(i+1))); // fixed param. + + // Emit type/value pairs for varargs params. + if (FTy->isVarArg()) { + unsigned NumVarargs = I.getNumOperands()-1-FTy->getNumParams(); + Vals.push_back(NumVarargs); + for (unsigned i = I.getNumOperands()-NumVarargs, e = I.getNumOperands(); + i != e; ++i) { + Vals.push_back(VE.getTypeID(I.getOperand(i)->getType())); + Vals.push_back(VE.getValueID(I.getOperand(i))); + } + } + } + break; + + case Instruction::VAArg: + Code = bitc::FUNC_CODE_INST_VAARG; + Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); // valistty + Vals.push_back(VE.getValueID(I.getOperand(0))); // valist. + Vals.push_back(VE.getTypeID(I.getType())); // restype. + break; } Stream.EmitRecord(Code, Vals, AbbrevToUse); From sabre at nondot.org Mon Apr 30 21:15:15 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 30 Apr 2007 21:15:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705010215.l412FFYD000319@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.17 -> 1.18 --- Log message: write the symbol table for function bodies --- Diffs of the changes: (+33 -30) BitcodeWriter.cpp | 63 ++++++++++++++++++++++++++++-------------------------- 1 files changed, 33 insertions(+), 30 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.17 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.18 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.17 Mon Apr 30 21:13:26 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Mon Apr 30 21:14:57 2007 @@ -683,6 +683,36 @@ Vals.clear(); } +// Emit names for globals/functions etc. +static void WriteValueSymbolTable(const ValueSymbolTable &VST, + const ValueEnumerator &VE, + BitstreamWriter &Stream) { + if (VST.empty()) return; + Stream.EnterSubblock(bitc::VALUE_SYMTAB_BLOCK_ID, 3); + + // FIXME: Set up the abbrev, we know how many values there are! + // FIXME: We know if the type names can use 7-bit ascii. + SmallVector NameVals; + + for (ValueSymbolTable::const_iterator SI = VST.begin(), SE = VST.end(); + SI != SE; ++SI) { + unsigned AbbrevToUse = 0; + + // VST_ENTRY: [valueid, namelen, namechar x N] + NameVals.push_back(VE.getValueID(SI->getValue())); + + NameVals.push_back(SI->getKeyLength()); + for (const char *P = SI->getKeyData(), + *E = SI->getKeyData()+SI->getKeyLength(); P != E; ++P) + NameVals.push_back((unsigned char)*P); + + // Emit the finished record. + Stream.EmitRecord(bitc::VST_CODE_ENTRY, NameVals, AbbrevToUse); + NameVals.clear(); + } + Stream.ExitBlock(); +} + /// WriteFunction - Emit a function body to the module stream. static void WriteFunction(const Function &F, ValueEnumerator &VE, BitstreamWriter &Stream) { @@ -709,6 +739,9 @@ for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I) WriteInstruction(*I, VE, Stream, Vals); + // Emit names for all the instructions etc. + WriteValueSymbolTable(F.getValueSymbolTable(), VE, Stream); + VE.purgeFunction(); Stream.ExitBlock(); } @@ -746,36 +779,6 @@ Stream.ExitBlock(); } -// Emit names for globals/functions etc. -static void WriteValueSymbolTable(const ValueSymbolTable &VST, - const ValueEnumerator &VE, - BitstreamWriter &Stream) { - if (VST.empty()) return; - Stream.EnterSubblock(bitc::VALUE_SYMTAB_BLOCK_ID, 3); - - // FIXME: Set up the abbrev, we know how many values there are! - // FIXME: We know if the type names can use 7-bit ascii. - SmallVector NameVals; - - for (ValueSymbolTable::const_iterator SI = VST.begin(), SE = VST.end(); - SI != SE; ++SI) { - unsigned AbbrevToUse = 0; - - // VST_ENTRY: [valueid, namelen, namechar x N] - NameVals.push_back(VE.getValueID(SI->getValue())); - - NameVals.push_back(SI->getKeyLength()); - for (const char *P = SI->getKeyData(), - *E = SI->getKeyData()+SI->getKeyLength(); P != E; ++P) - NameVals.push_back((unsigned char)*P); - - // Emit the finished record. - Stream.EmitRecord(bitc::VST_CODE_ENTRY, NameVals, AbbrevToUse); - NameVals.clear(); - } - Stream.ExitBlock(); -} - /// WriteModule - Emit the specified module to the bitstream. static void WriteModule(const Module *M, BitstreamWriter &Stream) { From sabre at nondot.org Mon Apr 30 21:44:04 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 30 Apr 2007 21:44:04 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Message-ID: <200705010244.l412i42W000855@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-bcanalyzer: llvm-bcanalyzer.cpp updated: 1.15 -> 1.16 --- Log message: add phi --- Diffs of the changes: (+5 -1) llvm-bcanalyzer.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp diff -u llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.15 llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.16 --- llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.15 Sun Apr 29 16:48:19 2007 +++ llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Mon Apr 30 21:43:46 2007 @@ -167,6 +167,7 @@ case bitc::FUNC_CODE_INST_UNWIND: return "INST_UNWIND"; case bitc::FUNC_CODE_INST_UNREACHABLE: return "INST_UNREACHABLE"; + case bitc::FUNC_CODE_INST_PHI: return "INST_PHI"; case bitc::FUNC_CODE_INST_MALLOC: return "INST_MALLOC"; case bitc::FUNC_CODE_INST_FREE: return "INST_FREE"; case bitc::FUNC_CODE_INST_ALLOCA: return "INST_ALLOCA"; @@ -371,10 +372,11 @@ if (Dump) std::cerr << "\n\n"; + uint64_t BufferSizeBits = Buffer->getBufferSize()*8; // Print a summary of the read file. std::cerr << "Summary of " << InputFilename << ":\n"; std::cerr << " Total size: "; - PrintSize(Buffer->getBufferSize()*8); + PrintSize(BufferSizeBits); std::cerr << "\n"; std::cerr << " Stream type: "; switch (CurStreamType) { @@ -402,6 +404,8 @@ std::cerr << " Average Size: "; PrintSize(Stats.NumBits/(double)Stats.NumInstances); std::cerr << "\n"; + std::cerr << " % of file: " + << Stats.NumBits/(double)BufferSizeBits*100 << "\n"; std::cerr << " Tot/Avg SubBlocks: " << Stats.NumSubBlocks << "/" << Stats.NumSubBlocks/(double)Stats.NumInstances << "\n"; std::cerr << " Tot/Avg Abbrevs: " << Stats.NumAbbrevs << "/" From reid at x10sys.com Mon Apr 30 21:56:39 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 30 Apr 2007 21:56:39 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/vector.ll Message-ID: <200705010256.l412udbf001067@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: vector.ll updated: 1.13 -> 1.14 --- Log message: Split target dependent test portions to target-specific directories. --- Diffs of the changes: (+0 -4) vector.ll | 4 ---- 1 files changed, 4 deletions(-) Index: llvm/test/CodeGen/Generic/vector.ll diff -u llvm/test/CodeGen/Generic/vector.ll:1.13 llvm/test/CodeGen/Generic/vector.ll:1.14 --- llvm/test/CodeGen/Generic/vector.ll:1.13 Mon Apr 16 12:36:06 2007 +++ llvm/test/CodeGen/Generic/vector.ll Mon Apr 30 21:56:15 2007 @@ -1,10 +1,6 @@ ; Test that vectors are scalarized/lowered correctly. ; RUN: llvm-upgrade < %s | llvm-as | llc ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple a-b-c -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g3 -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=i386 -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah %f1 = type <1 x float> %f2 = type <2 x float> From reid at x10sys.com Mon Apr 30 21:56:39 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 30 Apr 2007 21:56:39 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/vector.ll Message-ID: <200705010256.l412udWE001072@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: vector.ll added (r1.1) --- Log message: Split target dependent test portions to target-specific directories. --- Diffs of the changes: (+157 -0) vector.ll | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 157 insertions(+) Index: llvm/test/CodeGen/X86/vector.ll diff -c /dev/null llvm/test/CodeGen/X86/vector.ll:1.1 *** /dev/null Mon Apr 30 21:56:25 2007 --- llvm/test/CodeGen/X86/vector.ll Mon Apr 30 21:56:15 2007 *************** *** 0 **** --- 1,157 ---- + ; Test that vectors are scalarized/lowered correctly. + ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=i386 + ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah + + %f1 = type <1 x float> + %f2 = type <2 x float> + %f4 = type <4 x float> + %i4 = type <4 x int> + %f8 = type <8 x float> + %d8 = type <8 x double> + + implementation + + ;;; TEST HANDLING OF VARIOUS VECTOR SIZES + + void %test_f1(%f1 *%P, %f1* %Q, %f1 *%S) { + %p = load %f1 *%P + %q = load %f1* %Q + %R = add %f1 %p, %q + store %f1 %R, %f1 *%S + ret void + } + + void %test_f2(%f2 *%P, %f2* %Q, %f2 *%S) { + %p = load %f2* %P + %q = load %f2* %Q + %R = add %f2 %p, %q + store %f2 %R, %f2 *%S + ret void + } + + void %test_f4(%f4 *%P, %f4* %Q, %f4 *%S) { + %p = load %f4* %P + %q = load %f4* %Q + %R = add %f4 %p, %q + store %f4 %R, %f4 *%S + ret void + } + + void %test_f8(%f8 *%P, %f8* %Q, %f8 *%S) { + %p = load %f8* %P + %q = load %f8* %Q + %R = add %f8 %p, %q + store %f8 %R, %f8 *%S + ret void + } + + void %test_fmul(%f8 *%P, %f8* %Q, %f8 *%S) { + %p = load %f8* %P + %q = load %f8* %Q + %R = mul %f8 %p, %q + store %f8 %R, %f8 *%S + ret void + } + + void %test_div(%f8 *%P, %f8* %Q, %f8 *%S) { + %p = load %f8* %P + %q = load %f8* %Q + %R = div %f8 %p, %q + store %f8 %R, %f8 *%S + ret void + } + + ;;; TEST VECTOR CONSTRUCTS + + void %test_cst(%f4 *%P, %f4 *%S) { + %p = load %f4* %P + %R = add %f4 %p, + store %f4 %R, %f4 *%S + ret void + } + + void %test_zero(%f4 *%P, %f4 *%S) { + %p = load %f4* %P + %R = add %f4 %p, zeroinitializer + store %f4 %R, %f4 *%S + ret void + } + + void %test_undef(%f4 *%P, %f4 *%S) { + %p = load %f4* %P + %R = add %f4 %p, undef + store %f4 %R, %f4 *%S + ret void + } + + void %test_constant_insert(%f4 *%S) { + %R = insertelement %f4 zeroinitializer, float 10.0, uint 0 + store %f4 %R, %f4 *%S + ret void + } + + void %test_variable_buildvector(float %F, %f4 *%S) { + %R = insertelement %f4 zeroinitializer, float %F, uint 0 + store %f4 %R, %f4 *%S + ret void + } + + void %test_scalar_to_vector(float %F, %f4 *%S) { + %R = insertelement %f4 undef, float %F, uint 0 ;; R = scalar_to_vector F + store %f4 %R, %f4 *%S + ret void + } + + float %test_extract_elt(%f8 *%P) { + %p = load %f8* %P + %R = extractelement %f8 %p, uint 3 + ret float %R + } + + double %test_extract_elt2(%d8 *%P) { + %p = load %d8* %P + %R = extractelement %d8 %p, uint 3 + ret double %R + } + + void %test_cast_1(<4 x float>* %b, <4 x int>* %a) { + %tmp = load <4 x float>* %b + %tmp2 = add <4 x float> %tmp, + %tmp3 = cast <4 x float> %tmp2 to <4 x int> + %tmp4 = add <4 x int> %tmp3, + store <4 x int> %tmp4, <4 x int>* %a + ret void + } + + void %test_cast_2(<8 x float>* %a, <8 x int>* %b) { + %T = load <8 x float>* %a + %T2 = cast <8 x float> %T to <8 x int> + store <8 x int> %T2, <8 x int>* %b + ret void + } + + + ;;; TEST IMPORTANT IDIOMS + + void %splat(%f4* %P, %f4* %Q, float %X) { + %tmp = insertelement %f4 undef, float %X, uint 0 + %tmp2 = insertelement %f4 %tmp, float %X, uint 1 + %tmp4 = insertelement %f4 %tmp2, float %X, uint 2 + %tmp6 = insertelement %f4 %tmp4, float %X, uint 3 + %q = load %f4* %Q + %R = add %f4 %q, %tmp6 + store %f4 %R, %f4* %P + ret void + } + + void %splat_i4(%i4* %P, %i4* %Q, int %X) { + %tmp = insertelement %i4 undef, int %X, uint 0 + %tmp2 = insertelement %i4 %tmp, int %X, uint 1 + %tmp4 = insertelement %i4 %tmp2, int %X, uint 2 + %tmp6 = insertelement %i4 %tmp4, int %X, uint 3 + %q = load %i4* %Q + %R = add %i4 %q, %tmp6 + store %i4 %R, %i4* %P + ret void + } + From reid at x10sys.com Mon Apr 30 21:56:41 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 30 Apr 2007 21:56:41 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/vector.ll Message-ID: <200705010256.l412ufOf001077@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: vector.ll added (r1.1) --- Log message: Split target dependent test portions to target-specific directories. --- Diffs of the changes: (+157 -0) vector.ll | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 157 insertions(+) Index: llvm/test/CodeGen/PowerPC/vector.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/vector.ll:1.1 *** /dev/null Mon Apr 30 21:56:25 2007 --- llvm/test/CodeGen/PowerPC/vector.ll Mon Apr 30 21:56:15 2007 *************** *** 0 **** --- 1,157 ---- + ; Test that vectors are scalarized/lowered correctly. + ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 + ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g3 + + %f1 = type <1 x float> + %f2 = type <2 x float> + %f4 = type <4 x float> + %i4 = type <4 x int> + %f8 = type <8 x float> + %d8 = type <8 x double> + + implementation + + ;;; TEST HANDLING OF VARIOUS VECTOR SIZES + + void %test_f1(%f1 *%P, %f1* %Q, %f1 *%S) { + %p = load %f1 *%P + %q = load %f1* %Q + %R = add %f1 %p, %q + store %f1 %R, %f1 *%S + ret void + } + + void %test_f2(%f2 *%P, %f2* %Q, %f2 *%S) { + %p = load %f2* %P + %q = load %f2* %Q + %R = add %f2 %p, %q + store %f2 %R, %f2 *%S + ret void + } + + void %test_f4(%f4 *%P, %f4* %Q, %f4 *%S) { + %p = load %f4* %P + %q = load %f4* %Q + %R = add %f4 %p, %q + store %f4 %R, %f4 *%S + ret void + } + + void %test_f8(%f8 *%P, %f8* %Q, %f8 *%S) { + %p = load %f8* %P + %q = load %f8* %Q + %R = add %f8 %p, %q + store %f8 %R, %f8 *%S + ret void + } + + void %test_fmul(%f8 *%P, %f8* %Q, %f8 *%S) { + %p = load %f8* %P + %q = load %f8* %Q + %R = mul %f8 %p, %q + store %f8 %R, %f8 *%S + ret void + } + + void %test_div(%f8 *%P, %f8* %Q, %f8 *%S) { + %p = load %f8* %P + %q = load %f8* %Q + %R = div %f8 %p, %q + store %f8 %R, %f8 *%S + ret void + } + + ;;; TEST VECTOR CONSTRUCTS + + void %test_cst(%f4 *%P, %f4 *%S) { + %p = load %f4* %P + %R = add %f4 %p, + store %f4 %R, %f4 *%S + ret void + } + + void %test_zero(%f4 *%P, %f4 *%S) { + %p = load %f4* %P + %R = add %f4 %p, zeroinitializer + store %f4 %R, %f4 *%S + ret void + } + + void %test_undef(%f4 *%P, %f4 *%S) { + %p = load %f4* %P + %R = add %f4 %p, undef + store %f4 %R, %f4 *%S + ret void + } + + void %test_constant_insert(%f4 *%S) { + %R = insertelement %f4 zeroinitializer, float 10.0, uint 0 + store %f4 %R, %f4 *%S + ret void + } + + void %test_variable_buildvector(float %F, %f4 *%S) { + %R = insertelement %f4 zeroinitializer, float %F, uint 0 + store %f4 %R, %f4 *%S + ret void + } + + void %test_scalar_to_vector(float %F, %f4 *%S) { + %R = insertelement %f4 undef, float %F, uint 0 ;; R = scalar_to_vector F + store %f4 %R, %f4 *%S + ret void + } + + float %test_extract_elt(%f8 *%P) { + %p = load %f8* %P + %R = extractelement %f8 %p, uint 3 + ret float %R + } + + double %test_extract_elt2(%d8 *%P) { + %p = load %d8* %P + %R = extractelement %d8 %p, uint 3 + ret double %R + } + + void %test_cast_1(<4 x float>* %b, <4 x int>* %a) { + %tmp = load <4 x float>* %b + %tmp2 = add <4 x float> %tmp, + %tmp3 = cast <4 x float> %tmp2 to <4 x int> + %tmp4 = add <4 x int> %tmp3, + store <4 x int> %tmp4, <4 x int>* %a + ret void + } + + void %test_cast_2(<8 x float>* %a, <8 x int>* %b) { + %T = load <8 x float>* %a + %T2 = cast <8 x float> %T to <8 x int> + store <8 x int> %T2, <8 x int>* %b + ret void + } + + + ;;; TEST IMPORTANT IDIOMS + + void %splat(%f4* %P, %f4* %Q, float %X) { + %tmp = insertelement %f4 undef, float %X, uint 0 + %tmp2 = insertelement %f4 %tmp, float %X, uint 1 + %tmp4 = insertelement %f4 %tmp2, float %X, uint 2 + %tmp6 = insertelement %f4 %tmp4, float %X, uint 3 + %q = load %f4* %Q + %R = add %f4 %q, %tmp6 + store %f4 %R, %f4* %P + ret void + } + + void %splat_i4(%i4* %P, %i4* %Q, int %X) { + %tmp = insertelement %i4 undef, int %X, uint 0 + %tmp2 = insertelement %i4 %tmp, int %X, uint 1 + %tmp4 = insertelement %i4 %tmp2, int %X, uint 2 + %tmp6 = insertelement %i4 %tmp4, int %X, uint 3 + %q = load %i4* %Q + %R = add %i4 %q, %tmp6 + store %i4 %R, %i4* %P + ret void + } + From clattner at apple.com Mon Apr 30 23:39:37 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 30 Apr 2007 21:39:37 -0700 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp In-Reply-To: <200705010038.l410ccOi031037@zion.cs.uiuc.edu> References: <200705010038.l410ccOi031037@zion.cs.uiuc.edu> Message-ID: <1E6DD6BA-308B-406A-AA3F-CD634D9A3412@apple.com> > + bool HasUses = false; > + SmallVector VTs; > + for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) { > + if (!N->hasNUsesOfValue(0, i)) { > + HasUses = true; > + break; > + } > + VTs.push_back(N->getValueType(i)); > + } > + if (!HasUses) { > + SmallVector Ops; > + return CombineTo(N, DAG.getNode(ISD::UNDEF, &VTs[0], VTs.size > (), 0, 0), > + Chain); This can never trigger and isn't right if it did. #1: This should trigger if the chain has uses but the other values do not. If the entire node is dead, it will already have been removed. #2. you can't create an undef with multiple results, you have to create multiple undefs :) I'd suggest just writing this as: if (N->getValueType(1) == MVT::Other) { // single result case. } else { assert(N->getValueType(2) == MVT::Other); // multi result case. } This lets you drop the looping and smallvector. -Chris From sabre at nondot.org Mon Apr 30 23:59:24 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 30 Apr 2007 23:59:24 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/BitstreamReader.h Message-ID: <200705010459.l414xOA4003472@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: BitstreamReader.h updated: 1.9 -> 1.10 --- Log message: add JumpToBit, an explicit init method, and a default ctor. --- Diffs of the changes: (+28 -2) BitstreamReader.h | 30 ++++++++++++++++++++++++++++-- 1 files changed, 28 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Bitcode/BitstreamReader.h diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.9 llvm/include/llvm/Bitcode/BitstreamReader.h:1.10 --- llvm/include/llvm/Bitcode/BitstreamReader.h:1.9 Sun Apr 29 16:49:05 2007 +++ llvm/include/llvm/Bitcode/BitstreamReader.h Mon Apr 30 23:59:06 2007 @@ -51,8 +51,20 @@ /// FirstChar - This remembers the first byte of the stream. const unsigned char *FirstChar; public: - BitstreamReader(const unsigned char *Start, const unsigned char *End) - : NextChar(Start), LastChar(End), FirstChar(Start) { + BitstreamReader() { + NextChar = FirstChar = LastChar = 0; + CurWord = 0; + BitsInCurWord = 0; + CurCodeSize = 0; + } + + BitstreamReader(const unsigned char *Start, const unsigned char *End) { + init(Start, End); + } + + void init(const unsigned char *Start, const unsigned char *End) { + NextChar = FirstChar = Start; + LastChar = End; assert(((End-Start) & 3) == 0 &&"Bitcode stream not a multiple of 4 bytes"); CurWord = 0; BitsInCurWord = 0; @@ -79,6 +91,20 @@ return (NextChar-FirstChar)*8 + (32-BitsInCurWord); } + /// JumpToBit - Reset the stream to the specified bit number. + void JumpToBit(uint64_t BitNo) { + unsigned WordNo = BitNo/32; + unsigned WordBitNo = BitNo & 31; + assert(WordNo < (unsigned)(LastChar-FirstChar) && "Invalid location"); + + // Move the cursor to the right word. + NextChar = FirstChar+WordNo; + BitsInCurWord = 0; + + // Skip over any bits that are already consumed. + if (WordBitNo) Read(WordBitNo); + } + /// GetAbbrevIDWidth - Return the number of bits used to encode an abbrev #. unsigned GetAbbrevIDWidth() const { return CurCodeSize; } From sabre at nondot.org Tue May 1 00:00:05 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 1 May 2007 00:00:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp BitcodeReader.h Message-ID: <200705010500.l41505Tj003570@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.17 -> 1.18 BitcodeReader.h updated: 1.11 -> 1.12 --- Log message: implement scafolding for lazy deserialization of function bodies --- Diffs of the changes: (+85 -7) BitcodeReader.cpp | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- BitcodeReader.h | 27 ++++++++++++++++++---- 2 files changed, 85 insertions(+), 7 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.17 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.18 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.17 Sun Apr 29 15:56:48 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Mon Apr 30 23:59:48 2007 @@ -13,7 +13,6 @@ #include "llvm/Bitcode/ReaderWriter.h" #include "BitcodeReader.h" -#include "llvm/Bitcode/BitstreamReader.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" @@ -660,6 +659,30 @@ } } +/// ParseFunction - When we see the block for a function body, remember where it +/// is and then skip it. This lets us lazily deserialize the functions. +bool BitcodeReader::ParseFunction(BitstreamReader &Stream) { + // Get the function we are talking about. + if (FunctionsWithBodies.empty()) + return Error("Insufficient function protos"); + + Function *Fn = FunctionsWithBodies.back(); + FunctionsWithBodies.pop_back(); + + // Save the current stream state. + uint64_t CurBit = Stream.GetCurrentBitNo(); + DeferredFunctionInfo[Fn] = std::make_pair(CurBit, Fn->getLinkage()); + + // Set the functions linkage to GhostLinkage so we know it is lazily + // deserialized. + Fn->setLinkage(GlobalValue::GhostLinkage); + + // Skip over the function block for now. + if (Stream.SkipBlock()) + return Error("Malformed block record"); + return false; +} + bool BitcodeReader::ParseModule(BitstreamReader &Stream, const std::string &ModuleID) { // Reject multiple MODULE_BLOCK's in a single bitstream. @@ -682,6 +705,8 @@ ResolveGlobalAndAliasInits(); if (!GlobalInits.empty() || !AliasInits.empty()) return Error("Malformed global initializer set"); + if (!FunctionsWithBodies.empty()) + return Error("Too few function bodies found"); if (Stream.ReadBlockEnd()) return Error("Error at end of module block"); return false; @@ -709,6 +734,17 @@ if (ParseConstants(Stream) || ResolveGlobalAndAliasInits()) return true; break; + case bitc::FUNCTION_BLOCK_ID: + // If this is the first function body we've seen, reverse the + // FunctionsWithBodies list. + if (!HasReversedFunctionsWithBodies) { + std::reverse(FunctionsWithBodies.begin(), FunctionsWithBodies.end()); + HasReversedFunctionsWithBodies = true; + } + + if (ParseFunction(Stream)) + return true; + break; } continue; } @@ -819,6 +855,7 @@ "", TheModule); Func->setCallingConv(Record[1]); + bool isProto = Record[2]; Func->setLinkage(GetDecodedLinkage(Record[3])); Func->setAlignment((1 << Record[4]) >> 1); if (Record[5]) { @@ -829,6 +866,11 @@ Func->setVisibility(GetDecodedVisibility(Record[6])); ValueList.push_back(Func); + + // If this is a function with a body, remember the prototype we are + // creating now, so that we can match up the body with them later. + if (!isProto) + FunctionsWithBodies.push_back(Func); break; } // ALIAS: [alias type, aliasee val#, linkage] @@ -867,7 +909,7 @@ return Error("Bitcode stream should be a multiple of 4 bytes in length"); unsigned char *BufPtr = (unsigned char *)Buffer->getBufferStart(); - BitstreamReader Stream(BufPtr, BufPtr+Buffer->getBufferSize()); + Stream.init(BufPtr, BufPtr+Buffer->getBufferSize()); // Sniff for the signature. if (Stream.Read(8) != 'B' || @@ -900,6 +942,25 @@ return false; } + +bool BitcodeReader::materializeFunction(Function *F, std::string *ErrInfo) { + // If it already is material, ignore the request. + if (!F->hasNotBeenReadFromBytecode()) return false; + + DenseMap >::iterator DFII = + DeferredFunctionInfo.find(F); + assert(DFII != DeferredFunctionInfo.end() && "Deferred function not found!"); + + // Move the bit stream to the saved position of the deferred function body and + // restore the real linkage type for the function. + Stream.JumpToBit(DFII->second.first); + F->setLinkage((GlobalValue::LinkageTypes)DFII->second.second); + DeferredFunctionInfo.erase(DFII); + + return false; +} + + //===----------------------------------------------------------------------===// // External interface //===----------------------------------------------------------------------===// Index: llvm/lib/Bitcode/Reader/BitcodeReader.h diff -u llvm/lib/Bitcode/Reader/BitcodeReader.h:1.11 llvm/lib/Bitcode/Reader/BitcodeReader.h:1.12 --- llvm/lib/Bitcode/Reader/BitcodeReader.h:1.11 Sun Apr 29 02:54:31 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.h Mon Apr 30 23:59:48 2007 @@ -17,7 +17,9 @@ #include "llvm/ModuleProvider.h" #include "llvm/Type.h" #include "llvm/User.h" +#include "llvm/Bitcode/BitstreamReader.h" #include "llvm/Bitcode/LLVMBitCodes.h" +#include "llvm/ADT/DenseMap.h" #include namespace llvm { @@ -59,14 +61,31 @@ class BitcodeReader : public ModuleProvider { MemoryBuffer *Buffer; + BitstreamReader Stream; + const char *ErrorString; std::vector TypeList; BitcodeReaderValueList ValueList; std::vector > GlobalInits; std::vector > AliasInits; + + // When reading the module header, this list is populated with functions that + // have bodies later in the file. + std::vector FunctionsWithBodies; + + // After the module header has been read, the FunctionsWithBodies list is + // reversed. This keeps track of whether we've done this yet. + bool HasReversedFunctionsWithBodies; + + /// DeferredFunctionInfo - When function bodies are initially scanned, this + /// map contains info about where to find deferred function body (in the + /// stream) and what linkage the original function had. + DenseMap > DeferredFunctionInfo; public: - BitcodeReader(MemoryBuffer *buffer) : Buffer(buffer), ErrorString(0) {} + BitcodeReader(MemoryBuffer *buffer) : Buffer(buffer), ErrorString(0) { + HasReversedFunctionsWithBodies = false; + } ~BitcodeReader(); @@ -77,10 +96,7 @@ Buffer = 0; } - virtual bool materializeFunction(Function *F, std::string *ErrInfo = 0) { - // FIXME: TODO - return false; - } + virtual bool materializeFunction(Function *F, std::string *ErrInfo = 0); virtual Module *materializeModule(std::string *ErrInfo = 0) { // FIXME: TODO @@ -106,6 +122,7 @@ bool ParseTypeSymbolTable(BitstreamReader &Stream); bool ParseValueSymbolTable(BitstreamReader &Stream); bool ParseConstants(BitstreamReader &Stream); + bool ParseFunction(BitstreamReader &Stream); bool ResolveGlobalAndAliasInits(); }; From sabre at nondot.org Tue May 1 00:01:52 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 1 May 2007 00:01:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp BitcodeReader.h Message-ID: <200705010501.l4151q0r003643@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.18 -> 1.19 BitcodeReader.h updated: 1.12 -> 1.13 --- Log message: The stream to read from is now an ivar --- Diffs of the changes: (+18 -20) BitcodeReader.cpp | 25 ++++++++++++------------- BitcodeReader.h | 13 ++++++------- 2 files changed, 18 insertions(+), 20 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.18 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.19 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.18 Mon Apr 30 23:59:48 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Tue May 1 00:01:34 2007 @@ -152,7 +152,7 @@ } -bool BitcodeReader::ParseTypeTable(BitstreamReader &Stream) { +bool BitcodeReader::ParseTypeTable() { if (Stream.EnterSubBlock()) return Error("Malformed block record"); @@ -298,7 +298,7 @@ } -bool BitcodeReader::ParseTypeSymbolTable(BitstreamReader &Stream) { +bool BitcodeReader::ParseTypeSymbolTable() { if (Stream.EnterSubBlock()) return Error("Malformed block record"); @@ -346,7 +346,7 @@ } } -bool BitcodeReader::ParseValueSymbolTable(BitstreamReader &Stream) { +bool BitcodeReader::ParseValueSymbolTable() { if (Stream.EnterSubBlock()) return Error("Malformed block record"); @@ -444,7 +444,7 @@ } -bool BitcodeReader::ParseConstants(BitstreamReader &Stream) { +bool BitcodeReader::ParseConstants() { if (Stream.EnterSubBlock()) return Error("Malformed block record"); @@ -661,7 +661,7 @@ /// ParseFunction - When we see the block for a function body, remember where it /// is and then skip it. This lets us lazily deserialize the functions. -bool BitcodeReader::ParseFunction(BitstreamReader &Stream) { +bool BitcodeReader::ParseFunction() { // Get the function we are talking about. if (FunctionsWithBodies.empty()) return Error("Insufficient function protos"); @@ -683,8 +683,7 @@ return false; } -bool BitcodeReader::ParseModule(BitstreamReader &Stream, - const std::string &ModuleID) { +bool BitcodeReader::ParseModule(const std::string &ModuleID) { // Reject multiple MODULE_BLOCK's in a single bitstream. if (TheModule) return Error("Multiple MODULE_BLOCKs in same stream"); @@ -719,19 +718,19 @@ return Error("Malformed block record"); break; case bitc::TYPE_BLOCK_ID: - if (ParseTypeTable(Stream)) + if (ParseTypeTable()) return true; break; case bitc::TYPE_SYMTAB_BLOCK_ID: - if (ParseTypeSymbolTable(Stream)) + if (ParseTypeSymbolTable()) return true; break; case bitc::VALUE_SYMTAB_BLOCK_ID: - if (ParseValueSymbolTable(Stream)) + if (ParseValueSymbolTable()) return true; break; case bitc::CONSTANTS_BLOCK_ID: - if (ParseConstants(Stream) || ResolveGlobalAndAliasInits()) + if (ParseConstants() || ResolveGlobalAndAliasInits()) return true; break; case bitc::FUNCTION_BLOCK_ID: @@ -742,7 +741,7 @@ HasReversedFunctionsWithBodies = true; } - if (ParseFunction(Stream)) + if (ParseFunction()) return true; break; } @@ -932,7 +931,7 @@ // We only know the MODULE subblock ID. if (BlockID == bitc::MODULE_BLOCK_ID) { - if (ParseModule(Stream, Buffer->getBufferIdentifier())) + if (ParseModule(Buffer->getBufferIdentifier())) return true; } else if (Stream.SkipBlock()) { return Error("Malformed block record"); Index: llvm/lib/Bitcode/Reader/BitcodeReader.h diff -u llvm/lib/Bitcode/Reader/BitcodeReader.h:1.12 llvm/lib/Bitcode/Reader/BitcodeReader.h:1.13 --- llvm/lib/Bitcode/Reader/BitcodeReader.h:1.12 Mon Apr 30 23:59:48 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.h Tue May 1 00:01:34 2007 @@ -23,7 +23,6 @@ #include namespace llvm { - class BitstreamReader; class MemoryBuffer; class BitcodeReaderValueList : public User { @@ -117,12 +116,12 @@ private: const Type *getTypeByID(unsigned ID, bool isTypeTable = false); - bool ParseModule(BitstreamReader &Stream, const std::string &ModuleID); - bool ParseTypeTable(BitstreamReader &Stream); - bool ParseTypeSymbolTable(BitstreamReader &Stream); - bool ParseValueSymbolTable(BitstreamReader &Stream); - bool ParseConstants(BitstreamReader &Stream); - bool ParseFunction(BitstreamReader &Stream); + bool ParseModule(const std::string &ModuleID); + bool ParseTypeTable(); + bool ParseTypeSymbolTable(); + bool ParseValueSymbolTable(); + bool ParseConstants(); + bool ParseFunction(); bool ResolveGlobalAndAliasInits(); }; From sabre at nondot.org Tue May 1 00:51:51 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 1 May 2007 00:51:51 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/BitstreamReader.h Message-ID: <200705010551.l415ppSj005064@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: BitstreamReader.h updated: 1.10 -> 1.11 --- Log message: several bitfixes to JumpToBit --- Diffs of the changes: (+7 -4) BitstreamReader.h | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) Index: llvm/include/llvm/Bitcode/BitstreamReader.h diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.10 llvm/include/llvm/Bitcode/BitstreamReader.h:1.11 --- llvm/include/llvm/Bitcode/BitstreamReader.h:1.10 Mon Apr 30 23:59:06 2007 +++ llvm/include/llvm/Bitcode/BitstreamReader.h Tue May 1 00:51:32 2007 @@ -93,16 +93,19 @@ /// JumpToBit - Reset the stream to the specified bit number. void JumpToBit(uint64_t BitNo) { - unsigned WordNo = BitNo/32; + unsigned ByteNo = (BitNo/8) & ~3; unsigned WordBitNo = BitNo & 31; - assert(WordNo < (unsigned)(LastChar-FirstChar) && "Invalid location"); + assert(ByteNo < (unsigned)(LastChar-FirstChar) && "Invalid location"); // Move the cursor to the right word. - NextChar = FirstChar+WordNo; + NextChar = FirstChar+ByteNo; BitsInCurWord = 0; // Skip over any bits that are already consumed. - if (WordBitNo) Read(WordBitNo); + if (WordBitNo) { + NextChar -= 4; + Read(WordBitNo); + } } /// GetAbbrevIDWidth - Return the number of bits used to encode an abbrev #. From sabre at nondot.org Tue May 1 00:52:40 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 1 May 2007 00:52:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp BitcodeReader.h Message-ID: <200705010552.l415qeAi005113@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.19 -> 1.20 BitcodeReader.h updated: 1.13 -> 1.14 --- Log message: implement materializeModule, force deallocation of vector memory when we are done with them, start implementing ParseFunctionBody --- Diffs of the changes: (+107 -15) BitcodeReader.cpp | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++---- BitcodeReader.h | 17 ++++---- 2 files changed, 107 insertions(+), 15 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.19 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.20 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.19 Tue May 1 00:01:34 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Tue May 1 00:52:21 2007 @@ -659,9 +659,10 @@ } } -/// ParseFunction - When we see the block for a function body, remember where it -/// is and then skip it. This lets us lazily deserialize the functions. -bool BitcodeReader::ParseFunction() { +/// RememberAndSkipFunctionBody - When we see the block for a function body, +/// remember where it is and then skip it. This lets us lazily deserialize the +/// functions. +bool BitcodeReader::RememberAndSkipFunctionBody() { // Get the function we are talking about. if (FunctionsWithBodies.empty()) return Error("Insufficient function protos"); @@ -701,13 +702,21 @@ while (!Stream.AtEndOfStream()) { unsigned Code = Stream.ReadCode(); if (Code == bitc::END_BLOCK) { + if (Stream.ReadBlockEnd()) + return Error("Error at end of module block"); + + // Patch the initializers for globals and aliases up. ResolveGlobalAndAliasInits(); if (!GlobalInits.empty() || !AliasInits.empty()) return Error("Malformed global initializer set"); if (!FunctionsWithBodies.empty()) return Error("Too few function bodies found"); - if (Stream.ReadBlockEnd()) - return Error("Error at end of module block"); + + // Force deallocation of memory for these vectors to favor the client that + // want lazy deserialization. + std::vector >().swap(GlobalInits); + std::vector >().swap(AliasInits); + std::vector().swap(FunctionsWithBodies); return false; } @@ -741,7 +750,7 @@ HasReversedFunctionsWithBodies = true; } - if (ParseFunction()) + if (RememberAndSkipFunctionBody()) return true; break; } @@ -956,6 +965,90 @@ F->setLinkage((GlobalValue::LinkageTypes)DFII->second.second); DeferredFunctionInfo.erase(DFII); + if (ParseFunctionBody(F)) { + if (ErrInfo) *ErrInfo = ErrorString; + return true; + } + + return false; +} + +Module *BitcodeReader::materializeModule(std::string *ErrInfo) { + DenseMap >::iterator I = + DeferredFunctionInfo.begin(); + while (!DeferredFunctionInfo.empty()) { + Function *F = (*I++).first; + assert(F->hasNotBeenReadFromBytecode() && + "Deserialized function found in map!"); + if (materializeFunction(F, ErrInfo)) + return 0; + } + return TheModule; +} + + +/// ParseFunctionBody - Lazily parse the specified function body block. +bool BitcodeReader::ParseFunctionBody(Function *F) { + if (Stream.EnterSubBlock()) + return Error("Malformed block record"); + + unsigned ModuleValueListSize = ValueList.size(); + + // Add all the function arguments to the value table. + for(Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I) + ValueList.push_back(I); + + // Read all the records. + SmallVector Record; + while (1) { + unsigned Code = Stream.ReadCode(); + if (Code == bitc::END_BLOCK) { + if (Stream.ReadBlockEnd()) + return Error("Error at end of function block"); + break; + } + + if (Code == bitc::ENTER_SUBBLOCK) { + switch (Stream.ReadSubBlockID()) { + default: // Skip unknown content. + if (Stream.SkipBlock()) + return Error("Malformed block record"); + break; + case bitc::CONSTANTS_BLOCK_ID: + if (ParseConstants()) return true; + break; + case bitc::VALUE_SYMTAB_BLOCK_ID: + if (ParseValueSymbolTable()) return true; + break; + } + continue; + } + + if (Code == bitc::DEFINE_ABBREV) { + Stream.ReadAbbrevRecord(); + continue; + } + + // Read a record. + Record.clear(); + switch (Stream.ReadRecord(Code, Record)) { + default: // Default behavior: unknown constant + case bitc::FUNC_CODE_DECLAREBLOCKS: // DECLAREBLOCKS: [nblocks] + if (Record.size() < 1) + return Error("Invalid FUNC_CODE_DECLAREBLOCKS record"); + // Create all the basic blocks for the function. + FunctionBBs.resize(Record.size()); + for (unsigned i = 0, e = FunctionBBs.size(); i != e; ++i) + FunctionBBs[i] = new BasicBlock("", F); + break; + } + } + + + // Trim the value list down to the size it was before we parsed this function. + ValueList.shrinkTo(ModuleValueListSize); + std::vector().swap(FunctionBBs); + return false; } Index: llvm/lib/Bitcode/Reader/BitcodeReader.h diff -u llvm/lib/Bitcode/Reader/BitcodeReader.h:1.13 llvm/lib/Bitcode/Reader/BitcodeReader.h:1.14 --- llvm/lib/Bitcode/Reader/BitcodeReader.h:1.13 Tue May 1 00:01:34 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.h Tue May 1 00:52:21 2007 @@ -44,7 +44,7 @@ void pop_back() { Uses.pop_back(); --NumOperands; } bool empty() const { return NumOperands == 0; } void shrinkTo(unsigned N) { - assert(N < NumOperands && "Invalid shrinkTo request!"); + assert(N <= NumOperands && "Invalid shrinkTo request!"); Uses.resize(N); NumOperands = N; } @@ -69,6 +69,10 @@ std::vector > GlobalInits; std::vector > AliasInits; + /// FunctionBBs - While parsing a function body, this is a list of the basic + /// blocks for the function. + std::vector FunctionBBs; + // When reading the module header, this list is populated with functions that // have bodies later in the file. std::vector FunctionsWithBodies; @@ -96,13 +100,7 @@ } virtual bool materializeFunction(Function *F, std::string *ErrInfo = 0); - - virtual Module *materializeModule(std::string *ErrInfo = 0) { - // FIXME: TODO - //if (ParseAllFunctionBodies(ErrMsg)) - // return 0; - return TheModule; - } + virtual Module *materializeModule(std::string *ErrInfo = 0); bool Error(const char *Str) { ErrorString = Str; @@ -121,7 +119,8 @@ bool ParseTypeSymbolTable(); bool ParseValueSymbolTable(); bool ParseConstants(); - bool ParseFunction(); + bool RememberAndSkipFunctionBody(); + bool ParseFunctionBody(Function *F); bool ResolveGlobalAndAliasInits(); }; From natebegeman at mac.com Tue May 1 00:57:37 2007 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 1 May 2007 00:57:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Target.td Message-ID: <200705010557.l415vbiV005225@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: Target.td updated: 1.96 -> 1.97 --- Log message: llvm bug #1350, parts 1, 2, and 3. --- Diffs of the changes: (+9 -7) Target.td | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) Index: llvm/lib/Target/Target.td diff -u llvm/lib/Target/Target.td:1.96 llvm/lib/Target/Target.td:1.97 --- llvm/lib/Target/Target.td:1.96 Fri Apr 20 16:13:46 2007 +++ llvm/lib/Target/Target.td Tue May 1 00:57:02 2007 @@ -67,13 +67,15 @@ let SubRegs = subregs; } -// RegisterGroup - This can be used to define instances of Register which -// need to specify aliases. -// List "aliases" specifies which registers are aliased to this one. This -// allows the code generator to be careful not to put two values with -// overlapping live ranges into registers which alias. -class RegisterGroup aliases> : Register { - let Aliases = aliases; +// SubRegSet - This can be used to define a specific mapping of registers to +// indices, for use as named subregs of a particular physical register. Each +// register in 'subregs' becomes an addressable subregister at index 'n' of the +// corresponding register in 'regs'. +class SubRegSet regs, list subregs> { + int index = n; + + list From = regs; + list To = subregs; } // RegisterClass - Now that all of the registers are defined, and aliases From natebegeman at mac.com Tue May 1 00:57:37 2007 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 1 May 2007 00:57:37 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h Message-ID: <200705010557.l415vbgt005230@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineInstr.h updated: 1.217 -> 1.218 --- Log message: llvm bug #1350, parts 1, 2, and 3. --- Diffs of the changes: (+31 -16) MachineInstr.h | 47 +++++++++++++++++++++++++++++++---------------- 1 files changed, 31 insertions(+), 16 deletions(-) Index: llvm/include/llvm/CodeGen/MachineInstr.h diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.217 llvm/include/llvm/CodeGen/MachineInstr.h:1.218 --- llvm/include/llvm/CodeGen/MachineInstr.h:1.217 Thu Apr 26 13:59:33 2007 +++ llvm/include/llvm/CodeGen/MachineInstr.h Tue May 1 00:57:01 2007 @@ -71,10 +71,17 @@ // immediately after the write. i.e. A register // that is defined but never used. - /// offset - Offset to address of global or external, only valid for - /// MO_GlobalAddress, MO_ExternalSym and MO_ConstantPoolIndex - int offset; - + /// auxInfo - auxiliary information used by the MachineOperand + union { + /// offset - Offset to address of global or external, only valid for + /// MO_GlobalAddress, MO_ExternalSym and MO_ConstantPoolIndex + int offset; + + /// subReg - SubRegister number, only valid for MO_Register. A value of 0 + /// indicates the MO_Register has no subReg. + unsigned subReg; + } auxInfo; + MachineOperand() {} void print(std::ostream &os) const; @@ -95,7 +102,7 @@ Op.IsImp = false; Op.IsKill = false; Op.IsDead = false; - Op.offset = 0; + Op.auxInfo.offset = 0; return Op; } @@ -106,7 +113,7 @@ IsKill = MO.IsKill; IsDead = MO.IsDead; opType = MO.opType; - offset = MO.offset; + auxInfo = MO.auxInfo; return *this; } @@ -169,7 +176,11 @@ int getOffset() const { assert((isGlobalAddress() || isExternalSymbol() || isConstantPoolIndex()) && "Wrong MachineOperand accessor"); - return offset; + return auxInfo.offset; + } + unsigned getSubReg() const { + assert(isRegister() && "Wrong MachineOperand accessor"); + return auxInfo.subReg; } const char *getSymbolName() const { assert(isExternalSymbol() && "Wrong MachineOperand accessor"); @@ -254,7 +265,11 @@ assert((isGlobalAddress() || isExternalSymbol() || isConstantPoolIndex() || isJumpTableIndex()) && "Wrong MachineOperand accessor"); - offset = Offset; + auxInfo.offset = Offset; + } + void setSubReg(unsigned subReg) { + assert(isRegister() && "Wrong MachineOperand accessor"); + auxInfo.subReg = subReg; } void setConstantPoolIndex(unsigned Idx) { assert(isConstantPoolIndex() && "Wrong MachineOperand accessor"); @@ -433,7 +448,7 @@ Op.IsKill = IsKill; Op.IsDead = IsDead; Op.contents.RegNo = Reg; - Op.offset = 0; + Op.auxInfo.subReg = 0; } /// addImmOperand - Add a zero extended constant argument to the @@ -443,14 +458,14 @@ MachineOperand &Op = AddNewOperand(); Op.opType = MachineOperand::MO_Immediate; Op.contents.immedVal = Val; - Op.offset = 0; + Op.auxInfo.offset = 0; } void addMachineBasicBlockOperand(MachineBasicBlock *MBB) { MachineOperand &Op = AddNewOperand(); Op.opType = MachineOperand::MO_MachineBasicBlock; Op.contents.MBB = MBB; - Op.offset = 0; + Op.auxInfo.offset = 0; } /// addFrameIndexOperand - Add an abstract frame index to the instruction @@ -459,7 +474,7 @@ MachineOperand &Op = AddNewOperand(); Op.opType = MachineOperand::MO_FrameIndex; Op.contents.immedVal = Idx; - Op.offset = 0; + Op.auxInfo.offset = 0; } /// addConstantPoolndexOperand - Add a constant pool object index to the @@ -469,7 +484,7 @@ MachineOperand &Op = AddNewOperand(); Op.opType = MachineOperand::MO_ConstantPoolIndex; Op.contents.immedVal = Idx; - Op.offset = Offset; + Op.auxInfo.offset = Offset; } /// addJumpTableIndexOperand - Add a jump table object index to the @@ -479,14 +494,14 @@ MachineOperand &Op = AddNewOperand(); Op.opType = MachineOperand::MO_JumpTableIndex; Op.contents.immedVal = Idx; - Op.offset = 0; + Op.auxInfo.offset = 0; } void addGlobalAddressOperand(GlobalValue *GV, int Offset) { MachineOperand &Op = AddNewOperand(); Op.opType = MachineOperand::MO_GlobalAddress; Op.contents.GV = GV; - Op.offset = Offset; + Op.auxInfo.offset = Offset; } /// addExternalSymbolOperand - Add an external symbol operand to this instr @@ -495,7 +510,7 @@ MachineOperand &Op = AddNewOperand(); Op.opType = MachineOperand::MO_ExternalSymbol; Op.contents.SymbolName = SymName; - Op.offset = 0; + Op.auxInfo.offset = 0; } //===--------------------------------------------------------------------===// From natebegeman at mac.com Tue May 1 00:57:37 2007 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 1 May 2007 00:57:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.td Message-ID: <200705010557.l415vbBF005233@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.td updated: 1.44 -> 1.45 --- Log message: llvm bug #1350, parts 1, 2, and 3. --- Diffs of the changes: (+50 -1) PPCRegisterInfo.td | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 50 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.td diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.44 llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.45 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.44 Mon Jan 29 16:57:48 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.td Tue May 1 00:57:02 2007 @@ -43,10 +43,16 @@ } // CR - One of the 8 4-bit condition registers -class CR num, string n> : PPCReg { +class CR num, string n> : PPCReg { + field bits<3> Num = num; +} + +// CRBIT - One of the 32 1-bit condition register fields +class CRBIT num, string n> : PPCReg { field bits<5> Num = num; } + // General-purpose registers def R0 : GPR< 0, "r0">, DwarfRegNum<0>; def R1 : GPR< 1, "r1">, DwarfRegNum<1>; @@ -193,6 +199,49 @@ def CR6 : CR<6, "cr6">, DwarfRegNum<74>; def CR7 : CR<7, "cr7">, DwarfRegNum<75>; +// Condition register bits +def CR0LT : CRBIT< 0, "0">, DwarfRegNum<0>; +def CR0GT : CRBIT< 1, "1">, DwarfRegNum<0>; +def CR0EQ : CRBIT< 2, "2">, DwarfRegNum<0>; +def CR0UN : CRBIT< 3, "3">, DwarfRegNum<0>; +def CR1LT : CRBIT< 4, "4">, DwarfRegNum<0>; +def CR1GT : CRBIT< 5, "5">, DwarfRegNum<0>; +def CR1EQ : CRBIT< 6, "6">, DwarfRegNum<0>; +def CR1UN : CRBIT< 7, "7">, DwarfRegNum<0>; +def CR2LT : CRBIT< 8, "8">, DwarfRegNum<0>; +def CR2GT : CRBIT< 9, "9">, DwarfRegNum<0>; +def CR2EQ : CRBIT<10, "10">, DwarfRegNum<0>; +def CR2UN : CRBIT<11, "11">, DwarfRegNum<0>; +def CR3LT : CRBIT<12, "12">, DwarfRegNum<0>; +def CR3GT : CRBIT<13, "13">, DwarfRegNum<0>; +def CR3EQ : CRBIT<14, "14">, DwarfRegNum<0>; +def CR3UN : CRBIT<15, "15">, DwarfRegNum<0>; +def CR4LT : CRBIT<16, "16">, DwarfRegNum<0>; +def CR4GT : CRBIT<17, "17">, DwarfRegNum<0>; +def CR4EQ : CRBIT<18, "18">, DwarfRegNum<0>; +def CR4UN : CRBIT<19, "19">, DwarfRegNum<0>; +def CR5LT : CRBIT<20, "20">, DwarfRegNum<0>; +def CR5GT : CRBIT<21, "21">, DwarfRegNum<0>; +def CR5EQ : CRBIT<22, "22">, DwarfRegNum<0>; +def CR5UN : CRBIT<23, "23">, DwarfRegNum<0>; +def CR6LT : CRBIT<24, "24">, DwarfRegNum<0>; +def CR6GT : CRBIT<25, "25">, DwarfRegNum<0>; +def CR6EQ : CRBIT<26, "26">, DwarfRegNum<0>; +def CR6UN : CRBIT<27, "27">, DwarfRegNum<0>; +def CR7LT : CRBIT<28, "28">, DwarfRegNum<0>; +def CR7GT : CRBIT<29, "29">, DwarfRegNum<0>; +def CR7EQ : CRBIT<30, "30">, DwarfRegNum<0>; +def CR7UN : CRBIT<31, "31">, DwarfRegNum<0>; + +def : SubRegSet<1, [CR0, CR1, CR2, CR3, CR4, CR5, CR6, CR7], + [CR0LT, CR1LT, CR2LT, CR3LT, CR4LT, CR5LT, CR6LT, CR7LT]>; +def : SubRegSet<2, [CR0, CR1, CR2, CR3, CR4, CR5, CR6, CR7], + [CR0GT, CR1GT, CR2GT, CR3GT, CR4GT, CR5GT, CR6GT, CR7GT]>; +def : SubRegSet<3, [CR0, CR1, CR2, CR3, CR4, CR5, CR6, CR7], + [CR0EQ, CR1EQ, CR2EQ, CR3EQ, CR4EQ, CR5EQ, CR6EQ, CR7EQ]>; +def : SubRegSet<4, [CR0, CR1, CR2, CR3, CR4, CR5, CR6, CR7], + [CR0UN, CR1UN, CR2UN, CR3UN, CR4UN, CR5UN, CR6UN, CR7UN]>; + // Link register def LR : SPR<8, "lr">, DwarfRegNum<65>; //let Aliases = [LR] in From natebegeman at mac.com Tue May 1 00:57:37 2007 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 1 May 2007 00:57:37 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/RegisterInfoEmitter.cpp Message-ID: <200705010557.l415vb52005240@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: RegisterInfoEmitter.cpp updated: 1.52 -> 1.53 --- Log message: llvm bug #1350, parts 1, 2, and 3. --- Diffs of the changes: (+36 -0) RegisterInfoEmitter.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+) Index: llvm/utils/TableGen/RegisterInfoEmitter.cpp diff -u llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.52 llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.53 --- llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.52 Fri Apr 20 19:55:29 2007 +++ llvm/utils/TableGen/RegisterInfoEmitter.cpp Tue May 1 00:57:02 2007 @@ -61,6 +61,7 @@ << " " << ClassName << "(int CallFrameSetupOpcode = -1, int CallFrameDestroyOpcode = -1);\n" << " int getDwarfRegNum(unsigned RegNum) const;\n" + << " unsigned getSubReg(unsigned RegNo, unsigned Index) const;\n" << "};\n\n"; const std::vector &RegisterClasses = @@ -322,6 +323,7 @@ std::map > RegisterSubRegs; std::map > RegisterSuperRegs; std::map > RegisterAliases; + std::map > > SubRegVectors; const std::vector &Regs = Target.getRegisters(); for (unsigned i = 0, e = Regs.size(); i != e; ++i) { @@ -441,6 +443,40 @@ std::string ClassName = Target.getName() + "GenRegisterInfo"; + // Calculate the mapping of subregister+index pairs to physical registers. + std::vector SubRegs = Records.getAllDerivedDefinitions("SubRegSet"); + for (unsigned i = 0, e = SubRegs.size(); i != e; ++i) { + int subRegIndex = SubRegs[i]->getValueAsInt("index"); + std::vector From = SubRegs[i]->getValueAsListOfDefs("From"); + std::vector To = SubRegs[i]->getValueAsListOfDefs("To"); + + assert((From.size() == To.size()) && + "SubRegSet has mismatched from/to size"); + + // For each entry in from/to vectors, insert the to register at index + for (unsigned ii = 0, ee = From.size(); ii != ee; ++ii) + SubRegVectors[From[ii]].push_back(std::make_pair(subRegIndex, To[ii])); + } + + // Emit the subregister + index mapping function based on the information + // calculated above. + OS << "unsigned " << ClassName + << "::getSubReg(unsigned RegNo, unsigned Index) const {\n" + << " switch (RegNo) {\n" + << " default: abort(); break;\n"; + for (std::map > >::iterator + I = SubRegVectors.begin(), E = SubRegVectors.end(); I != E; ++I) { + OS << " case " << getQualifiedName(I->first) << ":\n"; + OS << " switch (Index) {\n"; + OS << " default: abort(); break;\n"; + for (unsigned i = 0, e = I->second.size(); i != e; ++i) + OS << " case " << (I->second)[i].first << ": return " + << getQualifiedName((I->second)[i].second) << ";\n"; + OS << " }; break;\n"; + } + OS << " };\n"; + OS << "}\n\n"; + // Emit the constructor of the class... OS << ClassName << "::" << ClassName << "(int CallFrameSetupOpcode, int CallFrameDestroyOpcode)\n" From natebegeman at mac.com Tue May 1 00:57:37 2007 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 1 May 2007 00:57:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineInstr.cpp Message-ID: <200705010557.l415vbKe005242@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachineInstr.cpp updated: 1.147 -> 1.148 --- Log message: llvm bug #1350, parts 1, 2, and 3. --- Diffs of the changes: (+2 -2) MachineInstr.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/MachineInstr.cpp diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.147 llvm/lib/CodeGen/MachineInstr.cpp:1.148 --- llvm/lib/CodeGen/MachineInstr.cpp:1.147 Thu Apr 26 13:59:33 2007 +++ llvm/lib/CodeGen/MachineInstr.cpp Tue May 1 00:57:02 2007 @@ -39,7 +39,7 @@ Op.IsKill = false; Op.IsDead = false; Op.contents.RegNo = *ImpDefs; - Op.offset = 0; + Op.auxInfo.subReg = 0; Operands.push_back(Op); } if (TID->ImplicitUses) @@ -51,7 +51,7 @@ Op.IsKill = false; Op.IsDead = false; Op.contents.RegNo = *ImpUses; - Op.offset = 0; + Op.auxInfo.subReg = 0; Operands.push_back(Op); } } From natebegeman at mac.com Tue May 1 00:57:38 2007 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 1 May 2007 00:57:38 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h Message-ID: <200705010557.l415vcbp005251@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.108 -> 1.109 --- Log message: llvm bug #1350, parts 1, 2, and 3. --- Diffs of the changes: (+5 -1) MRegisterInfo.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.108 llvm/include/llvm/Target/MRegisterInfo.h:1.109 --- llvm/include/llvm/Target/MRegisterInfo.h:1.108 Mon Apr 30 19:47:46 2007 +++ llvm/include/llvm/Target/MRegisterInfo.h Tue May 1 00:57:02 2007 @@ -41,7 +41,7 @@ /// The SubRegs field is a zero terminated array of registers that are /// sub-registers of the specific register, e.g. AL, AH are sub-registers of AX. /// The SuperRegs field is a zero terminated array of registers that are -/// super-registers of the specific register, e.g. RAX, EAX, are sub-registers +/// super-registers of the specific register, e.g. RAX, EAX, are super-registers /// of AX. /// struct TargetRegisterDesc { @@ -354,6 +354,10 @@ /// register scavenger to determine what registers are free. virtual BitVector getReservedRegs(const MachineFunction &MF) const = 0; + /// getSubReg - Returns the physical register number of sub-register "Index" + /// for physical register RegNo. + virtual unsigned getSubReg(unsigned RegNo, unsigned Index) const = 0; + //===--------------------------------------------------------------------===// // Register Class Information // From natebegeman at mac.com Tue May 1 01:08:55 2007 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 1 May 2007 01:08:55 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/RegisterInfoEmitter.cpp Message-ID: <200705010608.l4168tAn005539@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: RegisterInfoEmitter.cpp updated: 1.53 -> 1.54 --- Log message: A bit of feedback from Chris that I missed; error rather than asserting. --- Diffs of the changes: (+5 -2) RegisterInfoEmitter.cpp | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) Index: llvm/utils/TableGen/RegisterInfoEmitter.cpp diff -u llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.53 llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.54 --- llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.53 Tue May 1 00:57:02 2007 +++ llvm/utils/TableGen/RegisterInfoEmitter.cpp Tue May 1 01:08:36 2007 @@ -450,8 +450,11 @@ std::vector From = SubRegs[i]->getValueAsListOfDefs("From"); std::vector To = SubRegs[i]->getValueAsListOfDefs("To"); - assert((From.size() == To.size()) && - "SubRegSet has mismatched from/to size"); + if (From.size() != To.size()) { + cerr << "Error: register list and sub-register list not of equal length" + << " in SubRegSet\n"; + exit(1); + } // For each entry in from/to vectors, insert the to register at index for (unsigned ii = 0, ee = From.size(); ii != ee; ++ii) From sabre at nondot.org Tue May 1 02:02:15 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 1 May 2007 02:02:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp BitcodeReader.h Message-ID: <200705010702.l4172Fup006430@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.20 -> 1.21 BitcodeReader.h updated: 1.14 -> 1.15 --- Log message: handle function-level forward references, read binops. --- Diffs of the changes: (+147 -22) BitcodeReader.cpp | 150 ++++++++++++++++++++++++++++++++++++++++++++++-------- BitcodeReader.h | 19 ++++++ 2 files changed, 147 insertions(+), 22 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.20 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.21 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.20 Tue May 1 00:52:21 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Tue May 1 02:01:57 2007 @@ -15,6 +15,7 @@ #include "BitcodeReader.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" +#include "llvm/Instructions.h" #include "llvm/Module.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/MathExtras.h" @@ -125,10 +126,9 @@ NumOperands = Idx+1; } - if (Uses[Idx]) { - assert(Ty == getOperand(Idx)->getType() && - "Type mismatch in constant table!"); - return cast(getOperand(Idx)); + if (Value *V = Uses[Idx]) { + assert(Ty == V->getType() && "Type mismatch in constant table!"); + return cast(V); } // Create and return a placeholder, which will later be RAUW'd. @@ -137,6 +137,25 @@ return C; } +Value *BitcodeReaderValueList::getValueFwdRef(unsigned Idx, const Type *Ty) { + if (Idx >= size()) { + // Insert a bunch of null values. + Uses.resize(Idx+1); + OperandList = &Uses[0]; + NumOperands = Idx+1; + } + + if (Value *V = Uses[Idx]) { + assert((Ty == 0 || Ty == V->getType()) && "Type mismatch in value table!"); + return V; + } + + // Create and return a placeholder, which will later be RAUW'd. + Value *V = new Argument(Ty); + Uses[Idx].init(V, this); + return V; +} + const Type *BitcodeReader::getTypeByID(unsigned ID, bool isTypeTable) { // If the TypeID is in range, return it. @@ -151,7 +170,6 @@ return TypeList.back().get(); } - bool BitcodeReader::ParseTypeTable() { if (Stream.EnterSubBlock()) return Error("Malformed block record"); @@ -643,18 +661,7 @@ } } - if (NextCstNo == ValueList.size()) - ValueList.push_back(V); - else if (ValueList[NextCstNo] == 0) - ValueList.initVal(NextCstNo, V); - else { - // If there was a forward reference to this constant, - Value *OldV = ValueList[NextCstNo]; - ValueList.setOperand(NextCstNo, V); - OldV->replaceAllUsesWith(V); - delete OldV; - } - + ValueList.AssignValue(V, NextCstNo); ++NextCstNo; } } @@ -998,6 +1005,8 @@ for(Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I) ValueList.push_back(I); + unsigned NextValueNo = ValueList.size(); + // Read all the records. SmallVector Record; while (1) { @@ -1016,6 +1025,7 @@ break; case bitc::CONSTANTS_BLOCK_ID: if (ParseConstants()) return true; + NextValueNo = ValueList.size(); break; case bitc::VALUE_SYMTAB_BLOCK_ID: if (ParseValueSymbolTable()) return true; @@ -1031,19 +1041,115 @@ // Read a record. Record.clear(); + Instruction *I = 0; + BasicBlock *CurBB = 0; + unsigned CurBBNo = 0; switch (Stream.ReadRecord(Code, Record)) { - default: // Default behavior: unknown constant + default: // Default behavior: reject + return Error("Unknown instruction"); case bitc::FUNC_CODE_DECLAREBLOCKS: // DECLAREBLOCKS: [nblocks] - if (Record.size() < 1) - return Error("Invalid FUNC_CODE_DECLAREBLOCKS record"); + if (Record.size() < 1 || Record[0] == 0) + return Error("Invalid DECLAREBLOCKS record"); // Create all the basic blocks for the function. FunctionBBs.resize(Record.size()); for (unsigned i = 0, e = FunctionBBs.size(); i != e; ++i) FunctionBBs[i] = new BasicBlock("", F); - break; - } + CurBB = FunctionBBs[0]; + continue; + + case bitc::FUNC_CODE_INST_BINOP: { + // BINOP: [opcode, ty, opval, opval] + if (Record.size() < 4) return Error("Invalid BINOP record"); + const Type *Ty = getTypeByID(Record[1]); + int Opc = GetDecodedBinaryOpcode(Record[0], Ty); + Value *LHS = getFnValueByID(Record[2], Ty); + Value *RHS = getFnValueByID(Record[3], Ty); + if (Opc == -1 || Ty == 0 || LHS == 0 || RHS == 0) + return Error("Invalid BINOP record"); + I = BinaryOperator::create((Instruction::BinaryOps)Opc, LHS, RHS); + break; + } +#if 0 + case bitc::FUNC_CODE_INST_CAST: + // CAST: [opcode, ty, opty, opval] + case bitc::FUNC_CODE_INST_GEP: + // GEP: [n, n x operands] + case bitc::FUNC_CODE_INST_SELECT: + // SELECT: [ty, opval, opval, opval] + case bitc::FUNC_CODE_INST_EXTRACTELT: + // EXTRACTELT: [opty, opval, opval] + case bitc::FUNC_CODE_INST_INSERTELT: + // INSERTELT: [ty, opval, opval, opval] + case bitc::FUNC_CODE_INST_SHUFFLEVEC: + // SHUFFLEVEC: [ty, opval, opval, opval] + case bitc::FUNC_CODE_INST_CMP: + // CMP: [opty, opval, opval, pred] + + case bitc::FUNC_CODE_INST_RET: + // RET: [opty,opval] + case bitc::FUNC_CODE_INST_BR: + // BR: [opval, bb#, bb#] or [bb#] + case bitc::FUNC_CODE_INST_SWITCH: + // SWITCH: [opty, opval, n, n x ops] + case bitc::FUNC_CODE_INST_INVOKE: + // INVOKE: [fnty, op0,op1,op2, ...] + case bitc::FUNC_CODE_INST_UNWIND: + // UNWIND + case bitc::FUNC_CODE_INST_UNREACHABLE: + // UNREACHABLE + + case bitc::FUNC_CODE_INST_PHI: + // PHI: [ty, #ops, val0,bb0, ...] + case bitc::FUNC_CODE_INST_MALLOC: + // MALLOC: [instty, op, align] + case bitc::FUNC_CODE_INST_FREE: + // FREE: [opty, op] + case bitc::FUNC_CODE_INST_ALLOCA: + // ALLOCA: [instty, op, align] + case bitc::FUNC_CODE_INST_LOAD: + // LOAD: [opty, op, align, vol] + case bitc::FUNC_CODE_INST_STORE: + // STORE: [ptrty,val,ptr, align, vol] + case bitc::FUNC_CODE_INST_CALL: + // CALL: [fnty, fnid, arg0, arg1...] + case bitc::FUNC_CODE_INST_VAARG: + // VAARG: [valistty, valist, instty] + break; +#endif + } + + // Add instruction to end of current BB. If there is no current BB, reject + // this file. + if (CurBB == 0) { + delete I; + return Error("Invalid instruction with no BB"); + } + CurBB->getInstList().push_back(I); + + // If this was a terminator instruction, move to the next block. + if (isa(I)) { + ++CurBBNo; + CurBB = CurBBNo < FunctionBBs.size() ? FunctionBBs[CurBBNo] : 0; + } + + // Non-void values get registered in the value table for future use. + if (I && I->getType() != Type::VoidTy) + ValueList.AssignValue(I, NextValueNo++); } + // Check the function list for unresolved values. + if (Argument *A = dyn_cast(ValueList.back())) { + if (A->getParent() == 0) { + // We found at least one unresolved value. Nuke them all to avoid leaks. + for (unsigned i = ModuleValueListSize, e = ValueList.size(); i != e; ++i){ + if ((A = dyn_cast(ValueList.back())) && A->getParent() == 0) { + A->replaceAllUsesWith(UndefValue::get(A->getType())); + delete A; + } + } + } + return Error("Never resolved value found in function!"); + } // Trim the value list down to the size it was before we parsed this function. ValueList.shrinkTo(ModuleValueListSize); Index: llvm/lib/Bitcode/Reader/BitcodeReader.h diff -u llvm/lib/Bitcode/Reader/BitcodeReader.h:1.14 llvm/lib/Bitcode/Reader/BitcodeReader.h:1.15 --- llvm/lib/Bitcode/Reader/BitcodeReader.h:1.14 Tue May 1 00:52:21 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.h Tue May 1 02:01:57 2007 @@ -51,6 +51,22 @@ virtual void print(std::ostream&) const {} Constant *getConstantFwdRef(unsigned Idx, const Type *Ty); + Value *getValueFwdRef(unsigned Idx, const Type *Ty); + + void AssignValue(Value *V, unsigned Idx) { + if (Idx == size()) { + push_back(V); + } else if (Value *OldV = getOperand(Idx)) { + // If there was a forward reference to this value, replace it. + setOperand(Idx, V); + OldV->replaceAllUsesWith(V); + delete OldV; + } else { + initVal(Idx, V); + } + } + +private: void initVal(unsigned Idx, Value *V) { assert(Uses[Idx] == 0 && "Cannot init an already init'd Use!"); Uses[Idx].init(V, this); @@ -113,6 +129,9 @@ bool ParseBitcode(); private: const Type *getTypeByID(unsigned ID, bool isTypeTable = false); + Value *getFnValueByID(unsigned ID, const Type *Ty) { + return ValueList.getValueFwdRef(ID, Ty); + } bool ParseModule(const std::string &ModuleID); bool ParseTypeTable(); From sabre at nondot.org Tue May 1 02:03:55 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 1 May 2007 02:03:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705010703.l4173tJ2006498@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.18 -> 1.19 --- Log message: fix build with non-buggy compilers --- Diffs of the changes: (+11 -10) BitcodeWriter.cpp | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.18 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.19 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.18 Mon Apr 30 21:14:57 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Tue May 1 02:03:37 2007 @@ -571,7 +571,7 @@ for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) Vals.push_back(VE.getValueID(I.getOperand(i))); break; - case Instruction::Invoke: + case Instruction::Invoke: { Code = bitc::FUNC_CODE_INST_INVOKE; // FIXME: param attrs Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); @@ -596,6 +596,7 @@ } } break; + } case Instruction::Unwind: Code = bitc::FUNC_CODE_INST_UNWIND; break; @@ -658,18 +659,18 @@ for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) Vals.push_back(VE.getValueID(I.getOperand(i+1))); // fixed param. - // Emit type/value pairs for varargs params. - if (FTy->isVarArg()) { - unsigned NumVarargs = I.getNumOperands()-1-FTy->getNumParams(); - Vals.push_back(NumVarargs); - for (unsigned i = I.getNumOperands()-NumVarargs, e = I.getNumOperands(); - i != e; ++i) { - Vals.push_back(VE.getTypeID(I.getOperand(i)->getType())); - Vals.push_back(VE.getValueID(I.getOperand(i))); - } + // Emit type/value pairs for varargs params. + if (FTy->isVarArg()) { + unsigned NumVarargs = I.getNumOperands()-1-FTy->getNumParams(); + Vals.push_back(NumVarargs); + for (unsigned i = I.getNumOperands()-NumVarargs, e = I.getNumOperands(); + i != e; ++i) { + Vals.push_back(VE.getTypeID(I.getOperand(i)->getType())); + Vals.push_back(VE.getValueID(I.getOperand(i))); } } break; + } case Instruction::VAArg: Code = bitc::FUNC_CODE_INST_VAARG; From evan.cheng at apple.com Tue May 1 03:53:58 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 1 May 2007 03:53:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200705010853.l418rw6E017457@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.297 -> 1.298 --- Log message: Forgot about chain result; also UNDEF cannot have multiple values. --- Diffs of the changes: (+12 -12) DAGCombiner.cpp | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.297 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.298 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.297 Mon Apr 30 19:38:21 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue May 1 03:53:39 2007 @@ -3331,19 +3331,19 @@ // the updated indexed value in case of indexed loads), change uses of the // chain value into uses of the chain input (i.e. delete the dead load). if (!LD->isVolatile()) { - bool HasUses = false; - SmallVector VTs; - for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) { - if (!N->hasNUsesOfValue(0, i)) { - HasUses = true; - break; + if (N->getValueType(1) == MVT::Other) { + // Unindexed loads. + if (N->hasNUsesOfValue(0, 0)) + return CombineTo(N, DAG.getNode(ISD::UNDEF, N->getValueType(0)), Chain); + } else { + // Indexed loads. + assert(N->getValueType(2) == MVT::Other && "Malformed indexed loads?"); + if (N->hasNUsesOfValue(0, 0) && N->hasNUsesOfValue(0, 1)) { + SDOperand Undef0 = DAG.getNode(ISD::UNDEF, N->getValueType(0)); + SDOperand Undef1 = DAG.getNode(ISD::UNDEF, N->getValueType(1)); + SDOperand To[] = { Undef0, Undef1, Chain }; + return CombineTo(N, To, 3); } - VTs.push_back(N->getValueType(i)); - } - if (!HasUses) { - SmallVector Ops; - return CombineTo(N, DAG.getNode(ISD::UNDEF, &VTs[0], VTs.size(), 0, 0), - Chain); } } From evan.cheng at apple.com Tue May 1 03:53:58 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 1 May 2007 01:53:58 -0700 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp In-Reply-To: <1E6DD6BA-308B-406A-AA3F-CD634D9A3412@apple.com> References: <200705010038.l410ccOi031037@zion.cs.uiuc.edu> <1E6DD6BA-308B-406A-AA3F-CD634D9A3412@apple.com> Message-ID: Doh. Brain cramp. Evan On Apr 30, 2007, at 9:39 PM, Chris Lattner wrote: >> + bool HasUses = false; >> + SmallVector VTs; >> + for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) { >> + if (!N->hasNUsesOfValue(0, i)) { >> + HasUses = true; >> + break; >> + } >> + VTs.push_back(N->getValueType(i)); >> + } >> + if (!HasUses) { >> + SmallVector Ops; >> + return CombineTo(N, DAG.getNode(ISD::UNDEF, &VTs[0], VTs.size >> (), 0, 0), >> + Chain); > > This can never trigger and isn't right if it did. > > #1: This should trigger if the chain has uses but the other values do > not. If the entire node is dead, it will already have been removed. > > #2. you can't create an undef with multiple results, you have to > create multiple undefs :) > > I'd suggest just writing this as: > > if (N->getValueType(1) == MVT::Other) { > // single result case. > } else { > assert(N->getValueType(2) == MVT::Other); > // multi result case. > } > > This lets you drop the looping and smallvector. > > -Chris > > _______________________________________________ > 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 May 1 03:58:45 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 1 May 2007 03:58:45 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h Message-ID: <200705010858.l418wjA6017545@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.109 -> 1.110 --- Log message: Add SPAdj parameter to account for call frame setup SP adjustment. --- Diffs of the changes: (+4 -3) MRegisterInfo.h | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.109 llvm/include/llvm/Target/MRegisterInfo.h:1.110 --- llvm/include/llvm/Target/MRegisterInfo.h:1.109 Tue May 1 00:57:02 2007 +++ llvm/include/llvm/Target/MRegisterInfo.h Tue May 1 03:58:27 2007 @@ -512,11 +512,12 @@ /// referenced by the iterator contains an MO_FrameIndex operand which must be /// eliminated by this method. This method may modify or replace the /// specified instruction, as long as it keeps the iterator pointing the the - /// finished product. The return value is the number of instructions - /// added to (negative if removed from) the basic block. + /// finished product. SPAdj is the SP adjustment due to call frame setup + /// instruction. The return value is the number of instructions added to + /// (negative if removed from) the basic block. /// virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI, - RegScavenger *RS = NULL) const = 0; + int SPAdj, RegScavenger *RS=NULL) const = 0; /// emitProlog/emitEpilog - These methods insert prolog and epilog code into /// the function. The return value is the number of instructions From evan.cheng at apple.com Tue May 1 03:59:37 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 1 May 2007 03:59:37 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/RegisterScavenging.h Message-ID: <200705010859.l418xbmp017574@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: RegisterScavenging.h updated: 1.12 -> 1.13 --- Log message: Pass call frame setup SP adjustment along to eliminateFrameIndex(). --- Diffs of the changes: (+6 -5) RegisterScavenging.h | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) Index: llvm/include/llvm/CodeGen/RegisterScavenging.h diff -u llvm/include/llvm/CodeGen/RegisterScavenging.h:1.12 llvm/include/llvm/CodeGen/RegisterScavenging.h:1.13 --- llvm/include/llvm/CodeGen/RegisterScavenging.h:1.12 Mon Mar 26 17:23:54 2007 +++ llvm/include/llvm/CodeGen/RegisterScavenging.h Tue May 1 03:59:18 2007 @@ -117,12 +117,13 @@ int getScavengingFrameIndex() const { return ScavengingFrameIndex; } /// scavengeRegister - Make a register of the specific register class - /// available and do the appropriate bookkeeping. Returns the scavenged - /// register. + /// available and do the appropriate bookkeeping. SPAdj is the stack + /// adjustment due to call frame, it's passed along to eliminateFrameIndex(). + /// Returns the scavenged register. unsigned scavengeRegister(const TargetRegisterClass *RegClass, - MachineBasicBlock::iterator I); - unsigned scavengeRegister(const TargetRegisterClass *RegClass) { - return scavengeRegister(RegClass, MBBI); + MachineBasicBlock::iterator I, int SPAdj); + unsigned scavengeRegister(const TargetRegisterClass *RegClass, int SPAdj) { + return scavengeRegister(RegClass, MBBI, SPAdj); } private: From evan.cheng at apple.com Tue May 1 04:02:00 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 1 May 2007 04:02:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/PrologEpilogInserter.cpp RegisterScavenging.cpp Message-ID: <200705010902.l41920cI017643@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: PrologEpilogInserter.cpp updated: 1.83 -> 1.84 RegisterScavenging.cpp updated: 1.16 -> 1.17 --- Log message: If call frame is not part of stack frame and no dynamic alloc, eliminateFrameIndex() must adjust SP offset with size of call frames. --- Diffs of the changes: (+49 -18) PrologEpilogInserter.cpp | 58 +++++++++++++++++++++++++++++++++++------------ RegisterScavenging.cpp | 9 ++++--- 2 files changed, 49 insertions(+), 18 deletions(-) Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.83 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.84 --- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.83 Mon Apr 30 19:51:28 2007 +++ llvm/lib/CodeGen/PrologEpilogInserter.cpp Tue May 1 04:01:42 2007 @@ -26,6 +26,7 @@ #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/Compiler.h" +#include "llvm/ADT/STLExtras.h" #include using namespace llvm; @@ -151,9 +152,14 @@ MachineFrameInfo *FFI = Fn.getFrameInfo(); FFI->setHasCalls(HasCalls); FFI->setMaxCallFrameSize(MaxCallFrameSize); + for (unsigned i = 0, e = FrameSDOps.size(); i != e; ++i) { MachineBasicBlock::iterator I = FrameSDOps[i]; - RegInfo->eliminateCallFramePseudoInstr(Fn, *I->getParent(), I); + // If call frames are not being included as part of the stack frame, + // and there is no dynamic allocation (therefore referencing frame slots + // off sp), leave the pseudo ops alone. We'll eliminate them later. + if (RegInfo->hasReservedCallFrame(Fn) || RegInfo->hasFP(Fn)) + RegInfo->eliminateCallFramePseudoInstr(Fn, *I->getParent(), I); } // Now figure out which *callee saved* registers are modified by the current @@ -491,25 +497,49 @@ const TargetMachine &TM = Fn.getTarget(); assert(TM.getRegisterInfo() && "TM::getRegisterInfo() must be implemented!"); const MRegisterInfo &MRI = *TM.getRegisterInfo(); + const TargetFrameInfo *TFI = TM.getFrameInfo(); + bool StackGrowsDown = + TFI->getStackGrowthDirection() == TargetFrameInfo::StackGrowsDown; + int FrameSetupOpcode = MRI.getCallFrameSetupOpcode(); + int FrameDestroyOpcode = MRI.getCallFrameDestroyOpcode(); for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) { + int SPAdj = 0; // SP offset due to call frame setup / destroy. if (RS) RS->enterBasicBlock(BB); for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ) { - MachineInstr *MI = I++; - for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) - if (MI->getOperand(i).isFrameIndex()) { - // If this instruction has a FrameIndex operand, we need to use that - // target machine register info object to eliminate it. - MRI.eliminateFrameIndex(MI, RS); - - // Revisit the instruction in full. Some instructions (e.g. inline - // asm instructions) can have multiple frame indices. - --I; - MI = 0; - break; - } + MachineInstr *MI = I; + + // Remember how much SP has been adjustment to create the call frame. + if (I->getOpcode() == FrameSetupOpcode || + I->getOpcode() == FrameDestroyOpcode) { + int Size = I->getOperand(0).getImmedValue(); + if ((!StackGrowsDown && I->getOpcode() == FrameSetupOpcode) || + (StackGrowsDown && I->getOpcode() == FrameDestroyOpcode)) + Size = -Size; + SPAdj += Size; + MachineBasicBlock::iterator PrevI = prior(I); + MRI.eliminateCallFramePseudoInstr(Fn, *BB, I); + // Visit the instructions created by eliminateCallFramePseudoInstr(). + I = next(PrevI); + MI = NULL; + } else { + I++; + for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) + if (MI->getOperand(i).isFrameIndex()) { + // If this instruction has a FrameIndex operand, we need to use that + // target machine register info object to eliminate it. + MRI.eliminateFrameIndex(MI, SPAdj, RS); + + // Revisit the instruction in full. Some instructions (e.g. inline + // asm instructions) can have multiple frame indices. + --I; + MI = 0; + break; + } + } // Update register states. if (RS && MI) RS->forward(MI); } + assert(SPAdj == 0 && "Unbalanced call frame setup / destroy pairs?"); } } Index: llvm/lib/CodeGen/RegisterScavenging.cpp diff -u llvm/lib/CodeGen/RegisterScavenging.cpp:1.16 llvm/lib/CodeGen/RegisterScavenging.cpp:1.17 --- llvm/lib/CodeGen/RegisterScavenging.cpp:1.16 Thu Apr 26 13:59:33 2007 +++ llvm/lib/CodeGen/RegisterScavenging.cpp Tue May 1 04:01:42 2007 @@ -75,7 +75,7 @@ RegInfo->loadRegFromStackSlot(*MBB, MBBI, ScavengedReg, ScavengingFrameIndex, ScavengedRC); MachineBasicBlock::iterator II = prior(MBBI); - RegInfo->eliminateFrameIndex(II, this); + RegInfo->eliminateFrameIndex(II, 0, this); setUsed(ScavengedReg); ScavengedReg = 0; ScavengedRC = NULL; @@ -243,7 +243,8 @@ } unsigned RegScavenger::scavengeRegister(const TargetRegisterClass *RC, - MachineBasicBlock::iterator I) { + MachineBasicBlock::iterator I, + int SPAdj) { assert(ScavengingFrameIndex >= 0 && "Cannot scavenge a register without an emergency spill slot!"); @@ -277,12 +278,12 @@ RegInfo->loadRegFromStackSlot(*MBB, I, ScavengedReg, ScavengingFrameIndex, ScavengedRC); MachineBasicBlock::iterator II = prior(I); - RegInfo->eliminateFrameIndex(II, this); + RegInfo->eliminateFrameIndex(II, SPAdj, this); } RegInfo->storeRegToStackSlot(*MBB, I, SReg, ScavengingFrameIndex, RC); MachineBasicBlock::iterator II = prior(I); - RegInfo->eliminateFrameIndex(II, this); + RegInfo->eliminateFrameIndex(II, SPAdj, this); ScavengedReg = SReg; ScavengedRC = RC; From evan.cheng at apple.com Tue May 1 04:13:40 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 1 May 2007 04:13:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp ARMRegisterInfo.h Message-ID: <200705010913.l419DeHV018373@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.91 -> 1.92 ARMRegisterInfo.h updated: 1.18 -> 1.19 --- Log message: eliminateFrameIndex() change. --- Diffs of the changes: (+5 -4) ARMRegisterInfo.cpp | 7 ++++--- ARMRegisterInfo.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.91 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.92 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.91 Mon Apr 30 19:52:08 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Tue May 1 04:13:03 2007 @@ -689,7 +689,7 @@ } void ARMRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, - RegScavenger *RS) const{ + int SPAdj, RegScavenger *RS) const{ unsigned i = 0; MachineInstr &MI = *II; MachineBasicBlock &MBB = *MI.getParent(); @@ -705,7 +705,7 @@ unsigned FrameReg = ARM::SP; int FrameIndex = MI.getOperand(i).getFrameIndex(); int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex) + - MF.getFrameInfo()->getStackSize(); + MF.getFrameInfo()->getStackSize() + SPAdj; if (AFI->isGPRCalleeSavedArea1Frame(FrameIndex)) Offset -= AFI->getGPRCalleeSavedArea1Offset(); @@ -714,6 +714,7 @@ else if (AFI->isDPRCalleeSavedAreaFrame(FrameIndex)) Offset -= AFI->getDPRCalleeSavedAreaOffset(); else if (hasFP(MF)) { + assert(SPAdj == 0 && "Unexpected"); // There is alloca()'s in this function, must reference off the frame // pointer instead. FrameReg = getFrameRegister(MF); @@ -988,7 +989,7 @@ unsigned ScratchReg = findScratchRegister(RS, &ARM::GPRRegClass, AFI); if (ScratchReg == 0) // No register is "free". Scavenge a register. - ScratchReg = RS->scavengeRegister(&ARM::GPRRegClass, II); + ScratchReg = RS->scavengeRegister(&ARM::GPRRegClass, II, SPAdj); emitARMRegPlusImmediate(MBB, II, ScratchReg, FrameReg, isSub ? -Offset : Offset, TII); MI.getOperand(i).ChangeToRegister(ScratchReg, false, false, true); Index: llvm/lib/Target/ARM/ARMRegisterInfo.h diff -u llvm/lib/Target/ARM/ARMRegisterInfo.h:1.18 llvm/lib/Target/ARM/ARMRegisterInfo.h:1.19 --- llvm/lib/Target/ARM/ARMRegisterInfo.h:1.18 Mon Apr 30 19:52:08 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.h Tue May 1 04:13:03 2007 @@ -85,7 +85,7 @@ MachineBasicBlock::iterator I) const; void eliminateFrameIndex(MachineBasicBlock::iterator II, - RegScavenger *RS = NULL) const; + int SPAdj, RegScavenger *RS = NULL) const; void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, RegScavenger *RS = NULL) const; From evan.cheng at apple.com Tue May 1 04:13:40 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 1 May 2007 04:13:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcRegisterInfo.cpp SparcRegisterInfo.h Message-ID: <200705010913.l419DemK018378@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcRegisterInfo.cpp updated: 1.58 -> 1.59 SparcRegisterInfo.h updated: 1.23 -> 1.24 --- Log message: eliminateFrameIndex() change. --- Diffs of the changes: (+4 -2) SparcRegisterInfo.cpp | 4 +++- SparcRegisterInfo.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Target/Sparc/SparcRegisterInfo.cpp diff -u llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.58 llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.59 --- llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.58 Tue Mar 20 03:08:48 2007 +++ llvm/lib/Target/Sparc/SparcRegisterInfo.cpp Tue May 1 04:13:03 2007 @@ -165,7 +165,9 @@ } void SparcRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, - RegScavenger *RS) const { + int SPAdj, RegScavenger *RS) const { + assert(SPAdj == 0 && "Unexpected"); + unsigned i = 0; MachineInstr &MI = *II; while (!MI.getOperand(i).isFrameIndex()) { Index: llvm/lib/Target/Sparc/SparcRegisterInfo.h diff -u llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.23 llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.24 --- llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.23 Tue Mar 20 03:08:48 2007 +++ llvm/lib/Target/Sparc/SparcRegisterInfo.h Tue May 1 04:13:03 2007 @@ -64,7 +64,7 @@ MachineBasicBlock::iterator I) const; void eliminateFrameIndex(MachineBasicBlock::iterator II, - RegScavenger *RS = NULL) const; + int SPAdj, RegScavenger *RS = NULL) const; void processFunctionBeforeFrameFinalized(MachineFunction &MF) const; From evan.cheng at apple.com Tue May 1 04:13:41 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 1 May 2007 04:13:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp X86RegisterInfo.h Message-ID: <200705010913.l419DfjH018392@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86RegisterInfo.cpp updated: 1.216 -> 1.217 X86RegisterInfo.h updated: 1.51 -> 1.52 --- Log message: eliminateFrameIndex() change. --- Diffs of the changes: (+4 -2) X86RegisterInfo.cpp | 4 +++- X86RegisterInfo.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.216 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.217 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.216 Wed Apr 25 20:09:28 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Tue May 1 04:13:03 2007 @@ -986,7 +986,9 @@ } void X86RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, - RegScavenger *RS) const{ + int SPAdj, RegScavenger *RS) const{ + assert(SPAdj == 0 && "Unexpected"); + unsigned i = 0; MachineInstr &MI = *II; MachineFunction &MF = *MI.getParent()->getParent(); Index: llvm/lib/Target/X86/X86RegisterInfo.h diff -u llvm/lib/Target/X86/X86RegisterInfo.h:1.51 llvm/lib/Target/X86/X86RegisterInfo.h:1.52 --- llvm/lib/Target/X86/X86RegisterInfo.h:1.51 Tue Mar 20 03:09:38 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.h Tue May 1 04:13:03 2007 @@ -94,7 +94,7 @@ MachineBasicBlock::iterator MI) const; void eliminateFrameIndex(MachineBasicBlock::iterator MI, - RegScavenger *RS = NULL) const; + int SPAdj, RegScavenger *RS = NULL) const; void processFunctionBeforeFrameFinalized(MachineFunction &MF) const; From evan.cheng at apple.com Tue May 1 04:13:41 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 1 May 2007 04:13:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64RegisterInfo.cpp IA64RegisterInfo.h Message-ID: <200705010913.l419DfZb018403@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64RegisterInfo.cpp updated: 1.35 -> 1.36 IA64RegisterInfo.h updated: 1.17 -> 1.18 --- Log message: eliminateFrameIndex() change. --- Diffs of the changes: (+4 -2) IA64RegisterInfo.cpp | 4 +++- IA64RegisterInfo.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Target/IA64/IA64RegisterInfo.cpp diff -u llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.35 llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.36 --- llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.35 Tue Mar 20 03:08:04 2007 +++ llvm/lib/Target/IA64/IA64RegisterInfo.cpp Tue May 1 04:13:03 2007 @@ -177,7 +177,9 @@ } void IA64RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, - RegScavenger *RS)const{ + int SPAdj, RegScavenger *RS)const{ + assert(SPAdj == 0 && "Unexpected"); + unsigned i = 0; MachineInstr &MI = *II; MachineBasicBlock &MBB = *MI.getParent(); Index: llvm/lib/Target/IA64/IA64RegisterInfo.h diff -u llvm/lib/Target/IA64/IA64RegisterInfo.h:1.17 llvm/lib/Target/IA64/IA64RegisterInfo.h:1.18 --- llvm/lib/Target/IA64/IA64RegisterInfo.h:1.17 Tue Mar 20 03:08:04 2007 +++ llvm/lib/Target/IA64/IA64RegisterInfo.h Tue May 1 04:13:03 2007 @@ -60,7 +60,7 @@ MachineBasicBlock::iterator MI) const; void eliminateFrameIndex(MachineBasicBlock::iterator MI, - RegScavenger *RS = NULL) const; + int SPAdj, RegScavenger *RS = NULL) const; void emitPrologue(MachineFunction &MF) const; void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; From evan.cheng at apple.com Tue May 1 04:13:41 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 1 May 2007 04:13:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp AlphaRegisterInfo.h Message-ID: <200705010913.l419DfpV018387@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaRegisterInfo.cpp updated: 1.65 -> 1.66 AlphaRegisterInfo.h updated: 1.23 -> 1.24 --- Log message: eliminateFrameIndex() change. --- Diffs of the changes: (+4 -2) AlphaRegisterInfo.cpp | 4 +++- AlphaRegisterInfo.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.65 llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.66 --- llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.65 Mon Apr 16 13:10:22 2007 +++ llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp Tue May 1 04:13:03 2007 @@ -255,7 +255,9 @@ //<- SP void AlphaRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, - RegScavenger *RS) const { + int SPAdj, RegScavenger *RS) const { + assert(SPAdj == 0 && "Unexpected"); + unsigned i = 0; MachineInstr &MI = *II; MachineBasicBlock &MBB = *MI.getParent(); Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.h diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.h:1.23 llvm/lib/Target/Alpha/AlphaRegisterInfo.h:1.24 --- llvm/lib/Target/Alpha/AlphaRegisterInfo.h:1.23 Tue Mar 20 03:07:46 2007 +++ llvm/lib/Target/Alpha/AlphaRegisterInfo.h Tue May 1 04:13:03 2007 @@ -61,7 +61,7 @@ MachineBasicBlock::iterator I) const; void eliminateFrameIndex(MachineBasicBlock::iterator II, - RegScavenger *RS = NULL) const; + int SPAdj, RegScavenger *RS = NULL) const; //void processFunctionBeforeFrameFinalized(MachineFunction &MF) const; From evan.cheng at apple.com Tue May 1 04:13:41 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 1 May 2007 04:13:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp PPCRegisterInfo.h Message-ID: <200705010913.l419Df6G018405@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.cpp updated: 1.122 -> 1.123 PPCRegisterInfo.h updated: 1.34 -> 1.35 --- Log message: eliminateFrameIndex() change. --- Diffs of the changes: (+4 -2) PPCRegisterInfo.cpp | 4 +++- PPCRegisterInfo.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.122 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.123 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.122 Wed Apr 25 17:13:27 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Tue May 1 04:13:03 2007 @@ -589,7 +589,9 @@ } void PPCRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, - RegScavenger *RS) const { + int SPAdj, RegScavenger *RS) const { + assert(SPAdj == 0 && "Unexpected"); + // Get the instruction. MachineInstr &MI = *II; // Get the instruction's basic block. Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.h diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.34 llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.35 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.34 Tue Mar 20 03:08:30 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.h Tue May 1 04:13:03 2007 @@ -80,7 +80,7 @@ void lowerDynamicAlloc(MachineBasicBlock::iterator II) const; void eliminateFrameIndex(MachineBasicBlock::iterator II, - RegScavenger *RS = NULL) const; + int SPAdj, RegScavenger *RS = NULL) const; /// determineFrameLayout - Determine the size of the frame and maximum call /// frame size. From asl at math.spbu.ru Tue May 1 05:16:26 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 1 May 2007 05:16:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp Message-ID: <200705011016.l41AGQTf019332@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetAsmInfo.cpp updated: 1.36 -> 1.37 --- Log message: Adjust correct EH-related sections --- Diffs of the changes: (+4 -0) X86TargetAsmInfo.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.36 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.37 --- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.36 Wed Apr 25 09:27:10 2007 +++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp Tue May 1 05:16:06 2007 @@ -121,6 +121,10 @@ DwarfARangesSection = "\t.section\t.debug_aranges,\"\", at progbits"; DwarfRangesSection = "\t.section\t.debug_ranges,\"\", at progbits"; DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\", at progbits"; + + SupportsExceptionHandling = true; + DwarfEHFrameSection = "\t.section\t.eh_frame,\"aw\", at progbits"; + DwarfExceptionSection = "\t.section\t.gcc_except_table,\"a\", at progbits"; break; case X86Subtarget::isCygwin: From asl at math.spbu.ru Tue May 1 05:19:50 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 1 May 2007 05:19:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp Message-ID: <200705011019.l41AJocY019390@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetAsmInfo.cpp updated: 1.37 -> 1.38 --- Log message: Use correct PC symbol --- Diffs of the changes: (+2 -0) X86TargetAsmInfo.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.37 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.38 --- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.37 Tue May 1 05:16:06 2007 +++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp Tue May 1 05:19:31 2007 @@ -109,6 +109,8 @@ PrivateGlobalPrefix = ".L"; WeakRefDirective = "\t.weak\t"; SetDirective = "\t.set\t"; + PCSymbol = "."; + DwarfRequiresFrameSection = false; DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\", at progbits"; DwarfInfoSection = "\t.section\t.debug_info,\"\", at progbits"; From djg at cray.com Tue May 1 08:50:46 2007 From: djg at cray.com (Dan Gohman) Date: Tue, 1 May 2007 08:50:46 -0500 Subject: [llvm-commits] ELF sections in X86AsmTargetAsm.cpp Message-ID: <20070501135045.GS25688@village.us.cray.com> The attached patch sets the section names for fixed-size constants for ELF on x86 to match what GCC uses, and it uses the mergeable flag so that duplicate constants can be merged. This works for me with GAS; are there other assemblers (or linkers?) being used with LLVM on x86 ELF targets that don't support this? It looks like nasm/yasm wouldn't accept some of the other things that LLVM currently emits anyway.. Dan -- Dan Gohman, Cray Inc. -------------- next part -------------- Index: lib/Target/X86/X86TargetAsmInfo.cpp =================================================================== RCS file: /var/cvs/llvm/llvm/lib/Target/X86/X86TargetAsmInfo.cpp,v retrieving revision 1.38 diff -u -r1.38 X86TargetAsmInfo.cpp --- lib/Target/X86/X86TargetAsmInfo.cpp +++ lib/Target/X86/X86TargetAsmInfo.cpp @@ -106,6 +106,11 @@ // HasDotFile - True if target asm supports .file directives. // bool HasDotFile; // Defaults to false. ReadOnlySection = "\t.section\t.rodata\n"; + FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\", at progbits,4"; + EightByteConstantSection = "\t.section\t.rodata.cst8,\"aM\", at progbits,8"; + SixteenByteConstantSection = + "\t.section\t.rodata.cst16,\"aM\", at progbits,16"; + CStringSection = "\t.section\t.rodata.str1.1,\"aMS\", at progbits,1"; PrivateGlobalPrefix = ".L"; WeakRefDirective = "\t.weak\t"; SetDirective = "\t.set\t"; From clattner at apple.com Tue May 1 11:30:18 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 1 May 2007 09:30:18 -0700 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp In-Reply-To: <200705010853.l418rw6E017457@zion.cs.uiuc.edu> References: <200705010853.l418rw6E017457@zion.cs.uiuc.edu> Message-ID: <96216D8C-84AD-43CC-983F-17D477BD0ABC@apple.com> > Forgot about chain result; also UNDEF cannot have multiple values. Nice! Thanks Evan, -Chris > --- > Diffs of the changes: (+12 -12) > > DAGCombiner.cpp | 24 ++++++++++++------------ > 1 files changed, 12 insertions(+), 12 deletions(-) > > > Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp > diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.297 llvm/ > lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.298 > --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.297 Mon Apr 30 > 19:38:21 2007 > +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue May 1 > 03:53:39 2007 > @@ -3331,19 +3331,19 @@ > // the updated indexed value in case of indexed loads), change > uses of the > // chain value into uses of the chain input (i.e. delete the > dead load). > if (!LD->isVolatile()) { > - bool HasUses = false; > - SmallVector VTs; > - for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) { > - if (!N->hasNUsesOfValue(0, i)) { > - HasUses = true; > - break; > + if (N->getValueType(1) == MVT::Other) { > + // Unindexed loads. > + if (N->hasNUsesOfValue(0, 0)) > + return CombineTo(N, DAG.getNode(ISD::UNDEF, N->getValueType > (0)), Chain); > + } else { > + // Indexed loads. > + assert(N->getValueType(2) == MVT::Other && "Malformed > indexed loads?"); > + if (N->hasNUsesOfValue(0, 0) && N->hasNUsesOfValue(0, 1)) { > + SDOperand Undef0 = DAG.getNode(ISD::UNDEF, N->getValueType > (0)); > + SDOperand Undef1 = DAG.getNode(ISD::UNDEF, N->getValueType > (1)); > + SDOperand To[] = { Undef0, Undef1, Chain }; > + return CombineTo(N, To, 3); > } > - VTs.push_back(N->getValueType(i)); > - } > - if (!HasUses) { > - SmallVector Ops; > - return CombineTo(N, DAG.getNode(ISD::UNDEF, &VTs[0], VTs.size > (), 0, 0), > - Chain); > } > } > > > > > _______________________________________________ > 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 May 1 12:32:50 2007 From: baldrick at free.fr (Duncan Sands) Date: Tue, 1 May 2007 19:32:50 +0200 Subject: [llvm-commits] llvm-gcc: handle TRY_CATCH_EXPR with compound-stmt for handler Message-ID: <200705011932.53014.baldrick@free.fr> According to the documentation, the handler for a TRY_CATCH_EXPR can be: - A sequence of statements to execute. When an exception occurs, these statements are executed, and then the exception is rethrown. - A sequence of CATCH_EXPR expressions. Each CATCH_EXPR has a list of applicable exception types and handler code. If the thrown exception matches one of the caught types, the associated handler code is executed. If the handler code falls off the bottom, execution continues after the original TRY_CATCH_EXPR. - An EH_FILTER_EXPR expression. This has a list of permitted exception types, and code to handle a match failure. If the thrown exception does not match one of the allowed types, the associated match failure code is executed. If the thrown exception does match, it continues unwinding the stack looking for the next handler. However GatherTypeInfo wasn't expecting the first case, causing a crash when building the C++ runtime. Fix and testcase attached. Ciao, Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: no_catch.diff Type: text/x-diff Size: 818 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070501/b2ad714f/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 2007-04-31-TryCatch.cpp Type: text/x-c++src Size: 242 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070501/b2ad714f/attachment-0001.bin From clattner at apple.com Tue May 1 12:59:57 2007 From: clattner at apple.com (clattner at apple.com) Date: Tue, 1 May 2007 10:59:57 -0700 (PDT) Subject: [llvm-commits] [126768] improve support for __builtin_extract_return_address and Message-ID: <20070501175957.7CCFF6B40E4@src> Revision: 126768 Author: clattner Date: 2007-05-01 10:59:57 -0700 (Tue, 01 May 2007) Log Message: ----------- improve support for __builtin_extract_return_address and __builtin_frob_return_address (?) for most targets. This is one step towards solving PR1375, though it is not correct for ARM, SPARC, MIPS etc. Patch by Anton K! Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-convert.cpp apple-local/branches/llvm/gcc/llvm-internal.h Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-05-01 17:49:23 UTC (rev 126767) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-05-01 17:59:57 UTC (rev 126768) @@ -4071,6 +4071,10 @@ case BUILT_IN_RETURN_ADDRESS: return EmitBuiltinReturnAddr(exp, Result,false); case BUILT_IN_STACK_SAVE: return EmitBuiltinStackSave(exp, Result); case BUILT_IN_STACK_RESTORE: return EmitBuiltinStackRestore(exp); + case BUILT_IN_EXTRACT_RETURN_ADDR: + return EmitBuiltinExtractReturnAddr(exp, Result); + case BUILT_IN_FROB_RETURN_ADDR: + return EmitBuiltinFrobReturnAddr(exp, Result); #define HANDLE_UNARY_FP(F32, F64, V) \ Result = EmitBuiltinUnaryFPOp(V, Intrinsic::F32, Intrinsic::F64) @@ -4162,8 +4166,6 @@ case BUILT_IN_DWARF_SP_COLUMN: case BUILT_IN_INIT_DWARF_REG_SIZES: #endif - case BUILT_IN_FROB_RETURN_ADDR: - case BUILT_IN_EXTRACT_RETURN_ADDR: case BUILT_IN_EH_RETURN: #ifdef EH_RETURN_DATA_REGNO case BUILT_IN_EH_RETURN_DATA_REGNO: @@ -4404,6 +4406,39 @@ return true; } +bool TreeToLLVM::EmitBuiltinExtractReturnAddr(tree exp, Value *&Result) { + tree arglist = TREE_OPERAND(exp, 1); + + Value *Ptr = Emit(TREE_VALUE(arglist), 0); + + // FIXME: Actually we should do something like this: + // + // Result = (Ptr & MASK_RETURN_ADDR) + RETURN_ADDR_OFFSET, if mask and + // offset are defined. This seems to be needed for: ARM, MIPS, Sparc. + // Unfortunately, these constants are defined as RTL expressions and + // should be handled separately. + + Result = CastToType(Instruction::BitCast, Ptr, PointerType::get(Type::Int8Ty)); + + return true; +} + +bool TreeToLLVM::EmitBuiltinFrobReturnAddr(tree exp, Value *&Result) { + tree arglist = TREE_OPERAND(exp, 1); + + Value *Ptr = Emit(TREE_VALUE(arglist), 0); + + // FIXME: Actually we should do something like this: + // + // Result = Ptr - RETURN_ADDR_OFFSET, if offset is defined. This seems to be + // needed for: MIPS, Sparc. Unfortunately, these constants are defined + // as RTL expressions and should be handled separately. + + Result = CastToType(Instruction::BitCast, Ptr, PointerType::get(Type::Int8Ty)); + + return true; +} + bool TreeToLLVM::EmitBuiltinStackSave(tree exp, Value *&Result) { tree arglist = TREE_OPERAND(exp, 1); if (!validate_arglist(arglist, VOID_TYPE)) Modified: apple-local/branches/llvm/gcc/llvm-internal.h =================================================================== --- apple-local/branches/llvm/gcc/llvm-internal.h 2007-05-01 17:49:23 UTC (rev 126767) +++ apple-local/branches/llvm/gcc/llvm-internal.h 2007-05-01 17:59:57 UTC (rev 126768) @@ -524,6 +524,8 @@ bool EmitBuiltinBZero(tree_node *exp, Value *&Result); bool EmitBuiltinPrefetch(tree_node *exp); bool EmitBuiltinReturnAddr(tree_node *exp, Value *&Result, bool isFrame); + bool EmitBuiltinExtractReturnAddr(tree_node *exp, Value *&Result); + bool EmitBuiltinFrobReturnAddr(tree_node *exp, Value *&Result); bool EmitBuiltinStackSave(tree_node *exp, Value *&Result); bool EmitBuiltinStackRestore(tree_node *exp); From clattner at apple.com Tue May 1 13:46:42 2007 From: clattner at apple.com (clattner at apple.com) Date: Tue, 1 May 2007 11:46:42 -0700 (PDT) Subject: [llvm-commits] [126769] From Duncan Sands: Message-ID: <20070501184642.A9AF06EA192@src> Revision: 126769 Author: clattner Date: 2007-05-01 11:46:41 -0700 (Tue, 01 May 2007) Log Message: ----------- >From Duncan Sands: According to the documentation, the handler for a TRY_CATCH_EXPR can be: - A sequence of statements to execute. When an exception occurs, these statements are executed, and then the exception is rethrown. - A sequence of CATCH_EXPR expressions. Each CATCH_EXPR has a list of applicable exception types and handler code. If the thrown exception matches one of the caught types, the associated handler code is executed. If the handler code falls off the bottom, execution continues after the original TRY_CATCH_EXPR. - An EH_FILTER_EXPR expression. This has a list of permitted exception types, and code to handle a match failure. If the thrown exception does not match one of the allowed types, the associated match failure code is executed. If the thrown exception does match, it continues unwinding the stack looking for the next handler. However GatherTypeInfo wasn't expecting the first case, causing a crash when building the C++ runtime. Fix and testcase attached. Testcase here: C++Frontend/2007-04-31-TryCatch.cpp Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-convert.cpp Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-05-01 17:59:57 UTC (rev 126768) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-05-01 18:46:41 UTC (rev 126769) @@ -1868,11 +1868,12 @@ TypeInfos.push_back(TypeInfo); } } - } else { - assert(TREE_CODE(exp) == STATEMENT_LIST && "Need an exp with typeinfo"); - // Each statement in the statement list will be a catch. + } else if (TREE_CODE(exp) == STATEMENT_LIST) { + // Each statement in the statement list will be a catch, or none will. for (tree_stmt_iterator I = tsi_start(exp); !tsi_end_p(I); tsi_next(&I)) GatherTypeInfo(tsi_stmt(I), TypeInfos); + } else { + assert(TypeInfos.empty() && "Need an exp with typeinfo"); } } From baldrick at free.fr Tue May 1 13:49:49 2007 From: baldrick at free.fr (Duncan Sands) Date: Tue, 1 May 2007 13:49:49 -0500 Subject: [llvm-commits] CVS: llvm/test/C++Frontend/2007-04-31-TryCatch.cpp Message-ID: <200705011849.l41InnWb028253@zion.cs.uiuc.edu> Changes in directory llvm/test/C++Frontend: 2007-04-31-TryCatch.cpp added (r1.1) --- Log message: Test handling of TRY_CATCH_EXPRs for which the handler is a sequence of ordinary statements, rather than a list of CATCH_EXPRs or an EH_FILTER_EXPR. --- Diffs of the changes: (+12 -0) 2007-04-31-TryCatch.cpp | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/test/C++Frontend/2007-04-31-TryCatch.cpp diff -c /dev/null llvm/test/C++Frontend/2007-04-31-TryCatch.cpp:1.1 *** /dev/null Tue May 1 13:49:40 2007 --- llvm/test/C++Frontend/2007-04-31-TryCatch.cpp Tue May 1 13:49:30 2007 *************** *** 0 **** --- 1,12 ---- + // RUN: %llvmgxx -S %s -o /dev/null + + #include + + namespace std + { + codecvt:: + codecvt(size_t __refs) + : __codecvt_abstract_base(__refs), + _M_c_locale_codecvt(_S_get_c_locale()) + { } + } From clattner at apple.com Tue May 1 13:53:17 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 1 May 2007 11:53:17 -0700 Subject: [llvm-commits] Patch for bug in llvm-ld In-Reply-To: <4635F312.5040301@gmx.ch> References: <4635F312.5040301@gmx.ch> Message-ID: On Apr 30, 2007, at 6:45 AM, jlh wrote: > Hello! > > I've been told to send this here. In tools/llvm-ld/llvm-ld.cpp, > line 360, a const char* to a temporary std::string is being > stored, with the string going out of scope right after, making > that pointer invalid. > > std::string lib_name = "-l" + LinkItems[index].first; > args.push_back(lib_name.c_str()); > Thanks, but this doesn't seem safe. If the args_temp vector is reallocated, it will move all the std::string objects, invalidating the pointers. -Chris > The attached patch fixes this in a simple way. > > jlh > Index: llvm-ld.cpp > =================================================================== > RCS file: /var/cvs/llvm/llvm/tools/llvm-ld/llvm-ld.cpp,v > retrieving revision 1.51 > diff -u -r1.51 llvm-ld.cpp > --- llvm-ld.cpp 29 Apr 2007 23:59:47 -0000 1.51 > +++ llvm-ld.cpp 30 Apr 2007 13:34:21 -0000 > @@ -330,6 +330,9 @@ > // We can't just assemble and link the file with the system > assembler > // and linker because we don't know where to put the _start > symbol. > // GCC mysteriously knows how to do it. > + > + // args_temp is for storing temporary strings while we have a > const char * to them > + std::vector args_temp; > std::vector args; > args.push_back(gcc.c_str()); > args.push_back("-fno-strict-aliasing"); > @@ -354,8 +357,8 @@ > for (unsigned index = 0; index < LinkItems.size(); index++) > if (LinkItems[index].first != "crtend") { > if (LinkItems[index].second) { > - std::string lib_name = "-l" + LinkItems[index].first; > - args.push_back(lib_name.c_str()); > + args_temp.push_back("-l" + LinkItems[index].first); > + args.push_back(args_temp.back().c_str()); > } else > args.push_back(LinkItems[index].first.c_str()); > } > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From christopher.lamb at gmail.com Tue May 1 14:24:01 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Tue, 1 May 2007 14:24:01 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/RegisterInfoEmitter.cpp In-Reply-To: <200705010557.l415vb52005240@zion.cs.uiuc.edu> References: <200705010557.l415vb52005240@zion.cs.uiuc.edu> Message-ID: Hi Nate, Could you look into the possibility of re-using the sub/super register support that Evan recently added? This may prevent much duplication of information in the RegisterInfo.td, especially for targets with vector registers that have many subregisters. I believe that sub/super register generator unions the set of sub/ super registers in a deterministic fashion and produces the necessary tables in the RegisterInfo.inc already. The only thing is that this would make the sub register index implicit in the ordering of the sub register list in the RegisterInfo.td. Also, would it be possible to emit the information gathered as table lookups rather than a massive two level switch statement? I believe all the information to get the necessary mappings should be available. -- Christopher Lamb On May 1, 2007, at 12:57 AM, Nate Begeman wrote: > > > Changes in directory llvm/utils/TableGen: > > RegisterInfoEmitter.cpp updated: 1.52 -> 1.53 > --- > Log message: > > llvm bug #1350, parts 1, 2, and 3. > > > --- > Diffs of the changes: (+36 -0) > > RegisterInfoEmitter.cpp | 36 ++++++++++++++++++++++++++++++++++++ > 1 files changed, 36 insertions(+) > > > Index: llvm/utils/TableGen/RegisterInfoEmitter.cpp > diff -u llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.52 llvm/utils/ > TableGen/RegisterInfoEmitter.cpp:1.53 > --- llvm/utils/TableGen/RegisterInfoEmitter.cpp:1.52 Fri Apr 20 > 19:55:29 2007 > +++ llvm/utils/TableGen/RegisterInfoEmitter.cpp Tue May 1 00:57:02 > 2007 > @@ -61,6 +61,7 @@ > << " " << ClassName > << "(int CallFrameSetupOpcode = -1, int > CallFrameDestroyOpcode = -1);\n" > << " int getDwarfRegNum(unsigned RegNum) const;\n" > + << " unsigned getSubReg(unsigned RegNo, unsigned Index) > const;\n" > << "};\n\n"; > > const std::vector &RegisterClasses = > @@ -322,6 +323,7 @@ > std::map > RegisterSubRegs; > std::map > RegisterSuperRegs; > std::map > RegisterAliases; > + std::map > > > SubRegVectors; > const std::vector &Regs = Target.getRegisters(); > > for (unsigned i = 0, e = Regs.size(); i != e; ++i) { > @@ -441,6 +443,40 @@ > > std::string ClassName = Target.getName() + "GenRegisterInfo"; > > + // Calculate the mapping of subregister+index pairs to physical > registers. > + std::vector SubRegs = Records.getAllDerivedDefinitions > ("SubRegSet"); > + for (unsigned i = 0, e = SubRegs.size(); i != e; ++i) { > + int subRegIndex = SubRegs[i]->getValueAsInt("index"); > + std::vector From = SubRegs[i]->getValueAsListOfDefs > ("From"); > + std::vector To = SubRegs[i]->getValueAsListOfDefs > ("To"); > + > + assert((From.size() == To.size()) && > + "SubRegSet has mismatched from/to size"); > + > + // For each entry in from/to vectors, insert the to register > at index > + for (unsigned ii = 0, ee = From.size(); ii != ee; ++ii) > + SubRegVectors[From[ii]].push_back(std::make_pair > (subRegIndex, To[ii])); > + } > + > + // Emit the subregister + index mapping function based on the > information > + // calculated above. > + OS << "unsigned " << ClassName > + << "::getSubReg(unsigned RegNo, unsigned Index) const {\n" > + << " switch (RegNo) {\n" > + << " default: abort(); break;\n"; > + for (std::map > > >::iterator > + I = SubRegVectors.begin(), E = SubRegVectors.end(); I != > E; ++I) { > + OS << " case " << getQualifiedName(I->first) << ":\n"; > + OS << " switch (Index) {\n"; > + OS << " default: abort(); break;\n"; > + for (unsigned i = 0, e = I->second.size(); i != e; ++i) > + OS << " case " << (I->second)[i].first << ": return " > + << getQualifiedName((I->second)[i].second) << ";\n"; > + OS << " }; break;\n"; > + } > + OS << " };\n"; > + OS << "}\n\n"; > + > // Emit the constructor of the class... > OS << ClassName << "::" << ClassName > << "(int CallFrameSetupOpcode, int CallFrameDestroyOpcode)\n" > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070501/bd7e296b/attachment.html From evan.cheng at apple.com Tue May 1 15:27:37 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 1 May 2007 15:27:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrThumb.td Message-ID: <200705012027.l41KRb1j030238@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMInstrThumb.td updated: 1.24 -> 1.25 --- Log message: Doh. PC displacement is between the constantpool and the add instruction. --- Diffs of the changes: (+1 -1) ARMInstrThumb.td | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMInstrThumb.td diff -u llvm/lib/Target/ARM/ARMInstrThumb.td:1.24 llvm/lib/Target/ARM/ARMInstrThumb.td:1.25 --- llvm/lib/Target/ARM/ARMInstrThumb.td:1.24 Fri Apr 27 08:54:47 2007 +++ llvm/lib/Target/ARM/ARMInstrThumb.td Tue May 1 15:27:19 2007 @@ -511,7 +511,7 @@ // assembler. def tLEApcrel : TIx2<(ops GPR:$dst, i32imm:$label), !strconcat(!strconcat(".set PCRELV${:uid}, ($label-(", - "${:private}PCRELL${:uid}+6))\n"), + "${:private}PCRELL${:uid}+4))\n"), !strconcat("\tmov $dst, #PCRELV${:uid}\n", "${:private}PCRELL${:uid}:\n\tadd $dst, pc")), []>; From natebegeman at mac.com Tue May 1 15:28:54 2007 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 1 May 2007 13:28:54 -0700 Subject: [llvm-commits] CVS: llvm/utils/TableGen/RegisterInfoEmitter.cpp In-Reply-To: References: <200705010557.l415vb52005240@zion.cs.uiuc.edu> Message-ID: <74F07314-F0B2-469B-8BEE-4DF28A2D9677@mac.com> On May 1, 2007, at 12:24 PM, Christopher Lamb wrote: > Hi Nate, > > Could you look into the possibility of re-using the sub/super > register support that Evan recently added? This may prevent much > duplication of information in the RegisterInfo.td, especially for > targets with vector registers that have many subregisters. It certainly would, I agree. > I believe that sub/super register generator unions the set of sub/ > super registers in a deterministic fashion and produces the > necessary tables in the RegisterInfo.inc already. The only thing is > that this would make the sub register index implicit in the > ordering of the sub register list in the RegisterInfo.td. I'm not sure things are sufficiently well ordered internally for that, or sorted in any particular fashion. I'll look into it, but it seems like it would be less flexible and make the td files far less intuitive as to what is actually going on. If tablegen picked the numbering, I would have to go read the generated file to know what to write in the ISel for that backend, which seems backwards to me. > Also, would it be possible to emit the information gathered as > table lookups rather than a massive two level switch statement? I > believe all the information to get the necessary mappings should be > available. It would be possible, but seems like significantly more work. I'm sure it will be possible to improve upon the initial implementation, which should be good enough to address most of the issues blocked by the lack of subregs exposed to the selection dag. Nate From dpatel at apple.com Tue May 1 15:55:58 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 15:55:58 -0500 Subject: [llvm-commits] CVS: llvm/docs/WritingAnLLVMPass.html Message-ID: <200705012055.l41Ktw0L030819@zion.cs.uiuc.edu> Changes in directory llvm/docs: WritingAnLLVMPass.html updated: 1.56 -> 1.57 --- Log message: Update doc to reflect changes I am about to install to fix PR 888: http://llvm.org/PR888 . --- Diffs of the changes: (+20 -1) WritingAnLLVMPass.html | 21 ++++++++++++++++++++- 1 files changed, 20 insertions(+), 1 deletion(-) Index: llvm/docs/WritingAnLLVMPass.html diff -u llvm/docs/WritingAnLLVMPass.html:1.56 llvm/docs/WritingAnLLVMPass.html:1.57 --- llvm/docs/WritingAnLLVMPass.html:1.56 Mon Apr 16 19:17:11 2007 +++ llvm/docs/WritingAnLLVMPass.html Tue May 1 15:55:38 2007 @@ -263,6 +263,14 @@ time.

+     static const int ID;
+     Hello() : FunctionPass((intptr_t)&ID) {}
+

+ +

This declares pass identifier used by LLVM to identify pass. This allows LLVM to +avoid using expensive C++ runtime information.

+ +
     virtual bool runOnFunction(Function &F) {
       llvm::cerr << "Hello: " << F.getName() << "\n";
       return false;
@@ -277,6 +285,13 @@
 function.

+  const int Hello::ID = 0;
+
+ +

We initialize pass ID here. LLVM uses ID's address to identify pass so +initialization value is not important.

+ +
   RegisterPass<Hello> X("hello", "Hello World Pass");
 }  // end of anonymous namespace
 
@@ -295,6 +310,10 @@ namespace { struct Hello : public FunctionPass { + + static const int ID; + Hello() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F) { llvm::cerr << "Hello: " << F.getName() << "\n"; return false; @@ -1788,7 +1807,7 @@ Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007/04/17 00:17:11 $ + Last modified: $Date: 2007/05/01 20:55:38 $ From christopher.lamb at gmail.com Tue May 1 16:03:16 2007 From: christopher.lamb at gmail.com (Christopher Lamb) Date: Tue, 1 May 2007 16:03:16 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/RegisterInfoEmitter.cpp In-Reply-To: <74F07314-F0B2-469B-8BEE-4DF28A2D9677@mac.com> References: <200705010557.l415vb52005240@zion.cs.uiuc.edu> <74F07314-F0B2-469B-8BEE-4DF28A2D9677@mac.com> Message-ID: <8CF4D8A9-CCB4-416C-B1DD-5FC93FCDA890@gmail.com> On May 1, 2007, at 3:28 PM, Nate Begeman wrote: > On May 1, 2007, at 12:24 PM, Christopher Lamb wrote: > >> Hi Nate, >> >> Could you look into the possibility of re-using the sub/super >> register support that Evan recently added? This may prevent much >> duplication of information in the RegisterInfo.td, especially for >> targets with vector registers that have many subregisters. > > It certainly would, I agree. > >> I believe that sub/super register generator unions the set of sub/ >> super registers in a deterministic fashion and produces the >> necessary tables in the RegisterInfo.inc already. The only thing is >> that this would make the sub register index implicit in the >> ordering of the sub register list in the RegisterInfo.td. > > I'm not sure things are sufficiently well ordered internally for > that, or sorted in any particular fashion. I'll look into it, but it > seems like it would be less flexible and make the td files far less > intuitive as to what is actually going on. If tablegen picked the > numbering, I would have to go read the generated file to know what to > write in the ISel for that backend, which seems backwards to me. I see the problem in generating the ISel. Perhaps it would be be best to go the other way and have the sub/super reg sets be determined by the the explicit sets defined. My goal was simply to eliminate redundant, and possibly erroneously conflicting information from the file. Right now there are two different ways to specify sub registers, and if they don't match there could be problems. > >> Also, would it be possible to emit the information gathered as >> table lookups rather than a massive two level switch statement? I >> believe all the information to get the necessary mappings should be >> available. > > It would be possible, but seems like significantly more work. I'm > sure it will be possible to improve upon the initial implementation, > which should be good enough to address most of the issues blocked by > the lack of subregs exposed to the selection dag. Thanks for working on this. I didn't expect to get it addressed for quite a while! -- Christopher Lamb -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070501/521fd814/attachment.html From natebegeman at mac.com Tue May 1 16:10:34 2007 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 1 May 2007 14:10:34 -0700 Subject: [llvm-commits] CVS: llvm/utils/TableGen/RegisterInfoEmitter.cpp In-Reply-To: <8CF4D8A9-CCB4-416C-B1DD-5FC93FCDA890@gmail.com> References: <200705010557.l415vb52005240@zion.cs.uiuc.edu> <74F07314-F0B2-469B-8BEE-4DF28A2D9677@mac.com> <8CF4D8A9-CCB4-416C-B1DD-5FC93FCDA890@gmail.com> Message-ID: On May 1, 2007, at 2:03 PM, Christopher Lamb wrote: > I see the problem in generating the ISel. Perhaps it would be be > best to go the other way and have the sub/super reg sets be > determined by the the explicit sets defined. My goal was simply to > eliminate redundant, and possibly erroneously conflicting > information from the file. Right now there are two different ways > to specify sub registers, and if they don't match there could be > problems. > >> >>> Also, would it be possible to emit the information gathered as >>> table lookups rather than a massive two level switch statement? I >>> believe all the information to get the necessary mappings should be >>> available. >> >> It would be possible, but seems like significantly more work. I'm >> sure it will be possible to improve upon the initial implementation, >> which should be good enough to address most of the issues blocked by >> the lack of subregs exposed to the selection dag. > > Thanks for working on this. I didn't expect to get it addressed for > quite a while! No prob. I appreciate the feedback; I'll definitely be keeping it in mind while I finish the rest of the bug. Hopefully for 2.1 we can have everything done with no duplication of subreg info. Thanks, Nate From dpatel at apple.com Tue May 1 16:17:37 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200705012117.l41LHbQ7031356@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.179 -> 1.180 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+1 -0) Writer.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.179 llvm/lib/Bytecode/Writer/Writer.cpp:1.180 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.179 Sun Apr 29 13:35:00 2007 +++ llvm/lib/Bytecode/Writer/Writer.cpp Tue May 1 16:15:46 2007 @@ -47,6 +47,7 @@ /// @brief The bytecode version number const unsigned BCVersionNum = 7; +const int WriteBytecodePass::ID = 0; static RegisterPass X("emitbytecode", "Bytecode Writer"); STATISTIC(BytesWritten, "Number of bytecode bytes written"); From dpatel at apple.com Tue May 1 16:17:41 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp ARMLoadStoreOptimizer.cpp Message-ID: <200705012117.l41LHfn6031365@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.39 -> 1.40 ARMLoadStoreOptimizer.cpp updated: 1.8 -> 1.9 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+8 -0) ARMConstantIslandPass.cpp | 4 ++++ ARMLoadStoreOptimizer.cpp | 4 ++++ 2 files changed, 8 insertions(+) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.39 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.40 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.39 Sun Apr 29 14:19:30 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Tue May 1 16:15:46 2007 @@ -128,6 +128,9 @@ ARMFunctionInfo *AFI; bool isThumb; public: + static const int ID; + ARMConstantIslands() : MachineFunctionPass((intptr_t)&ID) {} + virtual bool runOnMachineFunction(MachineFunction &Fn); virtual const char *getPassName() const { @@ -171,6 +174,7 @@ void dumpBBs(); void verify(MachineFunction &Fn); }; + const int ARMConstantIslands::ID = 0; } /// verify - check BBOffsets, BBSizes, alignment of islands Index: llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp diff -u llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp:1.8 llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp:1.9 --- llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp:1.8 Thu Apr 26 14:00:32 2007 +++ llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Tue May 1 16:15:46 2007 @@ -38,6 +38,9 @@ namespace { struct VISIBILITY_HIDDEN ARMLoadStoreOpt : public MachineFunctionPass { + static const int ID; + ARMLoadStoreOpt() : MachineFunctionPass((intptr_t)&ID) {} + const TargetInstrInfo *TII; const MRegisterInfo *MRI; ARMFunctionInfo *AFI; @@ -70,6 +73,7 @@ bool LoadStoreMultipleOpti(MachineBasicBlock &MBB); bool MergeReturnIntoLDM(MachineBasicBlock &MBB); }; + const int ARMLoadStoreOpt::ID = 0; } /// createARMLoadStoreOptimizationPass - returns an instance of the load / store From dpatel at apple.com Tue May 1 16:17:44 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/MSIL/MSILWriter.cpp MSILWriter.h Message-ID: <200705012117.l41LHisK031374@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/MSIL: MSILWriter.cpp updated: 1.4 -> 1.5 MSILWriter.h updated: 1.2 -> 1.3 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+6 -3) MSILWriter.cpp | 2 ++ MSILWriter.h | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/Target/MSIL/MSILWriter.cpp diff -u llvm/lib/Target/MSIL/MSILWriter.cpp:1.4 llvm/lib/Target/MSIL/MSILWriter.cpp:1.5 --- llvm/lib/Target/MSIL/MSILWriter.cpp:1.4 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Target/MSIL/MSILWriter.cpp Tue May 1 16:15:46 2007 @@ -80,6 +80,8 @@ return Changed; } +const int MSILModule::ID = 0; +const int MSILWriter::ID = 0; bool MSILWriter::runOnFunction(Function &F) { if (F.isDeclaration()) return false; Index: llvm/lib/Target/MSIL/MSILWriter.h diff -u llvm/lib/Target/MSIL/MSILWriter.h:1.2 llvm/lib/Target/MSIL/MSILWriter.h:1.3 --- llvm/lib/Target/MSIL/MSILWriter.h:1.2 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Target/MSIL/MSILWriter.h Tue May 1 16:15:46 2007 @@ -37,9 +37,10 @@ const TargetData*& TD; public: + static const int ID; MSILModule(const std::set*& _UsedTypes, const TargetData*& _TD) - : UsedTypes(_UsedTypes), TD(_TD) {} + : ModulePass((intptr_t)&ID), UsedTypes(_UsedTypes), TD(_TD) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); @@ -82,8 +83,8 @@ std::map > StaticInitList; const std::set* UsedTypes; - - MSILWriter(std::ostream &o) : Out(o) { + static const int ID; + MSILWriter(std::ostream &o) : FunctionPass((intptr_t)&ID), Out(o) { UniqID = 0; } From dpatel at apple.com Tue May 1 16:17:45 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:45 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/DelaySlotFiller.cpp FPMover.cpp Message-ID: <200705012117.l41LHjFm031388@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: DelaySlotFiller.cpp updated: 1.13 -> 1.14 FPMover.cpp updated: 1.18 -> 1.19 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+9 -3) DelaySlotFiller.cpp | 5 ++++- FPMover.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) Index: llvm/lib/Target/Sparc/DelaySlotFiller.cpp diff -u llvm/lib/Target/Sparc/DelaySlotFiller.cpp:1.13 llvm/lib/Target/Sparc/DelaySlotFiller.cpp:1.14 --- llvm/lib/Target/Sparc/DelaySlotFiller.cpp:1.13 Tue Dec 19 16:59:26 2006 +++ llvm/lib/Target/Sparc/DelaySlotFiller.cpp Tue May 1 16:15:46 2007 @@ -30,7 +30,9 @@ TargetMachine &TM; const TargetInstrInfo *TII; - Filler(TargetMachine &tm) : TM(tm), TII(tm.getInstrInfo()) { } + static const int ID; + Filler(TargetMachine &tm) + : MachineFunctionPass((intptr_t)&ID), TM(tm), TII(tm.getInstrInfo()) { } virtual const char *getPassName() const { return "SPARC Delay Slot Filler"; @@ -46,6 +48,7 @@ } }; + const int Filler::ID = 0; } // end of anonymous namespace /// createSparcDelaySlotFillerPass - Returns a pass that fills in delay Index: llvm/lib/Target/Sparc/FPMover.cpp diff -u llvm/lib/Target/Sparc/FPMover.cpp:1.18 llvm/lib/Target/Sparc/FPMover.cpp:1.19 --- llvm/lib/Target/Sparc/FPMover.cpp:1.18 Tue Dec 19 16:59:26 2006 +++ llvm/lib/Target/Sparc/FPMover.cpp Tue May 1 16:15:46 2007 @@ -31,8 +31,10 @@ /// layout, etc. /// TargetMachine &TM; - - FPMover(TargetMachine &tm) : TM(tm) { } + + static const int ID; + FPMover(TargetMachine &tm) + : MachineFunctionPass((intptr_t)&ID), TM(tm) { } virtual const char *getPassName() const { return "Sparc Double-FP Move Fixer"; @@ -41,6 +43,7 @@ bool runOnMachineBasicBlock(MachineBasicBlock &MBB); bool runOnMachineFunction(MachineFunction &F); }; + const int FPMover::ID = 0; } // end of anonymous namespace /// createSparcFPMoverPass - Returns a pass that turns FpMOVD From dpatel at apple.com Tue May 1 16:17:45 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:45 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetData.cpp Message-ID: <200705012117.l41LHjxD031404@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.107 -> 1.108 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+3 -1) TargetData.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.107 llvm/lib/Target/TargetData.cpp:1.108 --- llvm/lib/Target/TargetData.cpp:1.107 Sun Apr 22 16:54:13 2007 +++ llvm/lib/Target/TargetData.cpp Tue May 1 16:15:46 2007 @@ -33,6 +33,7 @@ // Handle the Pass registration stuff necessary to use TargetData's. namespace { // Register the default SparcV9 implementation... + const int TargetData::ID = 0; RegisterPass X("targetdata", "Target Data Layout"); } @@ -221,7 +222,8 @@ } } -TargetData::TargetData(const Module *M) { +TargetData::TargetData(const Module *M) + : ImmutablePass((intptr_t)&ID) { init(M->getDataLayout()); } From dpatel at apple.com Tue May 1 16:17:46 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:46 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp PPCCodeEmitter.cpp Message-ID: <200705012117.l41LHkYc031427@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCBranchSelector.cpp updated: 1.42 -> 1.43 PPCCodeEmitter.cpp updated: 1.75 -> 1.76 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+7 -1) PPCBranchSelector.cpp | 4 ++++ PPCCodeEmitter.cpp | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.42 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.43 --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.42 Fri Jan 26 08:34:51 2007 +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Tue May 1 16:15:46 2007 @@ -32,6 +32,9 @@ namespace { struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass { + static const int ID; + PPCBSel() : MachineFunctionPass((intptr_t)&ID) {} + /// BlockSizes - The sizes of the basic blocks in the function. std::vector BlockSizes; @@ -41,6 +44,7 @@ return "PowerPC Branch Selector"; } }; + const int PPCBSel::ID = 0; } /// createPPCBranchSelectionPass - returns an instance of the Branch Selection Index: llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.75 llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.76 --- llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.75 Sat Feb 24 23:34:32 2007 +++ llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp Tue May 1 16:15:46 2007 @@ -40,8 +40,9 @@ int getMachineOpValue(MachineInstr &MI, MachineOperand &MO); public: + static const int ID; PPCCodeEmitter(TargetMachine &T, MachineCodeEmitter &M) - : TM(T), MCE(M) {} + : MachineFunctionPass((intptr_t)&ID), TM(T), MCE(M) {} const char *getPassName() const { return "PowerPC Machine Code Emitter"; } @@ -63,6 +64,7 @@ /// unsigned getBinaryCodeForInstr(MachineInstr &MI); }; + const int PPCCodeEmitter::ID = 0; } /// createPPCCodeEmitterPass - Return a pass that emits the collected PPC code From dpatel at apple.com Tue May 1 16:17:46 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:46 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasAnalysis.h CallGraph.h Dominators.h FindUsedTypes.h IntervalPartition.h LoopInfo.h LoopPass.h PostDominators.h ProfileInfo.h ScalarEvolution.h ValueNumbering.h Message-ID: <200705012117.l41LHkWb031450@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasAnalysis.h updated: 1.28 -> 1.29 CallGraph.h updated: 1.53 -> 1.54 Dominators.h updated: 1.76 -> 1.77 FindUsedTypes.h updated: 1.29 -> 1.30 IntervalPartition.h updated: 1.23 -> 1.24 LoopInfo.h updated: 1.63 -> 1.64 LoopPass.h updated: 1.15 -> 1.16 PostDominators.h updated: 1.17 -> 1.18 ProfileInfo.h updated: 1.5 -> 1.6 ScalarEvolution.h updated: 1.16 -> 1.17 ValueNumbering.h updated: 1.10 -> 1.11 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+45 -14) AliasAnalysis.h | 1 + CallGraph.h | 1 + Dominators.h | 27 ++++++++++++++++++--------- FindUsedTypes.h | 3 +++ IntervalPartition.h | 4 +++- LoopInfo.h | 3 +++ LoopPass.h | 3 +++ PostDominators.h | 12 +++++++++--- ProfileInfo.h | 1 + ScalarEvolution.h | 3 ++- ValueNumbering.h | 1 + 11 files changed, 45 insertions(+), 14 deletions(-) Index: llvm/include/llvm/Analysis/AliasAnalysis.h diff -u llvm/include/llvm/Analysis/AliasAnalysis.h:1.28 llvm/include/llvm/Analysis/AliasAnalysis.h:1.29 --- llvm/include/llvm/Analysis/AliasAnalysis.h:1.28 Sun Feb 11 22:59:57 2007 +++ llvm/include/llvm/Analysis/AliasAnalysis.h Tue May 1 16:15:46 2007 @@ -61,6 +61,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const; public: + static const int ID; // Class identification, replacement for typeinfo AliasAnalysis() : TD(0), AA(0) {} virtual ~AliasAnalysis(); // We want to be subclassed Index: llvm/include/llvm/Analysis/CallGraph.h diff -u llvm/include/llvm/Analysis/CallGraph.h:1.53 llvm/include/llvm/Analysis/CallGraph.h:1.54 --- llvm/include/llvm/Analysis/CallGraph.h:1.53 Sat Dec 16 23:15:12 2006 +++ llvm/include/llvm/Analysis/CallGraph.h Tue May 1 16:15:46 2007 @@ -73,6 +73,7 @@ FunctionMapTy FunctionMap; // Map from a function to its node public: + static const int ID; // Class identification, replacement for typeinfo //===--------------------------------------------------------------------- // Accessors... // Index: llvm/include/llvm/Analysis/Dominators.h diff -u llvm/include/llvm/Analysis/Dominators.h:1.76 llvm/include/llvm/Analysis/Dominators.h:1.77 --- llvm/include/llvm/Analysis/Dominators.h:1.76 Sat Apr 21 02:04:45 2007 +++ llvm/include/llvm/Analysis/Dominators.h Tue May 1 16:15:46 2007 @@ -42,9 +42,10 @@ protected: std::vector Roots; const bool IsPostDominators; - - inline DominatorBase(bool isPostDom) : Roots(), IsPostDominators(isPostDom) {} + inline DominatorBase(intptr_t ID, bool isPostDom) : + FunctionPass(ID), Roots(), IsPostDominators(isPostDom) {} public: + /// getRoots - Return the root blocks of the current CFG. This may include /// multiple blocks if we are computing post dominators. For forward /// dominators, this will always be a single block (the entry node). @@ -135,7 +136,8 @@ }; public: - DominatorTreeBase(bool isPostDom) : DominatorBase(isPostDom) {} + DominatorTreeBase(intptr_t ID, bool isPostDom) + : DominatorBase(ID, isPostDom) {} ~DominatorTreeBase() { reset(); } virtual void releaseMemory() { reset(); } @@ -206,7 +208,8 @@ /// class DominatorTree : public DominatorTreeBase { public: - DominatorTree() : DominatorTreeBase(false) {} + static const int ID; // Pass ID, replacement for typeid + DominatorTree() : DominatorTreeBase((intptr_t)&ID, false) {} BasicBlock *getRoot() const { assert(Roots.size() == 1 && "Should always have entry node!"); @@ -264,8 +267,9 @@ /// class ETForestBase : public DominatorBase { public: - ETForestBase(bool isPostDom) : DominatorBase(isPostDom), Nodes(), - DFSInfoValid(false), SlowQueries(0) {} + ETForestBase(intptr_t ID, bool isPostDom) + : DominatorBase(ID, isPostDom), Nodes(), + DFSInfoValid(false), SlowQueries(0) {} virtual void releaseMemory() { reset(); } @@ -395,7 +399,9 @@ class ETForest : public ETForestBase { public: - ETForest() : ETForestBase(false) {} + static const int ID; // Pass identifcation, replacement for typeid + + ETForest() : ETForestBase((intptr_t)&ID, false) {} BasicBlock *getRoot() const { assert(Roots.size() == 1 && "Should always have entry node!"); @@ -425,7 +431,8 @@ protected: DomSetMapType Frontiers; public: - DominanceFrontierBase(bool isPostDom) : DominatorBase(isPostDom) {} + DominanceFrontierBase(intptr_t ID, bool isPostDom) + : DominatorBase(ID, isPostDom) {} virtual void releaseMemory() { Frontiers.clear(); } @@ -470,7 +477,9 @@ /// class DominanceFrontier : public DominanceFrontierBase { public: - DominanceFrontier() : DominanceFrontierBase(false) {} + static const int ID; // Pass ID, replacement for typeid + DominanceFrontier() : + DominanceFrontierBase((intptr_t)& ID, false) {} BasicBlock *getRoot() const { assert(Roots.size() == 1 && "Should always have entry node!"); Index: llvm/include/llvm/Analysis/FindUsedTypes.h diff -u llvm/include/llvm/Analysis/FindUsedTypes.h:1.29 llvm/include/llvm/Analysis/FindUsedTypes.h:1.30 --- llvm/include/llvm/Analysis/FindUsedTypes.h:1.29 Sat Dec 16 23:15:12 2006 +++ llvm/include/llvm/Analysis/FindUsedTypes.h Tue May 1 16:15:46 2007 @@ -24,6 +24,9 @@ class FindUsedTypes : public ModulePass { std::set UsedTypes; public: + static const int ID; // Pass identifcation, replacement for typeid + FindUsedTypes() : ModulePass((intptr_t)&ID) {} + /// getTypes - After the pass has been run, return the set containing all of /// the types used in the module. /// Index: llvm/include/llvm/Analysis/IntervalPartition.h diff -u llvm/include/llvm/Analysis/IntervalPartition.h:1.23 llvm/include/llvm/Analysis/IntervalPartition.h:1.24 --- llvm/include/llvm/Analysis/IntervalPartition.h:1.23 Sat Dec 16 23:15:12 2006 +++ llvm/include/llvm/Analysis/IntervalPartition.h Tue May 1 16:15:46 2007 @@ -45,7 +45,9 @@ std::vector Intervals; public: - IntervalPartition() : RootInterval(0) {} + static const int ID; // Pass identifcation, replacement for typeid + + IntervalPartition() : FunctionPass((intptr_t)&ID), RootInterval(0) {} // run - Calculate the interval partition for this function virtual bool runOnFunction(Function &F); Index: llvm/include/llvm/Analysis/LoopInfo.h diff -u llvm/include/llvm/Analysis/LoopInfo.h:1.63 llvm/include/llvm/Analysis/LoopInfo.h:1.64 --- llvm/include/llvm/Analysis/LoopInfo.h:1.63 Sat Dec 16 23:15:12 2006 +++ llvm/include/llvm/Analysis/LoopInfo.h Tue May 1 16:15:46 2007 @@ -241,6 +241,9 @@ std::vector TopLevelLoops; friend class Loop; public: + static const int ID; // Pass identifcation, replacement for typeid + + LoopInfo() : FunctionPass((intptr_t)&ID) {} ~LoopInfo() { releaseMemory(); } /// iterator/begin/end - The interface to the top-level loops in the current Index: llvm/include/llvm/Analysis/LoopPass.h diff -u llvm/include/llvm/Analysis/LoopPass.h:1.15 llvm/include/llvm/Analysis/LoopPass.h:1.16 --- llvm/include/llvm/Analysis/LoopPass.h:1.15 Mon Apr 16 13:51:25 2007 +++ llvm/include/llvm/Analysis/LoopPass.h Tue May 1 16:15:46 2007 @@ -29,6 +29,8 @@ class LoopPass : public Pass { public: + LoopPass(intptr_t pid) : Pass(pid) {} + // runOnLoop - THis method should be implemented by the subclass to perform // whatever action is necessary for the specfied Loop. virtual bool runOnLoop (Loop *L, LPPassManager &LPM) = 0; @@ -66,6 +68,7 @@ class LPPassManager : public FunctionPass, public PMDataManager { public: + static const int ID; LPPassManager(int Depth); /// run - Execute all of the passes scheduled for execution. Keep track of Index: llvm/include/llvm/Analysis/PostDominators.h diff -u llvm/include/llvm/Analysis/PostDominators.h:1.17 llvm/include/llvm/Analysis/PostDominators.h:1.18 --- llvm/include/llvm/Analysis/PostDominators.h:1.17 Sun Apr 15 18:14:18 2007 +++ llvm/include/llvm/Analysis/PostDominators.h Tue May 1 16:15:46 2007 @@ -22,7 +22,10 @@ /// compute the a post-dominator tree. /// struct PostDominatorTree : public DominatorTreeBase { - PostDominatorTree() : DominatorTreeBase(true) {} + static const int ID; // Pass identifcation, replacement for typeid + + PostDominatorTree() : + DominatorTreeBase((intptr_t)&ID, true) {} virtual bool runOnFunction(Function &F) { reset(); // Reset from the last time we were run... @@ -51,7 +54,8 @@ /// PostETForest Class - Concrete subclass of ETForestBase that is used to /// compute a forwards post-dominator ET-Forest. struct PostETForest : public ETForestBase { - PostETForest() : ETForestBase(true) {} + static const int ID; + PostETForest() : ETForestBase((intptr_t)&ID, true) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); @@ -75,7 +79,9 @@ /// used to compute the a post-dominance frontier. /// struct PostDominanceFrontier : public DominanceFrontierBase { - PostDominanceFrontier() : DominanceFrontierBase(true) {} + static const int ID; + PostDominanceFrontier() + : DominanceFrontierBase((intptr_t) &ID, true) {} virtual bool runOnFunction(Function &) { Frontiers.clear(); Index: llvm/include/llvm/Analysis/ProfileInfo.h diff -u llvm/include/llvm/Analysis/ProfileInfo.h:1.5 llvm/include/llvm/Analysis/ProfileInfo.h:1.6 --- llvm/include/llvm/Analysis/ProfileInfo.h:1.5 Thu Apr 21 15:16:32 2005 +++ llvm/include/llvm/Analysis/ProfileInfo.h Tue May 1 16:15:46 2007 @@ -38,6 +38,7 @@ // entered. std::map, unsigned> EdgeCounts; public: + static const int ID; // Class identification, replacement for typeinfo virtual ~ProfileInfo(); // We want to be subclassed //===------------------------------------------------------------------===// Index: llvm/include/llvm/Analysis/ScalarEvolution.h diff -u llvm/include/llvm/Analysis/ScalarEvolution.h:1.16 llvm/include/llvm/Analysis/ScalarEvolution.h:1.17 --- llvm/include/llvm/Analysis/ScalarEvolution.h:1.16 Sun Mar 4 18:00:41 2007 +++ llvm/include/llvm/Analysis/ScalarEvolution.h Tue May 1 16:15:46 2007 @@ -197,7 +197,8 @@ class ScalarEvolution : public FunctionPass { void *Impl; // ScalarEvolution uses the pimpl pattern public: - ScalarEvolution() : Impl(0) {} + static const int ID; // Pass identifcation, replacement for typeid + ScalarEvolution() : FunctionPass((intptr_t)&ID), Impl(0) {} /// getSCEV - Return a SCEV expression handle for the full generality of the /// specified expression. Index: llvm/include/llvm/Analysis/ValueNumbering.h diff -u llvm/include/llvm/Analysis/ValueNumbering.h:1.10 llvm/include/llvm/Analysis/ValueNumbering.h:1.11 --- llvm/include/llvm/Analysis/ValueNumbering.h:1.10 Wed Jun 7 17:00:25 2006 +++ llvm/include/llvm/Analysis/ValueNumbering.h Tue May 1 16:15:46 2007 @@ -29,6 +29,7 @@ class Instruction; struct ValueNumbering { + static const int ID; // Class identification, replacement for typeinfo virtual ~ValueNumbering(); // We want to be subclassed /// getEqualNumberNodes - Return nodes with the same value number as the From dpatel at apple.com Tue May 1 16:17:46 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:46 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp EdgeProfiling.cpp RSProfiling.cpp RSProfiling.h Message-ID: <200705012117.l41LHkFL031476@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: BlockProfiling.cpp updated: 1.22 -> 1.23 EdgeProfiling.cpp updated: 1.12 -> 1.13 RSProfiling.cpp updated: 1.23 -> 1.24 RSProfiling.h updated: 1.4 -> 1.5 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+19 -0) BlockProfiling.cpp | 7 +++++++ EdgeProfiling.cpp | 4 ++++ RSProfiling.cpp | 7 +++++++ RSProfiling.h | 1 + 4 files changed, 19 insertions(+) Index: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.22 llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.23 --- llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.22 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp Tue May 1 16:15:47 2007 @@ -32,9 +32,13 @@ namespace { class VISIBILITY_HIDDEN FunctionProfiler : public RSProfilers_std { + public: + static const int ID; bool runOnModule(Module &M); }; + const int FunctionProfiler::ID = 0; + RegisterPass X("insert-function-profiling", "Insert instrumentation for function profiling"); RegisterAnalysisGroup XG(X); @@ -79,8 +83,11 @@ namespace { class BlockProfiler : public RSProfilers_std { bool runOnModule(Module &M); + public: + static const int ID; }; + const int BlockProfiler::ID = 0; RegisterPass Y("insert-block-profiling", "Insert instrumentation for block profiling"); RegisterAnalysisGroup YG(Y); Index: llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.12 llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.13 --- llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.12 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp Tue May 1 16:15:47 2007 @@ -32,8 +32,12 @@ namespace { class VISIBILITY_HIDDEN EdgeProfiler : public ModulePass { bool runOnModule(Module &M); + public: + static const int ID; // Pass identifcation, replacement for typeid + EdgeProfiler() : ModulePass((intptr_t)&ID) {} }; + const int EdgeProfiler::ID = 0; RegisterPass X("insert-edge-profiling", "Insert instrumentation for edge profiling"); } Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.23 llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.24 --- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.23 Tue Apr 17 12:54:12 2007 +++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Tue May 1 16:15:47 2007 @@ -69,6 +69,7 @@ /// measuring framework overhead class VISIBILITY_HIDDEN NullProfilerRS : public RSProfilers { public: + static const int ID; // Pass identifcation, replacement for typeid bool isProfiling(Value* v) { return false; } @@ -80,7 +81,9 @@ } }; + const int RSProfilers::ID = 0; static RegisterAnalysisGroup A("Profiling passes"); + const int NullProfilerRS::ID = 0; static RegisterPass NP("insert-null-profiling-rs", "Measure profiling framework overhead"); static RegisterAnalysisGroup NPT(NP); @@ -138,6 +141,9 @@ /// ProfilerRS - Insert the random sampling framework struct VISIBILITY_HIDDEN ProfilerRS : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + ProfilerRS() : FunctionPass((intptr_t)&ID) {} + std::map TransCache; std::set ChoicePoints; Chooser* c; @@ -154,6 +160,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const; }; + const int ProfilerRS::ID = 0; RegisterPass X("insert-rs-profiling-framework", "Insert random sampling instrumentation framework"); } Index: llvm/lib/Transforms/Instrumentation/RSProfiling.h diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.h:1.4 llvm/lib/Transforms/Instrumentation/RSProfiling.h:1.5 --- llvm/lib/Transforms/Instrumentation/RSProfiling.h:1.4 Sat Feb 3 18:40:41 2007 +++ llvm/lib/Transforms/Instrumentation/RSProfiling.h Tue May 1 16:15:47 2007 @@ -17,6 +17,7 @@ /// RSProfilers_std - a simple support class for profilers that handles most /// of the work of chaining and tracking inserted code. struct RSProfilers_std : public RSProfilers { + static const int ID; std::set profcode; // Lookup up values in profcode virtual bool isProfiling(Value* v); From dpatel at apple.com Tue May 1 16:17:47 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaBranchSelector.cpp AlphaCodeEmitter.cpp AlphaLLRP.cpp Message-ID: <200705012117.l41LHljN031509@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaBranchSelector.cpp updated: 1.2 -> 1.3 AlphaCodeEmitter.cpp updated: 1.21 -> 1.22 AlphaLLRP.cpp updated: 1.8 -> 1.9 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+11 -3) AlphaBranchSelector.cpp | 3 +++ AlphaCodeEmitter.cpp | 6 ++++-- AlphaLLRP.cpp | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) Index: llvm/lib/Target/Alpha/AlphaBranchSelector.cpp diff -u llvm/lib/Target/Alpha/AlphaBranchSelector.cpp:1.2 llvm/lib/Target/Alpha/AlphaBranchSelector.cpp:1.3 --- llvm/lib/Target/Alpha/AlphaBranchSelector.cpp:1.2 Thu Nov 30 01:12:03 2006 +++ llvm/lib/Target/Alpha/AlphaBranchSelector.cpp Tue May 1 16:15:46 2007 @@ -22,6 +22,8 @@ namespace { struct VISIBILITY_HIDDEN AlphaBSel : public MachineFunctionPass { + static const int ID; + AlphaBSel() : MachineFunctionPass((intptr_t)&ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); @@ -29,6 +31,7 @@ return "Alpha Branch Selection"; } }; + const int AlphaBSel::ID = 0; } /// createAlphaBranchSelectionPass - returns an instance of the Branch Selection Index: llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp diff -u llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.21 llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.22 --- llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.21 Tue Dec 19 16:59:25 2006 +++ llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp Tue May 1 16:15:46 2007 @@ -36,11 +36,12 @@ int getMachineOpValue(MachineInstr &MI, MachineOperand &MO); public: + static const int ID; explicit AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce) - : II(0), TM(tm), MCE(mce) {} + : MachineFunctionPass((intptr_t)&ID), II(0), TM(tm), MCE(mce) {} AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce, const AlphaInstrInfo& ii) - : II(&ii), TM(tm), MCE(mce) {} + : MachineFunctionPass((intptr_t)&ID), II(&ii), TM(tm), MCE(mce) {} bool runOnMachineFunction(MachineFunction &MF); @@ -60,6 +61,7 @@ void emitBasicBlock(MachineBasicBlock &MBB); }; + const int AlphaCodeEmitter::ID = 0; } /// createAlphaCodeEmitterPass - Return a pass that emits the collected Alpha code Index: llvm/lib/Target/Alpha/AlphaLLRP.cpp diff -u llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.8 llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.9 --- llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.8 Mon Apr 16 13:10:22 2007 +++ llvm/lib/Target/Alpha/AlphaLLRP.cpp Tue May 1 16:15:46 2007 @@ -37,7 +37,9 @@ /// AlphaTargetMachine &TM; - AlphaLLRPPass(AlphaTargetMachine &tm) : TM(tm) { } + static const int ID; + AlphaLLRPPass(AlphaTargetMachine &tm) + : MachineFunctionPass((intptr_t)&ID), TM(tm) { } virtual const char *getPassName() const { return "Alpha NOP inserter"; @@ -152,6 +154,7 @@ return Changed; } }; + const int AlphaLLRPPass::ID = 0; } // end of anonymous namespace FunctionPass *llvm::createAlphaLLRPPass(AlphaTargetMachine &tm) { From dpatel at apple.com Tue May 1 16:17:46 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:46 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp LCSSA.cpp LoopSimplify.cpp LowerAllocations.cpp LowerInvoke.cpp LowerSelect.cpp LowerSwitch.cpp Mem2Reg.cpp UnifyFunctionExitNodes.cpp Message-ID: <200705012117.l41LHkZM031466@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: BreakCriticalEdges.cpp updated: 1.44 -> 1.45 LCSSA.cpp updated: 1.38 -> 1.39 LoopSimplify.cpp updated: 1.92 -> 1.93 LowerAllocations.cpp updated: 1.73 -> 1.74 LowerInvoke.cpp updated: 1.59 -> 1.60 LowerSelect.cpp updated: 1.12 -> 1.13 LowerSwitch.cpp updated: 1.38 -> 1.39 Mem2Reg.cpp updated: 1.26 -> 1.27 UnifyFunctionExitNodes.cpp updated: 1.36 -> 1.37 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+33 -3) BreakCriticalEdges.cpp | 4 ++++ LCSSA.cpp | 4 ++++ LoopSimplify.cpp | 4 ++++ LowerAllocations.cpp | 5 ++++- LowerInvoke.cpp | 5 ++++- LowerSelect.cpp | 5 ++++- LowerSwitch.cpp | 4 ++++ Mem2Reg.cpp | 4 ++++ UnifyFunctionExitNodes.cpp | 1 + 9 files changed, 33 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp diff -u llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.44 llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.45 --- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.44 Tue Apr 17 13:09:47 2007 +++ llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp Tue May 1 16:15:47 2007 @@ -34,6 +34,9 @@ namespace { struct VISIBILITY_HIDDEN BreakCriticalEdges : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + BreakCriticalEdges() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -47,6 +50,7 @@ } }; + const int BreakCriticalEdges::ID = 0; RegisterPass X("break-crit-edges", "Break critical edges in CFG"); } Index: llvm/lib/Transforms/Utils/LCSSA.cpp diff -u llvm/lib/Transforms/Utils/LCSSA.cpp:1.38 llvm/lib/Transforms/Utils/LCSSA.cpp:1.39 --- llvm/lib/Transforms/Utils/LCSSA.cpp:1.38 Wed Apr 18 17:39:00 2007 +++ llvm/lib/Transforms/Utils/LCSSA.cpp Tue May 1 16:15:47 2007 @@ -47,6 +47,9 @@ namespace { struct VISIBILITY_HIDDEN LCSSA : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + LCSSA() : FunctionPass((intptr_t)&ID) {} + // Cached analysis information for the current function. LoopInfo *LI; DominatorTree *DT; @@ -81,6 +84,7 @@ } }; + const int LCSSA::ID = 0; RegisterPass X("lcssa", "Loop-Closed SSA Form Pass"); } Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.92 llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.93 --- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.92 Fri Apr 20 15:04:37 2007 +++ llvm/lib/Transforms/Utils/LoopSimplify.cpp Tue May 1 16:15:47 2007 @@ -54,6 +54,9 @@ namespace { struct VISIBILITY_HIDDEN LoopSimplify : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + LoopSimplify() : FunctionPass((intptr_t)&ID) {} + // AA - If we have an alias analysis object to update, this is it, otherwise // this is null. AliasAnalysis *AA; @@ -89,6 +92,7 @@ std::vector &PredBlocks); }; + const int LoopSimplify::ID = 0; RegisterPass X("loopsimplify", "Canonicalize natural loops", true); } Index: llvm/lib/Transforms/Utils/LowerAllocations.cpp diff -u llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.73 llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.74 --- llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.73 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Transforms/Utils/LowerAllocations.cpp Tue May 1 16:15:47 2007 @@ -36,8 +36,10 @@ Constant *FreeFunc; // Initialized by doInitialization bool LowerMallocArgToInteger; public: + static const int ID; // Pass ID, replacement for typeid LowerAllocations(bool LowerToInt = false) - : MallocFunc(0), FreeFunc(0), LowerMallocArgToInteger(LowerToInt) {} + : BasicBlockPass((intptr_t)&ID), MallocFunc(0), FreeFunc(0), + LowerMallocArgToInteger(LowerToInt) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); @@ -66,6 +68,7 @@ bool runOnBasicBlock(BasicBlock &BB); }; + const int LowerAllocations::ID = 0; RegisterPass X("lowerallocs", "Lower allocations from instructions to calls"); } Index: llvm/lib/Transforms/Utils/LowerInvoke.cpp diff -u llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.59 llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.60 --- llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.59 Fri Apr 20 17:40:10 2007 +++ llvm/lib/Transforms/Utils/LowerInvoke.cpp Tue May 1 16:15:47 2007 @@ -75,7 +75,9 @@ const TargetLowering *TLI; public: - LowerInvoke(const TargetLowering *tli = NULL) : TLI(tli) { } + static const int ID; // Pass identifcation, replacement for typeid + LowerInvoke(const TargetLowering *tli = NULL) : FunctionPass((intptr_t)&ID), + TLI(tli) { } bool doInitialization(Module &M); bool runOnFunction(Function &F); @@ -97,6 +99,7 @@ bool insertExpensiveEHSupport(Function &F); }; + const int LowerInvoke::ID = 0; RegisterPass X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); } Index: llvm/lib/Transforms/Utils/LowerSelect.cpp diff -u llvm/lib/Transforms/Utils/LowerSelect.cpp:1.12 llvm/lib/Transforms/Utils/LowerSelect.cpp:1.13 --- llvm/lib/Transforms/Utils/LowerSelect.cpp:1.12 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Transforms/Utils/LowerSelect.cpp Tue May 1 16:15:47 2007 @@ -33,7 +33,9 @@ class VISIBILITY_HIDDEN LowerSelect : public FunctionPass { bool OnlyFP; // Only lower FP select instructions? public: - LowerSelect(bool onlyfp = false) : OnlyFP(onlyfp) {} + static const int ID; // Pass identifcation, replacement for typeid + LowerSelect(bool onlyfp = false) : FunctionPass((intptr_t)&ID), + OnlyFP(onlyfp) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { // This certainly destroys the CFG. @@ -48,6 +50,7 @@ bool runOnFunction(Function &F); }; + const int LowerSelect::ID = 0; RegisterPass X("lowerselect", "Lower select instructions to branches"); } Index: llvm/lib/Transforms/Utils/LowerSwitch.cpp diff -u llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.38 llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.39 --- llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.38 Tue Apr 17 13:09:47 2007 +++ llvm/lib/Transforms/Utils/LowerSwitch.cpp Tue May 1 16:15:47 2007 @@ -30,6 +30,9 @@ /// modifies the CFG! class VISIBILITY_HIDDEN LowerSwitch : public FunctionPass { public: + static const int ID; // Pass identifcation, replacement for typeid + LowerSwitch() : FunctionPass((intptr_t) &ID) {} + virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -75,6 +78,7 @@ } }; + const int LowerSwitch::ID = 0; RegisterPass X("lowerswitch", "Lower SwitchInst's to branches"); } Index: llvm/lib/Transforms/Utils/Mem2Reg.cpp diff -u llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.26 llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.27 --- llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.26 Wed Apr 25 13:32:35 2007 +++ llvm/lib/Transforms/Utils/Mem2Reg.cpp Tue May 1 16:15:47 2007 @@ -27,6 +27,9 @@ namespace { struct VISIBILITY_HIDDEN PromotePass : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + PromotePass() : FunctionPass((intptr_t)&ID) {} + // runOnFunction - To run this pass, first we calculate the alloca // instructions that are safe for promotion, then we promote each one. // @@ -47,6 +50,7 @@ } }; + const int PromotePass::ID = 0; RegisterPass X("mem2reg", "Promote Memory to Register"); } // end of anonymous namespace Index: llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp diff -u llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.36 llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.37 --- llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.36 Sun Aug 27 17:42:52 2006 +++ llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp Tue May 1 16:15:47 2007 @@ -22,6 +22,7 @@ #include "llvm/Type.h" using namespace llvm; +const int UnifyFunctionExitNodes::ID = 0; static RegisterPass X("mergereturn", "Unify function exit nodes"); From dpatel at apple.com Tue May 1 16:17:47 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200705012117.l41LHlq8031517@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.442 -> 1.443 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+2 -0) SelectionDAGISel.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.442 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.443 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.442 Mon Apr 30 16:11:17 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue May 1 16:15:46 2007 @@ -5011,3 +5011,5 @@ if (e != InOps.size()) Ops.push_back(InOps.back()); } + +const int SelectionDAGISel::ID = 0; From dpatel at apple.com Tue May 1 16:17:47 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp ConstantMerge.cpp DeadArgumentElimination.cpp DeadTypeElimination.cpp ExtractFunction.cpp GlobalDCE.cpp GlobalOpt.cpp IPConstantPropagation.cpp IndMemRemoval.cpp InlineSimple.cpp Inliner.cpp Inliner.h Internalize.cpp LoopExtractor.cpp LowerSetJmp.cpp PruneEH.cpp RaiseAllocations.cpp SimplifyLibCalls.cpp StripDeadPrototypes.cpp StripSymbols.cpp Message-ID: <200705012117.l41LHljv031510@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ArgumentPromotion.cpp updated: 1.39 -> 1.40 ConstantMerge.cpp updated: 1.39 -> 1.40 DeadArgumentElimination.cpp updated: 1.40 -> 1.41 DeadTypeElimination.cpp updated: 1.62 -> 1.63 ExtractFunction.cpp updated: 1.20 -> 1.21 GlobalDCE.cpp updated: 1.45 -> 1.46 GlobalOpt.cpp updated: 1.101 -> 1.102 IPConstantPropagation.cpp updated: 1.23 -> 1.24 IndMemRemoval.cpp updated: 1.15 -> 1.16 InlineSimple.cpp updated: 1.78 -> 1.79 Inliner.cpp updated: 1.37 -> 1.38 Inliner.h updated: 1.9 -> 1.10 Internalize.cpp updated: 1.45 -> 1.46 LoopExtractor.cpp updated: 1.24 -> 1.25 LowerSetJmp.cpp updated: 1.40 -> 1.41 PruneEH.cpp updated: 1.31 -> 1.32 RaiseAllocations.cpp updated: 1.40 -> 1.41 SimplifyLibCalls.cpp updated: 1.112 -> 1.113 StripDeadPrototypes.cpp updated: 1.5 -> 1.6 StripSymbols.cpp updated: 1.15 -> 1.16 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+85 -10) ArgumentPromotion.cpp | 4 ++++ ConstantMerge.cpp | 4 ++++ DeadArgumentElimination.cpp | 5 +++++ DeadTypeElimination.cpp | 4 ++++ ExtractFunction.cpp | 6 +++++- GlobalDCE.cpp | 4 ++++ GlobalOpt.cpp | 3 +++ IPConstantPropagation.cpp | 4 ++++ IndMemRemoval.cpp | 4 ++++ InlineSimple.cpp | 2 ++ Inliner.cpp | 4 +++- Inliner.h | 1 + Internalize.cpp | 6 ++++-- LoopExtractor.cpp | 15 ++++++++++++--- LowerSetJmp.cpp | 4 ++++ PruneEH.cpp | 5 +++++ RaiseAllocations.cpp | 5 ++++- SimplifyLibCalls.cpp | 4 ++++ StripDeadPrototypes.cpp | 5 ++++- StripSymbols.cpp | 6 +++++- 20 files changed, 85 insertions(+), 10 deletions(-) Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.39 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.40 --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.39 Thu Mar 1 15:00:32 2007 +++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Tue May 1 16:15:46 2007 @@ -63,12 +63,16 @@ } virtual bool runOnSCC(const std::vector &SCC); + static const int ID; // Pass identifcation, replacement for typeid + ArgPromotion() : CallGraphSCCPass((intptr_t)&ID) {} + private: bool PromoteArguments(CallGraphNode *CGN); bool isSafeToPromoteArgument(Argument *Arg) const; Function *DoPromotion(Function *F, std::vector &ArgsToPromote); }; + const int ArgPromotion::ID = 0; RegisterPass X("argpromotion", "Promote 'by reference' arguments to scalars"); } Index: llvm/lib/Transforms/IPO/ConstantMerge.cpp diff -u llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.39 llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.40 --- llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.39 Sat Apr 14 13:06:52 2007 +++ llvm/lib/Transforms/IPO/ConstantMerge.cpp Tue May 1 16:15:46 2007 @@ -29,12 +29,16 @@ namespace { struct VISIBILITY_HIDDEN ConstantMerge : public ModulePass { + static const int ID; // Pass identifcation, replacement for typeid + ConstantMerge() : ModulePass((intptr_t)&ID) {} + // run - For this pass, process all of the globals in the module, // eliminating duplicate constants. // bool runOnModule(Module &M); }; + const int ConstantMerge::ID = 0; RegisterPassX("constmerge","Merge Duplicate Global Constants"); } Index: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.40 llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.41 --- llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.40 Mon Feb 12 20:10:56 2007 +++ llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp Tue May 1 16:15:46 2007 @@ -76,6 +76,8 @@ std::multimap CallSites; public: + static const int ID; // Pass identifcation, replacement for typeid + DAE() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); virtual bool ShouldHackArguments() const { return false; } @@ -93,14 +95,17 @@ void RemoveDeadArgumentsFromFunction(Function *F); }; + const int DAE::ID = 0; RegisterPass X("deadargelim", "Dead Argument Elimination"); /// DAH - DeadArgumentHacking pass - Same as dead argument elimination, but /// deletes arguments to functions which are external. This is only for use /// by bugpoint. struct DAH : public DAE { + static const int ID; virtual bool ShouldHackArguments() const { return true; } }; + const int DAH::ID = 0; RegisterPass Y("deadarghaX0r", "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)"); } Index: llvm/lib/Transforms/IPO/DeadTypeElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.62 llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.63 --- llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.62 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/IPO/DeadTypeElimination.cpp Tue May 1 16:15:46 2007 @@ -26,6 +26,9 @@ namespace { struct VISIBILITY_HIDDEN DTE : public ModulePass { + static const int ID; // Pass identifcation, replacement for typeid + DTE() : ModulePass((intptr_t)&ID) {} + // doPassInitialization - For this pass, it removes global symbol table // entries for primitive types. These are never used for linking in GCC and // they make the output uglier to look at, so we nuke them. @@ -40,6 +43,7 @@ AU.addRequired(); } }; + const int DTE::ID = 0; RegisterPass X("deadtypeelim", "Dead Type Elimination"); } Index: llvm/lib/Transforms/IPO/ExtractFunction.cpp diff -u llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.20 llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.21 --- llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.20 Sat Feb 10 19:08:35 2007 +++ llvm/lib/Transforms/IPO/ExtractFunction.cpp Tue May 1 16:15:46 2007 @@ -25,13 +25,16 @@ bool deleteFunc; bool reLink; public: + static const int ID; // Pass identifcation, replacement for typeid + /// FunctionExtractorPass - If deleteFn is true, this pass deletes as the /// specified function. Otherwise, it deletes as much of the module as /// possible, except for the function specified. /// FunctionExtractorPass(Function *F = 0, bool deleteFn = true, bool relinkCallees = false) - : Named(F), deleteFunc(deleteFn), reLink(relinkCallees) {} + : ModulePass((intptr_t)&ID), Named(F), deleteFunc(deleteFn), + reLink(relinkCallees) {} bool runOnModule(Module &M) { if (Named == 0) { @@ -131,6 +134,7 @@ } }; + const int FunctionExtractorPass::ID = 0; RegisterPass X("extract", "Function Extractor"); } Index: llvm/lib/Transforms/IPO/GlobalDCE.cpp diff -u llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.45 llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.46 --- llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.45 Sun Apr 29 13:02:48 2007 +++ llvm/lib/Transforms/IPO/GlobalDCE.cpp Tue May 1 16:15:46 2007 @@ -30,6 +30,9 @@ namespace { struct VISIBILITY_HIDDEN GlobalDCE : public ModulePass { + static const int ID; // Pass identifcation, replacement for typeid + GlobalDCE() : ModulePass((intptr_t)&ID) {} + // run - Do the GlobalDCE pass on the specified module, optionally updating // the specified callgraph to reflect the changes. // @@ -46,6 +49,7 @@ bool SafeToDestroyConstant(Constant* C); bool RemoveUnusedGlobalValue(GlobalValue &GV); }; + const int GlobalDCE::ID = 0; RegisterPass X("globaldce", "Dead Global Elimination"); } Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.101 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.102 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.101 Thu Apr 12 13:32:50 2007 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Tue May 1 16:15:46 2007 @@ -50,6 +50,8 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); } + static const int ID; // Pass identifcation, replacement for typeid + GlobalOpt() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); @@ -61,6 +63,7 @@ bool ProcessInternalGlobal(GlobalVariable *GV,Module::global_iterator &GVI); }; + const int GlobalOpt::ID = 0; RegisterPass X("globalopt", "Global Variable Optimizer"); } Index: llvm/lib/Transforms/IPO/IPConstantPropagation.cpp diff -u llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.23 llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.24 --- llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.23 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/IPO/IPConstantPropagation.cpp Tue May 1 16:15:46 2007 @@ -33,11 +33,15 @@ /// IPCP - The interprocedural constant propagation pass /// struct VISIBILITY_HIDDEN IPCP : public ModulePass { + static const int ID; // Pass identifcation, replacement for typeid + IPCP() : ModulePass((intptr_t)&ID) {} + bool runOnModule(Module &M); private: bool PropagateConstantsIntoArguments(Function &F); bool PropagateConstantReturn(Function &F); }; + const int IPCP::ID = 0; RegisterPass X("ipconstprop", "Interprocedural constant propagation"); } Index: llvm/lib/Transforms/IPO/IndMemRemoval.cpp diff -u llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.15 llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.16 --- llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.15 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Transforms/IPO/IndMemRemoval.cpp Tue May 1 16:15:46 2007 @@ -32,8 +32,12 @@ namespace { class VISIBILITY_HIDDEN IndMemRemPass : public ModulePass { public: + static const int ID; // Pass identifcation, replacement for typeid + IndMemRemPass() : ModulePass((intptr_t)&ID) {} + virtual bool runOnModule(Module &M); }; + const int IndMemRemPass::ID = 0; RegisterPass X("indmemrem","Indirect Malloc and Free Removal"); } // end anonymous namespace Index: llvm/lib/Transforms/IPO/InlineSimple.cpp diff -u llvm/lib/Transforms/IPO/InlineSimple.cpp:1.78 llvm/lib/Transforms/IPO/InlineSimple.cpp:1.79 --- llvm/lib/Transforms/IPO/InlineSimple.cpp:1.78 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/IPO/InlineSimple.cpp Tue May 1 16:15:46 2007 @@ -54,8 +54,10 @@ class VISIBILITY_HIDDEN SimpleInliner : public Inliner { std::map CachedFunctionInfo; public: + static const int ID; // Pass identifcation, replacement for typeid int getInlineCost(CallSite CS); }; + const int SimpleInliner::ID = 0; RegisterPass X("inline", "Function Integration/Inlining"); } Index: llvm/lib/Transforms/IPO/Inliner.cpp diff -u llvm/lib/Transforms/IPO/Inliner.cpp:1.37 llvm/lib/Transforms/IPO/Inliner.cpp:1.38 --- llvm/lib/Transforms/IPO/Inliner.cpp:1.37 Tue Jan 30 17:28:39 2007 +++ llvm/lib/Transforms/IPO/Inliner.cpp Tue May 1 16:15:46 2007 @@ -36,7 +36,9 @@ cl::desc("Control the amount of inlining to perform (default = 200)")); } -Inliner::Inliner() : InlineThreshold(InlineLimit) {} +const int Inliner::ID = 0; +Inliner::Inliner() + : CallGraphSCCPass((intptr_t)&ID), InlineThreshold(InlineLimit) {} /// getAnalysisUsage - For this class, we declare that we require and preserve /// the call graph. If the derived class implements this method, it should Index: llvm/lib/Transforms/IPO/Inliner.h diff -u llvm/lib/Transforms/IPO/Inliner.h:1.9 llvm/lib/Transforms/IPO/Inliner.h:1.10 --- llvm/lib/Transforms/IPO/Inliner.h:1.9 Tue Jan 30 17:28:39 2007 +++ llvm/lib/Transforms/IPO/Inliner.h Tue May 1 16:15:46 2007 @@ -27,6 +27,7 @@ /// perform the inlining operations that does not depend on the policy. /// struct Inliner : public CallGraphSCCPass { + static const int ID; Inliner(); /// getAnalysisUsage - For this class, we declare that we require and preserve Index: llvm/lib/Transforms/IPO/Internalize.cpp diff -u llvm/lib/Transforms/IPO/Internalize.cpp:1.45 llvm/lib/Transforms/IPO/Internalize.cpp:1.46 --- llvm/lib/Transforms/IPO/Internalize.cpp:1.45 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Transforms/IPO/Internalize.cpp Tue May 1 16:15:46 2007 @@ -46,16 +46,18 @@ std::set ExternalNames; bool DontInternalize; public: + static const int ID; // Pass identifcation, replacement for typeid InternalizePass(bool InternalizeEverything = true); InternalizePass(const std::vector & exportList); void LoadFile(const char *Filename); virtual bool runOnModule(Module &M); }; + const int InternalizePass::ID = 0; RegisterPass X("internalize", "Internalize Global Symbols"); } // end anonymous namespace InternalizePass::InternalizePass(bool InternalizeEverything) - : DontInternalize(false){ + : ModulePass((intptr_t)&ID), DontInternalize(false){ if (!APIFile.empty()) // If a filename is specified, use it LoadFile(APIFile.c_str()); else if (!APIList.empty()) // Else, if a list is specified, use it. @@ -66,7 +68,7 @@ } InternalizePass::InternalizePass(const std::vector&exportList) - : DontInternalize(false){ + : ModulePass((intptr_t)&ID), DontInternalize(false){ for(std::vector::const_iterator itr = exportList.begin(); itr != exportList.end(); itr++) { ExternalNames.insert(*itr); Index: llvm/lib/Transforms/IPO/LoopExtractor.cpp diff -u llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.24 llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.25 --- llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.24 Sat Apr 7 00:31:27 2007 +++ llvm/lib/Transforms/IPO/LoopExtractor.cpp Tue May 1 16:15:46 2007 @@ -34,9 +34,11 @@ // Module passes to require FunctionPasses, so we can't get loop info if we're // not a function pass. struct VISIBILITY_HIDDEN LoopExtractor : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid unsigned NumLoops; - LoopExtractor(unsigned numLoops = ~0) : NumLoops(numLoops) {} + LoopExtractor(unsigned numLoops = ~0) + : FunctionPass((intptr_t)&ID), NumLoops(numLoops) {} virtual bool runOnFunction(Function &F); @@ -49,14 +51,17 @@ } }; + const int LoopExtractor::ID = 0; RegisterPass X("loop-extract", "Extract loops into new functions"); /// SingleLoopExtractor - For bugpoint. struct SingleLoopExtractor : public LoopExtractor { + static const int ID; // Pass identifcation, replacement for typeid SingleLoopExtractor() : LoopExtractor(1) {} }; + const int SingleLoopExtractor::ID = 0; RegisterPass Y("loop-extract-single", "Extract at most one loop into a new function"); } // End anonymous namespace @@ -147,11 +152,15 @@ class BlockExtractorPass : public ModulePass { std::vector BlocksToNotExtract; public: - BlockExtractorPass(std::vector &B) : BlocksToNotExtract(B) {} - BlockExtractorPass() {} + static const int ID; // Pass identifcation, replacement for typeid + BlockExtractorPass(std::vector &B) + : ModulePass((intptr_t)&ID), BlocksToNotExtract(B) {} + BlockExtractorPass() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); }; + + const int BlockExtractorPass::ID = 0; RegisterPass XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)"); } Index: llvm/lib/Transforms/IPO/LowerSetJmp.cpp diff -u llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.40 llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.41 --- llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.40 Mon Feb 12 20:10:56 2007 +++ llvm/lib/Transforms/IPO/LowerSetJmp.cpp Tue May 1 16:15:46 2007 @@ -109,6 +109,9 @@ bool IsTransformableFunction(const std::string& Name); public: + static const int ID; // Pass identifcation, replacement for typeid + LowerSetJmp() : ModulePass((intptr_t)&ID) {} + void visitCallInst(CallInst& CI); void visitInvokeInst(InvokeInst& II); void visitReturnInst(ReturnInst& RI); @@ -118,6 +121,7 @@ bool doInitialization(Module& M); }; + const int LowerSetJmp::ID = 0; RegisterPass X("lowersetjmp", "Lower Set Jump"); } // end anonymous namespace Index: llvm/lib/Transforms/IPO/PruneEH.cpp diff -u llvm/lib/Transforms/IPO/PruneEH.cpp:1.31 llvm/lib/Transforms/IPO/PruneEH.cpp:1.32 --- llvm/lib/Transforms/IPO/PruneEH.cpp:1.31 Mon Feb 12 20:10:56 2007 +++ llvm/lib/Transforms/IPO/PruneEH.cpp Tue May 1 16:15:46 2007 @@ -35,6 +35,9 @@ namespace { struct VISIBILITY_HIDDEN PruneEH : public CallGraphSCCPass { + static const int ID; // Pass identifcation, replacement for typeid + PruneEH() : CallGraphSCCPass((intptr_t)&ID) {} + /// DoesNotUnwind - This set contains all of the functions which we have /// determined cannot unwind. std::set DoesNotUnwind; @@ -49,6 +52,8 @@ bool SimplifyFunction(Function *F); void DeleteBasicBlock(BasicBlock *BB); }; + + const int PruneEH::ID = 0; RegisterPass X("prune-eh", "Remove unused exception handling info"); } Index: llvm/lib/Transforms/IPO/RaiseAllocations.cpp diff -u llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.40 llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.41 --- llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.40 Sun Mar 4 18:00:42 2007 +++ llvm/lib/Transforms/IPO/RaiseAllocations.cpp Tue May 1 16:15:46 2007 @@ -35,7 +35,9 @@ Function *MallocFunc; // Functions in the module we are processing Function *FreeFunc; // Initialized by doPassInitializationVirt public: - RaiseAllocations() : MallocFunc(0), FreeFunc(0) {} + static const int ID; // Pass identifcation, replacement for typeid + RaiseAllocations() + : ModulePass((intptr_t)&ID), MallocFunc(0), FreeFunc(0) {} // doPassInitialization - For the raise allocations pass, this finds a // declaration for malloc and free if they exist. @@ -47,6 +49,7 @@ bool runOnModule(Module &M); }; + const int RaiseAllocations::ID = 0; RegisterPass X("raiseallocs", "Raise allocations from calls to instructions"); } // end anonymous namespace Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.112 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.113 --- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.112 Sun Apr 15 00:38:40 2007 +++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp Tue May 1 16:15:46 2007 @@ -152,6 +152,9 @@ /// @brief A ModulePass for optimizing well-known function calls. class VISIBILITY_HIDDEN SimplifyLibCalls : public ModulePass { public: + static const int ID; // Pass identifcation, replacement for typeid + SimplifyLibCalls() : ModulePass((intptr_t)&ID) {} + /// We need some target data for accurate signature details that are /// target dependent. So we require target data in our AnalysisUsage. /// @brief Require TargetData from AnalysisUsage. @@ -373,6 +376,7 @@ TargetData *TD; ///< Cached TargetData }; +const int SimplifyLibCalls::ID = 0; // Register the pass RegisterPass X("simplify-libcalls", "Simplify well-known library calls"); Index: llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp diff -u llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.5 llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.6 --- llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.5 Sun Feb 18 16:10:58 2007 +++ llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp Tue May 1 16:15:46 2007 @@ -27,9 +27,12 @@ /// @brief Pass to remove unused function declarations. class VISIBILITY_HIDDEN StripDeadPrototypesPass : public ModulePass { public: - StripDeadPrototypesPass() { } + static const int ID; // Pass identifcation, replacement for typeid + StripDeadPrototypesPass() : ModulePass((intptr_t)&ID) { } virtual bool runOnModule(Module &M); }; + +const int StripDeadPrototypesPass::ID = 0; RegisterPass X("strip-dead-prototypes", "Strip Unused Function Prototypes"); Index: llvm/lib/Transforms/IPO/StripSymbols.cpp diff -u llvm/lib/Transforms/IPO/StripSymbols.cpp:1.15 llvm/lib/Transforms/IPO/StripSymbols.cpp:1.16 --- llvm/lib/Transforms/IPO/StripSymbols.cpp:1.15 Sun Feb 11 23:18:08 2007 +++ llvm/lib/Transforms/IPO/StripSymbols.cpp Tue May 1 16:15:47 2007 @@ -37,7 +37,9 @@ class VISIBILITY_HIDDEN StripSymbols : public ModulePass { bool OnlyDebugInfo; public: - StripSymbols(bool ODI = false) : OnlyDebugInfo(ODI) {} + static const int ID; // Pass identifcation, replacement for typeid + StripSymbols(bool ODI = false) + : ModulePass((intptr_t)&ID), OnlyDebugInfo(ODI) {} virtual bool runOnModule(Module &M); @@ -45,6 +47,8 @@ AU.setPreservesAll(); } }; + + const int StripSymbols::ID = 0; RegisterPass X("strip", "Strip all symbols from a module"); } From dpatel at apple.com Tue May 1 16:17:47 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp X86FloatingPoint.cpp Message-ID: <200705012117.l41LHlR2031525@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.133 -> 1.134 X86FloatingPoint.cpp updated: 1.68 -> 1.69 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+10 -2) X86CodeEmitter.cpp | 8 ++++++-- X86FloatingPoint.cpp | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.133 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.134 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.133 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Tue May 1 16:15:46 2007 @@ -39,11 +39,14 @@ MachineCodeEmitter &MCE; bool Is64BitMode; public: + static const int ID; explicit Emitter(TargetMachine &tm, MachineCodeEmitter &mce) - : II(0), TD(0), TM(tm), MCE(mce), Is64BitMode(false) {} + : MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm), + MCE(mce), Is64BitMode(false) {} Emitter(TargetMachine &tm, MachineCodeEmitter &mce, const X86InstrInfo &ii, const TargetData &td, bool is64) - : II(&ii), TD(&td), TM(tm), MCE(mce), Is64BitMode(is64) {} + : MachineFunctionPass((intptr_t)&ID), II(&ii), TD(&td), TM(tm), + MCE(mce), Is64BitMode(is64) {} bool runOnMachineFunction(MachineFunction &MF); @@ -79,6 +82,7 @@ bool isX86_64ExtendedReg(const MachineOperand &MO); unsigned determineREX(const MachineInstr &MI); }; + const int Emitter::ID = 0; } /// createX86CodeEmitterPass - Return a pass that emits the collected X86 code Index: llvm/lib/Target/X86/X86FloatingPoint.cpp diff -u llvm/lib/Target/X86/X86FloatingPoint.cpp:1.68 llvm/lib/Target/X86/X86FloatingPoint.cpp:1.69 --- llvm/lib/Target/X86/X86FloatingPoint.cpp:1.68 Wed Apr 25 17:13:27 2007 +++ llvm/lib/Target/X86/X86FloatingPoint.cpp Tue May 1 16:15:46 2007 @@ -52,6 +52,9 @@ namespace { struct VISIBILITY_HIDDEN FPS : public MachineFunctionPass { + static const int ID; + FPS() : MachineFunctionPass((intptr_t)&ID) {} + virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "X86 FP Stackifier"; } @@ -151,6 +154,7 @@ void handleCondMovFP(MachineBasicBlock::iterator &I); void handleSpecialFP(MachineBasicBlock::iterator &I); }; + const int FPS::ID = 0; } FunctionPass *llvm::createX86FloatingPointStackifierPass() { return new FPS(); } From dpatel at apple.com Tue May 1 16:17:47 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Dominators.cpp Pass.cpp PassManager.cpp Verifier.cpp Message-ID: <200705012117.l41LHlLl031500@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.279 -> 1.280 Dominators.cpp updated: 1.97 -> 1.98 Pass.cpp updated: 1.87 -> 1.88 PassManager.cpp updated: 1.153 -> 1.154 Verifier.cpp updated: 1.209 -> 1.210 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+51 -32) AsmWriter.cpp | 2 ++ Dominators.cpp | 3 +++ Pass.cpp | 29 ++++++++++++++--------------- PassManager.cpp | 25 +++++++++++++++++-------- Verifier.cpp | 24 +++++++++++++++--------- 5 files changed, 51 insertions(+), 32 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.279 llvm/lib/VMCore/AsmWriter.cpp:1.280 --- llvm/lib/VMCore/AsmWriter.cpp:1.279 Sun Apr 29 13:35:00 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Tue May 1 16:15:47 2007 @@ -135,8 +135,10 @@ } // end namespace llvm +const int PrintModulePass::ID = 0; static RegisterPass X("printm", "Print module to stderr"); +const int PrintFunctionPass::ID = 0; static RegisterPass Y("print","Print function to stderr"); Index: llvm/lib/VMCore/Dominators.cpp diff -u llvm/lib/VMCore/Dominators.cpp:1.97 llvm/lib/VMCore/Dominators.cpp:1.98 --- llvm/lib/VMCore/Dominators.cpp:1.97 Fri Apr 20 19:36:45 2007 +++ llvm/lib/VMCore/Dominators.cpp Tue May 1 16:15:47 2007 @@ -58,6 +58,7 @@ // //===----------------------------------------------------------------------===// +const int DominatorTree::ID = 0; static RegisterPass E("domtree", "Dominator Tree Construction", true); @@ -353,6 +354,7 @@ // DominanceFrontier Implementation //===----------------------------------------------------------------------===// +const int DominanceFrontier::ID = 0; static RegisterPass G("domfrontier", "Dominance Frontier Construction", true); @@ -833,6 +835,7 @@ // ETForest implementation //===----------------------------------------------------------------------===// +const int ETForest::ID = 0; static RegisterPass D("etforest", "ET Forest Construction", true); Index: llvm/lib/VMCore/Pass.cpp diff -u llvm/lib/VMCore/Pass.cpp:1.87 llvm/lib/VMCore/Pass.cpp:1.88 --- llvm/lib/VMCore/Pass.cpp:1.87 Thu Apr 26 16:33:42 2007 +++ llvm/lib/VMCore/Pass.cpp Tue May 1 16:15:47 2007 @@ -133,7 +133,7 @@ class PassRegistrar { /// PassInfoMap - Keep track of the passinfo object for each registered llvm /// pass. - std::map PassInfoMap; + std::map PassInfoMap; /// AnalysisGroupInfo - Keep track of information for each analysis group. struct AnalysisGroupInfo { @@ -147,19 +147,19 @@ public: - const PassInfo *GetPassInfo(const std::type_info &TI) const { - std::map::const_iterator I = PassInfoMap.find(TI); + const PassInfo *GetPassInfo(intptr_t TI) const { + std::map::const_iterator I = PassInfoMap.find(TI); return I != PassInfoMap.end() ? I->second : 0; } void RegisterPass(PassInfo &PI) { bool Inserted = - PassInfoMap.insert(std::make_pair(TypeInfo(PI.getTypeInfo()),&PI)).second; + PassInfoMap.insert(std::make_pair(PI.getTypeInfo(),&PI)).second; assert(Inserted && "Pass registered multiple times!"); } void UnregisterPass(PassInfo &PI) { - std::map::iterator I = + std::map::iterator I = PassInfoMap.find(PI.getTypeInfo()); assert(I != PassInfoMap.end() && "Pass registered but not in map!"); @@ -168,7 +168,7 @@ } void EnumerateWith(PassRegistrationListener *L) { - for (std::map::const_iterator I = PassInfoMap.begin(), + for (std::map::const_iterator I = PassInfoMap.begin(), E = PassInfoMap.end(); I != E; ++I) L->passEnumerate(I->second); } @@ -210,11 +210,10 @@ // getPassInfo - Return the PassInfo data structure that corresponds to this // pass... const PassInfo *Pass::getPassInfo() const { - if (PassInfoCache) return PassInfoCache; - return lookupPassInfo(typeid(*this)); + return lookupPassInfo(PassID); } -const PassInfo *Pass::lookupPassInfo(const std::type_info &TI) { +const PassInfo *Pass::lookupPassInfo(intptr_t TI) { return getPassRegistrar()->GetPassInfo(TI); } @@ -238,12 +237,12 @@ // RegisterAGBase implementation // -RegisterAGBase::RegisterAGBase(const std::type_info &Interface, - const std::type_info *Pass, bool isDefault) - : RegisterPassBase(Interface), +RegisterAGBase::RegisterAGBase(intptr_t InterfaceID, + intptr_t PassID, bool isDefault) + : RegisterPassBase(InterfaceID), ImplementationInfo(0), isDefaultImplementation(isDefault) { - InterfaceInfo = const_cast(Pass::lookupPassInfo(Interface)); + InterfaceInfo = const_cast(Pass::lookupPassInfo(InterfaceID)); if (InterfaceInfo == 0) { // First reference to Interface, register it now. registerPass(); @@ -252,8 +251,8 @@ assert(PIObj.isAnalysisGroup() && "Trying to join an analysis group that is a normal pass!"); - if (Pass) { - ImplementationInfo = Pass::lookupPassInfo(*Pass); + if (PassID) { + ImplementationInfo = Pass::lookupPassInfo(PassID); assert(ImplementationInfo && "Must register pass before adding to AnalysisGroup!"); Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.153 llvm/lib/VMCore/PassManager.cpp:1.154 --- llvm/lib/VMCore/PassManager.cpp:1.153 Thu Apr 26 12:50:19 2007 +++ llvm/lib/VMCore/PassManager.cpp Tue May 1 16:15:47 2007 @@ -63,7 +63,9 @@ public FunctionPass { public: - BBPassManager(int Depth) : PMDataManager(Depth) { } + static const int ID; + BBPassManager(int Depth) + : PMDataManager(Depth), FunctionPass((intptr_t)&ID) {} /// Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the function, and if so, return true. @@ -104,6 +106,7 @@ } }; +const int BBPassManager::ID = 0; } namespace llvm { @@ -116,9 +119,10 @@ public PMDataManager, public PMTopLevelManager { public: - - FunctionPassManagerImpl(int Depth) : PMDataManager(Depth), - PMTopLevelManager(TLM_Function) { } + static const int ID; + FunctionPassManagerImpl(int Depth) : + Pass((intptr_t)&ID), PMDataManager(Depth), + PMTopLevelManager(TLM_Function) { } /// add - Add a pass to the queue of passes to run. This passes ownership of /// the Pass to the PassManager. When the PassManager is destroyed, the pass @@ -167,9 +171,9 @@ FPPassManager *FP = static_cast(PassManagers[N]); return FP; } - }; +const int FunctionPassManagerImpl::ID = 0; //===----------------------------------------------------------------------===// // MPPassManager // @@ -179,7 +183,8 @@ class MPPassManager : public Pass, public PMDataManager { public: - MPPassManager(int Depth) : PMDataManager(Depth) { } + static const int ID; + MPPassManager(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth) { } // Delete on the fly managers. virtual ~MPPassManager() { @@ -242,17 +247,19 @@ std::map OnTheFlyManagers; }; +const int MPPassManager::ID = 0; //===----------------------------------------------------------------------===// // PassManagerImpl // + /// PassManagerImpl manages MPPassManagers class PassManagerImpl : public Pass, public PMDataManager, public PMTopLevelManager { public: - - PassManagerImpl(int Depth) : PMDataManager(Depth), + static const int ID; + PassManagerImpl(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth), PMTopLevelManager(TLM_Pass) { } /// add - Add a pass to the queue of passes to run. This passes ownership of @@ -297,6 +304,7 @@ }; +const int PassManagerImpl::ID = 0; } // End of llvm namespace namespace { @@ -1100,6 +1108,7 @@ //===----------------------------------------------------------------------===// // FPPassManager implementation +const int FPPassManager::ID = 0; /// Print passes managed by this manager void FPPassManager::dumpPassStructure(unsigned Offset) { llvm::cerr << std::string(Offset*2, ' ') << "FunctionPass Manager\n"; Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.209 llvm/lib/VMCore/Verifier.cpp:1.210 --- llvm/lib/VMCore/Verifier.cpp:1.209 Sun Apr 29 13:02:48 2007 +++ llvm/lib/VMCore/Verifier.cpp Tue May 1 16:15:47 2007 @@ -69,6 +69,7 @@ struct VISIBILITY_HIDDEN Verifier : public FunctionPass, InstVisitor { + static const int ID; // Pass ID, replacement for typeid bool Broken; // Is this module found to be broken? bool RealPass; // Are we not being run by a PassManager? VerifierFailureAction action; @@ -84,18 +85,22 @@ SmallPtrSet InstsInThisBlock; Verifier() - : Broken(false), RealPass(true), action(AbortProcessAction), - EF(0), msgs( std::ios::app | std::ios::out ) {} + : FunctionPass((intptr_t)&ID), + Broken(false), RealPass(true), action(AbortProcessAction), + EF(0), msgs( std::ios::app | std::ios::out ) {} Verifier( VerifierFailureAction ctn ) - : Broken(false), RealPass(true), action(ctn), EF(0), - msgs( std::ios::app | std::ios::out ) {} + : FunctionPass((intptr_t)&ID), + Broken(false), RealPass(true), action(ctn), EF(0), + msgs( std::ios::app | std::ios::out ) {} Verifier(bool AB ) - : Broken(false), RealPass(true), - action( AB ? AbortProcessAction : PrintMessageAction), EF(0), - msgs( std::ios::app | std::ios::out ) {} + : FunctionPass((intptr_t)&ID), + Broken(false), RealPass(true), + action( AB ? AbortProcessAction : PrintMessageAction), EF(0), + msgs( std::ios::app | std::ios::out ) {} Verifier(ETForest &ef) - : Broken(false), RealPass(false), action(PrintMessageAction), - EF(&ef), msgs( std::ios::app | std::ios::out ) {} + : FunctionPass((intptr_t)&ID), + Broken(false), RealPass(false), action(PrintMessageAction), + EF(&ef), msgs( std::ios::app | std::ios::out ) {} bool doInitialization(Module &M) { @@ -261,6 +266,7 @@ } }; + const int Verifier::ID = 0; RegisterPass X("verify", "Module Verifier"); } // End anonymous namespace From dpatel at apple.com Tue May 1 16:17:50 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp BasicBlockPlacement.cpp CodeGenPrepare.cpp CondPropagate.cpp ConstantProp.cpp CorrelatedExprs.cpp DCE.cpp DeadStoreElimination.cpp GCSE.cpp IndVarSimplify.cpp InstructionCombining.cpp LICM.cpp LoopRotation.cpp LoopStrengthReduce.cpp LoopUnroll.cpp LoopUnswitch.cpp LowerGC.cpp LowerPacked.cpp PredicateSimplifier.cpp Reassociate.cpp Reg2Mem.cpp SCCP.cpp ScalarReplAggregates.cpp SimplifyCFG.cpp TailDuplication.cpp TailRecursionElimination.cpp Message-ID: <200705012117.l41LHoiA031581@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.106 -> 1.107 BasicBlockPlacement.cpp updated: 1.9 -> 1.10 CodeGenPrepare.cpp updated: 1.6 -> 1.7 CondPropagate.cpp updated: 1.18 -> 1.19 ConstantProp.cpp updated: 1.56 -> 1.57 CorrelatedExprs.cpp updated: 1.57 -> 1.58 DCE.cpp updated: 1.63 -> 1.64 DeadStoreElimination.cpp updated: 1.17 -> 1.18 GCSE.cpp updated: 1.53 -> 1.54 IndVarSimplify.cpp updated: 1.115 -> 1.116 InstructionCombining.cpp updated: 1.754 -> 1.755 LICM.cpp updated: 1.96 -> 1.97 LoopRotation.cpp updated: 1.10 -> 1.11 LoopStrengthReduce.cpp updated: 1.131 -> 1.132 LoopUnroll.cpp updated: 1.39 -> 1.40 LoopUnswitch.cpp updated: 1.65 -> 1.66 LowerGC.cpp updated: 1.22 -> 1.23 LowerPacked.cpp updated: 1.21 -> 1.22 PredicateSimplifier.cpp updated: 1.71 -> 1.72 Reassociate.cpp updated: 1.78 -> 1.79 Reg2Mem.cpp updated: 1.12 -> 1.13 SCCP.cpp updated: 1.165 -> 1.166 ScalarReplAggregates.cpp updated: 1.90 -> 1.91 SimplifyCFG.cpp updated: 1.21 -> 1.22 TailDuplication.cpp updated: 1.37 -> 1.38 TailRecursionElimination.cpp updated: 1.30 -> 1.31 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+114 -5) ADCE.cpp | 4 ++++ BasicBlockPlacement.cpp | 4 ++++ CodeGenPrepare.cpp | 6 +++++- CondPropagate.cpp | 5 +++++ ConstantProp.cpp | 4 ++++ CorrelatedExprs.cpp | 5 +++++ DCE.cpp | 7 +++++++ DeadStoreElimination.cpp | 3 +++ GCSE.cpp | 4 ++++ IndVarSimplify.cpp | 7 ++++++- InstructionCombining.cpp | 4 ++++ LICM.cpp | 4 ++++ LoopRotation.cpp | 5 ++++- LoopStrengthReduce.cpp | 5 ++++- LoopUnroll.cpp | 4 ++++ LoopUnswitch.cpp | 4 ++++ LowerGC.cpp | 5 ++++- LowerPacked.cpp | 4 ++++ PredicateSimplifier.cpp | 4 ++++ Reassociate.cpp | 4 ++++ Reg2Mem.cpp | 3 +++ SCCP.cpp | 7 +++++++ ScalarReplAggregates.cpp | 4 ++++ SimplifyCFG.cpp | 4 ++++ TailDuplication.cpp | 5 +++++ TailRecursionElimination.cpp | 4 ++++ 26 files changed, 114 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.106 llvm/lib/Transforms/Scalar/ADCE.cpp:1.107 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.106 Wed Apr 18 01:46:57 2007 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Tue May 1 16:15:47 2007 @@ -52,6 +52,9 @@ // The public interface for this class // public: + static const int ID; // Pass identifcation, replacement for typeid + ADCE() : FunctionPass((intptr_t)&ID) {} + // Execute the Aggressive Dead Code Elimination Algorithm // virtual bool runOnFunction(Function &F) { @@ -104,6 +107,7 @@ } }; + const int ADCE::ID = 0; RegisterPass X("adce", "Aggressive Dead Code Elimination"); } // End of anonymous namespace Index: llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp diff -u llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.9 llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.10 --- llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.9 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp Tue May 1 16:15:47 2007 @@ -41,6 +41,9 @@ namespace { struct VISIBILITY_HIDDEN BlockPlacement : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + BlockPlacement() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -70,6 +73,7 @@ void PlaceBlocks(BasicBlock *BB); }; + const int BlockPlacement::ID = 0; RegisterPass X("block-placement", "Profile Guided Basic Block Placement"); } Index: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp diff -u llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.6 llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.7 --- llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.6 Tue Apr 24 19:37:04 2007 +++ llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp Tue May 1 16:15:47 2007 @@ -39,7 +39,9 @@ /// transformation profitability. const TargetLowering *TLI; public: - CodeGenPrepare(const TargetLowering *tli = 0) : TLI(tli) {} + static const int ID; // Pass identifcation, replacement for typeid + CodeGenPrepare(const TargetLowering *tli = 0) : FunctionPass((intptr_t)&ID), + TLI(tli) {} bool runOnFunction(Function &F); private: @@ -52,6 +54,8 @@ DenseMap &SunkAddrs); }; } + +const int CodeGenPrepare::ID = 0; static RegisterPass X("codegenprepare", "Optimize for code generation"); Index: llvm/lib/Transforms/Scalar/CondPropagate.cpp diff -u llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.18 llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.19 --- llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.18 Thu Mar 1 18:28:52 2007 +++ llvm/lib/Transforms/Scalar/CondPropagate.cpp Tue May 1 16:15:47 2007 @@ -31,6 +31,9 @@ namespace { struct VISIBILITY_HIDDEN CondProp : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + CondProp() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -45,6 +48,8 @@ void SimplifyPredecessors(SwitchInst *SI); void RevectorBlockTo(BasicBlock *FromBB, BasicBlock *ToBB); }; + + const int CondProp::ID = 0; RegisterPass X("condprop", "Conditional Propagation"); } Index: llvm/lib/Transforms/Scalar/ConstantProp.cpp diff -u llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.56 llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.57 --- llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.56 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/Scalar/ConstantProp.cpp Tue May 1 16:15:47 2007 @@ -34,6 +34,9 @@ namespace { struct VISIBILITY_HIDDEN ConstantPropagation : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + ConstantPropagation() : FunctionPass((intptr_t)&ID) {} + bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -41,6 +44,7 @@ } }; + const int ConstantPropagation::ID = 0; RegisterPass X("constprop", "Simple constant propagation"); } Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.57 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.58 --- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.57 Wed Apr 18 00:25:43 2007 +++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp Tue May 1 16:15:47 2007 @@ -225,6 +225,9 @@ std::map RegionInfoMap; ETForest *EF; public: + static const int ID; // Pass identifcation, replacement for typeid + CEE() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F); // We don't modify the program, so we preserve all analyses @@ -284,6 +287,8 @@ bool SimplifyBasicBlock(BasicBlock &BB, const RegionInfo &RI); bool SimplifyInstruction(Instruction *Inst, const RegionInfo &RI); }; + + const int CEE::ID = 0; RegisterPass X("cee", "Correlated Expression Elimination"); } Index: llvm/lib/Transforms/Scalar/DCE.cpp diff -u llvm/lib/Transforms/Scalar/DCE.cpp:1.63 llvm/lib/Transforms/Scalar/DCE.cpp:1.64 --- llvm/lib/Transforms/Scalar/DCE.cpp:1.63 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/Scalar/DCE.cpp Tue May 1 16:15:47 2007 @@ -35,6 +35,8 @@ // DeadInstElimination pass implementation // struct VISIBILITY_HIDDEN DeadInstElimination : public BasicBlockPass { + static const int ID; // Pass identifcation, replacement for typeid + DeadInstElimination() : BasicBlockPass(intptr_t(&ID)) {} virtual bool runOnBasicBlock(BasicBlock &BB) { bool Changed = false; for (BasicBlock::iterator DI = BB.begin(); DI != BB.end(); ) @@ -51,6 +53,7 @@ } }; + const int DeadInstElimination::ID = 0; RegisterPass X("die", "Dead Instruction Elimination"); } @@ -64,6 +67,9 @@ // DeadCodeElimination pass implementation // struct DCE : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + DCE() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -71,6 +77,7 @@ } }; + const int DCE::ID = 0; RegisterPass Y("dce", "Dead Code Elimination"); } Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp diff -u llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.17 llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.18 --- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.17 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue May 1 16:15:47 2007 @@ -34,6 +34,8 @@ namespace { struct VISIBILITY_HIDDEN DSE : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + DSE() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { bool Changed = false; @@ -56,6 +58,7 @@ AU.addPreserved(); } }; + const int DSE::ID = 0; RegisterPass X("dse", "Dead Store Elimination"); } Index: llvm/lib/Transforms/Scalar/GCSE.cpp diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.53 llvm/lib/Transforms/Scalar/GCSE.cpp:1.54 --- llvm/lib/Transforms/Scalar/GCSE.cpp:1.53 Sat Apr 14 18:32:02 2007 +++ llvm/lib/Transforms/Scalar/GCSE.cpp Tue May 1 16:15:47 2007 @@ -37,6 +37,9 @@ "with constant values"); namespace { struct VISIBILITY_HIDDEN GCSE : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + GCSE() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F); private: @@ -51,6 +54,7 @@ } }; + const int GCSE::ID = 0; RegisterPass X("gcse", "Global Common Subexpression Elimination"); } Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.115 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.116 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.115 Wed Mar 7 00:39:01 2007 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Tue May 1 16:15:47 2007 @@ -68,7 +68,10 @@ ScalarEvolution *SE; bool Changed; public: - + + static const int ID; // Pass identifcation, replacement for typeid + IndVarSimplify() : LoopPass((intptr_t)&ID) {} + bool runOnLoop(Loop *L, LPPassManager &LPM); bool doInitialization(Loop *L, LPPassManager &LPM); virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -91,6 +94,8 @@ void DeleteTriviallyDeadInstructions(std::set &Insts); }; + + const int IndVarSimplify::ID = 0; RegisterPass X("indvars", "Canonicalize Induction Variables"); } Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.754 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.755 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.754 Sat Apr 28 00:27:36 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue May 1 16:15:47 2007 @@ -76,6 +76,9 @@ TargetData *TD; bool MustPreserveLCSSA; public: + static const int ID; // Pass identifcation, replacement for typeid + InstCombiner() : FunctionPass((intptr_t)&ID) {} + /// AddToWorkList - Add the specified instruction to the worklist if it /// isn't already in it. void AddToWorkList(Instruction *I) { @@ -358,6 +361,7 @@ Value *EvaluateInDifferentType(Value *V, const Type *Ty, bool isSigned); }; + const int InstCombiner::ID = 0; RegisterPass X("instcombine", "Combine redundant instructions"); } Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.96 llvm/lib/Transforms/Scalar/LICM.cpp:1.97 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.96 Wed Apr 25 13:32:35 2007 +++ llvm/lib/Transforms/Scalar/LICM.cpp Tue May 1 16:15:47 2007 @@ -63,6 +63,9 @@ cl::desc("Disable memory promotion in LICM pass")); struct VISIBILITY_HIDDEN LICM : public LoopPass { + static const int ID; // Pass identifcation, replacement for typeid + LICM() : LoopPass((intptr_t)&ID) {} + virtual bool runOnLoop(Loop *L, LPPassManager &LPM); /// This transformation requires natural loop information & requires that @@ -201,6 +204,7 @@ std::map &Val2AlMap); }; + const int LICM::ID = 0; RegisterPass X("licm", "Loop Invariant Code Motion"); } Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.10 llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.11 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.10 Sat Apr 14 18:32:02 2007 +++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Tue May 1 16:15:47 2007 @@ -44,7 +44,9 @@ class VISIBILITY_HIDDEN LoopRotate : public LoopPass { public: - + static const int ID; // Pass ID, replacement for typeid + LoopRotate() : LoopPass((intptr_t)&ID) {} + // Rotate Loop L as many times as possible. Return true if // loop is rotated at least once. bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -92,6 +94,7 @@ SmallVector LoopHeaderInfo; }; + const int LoopRotate::ID = 0; RegisterPass X ("loop-rotate", "Rotate Loops"); } Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.131 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.132 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.131 Mon Apr 23 17:42:03 2007 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue May 1 16:15:47 2007 @@ -143,7 +143,9 @@ const TargetLowering *TLI; public: - LoopStrengthReduce(const TargetLowering *tli = NULL) : TLI(tli) { + static const int ID; // Pass ID, replacement for typeid + LoopStrengthReduce(const TargetLowering *tli = NULL) : + LoopPass((intptr_t)&ID), TLI(tli) { } bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -186,6 +188,7 @@ Loop *L, bool isOnlyStride); void DeleteTriviallyDeadInstructions(std::set &Insts); }; + const int LoopStrengthReduce::ID = 0; RegisterPass X("loop-reduce", "Loop Strength Reduction"); } Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.39 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.40 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.39 Mon Apr 16 18:03:45 2007 +++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Tue May 1 16:15:47 2007 @@ -49,6 +49,9 @@ class VISIBILITY_HIDDEN LoopUnroll : public LoopPass { LoopInfo *LI; // The current loop information public: + static const int ID; // Pass ID, replacement for typeid + LoopUnroll() : LoopPass((intptr_t)&ID) {} + bool runOnLoop(Loop *L, LPPassManager &LPM); BasicBlock* FoldBlockIntoPredecessor(BasicBlock* BB); @@ -63,6 +66,7 @@ AU.addPreserved(); } }; + const int LoopUnroll::ID = 0; RegisterPass X("loop-unroll", "Unroll loops"); } Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.65 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.66 --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.65 Tue Mar 6 18:26:10 2007 +++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Tue May 1 16:15:47 2007 @@ -69,6 +69,9 @@ SmallPtrSet UnswitchedVals; public: + static const int ID; // Pass ID, replacement for typeid + LoopUnswitch() : LoopPass((intptr_t)&ID) {} + bool runOnLoop(Loop *L, LPPassManager &LPM); /// This transformation requires natural loop information & requires that @@ -109,6 +112,7 @@ std::vector &Worklist); void RemoveLoopFromHierarchy(Loop *L); }; + const int LoopUnswitch::ID = 0; RegisterPass X("loop-unswitch", "Unswitch loops"); } Index: llvm/lib/Transforms/Scalar/LowerGC.cpp diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.22 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.23 --- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.22 Mon Feb 12 20:10:56 2007 +++ llvm/lib/Transforms/Scalar/LowerGC.cpp Tue May 1 16:15:47 2007 @@ -47,7 +47,9 @@ /// had zero roots. const Type *MainRootRecordType; public: - LowerGC() : GCRootInt(0), GCReadInt(0), GCWriteInt(0), + static const int ID; // Pass identifcation, replacement for typeid + LowerGC() : FunctionPass((intptr_t)&ID), + GCRootInt(0), GCReadInt(0), GCWriteInt(0), GCRead(0), GCWrite(0), RootChain(0), MainRootRecordType(0) {} virtual bool doInitialization(Module &M); virtual bool runOnFunction(Function &F); @@ -56,6 +58,7 @@ const StructType *getRootRecordType(unsigned NumRoots); }; + const int LowerGC::ID = 0; RegisterPass X("lowergc", "Lower GC intrinsics, for GCless code generators"); } Index: llvm/lib/Transforms/Scalar/LowerPacked.cpp diff -u llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.21 llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.22 --- llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.21 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Transforms/Scalar/LowerPacked.cpp Tue May 1 16:15:47 2007 @@ -40,6 +40,9 @@ class VISIBILITY_HIDDEN LowerPacked : public FunctionPass, public InstVisitor { public: + static const int ID; // Pass identifcation, replacement for typeid + LowerPacked() : FunctionPass((intptr_t)&ID) {} + /// @brief Lowers packed operations to scalar operations. /// @param F The fuction to process virtual bool runOnFunction(Function &F); @@ -104,6 +107,7 @@ std::vector instrsToRemove; }; +const int LowerPacked::ID = 0; RegisterPass X("lower-packed", "lowers packed operations to operations on smaller packed datatypes"); Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.71 llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.72 --- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.71 Thu Apr 26 11:42:07 2007 +++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp Tue May 1 16:15:47 2007 @@ -1989,6 +1989,9 @@ std::vector WorkList; public: + static const int ID; // Pass identifcation, replacement for typeid + PredicateSimplifier() : FunctionPass((intptr_t)&ID) {} + bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -2374,6 +2377,7 @@ } } + const int PredicateSimplifier::ID = 0; RegisterPass X("predsimplify", "Predicate Simplifier"); } Index: llvm/lib/Transforms/Scalar/Reassociate.cpp diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.78 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.79 --- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.78 Thu Mar 1 18:28:52 2007 +++ llvm/lib/Transforms/Scalar/Reassociate.cpp Tue May 1 16:15:47 2007 @@ -69,6 +69,9 @@ std::map ValueRankMap; bool MadeChange; public: + static const int ID; // Pass identifcation, replacement for typeid + Reassociate() : FunctionPass((intptr_t)&ID) {} + bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -89,6 +92,7 @@ void RemoveDeadBinaryOp(Value *V); }; + const int Reassociate::ID = 0; RegisterPass X("reassociate", "Reassociate expressions"); } Index: llvm/lib/Transforms/Scalar/Reg2Mem.cpp diff -u llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.12 llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.13 --- llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.12 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Transforms/Scalar/Reg2Mem.cpp Tue May 1 16:15:47 2007 @@ -33,6 +33,8 @@ namespace { struct VISIBILITY_HIDDEN RegToMem : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + RegToMem() : FunctionPass((intptr_t)&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(BreakCriticalEdgesID); @@ -76,6 +78,7 @@ } }; + const int RegToMem::ID = 0; RegisterPass X("reg2mem", "Demote all values to stack slots"); } Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.165 llvm/lib/Transforms/Scalar/SCCP.cpp:1.166 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.165 Sat Apr 14 18:32:02 2007 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Tue May 1 16:15:47 2007 @@ -1334,6 +1334,9 @@ /// Sparse Conditional Constant Propagator. /// struct VISIBILITY_HIDDEN SCCP : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + SCCP() : FunctionPass((intptr_t)&ID) {} + // runOnFunction - Run the Sparse Conditional Constant Propagation // algorithm, and return true if the function was modified. // @@ -1344,6 +1347,7 @@ } }; + const int SCCP::ID = 0; RegisterPass X("sccp", "Sparse Conditional Constant Propagation"); } // end anonymous namespace @@ -1443,9 +1447,12 @@ /// Constant Propagation. /// struct VISIBILITY_HIDDEN IPSCCP : public ModulePass { + static const int ID; + IPSCCP() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); }; + const int IPSCCP::ID = 0; RegisterPass Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation"); } // end anonymous namespace Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.90 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.91 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.90 Wed Apr 25 13:32:35 2007 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue May 1 16:15:47 2007 @@ -47,6 +47,9 @@ namespace { struct VISIBILITY_HIDDEN SROA : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + SROA() : FunctionPass((intptr_t)&ID) {} + bool runOnFunction(Function &F); bool performScalarRepl(Function &F); @@ -81,6 +84,7 @@ static Instruction *isOnlyCopiedFromConstantGlobal(AllocationInst *AI); }; + const int SROA::ID = 0; RegisterPass X("scalarrepl", "Scalar Replacement of Aggregates"); } Index: llvm/lib/Transforms/Scalar/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.21 llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.22 --- llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.21 Wed Apr 4 20:27:02 2007 +++ llvm/lib/Transforms/Scalar/SimplifyCFG.cpp Tue May 1 16:15:47 2007 @@ -35,8 +35,12 @@ namespace { struct VISIBILITY_HIDDEN CFGSimplifyPass : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + CFGSimplifyPass() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F); }; + const int CFGSimplifyPass::ID = 0; RegisterPass X("simplifycfg", "Simplify the CFG"); } Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp diff -u llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.37 llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.38 --- llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.37 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/Scalar/TailDuplication.cpp Tue May 1 16:15:47 2007 @@ -42,10 +42,15 @@ cl::init(6), cl::Hidden); class VISIBILITY_HIDDEN TailDup : public FunctionPass { bool runOnFunction(Function &F); + public: + static const int ID; // Pass identifcation, replacement for typeid + TailDup() : FunctionPass((intptr_t)&ID) {} + private: inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI); inline void eliminateUnconditionalBranch(BranchInst *BI); }; + const int TailDup::ID = 0; RegisterPass X("tailduplicate", "Tail Duplication"); } Index: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp diff -u llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.30 llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.31 --- llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.30 Thu Mar 22 11:38:57 2007 +++ llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp Tue May 1 16:15:47 2007 @@ -67,6 +67,9 @@ namespace { struct VISIBILITY_HIDDEN TailCallElim : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + TailCallElim() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F); private: @@ -77,6 +80,7 @@ bool CanMoveAboveCall(Instruction *I, CallInst *CI); Value *CanTransformAccumulatorRecursion(Instruction *I, CallInst *CI); }; + const int TailCallElim::ID = 0; RegisterPass X("tailcallelim", "Tail Call Elimination"); } From dpatel at apple.com Tue May 1 16:17:57 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64Bundling.cpp Message-ID: <200705012117.l41LHvZb031590@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64Bundling.cpp updated: 1.8 -> 1.9 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+4 -1) IA64Bundling.cpp | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/lib/Target/IA64/IA64Bundling.cpp diff -u llvm/lib/Target/IA64/IA64Bundling.cpp:1.8 llvm/lib/Target/IA64/IA64Bundling.cpp:1.9 --- llvm/lib/Target/IA64/IA64Bundling.cpp:1.8 Mon Apr 16 13:10:23 2007 +++ llvm/lib/Target/IA64/IA64Bundling.cpp Tue May 1 16:15:46 2007 @@ -36,12 +36,14 @@ namespace { struct IA64BundlingPass : public MachineFunctionPass { + static const int ID; /// Target machine description which we query for reg. names, data /// layout, etc. /// IA64TargetMachine &TM; - IA64BundlingPass(IA64TargetMachine &tm) : TM(tm) { } + IA64BundlingPass(IA64TargetMachine &tm) + : MachineFunctionPass((intptr_t)&ID), TM(tm) { } virtual const char *getPassName() const { return "IA64 (Itanium) Bundling Pass"; @@ -61,6 +63,7 @@ // 'fallthrough' code std::set PendingRegWrites; }; + const int IA64BundlingPass::ID = 0; } // end of anonymous namespace /// createIA64BundlingPass - Returns a pass that adds STOP (;;) instructions From dpatel at apple.com Tue May 1 16:17:57 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200705012117.l41LHvjF031619@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.338 -> 1.339 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+12 -2) CBackend.cpp | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.338 llvm/lib/Target/CBackend/CBackend.cpp:1.339 --- llvm/lib/Target/CBackend/CBackend.cpp:1.338 Tue Apr 17 04:20:00 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Tue May 1 16:15:46 2007 @@ -56,6 +56,10 @@ /// external functions with the same name. /// class CBackendNameAllUsedStructsAndMergeFunctions : public ModulePass { + public: + static const int ID; + CBackendNameAllUsedStructsAndMergeFunctions() + : ModulePass((intptr_t)&ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); } @@ -67,6 +71,8 @@ virtual bool runOnModule(Module &M); }; + const int CBackendNameAllUsedStructsAndMergeFunctions::ID = 0; + /// CWriter - This class is the main chunk of code that converts an LLVM /// module to a C translation unit. class CWriter : public FunctionPass, public InstVisitor { @@ -82,8 +88,10 @@ std::set intrinsicPrototypesAlreadyGenerated; public: - CWriter(std::ostream &o) : Out(o), IL(0), Mang(0), LI(0), TheModule(0), - TAsm(0), TD(0) {} + static const int ID; + CWriter(std::ostream &o) + : FunctionPass((intptr_t)&ID), Out(o), IL(0), Mang(0), LI(0), + TheModule(0), TAsm(0), TD(0) {} virtual const char *getPassName() const { return "C backend"; } @@ -256,6 +264,8 @@ }; } +const int CWriter::ID = 0; + /// This method inserts names for any unnamed structure types that are used by /// the program, and removes names from structure types that are not used by the /// program. From dpatel at apple.com Tue May 1 16:17:58 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp BranchFolding.cpp ELFWriter.cpp ELFWriter.h LiveIntervalAnalysis.cpp LiveVariables.cpp MachOWriter.cpp MachOWriter.h MachineFunction.cpp MachineModuleInfo.cpp PHIElimination.cpp PrologEpilogInserter.cpp RegAllocLinearScan.cpp RegAllocLocal.cpp RegAllocSimple.cpp TwoAddressInstructionPass.cpp UnreachableBlockElim.cpp Message-ID: <200705012117.l41LHwOW031630@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.160 -> 1.161 BranchFolding.cpp updated: 1.46 -> 1.47 ELFWriter.cpp updated: 1.38 -> 1.39 ELFWriter.h updated: 1.1 -> 1.2 LiveIntervalAnalysis.cpp updated: 1.239 -> 1.240 LiveVariables.cpp updated: 1.79 -> 1.80 MachOWriter.cpp updated: 1.32 -> 1.33 MachOWriter.h updated: 1.3 -> 1.4 MachineFunction.cpp updated: 1.111 -> 1.112 MachineModuleInfo.cpp updated: 1.5 -> 1.6 PHIElimination.cpp updated: 1.57 -> 1.58 PrologEpilogInserter.cpp updated: 1.84 -> 1.85 RegAllocLinearScan.cpp updated: 1.145 -> 1.146 RegAllocLocal.cpp updated: 1.102 -> 1.103 RegAllocSimple.cpp updated: 1.83 -> 1.84 TwoAddressInstructionPass.cpp updated: 1.47 -> 1.48 UnreachableBlockElim.cpp updated: 1.9 -> 1.10 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+64 -7) AsmPrinter.cpp | 3 ++- BranchFolding.cpp | 4 ++++ ELFWriter.cpp | 4 +++- ELFWriter.h | 2 ++ LiveIntervalAnalysis.cpp | 1 + LiveVariables.cpp | 1 + MachOWriter.cpp | 4 +++- MachOWriter.h | 1 + MachineFunction.cpp | 11 +++++++++-- MachineModuleInfo.cpp | 9 ++++++++- PHIElimination.cpp | 4 ++++ PrologEpilogInserter.cpp | 4 ++++ RegAllocLinearScan.cpp | 4 ++++ RegAllocLocal.cpp | 5 +++++ RegAllocSimple.cpp | 6 +++++- TwoAddressInstructionPass.cpp | 4 ++++ UnreachableBlockElim.cpp | 4 ++++ 17 files changed, 64 insertions(+), 7 deletions(-) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.160 llvm/lib/CodeGen/AsmPrinter.cpp:1.161 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.160 Mon Apr 30 12:00:18 2007 +++ llvm/lib/CodeGen/AsmPrinter.cpp Tue May 1 16:15:46 2007 @@ -32,9 +32,10 @@ static cl::opt AsmVerbose("asm-verbose", cl::Hidden, cl::desc("Add comments to directives.")); +const int AsmPrinter::ID = 0; AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm, const TargetAsmInfo *T) -: FunctionNumber(0), O(o), TM(tm), TAI(T) + : MachineFunctionPass((intptr_t)&ID), FunctionNumber(0), O(o), TM(tm), TAI(T) {} std::string AsmPrinter::getSectionForFunction(const Function &F) const { Index: llvm/lib/CodeGen/BranchFolding.cpp diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.46 llvm/lib/CodeGen/BranchFolding.cpp:1.47 --- llvm/lib/CodeGen/BranchFolding.cpp:1.46 Mon Apr 30 18:35:00 2007 +++ llvm/lib/CodeGen/BranchFolding.cpp Tue May 1 16:15:46 2007 @@ -39,6 +39,9 @@ namespace { struct BranchFolder : public MachineFunctionPass { + static const int ID; + BranchFolder() : MachineFunctionPass((intptr_t)&ID) {} + virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Control Flow Optimizer"; } const TargetInstrInfo *TII; @@ -64,6 +67,7 @@ MachineBasicBlock *TBB, MachineBasicBlock *FBB, const std::vector &Cond); }; + const int BranchFolder::ID = 0; } FunctionPass *llvm::createBranchFoldingPass() { return new BranchFolder(); } Index: llvm/lib/CodeGen/ELFWriter.cpp diff -u llvm/lib/CodeGen/ELFWriter.cpp:1.38 llvm/lib/CodeGen/ELFWriter.cpp:1.39 --- llvm/lib/CodeGen/ELFWriter.cpp:1.38 Tue Feb 13 23:52:17 2007 +++ llvm/lib/CodeGen/ELFWriter.cpp Tue May 1 16:15:46 2007 @@ -47,6 +47,7 @@ #include using namespace llvm; +const int ELFWriter::ID = 0; /// AddELFWriter - Concrete function to add the ELF writer to the function pass /// manager. MachineCodeEmitter *llvm::AddELFWriter(FunctionPassManager &FPM, @@ -176,7 +177,8 @@ // ELFWriter Implementation //===----------------------------------------------------------------------===// -ELFWriter::ELFWriter(std::ostream &o, TargetMachine &tm) : O(o), TM(tm) { +ELFWriter::ELFWriter(std::ostream &o, TargetMachine &tm) + : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) { e_flags = 0; // e_flags defaults to 0, no flags. is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64; Index: llvm/lib/CodeGen/ELFWriter.h diff -u llvm/lib/CodeGen/ELFWriter.h:1.1 llvm/lib/CodeGen/ELFWriter.h:1.2 --- llvm/lib/CodeGen/ELFWriter.h:1.1 Wed Feb 7 19:30:50 2007 +++ llvm/lib/CodeGen/ELFWriter.h Tue May 1 16:15:46 2007 @@ -30,6 +30,8 @@ class ELFWriter : public MachineFunctionPass { friend class ELFCodeEmitter; public: + static const int ID; + MachineCodeEmitter &getMachineCodeEmitter() const { return *(MachineCodeEmitter*)MCE; } Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.239 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.240 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.239 Thu Apr 26 13:59:33 2007 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue May 1 16:15:46 2007 @@ -45,6 +45,7 @@ STATISTIC(numAborts , "Number of times interval joining aborted"); namespace { + const int LiveIntervals::ID = 0; RegisterPass X("liveintervals", "Live Interval Analysis"); static cl::opt Index: llvm/lib/CodeGen/LiveVariables.cpp diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.79 llvm/lib/CodeGen/LiveVariables.cpp:1.80 --- llvm/lib/CodeGen/LiveVariables.cpp:1.79 Thu Apr 26 13:59:33 2007 +++ llvm/lib/CodeGen/LiveVariables.cpp Tue May 1 16:15:46 2007 @@ -37,6 +37,7 @@ #include using namespace llvm; +const int LiveVariables::ID = 0; static RegisterPass X("livevars", "Live Variable Analysis"); void LiveVariables::VarInfo::dump() const { Index: llvm/lib/CodeGen/MachOWriter.cpp diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.32 llvm/lib/CodeGen/MachOWriter.cpp:1.33 --- llvm/lib/CodeGen/MachOWriter.cpp:1.32 Sat Mar 3 22:41:04 2007 +++ llvm/lib/CodeGen/MachOWriter.cpp Tue May 1 16:15:46 2007 @@ -317,7 +317,9 @@ // MachOWriter Implementation //===----------------------------------------------------------------------===// -MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm) : O(o), TM(tm) { +const int MachOWriter::ID = 0; +MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm) + : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) { is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64; isLittleEndian = TM.getTargetData()->isLittleEndian(); Index: llvm/lib/CodeGen/MachOWriter.h diff -u llvm/lib/CodeGen/MachOWriter.h:1.3 llvm/lib/CodeGen/MachOWriter.h:1.4 --- llvm/lib/CodeGen/MachOWriter.h:1.3 Mon Apr 16 13:10:22 2007 +++ llvm/lib/CodeGen/MachOWriter.h Tue May 1 16:15:46 2007 @@ -84,6 +84,7 @@ class MachOWriter : public MachineFunctionPass { friend class MachOCodeEmitter; public: + static const int ID; MachineCodeEmitter &getMachineCodeEmitter() const { return *(MachineCodeEmitter*)MCE; } Index: llvm/lib/CodeGen/MachineFunction.cpp diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.111 llvm/lib/CodeGen/MachineFunction.cpp:1.112 --- llvm/lib/CodeGen/MachineFunction.cpp:1.111 Wed Apr 25 17:10:09 2007 +++ llvm/lib/CodeGen/MachineFunction.cpp Tue May 1 16:15:46 2007 @@ -44,11 +44,13 @@ namespace { struct VISIBILITY_HIDDEN Printer : public MachineFunctionPass { + static const int ID; + std::ostream *OS; const std::string Banner; - Printer (std::ostream *_OS, const std::string &_Banner) : - OS (_OS), Banner (_Banner) { } + Printer (std::ostream *_OS, const std::string &_Banner) + : MachineFunctionPass((intptr_t)&ID), OS (_OS), Banner (_Banner) { } const char *getPassName() const { return "MachineFunction Printer"; } @@ -62,6 +64,7 @@ return false; } }; + const int Printer::ID = 0; } /// Returns a newly-created MachineFunction Printer pass. The default output @@ -74,6 +77,9 @@ namespace { struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass { + static const int ID; + Deleter() : MachineFunctionPass((intptr_t)&ID) {} + const char *getPassName() const { return "Machine Code Deleter"; } bool runOnMachineFunction(MachineFunction &MF) { @@ -82,6 +88,7 @@ return true; } }; + const int Deleter::ID = 0; } /// MachineCodeDeletion Pass - This pass deletes all of the machine code for Index: llvm/lib/CodeGen/MachineModuleInfo.cpp diff -u llvm/lib/CodeGen/MachineModuleInfo.cpp:1.5 llvm/lib/CodeGen/MachineModuleInfo.cpp:1.6 --- llvm/lib/CodeGen/MachineModuleInfo.cpp:1.5 Thu Mar 1 14:25:32 2007 +++ llvm/lib/CodeGen/MachineModuleInfo.cpp Tue May 1 16:15:46 2007 @@ -28,6 +28,7 @@ // Handle the Pass registration stuff necessary to use TargetData's. namespace { + const int MachineModuleInfo::ID = 0; RegisterPass X("machinemoduleinfo", "Module Information"); } @@ -1462,7 +1463,8 @@ //===----------------------------------------------------------------------===// MachineModuleInfo::MachineModuleInfo() -: DR() +: ImmutablePass((intptr_t)&ID) +, DR() , VR() , CompileUnits() , Directories() @@ -1749,10 +1751,15 @@ namespace llvm { struct DebugLabelFolder : public MachineFunctionPass { + static const int ID; + DebugLabelFolder() : MachineFunctionPass((intptr_t)&ID) {} + virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Label Folder"; } }; +const int DebugLabelFolder::ID = 0; + bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) { // Get machine module info. MachineModuleInfo *MMI = getAnalysisToUpdate(); Index: llvm/lib/CodeGen/PHIElimination.cpp diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.57 llvm/lib/CodeGen/PHIElimination.cpp:1.58 --- llvm/lib/CodeGen/PHIElimination.cpp:1.57 Wed Apr 18 00:04:38 2007 +++ llvm/lib/CodeGen/PHIElimination.cpp Tue May 1 16:15:46 2007 @@ -33,6 +33,9 @@ namespace { struct VISIBILITY_HIDDEN PNE : public MachineFunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + PNE() : MachineFunctionPass((intptr_t)&ID) {} + bool runOnMachineFunction(MachineFunction &Fn) { analyzePHINodes(Fn); @@ -73,6 +76,7 @@ VRegPHIUse VRegPHIUseCount; }; + const int PNE::ID = 0; RegisterPass X("phi-node-elimination", "Eliminate PHI nodes for register allocation"); } Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.84 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.85 --- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.84 Tue May 1 04:01:42 2007 +++ llvm/lib/CodeGen/PrologEpilogInserter.cpp Tue May 1 16:15:46 2007 @@ -32,6 +32,9 @@ namespace { struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass { + static const int ID; + PEI() : MachineFunctionPass((intptr_t)&ID) {} + const char *getPassName() const { return "Prolog/Epilog Insertion & Frame Finalization"; } @@ -98,6 +101,7 @@ void replaceFrameIndices(MachineFunction &Fn); void insertPrologEpilogCode(MachineFunction &Fn); }; + const int PEI::ID = 0; } Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.145 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.146 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.145 Wed Apr 25 17:11:48 2007 +++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Tue May 1 16:15:46 2007 @@ -48,6 +48,9 @@ static unsigned numIntervals = 0; struct VISIBILITY_HIDDEN RA : public MachineFunctionPass { + static const int ID; + RA() : MachineFunctionPass((intptr_t)&ID) {} + typedef std::pair IntervalPtr; typedef std::vector IntervalPtrs; private: @@ -146,6 +149,7 @@ } } }; + const int RA::ID = 0; } void RA::ComputeRelatedRegClasses() { Index: llvm/lib/CodeGen/RegAllocLocal.cpp diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.102 llvm/lib/CodeGen/RegAllocLocal.cpp:1.103 --- llvm/lib/CodeGen/RegAllocLocal.cpp:1.102 Wed Apr 25 17:11:48 2007 +++ llvm/lib/CodeGen/RegAllocLocal.cpp Tue May 1 16:15:46 2007 @@ -43,6 +43,10 @@ class VISIBILITY_HIDDEN RA : public MachineFunctionPass { + public: + static const int ID; + RA() : MachineFunctionPass((intptr_t)&ID) {} + private: const TargetMachine *TM; MachineFunction *MF; const MRegisterInfo *RegInfo; @@ -224,6 +228,7 @@ void reloadPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I, unsigned PhysReg); }; + const int RA::ID = 0; } /// getStackSpaceFor - This allocates space for the specified virtual register Index: llvm/lib/CodeGen/RegAllocSimple.cpp diff -u llvm/lib/CodeGen/RegAllocSimple.cpp:1.83 llvm/lib/CodeGen/RegAllocSimple.cpp:1.84 --- llvm/lib/CodeGen/RegAllocSimple.cpp:1.83 Wed Apr 25 17:11:48 2007 +++ llvm/lib/CodeGen/RegAllocSimple.cpp Tue May 1 16:15:46 2007 @@ -38,6 +38,10 @@ createSimpleRegisterAllocator); class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass { + public: + static const int ID; + RegAllocSimple() : MachineFunctionPass((intptr_t)&ID) {} + private: MachineFunction *MF; const TargetMachine *TM; const MRegisterInfo *RegInfo; @@ -90,7 +94,7 @@ void spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, unsigned VirtReg, unsigned PhysReg); }; - + const int RegAllocSimple::ID = 0; } /// getStackSpaceFor - This allocates space for the specified virtual Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.47 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.48 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.47 Wed Apr 18 00:04:38 2007 +++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Tue May 1 16:15:46 2007 @@ -50,12 +50,16 @@ namespace { struct VISIBILITY_HIDDEN TwoAddressInstructionPass : public MachineFunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + TwoAddressInstructionPass() : MachineFunctionPass((intptr_t)&ID) {} + virtual void getAnalysisUsage(AnalysisUsage &AU) const; /// runOnMachineFunction - pass entry point bool runOnMachineFunction(MachineFunction&); }; + const int TwoAddressInstructionPass::ID = 0; RegisterPass X("twoaddressinstruction", "Two-Address instruction pass"); } Index: llvm/lib/CodeGen/UnreachableBlockElim.cpp diff -u llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.9 llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.10 --- llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.9 Sun Aug 27 17:42:51 2006 +++ llvm/lib/CodeGen/UnreachableBlockElim.cpp Tue May 1 16:15:46 2007 @@ -34,7 +34,11 @@ namespace { class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass { virtual bool runOnFunction(Function &F); + public: + static const int ID; // Pass identifcation, replacement for typeid + UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {} }; + const int UnreachableBlockElim::ID = 0; RegisterPass X("unreachableblockelim", "Remove unreachable blocks from the CFG"); } From dpatel at apple.com Tue May 1 16:17:58 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:58 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h Message-ID: <200705012117.l41LHwTi031635@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms/Utils: UnifyFunctionExitNodes.h updated: 1.20 -> 1.21 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+3 -1) UnifyFunctionExitNodes.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h diff -u llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:1.20 llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:1.21 --- llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:1.20 Fri Jun 2 13:40:06 2006 +++ llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h Tue May 1 16:15:46 2007 @@ -25,7 +25,9 @@ struct UnifyFunctionExitNodes : public FunctionPass { BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock; public: - UnifyFunctionExitNodes() : ReturnBlock(0), UnwindBlock(0) {} + static const int ID; // Pass identifcation, replacement for typeid + UnifyFunctionExitNodes() : FunctionPass((intptr_t)&ID), + ReturnBlock(0), UnwindBlock(0) {} // We can preserve non-critical-edgeness when we unify function exit nodes virtual void getAnalysisUsage(AnalysisUsage &AU) const; From dpatel at apple.com Tue May 1 16:17:58 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:58 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CallGraphSCCPass.h Pass.h PassManagers.h PassSupport.h Message-ID: <200705012117.l41LHwf5031648@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: CallGraphSCCPass.h updated: 1.12 -> 1.13 Pass.h updated: 1.86 -> 1.87 PassManagers.h updated: 1.16 -> 1.17 PassSupport.h updated: 1.38 -> 1.39 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+29 -19) CallGraphSCCPass.h | 2 ++ Pass.h | 16 +++++++++++----- PassManagers.h | 4 +++- PassSupport.h | 26 +++++++++++++------------- 4 files changed, 29 insertions(+), 19 deletions(-) Index: llvm/include/llvm/CallGraphSCCPass.h diff -u llvm/include/llvm/CallGraphSCCPass.h:1.12 llvm/include/llvm/CallGraphSCCPass.h:1.13 --- llvm/include/llvm/CallGraphSCCPass.h:1.12 Mon Apr 16 13:51:25 2007 +++ llvm/include/llvm/CallGraphSCCPass.h Tue May 1 16:15:46 2007 @@ -31,6 +31,8 @@ struct CallGraphSCCPass : public Pass { + CallGraphSCCPass(intptr_t pid) : Pass(pid) {} + /// doInitialization - This method is called before the SCC's of the program /// has been processed, allowing the pass to do initialization as necessary. virtual bool doInitialization(CallGraph &CG) { Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.86 llvm/include/llvm/Pass.h:1.87 --- llvm/include/llvm/Pass.h:1.86 Thu Apr 26 16:33:41 2007 +++ llvm/include/llvm/Pass.h Tue May 1 16:15:46 2007 @@ -34,8 +34,8 @@ #include #include #include -#include #include +#include namespace llvm { @@ -77,7 +77,7 @@ /// class Pass { AnalysisResolver *Resolver; // Used to resolve analysis - const PassInfo *PassInfoCache; + intptr_t PassID; // AnalysisImpls - This keeps track of which passes implement the interfaces // that are required by the current pass (to implement getAnalysis()). @@ -87,7 +87,7 @@ void operator=(const Pass&); // DO NOT IMPLEMENT Pass(const Pass &); // DO NOT IMPLEMENT public: - Pass() : Resolver(0), PassInfoCache(0) {} + Pass(intptr_t pid) : Resolver(0), PassID(pid) {} virtual ~Pass(); /// getPassName - Return a nice clean name for a pass. This usually @@ -163,12 +163,12 @@ template static const PassInfo *getClassPassInfo() { - return lookupPassInfo(typeid(AnalysisClass)); + return lookupPassInfo((intptr_t)&AnalysisClass::ID); } // lookupPassInfo - Return the pass info object for the specified pass class, // or null if it is not known. - static const PassInfo *lookupPassInfo(const std::type_info &TI); + static const PassInfo *lookupPassInfo(intptr_t TI); /// getAnalysisToUpdate() - This function is used by subclasses /// to get to the analysis information that might be around that needs to be @@ -232,6 +232,7 @@ return PMT_ModulePassManager; } + ModulePass(intptr_t pid) : Pass(pid) {} // Force out-of-line virtual method. virtual ~ModulePass(); }; @@ -256,6 +257,7 @@ /// virtual bool runOnModule(Module &M) { return false; } + ImmutablePass(intptr_t pid) : ModulePass(pid) {} // Force out-of-line virtual method. virtual ~ImmutablePass(); }; @@ -271,6 +273,8 @@ /// class FunctionPass : public Pass { public: + FunctionPass(intptr_t pid) : Pass(pid) {} + /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. /// @@ -320,6 +324,8 @@ /// class BasicBlockPass : public Pass { public: + BasicBlockPass(intptr_t pid) : Pass(pid) {} + /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. /// Index: llvm/include/llvm/PassManagers.h diff -u llvm/include/llvm/PassManagers.h:1.16 llvm/include/llvm/PassManagers.h:1.17 --- llvm/include/llvm/PassManagers.h:1.16 Mon Apr 16 15:12:57 2007 +++ llvm/include/llvm/PassManagers.h Tue May 1 16:15:46 2007 @@ -336,7 +336,9 @@ class FPPassManager : public ModulePass, public PMDataManager { public: - explicit FPPassManager(int Depth) : PMDataManager(Depth) { } + static const int ID; + explicit FPPassManager(int Depth) + : ModulePass((intptr_t)&ID), PMDataManager(Depth) { } /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. Index: llvm/include/llvm/PassSupport.h diff -u llvm/include/llvm/PassSupport.h:1.38 llvm/include/llvm/PassSupport.h:1.39 --- llvm/include/llvm/PassSupport.h:1.38 Mon Apr 16 13:10:22 2007 +++ llvm/include/llvm/PassSupport.h Tue May 1 16:15:46 2007 @@ -37,19 +37,19 @@ class PassInfo { const char *PassName; // Nice name for Pass const char *PassArgument; // Command Line argument to run this pass - const std::type_info &TypeInfo; // type_info object for this Pass class + intptr_t PassID; bool IsCFGOnlyPass; // Pass only looks at the CFG. bool IsAnalysisGroup; // True if an analysis group. std::vector ItfImpl;// Interfaces implemented by this pass - Pass *(*NormalCtor)(); // No argument ctor + Pass *(*NormalCtor)(); public: /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. - PassInfo(const char *name, const char *arg, const std::type_info &ti, + PassInfo(const char *name, const char *arg, intptr_t pi, Pass *(*normal)() = 0, bool isCFGOnly = false) - : PassName(name), PassArgument(arg), TypeInfo(ti), + : PassName(name), PassArgument(arg), PassID(pi), IsCFGOnlyPass(isCFGOnly), IsAnalysisGroup(false), NormalCtor(normal) { } @@ -65,8 +65,8 @@ const char *getPassArgument() const { return PassArgument; } /// getTypeInfo - Return the type_info object for the pass... - /// - const std::type_info &getTypeInfo() const { return TypeInfo; } + /// TODO : Rename + intptr_t getTypeInfo() const { return PassID; } /// isAnalysisGroup - Return true if this is an analysis group, not a normal /// pass. @@ -139,12 +139,12 @@ typedef Pass* (*NormalCtor_t)(); - RegisterPassBase(const char *Name, const char *Arg, const std::type_info &TI, + RegisterPassBase(const char *Name, const char *Arg, intptr_t TI, NormalCtor_t NormalCtor = 0, bool CFGOnly = false) : PIObj(Name, Arg, TI, NormalCtor, CFGOnly) { registerPass(); } - RegisterPassBase(const std::type_info &TI) + RegisterPassBase(intptr_t TI) : PIObj("", "", TI) { // This ctor may only be used for analysis groups: it does not auto-register // the pass. @@ -165,7 +165,7 @@ // Register Pass using default constructor... RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), + : RegisterPassBase(Name, PassArg, (intptr_t)&PassName::ID, (RegisterPassBase::NormalCtor_t)callDefaultCtor, CFGOnly) { } }; @@ -195,8 +195,8 @@ const PassInfo *ImplementationInfo; bool isDefaultImplementation; protected: - explicit RegisterAGBase(const std::type_info &Interface, - const std::type_info *Pass = 0, + explicit RegisterAGBase(intptr_t InterfaceID, + intptr_t PassID = 0, bool isDefault = false); void setGroupName(const char *Name); }; @@ -204,12 +204,12 @@ template struct RegisterAnalysisGroup : public RegisterAGBase { explicit RegisterAnalysisGroup(RegisterPassBase &RPB) - : RegisterAGBase(typeid(Interface), &RPB.getPassInfo()->getTypeInfo(), + : RegisterAGBase((intptr_t) &Interface::ID, RPB.getPassInfo()->getTypeInfo(), Default) { } explicit RegisterAnalysisGroup(const char *Name) - : RegisterAGBase(typeid(Interface)) { + : RegisterAGBase((intptr_t) &Interface::ID) { setGroupName(Name); } }; From dpatel at apple.com Tue May 1 16:17:58 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:58 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Assembly/PrintModulePass.h Message-ID: <200705012117.l41LHw7C031647@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Assembly: PrintModulePass.h updated: 1.21 -> 1.22 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+7 -4) PrintModulePass.h | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) Index: llvm/include/llvm/Assembly/PrintModulePass.h diff -u llvm/include/llvm/Assembly/PrintModulePass.h:1.21 llvm/include/llvm/Assembly/PrintModulePass.h:1.22 --- llvm/include/llvm/Assembly/PrintModulePass.h:1.21 Wed Dec 6 19:30:30 2006 +++ llvm/include/llvm/Assembly/PrintModulePass.h Tue May 1 16:15:46 2007 @@ -28,9 +28,10 @@ OStream *Out; // ostream to print on bool DeleteStream; // Delete the ostream in our dtor? public: - PrintModulePass() : Out(&cerr), DeleteStream(false) {} + static const int ID; + PrintModulePass() : ModulePass((intptr_t)&ID), Out(&cerr), DeleteStream(false) {} PrintModulePass(OStream *o, bool DS = false) - : Out(o), DeleteStream(DS) {} + : ModulePass((intptr_t)&ID), Out(o), DeleteStream(DS) {} ~PrintModulePass() { if (DeleteStream) delete Out; @@ -51,10 +52,12 @@ OStream *Out; // ostream to print on bool DeleteStream; // Delete the ostream in our dtor? public: - PrintFunctionPass() : Banner(""), Out(&cerr), DeleteStream(false) {} + static const int ID; + PrintFunctionPass() : FunctionPass((intptr_t)&ID), Banner(""), Out(&cerr), + DeleteStream(false) {} PrintFunctionPass(const std::string &B, OStream *o = &cout, bool DS = false) - : Banner(B), Out(o), DeleteStream(DS) {} + : FunctionPass((intptr_t)&ID), Banner(B), Out(o), DeleteStream(DS) {} inline ~PrintFunctionPass() { if (DeleteStream) delete Out; From dpatel at apple.com Tue May 1 16:17:59 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:17:59 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/AnalysisWrappers.cpp GraphPrinters.cpp PrintSCC.cpp opt.cpp Message-ID: <200705012117.l41LHxAT031662@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: AnalysisWrappers.cpp updated: 1.21 -> 1.22 GraphPrinters.cpp updated: 1.14 -> 1.15 PrintSCC.cpp updated: 1.15 -> 1.16 opt.cpp updated: 1.134 -> 1.135 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+31 -4) AnalysisWrappers.cpp | 7 +++++++ GraphPrinters.cpp | 4 ++++ PrintSCC.cpp | 7 +++++++ opt.cpp | 17 +++++++++++++---- 4 files changed, 31 insertions(+), 4 deletions(-) Index: llvm/tools/opt/AnalysisWrappers.cpp diff -u llvm/tools/opt/AnalysisWrappers.cpp:1.21 llvm/tools/opt/AnalysisWrappers.cpp:1.22 --- llvm/tools/opt/AnalysisWrappers.cpp:1.21 Tue Jan 30 14:08:39 2007 +++ llvm/tools/opt/AnalysisWrappers.cpp Tue May 1 16:15:47 2007 @@ -30,6 +30,8 @@ /// useful when looking for standard library functions we should constant fold /// or handle in alias analyses. struct ExternalFunctionsPassedConstants : public ModulePass { + static const int ID; // Pass ID, replacement for typeid + ExternalFunctionsPassedConstants() : ModulePass((intptr_t)&ID) {} virtual bool runOnModule(Module &M) { for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if (I->isDeclaration()) { @@ -61,10 +63,14 @@ } }; + const int ExternalFunctionsPassedConstants::ID = 0; RegisterPass P1("externalfnconstants", "Print external fn callsites passed constants"); struct CallGraphPrinter : public ModulePass { + static const int ID; // Pass ID, replacement for typeid + CallGraphPrinter() : ModulePass((intptr_t)&ID) {} + virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequiredTransitive(); @@ -76,6 +82,7 @@ } }; + const int CallGraphPrinter::ID = 0; RegisterPass P2("callgraph", "Print a call graph"); } Index: llvm/tools/opt/GraphPrinters.cpp diff -u llvm/tools/opt/GraphPrinters.cpp:1.14 llvm/tools/opt/GraphPrinters.cpp:1.15 --- llvm/tools/opt/GraphPrinters.cpp:1.14 Fri Nov 17 04:05:07 2006 +++ llvm/tools/opt/GraphPrinters.cpp Tue May 1 16:15:47 2007 @@ -60,6 +60,9 @@ namespace { struct CallGraphPrinter : public ModulePass { + static const int ID; // Pass ID, replacement for typeid + CallGraphPrinter() : ModulePass((intptr_t)&ID) {} + virtual bool runOnModule(Module &M) { WriteGraphToFile(std::cerr, "callgraph", &getAnalysis()); return false; @@ -74,6 +77,7 @@ } }; + const int CallGraphPrinter::ID = 0; RegisterPass P2("print-callgraph", "Print Call Graph to 'dot' file"); } Index: llvm/tools/opt/PrintSCC.cpp diff -u llvm/tools/opt/PrintSCC.cpp:1.15 llvm/tools/opt/PrintSCC.cpp:1.16 --- llvm/tools/opt/PrintSCC.cpp:1.15 Sun Aug 27 17:30:17 2006 +++ llvm/tools/opt/PrintSCC.cpp Tue May 1 16:15:47 2007 @@ -35,6 +35,8 @@ namespace { struct CFGSCC : public FunctionPass { + static const int ID; // Pass identification, replacement for typeid + CFGSCC() : FunctionPass((intptr_t)&ID) {} bool runOnFunction(Function& func); void print(std::ostream &O, const Module* = 0) const { } @@ -45,6 +47,9 @@ }; struct CallGraphSCC : public ModulePass { + static const int ID; // Pass identification, replacement for typeid + CallGraphSCC() : ModulePass((intptr_t)&ID) {} + // run - Print out SCCs in the call graph for the specified module. bool runOnModule(Module &M); @@ -57,9 +62,11 @@ } }; + const int CFGSCC::ID = 0; RegisterPass Y("cfgscc", "Print SCCs of each function CFG"); + const int CallGraphSCC::ID = 0; RegisterPass Z("callscc", "Print SCCs of the Call Graph"); } Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.134 llvm/tools/opt/opt.cpp:1.135 --- llvm/tools/opt/opt.cpp:1.134 Thu Apr 19 23:45:58 2007 +++ llvm/tools/opt/opt.cpp Tue May 1 16:15:47 2007 @@ -98,8 +98,10 @@ namespace { struct ModulePassPrinter : public ModulePass { + static const int ID; const PassInfo *PassToPrint; - ModulePassPrinter(const PassInfo *PI) : PassToPrint(PI) {} + ModulePassPrinter(const PassInfo *PI) : ModulePass((intptr_t)&ID), + PassToPrint(PI) {} virtual bool runOnModule(Module &M) { if (!Quiet) { @@ -119,12 +121,15 @@ } }; +const int ModulePassPrinter::ID = 0; struct FunctionPassPrinter : public FunctionPass { const PassInfo *PassToPrint; - FunctionPassPrinter(const PassInfo *PI) : PassToPrint(PI) {} + static const int ID; + FunctionPassPrinter(const PassInfo *PI) : FunctionPass((intptr_t)&ID), + PassToPrint(PI) {} virtual bool runOnFunction(Function &F) { - if (!Quiet) { + if (!Quiet) { cout << "Printing analysis '" << PassToPrint->getPassName() << "' for function '" << F.getName() << "':\n"; } @@ -141,9 +146,12 @@ } }; +const int FunctionPassPrinter::ID = 0; struct BasicBlockPassPrinter : public BasicBlockPass { const PassInfo *PassToPrint; - BasicBlockPassPrinter(const PassInfo *PI) : PassToPrint(PI) {} + static const int ID; + BasicBlockPassPrinter(const PassInfo *PI) + : BasicBlockPass((intptr_t)&ID), PassToPrint(PI) {} virtual bool runOnBasicBlock(BasicBlock &BB) { if (!Quiet) { @@ -164,6 +172,7 @@ } }; +const int BasicBlockPassPrinter::ID = 0; inline void addPass(PassManager &PM, Pass *P) { // Add the pass to the pass manager... PM.add(P); From dpatel at apple.com Tue May 1 16:18:00 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:18:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Hello/Hello.cpp Message-ID: <200705012118.l41LI0n0031667@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Hello: Hello.cpp updated: 1.14 -> 1.15 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+9 -0) Hello.cpp | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm/lib/Transforms/Hello/Hello.cpp diff -u llvm/lib/Transforms/Hello/Hello.cpp:1.14 llvm/lib/Transforms/Hello/Hello.cpp:1.15 --- llvm/lib/Transforms/Hello/Hello.cpp:1.14 Fri Apr 13 13:58:18 2007 +++ llvm/lib/Transforms/Hello/Hello.cpp Tue May 1 16:15:46 2007 @@ -25,6 +25,9 @@ namespace { // Hello - The first implementation, without getAnalysisUsage. struct Hello : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + Hello() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F) { HelloCounter++; std::string fname = F.getName(); @@ -33,10 +36,15 @@ return false; } }; + + const int Hello::ID = 0; RegisterPass X("hello", "Hello World Pass"); // Hello2 - The second implementation with getAnalysisUsage implemented. struct Hello2 : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + Hello2() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F) { HelloCounter++; std::string fname = F.getName(); @@ -50,6 +58,7 @@ AU.setPreservesAll(); }; }; + const int Hello2::ID = 0; RegisterPass Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)"); } From dpatel at apple.com Tue May 1 16:18:00 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:18:00 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/WriteBytecodePass.h Message-ID: <200705012118.l41LI0fs031673@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bytecode: WriteBytecodePass.h updated: 1.19 -> 1.20 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+4 -2) WriteBytecodePass.h | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Bytecode/WriteBytecodePass.h diff -u llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.19 llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.20 --- llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.19 Sun Jan 21 00:31:34 2007 +++ llvm/include/llvm/Bytecode/WriteBytecodePass.h Tue May 1 16:15:46 2007 @@ -26,10 +26,12 @@ bool DeleteStream; bool CompressFile; public: + static const int ID; // Pass identifcation, replacement for typeid WriteBytecodePass() - : Out(&cout), DeleteStream(false), CompressFile(false) {} + : ModulePass((intptr_t) &ID), Out(&cout), DeleteStream(false), + CompressFile(false) {} WriteBytecodePass(OStream *o, bool DS = false, bool CF = false) - : Out(o), DeleteStream(DS), CompressFile(CF) {} + : ModulePass((intptr_t) &ID), Out(o), DeleteStream(DS), CompressFile(CF) {} inline ~WriteBytecodePass() { if (DeleteStream) delete Out; From dpatel at apple.com Tue May 1 16:18:01 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:18:01 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ExtractFunction.cpp TestPasses.cpp Message-ID: <200705012118.l41LI16n031720@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: ExtractFunction.cpp updated: 1.58 -> 1.59 TestPasses.cpp updated: 1.10 -> 1.11 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+15 -1) ExtractFunction.cpp | 4 ++++ TestPasses.cpp | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) Index: llvm/tools/bugpoint/ExtractFunction.cpp diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.58 llvm/tools/bugpoint/ExtractFunction.cpp:1.59 --- llvm/tools/bugpoint/ExtractFunction.cpp:1.58 Mon Feb 5 14:47:21 2007 +++ llvm/tools/bugpoint/ExtractFunction.cpp Tue May 1 16:15:47 2007 @@ -305,7 +305,11 @@ /// BlocksToNotExtract list. class BlockExtractorPass : public ModulePass { bool runOnModule(Module &M); + public: + static const int ID; // Pass ID, replacement for typeid + BlockExtractorPass() : ModulePass((intptr_t)&ID) {} }; + const int BlockExtractorPass::ID = 0; RegisterPass XX("extract-bbs", "Extract Basic Blocks From Module (for bugpoint use)"); } Index: llvm/tools/bugpoint/TestPasses.cpp diff -u llvm/tools/bugpoint/TestPasses.cpp:1.10 llvm/tools/bugpoint/TestPasses.cpp:1.11 --- llvm/tools/bugpoint/TestPasses.cpp:1.10 Thu Apr 21 18:59:23 2005 +++ llvm/tools/bugpoint/TestPasses.cpp Tue May 1 16:15:47 2007 @@ -25,6 +25,10 @@ /// CrashOnCalls - This pass is used to test bugpoint. It intentionally /// crashes on any call instructions. class CrashOnCalls : public BasicBlockPass { + public: + static const int ID; // Pass ID, replacement for typeid + CrashOnCalls() : BasicBlockPass((intptr_t)&ID) {} + private: virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); } @@ -38,6 +42,7 @@ } }; + const int CrashOnCalls::ID = 0; RegisterPass X("bugpoint-crashcalls", "BugPoint Test Pass - Intentionally crash on CallInsts"); @@ -47,6 +52,10 @@ /// DeleteCalls - This pass is used to test bugpoint. It intentionally /// deletes some call instructions, "misoptimizing" the program. class DeleteCalls : public BasicBlockPass { + public: + static const int ID; // Pass ID, replacement for typeid + DeleteCalls() : BasicBlockPass((intptr_t)&ID) {} + private: bool runOnBasicBlock(BasicBlock &BB) { for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) if (CallInst *CI = dyn_cast(I)) { @@ -58,7 +67,8 @@ return false; } }; - + + const int DeleteCalls::ID = 0; RegisterPass Y("bugpoint-deletecalls", "BugPoint Test Pass - Intentionally 'misoptimize' CallInsts"); From dpatel at apple.com Tue May 1 16:18:00 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:18:00 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/AsmPrinter.h LiveIntervalAnalysis.h LiveVariables.h MachineFunctionPass.h MachineModuleInfo.h SelectionDAGISel.h Message-ID: <200705012118.l41LI0rc031685@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: AsmPrinter.h updated: 1.63 -> 1.64 LiveIntervalAnalysis.h updated: 1.80 -> 1.81 LiveVariables.h updated: 1.41 -> 1.42 MachineFunctionPass.h updated: 1.5 -> 1.6 MachineModuleInfo.h updated: 1.7 -> 1.8 SelectionDAGISel.h updated: 1.37 -> 1.38 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+15 -1) AsmPrinter.h | 2 ++ LiveIntervalAnalysis.h | 3 +++ LiveVariables.h | 3 +++ MachineFunctionPass.h | 2 ++ MachineModuleInfo.h | 2 ++ SelectionDAGISel.h | 4 +++- 6 files changed, 15 insertions(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/AsmPrinter.h diff -u llvm/include/llvm/CodeGen/AsmPrinter.h:1.63 llvm/include/llvm/CodeGen/AsmPrinter.h:1.64 --- llvm/include/llvm/CodeGen/AsmPrinter.h:1.63 Wed Apr 25 09:27:10 2007 +++ llvm/include/llvm/CodeGen/AsmPrinter.h Tue May 1 16:15:46 2007 @@ -34,6 +34,8 @@ /// AsmPrinter - This class is intended to be used as a driving class for all /// asm writers. class AsmPrinter : public MachineFunctionPass { + static const int ID; + /// FunctionNumber - This provides a unique ID for each function emitted in /// this translation unit. It is autoincremented by SetupMachineFunction, /// and can be accessed with getFunctionNumber() and Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.80 llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.81 --- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.80 Wed Apr 25 02:30:23 2007 +++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Tue May 1 16:15:46 2007 @@ -65,6 +65,9 @@ BitVector JoinedLIs; public: + static const int ID; // Pass identifcation, replacement for typeid + LiveIntervals() : MachineFunctionPass((intptr_t)&ID) {} + struct CopyRec { MachineInstr *MI; unsigned SrcReg, DstReg; Index: llvm/include/llvm/CodeGen/LiveVariables.h diff -u llvm/include/llvm/CodeGen/LiveVariables.h:1.41 llvm/include/llvm/CodeGen/LiveVariables.h:1.42 --- llvm/include/llvm/CodeGen/LiveVariables.h:1.41 Wed Apr 25 20:40:09 2007 +++ llvm/include/llvm/CodeGen/LiveVariables.h Tue May 1 16:15:46 2007 @@ -40,6 +40,9 @@ class LiveVariables : public MachineFunctionPass { public: + static const int ID; // Pass identifcation, replacement for typeid + LiveVariables() : MachineFunctionPass((intptr_t)&ID) {} + /// VarInfo - This represents the regions where a virtual register is live in /// the program. We represent this with three different pieces of /// information: the instruction that uniquely defines the value, the set of Index: llvm/include/llvm/CodeGen/MachineFunctionPass.h diff -u llvm/include/llvm/CodeGen/MachineFunctionPass.h:1.5 llvm/include/llvm/CodeGen/MachineFunctionPass.h:1.6 --- llvm/include/llvm/CodeGen/MachineFunctionPass.h:1.5 Fri Jul 14 18:08:47 2006 +++ llvm/include/llvm/CodeGen/MachineFunctionPass.h Tue May 1 16:15:46 2007 @@ -26,6 +26,8 @@ struct MachineFunctionPass : public FunctionPass { + MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {} + /// runOnMachineFunction - This method must be overloaded to perform the /// desired machine code transformation or analysis. /// Index: llvm/include/llvm/CodeGen/MachineModuleInfo.h diff -u llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.7 llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.8 --- llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.7 Thu Mar 1 14:25:32 2007 +++ llvm/include/llvm/CodeGen/MachineModuleInfo.h Tue May 1 16:15:46 2007 @@ -1022,6 +1022,8 @@ std::vector TypeInfos; public: + static const int ID; // Pass identifcation, replacement for typeid + MachineModuleInfo(); ~MachineModuleInfo(); Index: llvm/include/llvm/CodeGen/SelectionDAGISel.h diff -u llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.37 llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.38 --- llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.37 Mon Apr 9 07:31:58 2007 +++ llvm/include/llvm/CodeGen/SelectionDAGISel.h Tue May 1 16:15:46 2007 @@ -41,8 +41,10 @@ MachineBasicBlock *BB; std::vector TopOrder; unsigned DAGSize; + static const int ID; - explicit SelectionDAGISel(TargetLowering &tli) : TLI(tli), DAGSize(0) {} + explicit SelectionDAGISel(TargetLowering &tli) : + FunctionPass((intptr_t)&ID), TLI(tli), DAGSize(0) {} TargetLowering &getTargetLowering() { return TLI; } From dpatel at apple.com Tue May 1 16:18:01 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:18:01 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/RSProfiling.h Message-ID: <200705012118.l41LI1rd031695@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: RSProfiling.h updated: 1.2 -> 1.3 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+3 -0) RSProfiling.h | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/include/llvm/Transforms/RSProfiling.h diff -u llvm/include/llvm/Transforms/RSProfiling.h:1.2 llvm/include/llvm/Transforms/RSProfiling.h:1.3 --- llvm/include/llvm/Transforms/RSProfiling.h:1.2 Wed Feb 22 10:23:43 2006 +++ llvm/include/llvm/Transforms/RSProfiling.h Tue May 1 16:15:46 2007 @@ -23,6 +23,9 @@ /// this interface are expected to chain to other implementations, such that /// multiple profilers can be support simultaniously. struct RSProfilers : public ModulePass { + static const int ID; // Pass identification, replacement for typeinfo + RSProfilers() : ModulePass((intptr_t)&ID) {} + /// isProfiling - This method returns true if the value passed it was /// inserted by the profiler. virtual bool isProfiling(Value* v) = 0; From dpatel at apple.com Tue May 1 16:18:01 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:18:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp CallGraph.cpp CallGraphSCCPass.cpp FindUsedTypes.cpp GlobalsModRef.cpp Message-ID: <200705012118.l41LI1xa031711@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: Andersens.cpp updated: 1.46 -> 1.47 CallGraph.cpp updated: 1.65 -> 1.66 CallGraphSCCPass.cpp updated: 1.21 -> 1.22 FindUsedTypes.cpp updated: 1.38 -> 1.39 GlobalsModRef.cpp updated: 1.29 -> 1.30 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+20 -2) Andersens.cpp | 6 ++++++ CallGraph.cpp | 6 +++++- CallGraphSCCPass.cpp | 5 ++++- FindUsedTypes.cpp | 1 + GlobalsModRef.cpp | 4 ++++ 5 files changed, 20 insertions(+), 2 deletions(-) Index: llvm/lib/Analysis/IPA/Andersens.cpp diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.46 llvm/lib/Analysis/IPA/Andersens.cpp:1.47 --- llvm/lib/Analysis/IPA/Andersens.cpp:1.46 Sun Mar 4 18:00:42 2007 +++ llvm/lib/Analysis/IPA/Andersens.cpp Tue May 1 16:15:46 2007 @@ -75,12 +75,17 @@ namespace { class VISIBILITY_HIDDEN Andersens : public ModulePass, public AliasAnalysis, private InstVisitor { + public: + static const int ID; // Class identification, replacement for typeinfo + Andersens() : ModulePass((intptr_t)&ID) {} + private: /// Node class - This class is used to represent a memory object in the /// program, and is the primitive used to build the points-to graph. class Node { std::vector Pointees; Value *Val; public: + static const unsigned ID; // Pass identifcation, replacement for typeid Node() : Val(0) {} Node *setValue(Value *V) { assert(Val == 0 && "Value already set for this node!"); @@ -334,6 +339,7 @@ void visitInstruction(Instruction &I); }; + const int Andersens::ID = 0; RegisterPass X("anders-aa", "Andersen's Interprocedural Alias Analysis"); RegisterAnalysisGroup Y(X); Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.65 llvm/lib/Analysis/IPA/CallGraph.cpp:1.66 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.65 Mon Feb 5 17:42:17 2007 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Tue May 1 16:15:46 2007 @@ -51,7 +51,9 @@ CallGraphNode *CallsExternalNode; public: - BasicCallGraph() : Root(0), ExternalCallingNode(0), CallsExternalNode(0) {} + static const int ID; // Class identification, replacement for typeinfo + BasicCallGraph() : ModulePass((intptr_t)&ID), Root(0), + ExternalCallingNode(0), CallsExternalNode(0) {} // runOnModule - Compute the call graph for the specified module. virtual bool runOnModule(Module &M) { @@ -188,7 +190,9 @@ } }; +const int CallGraph::ID = 0; RegisterAnalysisGroup X("Call Graph"); +const int BasicCallGraph::ID = 0; RegisterPass Y("basiccg", "Basic CallGraph Construction"); RegisterAnalysisGroup Z(Y); Index: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp diff -u llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.21 llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.22 --- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.21 Mon Apr 16 13:10:22 2007 +++ llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Tue May 1 16:15:46 2007 @@ -30,7 +30,9 @@ class CGPassManager : public ModulePass, public PMDataManager { public: - CGPassManager(int Depth) : PMDataManager(Depth) { } + static const int ID; + CGPassManager(int Depth) + : ModulePass((intptr_t)&ID), PMDataManager(Depth) { } /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. @@ -71,6 +73,7 @@ } }; +const int CGPassManager::ID = 0; /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. bool CGPassManager::runOnModule(Module &M) { Index: llvm/lib/Analysis/IPA/FindUsedTypes.cpp diff -u llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.38 llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.39 --- llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.38 Wed Dec 6 00:35:25 2006 +++ llvm/lib/Analysis/IPA/FindUsedTypes.cpp Tue May 1 16:15:46 2007 @@ -21,6 +21,7 @@ #include "llvm/Support/InstIterator.h" using namespace llvm; +const int FindUsedTypes::ID = 0; static RegisterPass X("printusedtypes", "Find Used Types"); Index: llvm/lib/Analysis/IPA/GlobalsModRef.cpp diff -u llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.29 llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.30 --- llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.29 Mon Feb 5 17:42:17 2007 +++ llvm/lib/Analysis/IPA/GlobalsModRef.cpp Tue May 1 16:15:46 2007 @@ -83,6 +83,9 @@ std::map FunctionInfo; public: + static const int ID; + GlobalsModRef() : ModulePass((intptr_t)&ID) {} + bool runOnModule(Module &M) { InitializeAliasAnalysis(this); // set up super class AnalyzeGlobals(M); // find non-addr taken globals @@ -143,6 +146,7 @@ bool AnalyzeIndirectGlobalMemory(GlobalValue *GV); }; + const int GlobalsModRef::ID = 0; RegisterPass X("globalsmodref-aa", "Simple mod/ref analysis for globals"); RegisterAnalysisGroup Y(X); From dpatel at apple.com Tue May 1 16:18:01 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:18:01 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h Message-ID: <200705012118.l41LI1w2031692@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetData.h updated: 1.60 -> 1.61 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+6 -3) TargetData.h | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Target/TargetData.h diff -u llvm/include/llvm/Target/TargetData.h:1.60 llvm/include/llvm/Target/TargetData.h:1.61 --- llvm/include/llvm/Target/TargetData.h:1.60 Thu Apr 26 14:39:32 2007 +++ llvm/include/llvm/Target/TargetData.h Tue May 1 16:15:46 2007 @@ -108,14 +108,15 @@ /// /// @note This has to exist, because this is a pass, but it should never be /// used. - TargetData() { + TargetData() : ImmutablePass((intptr_t)&ID) { assert(0 && "ERROR: Bad TargetData ctor used. " "Tool did not specify a TargetData to use?"); abort(); } /// Constructs a TargetData from a specification string. See init(). - TargetData(const std::string &TargetDescription) { + TargetData(const std::string &TargetDescription) + : ImmutablePass((intptr_t)&ID) { init(TargetDescription); } @@ -123,7 +124,7 @@ TargetData(const Module *M); TargetData(const TargetData &TD) : - ImmutablePass(), + ImmutablePass((intptr_t)&ID), LittleEndian(TD.isLittleEndian()), PointerMemSize(TD.PointerMemSize), PointerABIAlign(TD.PointerABIAlign), @@ -200,6 +201,8 @@ /// specified global, returned in log form. This includes an explicitly /// requested alignment (if the global has one). unsigned getPreferredAlignmentLog(const GlobalVariable *GV) const; + + static const int ID; // Pass identifcation, replacement for typeid }; /// StructLayout - used to lazily calculate structure layout information for a From dpatel at apple.com Tue May 1 16:18:01 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 1 May 2007 16:18:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysis.cpp AliasAnalysisCounter.cpp AliasAnalysisEvaluator.cpp AliasDebugger.cpp AliasSetTracker.cpp BasicAliasAnalysis.cpp CFGPrinter.cpp InstCount.cpp IntervalPartition.cpp LoadValueNumbering.cpp LoopInfo.cpp LoopPass.cpp PostDominators.cpp ProfileInfo.cpp ProfileInfoLoaderPass.cpp ScalarEvolution.cpp ValueNumbering.cpp Message-ID: <200705012118.l41LI1ks031754@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasAnalysis.cpp updated: 1.30 -> 1.31 AliasAnalysisCounter.cpp updated: 1.20 -> 1.21 AliasAnalysisEvaluator.cpp updated: 1.33 -> 1.34 AliasDebugger.cpp updated: 1.3 -> 1.4 AliasSetTracker.cpp updated: 1.46 -> 1.47 BasicAliasAnalysis.cpp updated: 1.108 -> 1.109 CFGPrinter.cpp updated: 1.22 -> 1.23 InstCount.cpp updated: 1.20 -> 1.21 IntervalPartition.cpp updated: 1.32 -> 1.33 LoadValueNumbering.cpp updated: 1.39 -> 1.40 LoopInfo.cpp updated: 1.83 -> 1.84 LoopPass.cpp updated: 1.18 -> 1.19 PostDominators.cpp updated: 1.67 -> 1.68 ProfileInfo.cpp updated: 1.11 -> 1.12 ProfileInfoLoaderPass.cpp updated: 1.18 -> 1.19 ScalarEvolution.cpp updated: 1.112 -> 1.113 ValueNumbering.cpp updated: 1.25 -> 1.26 --- Log message: Do not use typeinfo to identify pass in pass manager. --- Diffs of the changes: (+61 -5) AliasAnalysis.cpp | 1 + AliasAnalysisCounter.cpp | 4 +++- AliasAnalysisEvaluator.cpp | 4 ++++ AliasDebugger.cpp | 4 ++++ AliasSetTracker.cpp | 4 ++++ BasicAliasAnalysis.cpp | 6 ++++++ CFGPrinter.cpp | 6 ++++++ InstCount.cpp | 4 ++++ IntervalPartition.cpp | 4 +++- LoadValueNumbering.cpp | 3 +++ LoopInfo.cpp | 1 + LoopPass.cpp | 5 ++++- PostDominators.cpp | 3 +++ ProfileInfo.cpp | 7 ++++++- ProfileInfoLoaderPass.cpp | 4 +++- ScalarEvolution.cpp | 1 + ValueNumbering.cpp | 5 +++++ 17 files changed, 61 insertions(+), 5 deletions(-) Index: llvm/lib/Analysis/AliasAnalysis.cpp diff -u llvm/lib/Analysis/AliasAnalysis.cpp:1.30 llvm/lib/Analysis/AliasAnalysis.cpp:1.31 --- llvm/lib/Analysis/AliasAnalysis.cpp:1.30 Fri Nov 17 01:10:51 2006 +++ llvm/lib/Analysis/AliasAnalysis.cpp Tue May 1 16:15:46 2007 @@ -34,6 +34,7 @@ // Register the AliasAnalysis interface, providing a nice name to refer to. namespace { + const int AliasAnalysis::ID = 0; RegisterAnalysisGroup Z("Alias Analysis"); } Index: llvm/lib/Analysis/AliasAnalysisCounter.cpp diff -u llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.20 llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.21 --- llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.20 Mon Feb 5 17:42:17 2007 +++ llvm/lib/Analysis/AliasAnalysisCounter.cpp Tue May 1 16:15:46 2007 @@ -34,7 +34,8 @@ const char *Name; Module *M; public: - AliasAnalysisCounter() { + static const int ID; // Class identification, replacement for typeinfo + AliasAnalysisCounter() : ModulePass((intptr_t) &ID) { No = May = Must = 0; NoMR = JustRef = JustMod = MR = 0; } @@ -107,6 +108,7 @@ } }; + const int AliasAnalysisCounter::ID = 0; RegisterPass X("count-aa", "Count Alias Analysis Query Responses"); RegisterAnalysisGroup Y(X); Index: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp diff -u llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.33 llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.34 --- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.33 Mon Feb 5 17:42:17 2007 +++ llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Tue May 1 16:15:46 2007 @@ -50,6 +50,9 @@ unsigned NoModRef, Mod, Ref, ModRef; public: + static const int ID; // Pass identifcation, replacement for typeid + AAEval() : FunctionPass((intptr_t)&ID) {} + virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); AU.setPreservesAll(); @@ -70,6 +73,7 @@ bool doFinalization(Module &M); }; + const int AAEval::ID = 0; RegisterPass X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator"); } Index: llvm/lib/Analysis/AliasDebugger.cpp diff -u llvm/lib/Analysis/AliasDebugger.cpp:1.3 llvm/lib/Analysis/AliasDebugger.cpp:1.4 --- llvm/lib/Analysis/AliasDebugger.cpp:1.3 Mon Feb 5 17:42:17 2007 +++ llvm/lib/Analysis/AliasDebugger.cpp Tue May 1 16:15:46 2007 @@ -40,6 +40,9 @@ std::set Vals; public: + static const int ID; // Class identification, replacement for typeinfo + AliasDebugger() : ModulePass((intptr_t)&ID) {} + bool runOnModule(Module &M) { InitializeAliasAnalysis(this); // set up super class @@ -119,6 +122,7 @@ }; + const int AliasDebugger::ID = 0; RegisterPass X("debug-aa", "AA use debugger"); RegisterAnalysisGroup Y(X); } Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.46 llvm/lib/Analysis/AliasSetTracker.cpp:1.47 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.46 Mon Feb 5 17:42:17 2007 +++ llvm/lib/Analysis/AliasSetTracker.cpp Tue May 1 16:15:46 2007 @@ -555,6 +555,9 @@ class VISIBILITY_HIDDEN AliasSetPrinter : public FunctionPass { AliasSetTracker *Tracker; public: + static const int ID; // Pass identifcation, replacement for typeid + AliasSetPrinter() : FunctionPass((intptr_t)&ID) {} + virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired(); @@ -570,5 +573,6 @@ return false; } }; + const int AliasSetPrinter::ID = 0; RegisterPass X("print-alias-sets", "Alias Set Printer"); } Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.108 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.109 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.108 Thu Apr 19 00:39:12 2007 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Tue May 1 16:15:46 2007 @@ -36,6 +36,9 @@ /// such it doesn't follow many of the rules that other alias analyses must. /// struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public AliasAnalysis { + static const int ID; // Class identification, replacement for typeinfo + NoAA() : ImmutablePass((intptr_t)&ID) {} + virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); } @@ -74,6 +77,7 @@ }; // Register this pass... + const int NoAA::ID = 0; RegisterPass U("no-aa", "No Alias Analysis (always returns 'may' alias)"); @@ -88,6 +92,7 @@ /// Because it doesn't chain to a previous alias analysis (like -no-aa), it /// derives from the NoAA class. struct VISIBILITY_HIDDEN BasicAliasAnalysis : public NoAA { + static const int ID; // Class identification, replacement for typeinfo AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size); @@ -119,6 +124,7 @@ }; // Register this pass... + const int BasicAliasAnalysis::ID = 0; RegisterPass X("basicaa", "Basic Alias Analysis (default AA impl)"); Index: llvm/lib/Analysis/CFGPrinter.cpp diff -u llvm/lib/Analysis/CFGPrinter.cpp:1.22 llvm/lib/Analysis/CFGPrinter.cpp:1.23 --- llvm/lib/Analysis/CFGPrinter.cpp:1.22 Mon Feb 5 17:42:17 2007 +++ llvm/lib/Analysis/CFGPrinter.cpp Tue May 1 16:15:46 2007 @@ -91,6 +91,9 @@ namespace { struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass { + static const int ID; // Pass identifcation, replacement for typeid + CFGPrinter() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F) { std::string Filename = "cfg." + F.getName() + ".dot"; cerr << "Writing '" << Filename << "'..."; @@ -111,10 +114,12 @@ } }; + const int CFGPrinter::ID = 0; RegisterPass P1("print-cfg", "Print CFG of function to 'dot' file"); struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter { + static const int ID; // Pass identifcation, replacement for typeid virtual bool runOnFunction(Function &F) { bool OldCFGOnly = CFGOnly; CFGOnly = true; @@ -129,6 +134,7 @@ } }; + const int CFGOnlyPrinter::ID = 0; RegisterPass P2("print-cfg-only", "Print CFG of function to 'dot' file (with no function bodies)"); Index: llvm/lib/Analysis/InstCount.cpp diff -u llvm/lib/Analysis/InstCount.cpp:1.20 llvm/lib/Analysis/InstCount.cpp:1.21 --- llvm/lib/Analysis/InstCount.cpp:1.20 Mon Feb 5 17:42:17 2007 +++ llvm/lib/Analysis/InstCount.cpp Tue May 1 16:15:46 2007 @@ -51,6 +51,9 @@ abort(); } public: + static const int ID; // Pass identifcation, replacement for typeid + InstCount() : FunctionPass((intptr_t)&ID) {} + virtual bool runOnFunction(Function &F); virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -60,6 +63,7 @@ }; + const int InstCount::ID = 0; RegisterPass X("instcount", "Counts the various types of Instructions"); } Index: llvm/lib/Analysis/IntervalPartition.cpp diff -u llvm/lib/Analysis/IntervalPartition.cpp:1.32 llvm/lib/Analysis/IntervalPartition.cpp:1.33 --- llvm/lib/Analysis/IntervalPartition.cpp:1.32 Sun Aug 27 17:30:17 2006 +++ llvm/lib/Analysis/IntervalPartition.cpp Tue May 1 16:15:46 2007 @@ -15,6 +15,7 @@ #include "llvm/Analysis/IntervalIterator.h" using namespace llvm; +const int IntervalPartition::ID = 0; static RegisterPass X("intervals", "Interval Partition Construction", true); @@ -88,7 +89,8 @@ // existing interval graph. This takes an additional boolean parameter to // distinguish it from a copy constructor. Always pass in false for now. // -IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) { +IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) + : FunctionPass((intptr_t) &ID) { Interval *FunctionStart = IP.getRootInterval(); assert(FunctionStart && "Cannot operate on empty IntervalPartitions!"); Index: llvm/lib/Analysis/LoadValueNumbering.cpp diff -u llvm/lib/Analysis/LoadValueNumbering.cpp:1.39 llvm/lib/Analysis/LoadValueNumbering.cpp:1.40 --- llvm/lib/Analysis/LoadValueNumbering.cpp:1.39 Tue Apr 17 12:52:45 2007 +++ llvm/lib/Analysis/LoadValueNumbering.cpp Tue May 1 16:15:46 2007 @@ -40,6 +40,8 @@ namespace { // FIXME: This should not be a FunctionPass. struct VISIBILITY_HIDDEN LoadVN : public FunctionPass, public ValueNumbering { + static const int ID; // Class identification, replacement for typeinfo + LoadVN() : FunctionPass((intptr_t)&ID) {} /// Pass Implementation stuff. This doesn't do any analysis. /// @@ -81,6 +83,7 @@ std::vector &RetVals) const; }; + const int LoadVN::ID = 0; // Register this pass... RegisterPass X("load-vn", "Load Value Numbering"); Index: llvm/lib/Analysis/LoopInfo.cpp diff -u llvm/lib/Analysis/LoopInfo.cpp:1.83 llvm/lib/Analysis/LoopInfo.cpp:1.84 --- llvm/lib/Analysis/LoopInfo.cpp:1.83 Sat Mar 3 22:06:39 2007 +++ llvm/lib/Analysis/LoopInfo.cpp Tue May 1 16:15:46 2007 @@ -27,6 +27,7 @@ #include using namespace llvm; +const int LoopInfo::ID = 0; static RegisterPass X("loops", "Natural Loop Construction", true); Index: llvm/lib/Analysis/LoopPass.cpp diff -u llvm/lib/Analysis/LoopPass.cpp:1.18 llvm/lib/Analysis/LoopPass.cpp:1.19 --- llvm/lib/Analysis/LoopPass.cpp:1.18 Wed Mar 7 00:39:01 2007 +++ llvm/lib/Analysis/LoopPass.cpp Tue May 1 16:15:46 2007 @@ -20,9 +20,12 @@ //===----------------------------------------------------------------------===// // LPPassManager // + +const int LPPassManager::ID = 0; /// LPPassManager manages FPPassManagers and CalLGraphSCCPasses. -LPPassManager::LPPassManager(int Depth) : PMDataManager(Depth) { +LPPassManager::LPPassManager(int Depth) + : FunctionPass((intptr_t)&ID), PMDataManager(Depth) { skipThisLoop = false; redoThisLoop = false; LI = NULL; Index: llvm/lib/Analysis/PostDominators.cpp diff -u llvm/lib/Analysis/PostDominators.cpp:1.67 llvm/lib/Analysis/PostDominators.cpp:1.68 --- llvm/lib/Analysis/PostDominators.cpp:1.67 Tue Apr 17 20:19:55 2007 +++ llvm/lib/Analysis/PostDominators.cpp Tue May 1 16:15:46 2007 @@ -22,6 +22,9 @@ // PostDominatorTree Implementation //===----------------------------------------------------------------------===// +const int PostDominatorTree::ID = 0; +const int PostDominanceFrontier::ID = 0; +const int PostETForest::ID = 0; static RegisterPass F("postdomtree", "Post-Dominator Tree Construction", true); Index: llvm/lib/Analysis/ProfileInfo.cpp diff -u llvm/lib/Analysis/ProfileInfo.cpp:1.11 llvm/lib/Analysis/ProfileInfo.cpp:1.12 --- llvm/lib/Analysis/ProfileInfo.cpp:1.11 Thu Mar 22 11:38:57 2007 +++ llvm/lib/Analysis/ProfileInfo.cpp Tue May 1 16:15:46 2007 @@ -22,6 +22,7 @@ // Register the ProfileInfo interface, providing a nice name to refer to. namespace { + const int ProfileInfo::ID = 0; RegisterAnalysisGroup Z("Profile Information"); } @@ -84,8 +85,12 @@ namespace { struct VISIBILITY_HIDDEN NoProfileInfo - : public ImmutablePass, public ProfileInfo {}; + : public ImmutablePass, public ProfileInfo { + static const int ID; // Class identification, replacement for typeinfo + NoProfileInfo() : ImmutablePass((intptr_t)&ID) {} + }; + const int NoProfileInfo::ID = 0; // Register this pass... RegisterPass X("no-profile", "No Profile Information"); Index: llvm/lib/Analysis/ProfileInfoLoaderPass.cpp diff -u llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.18 llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.19 --- llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.18 Mon Feb 5 17:42:17 2007 +++ llvm/lib/Analysis/ProfileInfoLoaderPass.cpp Tue May 1 16:15:46 2007 @@ -32,8 +32,9 @@ class VISIBILITY_HIDDEN LoaderPass : public ModulePass, public ProfileInfo { std::string Filename; public: + static const int ID; // Class identification, replacement for typeinfo LoaderPass(const std::string &filename = "") - : Filename(filename) { + : ModulePass((intptr_t)&ID), Filename(filename) { if (filename.empty()) Filename = ProfileInfoFilename; } @@ -49,6 +50,7 @@ virtual bool runOnModule(Module &M); }; + const int LoaderPass::ID = 0; RegisterPass X("profile-loader", "Load profile information from llvmprof.out"); Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.112 llvm/lib/Analysis/ScalarEvolution.cpp:1.113 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.112 Sun Apr 15 21:24:41 2007 +++ llvm/lib/Analysis/ScalarEvolution.cpp Tue May 1 16:15:46 2007 @@ -102,6 +102,7 @@ cl::init(100)); namespace { + const int ScalarEvolution::ID = 0; RegisterPass R("scalar-evolution", "Scalar Evolution Analysis"); } Index: llvm/lib/Analysis/ValueNumbering.cpp diff -u llvm/lib/Analysis/ValueNumbering.cpp:1.25 llvm/lib/Analysis/ValueNumbering.cpp:1.26 --- llvm/lib/Analysis/ValueNumbering.cpp:1.25 Mon Feb 5 17:42:17 2007 +++ llvm/lib/Analysis/ValueNumbering.cpp Tue May 1 16:15:46 2007 @@ -22,6 +22,7 @@ #include "llvm/Support/Compiler.h" using namespace llvm; +const int ValueNumbering::ID = 0; // Register the ValueNumbering interface, providing a nice name to refer to. static RegisterAnalysisGroup X("Value Numbering"); @@ -51,6 +52,9 @@ /// struct VISIBILITY_HIDDEN BasicVN : public ImmutablePass, public ValueNumbering { + static const int ID; // Class identification, replacement for typeinfo + BasicVN() : ImmutablePass((intptr_t)&ID) {} + /// getEqualNumberNodes - Return nodes with the same value number as the /// specified Value. This fills in the argument vector with any equal /// values. @@ -61,6 +65,7 @@ std::vector &RetVals) const; }; + const int BasicVN::ID = 0; // Register this pass... RegisterPass X("basicvn", "Basic Value Numbering (default GVN impl)"); From asl at math.spbu.ru Tue May 1 17:23:37 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 1 May 2007 17:23:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp Message-ID: <200705012223.l41MNbTs001594@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.132 -> 1.133 --- Log message: Fix couple of bugs connected with eh info: 1. Correct output offsets on Linux 2. Fix "style" of personality function. It shouldn't be indirect. --- Diffs of the changes: (+27 -15) DwarfWriter.cpp | 42 +++++++++++++++++++++++++++--------------- 1 files changed, 27 insertions(+), 15 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.132 llvm/lib/CodeGen/DwarfWriter.cpp:1.133 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.132 Wed Mar 7 02:25:02 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Tue May 1 17:23:12 2007 @@ -914,13 +914,20 @@ void EmitSectionOffset(const char* Label, const char* Section, unsigned LabelNumber, unsigned SectionNumber, - bool IsSmall = false) { + bool IsSmall = false, bool isEH = false) { + bool printAbsolute = false; if (TAI->needsSet()) { O << "\t.set\t"; PrintLabelName("set", SetCounter); O << ","; PrintLabelName(Label, LabelNumber, true); - if (!TAI->isAbsoluteSectionOffsets()) { + + if (isEH) + printAbsolute = TAI->isAbsoluteEHSectionOffsets(); + else + printAbsolute = TAI->isAbsoluteDebugSectionOffsets(); + + if (!printAbsolute) { O << "-"; PrintLabelName(Section, SectionNumber); } @@ -940,7 +947,13 @@ O << TAI->getData64bitsDirective(); PrintLabelName(Label, LabelNumber, true); - if (!TAI->isAbsoluteSectionOffsets()) { + + if (isEH) + printAbsolute = TAI->isAbsoluteEHSectionOffsets(); + else + printAbsolute = TAI->isAbsoluteDebugSectionOffsets(); + + if (!printAbsolute) { O << "-"; PrintLabelName(Section, SectionNumber); } @@ -1688,7 +1701,7 @@ CompileUnit *NewCompileUnit(CompileUnitDesc *UnitDesc, unsigned ID) { // Construct debug information entry. DIE *Die = new DIE(DW_TAG_compile_unit); - if (TAI->isAbsoluteSectionOffsets()) + if (TAI->isAbsoluteDebugSectionOffsets()) AddLabel(Die, DW_AT_stmt_list, DW_FORM_data4, DWLabel("section_line", 0)); else AddDelta(Die, DW_AT_stmt_list, DW_FORM_data4, DWLabel("section_line", 0), @@ -2107,7 +2120,7 @@ Asm->EmitInt32(ContentSize); Asm->EOL("Length of Compilation Unit Info"); Asm->EmitInt16(DWARF_VERSION); Asm->EOL("DWARF version number"); - EmitSectionOffset("abbrev_begin", "section_abbrev", 0, 0, true); + EmitSectionOffset("abbrev_begin", "section_abbrev", 0, 0, true, false); Asm->EOL("Offset Into Abbrev. Section"); Asm->EmitInt8(TAI->getAddressSize()); Asm->EOL("Address Size (in bytes)"); @@ -2366,7 +2379,7 @@ EmitLabel("frame_begin", SubprogramCount); - EmitSectionOffset("frame_common_begin", "section_frame", 0, 0, true); + EmitSectionOffset("frame_common_begin", "section_frame", 0, 0, true, false); Asm->EOL("FDE CIE offset"); EmitReference("func_begin", SubprogramCount); @@ -2401,7 +2414,8 @@ Asm->EmitInt16(DWARF_VERSION); Asm->EOL("DWARF Version"); - EmitSectionOffset("info_begin", "section_info", Unit->getID(), 0, true); + EmitSectionOffset("info_begin", "section_info", + Unit->getID(), 0, true, false); Asm->EOL("Offset of Compilation Unit Info"); EmitDifference("info_end", Unit->getID(), "info_begin", Unit->getID(),true); @@ -2769,10 +2783,8 @@ if (Personality) { Asm->EmitULEB128Bytes(7); Asm->EOL("Augmentation Size"); - Asm->EmitInt8(DW_EH_PE_indirect | - DW_EH_PE_pcrel | - DW_EH_PE_sdata4); - Asm->EOL("Personality (indirect pcrel sdata4)"); + Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4); + Asm->EOL("Personality (pcrel sdata4)"); O << TAI->getData32bitsDirective(); Asm->EmitExternalGlobal((const GlobalVariable *)(Personality)); @@ -2830,7 +2842,7 @@ EmitLabel("eh_frame_begin", SubprogramCount); EmitSectionOffset("eh_frame_begin", "section_eh_frame", - SubprogramCount, 0, true); + SubprogramCount, 0, true, true); Asm->EOL("FDE CIE offset"); EmitReference("eh_func_begin", SubprogramCount, true); @@ -2994,7 +3006,7 @@ for (unsigned i = 0, N = LandingPads.size(); i != N; ++i) { const LandingPadInfo &LandingPad = LandingPads[i]; EmitSectionOffset("label", "eh_func_begin", - LandingPad.BeginLabel, SubprogramCount); + LandingPad.BeginLabel, SubprogramCount, false, true); Asm->EOL("Region start"); EmitDifference("label", LandingPad.EndLabel, @@ -3007,8 +3019,8 @@ else Asm->EmitInt64(0); } else { - EmitSectionOffset("label", "eh_func_begin", - LandingPad.LandingPadLabel, SubprogramCount); + EmitSectionOffset("label", "eh_func_begin", LandingPad.LandingPadLabel, + SubprogramCount, false, true); } Asm->EOL("Landing pad"); From asl at math.spbu.ru Tue May 1 17:23:41 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 1 May 2007 17:23:41 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetAsmInfo.h Message-ID: <200705012223.l41MNf9L001601@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetAsmInfo.h updated: 1.31 -> 1.32 --- Log message: Fix couple of bugs connected with eh info: 1. Correct output offsets on Linux 2. Fix "style" of personality function. It shouldn't be indirect. --- Diffs of the changes: (+13 -6) TargetAsmInfo.h | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) Index: llvm/include/llvm/Target/TargetAsmInfo.h diff -u llvm/include/llvm/Target/TargetAsmInfo.h:1.31 llvm/include/llvm/Target/TargetAsmInfo.h:1.32 --- llvm/include/llvm/Target/TargetAsmInfo.h:1.31 Sun Apr 29 14:17:45 2007 +++ llvm/include/llvm/Target/TargetAsmInfo.h Tue May 1 17:23:12 2007 @@ -263,10 +263,14 @@ //===--- Dwarf Emission Directives -----------------------------------===// - /// AbsoluteSectionOffsets - True if we should emit abolute section - /// offsets. Defaults to false. - bool AbsoluteSectionOffsets; - + /// AbsoluteDebugSectionOffsets - True if we should emit abolute section + /// offsets for debug information. Defaults to false. + bool AbsoluteDebugSectionOffsets; + + /// AbsoluteEHSectionOffsets - True if we should emit abolute section + /// offsets for EH information. Defaults to false. + bool AbsoluteEHSectionOffsets; + /// HasLEB128 - True if target asm supports leb128 directives. /// bool HasLEB128; // Defaults to false. @@ -530,8 +534,11 @@ const char *getProtectedDirective() const { return ProtectedDirective; } - bool isAbsoluteSectionOffsets() const { - return AbsoluteSectionOffsets; + bool isAbsoluteDebugSectionOffsets() const { + return AbsoluteDebugSectionOffsets; + } + bool isAbsoluteEHSectionOffsets() const { + return AbsoluteEHSectionOffsets; } bool hasLEB128() const { return HasLEB128; From asl at math.spbu.ru Tue May 1 17:23:41 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 1 May 2007 17:23:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetAsmInfo.cpp Message-ID: <200705012223.l41MNfw3001603@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetAsmInfo.cpp updated: 1.24 -> 1.25 --- Log message: Fix couple of bugs connected with eh info: 1. Correct output offsets on Linux 2. Fix "style" of personality function. It shouldn't be indirect. --- Diffs of the changes: (+2 -1) TargetAsmInfo.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Target/TargetAsmInfo.cpp diff -u llvm/lib/Target/TargetAsmInfo.cpp:1.24 llvm/lib/Target/TargetAsmInfo.cpp:1.25 --- llvm/lib/Target/TargetAsmInfo.cpp:1.24 Sun Apr 29 13:35:00 2007 +++ llvm/lib/Target/TargetAsmInfo.cpp Tue May 1 17:23:12 2007 @@ -75,7 +75,8 @@ WeakRefDirective(0), HiddenDirective("\t.hidden\t"), ProtectedDirective("\t.protected\t"), - AbsoluteSectionOffsets(false), + AbsoluteDebugSectionOffsets(false), + AbsoluteEHSectionOffsets(false), HasLEB128(false), HasDotLoc(false), HasDotFile(false), From asl at math.spbu.ru Tue May 1 17:23:42 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 1 May 2007 17:23:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp Message-ID: <200705012223.l41MNgX6001611@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetAsmInfo.cpp updated: 1.38 -> 1.39 --- Log message: Fix couple of bugs connected with eh info: 1. Correct output offsets on Linux 2. Fix "style" of personality function. It shouldn't be indirect. --- Diffs of the changes: (+4 -2) X86TargetAsmInfo.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.38 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.39 --- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.38 Tue May 1 05:19:31 2007 +++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp Tue May 1 17:23:12 2007 @@ -99,7 +99,8 @@ case X86Subtarget::isELF: // Set up DWARF directives HasLEB128 = true; // Target asm supports leb128 directives (little-endian) - AbsoluteSectionOffsets = true; + AbsoluteDebugSectionOffsets = true; + AbsoluteEHSectionOffsets = false; // bool HasLEB128; // Defaults to false. // hasDotLoc - True if target asm supports .loc directives. // bool HasDotLoc; // Defaults to false. @@ -141,7 +142,8 @@ // Set up DWARF directives HasLEB128 = true; // Target asm supports leb128 directives (little-endian) - AbsoluteSectionOffsets = true; + AbsoluteDebugSectionOffsets = true; + AbsoluteEHSectionOffsets = false; PrivateGlobalPrefix = "L"; // Prefix for private global symbols WeakRefDirective = "\t.weak\t"; SetDirective = "\t.set\t"; From dalej at apple.com Tue May 1 20:03:00 2007 From: dalej at apple.com (Dale Johannesen) Date: Tue, 1 May 2007 20:03:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetAsmInfo.h ARMTargetAsmInfo.cpp Message-ID: <200705020103.l42130Kr004648@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMTargetAsmInfo.h updated: 1.3 -> 1.4 ARMTargetAsmInfo.cpp updated: 1.18 -> 1.19 --- Log message: Add some support for (Darwin) code-generating directives in getInlineAsmLength. Support is incomplete, but more accurate than gcc's. --- Diffs of the changes: (+115 -18) ARMTargetAsmInfo.cpp | 128 ++++++++++++++++++++++++++++++++++++++++++++------- ARMTargetAsmInfo.h | 5 + 2 files changed, 115 insertions(+), 18 deletions(-) Index: llvm/lib/Target/ARM/ARMTargetAsmInfo.h diff -u llvm/lib/Target/ARM/ARMTargetAsmInfo.h:1.3 llvm/lib/Target/ARM/ARMTargetAsmInfo.h:1.4 --- llvm/lib/Target/ARM/ARMTargetAsmInfo.h:1.3 Sun Apr 29 14:17:45 2007 +++ llvm/lib/Target/ARM/ARMTargetAsmInfo.h Tue May 1 20:02:40 2007 @@ -15,6 +15,7 @@ #define ARMTARGETASMINFO_H #include "llvm/Target/TargetAsmInfo.h" +#include "ARMSubtarget.h" namespace llvm { @@ -24,9 +25,11 @@ struct ARMTargetAsmInfo : public TargetAsmInfo { ARMTargetAsmInfo(const ARMTargetMachine &TM); - bool isThumb; + const ARMSubtarget *Subtarget; virtual unsigned getInlineAsmLength(const char *Str) const; + unsigned countArguments(const char *p) const; + unsigned countString(const char *p) const; }; Index: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp diff -u llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.18 llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.19 --- llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.18 Sun Apr 29 19:30:48 2007 +++ llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp Tue May 1 20:02:40 2007 @@ -1,3 +1,4 @@ + //===-- ARMTargetAsmInfo.cpp - ARM asm properties ---------------*- C++ -*-===// // // The LLVM Compiler Infrastructure @@ -18,7 +19,7 @@ using namespace llvm; ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) { - const ARMSubtarget *Subtarget = &TM.getSubtarget(); + Subtarget = &TM.getSubtarget(); if (Subtarget->isTargetDarwin()) { GlobalPrefix = "_"; PrivateGlobalPrefix = "L"; @@ -85,13 +86,42 @@ InlineAsmStart = "@ InlineAsm Start"; InlineAsmEnd = "@ InlineAsm End"; LCOMMDirective = "\t.lcomm\t"; - isThumb = Subtarget->isThumb(); +} + +/// Count the number of comma-separated arguments. +/// Do not try to detect errors. +unsigned ARMTargetAsmInfo::countArguments(const char* p) const { + unsigned count = 0; + while (*p && isspace(*p) && *p != '\n') + p++; + count++; + while (*p && *p!='\n' && + strncmp(p, CommentString, strlen(CommentString))!=0) { + if (*p==',') + count++; + p++; + } + return count; +} + +/// Count the length of a string enclosed in quote characters. +/// Do not try to detect errors. +unsigned ARMTargetAsmInfo::countString(const char* p) const { + unsigned count = 0; + while (*p && isspace(*p) && *p!='\n') + p++; + if (!*p || *p != '\"') + return count; + while (*++p && *p != '\"') + count++; + return count; } /// ARM-specific version of TargetAsmInfo::getInlineAsmLength. unsigned ARMTargetAsmInfo::getInlineAsmLength(const char *Str) const { // Count the number of bytes in the asm. bool atInsnStart = true; + bool inTextSection = true; unsigned Length = 0; for (; *Str; ++Str) { if (atInsnStart) { @@ -102,30 +132,94 @@ for (const char* p = Str; *p && !isspace(*p); p++) if (*p == ':') { Str = p+1; + while (*Str && isspace(*Str) && *Str != '\n') + Str++; break; } // Ignore everything from comment char(s) to EOL if (strncmp(Str, CommentString, strlen(CommentString))==-0) atInsnStart = false; - else { + // FIXME do something like the following for non-Darwin + else if (*Str == '.' && Subtarget->isTargetDarwin()) { + // Directive. + atInsnStart = false; + // Some change the section, but don't generate code. + if (strncasecmp(Str, ".literal4", strlen(".literal4"))==0 || + strncasecmp(Str, ".literal8", strlen(".literal8"))==0 || + strncasecmp(Str, ".const", strlen(".const"))==0 || + strncasecmp(Str, ".constructor", strlen(".constructor"))==0 || + strncasecmp(Str, ".cstring", strlen(".cstring"))==0 || + strncasecmp(Str, ".data", strlen(".data"))==0 || + strncasecmp(Str, ".destructor", strlen(".destructor"))==0 || + strncasecmp(Str, ".fvmlib_init0", strlen(".fvmlib_init0"))==0 || + strncasecmp(Str, ".fvmlib_init1", strlen(".fvmlib_init1"))==0 || + strncasecmp(Str, ".mod_init_func", strlen(".mod_init_func"))==0 || + strncasecmp(Str, ".mod_term_func", strlen(".mod_term_func"))==0 || + strncasecmp(Str, ".picsymbol_stub", strlen(".picsymbol_stub"))==0 || + strncasecmp(Str, ".symbol_stub", strlen(".symbol_stub"))==0 || + strncasecmp(Str, ".static_data", strlen(".static_data"))==0 || + strncasecmp(Str, ".section", strlen(".section"))==0 || + strncasecmp(Str, ".lazy_symbol_pointer", strlen(".lazy_symbol_pointer"))==0 || + strncasecmp(Str, ".non_lazy_symbol_pointer", strlen(".non_lazy_symbol_pointer"))==0 || + strncasecmp(Str, ".dyld", strlen(".dyld"))==0 || + strncasecmp(Str, ".const_data", strlen(".const_data"))==0 || + strncasecmp(Str, ".objc", strlen(".objc"))==0 || //// many directives + strncasecmp(Str, ".static_const", strlen(".static_const"))==0) + inTextSection=false; + else if (strncasecmp(Str, ".text", strlen(".text"))==0) + inTextSection = true; + // Some can't really be handled without implementing significant pieces + // of an assembler. Others require dynamic adjustment of block sizes in + // AdjustBBOffsetsAfter; it's a big compile-time speed hit to check every + // instruction in there, and none of these are currently used in the kernel. + else if (strncasecmp(Str, ".macro", strlen(".macro"))==0 || + strncasecmp(Str, ".if", strlen(".if"))==0 || + strncasecmp(Str, ".align", strlen(".align"))==0 || + strncasecmp(Str, ".fill", strlen(".fill"))==0 || + strncasecmp(Str, ".space", strlen(".space"))==0 || + strncasecmp(Str, ".zerofill", strlen(".zerofill"))==0 || + strncasecmp(Str, ".p2align", strlen(".p2align"))==0 || + strncasecmp(Str, ".p2alignw", strlen(".p2alignw"))==0 || + strncasecmp(Str, ".p2alignl", strlen(".p2alignl"))==0 || + strncasecmp(Str, ".align32", strlen(".p2align32"))==0 || + strncasecmp(Str, ".include", strlen(".include"))==0) + cerr << "Directive " << Str << " in asm may lead to invalid offsets for" << + " constant pools (the assembler will tell you if this happens).\n"; + // Some generate code, but this is only interesting in the text section. + else if (inTextSection) { + if (strncasecmp(Str, ".long", strlen(".long"))==0) + Length += 4*countArguments(Str+strlen(".long")); + else if (strncasecmp(Str, ".short", strlen(".short"))==0) + Length += 2*countArguments(Str+strlen(".short")); + else if (strncasecmp(Str, ".byte", strlen(".byte"))==0) + Length += 1*countArguments(Str+strlen(".byte")); + else if (strncasecmp(Str, ".single", strlen(".single"))==0) + Length += 4*countArguments(Str+strlen(".single")); + else if (strncasecmp(Str, ".double", strlen(".double"))==0) + Length += 8*countArguments(Str+strlen(".double")); + else if (strncasecmp(Str, ".quad", strlen(".quad"))==0) + Length += 16*countArguments(Str+strlen(".quad")); + else if (strncasecmp(Str, ".ascii", strlen(".ascii"))==0) + Length += countString(Str+strlen(".ascii")); + else if (strncasecmp(Str, ".asciz", strlen(".asciz"))==0) + Length += countString(Str+strlen(".asciz"))+1; + } + } else if (inTextSection) { // An instruction atInsnStart = false; - if (isThumb) { + if (Subtarget->isThumb()) { // BL and BLX are 4 bytes, all others 2. - if ((*Str=='b' || *Str=='B') && - (*(Str+1)=='l' || *(Str+1)=='L')) { - if (*(Str+2)=='x' || *(Str+2)=='X') { - const char* p = Str+3; - while (*p && isspace(*p)) - p++; - if (*p == 'r' || *p=='R') - Length += 2; // BLX reg - else - Length += 4; // BLX non-reg - } + if (strncasecmp(Str, "blx", strlen("blx"))==0) { + const char* p = Str+3; + while (*p && isspace(*p)) + p++; + if (*p == 'r' || *p=='R') + Length += 2; // BLX reg else - Length += 4; // BL - } else + Length += 4; // BLX non-reg + } else if (strncasecmp(Str, "bl", strlen("bl"))==0) + Length += 4; // BL + else Length += 2; // Thumb anything else } else From evan.cheng at apple.com Tue May 1 20:10:23 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 1 May 2007 18:10:23 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetAsmInfo.h ARMTargetAsmInfo.cpp In-Reply-To: <200705020103.l42130Kr004648@zion.cs.uiuc.edu> References: <200705020103.l42130Kr004648@zion.cs.uiuc.edu> Message-ID: Woot! Fun stuff. :-) Thanks Dale. Evan On May 1, 2007, at 6:03 PM, Dale Johannesen wrote: > > > Changes in directory llvm/lib/Target/ARM: > > ARMTargetAsmInfo.h updated: 1.3 -> 1.4 > ARMTargetAsmInfo.cpp updated: 1.18 -> 1.19 > --- > Log message: > > Add some support for (Darwin) code-generating directives in > getInlineAsmLength. > Support is incomplete, but more accurate than gcc's. > > > --- > Diffs of the changes: (+115 -18) > > ARMTargetAsmInfo.cpp | 128 +++++++++++++++++++++++++++++++++++++++ > +++++------- > ARMTargetAsmInfo.h | 5 + > 2 files changed, 115 insertions(+), 18 deletions(-) > > > Index: llvm/lib/Target/ARM/ARMTargetAsmInfo.h > diff -u llvm/lib/Target/ARM/ARMTargetAsmInfo.h:1.3 llvm/lib/Target/ > ARM/ARMTargetAsmInfo.h:1.4 > --- llvm/lib/Target/ARM/ARMTargetAsmInfo.h:1.3 Sun Apr 29 14:17:45 > 2007 > +++ llvm/lib/Target/ARM/ARMTargetAsmInfo.h Tue May 1 20:02:40 2007 > @@ -15,6 +15,7 @@ > #define ARMTARGETASMINFO_H > > #include "llvm/Target/TargetAsmInfo.h" > +#include "ARMSubtarget.h" > > namespace llvm { > > @@ -24,9 +25,11 @@ > struct ARMTargetAsmInfo : public TargetAsmInfo { > ARMTargetAsmInfo(const ARMTargetMachine &TM); > > - bool isThumb; > + const ARMSubtarget *Subtarget; > > virtual unsigned getInlineAsmLength(const char *Str) const; > + unsigned countArguments(const char *p) const; > + unsigned countString(const char *p) const; > }; > > > > > Index: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp > diff -u llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.18 llvm/lib/ > Target/ARM/ARMTargetAsmInfo.cpp:1.19 > --- llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.18 Sun Apr 29 > 19:30:48 2007 > +++ llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp Tue May 1 20:02:40 2007 > @@ -1,3 +1,4 @@ > + > //===-- ARMTargetAsmInfo.cpp - ARM asm properties --------------- > *- C++ -*-===// > // > // The LLVM Compiler Infrastructure > @@ -18,7 +19,7 @@ > using namespace llvm; > > ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) { > - const ARMSubtarget *Subtarget = &TM.getSubtarget(); > + Subtarget = &TM.getSubtarget(); > if (Subtarget->isTargetDarwin()) { > GlobalPrefix = "_"; > PrivateGlobalPrefix = "L"; > @@ -85,13 +86,42 @@ > InlineAsmStart = "@ InlineAsm Start"; > InlineAsmEnd = "@ InlineAsm End"; > LCOMMDirective = "\t.lcomm\t"; > - isThumb = Subtarget->isThumb(); > +} > + > +/// Count the number of comma-separated arguments. > +/// Do not try to detect errors. > +unsigned ARMTargetAsmInfo::countArguments(const char* p) const { > + unsigned count = 0; > + while (*p && isspace(*p) && *p != '\n') > + p++; > + count++; > + while (*p && *p!='\n' && > + strncmp(p, CommentString, strlen(CommentString))!=0) { > + if (*p==',') > + count++; > + p++; > + } > + return count; > +} > + > +/// Count the length of a string enclosed in quote characters. > +/// Do not try to detect errors. > +unsigned ARMTargetAsmInfo::countString(const char* p) const { > + unsigned count = 0; > + while (*p && isspace(*p) && *p!='\n') > + p++; > + if (!*p || *p != '\"') > + return count; > + while (*++p && *p != '\"') > + count++; > + return count; > } > > /// ARM-specific version of TargetAsmInfo::getInlineAsmLength. > unsigned ARMTargetAsmInfo::getInlineAsmLength(const char *Str) > const { > // Count the number of bytes in the asm. > bool atInsnStart = true; > + bool inTextSection = true; > unsigned Length = 0; > for (; *Str; ++Str) { > if (atInsnStart) { > @@ -102,30 +132,94 @@ > for (const char* p = Str; *p && !isspace(*p); p++) > if (*p == ':') { > Str = p+1; > + while (*Str && isspace(*Str) && *Str != '\n') > + Str++; > break; > } > // Ignore everything from comment char(s) to EOL > if (strncmp(Str, CommentString, strlen(CommentString))==-0) > atInsnStart = false; > - else { > + // FIXME do something like the following for non-Darwin > + else if (*Str == '.' && Subtarget->isTargetDarwin()) { > + // Directive. > + atInsnStart = false; > + // Some change the section, but don't generate code. > + if (strncasecmp(Str, ".literal4", strlen(".literal4"))==0 || > + strncasecmp(Str, ".literal8", strlen(".literal8"))==0 || > + strncasecmp(Str, ".const", strlen(".const"))==0 || > + strncasecmp(Str, ".constructor", strlen > (".constructor"))==0 || > + strncasecmp(Str, ".cstring", strlen(".cstring"))==0 || > + strncasecmp(Str, ".data", strlen(".data"))==0 || > + strncasecmp(Str, ".destructor", strlen(".destructor")) > ==0 || > + strncasecmp(Str, ".fvmlib_init0", strlen > (".fvmlib_init0"))==0 || > + strncasecmp(Str, ".fvmlib_init1", strlen > (".fvmlib_init1"))==0 || > + strncasecmp(Str, ".mod_init_func", strlen > (".mod_init_func"))==0 || > + strncasecmp(Str, ".mod_term_func", strlen > (".mod_term_func"))==0 || > + strncasecmp(Str, ".picsymbol_stub", strlen > (".picsymbol_stub"))==0 || > + strncasecmp(Str, ".symbol_stub", strlen > (".symbol_stub"))==0 || > + strncasecmp(Str, ".static_data", strlen > (".static_data"))==0 || > + strncasecmp(Str, ".section", strlen(".section"))==0 || > + strncasecmp(Str, ".lazy_symbol_pointer", strlen > (".lazy_symbol_pointer"))==0 || > + strncasecmp(Str, ".non_lazy_symbol_pointer", strlen > (".non_lazy_symbol_pointer"))==0 || > + strncasecmp(Str, ".dyld", strlen(".dyld"))==0 || > + strncasecmp(Str, ".const_data", strlen(".const_data")) > ==0 || > + strncasecmp(Str, ".objc", strlen(".objc"))==0 > || //// many directives > + strncasecmp(Str, ".static_const", strlen > (".static_const"))==0) > + inTextSection=false; > + else if (strncasecmp(Str, ".text", strlen(".text"))==0) > + inTextSection = true; > + // Some can't really be handled without implementing > significant pieces > + // of an assembler. Others require dynamic adjustment of > block sizes in > + // AdjustBBOffsetsAfter; it's a big compile-time speed hit > to check every > + // instruction in there, and none of these are currently > used in the kernel. > + else if (strncasecmp(Str, ".macro", strlen(".macro"))==0 || > + strncasecmp(Str, ".if", strlen(".if"))==0 || > + strncasecmp(Str, ".align", strlen(".align"))==0 || > + strncasecmp(Str, ".fill", strlen(".fill"))==0 || > + strncasecmp(Str, ".space", strlen(".space"))==0 || > + strncasecmp(Str, ".zerofill", strlen(".zerofill")) > ==0 || > + strncasecmp(Str, ".p2align", strlen(".p2align")) > ==0 || > + strncasecmp(Str, ".p2alignw", strlen(".p2alignw")) > ==0 || > + strncasecmp(Str, ".p2alignl", strlen(".p2alignl")) > ==0 || > + strncasecmp(Str, ".align32", strlen(".p2align32")) > ==0 || > + strncasecmp(Str, ".include", strlen(".include"))==0) > + cerr << "Directive " << Str << " in asm may lead to > invalid offsets for" << > + " constant pools (the assembler will tell you > if this happens).\n"; > + // Some generate code, but this is only interesting in the > text section. > + else if (inTextSection) { > + if (strncasecmp(Str, ".long", strlen(".long"))==0) > + Length += 4*countArguments(Str+strlen(".long")); > + else if (strncasecmp(Str, ".short", strlen(".short"))==0) > + Length += 2*countArguments(Str+strlen(".short")); > + else if (strncasecmp(Str, ".byte", strlen(".byte"))==0) > + Length += 1*countArguments(Str+strlen(".byte")); > + else if (strncasecmp(Str, ".single", strlen(".single"))==0) > + Length += 4*countArguments(Str+strlen(".single")); > + else if (strncasecmp(Str, ".double", strlen(".double"))==0) > + Length += 8*countArguments(Str+strlen(".double")); > + else if (strncasecmp(Str, ".quad", strlen(".quad"))==0) > + Length += 16*countArguments(Str+strlen(".quad")); > + else if (strncasecmp(Str, ".ascii", strlen(".ascii"))==0) > + Length += countString(Str+strlen(".ascii")); > + else if (strncasecmp(Str, ".asciz", strlen(".asciz"))==0) > + Length += countString(Str+strlen(".asciz"))+1; > + } > + } else if (inTextSection) { > // An instruction > atInsnStart = false; > - if (isThumb) { > + if (Subtarget->isThumb()) { > // BL and BLX are 4 bytes, all others 2. > - if ((*Str=='b' || *Str=='B') && > - (*(Str+1)=='l' || *(Str+1)=='L')) { > - if (*(Str+2)=='x' || *(Str+2)=='X') { > - const char* p = Str+3; > - while (*p && isspace(*p)) > - p++; > - if (*p == 'r' || *p=='R') > - Length += 2; // BLX reg > - else > - Length += 4; // BLX non-reg > - } > + if (strncasecmp(Str, "blx", strlen("blx"))==0) { > + const char* p = Str+3; > + while (*p && isspace(*p)) > + p++; > + if (*p == 'r' || *p=='R') > + Length += 2; // BLX reg > else > - Length += 4; // BL > - } else > + Length += 4; // BLX non-reg > + } else if (strncasecmp(Str, "bl", strlen("bl"))==0) > + Length += 4; // BL > + else > Length += 2; // Thumb anything else > } > else > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From reid at x10sys.com Tue May 1 20:42:18 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 1 May 2007 20:42:18 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200705020142.l421gIOU005376@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.115 -> 1.116 --- Log message: Add Alireza Moshtaghi --- Diffs of the changes: (+3 -1) DevMtgMay2007.html | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.115 llvm-www/DevMtgMay2007.html:1.116 --- llvm-www/DevMtgMay2007.html:1.115 Fri Apr 27 13:31:19 2007 +++ llvm-www/DevMtgMay2007.html Tue May 1 20:42:00 2007 @@ -127,6 +127,7 @@ LLVM, that tutorial you gave last week, etc.

+ @@ -319,6 +320,7 @@ + @@ -360,6 +362,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
Last modified: $Date: 2007/04/27 18:31:19 $ +
Last modified: $Date: 2007/05/02 01:42:00 $ From reid at x10sys.com Tue May 1 21:17:59 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 1 May 2007 21:17:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200705020217.l422HxcB006301@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.339 -> 1.340 --- Log message: Make sign extension work correctly for unusual bit widths. --- Diffs of the changes: (+100 -28) CBackend.cpp | 128 ++++++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 100 insertions(+), 28 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.339 llvm/lib/Target/CBackend/CBackend.cpp:1.340 --- llvm/lib/Target/CBackend/CBackend.cpp:1.339 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Tue May 1 21:17:41 2007 @@ -412,6 +412,29 @@ } } +#define IMPL_SIGN_EXTENSION(OpTy, Func) { \ + const IntegerType* IntTy = cast(OpTy); \ + unsigned BitWidth = IntTy->getBitWidth(); \ + if (BitWidth != 8 && BitWidth != 16 && BitWidth != 32 && \ + BitWidth != 64 && BitWidth != 128) { \ + const char * Suffix; \ + if (BitWidth <=32)\ + Suffix = "U"; \ + else \ + Suffix = "ULL"; \ + Out << "("; \ + Func; \ + Out << " & (1" << Suffix << " << " << BitWidth - 1 << " ) ? "; \ + Func; \ + Out << " | " << (~IntTy->getBitMask()) << Suffix << " : "; \ + Func; \ + Out << " & " << IntTy->getBitMask() << Suffix; \ + Out << ")";\ + } \ + else \ + Func; \ + } + // Pass the Type* and the variable name and this prints out the variable // declaration. // @@ -711,23 +734,39 @@ case Instruction::BitCast: Out << "("; printCast(CE->getOpcode(), CE->getOperand(0)->getType(), CE->getType()); - if (CE->getOpcode() == Instruction::SExt && - CE->getOperand(0)->getType() == Type::Int1Ty) { - // Make sure we really sext from bool here by subtracting from 0 - Out << "0-"; - } - printConstant(CE->getOperand(0)); - if (CE->getType() == Type::Int1Ty && - (CE->getOpcode() == Instruction::Trunc || + if (CE->getOpcode() == Instruction::Trunc || CE->getOpcode() == Instruction::FPToUI || CE->getOpcode() == Instruction::FPToSI || - CE->getOpcode() == Instruction::PtrToInt)) { - // Make sure we really truncate to bool here by anding with 1 - Out << "&1u"; + CE->getOpcode() == Instruction::PtrToInt) { + if (const IntegerType* IntTy = dyn_cast(CE->getType())) { + uint64_t BitMask = IntTy->getBitMask(); + printConstant(CE->getOperand(0)); + Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); + } } - Out << ')'; + else if (CE->getOpcode() == Instruction::SExt && + CE->getOperand(0)->getType() == Type::Int1Ty) { + // Make sure we really sext from bool here by subtracting from 0 + Out << "0-"; + printConstant(CE->getOperand(0)); + } + else if (CE->getOpcode() == Instruction::SExt && + CE->getOperand(0)->getType()->getTypeID() == Type::IntegerTyID) { + IMPL_SIGN_EXTENSION(CE->getOperand(0)->getType(), + printConstant(CE->getOperand(0))); + } + else if (CE->getOpcode() == Instruction::ZExt && + CE->getOperand(0)->getType()->getTypeID() == Type::IntegerTyID){ + const IntegerType* IntTy = + cast(CE->getOperand(0)->getType()); + uint64_t BitMask = IntTy->getBitMask(); + writeOperand(CE->getOperand(0)); + Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); + } + else + printConstant(CE->getOperand(0)); + Out << ")"; return; - case Instruction::GetElementPtr: Out << "(&("; printIndexingExpression(CE->getOperand(0), gep_type_begin(CPV), @@ -1228,7 +1267,11 @@ Out << "(("; printSimpleType(Out, OpTy, castIsSigned); Out << ")"; - writeOperand(Operand); + if (castIsSigned && OpTy->getTypeID() == Type::IntegerTyID) { + IMPL_SIGN_EXTENSION(OpTy, writeOperand(Operand)); + } + else + writeOperand(Operand); Out << ")"; } else writeOperand(Operand); @@ -1253,7 +1296,9 @@ switch (predicate) { default: // for eq and ne, it doesn't matter - break; + break; + case ICmpInst::ICMP_EQ: + case ICmpInst::ICMP_NE: case ICmpInst::ICMP_UGT: case ICmpInst::ICMP_UGE: case ICmpInst::ICMP_ULT: @@ -1278,10 +1323,25 @@ else printType(Out, OpTy); // not integer, sign doesn't matter Out << ")"; - writeOperand(Operand); + if(castIsSigned && OpTy->getTypeID() == Type::IntegerTyID) { + IMPL_SIGN_EXTENSION(OpTy, writeOperand(Operand)); + } else { + writeOperand(Operand); + if(OpTy->getTypeID() == Type::IntegerTyID){ + const IntegerType * IntTy = cast(OpTy); + uint64_t BitMask = IntTy->getBitMask(); + Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); + } + } Out << ")"; - } else + } else { writeOperand(Operand); + if(OpTy->getTypeID() == Type::IntegerTyID){ + const IntegerType * IntTy = cast(OpTy); + uint64_t BitMask = IntTy->getBitMask(); + Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); + } + } } // generateCompilerSpecificCode - This is where we add conditional compilation @@ -2346,21 +2406,33 @@ << getFloatBitCastField(I.getType()); } else { printCast(I.getOpcode(), SrcTy, DstTy); - if (I.getOpcode() == Instruction::SExt && SrcTy == Type::Int1Ty) { + if (I.getOpcode() == Instruction::Trunc || + I.getOpcode() == Instruction::FPToUI || + I.getOpcode() == Instruction::FPToSI || + I.getOpcode() == Instruction::PtrToInt) { + if (const IntegerType* IntTy = dyn_cast(DstTy)){ + uint64_t BitMask = IntTy->getBitMask(); + writeOperand(I.getOperand(0)); + Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); + } + } else if (I.getOpcode() == Instruction::SExt && SrcTy == Type::Int1Ty) { // Make sure we really get a sext from bool by subtracing the bool from 0 Out << "0-"; + writeOperand(I.getOperand(0)); + } else if (I.getOpcode() == Instruction::SExt && + SrcTy->getTypeID() == Type::IntegerTyID) { + IMPL_SIGN_EXTENSION(SrcTy, writeOperand(I.getOperand(0)) ); + } else if (I.getOpcode() == Instruction::ZExt && + SrcTy->getTypeID() == Type::IntegerTyID) { + const IntegerType* IntTy = cast(SrcTy); + uint64_t BitMask = IntTy->getBitMask(); + writeOperand(I.getOperand(0)); + Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); } - writeOperand(I.getOperand(0)); - if (DstTy == Type::Int1Ty && - (I.getOpcode() == Instruction::Trunc || - I.getOpcode() == Instruction::FPToUI || - I.getOpcode() == Instruction::FPToSI || - I.getOpcode() == Instruction::PtrToInt)) { - // Make sure we really get a trunc to bool by anding the operand with 1 - Out << "&1u"; - } + else + writeOperand(I.getOperand(0)); } - Out << ')'; + Out << ")"; } void CWriter::visitSelectInst(SelectInst &I) { From reid at x10sys.com Tue May 1 21:35:43 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 1 May 2007 21:35:43 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bits.h Message-ID: <200705020235.l422Zhgc006682@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: bits.h updated: 1.4 -> 1.5 --- Log message: Add some bit widths. Make conversion from hex string easier. --- Diffs of the changes: (+9 -1) bits.h | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletion(-) Index: llvm-test/SingleSource/UnitTests/Integer/bits.h diff -u llvm-test/SingleSource/UnitTests/Integer/bits.h:1.4 llvm-test/SingleSource/UnitTests/Integer/bits.h:1.5 --- llvm-test/SingleSource/UnitTests/Integer/bits.h:1.4 Sat Apr 21 12:47:59 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bits.h Tue May 1 21:35:26 2007 @@ -40,12 +40,14 @@ typedef unsigned int __attribute__((bitwidth(68))) uint68; typedef unsigned int __attribute__((bitwidth(128))) uint128; -typedef int __attribute__ ((bitwidth(9))) int9; +typedef int __attribute__((bitwidth(9))) int9; typedef int __attribute__((bitwidth(10))) int10; typedef int __attribute__((bitwidth(21))) int21; typedef int __attribute__((bitwidth(24))) int24; typedef int __attribute__((bitwidth(32))) int32; typedef int __attribute__((bitwidth(33))) int33; +typedef int __attribute__((bitwidth(68))) int68; +typedef int __attribute__((bitwidth(69))) int69; typedef int __attribute__((bitwidth(169))) int169; typedef unsigned int __attribute__((bitwidth(250))) int250; @@ -111,3 +113,9 @@ __builtin_bit_from_string(&Result, str, 10); \ Result; \ }) + +#define bitsFromHexString(str,bits) ({ \ + int __attribute__((bitwidth(bits))) Result; \ + __builtin_bit_from_string(&Result, str, 16); \ + Result; \ +}) From sabre at nondot.org Tue May 1 23:02:02 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 1 May 2007 23:02:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Pass.cpp Message-ID: <200705020402.l42422AB008362@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Pass.cpp updated: 1.88 -> 1.89 --- Log message: disable this assertion as a hack to get the build more unbroken :( --- Diffs of the changes: (+1 -1) Pass.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/VMCore/Pass.cpp diff -u llvm/lib/VMCore/Pass.cpp:1.88 llvm/lib/VMCore/Pass.cpp:1.89 --- llvm/lib/VMCore/Pass.cpp:1.88 Tue May 1 16:15:47 2007 +++ llvm/lib/VMCore/Pass.cpp Tue May 1 23:01:44 2007 @@ -155,7 +155,7 @@ void RegisterPass(PassInfo &PI) { bool Inserted = PassInfoMap.insert(std::make_pair(PI.getTypeInfo(),&PI)).second; - assert(Inserted && "Pass registered multiple times!"); + //assert(Inserted && "Pass registered multiple times!"); } void UnregisterPass(PassInfo &PI) { From clattner at apple.com Tue May 1 23:15:05 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 1 May 2007 21:15:05 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp ARMLoadStoreOptimizer.cpp In-Reply-To: <200705012117.l41LHfn6031365@zion.cs.uiuc.edu> References: <200705012117.l41LHfn6031365@zion.cs.uiuc.edu> Message-ID: > + static const int ID; > + ARMConstantIslands() : MachineFunctionPass((intptr_t)&ID) {} Why the cast to intptr_t? Why not just make the ctors take void* ? -Chris From sabre at nondot.org Tue May 1 23:25:54 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 1 May 2007 23:25:54 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Pass.h PassSupport.h Message-ID: <200705020425.l424PsKA008866@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Pass.h updated: 1.87 -> 1.88 PassSupport.h updated: 1.39 -> 1.40 --- Log message: revert enough of devang's recent patches to get the tree basically working again --- Diffs of the changes: (+20 -20) Pass.h | 14 +++++++------- PassSupport.h | 26 +++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.87 llvm/include/llvm/Pass.h:1.88 --- llvm/include/llvm/Pass.h:1.87 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Pass.h Tue May 1 23:25:30 2007 @@ -34,8 +34,8 @@ #include #include #include +#include #include -#include namespace llvm { @@ -77,7 +77,7 @@ /// class Pass { AnalysisResolver *Resolver; // Used to resolve analysis - intptr_t PassID; + const PassInfo *PassInfoCache; // AnalysisImpls - This keeps track of which passes implement the interfaces // that are required by the current pass (to implement getAnalysis()). @@ -87,7 +87,7 @@ void operator=(const Pass&); // DO NOT IMPLEMENT Pass(const Pass &); // DO NOT IMPLEMENT public: - Pass(intptr_t pid) : Resolver(0), PassID(pid) {} + Pass(intptr_t pid = 0) : Resolver(0), PassInfoCache(0) {} virtual ~Pass(); /// getPassName - Return a nice clean name for a pass. This usually @@ -163,12 +163,12 @@ template static const PassInfo *getClassPassInfo() { - return lookupPassInfo((intptr_t)&AnalysisClass::ID); + return lookupPassInfo(typeid(AnalysisClass)); } // lookupPassInfo - Return the pass info object for the specified pass class, // or null if it is not known. - static const PassInfo *lookupPassInfo(intptr_t TI); + static const PassInfo *lookupPassInfo(const std::type_info &TI); /// getAnalysisToUpdate() - This function is used by subclasses /// to get to the analysis information that might be around that needs to be @@ -274,7 +274,7 @@ class FunctionPass : public Pass { public: FunctionPass(intptr_t pid) : Pass(pid) {} - + /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. /// @@ -325,7 +325,7 @@ class BasicBlockPass : public Pass { public: BasicBlockPass(intptr_t pid) : Pass(pid) {} - + /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. /// Index: llvm/include/llvm/PassSupport.h diff -u llvm/include/llvm/PassSupport.h:1.39 llvm/include/llvm/PassSupport.h:1.40 --- llvm/include/llvm/PassSupport.h:1.39 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/PassSupport.h Tue May 1 23:25:30 2007 @@ -37,19 +37,19 @@ class PassInfo { const char *PassName; // Nice name for Pass const char *PassArgument; // Command Line argument to run this pass - intptr_t PassID; + const std::type_info &TypeInfo; // type_info object for this Pass class bool IsCFGOnlyPass; // Pass only looks at the CFG. bool IsAnalysisGroup; // True if an analysis group. std::vector ItfImpl;// Interfaces implemented by this pass - Pass *(*NormalCtor)(); + Pass *(*NormalCtor)(); // No argument ctor public: /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. - PassInfo(const char *name, const char *arg, intptr_t pi, + PassInfo(const char *name, const char *arg, const std::type_info &ti, Pass *(*normal)() = 0, bool isCFGOnly = false) - : PassName(name), PassArgument(arg), PassID(pi), + : PassName(name), PassArgument(arg), TypeInfo(ti), IsCFGOnlyPass(isCFGOnly), IsAnalysisGroup(false), NormalCtor(normal) { } @@ -65,8 +65,8 @@ const char *getPassArgument() const { return PassArgument; } /// getTypeInfo - Return the type_info object for the pass... - /// TODO : Rename - intptr_t getTypeInfo() const { return PassID; } + /// + const std::type_info &getTypeInfo() const { return TypeInfo; } /// isAnalysisGroup - Return true if this is an analysis group, not a normal /// pass. @@ -139,12 +139,12 @@ typedef Pass* (*NormalCtor_t)(); - RegisterPassBase(const char *Name, const char *Arg, intptr_t TI, + RegisterPassBase(const char *Name, const char *Arg, const std::type_info &TI, NormalCtor_t NormalCtor = 0, bool CFGOnly = false) : PIObj(Name, Arg, TI, NormalCtor, CFGOnly) { registerPass(); } - RegisterPassBase(intptr_t TI) + RegisterPassBase(const std::type_info &TI) : PIObj("", "", TI) { // This ctor may only be used for analysis groups: it does not auto-register // the pass. @@ -165,7 +165,7 @@ // Register Pass using default constructor... RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, (intptr_t)&PassName::ID, + : RegisterPassBase(Name, PassArg, typeid(PassName), (RegisterPassBase::NormalCtor_t)callDefaultCtor, CFGOnly) { } }; @@ -195,8 +195,8 @@ const PassInfo *ImplementationInfo; bool isDefaultImplementation; protected: - explicit RegisterAGBase(intptr_t InterfaceID, - intptr_t PassID = 0, + explicit RegisterAGBase(const std::type_info &Interface, + const std::type_info *Pass = 0, bool isDefault = false); void setGroupName(const char *Name); }; @@ -204,12 +204,12 @@ template struct RegisterAnalysisGroup : public RegisterAGBase { explicit RegisterAnalysisGroup(RegisterPassBase &RPB) - : RegisterAGBase((intptr_t) &Interface::ID, RPB.getPassInfo()->getTypeInfo(), + : RegisterAGBase(typeid(Interface), &RPB.getPassInfo()->getTypeInfo(), Default) { } explicit RegisterAnalysisGroup(const char *Name) - : RegisterAGBase((intptr_t) &Interface::ID) { + : RegisterAGBase(typeid(Interface)) { setGroupName(Name); } }; From sabre at nondot.org Tue May 1 23:25:54 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 1 May 2007 23:25:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Pass.cpp Message-ID: <200705020425.l424Ps1o008872@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Pass.cpp updated: 1.89 -> 1.90 --- Log message: revert enough of devang's recent patches to get the tree basically working again --- Diffs of the changes: (+16 -15) Pass.cpp | 31 ++++++++++++++++--------------- 1 files changed, 16 insertions(+), 15 deletions(-) Index: llvm/lib/VMCore/Pass.cpp diff -u llvm/lib/VMCore/Pass.cpp:1.89 llvm/lib/VMCore/Pass.cpp:1.90 --- llvm/lib/VMCore/Pass.cpp:1.89 Tue May 1 23:01:44 2007 +++ llvm/lib/VMCore/Pass.cpp Tue May 1 23:25:31 2007 @@ -133,7 +133,7 @@ class PassRegistrar { /// PassInfoMap - Keep track of the passinfo object for each registered llvm /// pass. - std::map PassInfoMap; + std::map PassInfoMap; /// AnalysisGroupInfo - Keep track of information for each analysis group. struct AnalysisGroupInfo { @@ -147,19 +147,19 @@ public: - const PassInfo *GetPassInfo(intptr_t TI) const { - std::map::const_iterator I = PassInfoMap.find(TI); + const PassInfo *GetPassInfo(const std::type_info &TI) const { + std::map::const_iterator I = PassInfoMap.find(TI); return I != PassInfoMap.end() ? I->second : 0; } void RegisterPass(PassInfo &PI) { bool Inserted = - PassInfoMap.insert(std::make_pair(PI.getTypeInfo(),&PI)).second; - //assert(Inserted && "Pass registered multiple times!"); + PassInfoMap.insert(std::make_pair(TypeInfo(PI.getTypeInfo()),&PI)).second; + assert(Inserted && "Pass registered multiple times!"); } void UnregisterPass(PassInfo &PI) { - std::map::iterator I = + std::map::iterator I = PassInfoMap.find(PI.getTypeInfo()); assert(I != PassInfoMap.end() && "Pass registered but not in map!"); @@ -168,7 +168,7 @@ } void EnumerateWith(PassRegistrationListener *L) { - for (std::map::const_iterator I = PassInfoMap.begin(), + for (std::map::const_iterator I = PassInfoMap.begin(), E = PassInfoMap.end(); I != E; ++I) L->passEnumerate(I->second); } @@ -210,10 +210,11 @@ // getPassInfo - Return the PassInfo data structure that corresponds to this // pass... const PassInfo *Pass::getPassInfo() const { - return lookupPassInfo(PassID); + if (PassInfoCache) return PassInfoCache; + return lookupPassInfo(typeid(*this)); } -const PassInfo *Pass::lookupPassInfo(intptr_t TI) { +const PassInfo *Pass::lookupPassInfo(const std::type_info &TI) { return getPassRegistrar()->GetPassInfo(TI); } @@ -237,12 +238,12 @@ // RegisterAGBase implementation // -RegisterAGBase::RegisterAGBase(intptr_t InterfaceID, - intptr_t PassID, bool isDefault) - : RegisterPassBase(InterfaceID), +RegisterAGBase::RegisterAGBase(const std::type_info &Interface, + const std::type_info *Pass, bool isDefault) + : RegisterPassBase(Interface), ImplementationInfo(0), isDefaultImplementation(isDefault) { - InterfaceInfo = const_cast(Pass::lookupPassInfo(InterfaceID)); + InterfaceInfo = const_cast(Pass::lookupPassInfo(Interface)); if (InterfaceInfo == 0) { // First reference to Interface, register it now. registerPass(); @@ -251,8 +252,8 @@ assert(PIObj.isAnalysisGroup() && "Trying to join an analysis group that is a normal pass!"); - if (PassID) { - ImplementationInfo = Pass::lookupPassInfo(PassID); + if (Pass) { + ImplementationInfo = Pass::lookupPassInfo(*Pass); assert(ImplementationInfo && "Must register pass before adding to AnalysisGroup!"); From sabre at nondot.org Tue May 1 23:26:55 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 1 May 2007 23:26:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705020426.l424QtvF008942@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.19 -> 1.20 --- Log message: use the correct code for binop instrs --- Diffs of the changes: (+1 -1) BitcodeWriter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.19 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.20 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.19 Tue May 1 02:03:37 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Tue May 1 23:26:36 2007 @@ -497,7 +497,7 @@ Vals.push_back(VE.getValueID(I.getOperand(0))); } else { assert(isa(I) && "Unknown instruction!"); - Code = bitc::CST_CODE_CE_BINOP; + Code = bitc::FUNC_CODE_INST_BINOP; Vals.push_back(GetEncodedBinaryOpcode(I.getOpcode())); Vals.push_back(VE.getTypeID(I.getType())); Vals.push_back(VE.getValueID(I.getOperand(0))); From sabre at nondot.org Tue May 1 23:27:44 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 1 May 2007 23:27:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705020427.l424Rigl009011@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.21 -> 1.22 --- Log message: read a few instructions, fix some bugs. This is enough to be able to round trip function bodies like this: define <2 x i64> @foo(<2 x i64> %x, <2 x i64> %y) { %tmp4 = bitcast <2 x i64> %y to <8 x i16> ; <<8 x i16>> [#uses=1] %tmp5 = bitcast <2 x i64> %x to <8 x i16> ; <<8 x i16>> [#uses=1] %tmp = add <8 x i16> %tmp5, %tmp4 ; <<8 x i16>> [#uses=1] %tmp6 = bitcast <8 x i16> %tmp to <2 x i64> ; <<2 x i64>> [#uses=1] ret <2 x i64> %tmp6 } --- Diffs of the changes: (+38 -15) BitcodeReader.cpp | 53 ++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 38 insertions(+), 15 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.21 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.22 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.21 Tue May 1 02:01:57 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Tue May 1 23:27:25 2007 @@ -1006,7 +1006,9 @@ ValueList.push_back(I); unsigned NextValueNo = ValueList.size(); - + BasicBlock *CurBB = 0; + unsigned CurBBNo = 0; + // Read all the records. SmallVector Record; while (1) { @@ -1042,8 +1044,6 @@ // Read a record. Record.clear(); Instruction *I = 0; - BasicBlock *CurBB = 0; - unsigned CurBBNo = 0; switch (Stream.ReadRecord(Code, Record)) { default: // Default behavior: reject return Error("Unknown instruction"); @@ -1057,8 +1057,7 @@ CurBB = FunctionBBs[0]; continue; - case bitc::FUNC_CODE_INST_BINOP: { - // BINOP: [opcode, ty, opval, opval] + case bitc::FUNC_CODE_INST_BINOP: { // BINOP: [opcode, ty, opval, opval] if (Record.size() < 4) return Error("Invalid BINOP record"); const Type *Ty = getTypeByID(Record[1]); int Opc = GetDecodedBinaryOpcode(Record[0], Ty); @@ -1069,9 +1068,18 @@ I = BinaryOperator::create((Instruction::BinaryOps)Opc, LHS, RHS); break; } + case bitc::FUNC_CODE_INST_CAST: { // CAST: [opcode, ty, opty, opval] + if (Record.size() < 4) return Error("Invalid CAST record"); + int Opc = GetDecodedCastOpcode(Record[0]); + const Type *ResTy = getTypeByID(Record[1]); + const Type *OpTy = getTypeByID(Record[2]); + Value *Op = getFnValueByID(Record[3], OpTy); + if (Opc == -1 || ResTy == 0 || OpTy == 0 || Op == 0) + return Error("Invalid CAST record"); + I = CastInst::create((Instruction::CastOps)Opc, Op, ResTy); + break; + } #if 0 - case bitc::FUNC_CODE_INST_CAST: - // CAST: [opcode, ty, opty, opval] case bitc::FUNC_CODE_INST_GEP: // GEP: [n, n x operands] case bitc::FUNC_CODE_INST_SELECT: @@ -1084,20 +1092,35 @@ // SHUFFLEVEC: [ty, opval, opval, opval] case bitc::FUNC_CODE_INST_CMP: // CMP: [opty, opval, opval, pred] - - case bitc::FUNC_CODE_INST_RET: - // RET: [opty,opval] +#endif + + case bitc::FUNC_CODE_INST_RET: // RET: [opty,opval] + if (Record.size() == 0) { + I = new ReturnInst(); + break; + } + if (Record.size() == 2) { + const Type *OpTy = getTypeByID(Record[0]); + Value *Op = getFnValueByID(Record[1], OpTy); + if (OpTy && Op); + I = new ReturnInst(Op); + break; + } + return Error("Invalid RET record"); +#if 0 case bitc::FUNC_CODE_INST_BR: // BR: [opval, bb#, bb#] or [bb#] case bitc::FUNC_CODE_INST_SWITCH: // SWITCH: [opty, opval, n, n x ops] case bitc::FUNC_CODE_INST_INVOKE: // INVOKE: [fnty, op0,op1,op2, ...] - case bitc::FUNC_CODE_INST_UNWIND: - // UNWIND - case bitc::FUNC_CODE_INST_UNREACHABLE: - // UNREACHABLE - + case bitc::FUNC_CODE_INST_UNWIND: // UNWIND + I = new UnwindInst(); + break; + case bitc::FUNC_CODE_INST_UNREACHABLE: // UNREACHABLE + I = new UnreachableInst(); + break; + case bitc::FUNC_CODE_INST_PHI: // PHI: [ty, #ops, val0,bb0, ...] case bitc::FUNC_CODE_INST_MALLOC: From sabre at nondot.org Wed May 2 00:17:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 2 May 2007 00:17:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705020517.l425H7Op009854@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.22 -> 1.23 --- Log message: add reader support for a bunch of new instructions --- Diffs of the changes: (+90 -14) BitcodeReader.cpp | 104 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 90 insertions(+), 14 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.22 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.23 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.22 Tue May 1 23:27:25 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Wed May 2 00:16:49 2007 @@ -150,6 +150,9 @@ return V; } + // No type specified, must be invalid reference. + if (Ty == 0) return 0; + // Create and return a placeholder, which will later be RAUW'd. Value *V = new Argument(Ty); Uses[Idx].init(V, this); @@ -1079,21 +1082,94 @@ I = CastInst::create((Instruction::CastOps)Opc, Op, ResTy); break; } -#if 0 - case bitc::FUNC_CODE_INST_GEP: - // GEP: [n, n x operands] - case bitc::FUNC_CODE_INST_SELECT: - // SELECT: [ty, opval, opval, opval] - case bitc::FUNC_CODE_INST_EXTRACTELT: - // EXTRACTELT: [opty, opval, opval] - case bitc::FUNC_CODE_INST_INSERTELT: - // INSERTELT: [ty, opval, opval, opval] - case bitc::FUNC_CODE_INST_SHUFFLEVEC: - // SHUFFLEVEC: [ty, opval, opval, opval] - case bitc::FUNC_CODE_INST_CMP: - // CMP: [opty, opval, opval, pred] -#endif + case bitc::FUNC_CODE_INST_GEP: { // GEP: [n, n x operands] + if (Record.size() < 2 || (Record.size() & 1)) + return Error("Invalid GEP record"); + const Type *OpTy = getTypeByID(Record[0]); + Value *Op = getFnValueByID(Record[1], OpTy); + if (OpTy == 0 || Op == 0) + return Error("Invalid GEP record"); + + SmallVector GEPIdx; + for (unsigned i = 1, e = Record.size()/2; i != e; ++i) { + const Type *IdxTy = getTypeByID(Record[i*2]); + Value *Idx = getFnValueByID(Record[i*2+1], IdxTy); + if (IdxTy == 0 || Idx == 0) + return Error("Invalid GEP record"); + GEPIdx.push_back(Idx); + } + + I = new GetElementPtrInst(Op, &GEPIdx[0], GEPIdx.size()); + break; + } + case bitc::FUNC_CODE_INST_SELECT: { // SELECT: [ty, opval, opval, opval] + if (Record.size() < 4) return Error("Invalid SELECT record"); + const Type *Ty = getTypeByID(Record[0]); + Value *Cond = getFnValueByID(Record[1], Type::Int1Ty); + Value *LHS = getFnValueByID(Record[2], Ty); + Value *RHS = getFnValueByID(Record[3], Ty); + if (Ty == 0 || Cond == 0 || LHS == 0 || RHS == 0) + return Error("Invalid SELECT record"); + I = new SelectInst(Cond, LHS, RHS); + break; + } + + case bitc::FUNC_CODE_INST_EXTRACTELT: { // EXTRACTELT: [opty, opval, opval] + if (Record.size() < 3) return Error("Invalid EXTRACTELT record"); + const Type *OpTy = getTypeByID(Record[0]); + Value *Vec = getFnValueByID(Record[1], OpTy); + Value *Idx = getFnValueByID(Record[2], Type::Int32Ty); + if (OpTy == 0 || Vec == 0 || Idx == 0) + return Error("Invalid EXTRACTELT record"); + I = new ExtractElementInst(Vec, Idx); + break; + } + + case bitc::FUNC_CODE_INST_INSERTELT: { // INSERTELT: [ty, opval,opval,opval] + if (Record.size() < 4) return Error("Invalid INSERTELT record"); + const VectorType *OpTy = + dyn_cast_or_null(getTypeByID(Record[0])); + if (OpTy == 0) return Error("Invalid INSERTELT record"); + Value *Vec = getFnValueByID(Record[1], OpTy); + Value *Elt = getFnValueByID(Record[2], OpTy->getElementType()); + Value *Idx = getFnValueByID(Record[3], Type::Int32Ty); + if (Vec == 0 || Elt == 0 || Idx == 0) + return Error("Invalid INSERTELT record"); + I = new InsertElementInst(Vec, Elt, Idx); + break; + } + + case bitc::FUNC_CODE_INST_SHUFFLEVEC: {// SHUFFLEVEC: [ty,opval,opval,opval] + if (Record.size() < 4) return Error("Invalid SHUFFLEVEC record"); + const VectorType *OpTy = + dyn_cast_or_null(getTypeByID(Record[0])); + if (OpTy == 0) return Error("Invalid SHUFFLEVEC record"); + Value *Vec1 = getFnValueByID(Record[1], OpTy); + Value *Vec2 = getFnValueByID(Record[2], OpTy); + Value *Mask = getFnValueByID(Record[3], + VectorType::get(Type::Int32Ty, + OpTy->getNumElements())); + if (Vec1 == 0 || Vec2 == 0 || Mask == 0) + return Error("Invalid SHUFFLEVEC record"); + I = new ShuffleVectorInst(Vec1, Vec2, Mask); + break; + } + + case bitc::FUNC_CODE_INST_CMP: { // CMP: [opty, opval, opval, pred] + if (Record.size() < 4) return Error("Invalid CMP record"); + const Type *OpTy = getTypeByID(Record[0]); + Value *LHS = getFnValueByID(Record[1], OpTy); + Value *RHS = getFnValueByID(Record[2], OpTy); + if (OpTy == 0 || LHS == 0 || RHS == 0) + return Error("Invalid CMP record"); + if (OpTy->isFPOrFPVector()) + I = new FCmpInst((FCmpInst::Predicate)Record[3], LHS, RHS); + else + I = new ICmpInst((ICmpInst::Predicate)Record[3], LHS, RHS); + break; + } + case bitc::FUNC_CODE_INST_RET: // RET: [opty,opval] if (Record.size() == 0) { I = new ReturnInst(); From sabre at nondot.org Wed May 2 00:47:09 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 2 May 2007 00:47:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp BitcodeReader.h Message-ID: <200705020547.l425l9im010458@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.23 -> 1.24 BitcodeReader.h updated: 1.15 -> 1.16 --- Log message: add reader logic for terminator instrs. --- Diffs of the changes: (+93 -8) BitcodeReader.cpp | 97 +++++++++++++++++++++++++++++++++++++++++++++++++----- BitcodeReader.h | 4 ++ 2 files changed, 93 insertions(+), 8 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.23 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.24 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.23 Wed May 2 00:16:49 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Wed May 2 00:46:45 2007 @@ -1090,7 +1090,7 @@ if (OpTy == 0 || Op == 0) return Error("Invalid GEP record"); - SmallVector GEPIdx; + SmallVector GEPIdx; for (unsigned i = 1, e = Record.size()/2; i != e; ++i) { const Type *IdxTy = getTypeByID(Record[i*2]); Value *Idx = getFnValueByID(Record[i*2+1], IdxTy); @@ -1183,19 +1183,100 @@ break; } return Error("Invalid RET record"); -#if 0 - case bitc::FUNC_CODE_INST_BR: - // BR: [opval, bb#, bb#] or [bb#] - case bitc::FUNC_CODE_INST_SWITCH: - // SWITCH: [opty, opval, n, n x ops] - case bitc::FUNC_CODE_INST_INVOKE: - // INVOKE: [fnty, op0,op1,op2, ...] + case bitc::FUNC_CODE_INST_BR: { // BR: [bb#, bb#, opval] or [bb#] + if (Record.size() != 1 || Record.size() != 3) + return Error("Invalid BR record"); + BasicBlock *TrueDest = getBasicBlock(Record[0]); + if (TrueDest == 0) + return Error("Invalid BR record"); + + if (Record.size() == 1) + I = new BranchInst(TrueDest); + else { + BasicBlock *FalseDest = getBasicBlock(Record[1]); + Value *Cond = getFnValueByID(Record[2], Type::Int1Ty); + if (FalseDest == 0 || Cond == 0) + return Error("Invalid BR record"); + I = new BranchInst(TrueDest, FalseDest, Cond); + } + break; + } + case bitc::FUNC_CODE_INST_SWITCH: { // SWITCH: [opty, opval, n, n x ops] + if (Record.size() < 3 || (Record.size() & 1) == 0) + return Error("Invalid SWITCH record"); + const Type *OpTy = getTypeByID(Record[0]); + Value *Cond = getFnValueByID(Record[1], OpTy); + BasicBlock *Default = getBasicBlock(Record[2]); + if (OpTy == 0 || Cond == 0 || Default == 0) + return Error("Invalid SWITCH record"); + unsigned NumCases = (Record.size()-3)/2; + SwitchInst *SI = new SwitchInst(Cond, Default, NumCases); + for (unsigned i = 0, e = NumCases; i != e; ++i) { + ConstantInt *CaseVal = + dyn_cast_or_null(getFnValueByID(Record[3+i*2], OpTy)); + BasicBlock *DestBB = getBasicBlock(Record[1+3+i*2]); + if (CaseVal == 0 || DestBB == 0) { + delete SI; + return Error("Invalid SWITCH record!"); + } + SI->addCase(CaseVal, DestBB); + } + I = SI; + break; + } + + case bitc::FUNC_CODE_INST_INVOKE: { // INVOKE: [fnty, op0,op1,op2, ...] + if (Record.size() < 4) + return Error("Invalid INVOKE record"); + const PointerType *CalleeTy = + dyn_cast_or_null(getTypeByID(Record[0])); + Value *Callee = getFnValueByID(Record[1], CalleeTy); + BasicBlock *NormalBB = getBasicBlock(Record[2]); + BasicBlock *UnwindBB = getBasicBlock(Record[3]); + if (CalleeTy == 0 || Callee == 0 || NormalBB == 0 || UnwindBB == 0) + return Error("Invalid INVOKE record"); + + const FunctionType *FTy = + dyn_cast(CalleeTy->getElementType()); + + // Check that the right number of fixed parameters are here. + if (FTy == 0 || Record.size() < 4+FTy->getNumParams()) + return Error("Invalid INVOKE record"); + + SmallVector Ops; + for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) { + Ops.push_back(getFnValueByID(Record[4+i], FTy->getParamType(4+i))); + if (Ops.back() == 0) + return Error("Invalid INVOKE record"); + } + + unsigned FirstVarargParam = 4+FTy->getNumParams(); + if (FTy->isVarArg()) { + // Read type/value pairs for varargs params. + if ((Record.size()-FirstVarargParam) & 1) + return Error("Invalid INVOKE record"); + + for (unsigned i = FirstVarargParam, e = Record.size(); i != e; i += 2) { + const Type *ArgTy = getTypeByID(Record[i]); + Ops.push_back(getFnValueByID(Record[i+1], ArgTy)); + if (Ops.back() == 0 || ArgTy == 0) + return Error("Invalid INVOKE record"); + } + } else { + if (Record.size() != FirstVarargParam) + return Error("Invalid INVOKE record"); + } + + I = new InvokeInst(Callee, NormalBB, UnwindBB, &Ops[0], Ops.size()); + break; + } case bitc::FUNC_CODE_INST_UNWIND: // UNWIND I = new UnwindInst(); break; case bitc::FUNC_CODE_INST_UNREACHABLE: // UNREACHABLE I = new UnreachableInst(); break; +#if 0 case bitc::FUNC_CODE_INST_PHI: // PHI: [ty, #ops, val0,bb0, ...] Index: llvm/lib/Bitcode/Reader/BitcodeReader.h diff -u llvm/lib/Bitcode/Reader/BitcodeReader.h:1.15 llvm/lib/Bitcode/Reader/BitcodeReader.h:1.16 --- llvm/lib/Bitcode/Reader/BitcodeReader.h:1.15 Tue May 1 02:01:57 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.h Wed May 2 00:46:45 2007 @@ -132,6 +132,10 @@ Value *getFnValueByID(unsigned ID, const Type *Ty) { return ValueList.getValueFwdRef(ID, Ty); } + BasicBlock *getBasicBlock(unsigned ID) const { + if (ID >= FunctionBBs.size()) return 0; // Invalid ID + return FunctionBBs[ID]; + } bool ParseModule(const std::string &ModuleID); bool ParseTypeTable(); From sabre at nondot.org Wed May 2 00:47:09 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 2 May 2007 00:47:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705020547.l425l9Ep010463@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.20 -> 1.21 --- Log message: add reader logic for terminator instrs. --- Diffs of the changes: (+0 -2) BitcodeWriter.cpp | 2 -- 1 files changed, 2 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.20 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.21 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.20 Tue May 1 23:26:36 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Wed May 2 00:46:45 2007 @@ -507,7 +507,6 @@ case Instruction::GetElementPtr: Code = bitc::FUNC_CODE_INST_GEP; - Vals.push_back(I.getNumOperands()); for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) { Vals.push_back(VE.getTypeID(I.getOperand(i)->getType())); Vals.push_back(VE.getValueID(I.getOperand(i))); @@ -567,7 +566,6 @@ case Instruction::Switch: Code = bitc::FUNC_CODE_INST_SWITCH; Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); - Vals.push_back(I.getNumOperands()); for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) Vals.push_back(VE.getValueID(I.getOperand(i))); break; From sabre at nondot.org Wed May 2 00:47:42 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 2 May 2007 00:47:42 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/LLVMBitCodes.h Message-ID: <200705020547.l425lgf0010505@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: LLVMBitCodes.h updated: 1.10 -> 1.11 --- Log message: update to reflect reality --- Diffs of the changes: (+1 -1) LLVMBitCodes.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Bitcode/LLVMBitCodes.h diff -u llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.10 llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.11 --- llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.10 Mon Apr 30 21:12:05 2007 +++ llvm/include/llvm/Bitcode/LLVMBitCodes.h Wed May 2 00:47:22 2007 @@ -165,7 +165,7 @@ FUNC_CODE_INST_CMP = 9, // CMP: [opty, opval, opval, pred] FUNC_CODE_INST_RET = 10, // RET: [opty,opval] - FUNC_CODE_INST_BR = 11, // BR: [opval, bb#, bb#] or [bb#] + FUNC_CODE_INST_BR = 11, // BR: [bb#, bb#, cond] or [bb#] FUNC_CODE_INST_SWITCH = 12, // SWITCH: [opty, opval, n, n x ops] FUNC_CODE_INST_INVOKE = 13, // INVOKE: [fnty, op0,op1,op2, ...] FUNC_CODE_INST_UNWIND = 14, // UNWIND From clattner at apple.com Wed May 2 00:50:00 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 1 May 2007 22:50:00 -0700 Subject: [llvm-commits] CVS: llvm/utils/TableGen/RegisterInfoEmitter.cpp In-Reply-To: <74F07314-F0B2-469B-8BEE-4DF28A2D9677@mac.com> References: <200705010557.l415vb52005240@zion.cs.uiuc.edu> <74F07314-F0B2-469B-8BEE-4DF28A2D9677@mac.com> Message-ID: <52AE163D-4EDC-4A25-A5D1-993AB0752596@apple.com> On May 1, 2007, at 1:28 PM, Nate Begeman wrote: >> I believe that sub/super register generator unions the set of sub/ >> super registers in a deterministic fashion and produces the >> necessary tables in the RegisterInfo.inc already. The only thing is >> that this would make the sub register index implicit in the >> ordering of the sub register list in the RegisterInfo.td. > > I'm not sure things are sufficiently well ordered internally for > that, or sorted in any particular fashion. I'll look into it, but it > seems like it would be less flexible and make the td files far less > intuitive as to what is actually going on. If tablegen picked the > numbering, I would have to go read the generated file to know what to > write in the ISel for that backend, which seems backwards to me. I agree with both of you. We should have the subreg number in the .td file, but we should merge this with the existing subreg stuff if possible. One simple thing would be for nates new syntax to populate the old tables, making the old syntax unneeded? -Chris From baldrick at free.fr Wed May 2 02:41:52 2007 From: baldrick at free.fr (Duncan Sands) Date: Wed, 2 May 2007 02:41:52 -0500 Subject: [llvm-commits] CVS: llvm/test/FrontendAda/asm.adb Message-ID: <200705020741.l427fqIC021478@zion.cs.uiuc.edu> Changes in directory llvm/test/FrontendAda: asm.adb added (r1.1) --- Log message: Test that inline assembler compiles (llvm-gcc added an extra "uses" parameter to ASM_EXPR). --- Diffs of the changes: (+6 -0) asm.adb | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/test/FrontendAda/asm.adb diff -c /dev/null llvm/test/FrontendAda/asm.adb:1.1 *** /dev/null Wed May 2 02:41:32 2007 --- llvm/test/FrontendAda/asm.adb Wed May 2 02:41:22 2007 *************** *** 0 **** --- 1,6 ---- + -- RUN: %llvmgcc -c %s -o /dev/null + with System.Machine_Code; + procedure Asm is + begin + System.Machine_Code.Asm (""); + end; From baldrick at free.fr Wed May 2 02:43:33 2007 From: baldrick at free.fr (Duncan Sands) Date: Wed, 2 May 2007 02:43:33 -0500 Subject: [llvm-commits] CVS: llvm/test/FrontendAda/unc_constructor.adb unc_constructor.ads Message-ID: <200705020743.l427hXQ8021515@zion.cs.uiuc.edu> Changes in directory llvm/test/FrontendAda: unc_constructor.adb added (r1.1) unc_constructor.ads added (r1.1) --- Log message: Test that TREE_CONSTANT is being set correctly. --- Diffs of the changes: (+17 -0) unc_constructor.adb | 9 +++++++++ unc_constructor.ads | 8 ++++++++ 2 files changed, 17 insertions(+) Index: llvm/test/FrontendAda/unc_constructor.adb diff -c /dev/null llvm/test/FrontendAda/unc_constructor.adb:1.1 *** /dev/null Wed May 2 02:43:24 2007 --- llvm/test/FrontendAda/unc_constructor.adb Wed May 2 02:43:14 2007 *************** *** 0 **** --- 1,9 ---- + -- RUN: %llvmgcc -c %s -o /dev/null + package body Unc_Constructor is + procedure P (X : A) is + begin + if X = A0 then + null; + end if; + end; + end; Index: llvm/test/FrontendAda/unc_constructor.ads diff -c /dev/null llvm/test/FrontendAda/unc_constructor.ads:1.1 *** /dev/null Wed May 2 02:43:33 2007 --- llvm/test/FrontendAda/unc_constructor.ads Wed May 2 02:43:14 2007 *************** *** 0 **** --- 1,8 ---- + package Unc_Constructor is + type C is null record; + type A is array (Positive range <>) of C; + A0 : constant A; + procedure P (X : A); + private + A0 : aliased constant A := (1 .. 0 => (null record)); + end; From asl at math.spbu.ru Wed May 2 03:46:20 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Wed, 2 May 2007 03:46:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp X86RegisterInfo.td Message-ID: <200705020846.l428kK3X022648@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86RegisterInfo.cpp updated: 1.217 -> 1.218 X86RegisterInfo.td updated: 1.42 -> 1.43 --- Log message: Emit correct DWARF reg # for RA (return address) register --- Diffs of the changes: (+7 -1) X86RegisterInfo.cpp | 5 ++++- X86RegisterInfo.td | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.217 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.218 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.217 Tue May 1 04:13:03 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Wed May 2 03:46:03 2007 @@ -1235,7 +1235,10 @@ } unsigned X86RegisterInfo::getRARegister() const { - return X86::ST0; // use a non-register register + if (Is64Bit) + return X86::RIP; // Should have dwarf #16 + else + return X86::EIP; // Should have dwarf #8 } unsigned X86RegisterInfo::getFrameRegister(MachineFunction &MF) const { Index: llvm/lib/Target/X86/X86RegisterInfo.td diff -u llvm/lib/Target/X86/X86RegisterInfo.td:1.42 llvm/lib/Target/X86/X86RegisterInfo.td:1.43 --- llvm/lib/Target/X86/X86RegisterInfo.td:1.42 Fri Apr 20 16:15:21 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.td Wed May 2 03:46:03 2007 @@ -60,6 +60,7 @@ def BP : RegisterWithSubRegs<"BP", [BPL]>, DwarfRegNum<5>; def SI : RegisterWithSubRegs<"SI", [SIL]>, DwarfRegNum<6>; def DI : RegisterWithSubRegs<"DI", [DIL]>, DwarfRegNum<7>; + def IP : Register<"IP">, DwarfRegNum<8>; // X86-64 only def R8W : RegisterWithSubRegs<"R8W", [R8B]>, DwarfRegNum<8>; @@ -80,6 +81,7 @@ def EBP : RegisterWithSubRegs<"EBP", [BP]>, DwarfRegNum<5>; def ESI : RegisterWithSubRegs<"ESI", [SI]>, DwarfRegNum<6>; def EDI : RegisterWithSubRegs<"EDI", [DI]>, DwarfRegNum<7>; + def EIP : RegisterWithSubRegs<"EIP", [IP]>, DwarfRegNum<8>; // X86-64 only def R8D : RegisterWithSubRegs<"R8D", [R8W]>, DwarfRegNum<8>; @@ -109,6 +111,7 @@ def R13 : RegisterWithSubRegs<"R13", [R13D]>, DwarfRegNum<13>; def R14 : RegisterWithSubRegs<"R14", [R14D]>, DwarfRegNum<14>; def R15 : RegisterWithSubRegs<"R15", [R15D]>, DwarfRegNum<15>; + def RIP : RegisterWithSubRegs<"RIP", [EIP]>, DwarfRegNum<16>; // MMX Registers. These are actually aliased to ST0 .. ST7 def MM0 : Register<"MM0">, DwarfRegNum<29>; From jlh at gmx.ch Wed May 2 10:57:58 2007 From: jlh at gmx.ch (jlh) Date: Wed, 02 May 2007 17:57:58 +0200 Subject: [llvm-commits] Patch for bug in llvm-ld In-Reply-To: References: <4635F312.5040301@gmx.ch> Message-ID: <4638B506.7040304@gmx.ch> Chris Lattner wrote: > Thanks, but this doesn't seem safe. If the args_temp vector is > reallocated, it will move all the std::string objects, invalidating the > pointers. Right, I wasn't thinking enough. One solution would be to use std::list instead. But anyway, I only wanted to point out the problem. Fix it the way you think is best. jlh From evan.cheng at apple.com Wed May 2 13:05:17 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 2 May 2007 11:05:17 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp X86RegisterInfo.td In-Reply-To: <200705020846.l428kK3X022648@zion.cs.uiuc.edu> References: <200705020846.l428kK3X022648@zion.cs.uiuc.edu> Message-ID: <965F198C-3210-444B-BC84-2268EE81B36C@apple.com> Anton, I believe different OS / target / DWARF imeplementations assign different DWARF numbers to register. On Mac OS X, I am fairly certain x86 and x86-64 assign different numbers. :-( We need a better way to handle this. Evan On May 2, 2007, at 1:46 AM, Anton Korobeynikov wrote: > > > Changes in directory llvm/lib/Target/X86: > > X86RegisterInfo.cpp updated: 1.217 -> 1.218 > X86RegisterInfo.td updated: 1.42 -> 1.43 > --- > Log message: > > Emit correct DWARF reg # for RA (return address) register > > > --- > Diffs of the changes: (+7 -1) > > X86RegisterInfo.cpp | 5 ++++- > X86RegisterInfo.td | 3 +++ > 2 files changed, 7 insertions(+), 1 deletion(-) > > > Index: llvm/lib/Target/X86/X86RegisterInfo.cpp > diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.217 llvm/lib/ > Target/X86/X86RegisterInfo.cpp:1.218 > --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.217 Tue May 1 > 04:13:03 2007 > +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Wed May 2 03:46:03 2007 > @@ -1235,7 +1235,10 @@ > } > > unsigned X86RegisterInfo::getRARegister() const { > - return X86::ST0; // use a non-register register > + if (Is64Bit) > + return X86::RIP; // Should have dwarf #16 > + else > + return X86::EIP; // Should have dwarf #8 > } > > unsigned X86RegisterInfo::getFrameRegister(MachineFunction &MF) > const { > > > Index: llvm/lib/Target/X86/X86RegisterInfo.td > diff -u llvm/lib/Target/X86/X86RegisterInfo.td:1.42 llvm/lib/Target/ > X86/X86RegisterInfo.td:1.43 > --- llvm/lib/Target/X86/X86RegisterInfo.td:1.42 Fri Apr 20 16:15:21 > 2007 > +++ llvm/lib/Target/X86/X86RegisterInfo.td Wed May 2 03:46:03 2007 > @@ -60,6 +60,7 @@ > def BP : RegisterWithSubRegs<"BP", [BPL]>, DwarfRegNum<5>; > def SI : RegisterWithSubRegs<"SI", [SIL]>, DwarfRegNum<6>; > def DI : RegisterWithSubRegs<"DI", [DIL]>, DwarfRegNum<7>; > + def IP : Register<"IP">, DwarfRegNum<8>; > > // X86-64 only > def R8W : RegisterWithSubRegs<"R8W", [R8B]>, DwarfRegNum<8>; > @@ -80,6 +81,7 @@ > def EBP : RegisterWithSubRegs<"EBP", [BP]>, DwarfRegNum<5>; > def ESI : RegisterWithSubRegs<"ESI", [SI]>, DwarfRegNum<6>; > def EDI : RegisterWithSubRegs<"EDI", [DI]>, DwarfRegNum<7>; > + def EIP : RegisterWithSubRegs<"EIP", [IP]>, DwarfRegNum<8>; > > // X86-64 only > def R8D : RegisterWithSubRegs<"R8D", [R8W]>, DwarfRegNum<8>; > @@ -109,6 +111,7 @@ > def R13 : RegisterWithSubRegs<"R13", [R13D]>, DwarfRegNum<13>; > def R14 : RegisterWithSubRegs<"R14", [R14D]>, DwarfRegNum<14>; > def R15 : RegisterWithSubRegs<"R15", [R15D]>, DwarfRegNum<15>; > + def RIP : RegisterWithSubRegs<"RIP", [EIP]>, DwarfRegNum<16>; > > // MMX Registers. These are actually aliased to ST0 .. ST7 > def MM0 : Register<"MM0">, DwarfRegNum<29>; > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From asl at math.spbu.ru Wed May 2 13:11:23 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Wed, 02 May 2007 22:11:23 +0400 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp X86RegisterInfo.td In-Reply-To: <965F198C-3210-444B-BC84-2268EE81B36C.SS3095SS@apple.com> References: <200705020846.l428kK3X022648@zion.cs.uiuc.edu> <965F198C-3210-444B-BC84-2268EE81B36C.SS3095SS@apple.com> Message-ID: <1178129483.29965.17.camel@asl.dorms.spbu.ru> Evan, > Anton, I believe different OS / target / DWARF imeplementations > assign different DWARF numbers to register. On Mac OS X, I am fairly > certain x86 and x86-64 assign different numbers. :-( We need a > better way to handle this. I've specially checked this case. DWARF register numbers are fixed for all i386-based platforms (at least ones, supported by GCC). The only special case seems to be cygwin/mingw, but I'll handle this case separately. Currently, I'm interested only in narrowing necessary bits (probably, platform-dependent). Anyway, this won't hurt :) -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From evan.cheng at apple.com Wed May 2 13:35:23 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 2 May 2007 11:35:23 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp X86RegisterInfo.td In-Reply-To: <1178129483.29965.17.camel@asl.dorms.spbu.ru> References: <200705020846.l428kK3X022648@zion.cs.uiuc.edu> <965F198C-3210-444B-BC84-2268EE81B36C.SS3095SS@apple.com> <1178129483.29965.17.camel@asl.dorms.spbu.ru> Message-ID: <65829913-B837-42E8-9C02-3AF12D8268A2@apple.com> On May 2, 2007, at 11:11 AM, Anton Korobeynikov wrote: > Evan, > >> Anton, I believe different OS / target / DWARF imeplementations >> assign different DWARF numbers to register. On Mac OS X, I am fairly >> certain x86 and x86-64 assign different numbers. :-( We need a >> better way to handle this. > I've specially checked this case. DWARF register numbers are fixed for > all i386-based platforms (at least ones, supported by GCC). The only > special case seems to be cygwin/mingw, but I'll handle this case > separately. Ok. Did you check both FSF and Apple gcc (llvm-gcc)? > > Currently, I'm interested only in narrowing necessary bits (probably, > platform-dependent). Anyway, this won't hurt :) Right. I figured since you are touching this you are taking ownership. :-) Perhaps you want to handle it. Evan > -- > With best regards, Anton Korobeynikov. > > Faculty of Mathematics & 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 asl at math.spbu.ru Wed May 2 14:53:53 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Wed, 2 May 2007 14:53:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86RegisterInfo.cpp Message-ID: <200705021953.l42JrrLW021737@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.397 -> 1.398 X86RegisterInfo.cpp updated: 1.218 -> 1.219 --- Log message: Emit correct register move information in eh frames for X86. This allows Shootout-C++/except to pass on x86/linux with non-llvm-compiled (e.g. "native") unwind runtime. --- Diffs of the changes: (+56 -8) X86ISelLowering.cpp | 13 +++++++++++++ X86RegisterInfo.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 56 insertions(+), 8 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.397 llvm/lib/Target/X86/X86ISelLowering.cpp:1.398 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.397 Tue Apr 24 16:16:55 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Wed May 2 14:53:33 2007 @@ -226,6 +226,19 @@ !Subtarget->isTargetCygMing()) setOperationAction(ISD::LABEL, MVT::Other, Expand); + setOperationAction(ISD::EXCEPTIONADDR, MVT::i64, Expand); + setOperationAction(ISD::EHSELECTION, MVT::i64, Expand); + setOperationAction(ISD::EXCEPTIONADDR, MVT::i32, Expand); + setOperationAction(ISD::EHSELECTION, MVT::i32, Expand); + if (Subtarget->is64Bit()) { + // FIXME: Verify + setExceptionPointerRegister(X86::RAX); + setExceptionSelectorRegister(X86::RDX); + } else { + setExceptionPointerRegister(X86::EAX); + setExceptionSelectorRegister(X86::EDX); + } + // VASTART needs to be custom lowered to use the VarArgsFrameIndex setOperationAction(ISD::VASTART , MVT::Other, Custom); setOperationAction(ISD::VAARG , MVT::Other, Expand); Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.218 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.219 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.218 Wed May 2 03:46:03 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Wed May 2 14:53:33 2007 @@ -26,6 +26,7 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineLocation.h" +#include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" @@ -1060,11 +1061,17 @@ MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); // Prepare for frame info. - unsigned FrameLabelId = 0; + unsigned FrameLabelId = 0, StartLabelId = 0; // Get the number of bytes to allocate from the FrameInfo uint64_t NumBytes = MFI->getStackSize(); + if (MMI && MMI->needsFrameInfo()) { + // Mark function start + StartLabelId = MMI->NextLabelID(); + BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(StartLabelId); + } + if (NumBytes) { // adjust stack pointer: ESP -= numbytes if (NumBytes >= 4096 && Subtarget->isTargetCygMing()) { // Check, whether EAX is livein for this function @@ -1138,17 +1145,38 @@ if (MMI && MMI->needsFrameInfo()) { std::vector &Moves = MMI->getFrameMoves(); - + const TargetAsmInfo *TAI = MF.getTarget().getTargetAsmInfo(); + + // Calculate amount of bytes used for return address storing + int stackGrowth = + (MF.getTarget().getFrameInfo()->getStackGrowthDirection() == + TargetFrameInfo::StackGrowsUp ? + TAI->getAddressSize() : -TAI->getAddressSize()); + + // Add return address to move list + MachineLocation CSDst(StackPtr, stackGrowth); + MachineLocation CSSrc(getRARegister()); + Moves.push_back(MachineMove(StartLabelId, CSDst, CSSrc)); + if (NumBytes) { // Show update of SP. - MachineLocation SPDst(MachineLocation::VirtualFP); - MachineLocation SPSrc(MachineLocation::VirtualFP, -NumBytes); - Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc)); + if (hasFP(MF)) { + // Adjust SP + MachineLocation SPDst(MachineLocation::VirtualFP); + MachineLocation SPSrc(MachineLocation::VirtualFP, 2*stackGrowth); + Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc)); + } else { + MachineLocation SPDst(MachineLocation::VirtualFP); + MachineLocation SPSrc(MachineLocation::VirtualFP, -NumBytes+stackGrowth); + Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc)); + } } else { - MachineLocation SP(StackPtr); - Moves.push_back(MachineMove(FrameLabelId, SP, SP)); + //FIXME: Verify & implement for FP + MachineLocation SPDst(StackPtr); + MachineLocation SPSrc(StackPtr, stackGrowth); + Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc)); } - + // Add callee saved registers to move list. const std::vector &CSI = MFI->getCalleeSavedInfo(); for (unsigned I = 0, E = CSI.size(); I != E; ++I) { @@ -1162,6 +1190,13 @@ // Mark effective beginning of when frame pointer is ready. unsigned ReadyLabelId = MMI->NextLabelID(); BuildMI(MBB, MBBI, TII.get(X86::LABEL)).addImm(ReadyLabelId); + + if (hasFP(MF)) { + // Save FP + MachineLocation FPDst(MachineLocation::VirtualFP, 2*stackGrowth); + MachineLocation FPSrc(FramePtr); + Moves.push_back(MachineMove(ReadyLabelId, FPDst, FPSrc)); + } MachineLocation FPDst(hasFP(MF) ? FramePtr : StackPtr); MachineLocation FPSrc(MachineLocation::VirtualFP); From lauro.venancio at gmail.com Wed May 2 14:55:32 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 2 May 2007 16:55:32 -0300 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysis.cpp AliasAnalysisCounter.cpp AliasAnalysisEvaluator.cpp AliasDebugger.cpp AliasSetTracker.cpp BasicAliasAnalysis.cpp CFGPrinter.cpp InstCount.cpp IntervalPartition.cpp LoadValueNumbering.cpp Loo Message-ID: <9c10c9f0705021255x561db443t77b6627a7a2151d0@mail.gmail.com> The following build error is occurring. Lauro make[2]: Entering directory `/armel-chroot/home/laurov/test/build/llvm/lib/Analysis' llvm[2]: Compiling AliasAnalysis.cpp for Release build AliasAnalysis.cpp:37: error: definition of 'llvm::AliasAnalysis::ID' is not in namespace enclosing 'llvm::AliasAnalysis' make[2]: *** [/armel-chroot/home/laurov/test/build/llvm/lib/Analysis/Release/AliasAnalysis.o] Error 1 make[2]: Leaving directory `/armel-chroot/home/laurov/test/build/llvm/lib/Analysis' make[1]: *** [Analysis/.makeall] Error 2 2007/5/1, Devang Patel : > > > > Changes in directory llvm/lib/Analysis: > > AliasAnalysis.cpp updated: 1.30 -> 1.31 > AliasAnalysisCounter.cpp updated: 1.20 -> 1.21 > AliasAnalysisEvaluator.cpp updated: 1.33 -> 1.34 > AliasDebugger.cpp updated: 1.3 -> 1.4 > AliasSetTracker.cpp updated: 1.46 -> 1.47 > BasicAliasAnalysis.cpp updated: 1.108 -> 1.109 > CFGPrinter.cpp updated: 1.22 -> 1.23 > InstCount.cpp updated: 1.20 -> 1.21 > IntervalPartition.cpp updated: 1.32 -> 1.33 > LoadValueNumbering.cpp updated: 1.39 -> 1.40 > LoopInfo.cpp updated: 1.83 -> 1.84 > LoopPass.cpp updated: 1.18 -> 1.19 > PostDominators.cpp updated: 1.67 -> 1.68 > ProfileInfo.cpp updated: 1.11 -> 1.12 > ProfileInfoLoaderPass.cpp updated: 1.18 -> 1.19 > ScalarEvolution.cpp updated: 1.112 -> 1.113 > ValueNumbering.cpp updated: 1.25 -> 1.26 > --- > Log message: > > Do not use typeinfo to identify pass in pass manager. > > > --- > Diffs of the changes: (+61 -5) > > AliasAnalysis.cpp | 1 + > AliasAnalysisCounter.cpp | 4 +++- > AliasAnalysisEvaluator.cpp | 4 ++++ > AliasDebugger.cpp | 4 ++++ > AliasSetTracker.cpp | 4 ++++ > BasicAliasAnalysis.cpp | 6 ++++++ > CFGPrinter.cpp | 6 ++++++ > InstCount.cpp | 4 ++++ > IntervalPartition.cpp | 4 +++- > LoadValueNumbering.cpp | 3 +++ > LoopInfo.cpp | 1 + > LoopPass.cpp | 5 ++++- > PostDominators.cpp | 3 +++ > ProfileInfo.cpp | 7 ++++++- > ProfileInfoLoaderPass.cpp | 4 +++- > ScalarEvolution.cpp | 1 + > ValueNumbering.cpp | 5 +++++ > 17 files changed, 61 insertions(+), 5 deletions(-) > > > Index: llvm/lib/Analysis/AliasAnalysis.cpp > diff -u llvm/lib/Analysis/AliasAnalysis.cpp:1.30llvm/lib/Analysis/AliasAnalysis.cpp: > 1.31 > --- llvm/lib/Analysis/AliasAnalysis.cpp:1.30 Fri Nov 17 01:10:51 2006 > +++ llvm/lib/Analysis/AliasAnalysis.cpp Tue May 1 16:15:46 2007 > @@ -34,6 +34,7 @@ > > // Register the AliasAnalysis interface, providing a nice name to refer > to. > namespace { > + const int AliasAnalysis::ID = 0; > RegisterAnalysisGroup Z("Alias Analysis"); > } > > > > Index: llvm/lib/Analysis/AliasAnalysisCounter.cpp > diff -u llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.20llvm/lib/Analysis/AliasAnalysisCounter.cpp: > 1.21 > --- llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.20 Mon Feb 5 > 17:42:17 2007 > +++ llvm/lib/Analysis/AliasAnalysisCounter.cpp Tue May 1 16:15:46 2007 > @@ -34,7 +34,8 @@ > const char *Name; > Module *M; > public: > - AliasAnalysisCounter() { > + static const int ID; // Class identification, replacement for > typeinfo > + AliasAnalysisCounter() : ModulePass((intptr_t) &ID) { > No = May = Must = 0; > NoMR = JustRef = JustMod = MR = 0; > } > @@ -107,6 +108,7 @@ > } > }; > > + const int AliasAnalysisCounter::ID = 0; > RegisterPass > X("count-aa", "Count Alias Analysis Query Responses"); > RegisterAnalysisGroup Y(X); > > > Index: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp > diff -u llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.33llvm/lib/Analysis/AliasAnalysisEvaluator.cpp: > 1.34 > --- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.33 Mon Feb 5 > 17:42:17 2007 > +++ llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Tue May 1 > 16:15:46 2007 > @@ -50,6 +50,9 @@ > unsigned NoModRef, Mod, Ref, ModRef; > > public: > + static const int ID; // Pass identifcation, replacement for typeid > + AAEval() : FunctionPass((intptr_t)&ID) {} > + > virtual void getAnalysisUsage(AnalysisUsage &AU) const { > AU.addRequired(); > AU.setPreservesAll(); > @@ -70,6 +73,7 @@ > bool doFinalization(Module &M); > }; > > + const int AAEval::ID = 0; > RegisterPass > X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator"); > } > > > Index: llvm/lib/Analysis/AliasDebugger.cpp > diff -u llvm/lib/Analysis/AliasDebugger.cpp:1.3llvm/lib/Analysis/AliasDebugger.cpp: > 1.4 > --- llvm/lib/Analysis/AliasDebugger.cpp:1.3 Mon Feb 5 17:42:17 2007 > +++ llvm/lib/Analysis/AliasDebugger.cpp Tue May 1 16:15:46 2007 > @@ -40,6 +40,9 @@ > std::set Vals; > > public: > + static const int ID; // Class identification, replacement for > typeinfo > + AliasDebugger() : ModulePass((intptr_t)&ID) {} > + > bool runOnModule(Module &M) { > InitializeAliasAnalysis(this); // set up super > class > > @@ -119,6 +122,7 @@ > > }; > > + const int AliasDebugger::ID = 0; > RegisterPass X("debug-aa", "AA use debugger"); > RegisterAnalysisGroup Y(X); > } > > > Index: llvm/lib/Analysis/AliasSetTracker.cpp > diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.46llvm/lib/Analysis/AliasSetTracker.cpp: > 1.47 > --- llvm/lib/Analysis/AliasSetTracker.cpp:1.46 Mon Feb 5 17:42:17 2007 > +++ llvm/lib/Analysis/AliasSetTracker.cpp Tue May 1 16:15:46 2007 > @@ -555,6 +555,9 @@ > class VISIBILITY_HIDDEN AliasSetPrinter : public FunctionPass { > AliasSetTracker *Tracker; > public: > + static const int ID; // Pass identifcation, replacement for typeid > + AliasSetPrinter() : FunctionPass((intptr_t)&ID) {} > + > virtual void getAnalysisUsage(AnalysisUsage &AU) const { > AU.setPreservesAll(); > AU.addRequired(); > @@ -570,5 +573,6 @@ > return false; > } > }; > + const int AliasSetPrinter::ID = 0; > RegisterPass X("print-alias-sets", "Alias Set > Printer"); > } > > > Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp > diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.108llvm/lib/Analysis/BasicAliasAnalysis.cpp: > 1.109 > --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.108 Thu Apr 19 > 00:39:12 2007 > +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Tue May 1 16:15:46 2007 > @@ -36,6 +36,9 @@ > /// such it doesn't follow many of the rules that other alias analyses > must. > /// > struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public > AliasAnalysis { > + static const int ID; // Class identification, replacement for > typeinfo > + NoAA() : ImmutablePass((intptr_t)&ID) {} > + > virtual void getAnalysisUsage(AnalysisUsage &AU) const { > AU.addRequired(); > } > @@ -74,6 +77,7 @@ > }; > > // Register this pass... > + const int NoAA::ID = 0; > RegisterPass > U("no-aa", "No Alias Analysis (always returns 'may' alias)"); > > @@ -88,6 +92,7 @@ > /// Because it doesn't chain to a previous alias analysis (like > -no-aa), it > /// derives from the NoAA class. > struct VISIBILITY_HIDDEN BasicAliasAnalysis : public NoAA { > + static const int ID; // Class identification, replacement for > typeinfo > AliasResult alias(const Value *V1, unsigned V1Size, > const Value *V2, unsigned V2Size); > > @@ -119,6 +124,7 @@ > }; > > // Register this pass... > + const int BasicAliasAnalysis::ID = 0; > RegisterPass > X("basicaa", "Basic Alias Analysis (default AA impl)"); > > > > Index: llvm/lib/Analysis/CFGPrinter.cpp > diff -u llvm/lib/Analysis/CFGPrinter.cpp:1.22llvm/lib/Analysis/CFGPrinter.cpp: > 1.23 > --- llvm/lib/Analysis/CFGPrinter.cpp:1.22 Mon Feb 5 17:42:17 2007 > +++ llvm/lib/Analysis/CFGPrinter.cpp Tue May 1 16:15:46 2007 > @@ -91,6 +91,9 @@ > > namespace { > struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass { > + static const int ID; // Pass identifcation, replacement for typeid > + CFGPrinter() : FunctionPass((intptr_t)&ID) {} > + > virtual bool runOnFunction(Function &F) { > std::string Filename = "cfg." + F.getName() + ".dot"; > cerr << "Writing '" << Filename << "'..."; > @@ -111,10 +114,12 @@ > } > }; > > + const int CFGPrinter::ID = 0; > RegisterPass P1("print-cfg", > "Print CFG of function to 'dot' file"); > > struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter { > + static const int ID; // Pass identifcation, replacement for typeid > virtual bool runOnFunction(Function &F) { > bool OldCFGOnly = CFGOnly; > CFGOnly = true; > @@ -129,6 +134,7 @@ > } > }; > > + const int CFGOnlyPrinter::ID = 0; > RegisterPass > P2("print-cfg-only", > "Print CFG of function to 'dot' file (with no function bodies)"); > > > Index: llvm/lib/Analysis/InstCount.cpp > diff -u llvm/lib/Analysis/InstCount.cpp:1.20llvm/lib/Analysis/InstCount.cpp: > 1.21 > --- llvm/lib/Analysis/InstCount.cpp:1.20 Mon Feb 5 17:42:17 2007 > +++ llvm/lib/Analysis/InstCount.cpp Tue May 1 16:15:46 2007 > @@ -51,6 +51,9 @@ > abort(); > } > public: > + static const int ID; // Pass identifcation, replacement for typeid > + InstCount() : FunctionPass((intptr_t)&ID) {} > + > virtual bool runOnFunction(Function &F); > > virtual void getAnalysisUsage(AnalysisUsage &AU) const { > @@ -60,6 +63,7 @@ > > }; > > + const int InstCount::ID = 0; > RegisterPass X("instcount", > "Counts the various types of Instructions"); > } > > > Index: llvm/lib/Analysis/IntervalPartition.cpp > diff -u llvm/lib/Analysis/IntervalPartition.cpp:1.32llvm/lib/Analysis/IntervalPartition.cpp: > 1.33 > --- llvm/lib/Analysis/IntervalPartition.cpp:1.32 Sun Aug 27 > 17:30:17 2006 > +++ llvm/lib/Analysis/IntervalPartition.cpp Tue May 1 16:15:46 2007 > @@ -15,6 +15,7 @@ > #include "llvm/Analysis/IntervalIterator.h" > using namespace llvm; > > +const int IntervalPartition::ID = 0; > static RegisterPass > X("intervals", "Interval Partition Construction", true); > > @@ -88,7 +89,8 @@ > // existing interval graph. This takes an additional boolean parameter to > // distinguish it from a copy constructor. Always pass in false for now. > // > -IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) { > +IntervalPartition::IntervalPartition(IntervalPartition &IP, bool) > + : FunctionPass((intptr_t) &ID) { > Interval *FunctionStart = IP.getRootInterval(); > assert(FunctionStart && "Cannot operate on empty IntervalPartitions!"); > > > > Index: llvm/lib/Analysis/LoadValueNumbering.cpp > diff -u llvm/lib/Analysis/LoadValueNumbering.cpp:1.39llvm/lib/Analysis/LoadValueNumbering.cpp: > 1.40 > --- llvm/lib/Analysis/LoadValueNumbering.cpp:1.39 Tue Apr 17 > 12:52:45 2007 > +++ llvm/lib/Analysis/LoadValueNumbering.cpp Tue May 1 16:15:46 2007 > @@ -40,6 +40,8 @@ > namespace { > // FIXME: This should not be a FunctionPass. > struct VISIBILITY_HIDDEN LoadVN : public FunctionPass, public > ValueNumbering { > + static const int ID; // Class identification, replacement for > typeinfo > + LoadVN() : FunctionPass((intptr_t)&ID) {} > > /// Pass Implementation stuff. This doesn't do any analysis. > /// > @@ -81,6 +83,7 @@ > std::vector &RetVals) const; > }; > > + const int LoadVN::ID = 0; > // Register this pass... > RegisterPass X("load-vn", "Load Value Numbering"); > > > > Index: llvm/lib/Analysis/LoopInfo.cpp > diff -u llvm/lib/Analysis/LoopInfo.cpp:1.83llvm/lib/Analysis/LoopInfo.cpp: > 1.84 > --- llvm/lib/Analysis/LoopInfo.cpp:1.83 Sat Mar 3 22:06:39 2007 > +++ llvm/lib/Analysis/LoopInfo.cpp Tue May 1 16:15:46 2007 > @@ -27,6 +27,7 @@ > #include > using namespace llvm; > > +const int LoopInfo::ID = 0; > static RegisterPass > X("loops", "Natural Loop Construction", true); > > > > Index: llvm/lib/Analysis/LoopPass.cpp > diff -u llvm/lib/Analysis/LoopPass.cpp:1.18llvm/lib/Analysis/LoopPass.cpp: > 1.19 > --- llvm/lib/Analysis/LoopPass.cpp:1.18 Wed Mar 7 00:39:01 2007 > +++ llvm/lib/Analysis/LoopPass.cpp Tue May 1 16:15:46 2007 > @@ -20,9 +20,12 @@ > > //===----------------------------------------------------------------------===// > // LPPassManager > // > + > +const int LPPassManager::ID = 0; > /// LPPassManager manages FPPassManagers and CalLGraphSCCPasses. > > -LPPassManager::LPPassManager(int Depth) : PMDataManager(Depth) { > +LPPassManager::LPPassManager(int Depth) > + : FunctionPass((intptr_t)&ID), PMDataManager(Depth) { > skipThisLoop = false; > redoThisLoop = false; > LI = NULL; > > > Index: llvm/lib/Analysis/PostDominators.cpp > diff -u llvm/lib/Analysis/PostDominators.cpp:1.67llvm/lib/Analysis/PostDominators.cpp: > 1.68 > --- llvm/lib/Analysis/PostDominators.cpp:1.67 Tue Apr 17 20:19:55 2007 > +++ llvm/lib/Analysis/PostDominators.cpp Tue May 1 16:15:46 2007 > @@ -22,6 +22,9 @@ > // PostDominatorTree Implementation > > //===----------------------------------------------------------------------===// > > +const int PostDominatorTree::ID = 0; > +const int PostDominanceFrontier::ID = 0; > +const int PostETForest::ID = 0; > static RegisterPass > F("postdomtree", "Post-Dominator Tree Construction", true); > > > > Index: llvm/lib/Analysis/ProfileInfo.cpp > diff -u llvm/lib/Analysis/ProfileInfo.cpp:1.11llvm/lib/Analysis/ProfileInfo.cpp: > 1.12 > --- llvm/lib/Analysis/ProfileInfo.cpp:1.11 Thu Mar 22 11:38:57 2007 > +++ llvm/lib/Analysis/ProfileInfo.cpp Tue May 1 16:15:46 2007 > @@ -22,6 +22,7 @@ > > // Register the ProfileInfo interface, providing a nice name to refer to. > namespace { > + const int ProfileInfo::ID = 0; > RegisterAnalysisGroup Z("Profile Information"); > } > > @@ -84,8 +85,12 @@ > > namespace { > struct VISIBILITY_HIDDEN NoProfileInfo > - : public ImmutablePass, public ProfileInfo {}; > + : public ImmutablePass, public ProfileInfo { > + static const int ID; // Class identification, replacement for > typeinfo > + NoProfileInfo() : ImmutablePass((intptr_t)&ID) {} > + }; > > + const int NoProfileInfo::ID = 0; > // Register this pass... > RegisterPass > X("no-profile", "No Profile Information"); > > > Index: llvm/lib/Analysis/ProfileInfoLoaderPass.cpp > diff -u llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.18llvm/lib/Analysis/ProfileInfoLoaderPass.cpp: > 1.19 > --- llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.18 Mon Feb 5 > 17:42:17 2007 > +++ llvm/lib/Analysis/ProfileInfoLoaderPass.cpp Tue May 1 16:15:46 2007 > @@ -32,8 +32,9 @@ > class VISIBILITY_HIDDEN LoaderPass : public ModulePass, public > ProfileInfo { > std::string Filename; > public: > + static const int ID; // Class identification, replacement for > typeinfo > LoaderPass(const std::string &filename = "") > - : Filename(filename) { > + : ModulePass((intptr_t)&ID), Filename(filename) { > if (filename.empty()) Filename = ProfileInfoFilename; > } > > @@ -49,6 +50,7 @@ > virtual bool runOnModule(Module &M); > }; > > + const int LoaderPass::ID = 0; > RegisterPass > X("profile-loader", "Load profile information from llvmprof.out"); > > > > Index: llvm/lib/Analysis/ScalarEvolution.cpp > diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.112llvm/lib/Analysis/ScalarEvolution.cpp: > 1.113 > --- llvm/lib/Analysis/ScalarEvolution.cpp:1.112 Sun Apr 15 21:24:41 2007 > +++ llvm/lib/Analysis/ScalarEvolution.cpp Tue May 1 16:15:46 2007 > @@ -102,6 +102,7 @@ > cl::init(100)); > > namespace { > + const int ScalarEvolution::ID = 0; > RegisterPass > R("scalar-evolution", "Scalar Evolution Analysis"); > } > > > Index: llvm/lib/Analysis/ValueNumbering.cpp > diff -u llvm/lib/Analysis/ValueNumbering.cpp:1.25llvm/lib/Analysis/ValueNumbering.cpp: > 1.26 > --- llvm/lib/Analysis/ValueNumbering.cpp:1.25 Mon Feb 5 17:42:17 2007 > +++ llvm/lib/Analysis/ValueNumbering.cpp Tue May 1 16:15:46 2007 > @@ -22,6 +22,7 @@ > #include "llvm/Support/Compiler.h" > using namespace llvm; > > +const int ValueNumbering::ID = 0; > // Register the ValueNumbering interface, providing a nice name to refer > to. > static RegisterAnalysisGroup X("Value Numbering"); > > @@ -51,6 +52,9 @@ > /// > struct VISIBILITY_HIDDEN BasicVN > : public ImmutablePass, public ValueNumbering { > + static const int ID; // Class identification, replacement for > typeinfo > + BasicVN() : ImmutablePass((intptr_t)&ID) {} > + > /// getEqualNumberNodes - Return nodes with the same value number as > the > /// specified Value. This fills in the argument vector with any > equal > /// values. > @@ -61,6 +65,7 @@ > std::vector &RetVals) const; > }; > > + const int BasicVN::ID = 0; > // Register this pass... > RegisterPass > X("basicvn", "Basic Value Numbering (default GVN impl)"); > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070502/1954d45f/attachment.html From evan.cheng at apple.com Wed May 2 15:21:39 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 2 May 2007 13:21:39 -0700 Subject: [llvm-commits] ELF sections in X86AsmTargetAsm.cpp In-Reply-To: <20070501135045.GS25688@village.us.cray.com> References: <20070501135045.GS25688@village.us.cray.com> Message-ID: Looks safe to me. :-) But I don't have access to a Linux box to verify. Anton, can you check? Evan On May 1, 2007, at 6:50 AM, Dan Gohman wrote: > The attached patch sets the section names for fixed-size constants for > ELF on x86 to match what GCC uses, and it uses the mergeable flag so > that duplicate constants can be merged. > > This works for me with GAS; are there other assemblers (or linkers?) > being used with LLVM on x86 ELF targets that don't support this? > It looks like nasm/yasm wouldn't accept some of the other things > that LLVM currently emits anyway.. > > Dan > > -- > Dan Gohman, Cray Inc. > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Wed May 2 15:27:27 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 13:27:27 -0700 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysis.cpp AliasAnalysisCounter.cpp AliasAnalysisEvaluator.cpp AliasDebugger.cpp AliasSetTracker.cpp BasicAliasAnalysis.cpp CFGPrinter.cpp InstCount.cpp IntervalPartition.cpp LoadValueNumbering.cpp Loo In-Reply-To: <9c10c9f0705021255x561db443t77b6627a7a2151d0@mail.gmail.com> References: <9c10c9f0705021255x561db443t77b6627a7a2151d0@mail.gmail.com> Message-ID: <0C30B328-5028-4F8C-A069-97193C96844C@apple.com> On May 2, 2007, at 12:55 PM, Lauro Ramos Venancio wrote: > The following build error is occurring. > > Lauro > > make[2]: Entering directory `/armel-chroot/home/laurov/test/build/ > llvm/lib/Analysis' > llvm[2]: Compiling AliasAnalysis.cpp for Release build > AliasAnalysis.cpp :37: error: definition of > 'llvm::AliasAnalysis::ID' is not in namespace enclosing > 'llvm::AliasAnalysis' > make[2]: *** [/armel-chroot/home/laurov/test/build/llvm/lib/Analysis/ > Release/AliasAnalysis.o] Error 1 > make[2]: Leaving directory `/armel-chroot/home/laurov/test/build/ > llvm/lib/Analysis' > make[1]: *** [Analysis/.makeall] Error 2 hmm.. I did not get this error. Does it help to move 'const int AliasAnalysis::ID = 0;' outside anonymous namespace ? Thanks, - Devang From lauro.venancio at gmail.com Wed May 2 15:34:54 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 2 May 2007 17:34:54 -0300 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysis.cpp AliasAnalysisCounter.cpp AliasAnalysisEvaluator.cpp AliasDebugger.cpp AliasSetTracker.cpp BasicAliasAnalysis.cpp CFGPrinter.cpp InstCount.cpp IntervalPartition.cpp LoadValueNumbering.cpp Loo In-Reply-To: <0C30B328-5028-4F8C-A069-97193C96844C@apple.com> References: <9c10c9f0705021255x561db443t77b6627a7a2151d0@mail.gmail.com> <0C30B328-5028-4F8C-A069-97193C96844C@apple.com> Message-ID: <9c10c9f0705021334x2cdbb5d7i10a9903c10ed162c@mail.gmail.com> > > > hmm.. I did not get this error. > Does it help to move 'const int AliasAnalysis::ID = 0;' outside > anonymous namespace ? > > Yes, to move the definition resolves the problem. I already fixed this problem. I will commit in few minutes. Lauro -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070502/8be21ddd/attachment.html From lauro.venancio at gmail.com Wed May 2 15:38:15 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 2 May 2007 15:38:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraph.cpp Message-ID: <200705022038.l42KcFNW022624@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraph.cpp updated: 1.66 -> 1.67 --- Log message: Fix build error. --- Diffs of the changes: (+4 -2) CallGraph.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.66 llvm/lib/Analysis/IPA/CallGraph.cpp:1.67 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.66 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Wed May 2 15:37:47 2007 @@ -190,14 +190,16 @@ } }; -const int CallGraph::ID = 0; + RegisterAnalysisGroup X("Call Graph"); -const int BasicCallGraph::ID = 0; RegisterPass Y("basiccg", "Basic CallGraph Construction"); RegisterAnalysisGroup Z(Y); } //End anonymous namespace +const int CallGraph::ID = 0; +const int BasicCallGraph::ID = 0; + void CallGraph::initialize(Module &M) { Mod = &M; } From lauro.venancio at gmail.com Wed May 2 15:38:20 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 2 May 2007 15:38:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Message-ID: <200705022038.l42KcKMi022635@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: RSProfiling.cpp updated: 1.24 -> 1.25 --- Log message: Fix build error. --- Diffs of the changes: (+4 -3) RSProfiling.cpp | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.24 llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.25 --- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.24 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Wed May 2 15:37:47 2007 @@ -81,9 +81,7 @@ } }; - const int RSProfilers::ID = 0; static RegisterAnalysisGroup A("Profiling passes"); - const int NullProfilerRS::ID = 0; static RegisterPass NP("insert-null-profiling-rs", "Measure profiling framework overhead"); static RegisterAnalysisGroup NPT(NP); @@ -160,11 +158,14 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const; }; - const int ProfilerRS::ID = 0; RegisterPass X("insert-rs-profiling-framework", "Insert random sampling instrumentation framework"); } +const int RSProfilers::ID = 0; +const int NullProfilerRS::ID = 0; +const int ProfilerRS::ID = 0; + //Local utilities static void ReplacePhiPred(BasicBlock* btarget, BasicBlock* bold, BasicBlock* bnew); From lauro.venancio at gmail.com Wed May 2 15:38:21 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 2 May 2007 15:38:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysis.cpp ProfileInfo.cpp ScalarEvolution.cpp Message-ID: <200705022038.l42KcLWQ022644@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasAnalysis.cpp updated: 1.31 -> 1.32 ProfileInfo.cpp updated: 1.12 -> 1.13 ScalarEvolution.cpp updated: 1.113 -> 1.114 --- Log message: Fix build error. --- Diffs of the changes: (+3 -3) AliasAnalysis.cpp | 2 +- ProfileInfo.cpp | 2 +- ScalarEvolution.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Analysis/AliasAnalysis.cpp diff -u llvm/lib/Analysis/AliasAnalysis.cpp:1.31 llvm/lib/Analysis/AliasAnalysis.cpp:1.32 --- llvm/lib/Analysis/AliasAnalysis.cpp:1.31 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/AliasAnalysis.cpp Wed May 2 15:37:47 2007 @@ -34,9 +34,9 @@ // Register the AliasAnalysis interface, providing a nice name to refer to. namespace { - const int AliasAnalysis::ID = 0; RegisterAnalysisGroup Z("Alias Analysis"); } +const int AliasAnalysis::ID = 0; //===----------------------------------------------------------------------===// // Default chaining methods Index: llvm/lib/Analysis/ProfileInfo.cpp diff -u llvm/lib/Analysis/ProfileInfo.cpp:1.12 llvm/lib/Analysis/ProfileInfo.cpp:1.13 --- llvm/lib/Analysis/ProfileInfo.cpp:1.12 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/ProfileInfo.cpp Wed May 2 15:37:47 2007 @@ -22,9 +22,9 @@ // Register the ProfileInfo interface, providing a nice name to refer to. namespace { - const int ProfileInfo::ID = 0; RegisterAnalysisGroup Z("Profile Information"); } +const int ProfileInfo::ID = 0; ProfileInfo::~ProfileInfo() {} Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.113 llvm/lib/Analysis/ScalarEvolution.cpp:1.114 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.113 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/ScalarEvolution.cpp Wed May 2 15:37:47 2007 @@ -102,10 +102,10 @@ cl::init(100)); namespace { - const int ScalarEvolution::ID = 0; RegisterPass R("scalar-evolution", "Scalar Evolution Analysis"); } +const int ScalarEvolution::ID = 0; //===----------------------------------------------------------------------===// // SCEV class definitions From lauro.venancio at gmail.com Wed May 2 15:38:21 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 2 May 2007 15:38:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp MachineModuleInfo.cpp Message-ID: <200705022038.l42KcLn0022652@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.240 -> 1.241 MachineModuleInfo.cpp updated: 1.6 -> 1.7 --- Log message: Fix build error. --- Diffs of the changes: (+2 -2) LiveIntervalAnalysis.cpp | 2 +- MachineModuleInfo.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.240 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.241 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.240 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Wed May 2 15:37:47 2007 @@ -44,8 +44,8 @@ STATISTIC(numFolded , "Number of loads/stores folded into instructions"); STATISTIC(numAborts , "Number of times interval joining aborted"); +const int LiveIntervals::ID = 0; namespace { - const int LiveIntervals::ID = 0; RegisterPass X("liveintervals", "Live Interval Analysis"); static cl::opt Index: llvm/lib/CodeGen/MachineModuleInfo.cpp diff -u llvm/lib/CodeGen/MachineModuleInfo.cpp:1.6 llvm/lib/CodeGen/MachineModuleInfo.cpp:1.7 --- llvm/lib/CodeGen/MachineModuleInfo.cpp:1.6 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/MachineModuleInfo.cpp Wed May 2 15:37:47 2007 @@ -28,9 +28,9 @@ // Handle the Pass registration stuff necessary to use TargetData's. namespace { - const int MachineModuleInfo::ID = 0; RegisterPass X("machinemoduleinfo", "Module Information"); } +const int MachineModuleInfo::ID = 0; //===----------------------------------------------------------------------===// From lauro.venancio at gmail.com Wed May 2 15:38:17 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 2 May 2007 15:38:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetData.cpp Message-ID: <200705022038.l42KcHOw022629@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.108 -> 1.109 --- Log message: Fix build error. --- Diffs of the changes: (+1 -1) TargetData.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.108 llvm/lib/Target/TargetData.cpp:1.109 --- llvm/lib/Target/TargetData.cpp:1.108 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/TargetData.cpp Wed May 2 15:37:47 2007 @@ -33,9 +33,9 @@ // Handle the Pass registration stuff necessary to use TargetData's. namespace { // Register the default SparcV9 implementation... - const int TargetData::ID = 0; RegisterPass X("targetdata", "Target Data Layout"); } +const int TargetData::ID = 0; //===----------------------------------------------------------------------===// // Support for StructLayout From dpatel at apple.com Wed May 2 15:38:43 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 15:38:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Pass.cpp Message-ID: <200705022038.l42KchIx022672@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Pass.cpp updated: 1.90 -> 1.91 --- Log message: Re-install patch to enable use of PassID. I am preparing another patch to address the failure that prompted Chris to revert this patch earlier. --- Diffs of the changes: (+14 -15) Pass.cpp | 29 ++++++++++++++--------------- 1 files changed, 14 insertions(+), 15 deletions(-) Index: llvm/lib/VMCore/Pass.cpp diff -u llvm/lib/VMCore/Pass.cpp:1.90 llvm/lib/VMCore/Pass.cpp:1.91 --- llvm/lib/VMCore/Pass.cpp:1.90 Tue May 1 23:25:31 2007 +++ llvm/lib/VMCore/Pass.cpp Wed May 2 15:38:25 2007 @@ -133,7 +133,7 @@ class PassRegistrar { /// PassInfoMap - Keep track of the passinfo object for each registered llvm /// pass. - std::map PassInfoMap; + std::map PassInfoMap; /// AnalysisGroupInfo - Keep track of information for each analysis group. struct AnalysisGroupInfo { @@ -147,19 +147,19 @@ public: - const PassInfo *GetPassInfo(const std::type_info &TI) const { - std::map::const_iterator I = PassInfoMap.find(TI); + const PassInfo *GetPassInfo(intptr_t TI) const { + std::map::const_iterator I = PassInfoMap.find(TI); return I != PassInfoMap.end() ? I->second : 0; } void RegisterPass(PassInfo &PI) { bool Inserted = - PassInfoMap.insert(std::make_pair(TypeInfo(PI.getTypeInfo()),&PI)).second; + PassInfoMap.insert(std::make_pair(PI.getTypeInfo(),&PI)).second; assert(Inserted && "Pass registered multiple times!"); } void UnregisterPass(PassInfo &PI) { - std::map::iterator I = + std::map::iterator I = PassInfoMap.find(PI.getTypeInfo()); assert(I != PassInfoMap.end() && "Pass registered but not in map!"); @@ -168,7 +168,7 @@ } void EnumerateWith(PassRegistrationListener *L) { - for (std::map::const_iterator I = PassInfoMap.begin(), + for (std::map::const_iterator I = PassInfoMap.begin(), E = PassInfoMap.end(); I != E; ++I) L->passEnumerate(I->second); } @@ -210,11 +210,10 @@ // getPassInfo - Return the PassInfo data structure that corresponds to this // pass... const PassInfo *Pass::getPassInfo() const { - if (PassInfoCache) return PassInfoCache; - return lookupPassInfo(typeid(*this)); + return lookupPassInfo(PassID); } -const PassInfo *Pass::lookupPassInfo(const std::type_info &TI) { +const PassInfo *Pass::lookupPassInfo(intptr_t TI) { return getPassRegistrar()->GetPassInfo(TI); } @@ -238,12 +237,12 @@ // RegisterAGBase implementation // -RegisterAGBase::RegisterAGBase(const std::type_info &Interface, - const std::type_info *Pass, bool isDefault) - : RegisterPassBase(Interface), +RegisterAGBase::RegisterAGBase(intptr_t InterfaceID, + intptr_t PassID, bool isDefault) + : RegisterPassBase(InterfaceID), ImplementationInfo(0), isDefaultImplementation(isDefault) { - InterfaceInfo = const_cast(Pass::lookupPassInfo(Interface)); + InterfaceInfo = const_cast(Pass::lookupPassInfo(InterfaceID)); if (InterfaceInfo == 0) { // First reference to Interface, register it now. registerPass(); @@ -252,8 +251,8 @@ assert(PIObj.isAnalysisGroup() && "Trying to join an analysis group that is a normal pass!"); - if (Pass) { - ImplementationInfo = Pass::lookupPassInfo(*Pass); + if (PassID) { + ImplementationInfo = Pass::lookupPassInfo(PassID); assert(ImplementationInfo && "Must register pass before adding to AnalysisGroup!"); From dpatel at apple.com Wed May 2 15:38:48 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 15:38:48 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Pass.h PassSupport.h Message-ID: <200705022038.l42KcmCe022680@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Pass.h updated: 1.88 -> 1.89 PassSupport.h updated: 1.40 -> 1.41 --- Log message: Re-install patch to enable use of PassID. I am preparing another patch to address the failure that prompted Chris to revert this patch earlier. --- Diffs of the changes: (+20 -20) Pass.h | 14 +++++++------- PassSupport.h | 26 +++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.88 llvm/include/llvm/Pass.h:1.89 --- llvm/include/llvm/Pass.h:1.88 Tue May 1 23:25:30 2007 +++ llvm/include/llvm/Pass.h Wed May 2 15:38:25 2007 @@ -34,8 +34,8 @@ #include #include #include -#include #include +#include namespace llvm { @@ -77,7 +77,7 @@ /// class Pass { AnalysisResolver *Resolver; // Used to resolve analysis - const PassInfo *PassInfoCache; + intptr_t PassID; // AnalysisImpls - This keeps track of which passes implement the interfaces // that are required by the current pass (to implement getAnalysis()). @@ -87,7 +87,7 @@ void operator=(const Pass&); // DO NOT IMPLEMENT Pass(const Pass &); // DO NOT IMPLEMENT public: - Pass(intptr_t pid = 0) : Resolver(0), PassInfoCache(0) {} + Pass(intptr_t pid) : Resolver(0), PassID(pid) {} virtual ~Pass(); /// getPassName - Return a nice clean name for a pass. This usually @@ -163,12 +163,12 @@ template static const PassInfo *getClassPassInfo() { - return lookupPassInfo(typeid(AnalysisClass)); + return lookupPassInfo((intptr_t)&AnalysisClass::ID); } // lookupPassInfo - Return the pass info object for the specified pass class, // or null if it is not known. - static const PassInfo *lookupPassInfo(const std::type_info &TI); + static const PassInfo *lookupPassInfo(intptr_t TI); /// getAnalysisToUpdate() - This function is used by subclasses /// to get to the analysis information that might be around that needs to be @@ -274,7 +274,7 @@ class FunctionPass : public Pass { public: FunctionPass(intptr_t pid) : Pass(pid) {} - + /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. /// @@ -325,7 +325,7 @@ class BasicBlockPass : public Pass { public: BasicBlockPass(intptr_t pid) : Pass(pid) {} - + /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. /// Index: llvm/include/llvm/PassSupport.h diff -u llvm/include/llvm/PassSupport.h:1.40 llvm/include/llvm/PassSupport.h:1.41 --- llvm/include/llvm/PassSupport.h:1.40 Tue May 1 23:25:30 2007 +++ llvm/include/llvm/PassSupport.h Wed May 2 15:38:25 2007 @@ -37,19 +37,19 @@ class PassInfo { const char *PassName; // Nice name for Pass const char *PassArgument; // Command Line argument to run this pass - const std::type_info &TypeInfo; // type_info object for this Pass class + intptr_t PassID; bool IsCFGOnlyPass; // Pass only looks at the CFG. bool IsAnalysisGroup; // True if an analysis group. std::vector ItfImpl;// Interfaces implemented by this pass - Pass *(*NormalCtor)(); // No argument ctor + Pass *(*NormalCtor)(); public: /// PassInfo ctor - Do not call this directly, this should only be invoked /// through RegisterPass. - PassInfo(const char *name, const char *arg, const std::type_info &ti, + PassInfo(const char *name, const char *arg, intptr_t pi, Pass *(*normal)() = 0, bool isCFGOnly = false) - : PassName(name), PassArgument(arg), TypeInfo(ti), + : PassName(name), PassArgument(arg), PassID(pi), IsCFGOnlyPass(isCFGOnly), IsAnalysisGroup(false), NormalCtor(normal) { } @@ -65,8 +65,8 @@ const char *getPassArgument() const { return PassArgument; } /// getTypeInfo - Return the type_info object for the pass... - /// - const std::type_info &getTypeInfo() const { return TypeInfo; } + /// TODO : Rename + intptr_t getTypeInfo() const { return PassID; } /// isAnalysisGroup - Return true if this is an analysis group, not a normal /// pass. @@ -139,12 +139,12 @@ typedef Pass* (*NormalCtor_t)(); - RegisterPassBase(const char *Name, const char *Arg, const std::type_info &TI, + RegisterPassBase(const char *Name, const char *Arg, intptr_t TI, NormalCtor_t NormalCtor = 0, bool CFGOnly = false) : PIObj(Name, Arg, TI, NormalCtor, CFGOnly) { registerPass(); } - RegisterPassBase(const std::type_info &TI) + RegisterPassBase(intptr_t TI) : PIObj("", "", TI) { // This ctor may only be used for analysis groups: it does not auto-register // the pass. @@ -165,7 +165,7 @@ // Register Pass using default constructor... RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false) - : RegisterPassBase(Name, PassArg, typeid(PassName), + : RegisterPassBase(Name, PassArg, (intptr_t)&PassName::ID, (RegisterPassBase::NormalCtor_t)callDefaultCtor, CFGOnly) { } }; @@ -195,8 +195,8 @@ const PassInfo *ImplementationInfo; bool isDefaultImplementation; protected: - explicit RegisterAGBase(const std::type_info &Interface, - const std::type_info *Pass = 0, + explicit RegisterAGBase(intptr_t InterfaceID, + intptr_t PassID = 0, bool isDefault = false); void setGroupName(const char *Name); }; @@ -204,12 +204,12 @@ template struct RegisterAnalysisGroup : public RegisterAGBase { explicit RegisterAnalysisGroup(RegisterPassBase &RPB) - : RegisterAGBase(typeid(Interface), &RPB.getPassInfo()->getTypeInfo(), + : RegisterAGBase((intptr_t) &Interface::ID, RPB.getPassInfo()->getTypeInfo(), Default) { } explicit RegisterAnalysisGroup(const char *Name) - : RegisterAGBase(typeid(Interface)) { + : RegisterAGBase((intptr_t) &Interface::ID) { setGroupName(Name); } }; From reid at x10sys.com Wed May 2 16:29:57 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 2 May 2007 16:29:57 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200705022129.l42LTv31023825@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.432 -> 1.433 --- Log message: Add a rule to get the footprint of binaries and libraries. --- Diffs of the changes: (+14 -0) Makefile.rules | 14 ++++++++++++++ 1 files changed, 14 insertions(+) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.432 llvm/Makefile.rules:1.433 --- llvm/Makefile.rules:1.432 Mon Apr 16 13:10:22 2007 +++ llvm/Makefile.rules Wed May 2 16:29:39 2007 @@ -244,6 +244,11 @@ CXX.Flags += -fno-exceptions endif +# IF REQUIRES_RTTI=1 is specified then don't disable run-time type id +ifndef REQUIRES_RTTI + CXX.Flags += -fno-rtti +endif + # If DISABLE_ASSERTIONS=1 is specified (make command line or configured), # then disable assertions by defining the appropriate preprocessor symbols. ifdef DISABLE_ASSERTIONS @@ -1730,6 +1735,15 @@ check-for-tabs: @egrep -n ' ' $(Sources) +check-footprint: + @ls -l $(LibDir) | awk '\ + BEGIN { sum = 0; } \ + { sum += $$5; } \ + END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }' + @ls -l $(ToolDir) | awk '\ + BEGIN { sum = 0; } \ + { sum += $$5; } \ + END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }' #------------------------------------------------------------------------ # Print out the directories used for building #------------------------------------------------------------------------ From reid at x10sys.com Wed May 2 16:31:27 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 2 May 2007 16:31:27 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200705022131.l42LVRSc023874@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.433 -> 1.434 --- Log message: Disable RTTI handling until we're ready. --- Diffs of the changes: (+1 -1) Makefile.rules | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.433 llvm/Makefile.rules:1.434 --- llvm/Makefile.rules:1.433 Wed May 2 16:29:39 2007 +++ llvm/Makefile.rules Wed May 2 16:31:09 2007 @@ -246,7 +246,7 @@ # IF REQUIRES_RTTI=1 is specified then don't disable run-time type id ifndef REQUIRES_RTTI - CXX.Flags += -fno-rtti +# CXX.Flags += -fno-rtti endif # If DISABLE_ASSERTIONS=1 is specified (make command line or configured), From dpatel at apple.com Wed May 2 16:41:22 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp ARMLoadStoreOptimizer.cpp Message-ID: <200705022141.l42LfMNO024255@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.40 -> 1.41 ARMLoadStoreOptimizer.cpp updated: 1.9 -> 1.10 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+4 -4) ARMConstantIslandPass.cpp | 4 ++-- ARMLoadStoreOptimizer.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.40 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.41 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.40 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Wed May 2 16:39:19 2007 @@ -128,7 +128,7 @@ ARMFunctionInfo *AFI; bool isThumb; public: - static const int ID; + static const char ID; ARMConstantIslands() : MachineFunctionPass((intptr_t)&ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); @@ -174,7 +174,7 @@ void dumpBBs(); void verify(MachineFunction &Fn); }; - const int ARMConstantIslands::ID = 0; + const char ARMConstantIslands::ID = 0; } /// verify - check BBOffsets, BBSizes, alignment of islands Index: llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp diff -u llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp:1.9 llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp:1.10 --- llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp:1.9 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Wed May 2 16:39:19 2007 @@ -38,7 +38,7 @@ namespace { struct VISIBILITY_HIDDEN ARMLoadStoreOpt : public MachineFunctionPass { - static const int ID; + static const char ID; ARMLoadStoreOpt() : MachineFunctionPass((intptr_t)&ID) {} const TargetInstrInfo *TII; @@ -73,7 +73,7 @@ bool LoadStoreMultipleOpti(MachineBasicBlock &MBB); bool MergeReturnIntoLDM(MachineBasicBlock &MBB); }; - const int ARMLoadStoreOpt::ID = 0; + const char ARMLoadStoreOpt::ID = 0; } /// createARMLoadStoreOptimizationPass - returns an instance of the load / store From dpatel at apple.com Wed May 2 16:41:23 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:23 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetData.cpp Message-ID: <200705022141.l42LfNx6024264@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.109 -> 1.110 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+1 -1) TargetData.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.109 llvm/lib/Target/TargetData.cpp:1.110 --- llvm/lib/Target/TargetData.cpp:1.109 Wed May 2 15:37:47 2007 +++ llvm/lib/Target/TargetData.cpp Wed May 2 16:39:19 2007 @@ -35,7 +35,7 @@ // Register the default SparcV9 implementation... RegisterPass X("targetdata", "Target Data Layout"); } -const int TargetData::ID = 0; +const char TargetData::ID = 0; //===----------------------------------------------------------------------===// // Support for StructLayout From dpatel at apple.com Wed May 2 16:41:24 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:24 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ExtractFunction.cpp TestPasses.cpp Message-ID: <200705022141.l42LfO5Z024266@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: ExtractFunction.cpp updated: 1.59 -> 1.60 TestPasses.cpp updated: 1.11 -> 1.12 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+6 -6) ExtractFunction.cpp | 4 ++-- TestPasses.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/tools/bugpoint/ExtractFunction.cpp diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.59 llvm/tools/bugpoint/ExtractFunction.cpp:1.60 --- llvm/tools/bugpoint/ExtractFunction.cpp:1.59 Tue May 1 16:15:47 2007 +++ llvm/tools/bugpoint/ExtractFunction.cpp Wed May 2 16:39:20 2007 @@ -306,10 +306,10 @@ class BlockExtractorPass : public ModulePass { bool runOnModule(Module &M); public: - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid BlockExtractorPass() : ModulePass((intptr_t)&ID) {} }; - const int BlockExtractorPass::ID = 0; + const char BlockExtractorPass::ID = 0; RegisterPass XX("extract-bbs", "Extract Basic Blocks From Module (for bugpoint use)"); } Index: llvm/tools/bugpoint/TestPasses.cpp diff -u llvm/tools/bugpoint/TestPasses.cpp:1.11 llvm/tools/bugpoint/TestPasses.cpp:1.12 --- llvm/tools/bugpoint/TestPasses.cpp:1.11 Tue May 1 16:15:47 2007 +++ llvm/tools/bugpoint/TestPasses.cpp Wed May 2 16:39:20 2007 @@ -26,7 +26,7 @@ /// crashes on any call instructions. class CrashOnCalls : public BasicBlockPass { public: - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid CrashOnCalls() : BasicBlockPass((intptr_t)&ID) {} private: virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -42,7 +42,7 @@ } }; - const int CrashOnCalls::ID = 0; + const char CrashOnCalls::ID = 0; RegisterPass X("bugpoint-crashcalls", "BugPoint Test Pass - Intentionally crash on CallInsts"); @@ -53,7 +53,7 @@ /// deletes some call instructions, "misoptimizing" the program. class DeleteCalls : public BasicBlockPass { public: - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid DeleteCalls() : BasicBlockPass((intptr_t)&ID) {} private: bool runOnBasicBlock(BasicBlock &BB) { @@ -68,7 +68,7 @@ } }; - const int DeleteCalls::ID = 0; + const char DeleteCalls::ID = 0; RegisterPass Y("bugpoint-deletecalls", "BugPoint Test Pass - Intentionally 'misoptimize' CallInsts"); From dpatel at apple.com Wed May 2 16:41:24 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200705022141.l42LfOYr024271@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.443 -> 1.444 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+1 -1) SelectionDAGISel.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.443 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.444 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.443 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed May 2 16:39:19 2007 @@ -5012,4 +5012,4 @@ Ops.push_back(InOps.back()); } -const int SelectionDAGISel::ID = 0; +const char SelectionDAGISel::ID = 0; From dpatel at apple.com Wed May 2 16:41:24 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:24 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Assembly/PrintModulePass.h Message-ID: <200705022141.l42LfOIf024273@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Assembly: PrintModulePass.h updated: 1.22 -> 1.23 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+2 -2) PrintModulePass.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Assembly/PrintModulePass.h diff -u llvm/include/llvm/Assembly/PrintModulePass.h:1.22 llvm/include/llvm/Assembly/PrintModulePass.h:1.23 --- llvm/include/llvm/Assembly/PrintModulePass.h:1.22 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Assembly/PrintModulePass.h Wed May 2 16:39:18 2007 @@ -28,7 +28,7 @@ OStream *Out; // ostream to print on bool DeleteStream; // Delete the ostream in our dtor? public: - static const int ID; + static const char ID; PrintModulePass() : ModulePass((intptr_t)&ID), Out(&cerr), DeleteStream(false) {} PrintModulePass(OStream *o, bool DS = false) : ModulePass((intptr_t)&ID), Out(o), DeleteStream(DS) {} @@ -52,7 +52,7 @@ OStream *Out; // ostream to print on bool DeleteStream; // Delete the ostream in our dtor? public: - static const int ID; + static const char ID; PrintFunctionPass() : FunctionPass((intptr_t)&ID), Banner(""), Out(&cerr), DeleteStream(false) {} PrintFunctionPass(const std::string &B, OStream *o = &cout, From dpatel at apple.com Wed May 2 16:41:25 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp X86FloatingPoint.cpp Message-ID: <200705022141.l42LfPq8024287@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.134 -> 1.135 X86FloatingPoint.cpp updated: 1.69 -> 1.70 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+4 -4) X86CodeEmitter.cpp | 4 ++-- X86FloatingPoint.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.134 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.135 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.134 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Wed May 2 16:39:19 2007 @@ -39,7 +39,7 @@ MachineCodeEmitter &MCE; bool Is64BitMode; public: - static const int ID; + static const char ID; explicit Emitter(TargetMachine &tm, MachineCodeEmitter &mce) : MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm), MCE(mce), Is64BitMode(false) {} @@ -82,7 +82,7 @@ bool isX86_64ExtendedReg(const MachineOperand &MO); unsigned determineREX(const MachineInstr &MI); }; - const int Emitter::ID = 0; + const char Emitter::ID = 0; } /// createX86CodeEmitterPass - Return a pass that emits the collected X86 code Index: llvm/lib/Target/X86/X86FloatingPoint.cpp diff -u llvm/lib/Target/X86/X86FloatingPoint.cpp:1.69 llvm/lib/Target/X86/X86FloatingPoint.cpp:1.70 --- llvm/lib/Target/X86/X86FloatingPoint.cpp:1.69 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/X86/X86FloatingPoint.cpp Wed May 2 16:39:19 2007 @@ -52,7 +52,7 @@ namespace { struct VISIBILITY_HIDDEN FPS : public MachineFunctionPass { - static const int ID; + static const char ID; FPS() : MachineFunctionPass((intptr_t)&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); @@ -154,7 +154,7 @@ void handleCondMovFP(MachineBasicBlock::iterator &I); void handleSpecialFP(MachineBasicBlock::iterator &I); }; - const int FPS::ID = 0; + const char FPS::ID = 0; } FunctionPass *llvm::createX86FloatingPointStackifierPass() { return new FPS(); } From dpatel at apple.com Wed May 2 16:41:25 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/DelaySlotFiller.cpp FPMover.cpp Message-ID: <200705022141.l42LfPw3024293@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: DelaySlotFiller.cpp updated: 1.14 -> 1.15 FPMover.cpp updated: 1.19 -> 1.20 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+4 -4) DelaySlotFiller.cpp | 4 ++-- FPMover.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/Sparc/DelaySlotFiller.cpp diff -u llvm/lib/Target/Sparc/DelaySlotFiller.cpp:1.14 llvm/lib/Target/Sparc/DelaySlotFiller.cpp:1.15 --- llvm/lib/Target/Sparc/DelaySlotFiller.cpp:1.14 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/Sparc/DelaySlotFiller.cpp Wed May 2 16:39:19 2007 @@ -30,7 +30,7 @@ TargetMachine &TM; const TargetInstrInfo *TII; - static const int ID; + static const char ID; Filler(TargetMachine &tm) : MachineFunctionPass((intptr_t)&ID), TM(tm), TII(tm.getInstrInfo()) { } @@ -48,7 +48,7 @@ } }; - const int Filler::ID = 0; + const char Filler::ID = 0; } // end of anonymous namespace /// createSparcDelaySlotFillerPass - Returns a pass that fills in delay Index: llvm/lib/Target/Sparc/FPMover.cpp diff -u llvm/lib/Target/Sparc/FPMover.cpp:1.19 llvm/lib/Target/Sparc/FPMover.cpp:1.20 --- llvm/lib/Target/Sparc/FPMover.cpp:1.19 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/Sparc/FPMover.cpp Wed May 2 16:39:19 2007 @@ -32,7 +32,7 @@ /// TargetMachine &TM; - static const int ID; + static const char ID; FPMover(TargetMachine &tm) : MachineFunctionPass((intptr_t)&ID), TM(tm) { } @@ -43,7 +43,7 @@ bool runOnMachineBasicBlock(MachineBasicBlock &MBB); bool runOnMachineFunction(MachineFunction &F); }; - const int FPMover::ID = 0; + const char FPMover::ID = 0; } // end of anonymous namespace /// createSparcFPMoverPass - Returns a pass that turns FpMOVD From dpatel at apple.com Wed May 2 16:41:26 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:26 -0500 Subject: [llvm-commits] CVS: llvm/docs/WritingAnLLVMPass.html Message-ID: <200705022141.l42LfQN8024298@zion.cs.uiuc.edu> Changes in directory llvm/docs: WritingAnLLVMPass.html updated: 1.57 -> 1.58 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+4 -4) WritingAnLLVMPass.html | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/docs/WritingAnLLVMPass.html diff -u llvm/docs/WritingAnLLVMPass.html:1.57 llvm/docs/WritingAnLLVMPass.html:1.58 --- llvm/docs/WritingAnLLVMPass.html:1.57 Tue May 1 15:55:38 2007 +++ llvm/docs/WritingAnLLVMPass.html Wed May 2 16:39:18 2007 @@ -263,7 +263,7 @@ time.

-     static const int ID;
+     static const char ID;
      Hello() : FunctionPass((intptr_t)&ID) {}
 

@@ -285,7 +285,7 @@ function.

-  const int Hello::ID = 0;
+  const char Hello::ID = 0;
 

We initialize pass ID here. LLVM uses ID's address to identify pass so @@ -311,7 +311,7 @@ namespace { struct Hello : public FunctionPass { - static const int ID; + static const char ID; Hello() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { @@ -1807,7 +1807,7 @@ Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007/05/01 20:55:38 $ + Last modified: $Date: 2007/05/02 21:39:18 $ From dpatel at apple.com Wed May 2 16:41:26 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200705022141.l42LfQN1024306@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.180 -> 1.181 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+1 -1) Writer.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.180 llvm/lib/Bytecode/Writer/Writer.cpp:1.181 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.180 Tue May 1 16:15:46 2007 +++ llvm/lib/Bytecode/Writer/Writer.cpp Wed May 2 16:39:18 2007 @@ -47,7 +47,7 @@ /// @brief The bytecode version number const unsigned BCVersionNum = 7; -const int WriteBytecodePass::ID = 0; +const char WriteBytecodePass::ID = 0; static RegisterPass X("emitbytecode", "Bytecode Writer"); STATISTIC(BytesWritten, "Number of bytecode bytes written"); From dpatel at apple.com Wed May 2 16:41:27 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp EdgeProfiling.cpp RSProfiling.cpp RSProfiling.h Message-ID: <200705022141.l42LfR2n024318@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: BlockProfiling.cpp updated: 1.23 -> 1.24 EdgeProfiling.cpp updated: 1.13 -> 1.14 RSProfiling.cpp updated: 1.25 -> 1.26 RSProfiling.h updated: 1.5 -> 1.6 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+12 -12) BlockProfiling.cpp | 8 ++++---- EdgeProfiling.cpp | 4 ++-- RSProfiling.cpp | 10 +++++----- RSProfiling.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) Index: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.23 llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.24 --- llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.23 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp Wed May 2 16:39:19 2007 @@ -33,11 +33,11 @@ namespace { class VISIBILITY_HIDDEN FunctionProfiler : public RSProfilers_std { public: - static const int ID; + static const char ID; bool runOnModule(Module &M); }; - const int FunctionProfiler::ID = 0; + const char FunctionProfiler::ID = 0; RegisterPass X("insert-function-profiling", "Insert instrumentation for function profiling"); @@ -84,10 +84,10 @@ class BlockProfiler : public RSProfilers_std { bool runOnModule(Module &M); public: - static const int ID; + static const char ID; }; - const int BlockProfiler::ID = 0; + const char BlockProfiler::ID = 0; RegisterPass Y("insert-block-profiling", "Insert instrumentation for block profiling"); RegisterAnalysisGroup YG(Y); Index: llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.13 llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.14 --- llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.13 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp Wed May 2 16:39:19 2007 @@ -33,11 +33,11 @@ class VISIBILITY_HIDDEN EdgeProfiler : public ModulePass { bool runOnModule(Module &M); public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid EdgeProfiler() : ModulePass((intptr_t)&ID) {} }; - const int EdgeProfiler::ID = 0; + const char EdgeProfiler::ID = 0; RegisterPass X("insert-edge-profiling", "Insert instrumentation for edge profiling"); } Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.25 llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.26 --- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.25 Wed May 2 15:37:47 2007 +++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Wed May 2 16:39:19 2007 @@ -69,7 +69,7 @@ /// measuring framework overhead class VISIBILITY_HIDDEN NullProfilerRS : public RSProfilers { public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid bool isProfiling(Value* v) { return false; } @@ -139,7 +139,7 @@ /// ProfilerRS - Insert the random sampling framework struct VISIBILITY_HIDDEN ProfilerRS : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid ProfilerRS() : FunctionPass((intptr_t)&ID) {} std::map TransCache; @@ -162,9 +162,9 @@ "Insert random sampling instrumentation framework"); } -const int RSProfilers::ID = 0; -const int NullProfilerRS::ID = 0; -const int ProfilerRS::ID = 0; +const char RSProfilers::ID = 0; +const char NullProfilerRS::ID = 0; +const char ProfilerRS::ID = 0; //Local utilities static void ReplacePhiPred(BasicBlock* btarget, Index: llvm/lib/Transforms/Instrumentation/RSProfiling.h diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.h:1.5 llvm/lib/Transforms/Instrumentation/RSProfiling.h:1.6 --- llvm/lib/Transforms/Instrumentation/RSProfiling.h:1.5 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Instrumentation/RSProfiling.h Wed May 2 16:39:19 2007 @@ -17,7 +17,7 @@ /// RSProfilers_std - a simple support class for profilers that handles most /// of the work of chaining and tracking inserted code. struct RSProfilers_std : public RSProfilers { - static const int ID; + static const char ID; std::set profcode; // Lookup up values in profcode virtual bool isProfiling(Value* v); From dpatel at apple.com Wed May 2 16:41:29 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:29 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/WriteBytecodePass.h Message-ID: <200705022141.l42LfTnh024351@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bytecode: WriteBytecodePass.h updated: 1.20 -> 1.21 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+1 -1) WriteBytecodePass.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Bytecode/WriteBytecodePass.h diff -u llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.20 llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.21 --- llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.20 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Bytecode/WriteBytecodePass.h Wed May 2 16:39:18 2007 @@ -26,7 +26,7 @@ bool DeleteStream; bool CompressFile; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid WriteBytecodePass() : ModulePass((intptr_t) &ID), Out(&cout), DeleteStream(false), CompressFile(false) {} From dpatel at apple.com Wed May 2 16:41:27 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/MSIL/MSILWriter.cpp MSILWriter.h Message-ID: <200705022141.l42LfRdw024323@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/MSIL: MSILWriter.cpp updated: 1.5 -> 1.6 MSILWriter.h updated: 1.3 -> 1.4 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+4 -4) MSILWriter.cpp | 4 ++-- MSILWriter.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/MSIL/MSILWriter.cpp diff -u llvm/lib/Target/MSIL/MSILWriter.cpp:1.5 llvm/lib/Target/MSIL/MSILWriter.cpp:1.6 --- llvm/lib/Target/MSIL/MSILWriter.cpp:1.5 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/MSIL/MSILWriter.cpp Wed May 2 16:39:19 2007 @@ -80,8 +80,8 @@ return Changed; } -const int MSILModule::ID = 0; -const int MSILWriter::ID = 0; +const char MSILModule::ID = 0; +const char MSILWriter::ID = 0; bool MSILWriter::runOnFunction(Function &F) { if (F.isDeclaration()) return false; Index: llvm/lib/Target/MSIL/MSILWriter.h diff -u llvm/lib/Target/MSIL/MSILWriter.h:1.3 llvm/lib/Target/MSIL/MSILWriter.h:1.4 --- llvm/lib/Target/MSIL/MSILWriter.h:1.3 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/MSIL/MSILWriter.h Wed May 2 16:39:19 2007 @@ -37,7 +37,7 @@ const TargetData*& TD; public: - static const int ID; + static const char ID; MSILModule(const std::set*& _UsedTypes, const TargetData*& _TD) : ModulePass((intptr_t)&ID), UsedTypes(_UsedTypes), TD(_TD) {} @@ -83,7 +83,7 @@ std::map > StaticInitList; const std::set* UsedTypes; - static const int ID; + static const char ID; MSILWriter(std::ostream &o) : FunctionPass((intptr_t)&ID), Out(o) { UniqID = 0; } From dpatel at apple.com Wed May 2 16:41:29 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:29 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasAnalysis.h CallGraph.h Dominators.h FindUsedTypes.h IntervalPartition.h LoopInfo.h LoopPass.h PostDominators.h ProfileInfo.h ScalarEvolution.h ValueNumbering.h Message-ID: <200705022141.l42LfTR7024376@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasAnalysis.h updated: 1.29 -> 1.30 CallGraph.h updated: 1.54 -> 1.55 Dominators.h updated: 1.77 -> 1.78 FindUsedTypes.h updated: 1.30 -> 1.31 IntervalPartition.h updated: 1.24 -> 1.25 LoopInfo.h updated: 1.64 -> 1.65 LoopPass.h updated: 1.16 -> 1.17 PostDominators.h updated: 1.18 -> 1.19 ProfileInfo.h updated: 1.6 -> 1.7 ScalarEvolution.h updated: 1.17 -> 1.18 ValueNumbering.h updated: 1.11 -> 1.12 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+15 -15) AliasAnalysis.h | 2 +- CallGraph.h | 2 +- Dominators.h | 6 +++--- FindUsedTypes.h | 2 +- IntervalPartition.h | 2 +- LoopInfo.h | 2 +- LoopPass.h | 2 +- PostDominators.h | 6 +++--- ProfileInfo.h | 2 +- ScalarEvolution.h | 2 +- ValueNumbering.h | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) Index: llvm/include/llvm/Analysis/AliasAnalysis.h diff -u llvm/include/llvm/Analysis/AliasAnalysis.h:1.29 llvm/include/llvm/Analysis/AliasAnalysis.h:1.30 --- llvm/include/llvm/Analysis/AliasAnalysis.h:1.29 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Analysis/AliasAnalysis.h Wed May 2 16:39:18 2007 @@ -61,7 +61,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const; public: - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo AliasAnalysis() : TD(0), AA(0) {} virtual ~AliasAnalysis(); // We want to be subclassed Index: llvm/include/llvm/Analysis/CallGraph.h diff -u llvm/include/llvm/Analysis/CallGraph.h:1.54 llvm/include/llvm/Analysis/CallGraph.h:1.55 --- llvm/include/llvm/Analysis/CallGraph.h:1.54 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Analysis/CallGraph.h Wed May 2 16:39:18 2007 @@ -73,7 +73,7 @@ FunctionMapTy FunctionMap; // Map from a function to its node public: - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo //===--------------------------------------------------------------------- // Accessors... // Index: llvm/include/llvm/Analysis/Dominators.h diff -u llvm/include/llvm/Analysis/Dominators.h:1.77 llvm/include/llvm/Analysis/Dominators.h:1.78 --- llvm/include/llvm/Analysis/Dominators.h:1.77 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Analysis/Dominators.h Wed May 2 16:39:18 2007 @@ -208,7 +208,7 @@ /// class DominatorTree : public DominatorTreeBase { public: - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid DominatorTree() : DominatorTreeBase((intptr_t)&ID, false) {} BasicBlock *getRoot() const { @@ -399,7 +399,7 @@ class ETForest : public ETForestBase { public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid ETForest() : ETForestBase((intptr_t)&ID, false) {} @@ -477,7 +477,7 @@ /// class DominanceFrontier : public DominanceFrontierBase { public: - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid DominanceFrontier() : DominanceFrontierBase((intptr_t)& ID, false) {} Index: llvm/include/llvm/Analysis/FindUsedTypes.h diff -u llvm/include/llvm/Analysis/FindUsedTypes.h:1.30 llvm/include/llvm/Analysis/FindUsedTypes.h:1.31 --- llvm/include/llvm/Analysis/FindUsedTypes.h:1.30 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Analysis/FindUsedTypes.h Wed May 2 16:39:18 2007 @@ -24,7 +24,7 @@ class FindUsedTypes : public ModulePass { std::set UsedTypes; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid FindUsedTypes() : ModulePass((intptr_t)&ID) {} /// getTypes - After the pass has been run, return the set containing all of Index: llvm/include/llvm/Analysis/IntervalPartition.h diff -u llvm/include/llvm/Analysis/IntervalPartition.h:1.24 llvm/include/llvm/Analysis/IntervalPartition.h:1.25 --- llvm/include/llvm/Analysis/IntervalPartition.h:1.24 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Analysis/IntervalPartition.h Wed May 2 16:39:18 2007 @@ -45,7 +45,7 @@ std::vector Intervals; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid IntervalPartition() : FunctionPass((intptr_t)&ID), RootInterval(0) {} Index: llvm/include/llvm/Analysis/LoopInfo.h diff -u llvm/include/llvm/Analysis/LoopInfo.h:1.64 llvm/include/llvm/Analysis/LoopInfo.h:1.65 --- llvm/include/llvm/Analysis/LoopInfo.h:1.64 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Analysis/LoopInfo.h Wed May 2 16:39:18 2007 @@ -241,7 +241,7 @@ std::vector TopLevelLoops; friend class Loop; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid LoopInfo() : FunctionPass((intptr_t)&ID) {} ~LoopInfo() { releaseMemory(); } Index: llvm/include/llvm/Analysis/LoopPass.h diff -u llvm/include/llvm/Analysis/LoopPass.h:1.16 llvm/include/llvm/Analysis/LoopPass.h:1.17 --- llvm/include/llvm/Analysis/LoopPass.h:1.16 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Analysis/LoopPass.h Wed May 2 16:39:18 2007 @@ -68,7 +68,7 @@ class LPPassManager : public FunctionPass, public PMDataManager { public: - static const int ID; + static const char ID; LPPassManager(int Depth); /// run - Execute all of the passes scheduled for execution. Keep track of Index: llvm/include/llvm/Analysis/PostDominators.h diff -u llvm/include/llvm/Analysis/PostDominators.h:1.18 llvm/include/llvm/Analysis/PostDominators.h:1.19 --- llvm/include/llvm/Analysis/PostDominators.h:1.18 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Analysis/PostDominators.h Wed May 2 16:39:18 2007 @@ -22,7 +22,7 @@ /// compute the a post-dominator tree. /// struct PostDominatorTree : public DominatorTreeBase { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid PostDominatorTree() : DominatorTreeBase((intptr_t)&ID, true) {} @@ -54,7 +54,7 @@ /// PostETForest Class - Concrete subclass of ETForestBase that is used to /// compute a forwards post-dominator ET-Forest. struct PostETForest : public ETForestBase { - static const int ID; + static const char ID; PostETForest() : ETForestBase((intptr_t)&ID, true) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -79,7 +79,7 @@ /// used to compute the a post-dominance frontier. /// struct PostDominanceFrontier : public DominanceFrontierBase { - static const int ID; + static const char ID; PostDominanceFrontier() : DominanceFrontierBase((intptr_t) &ID, true) {} Index: llvm/include/llvm/Analysis/ProfileInfo.h diff -u llvm/include/llvm/Analysis/ProfileInfo.h:1.6 llvm/include/llvm/Analysis/ProfileInfo.h:1.7 --- llvm/include/llvm/Analysis/ProfileInfo.h:1.6 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Analysis/ProfileInfo.h Wed May 2 16:39:18 2007 @@ -38,7 +38,7 @@ // entered. std::map, unsigned> EdgeCounts; public: - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo virtual ~ProfileInfo(); // We want to be subclassed //===------------------------------------------------------------------===// Index: llvm/include/llvm/Analysis/ScalarEvolution.h diff -u llvm/include/llvm/Analysis/ScalarEvolution.h:1.17 llvm/include/llvm/Analysis/ScalarEvolution.h:1.18 --- llvm/include/llvm/Analysis/ScalarEvolution.h:1.17 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Analysis/ScalarEvolution.h Wed May 2 16:39:18 2007 @@ -197,7 +197,7 @@ class ScalarEvolution : public FunctionPass { void *Impl; // ScalarEvolution uses the pimpl pattern public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid ScalarEvolution() : FunctionPass((intptr_t)&ID), Impl(0) {} /// getSCEV - Return a SCEV expression handle for the full generality of the Index: llvm/include/llvm/Analysis/ValueNumbering.h diff -u llvm/include/llvm/Analysis/ValueNumbering.h:1.11 llvm/include/llvm/Analysis/ValueNumbering.h:1.12 --- llvm/include/llvm/Analysis/ValueNumbering.h:1.11 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Analysis/ValueNumbering.h Wed May 2 16:39:18 2007 @@ -29,7 +29,7 @@ class Instruction; struct ValueNumbering { - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo virtual ~ValueNumbering(); // We want to be subclassed /// getEqualNumberNodes - Return nodes with the same value number as the From dpatel at apple.com Wed May 2 16:41:31 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:31 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h Message-ID: <200705022141.l42LfV12024397@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetData.h updated: 1.61 -> 1.62 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+1 -1) TargetData.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Target/TargetData.h diff -u llvm/include/llvm/Target/TargetData.h:1.61 llvm/include/llvm/Target/TargetData.h:1.62 --- llvm/include/llvm/Target/TargetData.h:1.61 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Target/TargetData.h Wed May 2 16:39:18 2007 @@ -202,7 +202,7 @@ /// requested alignment (if the global has one). unsigned getPreferredAlignmentLog(const GlobalVariable *GV) const; - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid }; /// StructLayout - used to lazily calculate structure layout information for a From dpatel at apple.com Wed May 2 16:41:31 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:31 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/PassManagers.h Message-ID: <200705022141.l42LfV7E024402@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: PassManagers.h updated: 1.17 -> 1.18 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+1 -1) PassManagers.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/PassManagers.h diff -u llvm/include/llvm/PassManagers.h:1.17 llvm/include/llvm/PassManagers.h:1.18 --- llvm/include/llvm/PassManagers.h:1.17 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/PassManagers.h Wed May 2 16:39:18 2007 @@ -336,7 +336,7 @@ class FPPassManager : public ModulePass, public PMDataManager { public: - static const int ID; + static const char ID; explicit FPPassManager(int Depth) : ModulePass((intptr_t)&ID), PMDataManager(Depth) { } From dpatel at apple.com Wed May 2 16:41:27 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:27 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/AsmPrinter.h LiveIntervalAnalysis.h LiveVariables.h MachineModuleInfo.h SelectionDAGISel.h Message-ID: <200705022141.l42LfR7M024333@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: AsmPrinter.h updated: 1.64 -> 1.65 LiveIntervalAnalysis.h updated: 1.81 -> 1.82 LiveVariables.h updated: 1.42 -> 1.43 MachineModuleInfo.h updated: 1.8 -> 1.9 SelectionDAGISel.h updated: 1.38 -> 1.39 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+5 -5) AsmPrinter.h | 2 +- LiveIntervalAnalysis.h | 2 +- LiveVariables.h | 2 +- MachineModuleInfo.h | 2 +- SelectionDAGISel.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/include/llvm/CodeGen/AsmPrinter.h diff -u llvm/include/llvm/CodeGen/AsmPrinter.h:1.64 llvm/include/llvm/CodeGen/AsmPrinter.h:1.65 --- llvm/include/llvm/CodeGen/AsmPrinter.h:1.64 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/CodeGen/AsmPrinter.h Wed May 2 16:39:18 2007 @@ -34,7 +34,7 @@ /// AsmPrinter - This class is intended to be used as a driving class for all /// asm writers. class AsmPrinter : public MachineFunctionPass { - static const int ID; + static const char ID; /// FunctionNumber - This provides a unique ID for each function emitted in /// this translation unit. It is autoincremented by SetupMachineFunction, Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.81 llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.82 --- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.81 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Wed May 2 16:39:18 2007 @@ -65,7 +65,7 @@ BitVector JoinedLIs; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid LiveIntervals() : MachineFunctionPass((intptr_t)&ID) {} struct CopyRec { Index: llvm/include/llvm/CodeGen/LiveVariables.h diff -u llvm/include/llvm/CodeGen/LiveVariables.h:1.42 llvm/include/llvm/CodeGen/LiveVariables.h:1.43 --- llvm/include/llvm/CodeGen/LiveVariables.h:1.42 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/CodeGen/LiveVariables.h Wed May 2 16:39:18 2007 @@ -40,7 +40,7 @@ class LiveVariables : public MachineFunctionPass { public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid LiveVariables() : MachineFunctionPass((intptr_t)&ID) {} /// VarInfo - This represents the regions where a virtual register is live in Index: llvm/include/llvm/CodeGen/MachineModuleInfo.h diff -u llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.8 llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.9 --- llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.8 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/CodeGen/MachineModuleInfo.h Wed May 2 16:39:18 2007 @@ -1022,7 +1022,7 @@ std::vector TypeInfos; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid MachineModuleInfo(); ~MachineModuleInfo(); Index: llvm/include/llvm/CodeGen/SelectionDAGISel.h diff -u llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.38 llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.39 --- llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.38 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/CodeGen/SelectionDAGISel.h Wed May 2 16:39:18 2007 @@ -41,7 +41,7 @@ MachineBasicBlock *BB; std::vector TopOrder; unsigned DAGSize; - static const int ID; + static const char ID; explicit SelectionDAGISel(TargetLowering &tli) : FunctionPass((intptr_t)&ID), TLI(tli), DAGSize(0) {} From dpatel at apple.com Wed May 2 16:41:27 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp PPCCodeEmitter.cpp Message-ID: <200705022141.l42LfRZf024342@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCBranchSelector.cpp updated: 1.43 -> 1.44 PPCCodeEmitter.cpp updated: 1.76 -> 1.77 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+4 -4) PPCBranchSelector.cpp | 4 ++-- PPCCodeEmitter.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.43 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.44 --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.43 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Wed May 2 16:39:19 2007 @@ -32,7 +32,7 @@ namespace { struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass { - static const int ID; + static const char ID; PPCBSel() : MachineFunctionPass((intptr_t)&ID) {} /// BlockSizes - The sizes of the basic blocks in the function. @@ -44,7 +44,7 @@ return "PowerPC Branch Selector"; } }; - const int PPCBSel::ID = 0; + const char PPCBSel::ID = 0; } /// createPPCBranchSelectionPass - returns an instance of the Branch Selection Index: llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.76 llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.77 --- llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.76 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp Wed May 2 16:39:19 2007 @@ -40,7 +40,7 @@ int getMachineOpValue(MachineInstr &MI, MachineOperand &MO); public: - static const int ID; + static const char ID; PPCCodeEmitter(TargetMachine &T, MachineCodeEmitter &M) : MachineFunctionPass((intptr_t)&ID), TM(T), MCE(M) {} @@ -64,7 +64,7 @@ /// unsigned getBinaryCodeForInstr(MachineInstr &MI); }; - const int PPCCodeEmitter::ID = 0; + const char PPCCodeEmitter::ID = 0; } /// createPPCCodeEmitterPass - Return a pass that emits the collected PPC code From dpatel at apple.com Wed May 2 16:41:30 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:30 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/AnalysisWrappers.cpp GraphPrinters.cpp PrintSCC.cpp opt.cpp Message-ID: <200705022141.l42LfUOn024387@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: AnalysisWrappers.cpp updated: 1.22 -> 1.23 GraphPrinters.cpp updated: 1.15 -> 1.16 PrintSCC.cpp updated: 1.16 -> 1.17 opt.cpp updated: 1.135 -> 1.136 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+16 -16) AnalysisWrappers.cpp | 8 ++++---- GraphPrinters.cpp | 4 ++-- PrintSCC.cpp | 8 ++++---- opt.cpp | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) Index: llvm/tools/opt/AnalysisWrappers.cpp diff -u llvm/tools/opt/AnalysisWrappers.cpp:1.22 llvm/tools/opt/AnalysisWrappers.cpp:1.23 --- llvm/tools/opt/AnalysisWrappers.cpp:1.22 Tue May 1 16:15:47 2007 +++ llvm/tools/opt/AnalysisWrappers.cpp Wed May 2 16:39:20 2007 @@ -30,7 +30,7 @@ /// useful when looking for standard library functions we should constant fold /// or handle in alias analyses. struct ExternalFunctionsPassedConstants : public ModulePass { - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid ExternalFunctionsPassedConstants() : ModulePass((intptr_t)&ID) {} virtual bool runOnModule(Module &M) { for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) @@ -63,12 +63,12 @@ } }; - const int ExternalFunctionsPassedConstants::ID = 0; + const char ExternalFunctionsPassedConstants::ID = 0; RegisterPass P1("externalfnconstants", "Print external fn callsites passed constants"); struct CallGraphPrinter : public ModulePass { - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid CallGraphPrinter() : ModulePass((intptr_t)&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -82,7 +82,7 @@ } }; - const int CallGraphPrinter::ID = 0; + const char CallGraphPrinter::ID = 0; RegisterPass P2("callgraph", "Print a call graph"); } Index: llvm/tools/opt/GraphPrinters.cpp diff -u llvm/tools/opt/GraphPrinters.cpp:1.15 llvm/tools/opt/GraphPrinters.cpp:1.16 --- llvm/tools/opt/GraphPrinters.cpp:1.15 Tue May 1 16:15:47 2007 +++ llvm/tools/opt/GraphPrinters.cpp Wed May 2 16:39:20 2007 @@ -60,7 +60,7 @@ namespace { struct CallGraphPrinter : public ModulePass { - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid CallGraphPrinter() : ModulePass((intptr_t)&ID) {} virtual bool runOnModule(Module &M) { @@ -77,7 +77,7 @@ } }; - const int CallGraphPrinter::ID = 0; + const char CallGraphPrinter::ID = 0; RegisterPass P2("print-callgraph", "Print Call Graph to 'dot' file"); } Index: llvm/tools/opt/PrintSCC.cpp diff -u llvm/tools/opt/PrintSCC.cpp:1.16 llvm/tools/opt/PrintSCC.cpp:1.17 --- llvm/tools/opt/PrintSCC.cpp:1.16 Tue May 1 16:15:47 2007 +++ llvm/tools/opt/PrintSCC.cpp Wed May 2 16:39:20 2007 @@ -35,7 +35,7 @@ namespace { struct CFGSCC : public FunctionPass { - static const int ID; // Pass identification, replacement for typeid + static const char ID; // Pass identification, replacement for typeid CFGSCC() : FunctionPass((intptr_t)&ID) {} bool runOnFunction(Function& func); @@ -47,7 +47,7 @@ }; struct CallGraphSCC : public ModulePass { - static const int ID; // Pass identification, replacement for typeid + static const char ID; // Pass identification, replacement for typeid CallGraphSCC() : ModulePass((intptr_t)&ID) {} // run - Print out SCCs in the call graph for the specified module. @@ -62,11 +62,11 @@ } }; - const int CFGSCC::ID = 0; + const char CFGSCC::ID = 0; RegisterPass Y("cfgscc", "Print SCCs of each function CFG"); - const int CallGraphSCC::ID = 0; + const char CallGraphSCC::ID = 0; RegisterPass Z("callscc", "Print SCCs of the Call Graph"); } Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.135 llvm/tools/opt/opt.cpp:1.136 --- llvm/tools/opt/opt.cpp:1.135 Tue May 1 16:15:47 2007 +++ llvm/tools/opt/opt.cpp Wed May 2 16:39:20 2007 @@ -98,7 +98,7 @@ namespace { struct ModulePassPrinter : public ModulePass { - static const int ID; + static const char ID; const PassInfo *PassToPrint; ModulePassPrinter(const PassInfo *PI) : ModulePass((intptr_t)&ID), PassToPrint(PI) {} @@ -121,10 +121,10 @@ } }; -const int ModulePassPrinter::ID = 0; +const char ModulePassPrinter::ID = 0; struct FunctionPassPrinter : public FunctionPass { const PassInfo *PassToPrint; - static const int ID; + static const char ID; FunctionPassPrinter(const PassInfo *PI) : FunctionPass((intptr_t)&ID), PassToPrint(PI) {} @@ -146,10 +146,10 @@ } }; -const int FunctionPassPrinter::ID = 0; +const char FunctionPassPrinter::ID = 0; struct BasicBlockPassPrinter : public BasicBlockPass { const PassInfo *PassToPrint; - static const int ID; + static const char ID; BasicBlockPassPrinter(const PassInfo *PI) : BasicBlockPass((intptr_t)&ID), PassToPrint(PI) {} @@ -172,7 +172,7 @@ } }; -const int BasicBlockPassPrinter::ID = 0; +const char BasicBlockPassPrinter::ID = 0; inline void addPass(PassManager &PM, Pass *P) { // Add the pass to the pass manager... PM.add(P); From dpatel at apple.com Wed May 2 16:41:34 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:34 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp ConstantMerge.cpp DeadArgumentElimination.cpp DeadTypeElimination.cpp ExtractFunction.cpp GlobalDCE.cpp GlobalOpt.cpp IPConstantPropagation.cpp IndMemRemoval.cpp InlineSimple.cpp Inliner.cpp Inliner.h Internalize.cpp LoopExtractor.cpp LowerSetJmp.cpp PruneEH.cpp RaiseAllocations.cpp SimplifyLibCalls.cpp StripDeadPrototypes.cpp StripSymbols.cpp Message-ID: <200705022141.l42LfYaY024457@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ArgumentPromotion.cpp updated: 1.40 -> 1.41 ConstantMerge.cpp updated: 1.40 -> 1.41 DeadArgumentElimination.cpp updated: 1.41 -> 1.42 DeadTypeElimination.cpp updated: 1.63 -> 1.64 ExtractFunction.cpp updated: 1.21 -> 1.22 GlobalDCE.cpp updated: 1.46 -> 1.47 GlobalOpt.cpp updated: 1.102 -> 1.103 IPConstantPropagation.cpp updated: 1.24 -> 1.25 IndMemRemoval.cpp updated: 1.16 -> 1.17 InlineSimple.cpp updated: 1.79 -> 1.80 Inliner.cpp updated: 1.38 -> 1.39 Inliner.h updated: 1.10 -> 1.11 Internalize.cpp updated: 1.46 -> 1.47 LoopExtractor.cpp updated: 1.25 -> 1.26 LowerSetJmp.cpp updated: 1.41 -> 1.42 PruneEH.cpp updated: 1.32 -> 1.33 RaiseAllocations.cpp updated: 1.41 -> 1.42 SimplifyLibCalls.cpp updated: 1.113 -> 1.114 StripDeadPrototypes.cpp updated: 1.6 -> 1.7 StripSymbols.cpp updated: 1.16 -> 1.17 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+44 -44) ArgumentPromotion.cpp | 4 ++-- ConstantMerge.cpp | 4 ++-- DeadArgumentElimination.cpp | 8 ++++---- DeadTypeElimination.cpp | 4 ++-- ExtractFunction.cpp | 4 ++-- GlobalDCE.cpp | 4 ++-- GlobalOpt.cpp | 4 ++-- IPConstantPropagation.cpp | 4 ++-- IndMemRemoval.cpp | 4 ++-- InlineSimple.cpp | 4 ++-- Inliner.cpp | 2 +- Inliner.h | 2 +- Internalize.cpp | 4 ++-- LoopExtractor.cpp | 12 ++++++------ LowerSetJmp.cpp | 4 ++-- PruneEH.cpp | 4 ++-- RaiseAllocations.cpp | 4 ++-- SimplifyLibCalls.cpp | 4 ++-- StripDeadPrototypes.cpp | 4 ++-- StripSymbols.cpp | 4 ++-- 20 files changed, 44 insertions(+), 44 deletions(-) Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.40 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.41 --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.40 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Wed May 2 16:39:19 2007 @@ -63,7 +63,7 @@ } virtual bool runOnSCC(const std::vector &SCC); - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid ArgPromotion() : CallGraphSCCPass((intptr_t)&ID) {} private: @@ -72,7 +72,7 @@ Function *DoPromotion(Function *F, std::vector &ArgsToPromote); }; - const int ArgPromotion::ID = 0; + const char ArgPromotion::ID = 0; RegisterPass X("argpromotion", "Promote 'by reference' arguments to scalars"); } Index: llvm/lib/Transforms/IPO/ConstantMerge.cpp diff -u llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.40 llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.41 --- llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.40 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/ConstantMerge.cpp Wed May 2 16:39:19 2007 @@ -29,7 +29,7 @@ namespace { struct VISIBILITY_HIDDEN ConstantMerge : public ModulePass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid ConstantMerge() : ModulePass((intptr_t)&ID) {} // run - For this pass, process all of the globals in the module, @@ -38,7 +38,7 @@ bool runOnModule(Module &M); }; - const int ConstantMerge::ID = 0; + const char ConstantMerge::ID = 0; RegisterPassX("constmerge","Merge Duplicate Global Constants"); } Index: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.41 llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.42 --- llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.41 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp Wed May 2 16:39:19 2007 @@ -76,7 +76,7 @@ std::multimap CallSites; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid DAE() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); @@ -95,17 +95,17 @@ void RemoveDeadArgumentsFromFunction(Function *F); }; - const int DAE::ID = 0; + const char DAE::ID = 0; RegisterPass X("deadargelim", "Dead Argument Elimination"); /// DAH - DeadArgumentHacking pass - Same as dead argument elimination, but /// deletes arguments to functions which are external. This is only for use /// by bugpoint. struct DAH : public DAE { - static const int ID; + static const char ID; virtual bool ShouldHackArguments() const { return true; } }; - const int DAH::ID = 0; + const char DAH::ID = 0; RegisterPass Y("deadarghaX0r", "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)"); } Index: llvm/lib/Transforms/IPO/DeadTypeElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.63 llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.64 --- llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.63 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/DeadTypeElimination.cpp Wed May 2 16:39:19 2007 @@ -26,7 +26,7 @@ namespace { struct VISIBILITY_HIDDEN DTE : public ModulePass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid DTE() : ModulePass((intptr_t)&ID) {} // doPassInitialization - For this pass, it removes global symbol table @@ -43,7 +43,7 @@ AU.addRequired(); } }; - const int DTE::ID = 0; + const char DTE::ID = 0; RegisterPass X("deadtypeelim", "Dead Type Elimination"); } Index: llvm/lib/Transforms/IPO/ExtractFunction.cpp diff -u llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.21 llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.22 --- llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.21 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/ExtractFunction.cpp Wed May 2 16:39:19 2007 @@ -25,7 +25,7 @@ bool deleteFunc; bool reLink; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid /// FunctionExtractorPass - If deleteFn is true, this pass deletes as the /// specified function. Otherwise, it deletes as much of the module as @@ -134,7 +134,7 @@ } }; - const int FunctionExtractorPass::ID = 0; + const char FunctionExtractorPass::ID = 0; RegisterPass X("extract", "Function Extractor"); } Index: llvm/lib/Transforms/IPO/GlobalDCE.cpp diff -u llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.46 llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.47 --- llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.46 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/GlobalDCE.cpp Wed May 2 16:39:19 2007 @@ -30,7 +30,7 @@ namespace { struct VISIBILITY_HIDDEN GlobalDCE : public ModulePass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid GlobalDCE() : ModulePass((intptr_t)&ID) {} // run - Do the GlobalDCE pass on the specified module, optionally updating @@ -49,7 +49,7 @@ bool SafeToDestroyConstant(Constant* C); bool RemoveUnusedGlobalValue(GlobalValue &GV); }; - const int GlobalDCE::ID = 0; + const char GlobalDCE::ID = 0; RegisterPass X("globaldce", "Dead Global Elimination"); } Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.102 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.103 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.102 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Wed May 2 16:39:19 2007 @@ -50,7 +50,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); } - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid GlobalOpt() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); @@ -63,7 +63,7 @@ bool ProcessInternalGlobal(GlobalVariable *GV,Module::global_iterator &GVI); }; - const int GlobalOpt::ID = 0; + const char GlobalOpt::ID = 0; RegisterPass X("globalopt", "Global Variable Optimizer"); } Index: llvm/lib/Transforms/IPO/IPConstantPropagation.cpp diff -u llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.24 llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.25 --- llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.24 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/IPConstantPropagation.cpp Wed May 2 16:39:19 2007 @@ -33,7 +33,7 @@ /// IPCP - The interprocedural constant propagation pass /// struct VISIBILITY_HIDDEN IPCP : public ModulePass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid IPCP() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); @@ -41,7 +41,7 @@ bool PropagateConstantsIntoArguments(Function &F); bool PropagateConstantReturn(Function &F); }; - const int IPCP::ID = 0; + const char IPCP::ID = 0; RegisterPass X("ipconstprop", "Interprocedural constant propagation"); } Index: llvm/lib/Transforms/IPO/IndMemRemoval.cpp diff -u llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.16 llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.17 --- llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.16 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/IndMemRemoval.cpp Wed May 2 16:39:19 2007 @@ -32,12 +32,12 @@ namespace { class VISIBILITY_HIDDEN IndMemRemPass : public ModulePass { public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid IndMemRemPass() : ModulePass((intptr_t)&ID) {} virtual bool runOnModule(Module &M); }; - const int IndMemRemPass::ID = 0; + const char IndMemRemPass::ID = 0; RegisterPass X("indmemrem","Indirect Malloc and Free Removal"); } // end anonymous namespace Index: llvm/lib/Transforms/IPO/InlineSimple.cpp diff -u llvm/lib/Transforms/IPO/InlineSimple.cpp:1.79 llvm/lib/Transforms/IPO/InlineSimple.cpp:1.80 --- llvm/lib/Transforms/IPO/InlineSimple.cpp:1.79 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/InlineSimple.cpp Wed May 2 16:39:19 2007 @@ -54,10 +54,10 @@ class VISIBILITY_HIDDEN SimpleInliner : public Inliner { std::map CachedFunctionInfo; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid int getInlineCost(CallSite CS); }; - const int SimpleInliner::ID = 0; + const char SimpleInliner::ID = 0; RegisterPass X("inline", "Function Integration/Inlining"); } Index: llvm/lib/Transforms/IPO/Inliner.cpp diff -u llvm/lib/Transforms/IPO/Inliner.cpp:1.38 llvm/lib/Transforms/IPO/Inliner.cpp:1.39 --- llvm/lib/Transforms/IPO/Inliner.cpp:1.38 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/Inliner.cpp Wed May 2 16:39:19 2007 @@ -36,7 +36,7 @@ cl::desc("Control the amount of inlining to perform (default = 200)")); } -const int Inliner::ID = 0; +const char Inliner::ID = 0; Inliner::Inliner() : CallGraphSCCPass((intptr_t)&ID), InlineThreshold(InlineLimit) {} Index: llvm/lib/Transforms/IPO/Inliner.h diff -u llvm/lib/Transforms/IPO/Inliner.h:1.10 llvm/lib/Transforms/IPO/Inliner.h:1.11 --- llvm/lib/Transforms/IPO/Inliner.h:1.10 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/Inliner.h Wed May 2 16:39:19 2007 @@ -27,7 +27,7 @@ /// perform the inlining operations that does not depend on the policy. /// struct Inliner : public CallGraphSCCPass { - static const int ID; + static const char ID; Inliner(); /// getAnalysisUsage - For this class, we declare that we require and preserve Index: llvm/lib/Transforms/IPO/Internalize.cpp diff -u llvm/lib/Transforms/IPO/Internalize.cpp:1.46 llvm/lib/Transforms/IPO/Internalize.cpp:1.47 --- llvm/lib/Transforms/IPO/Internalize.cpp:1.46 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/Internalize.cpp Wed May 2 16:39:19 2007 @@ -46,13 +46,13 @@ std::set ExternalNames; bool DontInternalize; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid InternalizePass(bool InternalizeEverything = true); InternalizePass(const std::vector & exportList); void LoadFile(const char *Filename); virtual bool runOnModule(Module &M); }; - const int InternalizePass::ID = 0; + const char InternalizePass::ID = 0; RegisterPass X("internalize", "Internalize Global Symbols"); } // end anonymous namespace Index: llvm/lib/Transforms/IPO/LoopExtractor.cpp diff -u llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.25 llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.26 --- llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.25 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/LoopExtractor.cpp Wed May 2 16:39:19 2007 @@ -34,7 +34,7 @@ // Module passes to require FunctionPasses, so we can't get loop info if we're // not a function pass. struct VISIBILITY_HIDDEN LoopExtractor : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid unsigned NumLoops; LoopExtractor(unsigned numLoops = ~0) @@ -51,17 +51,17 @@ } }; - const int LoopExtractor::ID = 0; + const char LoopExtractor::ID = 0; RegisterPass X("loop-extract", "Extract loops into new functions"); /// SingleLoopExtractor - For bugpoint. struct SingleLoopExtractor : public LoopExtractor { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid SingleLoopExtractor() : LoopExtractor(1) {} }; - const int SingleLoopExtractor::ID = 0; + const char SingleLoopExtractor::ID = 0; RegisterPass Y("loop-extract-single", "Extract at most one loop into a new function"); } // End anonymous namespace @@ -152,7 +152,7 @@ class BlockExtractorPass : public ModulePass { std::vector BlocksToNotExtract; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid BlockExtractorPass(std::vector &B) : ModulePass((intptr_t)&ID), BlocksToNotExtract(B) {} BlockExtractorPass() : ModulePass((intptr_t)&ID) {} @@ -160,7 +160,7 @@ bool runOnModule(Module &M); }; - const int BlockExtractorPass::ID = 0; + const char BlockExtractorPass::ID = 0; RegisterPass XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)"); } Index: llvm/lib/Transforms/IPO/LowerSetJmp.cpp diff -u llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.41 llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.42 --- llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.41 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/LowerSetJmp.cpp Wed May 2 16:39:19 2007 @@ -109,7 +109,7 @@ bool IsTransformableFunction(const std::string& Name); public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid LowerSetJmp() : ModulePass((intptr_t)&ID) {} void visitCallInst(CallInst& CI); @@ -121,7 +121,7 @@ bool doInitialization(Module& M); }; - const int LowerSetJmp::ID = 0; + const char LowerSetJmp::ID = 0; RegisterPass X("lowersetjmp", "Lower Set Jump"); } // end anonymous namespace Index: llvm/lib/Transforms/IPO/PruneEH.cpp diff -u llvm/lib/Transforms/IPO/PruneEH.cpp:1.32 llvm/lib/Transforms/IPO/PruneEH.cpp:1.33 --- llvm/lib/Transforms/IPO/PruneEH.cpp:1.32 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/PruneEH.cpp Wed May 2 16:39:19 2007 @@ -35,7 +35,7 @@ namespace { struct VISIBILITY_HIDDEN PruneEH : public CallGraphSCCPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid PruneEH() : CallGraphSCCPass((intptr_t)&ID) {} /// DoesNotUnwind - This set contains all of the functions which we have @@ -53,7 +53,7 @@ void DeleteBasicBlock(BasicBlock *BB); }; - const int PruneEH::ID = 0; + const char PruneEH::ID = 0; RegisterPass X("prune-eh", "Remove unused exception handling info"); } Index: llvm/lib/Transforms/IPO/RaiseAllocations.cpp diff -u llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.41 llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.42 --- llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.41 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/RaiseAllocations.cpp Wed May 2 16:39:19 2007 @@ -35,7 +35,7 @@ Function *MallocFunc; // Functions in the module we are processing Function *FreeFunc; // Initialized by doPassInitializationVirt public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid RaiseAllocations() : ModulePass((intptr_t)&ID), MallocFunc(0), FreeFunc(0) {} @@ -49,7 +49,7 @@ bool runOnModule(Module &M); }; - const int RaiseAllocations::ID = 0; + const char RaiseAllocations::ID = 0; RegisterPass X("raiseallocs", "Raise allocations from calls to instructions"); } // end anonymous namespace Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.113 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.114 --- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.113 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp Wed May 2 16:39:19 2007 @@ -152,7 +152,7 @@ /// @brief A ModulePass for optimizing well-known function calls. class VISIBILITY_HIDDEN SimplifyLibCalls : public ModulePass { public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid SimplifyLibCalls() : ModulePass((intptr_t)&ID) {} /// We need some target data for accurate signature details that are @@ -376,7 +376,7 @@ TargetData *TD; ///< Cached TargetData }; -const int SimplifyLibCalls::ID = 0; +const char SimplifyLibCalls::ID = 0; // Register the pass RegisterPass X("simplify-libcalls", "Simplify well-known library calls"); Index: llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp diff -u llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.6 llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.7 --- llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.6 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp Wed May 2 16:39:19 2007 @@ -27,12 +27,12 @@ /// @brief Pass to remove unused function declarations. class VISIBILITY_HIDDEN StripDeadPrototypesPass : public ModulePass { public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid StripDeadPrototypesPass() : ModulePass((intptr_t)&ID) { } virtual bool runOnModule(Module &M); }; -const int StripDeadPrototypesPass::ID = 0; +const char StripDeadPrototypesPass::ID = 0; RegisterPass X("strip-dead-prototypes", "Strip Unused Function Prototypes"); Index: llvm/lib/Transforms/IPO/StripSymbols.cpp diff -u llvm/lib/Transforms/IPO/StripSymbols.cpp:1.16 llvm/lib/Transforms/IPO/StripSymbols.cpp:1.17 --- llvm/lib/Transforms/IPO/StripSymbols.cpp:1.16 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/IPO/StripSymbols.cpp Wed May 2 16:39:19 2007 @@ -37,7 +37,7 @@ class VISIBILITY_HIDDEN StripSymbols : public ModulePass { bool OnlyDebugInfo; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid StripSymbols(bool ODI = false) : ModulePass((intptr_t)&ID), OnlyDebugInfo(ODI) {} @@ -48,7 +48,7 @@ } }; - const int StripSymbols::ID = 0; + const char StripSymbols::ID = 0; RegisterPass X("strip", "Strip all symbols from a module"); } From dpatel at apple.com Wed May 2 16:41:35 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:35 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/RSProfiling.h Message-ID: <200705022141.l42LfZfj024462@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: RSProfiling.h updated: 1.3 -> 1.4 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+1 -1) RSProfiling.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Transforms/RSProfiling.h diff -u llvm/include/llvm/Transforms/RSProfiling.h:1.3 llvm/include/llvm/Transforms/RSProfiling.h:1.4 --- llvm/include/llvm/Transforms/RSProfiling.h:1.3 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Transforms/RSProfiling.h Wed May 2 16:39:18 2007 @@ -23,7 +23,7 @@ /// this interface are expected to chain to other implementations, such that /// multiple profilers can be support simultaniously. struct RSProfilers : public ModulePass { - static const int ID; // Pass identification, replacement for typeinfo + static const char ID; // Pass identification, replacement for typeinfo RSProfilers() : ModulePass((intptr_t)&ID) {} /// isProfiling - This method returns true if the value passed it was From dpatel at apple.com Wed May 2 16:41:30 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Hello/Hello.cpp Message-ID: <200705022141.l42LfULc024392@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Hello: Hello.cpp updated: 1.15 -> 1.16 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+4 -4) Hello.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Transforms/Hello/Hello.cpp diff -u llvm/lib/Transforms/Hello/Hello.cpp:1.15 llvm/lib/Transforms/Hello/Hello.cpp:1.16 --- llvm/lib/Transforms/Hello/Hello.cpp:1.15 Tue May 1 16:15:46 2007 +++ llvm/lib/Transforms/Hello/Hello.cpp Wed May 2 16:39:19 2007 @@ -25,7 +25,7 @@ namespace { // Hello - The first implementation, without getAnalysisUsage. struct Hello : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid Hello() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { @@ -37,12 +37,12 @@ } }; - const int Hello::ID = 0; + const char Hello::ID = 0; RegisterPass X("hello", "Hello World Pass"); // Hello2 - The second implementation with getAnalysisUsage implemented. struct Hello2 : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid Hello2() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { @@ -58,7 +58,7 @@ AU.setPreservesAll(); }; }; - const int Hello2::ID = 0; + const char Hello2::ID = 0; RegisterPass Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)"); } From dpatel at apple.com Wed May 2 16:41:36 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200705022141.l42LfaVv024563@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.340 -> 1.341 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+4 -4) CBackend.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.340 llvm/lib/Target/CBackend/CBackend.cpp:1.341 --- llvm/lib/Target/CBackend/CBackend.cpp:1.340 Tue May 1 21:17:41 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Wed May 2 16:39:19 2007 @@ -57,7 +57,7 @@ /// class CBackendNameAllUsedStructsAndMergeFunctions : public ModulePass { public: - static const int ID; + static const char ID; CBackendNameAllUsedStructsAndMergeFunctions() : ModulePass((intptr_t)&ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { @@ -71,7 +71,7 @@ virtual bool runOnModule(Module &M); }; - const int CBackendNameAllUsedStructsAndMergeFunctions::ID = 0; + const char CBackendNameAllUsedStructsAndMergeFunctions::ID = 0; /// CWriter - This class is the main chunk of code that converts an LLVM /// module to a C translation unit. @@ -88,7 +88,7 @@ std::set intrinsicPrototypesAlreadyGenerated; public: - static const int ID; + static const char ID; CWriter(std::ostream &o) : FunctionPass((intptr_t)&ID), Out(o), IL(0), Mang(0), LI(0), TheModule(0), TAsm(0), TD(0) {} @@ -264,7 +264,7 @@ }; } -const int CWriter::ID = 0; +const char CWriter::ID = 0; /// This method inserts names for any unnamed structure types that are used by /// the program, and removes names from structure types that are not used by the From dpatel at apple.com Wed May 2 16:41:32 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Dominators.cpp PassManager.cpp Verifier.cpp Message-ID: <200705022141.l42LfWa4024413@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.280 -> 1.281 Dominators.cpp updated: 1.98 -> 1.99 PassManager.cpp updated: 1.154 -> 1.155 Verifier.cpp updated: 1.210 -> 1.211 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+16 -16) AsmWriter.cpp | 4 ++-- Dominators.cpp | 6 +++--- PassManager.cpp | 18 +++++++++--------- Verifier.cpp | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.280 llvm/lib/VMCore/AsmWriter.cpp:1.281 --- llvm/lib/VMCore/AsmWriter.cpp:1.280 Tue May 1 16:15:47 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Wed May 2 16:39:19 2007 @@ -135,10 +135,10 @@ } // end namespace llvm -const int PrintModulePass::ID = 0; +const char PrintModulePass::ID = 0; static RegisterPass X("printm", "Print module to stderr"); -const int PrintFunctionPass::ID = 0; +const char PrintFunctionPass::ID = 0; static RegisterPass Y("print","Print function to stderr"); Index: llvm/lib/VMCore/Dominators.cpp diff -u llvm/lib/VMCore/Dominators.cpp:1.98 llvm/lib/VMCore/Dominators.cpp:1.99 --- llvm/lib/VMCore/Dominators.cpp:1.98 Tue May 1 16:15:47 2007 +++ llvm/lib/VMCore/Dominators.cpp Wed May 2 16:39:20 2007 @@ -58,7 +58,7 @@ // //===----------------------------------------------------------------------===// -const int DominatorTree::ID = 0; +const char DominatorTree::ID = 0; static RegisterPass E("domtree", "Dominator Tree Construction", true); @@ -354,7 +354,7 @@ // DominanceFrontier Implementation //===----------------------------------------------------------------------===// -const int DominanceFrontier::ID = 0; +const char DominanceFrontier::ID = 0; static RegisterPass G("domfrontier", "Dominance Frontier Construction", true); @@ -835,7 +835,7 @@ // ETForest implementation //===----------------------------------------------------------------------===// -const int ETForest::ID = 0; +const char ETForest::ID = 0; static RegisterPass D("etforest", "ET Forest Construction", true); Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.154 llvm/lib/VMCore/PassManager.cpp:1.155 --- llvm/lib/VMCore/PassManager.cpp:1.154 Tue May 1 16:15:47 2007 +++ llvm/lib/VMCore/PassManager.cpp Wed May 2 16:39:20 2007 @@ -63,7 +63,7 @@ public FunctionPass { public: - static const int ID; + static const char ID; BBPassManager(int Depth) : PMDataManager(Depth), FunctionPass((intptr_t)&ID) {} @@ -106,7 +106,7 @@ } }; -const int BBPassManager::ID = 0; +const char BBPassManager::ID = 0; } namespace llvm { @@ -119,7 +119,7 @@ public PMDataManager, public PMTopLevelManager { public: - static const int ID; + static const char ID; FunctionPassManagerImpl(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth), PMTopLevelManager(TLM_Function) { } @@ -173,7 +173,7 @@ } }; -const int FunctionPassManagerImpl::ID = 0; +const char FunctionPassManagerImpl::ID = 0; //===----------------------------------------------------------------------===// // MPPassManager // @@ -183,7 +183,7 @@ class MPPassManager : public Pass, public PMDataManager { public: - static const int ID; + static const char ID; MPPassManager(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth) { } // Delete on the fly managers. @@ -247,7 +247,7 @@ std::map OnTheFlyManagers; }; -const int MPPassManager::ID = 0; +const char MPPassManager::ID = 0; //===----------------------------------------------------------------------===// // PassManagerImpl // @@ -258,7 +258,7 @@ public PMTopLevelManager { public: - static const int ID; + static const char ID; PassManagerImpl(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth), PMTopLevelManager(TLM_Pass) { } @@ -304,7 +304,7 @@ }; -const int PassManagerImpl::ID = 0; +const char PassManagerImpl::ID = 0; } // End of llvm namespace namespace { @@ -1108,7 +1108,7 @@ //===----------------------------------------------------------------------===// // FPPassManager implementation -const int FPPassManager::ID = 0; +const char FPPassManager::ID = 0; /// Print passes managed by this manager void FPPassManager::dumpPassStructure(unsigned Offset) { llvm::cerr << std::string(Offset*2, ' ') << "FunctionPass Manager\n"; Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.210 llvm/lib/VMCore/Verifier.cpp:1.211 --- llvm/lib/VMCore/Verifier.cpp:1.210 Tue May 1 16:15:47 2007 +++ llvm/lib/VMCore/Verifier.cpp Wed May 2 16:39:20 2007 @@ -69,7 +69,7 @@ struct VISIBILITY_HIDDEN Verifier : public FunctionPass, InstVisitor { - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid bool Broken; // Is this module found to be broken? bool RealPass; // Are we not being run by a PassManager? VerifierFailureAction action; @@ -266,7 +266,7 @@ } }; - const int Verifier::ID = 0; + const char Verifier::ID = 0; RegisterPass X("verify", "Module Verifier"); } // End anonymous namespace From dpatel at apple.com Wed May 2 16:41:37 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64Bundling.cpp Message-ID: <200705022141.l42LfbRX024611@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64Bundling.cpp updated: 1.9 -> 1.10 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+2 -2) IA64Bundling.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/IA64/IA64Bundling.cpp diff -u llvm/lib/Target/IA64/IA64Bundling.cpp:1.9 llvm/lib/Target/IA64/IA64Bundling.cpp:1.10 --- llvm/lib/Target/IA64/IA64Bundling.cpp:1.9 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/IA64/IA64Bundling.cpp Wed May 2 16:39:19 2007 @@ -36,7 +36,7 @@ namespace { struct IA64BundlingPass : public MachineFunctionPass { - static const int ID; + static const char ID; /// Target machine description which we query for reg. names, data /// layout, etc. /// @@ -63,7 +63,7 @@ // 'fallthrough' code std::set PendingRegWrites; }; - const int IA64BundlingPass::ID = 0; + const char IA64BundlingPass::ID = 0; } // end of anonymous namespace /// createIA64BundlingPass - Returns a pass that adds STOP (;;) instructions From dpatel at apple.com Wed May 2 16:41:38 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:38 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h Message-ID: <200705022141.l42LfcDQ024624@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms/Utils: UnifyFunctionExitNodes.h updated: 1.21 -> 1.22 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+1 -1) UnifyFunctionExitNodes.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h diff -u llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:1.21 llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:1.22 --- llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:1.21 Tue May 1 16:15:46 2007 +++ llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h Wed May 2 16:39:18 2007 @@ -25,7 +25,7 @@ struct UnifyFunctionExitNodes : public FunctionPass { BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid UnifyFunctionExitNodes() : FunctionPass((intptr_t)&ID), ReturnBlock(0), UnwindBlock(0) {} From dpatel at apple.com Wed May 2 16:41:36 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp LCSSA.cpp LoopSimplify.cpp LowerAllocations.cpp LowerInvoke.cpp LowerSelect.cpp LowerSwitch.cpp Mem2Reg.cpp UnifyFunctionExitNodes.cpp Message-ID: <200705022141.l42LfaMD024560@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: BreakCriticalEdges.cpp updated: 1.45 -> 1.46 LCSSA.cpp updated: 1.39 -> 1.40 LoopSimplify.cpp updated: 1.93 -> 1.94 LowerAllocations.cpp updated: 1.74 -> 1.75 LowerInvoke.cpp updated: 1.60 -> 1.61 LowerSelect.cpp updated: 1.13 -> 1.14 LowerSwitch.cpp updated: 1.39 -> 1.40 Mem2Reg.cpp updated: 1.27 -> 1.28 UnifyFunctionExitNodes.cpp updated: 1.37 -> 1.38 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+17 -17) BreakCriticalEdges.cpp | 4 ++-- LCSSA.cpp | 4 ++-- LoopSimplify.cpp | 4 ++-- LowerAllocations.cpp | 4 ++-- LowerInvoke.cpp | 4 ++-- LowerSelect.cpp | 4 ++-- LowerSwitch.cpp | 4 ++-- Mem2Reg.cpp | 4 ++-- UnifyFunctionExitNodes.cpp | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) Index: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp diff -u llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.45 llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.46 --- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.45 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp Wed May 2 16:39:19 2007 @@ -34,7 +34,7 @@ namespace { struct VISIBILITY_HIDDEN BreakCriticalEdges : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid BreakCriticalEdges() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -50,7 +50,7 @@ } }; - const int BreakCriticalEdges::ID = 0; + const char BreakCriticalEdges::ID = 0; RegisterPass X("break-crit-edges", "Break critical edges in CFG"); } Index: llvm/lib/Transforms/Utils/LCSSA.cpp diff -u llvm/lib/Transforms/Utils/LCSSA.cpp:1.39 llvm/lib/Transforms/Utils/LCSSA.cpp:1.40 --- llvm/lib/Transforms/Utils/LCSSA.cpp:1.39 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Utils/LCSSA.cpp Wed May 2 16:39:19 2007 @@ -47,7 +47,7 @@ namespace { struct VISIBILITY_HIDDEN LCSSA : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid LCSSA() : FunctionPass((intptr_t)&ID) {} // Cached analysis information for the current function. @@ -84,7 +84,7 @@ } }; - const int LCSSA::ID = 0; + const char LCSSA::ID = 0; RegisterPass X("lcssa", "Loop-Closed SSA Form Pass"); } Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.93 llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.94 --- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.93 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Utils/LoopSimplify.cpp Wed May 2 16:39:19 2007 @@ -54,7 +54,7 @@ namespace { struct VISIBILITY_HIDDEN LoopSimplify : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid LoopSimplify() : FunctionPass((intptr_t)&ID) {} // AA - If we have an alias analysis object to update, this is it, otherwise @@ -92,7 +92,7 @@ std::vector &PredBlocks); }; - const int LoopSimplify::ID = 0; + const char LoopSimplify::ID = 0; RegisterPass X("loopsimplify", "Canonicalize natural loops", true); } Index: llvm/lib/Transforms/Utils/LowerAllocations.cpp diff -u llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.74 llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.75 --- llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.74 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Utils/LowerAllocations.cpp Wed May 2 16:39:19 2007 @@ -36,7 +36,7 @@ Constant *FreeFunc; // Initialized by doInitialization bool LowerMallocArgToInteger; public: - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid LowerAllocations(bool LowerToInt = false) : BasicBlockPass((intptr_t)&ID), MallocFunc(0), FreeFunc(0), LowerMallocArgToInteger(LowerToInt) {} @@ -68,7 +68,7 @@ bool runOnBasicBlock(BasicBlock &BB); }; - const int LowerAllocations::ID = 0; + const char LowerAllocations::ID = 0; RegisterPass X("lowerallocs", "Lower allocations from instructions to calls"); } Index: llvm/lib/Transforms/Utils/LowerInvoke.cpp diff -u llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.60 llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.61 --- llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.60 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Utils/LowerInvoke.cpp Wed May 2 16:39:19 2007 @@ -75,7 +75,7 @@ const TargetLowering *TLI; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid LowerInvoke(const TargetLowering *tli = NULL) : FunctionPass((intptr_t)&ID), TLI(tli) { } bool doInitialization(Module &M); @@ -99,7 +99,7 @@ bool insertExpensiveEHSupport(Function &F); }; - const int LowerInvoke::ID = 0; + const char LowerInvoke::ID = 0; RegisterPass X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); } Index: llvm/lib/Transforms/Utils/LowerSelect.cpp diff -u llvm/lib/Transforms/Utils/LowerSelect.cpp:1.13 llvm/lib/Transforms/Utils/LowerSelect.cpp:1.14 --- llvm/lib/Transforms/Utils/LowerSelect.cpp:1.13 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Utils/LowerSelect.cpp Wed May 2 16:39:19 2007 @@ -33,7 +33,7 @@ class VISIBILITY_HIDDEN LowerSelect : public FunctionPass { bool OnlyFP; // Only lower FP select instructions? public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid LowerSelect(bool onlyfp = false) : FunctionPass((intptr_t)&ID), OnlyFP(onlyfp) {} @@ -50,7 +50,7 @@ bool runOnFunction(Function &F); }; - const int LowerSelect::ID = 0; + const char LowerSelect::ID = 0; RegisterPass X("lowerselect", "Lower select instructions to branches"); } Index: llvm/lib/Transforms/Utils/LowerSwitch.cpp diff -u llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.39 llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.40 --- llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.39 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Utils/LowerSwitch.cpp Wed May 2 16:39:19 2007 @@ -30,7 +30,7 @@ /// modifies the CFG! class VISIBILITY_HIDDEN LowerSwitch : public FunctionPass { public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid LowerSwitch() : FunctionPass((intptr_t) &ID) {} virtual bool runOnFunction(Function &F); @@ -78,7 +78,7 @@ } }; - const int LowerSwitch::ID = 0; + const char LowerSwitch::ID = 0; RegisterPass X("lowerswitch", "Lower SwitchInst's to branches"); } Index: llvm/lib/Transforms/Utils/Mem2Reg.cpp diff -u llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.27 llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.28 --- llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.27 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Utils/Mem2Reg.cpp Wed May 2 16:39:19 2007 @@ -27,7 +27,7 @@ namespace { struct VISIBILITY_HIDDEN PromotePass : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid PromotePass() : FunctionPass((intptr_t)&ID) {} // runOnFunction - To run this pass, first we calculate the alloca @@ -50,7 +50,7 @@ } }; - const int PromotePass::ID = 0; + const char PromotePass::ID = 0; RegisterPass X("mem2reg", "Promote Memory to Register"); } // end of anonymous namespace Index: llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp diff -u llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.37 llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.38 --- llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.37 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp Wed May 2 16:39:19 2007 @@ -22,7 +22,7 @@ #include "llvm/Type.h" using namespace llvm; -const int UnifyFunctionExitNodes::ID = 0; +const char UnifyFunctionExitNodes::ID = 0; static RegisterPass X("mergereturn", "Unify function exit nodes"); From dpatel at apple.com Wed May 2 16:41:35 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaBranchSelector.cpp AlphaCodeEmitter.cpp AlphaLLRP.cpp Message-ID: <200705022141.l42LfZub024500@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaBranchSelector.cpp updated: 1.3 -> 1.4 AlphaCodeEmitter.cpp updated: 1.22 -> 1.23 AlphaLLRP.cpp updated: 1.9 -> 1.10 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+6 -6) AlphaBranchSelector.cpp | 4 ++-- AlphaCodeEmitter.cpp | 4 ++-- AlphaLLRP.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/lib/Target/Alpha/AlphaBranchSelector.cpp diff -u llvm/lib/Target/Alpha/AlphaBranchSelector.cpp:1.3 llvm/lib/Target/Alpha/AlphaBranchSelector.cpp:1.4 --- llvm/lib/Target/Alpha/AlphaBranchSelector.cpp:1.3 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/Alpha/AlphaBranchSelector.cpp Wed May 2 16:39:19 2007 @@ -22,7 +22,7 @@ namespace { struct VISIBILITY_HIDDEN AlphaBSel : public MachineFunctionPass { - static const int ID; + static const char ID; AlphaBSel() : MachineFunctionPass((intptr_t)&ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); @@ -31,7 +31,7 @@ return "Alpha Branch Selection"; } }; - const int AlphaBSel::ID = 0; + const char AlphaBSel::ID = 0; } /// createAlphaBranchSelectionPass - returns an instance of the Branch Selection Index: llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp diff -u llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.22 llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.23 --- llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.22 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp Wed May 2 16:39:19 2007 @@ -36,7 +36,7 @@ int getMachineOpValue(MachineInstr &MI, MachineOperand &MO); public: - static const int ID; + static const char ID; explicit AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce) : MachineFunctionPass((intptr_t)&ID), II(0), TM(tm), MCE(mce) {} AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce, @@ -61,7 +61,7 @@ void emitBasicBlock(MachineBasicBlock &MBB); }; - const int AlphaCodeEmitter::ID = 0; + const char AlphaCodeEmitter::ID = 0; } /// createAlphaCodeEmitterPass - Return a pass that emits the collected Alpha code Index: llvm/lib/Target/Alpha/AlphaLLRP.cpp diff -u llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.9 llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.10 --- llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.9 Tue May 1 16:15:46 2007 +++ llvm/lib/Target/Alpha/AlphaLLRP.cpp Wed May 2 16:39:19 2007 @@ -37,7 +37,7 @@ /// AlphaTargetMachine &TM; - static const int ID; + static const char ID; AlphaLLRPPass(AlphaTargetMachine &tm) : MachineFunctionPass((intptr_t)&ID), TM(tm) { } @@ -154,7 +154,7 @@ return Changed; } }; - const int AlphaLLRPPass::ID = 0; + const char AlphaLLRPPass::ID = 0; } // end of anonymous namespace FunctionPass *llvm::createAlphaLLRPPass(AlphaTargetMachine &tm) { From dpatel at apple.com Wed May 2 16:41:37 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysis.cpp AliasAnalysisCounter.cpp AliasAnalysisEvaluator.cpp AliasDebugger.cpp AliasSetTracker.cpp BasicAliasAnalysis.cpp CFGPrinter.cpp InstCount.cpp IntervalPartition.cpp LoadValueNumbering.cpp LoopInfo.cpp LoopPass.cpp PostDominators.cpp ProfileInfo.cpp ProfileInfoLoaderPass.cpp ScalarEvolution.cpp ValueNumbering.cpp Message-ID: <200705022141.l42Lfbja024606@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasAnalysis.cpp updated: 1.32 -> 1.33 AliasAnalysisCounter.cpp updated: 1.21 -> 1.22 AliasAnalysisEvaluator.cpp updated: 1.34 -> 1.35 AliasDebugger.cpp updated: 1.4 -> 1.5 AliasSetTracker.cpp updated: 1.47 -> 1.48 BasicAliasAnalysis.cpp updated: 1.109 -> 1.110 CFGPrinter.cpp updated: 1.23 -> 1.24 InstCount.cpp updated: 1.21 -> 1.22 IntervalPartition.cpp updated: 1.33 -> 1.34 LoadValueNumbering.cpp updated: 1.40 -> 1.41 LoopInfo.cpp updated: 1.84 -> 1.85 LoopPass.cpp updated: 1.19 -> 1.20 PostDominators.cpp updated: 1.68 -> 1.69 ProfileInfo.cpp updated: 1.13 -> 1.14 ProfileInfoLoaderPass.cpp updated: 1.19 -> 1.20 ScalarEvolution.cpp updated: 1.114 -> 1.115 ValueNumbering.cpp updated: 1.26 -> 1.27 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+36 -36) AliasAnalysis.cpp | 2 +- AliasAnalysisCounter.cpp | 4 ++-- AliasAnalysisEvaluator.cpp | 4 ++-- AliasDebugger.cpp | 4 ++-- AliasSetTracker.cpp | 4 ++-- BasicAliasAnalysis.cpp | 8 ++++---- CFGPrinter.cpp | 8 ++++---- InstCount.cpp | 4 ++-- IntervalPartition.cpp | 2 +- LoadValueNumbering.cpp | 4 ++-- LoopInfo.cpp | 2 +- LoopPass.cpp | 2 +- PostDominators.cpp | 6 +++--- ProfileInfo.cpp | 6 +++--- ProfileInfoLoaderPass.cpp | 4 ++-- ScalarEvolution.cpp | 2 +- ValueNumbering.cpp | 6 +++--- 17 files changed, 36 insertions(+), 36 deletions(-) Index: llvm/lib/Analysis/AliasAnalysis.cpp diff -u llvm/lib/Analysis/AliasAnalysis.cpp:1.32 llvm/lib/Analysis/AliasAnalysis.cpp:1.33 --- llvm/lib/Analysis/AliasAnalysis.cpp:1.32 Wed May 2 15:37:47 2007 +++ llvm/lib/Analysis/AliasAnalysis.cpp Wed May 2 16:39:18 2007 @@ -36,7 +36,7 @@ namespace { RegisterAnalysisGroup Z("Alias Analysis"); } -const int AliasAnalysis::ID = 0; +const char AliasAnalysis::ID = 0; //===----------------------------------------------------------------------===// // Default chaining methods Index: llvm/lib/Analysis/AliasAnalysisCounter.cpp diff -u llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.21 llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.22 --- llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.21 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/AliasAnalysisCounter.cpp Wed May 2 16:39:18 2007 @@ -34,7 +34,7 @@ const char *Name; Module *M; public: - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo AliasAnalysisCounter() : ModulePass((intptr_t) &ID) { No = May = Must = 0; NoMR = JustRef = JustMod = MR = 0; @@ -108,7 +108,7 @@ } }; - const int AliasAnalysisCounter::ID = 0; + const char AliasAnalysisCounter::ID = 0; RegisterPass X("count-aa", "Count Alias Analysis Query Responses"); RegisterAnalysisGroup Y(X); Index: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp diff -u llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.34 llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.35 --- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.34 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Wed May 2 16:39:18 2007 @@ -50,7 +50,7 @@ unsigned NoModRef, Mod, Ref, ModRef; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid AAEval() : FunctionPass((intptr_t)&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -73,7 +73,7 @@ bool doFinalization(Module &M); }; - const int AAEval::ID = 0; + const char AAEval::ID = 0; RegisterPass X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator"); } Index: llvm/lib/Analysis/AliasDebugger.cpp diff -u llvm/lib/Analysis/AliasDebugger.cpp:1.4 llvm/lib/Analysis/AliasDebugger.cpp:1.5 --- llvm/lib/Analysis/AliasDebugger.cpp:1.4 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/AliasDebugger.cpp Wed May 2 16:39:18 2007 @@ -40,7 +40,7 @@ std::set Vals; public: - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo AliasDebugger() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M) { @@ -122,7 +122,7 @@ }; - const int AliasDebugger::ID = 0; + const char AliasDebugger::ID = 0; RegisterPass X("debug-aa", "AA use debugger"); RegisterAnalysisGroup Y(X); } Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.47 llvm/lib/Analysis/AliasSetTracker.cpp:1.48 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.47 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/AliasSetTracker.cpp Wed May 2 16:39:18 2007 @@ -555,7 +555,7 @@ class VISIBILITY_HIDDEN AliasSetPrinter : public FunctionPass { AliasSetTracker *Tracker; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid AliasSetPrinter() : FunctionPass((intptr_t)&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -573,6 +573,6 @@ return false; } }; - const int AliasSetPrinter::ID = 0; + const char AliasSetPrinter::ID = 0; RegisterPass X("print-alias-sets", "Alias Set Printer"); } Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.109 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.110 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.109 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Wed May 2 16:39:18 2007 @@ -36,7 +36,7 @@ /// such it doesn't follow many of the rules that other alias analyses must. /// struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public AliasAnalysis { - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo NoAA() : ImmutablePass((intptr_t)&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -77,7 +77,7 @@ }; // Register this pass... - const int NoAA::ID = 0; + const char NoAA::ID = 0; RegisterPass U("no-aa", "No Alias Analysis (always returns 'may' alias)"); @@ -92,7 +92,7 @@ /// Because it doesn't chain to a previous alias analysis (like -no-aa), it /// derives from the NoAA class. struct VISIBILITY_HIDDEN BasicAliasAnalysis : public NoAA { - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size); @@ -124,7 +124,7 @@ }; // Register this pass... - const int BasicAliasAnalysis::ID = 0; + const char BasicAliasAnalysis::ID = 0; RegisterPass X("basicaa", "Basic Alias Analysis (default AA impl)"); Index: llvm/lib/Analysis/CFGPrinter.cpp diff -u llvm/lib/Analysis/CFGPrinter.cpp:1.23 llvm/lib/Analysis/CFGPrinter.cpp:1.24 --- llvm/lib/Analysis/CFGPrinter.cpp:1.23 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/CFGPrinter.cpp Wed May 2 16:39:18 2007 @@ -91,7 +91,7 @@ namespace { struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid CFGPrinter() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { @@ -114,12 +114,12 @@ } }; - const int CFGPrinter::ID = 0; + const char CFGPrinter::ID = 0; RegisterPass P1("print-cfg", "Print CFG of function to 'dot' file"); struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid virtual bool runOnFunction(Function &F) { bool OldCFGOnly = CFGOnly; CFGOnly = true; @@ -134,7 +134,7 @@ } }; - const int CFGOnlyPrinter::ID = 0; + const char CFGOnlyPrinter::ID = 0; RegisterPass P2("print-cfg-only", "Print CFG of function to 'dot' file (with no function bodies)"); Index: llvm/lib/Analysis/InstCount.cpp diff -u llvm/lib/Analysis/InstCount.cpp:1.21 llvm/lib/Analysis/InstCount.cpp:1.22 --- llvm/lib/Analysis/InstCount.cpp:1.21 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/InstCount.cpp Wed May 2 16:39:18 2007 @@ -51,7 +51,7 @@ abort(); } public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid InstCount() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -63,7 +63,7 @@ }; - const int InstCount::ID = 0; + const char InstCount::ID = 0; RegisterPass X("instcount", "Counts the various types of Instructions"); } Index: llvm/lib/Analysis/IntervalPartition.cpp diff -u llvm/lib/Analysis/IntervalPartition.cpp:1.33 llvm/lib/Analysis/IntervalPartition.cpp:1.34 --- llvm/lib/Analysis/IntervalPartition.cpp:1.33 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/IntervalPartition.cpp Wed May 2 16:39:18 2007 @@ -15,7 +15,7 @@ #include "llvm/Analysis/IntervalIterator.h" using namespace llvm; -const int IntervalPartition::ID = 0; +const char IntervalPartition::ID = 0; static RegisterPass X("intervals", "Interval Partition Construction", true); Index: llvm/lib/Analysis/LoadValueNumbering.cpp diff -u llvm/lib/Analysis/LoadValueNumbering.cpp:1.40 llvm/lib/Analysis/LoadValueNumbering.cpp:1.41 --- llvm/lib/Analysis/LoadValueNumbering.cpp:1.40 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/LoadValueNumbering.cpp Wed May 2 16:39:18 2007 @@ -40,7 +40,7 @@ namespace { // FIXME: This should not be a FunctionPass. struct VISIBILITY_HIDDEN LoadVN : public FunctionPass, public ValueNumbering { - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo LoadVN() : FunctionPass((intptr_t)&ID) {} /// Pass Implementation stuff. This doesn't do any analysis. @@ -83,7 +83,7 @@ std::vector &RetVals) const; }; - const int LoadVN::ID = 0; + const char LoadVN::ID = 0; // Register this pass... RegisterPass X("load-vn", "Load Value Numbering"); Index: llvm/lib/Analysis/LoopInfo.cpp diff -u llvm/lib/Analysis/LoopInfo.cpp:1.84 llvm/lib/Analysis/LoopInfo.cpp:1.85 --- llvm/lib/Analysis/LoopInfo.cpp:1.84 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/LoopInfo.cpp Wed May 2 16:39:18 2007 @@ -27,7 +27,7 @@ #include using namespace llvm; -const int LoopInfo::ID = 0; +const char LoopInfo::ID = 0; static RegisterPass X("loops", "Natural Loop Construction", true); Index: llvm/lib/Analysis/LoopPass.cpp diff -u llvm/lib/Analysis/LoopPass.cpp:1.19 llvm/lib/Analysis/LoopPass.cpp:1.20 --- llvm/lib/Analysis/LoopPass.cpp:1.19 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/LoopPass.cpp Wed May 2 16:39:18 2007 @@ -21,7 +21,7 @@ // LPPassManager // -const int LPPassManager::ID = 0; +const char LPPassManager::ID = 0; /// LPPassManager manages FPPassManagers and CalLGraphSCCPasses. LPPassManager::LPPassManager(int Depth) Index: llvm/lib/Analysis/PostDominators.cpp diff -u llvm/lib/Analysis/PostDominators.cpp:1.68 llvm/lib/Analysis/PostDominators.cpp:1.69 --- llvm/lib/Analysis/PostDominators.cpp:1.68 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/PostDominators.cpp Wed May 2 16:39:18 2007 @@ -22,9 +22,9 @@ // PostDominatorTree Implementation //===----------------------------------------------------------------------===// -const int PostDominatorTree::ID = 0; -const int PostDominanceFrontier::ID = 0; -const int PostETForest::ID = 0; +const char PostDominatorTree::ID = 0; +const char PostDominanceFrontier::ID = 0; +const char PostETForest::ID = 0; static RegisterPass F("postdomtree", "Post-Dominator Tree Construction", true); Index: llvm/lib/Analysis/ProfileInfo.cpp diff -u llvm/lib/Analysis/ProfileInfo.cpp:1.13 llvm/lib/Analysis/ProfileInfo.cpp:1.14 --- llvm/lib/Analysis/ProfileInfo.cpp:1.13 Wed May 2 15:37:47 2007 +++ llvm/lib/Analysis/ProfileInfo.cpp Wed May 2 16:39:18 2007 @@ -24,7 +24,7 @@ namespace { RegisterAnalysisGroup Z("Profile Information"); } -const int ProfileInfo::ID = 0; +const char ProfileInfo::ID = 0; ProfileInfo::~ProfileInfo() {} @@ -86,11 +86,11 @@ namespace { struct VISIBILITY_HIDDEN NoProfileInfo : public ImmutablePass, public ProfileInfo { - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo NoProfileInfo() : ImmutablePass((intptr_t)&ID) {} }; - const int NoProfileInfo::ID = 0; + const char NoProfileInfo::ID = 0; // Register this pass... RegisterPass X("no-profile", "No Profile Information"); Index: llvm/lib/Analysis/ProfileInfoLoaderPass.cpp diff -u llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.19 llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.20 --- llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.19 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/ProfileInfoLoaderPass.cpp Wed May 2 16:39:18 2007 @@ -32,7 +32,7 @@ class VISIBILITY_HIDDEN LoaderPass : public ModulePass, public ProfileInfo { std::string Filename; public: - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo LoaderPass(const std::string &filename = "") : ModulePass((intptr_t)&ID), Filename(filename) { if (filename.empty()) Filename = ProfileInfoFilename; @@ -50,7 +50,7 @@ virtual bool runOnModule(Module &M); }; - const int LoaderPass::ID = 0; + const char LoaderPass::ID = 0; RegisterPass X("profile-loader", "Load profile information from llvmprof.out"); Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.114 llvm/lib/Analysis/ScalarEvolution.cpp:1.115 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.114 Wed May 2 15:37:47 2007 +++ llvm/lib/Analysis/ScalarEvolution.cpp Wed May 2 16:39:18 2007 @@ -105,7 +105,7 @@ RegisterPass R("scalar-evolution", "Scalar Evolution Analysis"); } -const int ScalarEvolution::ID = 0; +const char ScalarEvolution::ID = 0; //===----------------------------------------------------------------------===// // SCEV class definitions Index: llvm/lib/Analysis/ValueNumbering.cpp diff -u llvm/lib/Analysis/ValueNumbering.cpp:1.26 llvm/lib/Analysis/ValueNumbering.cpp:1.27 --- llvm/lib/Analysis/ValueNumbering.cpp:1.26 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/ValueNumbering.cpp Wed May 2 16:39:18 2007 @@ -22,7 +22,7 @@ #include "llvm/Support/Compiler.h" using namespace llvm; -const int ValueNumbering::ID = 0; +const char ValueNumbering::ID = 0; // Register the ValueNumbering interface, providing a nice name to refer to. static RegisterAnalysisGroup X("Value Numbering"); @@ -52,7 +52,7 @@ /// struct VISIBILITY_HIDDEN BasicVN : public ImmutablePass, public ValueNumbering { - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo BasicVN() : ImmutablePass((intptr_t)&ID) {} /// getEqualNumberNodes - Return nodes with the same value number as the @@ -65,7 +65,7 @@ std::vector &RetVals) const; }; - const int BasicVN::ID = 0; + const char BasicVN::ID = 0; // Register this pass... RegisterPass X("basicvn", "Basic Value Numbering (default GVN impl)"); From dpatel at apple.com Wed May 2 16:41:35 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp CallGraph.cpp CallGraphSCCPass.cpp FindUsedTypes.cpp GlobalsModRef.cpp Message-ID: <200705022141.l42LfZVG024495@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: Andersens.cpp updated: 1.47 -> 1.48 CallGraph.cpp updated: 1.67 -> 1.68 CallGraphSCCPass.cpp updated: 1.22 -> 1.23 FindUsedTypes.cpp updated: 1.39 -> 1.40 GlobalsModRef.cpp updated: 1.30 -> 1.31 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+10 -11) Andersens.cpp | 4 ++-- CallGraph.cpp | 7 +++---- CallGraphSCCPass.cpp | 4 ++-- FindUsedTypes.cpp | 2 +- GlobalsModRef.cpp | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) Index: llvm/lib/Analysis/IPA/Andersens.cpp diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.47 llvm/lib/Analysis/IPA/Andersens.cpp:1.48 --- llvm/lib/Analysis/IPA/Andersens.cpp:1.47 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/IPA/Andersens.cpp Wed May 2 16:39:18 2007 @@ -76,7 +76,7 @@ class VISIBILITY_HIDDEN Andersens : public ModulePass, public AliasAnalysis, private InstVisitor { public: - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo Andersens() : ModulePass((intptr_t)&ID) {} private: /// Node class - This class is used to represent a memory object in the @@ -339,7 +339,7 @@ void visitInstruction(Instruction &I); }; - const int Andersens::ID = 0; + const char Andersens::ID = 0; RegisterPass X("anders-aa", "Andersen's Interprocedural Alias Analysis"); RegisterAnalysisGroup Y(X); Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.67 llvm/lib/Analysis/IPA/CallGraph.cpp:1.68 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.67 Wed May 2 15:37:47 2007 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Wed May 2 16:39:18 2007 @@ -51,7 +51,7 @@ CallGraphNode *CallsExternalNode; public: - static const int ID; // Class identification, replacement for typeinfo + static const char ID; // Class identification, replacement for typeinfo BasicCallGraph() : ModulePass((intptr_t)&ID), Root(0), ExternalCallingNode(0), CallsExternalNode(0) {} @@ -190,15 +190,14 @@ } }; - RegisterAnalysisGroup X("Call Graph"); RegisterPass Y("basiccg", "Basic CallGraph Construction"); RegisterAnalysisGroup Z(Y); } //End anonymous namespace -const int CallGraph::ID = 0; -const int BasicCallGraph::ID = 0; +const char CallGraph::ID = 0; +const char BasicCallGraph::ID = 0; void CallGraph::initialize(Module &M) { Mod = &M; Index: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp diff -u llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.22 llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.23 --- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.22 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Wed May 2 16:39:18 2007 @@ -30,7 +30,7 @@ class CGPassManager : public ModulePass, public PMDataManager { public: - static const int ID; + static const char ID; CGPassManager(int Depth) : ModulePass((intptr_t)&ID), PMDataManager(Depth) { } @@ -73,7 +73,7 @@ } }; -const int CGPassManager::ID = 0; +const char CGPassManager::ID = 0; /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. bool CGPassManager::runOnModule(Module &M) { Index: llvm/lib/Analysis/IPA/FindUsedTypes.cpp diff -u llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.39 llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.40 --- llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.39 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/IPA/FindUsedTypes.cpp Wed May 2 16:39:18 2007 @@ -21,7 +21,7 @@ #include "llvm/Support/InstIterator.h" using namespace llvm; -const int FindUsedTypes::ID = 0; +const char FindUsedTypes::ID = 0; static RegisterPass X("printusedtypes", "Find Used Types"); Index: llvm/lib/Analysis/IPA/GlobalsModRef.cpp diff -u llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.30 llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.31 --- llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.30 Tue May 1 16:15:46 2007 +++ llvm/lib/Analysis/IPA/GlobalsModRef.cpp Wed May 2 16:39:18 2007 @@ -83,7 +83,7 @@ std::map FunctionInfo; public: - static const int ID; + static const char ID; GlobalsModRef() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M) { @@ -146,7 +146,7 @@ bool AnalyzeIndirectGlobalMemory(GlobalValue *GV); }; - const int GlobalsModRef::ID = 0; + const char GlobalsModRef::ID = 0; RegisterPass X("globalsmodref-aa", "Simple mod/ref analysis for globals"); RegisterAnalysisGroup Y(X); From dpatel at apple.com Wed May 2 16:41:38 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:38 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp BranchFolding.cpp ELFWriter.cpp ELFWriter.h LiveIntervalAnalysis.cpp LiveVariables.cpp MachOWriter.cpp MachOWriter.h MachineFunction.cpp MachineModuleInfo.cpp PHIElimination.cpp PrologEpilogInserter.cpp RegAllocLinearScan.cpp RegAllocLocal.cpp RegAllocSimple.cpp TwoAddressInstructionPass.cpp UnreachableBlockElim.cpp Message-ID: <200705022141.l42LfcaU024653@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.161 -> 1.162 BranchFolding.cpp updated: 1.47 -> 1.48 ELFWriter.cpp updated: 1.39 -> 1.40 ELFWriter.h updated: 1.2 -> 1.3 LiveIntervalAnalysis.cpp updated: 1.241 -> 1.242 LiveVariables.cpp updated: 1.80 -> 1.81 MachOWriter.cpp updated: 1.33 -> 1.34 MachOWriter.h updated: 1.4 -> 1.5 MachineFunction.cpp updated: 1.112 -> 1.113 MachineModuleInfo.cpp updated: 1.7 -> 1.8 PHIElimination.cpp updated: 1.58 -> 1.59 PrologEpilogInserter.cpp updated: 1.85 -> 1.86 RegAllocLinearScan.cpp updated: 1.146 -> 1.147 RegAllocLocal.cpp updated: 1.103 -> 1.104 RegAllocSimple.cpp updated: 1.84 -> 1.85 TwoAddressInstructionPass.cpp updated: 1.48 -> 1.49 UnreachableBlockElim.cpp updated: 1.10 -> 1.11 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+30 -30) AsmPrinter.cpp | 2 +- BranchFolding.cpp | 4 ++-- ELFWriter.cpp | 2 +- ELFWriter.h | 2 +- LiveIntervalAnalysis.cpp | 2 +- LiveVariables.cpp | 2 +- MachOWriter.cpp | 2 +- MachOWriter.h | 2 +- MachineFunction.cpp | 8 ++++---- MachineModuleInfo.cpp | 6 +++--- PHIElimination.cpp | 4 ++-- PrologEpilogInserter.cpp | 4 ++-- RegAllocLinearScan.cpp | 4 ++-- RegAllocLocal.cpp | 4 ++-- RegAllocSimple.cpp | 4 ++-- TwoAddressInstructionPass.cpp | 4 ++-- UnreachableBlockElim.cpp | 4 ++-- 17 files changed, 30 insertions(+), 30 deletions(-) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.161 llvm/lib/CodeGen/AsmPrinter.cpp:1.162 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.161 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/AsmPrinter.cpp Wed May 2 16:39:18 2007 @@ -32,7 +32,7 @@ static cl::opt AsmVerbose("asm-verbose", cl::Hidden, cl::desc("Add comments to directives.")); -const int AsmPrinter::ID = 0; +const char AsmPrinter::ID = 0; AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm, const TargetAsmInfo *T) : MachineFunctionPass((intptr_t)&ID), FunctionNumber(0), O(o), TM(tm), TAI(T) Index: llvm/lib/CodeGen/BranchFolding.cpp diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.47 llvm/lib/CodeGen/BranchFolding.cpp:1.48 --- llvm/lib/CodeGen/BranchFolding.cpp:1.47 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/BranchFolding.cpp Wed May 2 16:39:18 2007 @@ -39,7 +39,7 @@ namespace { struct BranchFolder : public MachineFunctionPass { - static const int ID; + static const char ID; BranchFolder() : MachineFunctionPass((intptr_t)&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); @@ -67,7 +67,7 @@ MachineBasicBlock *TBB, MachineBasicBlock *FBB, const std::vector &Cond); }; - const int BranchFolder::ID = 0; + const char BranchFolder::ID = 0; } FunctionPass *llvm::createBranchFoldingPass() { return new BranchFolder(); } Index: llvm/lib/CodeGen/ELFWriter.cpp diff -u llvm/lib/CodeGen/ELFWriter.cpp:1.39 llvm/lib/CodeGen/ELFWriter.cpp:1.40 --- llvm/lib/CodeGen/ELFWriter.cpp:1.39 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/ELFWriter.cpp Wed May 2 16:39:18 2007 @@ -47,7 +47,7 @@ #include using namespace llvm; -const int ELFWriter::ID = 0; +const char ELFWriter::ID = 0; /// AddELFWriter - Concrete function to add the ELF writer to the function pass /// manager. MachineCodeEmitter *llvm::AddELFWriter(FunctionPassManager &FPM, Index: llvm/lib/CodeGen/ELFWriter.h diff -u llvm/lib/CodeGen/ELFWriter.h:1.2 llvm/lib/CodeGen/ELFWriter.h:1.3 --- llvm/lib/CodeGen/ELFWriter.h:1.2 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/ELFWriter.h Wed May 2 16:39:18 2007 @@ -30,7 +30,7 @@ class ELFWriter : public MachineFunctionPass { friend class ELFCodeEmitter; public: - static const int ID; + static const char ID; MachineCodeEmitter &getMachineCodeEmitter() const { return *(MachineCodeEmitter*)MCE; Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.241 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.242 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.241 Wed May 2 15:37:47 2007 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Wed May 2 16:39:18 2007 @@ -44,7 +44,7 @@ STATISTIC(numFolded , "Number of loads/stores folded into instructions"); STATISTIC(numAborts , "Number of times interval joining aborted"); -const int LiveIntervals::ID = 0; +const char LiveIntervals::ID = 0; namespace { RegisterPass X("liveintervals", "Live Interval Analysis"); Index: llvm/lib/CodeGen/LiveVariables.cpp diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.80 llvm/lib/CodeGen/LiveVariables.cpp:1.81 --- llvm/lib/CodeGen/LiveVariables.cpp:1.80 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/LiveVariables.cpp Wed May 2 16:39:18 2007 @@ -37,7 +37,7 @@ #include using namespace llvm; -const int LiveVariables::ID = 0; +const char LiveVariables::ID = 0; static RegisterPass X("livevars", "Live Variable Analysis"); void LiveVariables::VarInfo::dump() const { Index: llvm/lib/CodeGen/MachOWriter.cpp diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.33 llvm/lib/CodeGen/MachOWriter.cpp:1.34 --- llvm/lib/CodeGen/MachOWriter.cpp:1.33 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/MachOWriter.cpp Wed May 2 16:39:19 2007 @@ -317,7 +317,7 @@ // MachOWriter Implementation //===----------------------------------------------------------------------===// -const int MachOWriter::ID = 0; +const char MachOWriter::ID = 0; MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm) : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) { is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64; Index: llvm/lib/CodeGen/MachOWriter.h diff -u llvm/lib/CodeGen/MachOWriter.h:1.4 llvm/lib/CodeGen/MachOWriter.h:1.5 --- llvm/lib/CodeGen/MachOWriter.h:1.4 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/MachOWriter.h Wed May 2 16:39:19 2007 @@ -84,7 +84,7 @@ class MachOWriter : public MachineFunctionPass { friend class MachOCodeEmitter; public: - static const int ID; + static const char ID; MachineCodeEmitter &getMachineCodeEmitter() const { return *(MachineCodeEmitter*)MCE; } Index: llvm/lib/CodeGen/MachineFunction.cpp diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.112 llvm/lib/CodeGen/MachineFunction.cpp:1.113 --- llvm/lib/CodeGen/MachineFunction.cpp:1.112 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/MachineFunction.cpp Wed May 2 16:39:19 2007 @@ -44,7 +44,7 @@ namespace { struct VISIBILITY_HIDDEN Printer : public MachineFunctionPass { - static const int ID; + static const char ID; std::ostream *OS; const std::string Banner; @@ -64,7 +64,7 @@ return false; } }; - const int Printer::ID = 0; + const char Printer::ID = 0; } /// Returns a newly-created MachineFunction Printer pass. The default output @@ -77,7 +77,7 @@ namespace { struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass { - static const int ID; + static const char ID; Deleter() : MachineFunctionPass((intptr_t)&ID) {} const char *getPassName() const { return "Machine Code Deleter"; } @@ -88,7 +88,7 @@ return true; } }; - const int Deleter::ID = 0; + const char Deleter::ID = 0; } /// MachineCodeDeletion Pass - This pass deletes all of the machine code for Index: llvm/lib/CodeGen/MachineModuleInfo.cpp diff -u llvm/lib/CodeGen/MachineModuleInfo.cpp:1.7 llvm/lib/CodeGen/MachineModuleInfo.cpp:1.8 --- llvm/lib/CodeGen/MachineModuleInfo.cpp:1.7 Wed May 2 15:37:47 2007 +++ llvm/lib/CodeGen/MachineModuleInfo.cpp Wed May 2 16:39:19 2007 @@ -30,7 +30,7 @@ namespace { RegisterPass X("machinemoduleinfo", "Module Information"); } -const int MachineModuleInfo::ID = 0; +const char MachineModuleInfo::ID = 0; //===----------------------------------------------------------------------===// @@ -1751,14 +1751,14 @@ namespace llvm { struct DebugLabelFolder : public MachineFunctionPass { - static const int ID; + static const char ID; DebugLabelFolder() : MachineFunctionPass((intptr_t)&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Label Folder"; } }; -const int DebugLabelFolder::ID = 0; +const char DebugLabelFolder::ID = 0; bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) { // Get machine module info. Index: llvm/lib/CodeGen/PHIElimination.cpp diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.58 llvm/lib/CodeGen/PHIElimination.cpp:1.59 --- llvm/lib/CodeGen/PHIElimination.cpp:1.58 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/PHIElimination.cpp Wed May 2 16:39:19 2007 @@ -33,7 +33,7 @@ namespace { struct VISIBILITY_HIDDEN PNE : public MachineFunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid PNE() : MachineFunctionPass((intptr_t)&ID) {} bool runOnMachineFunction(MachineFunction &Fn) { @@ -76,7 +76,7 @@ VRegPHIUse VRegPHIUseCount; }; - const int PNE::ID = 0; + const char PNE::ID = 0; RegisterPass X("phi-node-elimination", "Eliminate PHI nodes for register allocation"); } Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.85 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.86 --- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.85 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/PrologEpilogInserter.cpp Wed May 2 16:39:19 2007 @@ -32,7 +32,7 @@ namespace { struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass { - static const int ID; + static const char ID; PEI() : MachineFunctionPass((intptr_t)&ID) {} const char *getPassName() const { @@ -101,7 +101,7 @@ void replaceFrameIndices(MachineFunction &Fn); void insertPrologEpilogCode(MachineFunction &Fn); }; - const int PEI::ID = 0; + const char PEI::ID = 0; } Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.146 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.147 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.146 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Wed May 2 16:39:19 2007 @@ -48,7 +48,7 @@ static unsigned numIntervals = 0; struct VISIBILITY_HIDDEN RA : public MachineFunctionPass { - static const int ID; + static const char ID; RA() : MachineFunctionPass((intptr_t)&ID) {} typedef std::pair IntervalPtr; @@ -149,7 +149,7 @@ } } }; - const int RA::ID = 0; + const char RA::ID = 0; } void RA::ComputeRelatedRegClasses() { Index: llvm/lib/CodeGen/RegAllocLocal.cpp diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.103 llvm/lib/CodeGen/RegAllocLocal.cpp:1.104 --- llvm/lib/CodeGen/RegAllocLocal.cpp:1.103 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/RegAllocLocal.cpp Wed May 2 16:39:19 2007 @@ -44,7 +44,7 @@ class VISIBILITY_HIDDEN RA : public MachineFunctionPass { public: - static const int ID; + static const char ID; RA() : MachineFunctionPass((intptr_t)&ID) {} private: const TargetMachine *TM; @@ -228,7 +228,7 @@ void reloadPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I, unsigned PhysReg); }; - const int RA::ID = 0; + const char RA::ID = 0; } /// getStackSpaceFor - This allocates space for the specified virtual register Index: llvm/lib/CodeGen/RegAllocSimple.cpp diff -u llvm/lib/CodeGen/RegAllocSimple.cpp:1.84 llvm/lib/CodeGen/RegAllocSimple.cpp:1.85 --- llvm/lib/CodeGen/RegAllocSimple.cpp:1.84 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/RegAllocSimple.cpp Wed May 2 16:39:19 2007 @@ -39,7 +39,7 @@ class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass { public: - static const int ID; + static const char ID; RegAllocSimple() : MachineFunctionPass((intptr_t)&ID) {} private: MachineFunction *MF; @@ -94,7 +94,7 @@ void spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, unsigned VirtReg, unsigned PhysReg); }; - const int RegAllocSimple::ID = 0; + const char RegAllocSimple::ID = 0; } /// getStackSpaceFor - This allocates space for the specified virtual Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.48 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.49 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.48 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Wed May 2 16:39:19 2007 @@ -50,7 +50,7 @@ namespace { struct VISIBILITY_HIDDEN TwoAddressInstructionPass : public MachineFunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid TwoAddressInstructionPass() : MachineFunctionPass((intptr_t)&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const; @@ -59,7 +59,7 @@ bool runOnMachineFunction(MachineFunction&); }; - const int TwoAddressInstructionPass::ID = 0; + const char TwoAddressInstructionPass::ID = 0; RegisterPass X("twoaddressinstruction", "Two-Address instruction pass"); } Index: llvm/lib/CodeGen/UnreachableBlockElim.cpp diff -u llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.10 llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.11 --- llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.10 Tue May 1 16:15:46 2007 +++ llvm/lib/CodeGen/UnreachableBlockElim.cpp Wed May 2 16:39:19 2007 @@ -35,10 +35,10 @@ class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass { virtual bool runOnFunction(Function &F); public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {} }; - const int UnreachableBlockElim::ID = 0; + const char UnreachableBlockElim::ID = 0; RegisterPass X("unreachableblockelim", "Remove unreachable blocks from the CFG"); } From dpatel at apple.com Wed May 2 16:41:36 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 16:41:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp BasicBlockPlacement.cpp CodeGenPrepare.cpp CondPropagate.cpp ConstantProp.cpp CorrelatedExprs.cpp DCE.cpp DeadStoreElimination.cpp GCSE.cpp IndVarSimplify.cpp InstructionCombining.cpp LICM.cpp LoopRotation.cpp LoopStrengthReduce.cpp LoopUnroll.cpp LoopUnswitch.cpp LowerGC.cpp LowerPacked.cpp PredicateSimplifier.cpp Reassociate.cpp Reg2Mem.cpp SCCP.cpp ScalarReplAggregates.cpp SimplifyCFG.cpp TailDuplication.cpp TailRecursionElimination.cpp Message-ID: <200705022141.l42LfaoB024539@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.107 -> 1.108 BasicBlockPlacement.cpp updated: 1.10 -> 1.11 CodeGenPrepare.cpp updated: 1.7 -> 1.8 CondPropagate.cpp updated: 1.19 -> 1.20 ConstantProp.cpp updated: 1.57 -> 1.58 CorrelatedExprs.cpp updated: 1.58 -> 1.59 DCE.cpp updated: 1.64 -> 1.65 DeadStoreElimination.cpp updated: 1.18 -> 1.19 GCSE.cpp updated: 1.54 -> 1.55 IndVarSimplify.cpp updated: 1.116 -> 1.117 InstructionCombining.cpp updated: 1.755 -> 1.756 LICM.cpp updated: 1.97 -> 1.98 LoopRotation.cpp updated: 1.11 -> 1.12 LoopStrengthReduce.cpp updated: 1.132 -> 1.133 LoopUnroll.cpp updated: 1.40 -> 1.41 LoopUnswitch.cpp updated: 1.66 -> 1.67 LowerGC.cpp updated: 1.23 -> 1.24 LowerPacked.cpp updated: 1.22 -> 1.23 PredicateSimplifier.cpp updated: 1.72 -> 1.73 Reassociate.cpp updated: 1.79 -> 1.80 Reg2Mem.cpp updated: 1.13 -> 1.14 SCCP.cpp updated: 1.166 -> 1.167 ScalarReplAggregates.cpp updated: 1.91 -> 1.92 SimplifyCFG.cpp updated: 1.22 -> 1.23 TailDuplication.cpp updated: 1.38 -> 1.39 TailRecursionElimination.cpp updated: 1.31 -> 1.32 --- Log message: Use 'static const char' instead of 'static const int'. Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. --- Diffs of the changes: (+56 -56) ADCE.cpp | 4 ++-- BasicBlockPlacement.cpp | 4 ++-- CodeGenPrepare.cpp | 4 ++-- CondPropagate.cpp | 4 ++-- ConstantProp.cpp | 4 ++-- CorrelatedExprs.cpp | 4 ++-- DCE.cpp | 8 ++++---- DeadStoreElimination.cpp | 4 ++-- GCSE.cpp | 4 ++-- IndVarSimplify.cpp | 4 ++-- InstructionCombining.cpp | 4 ++-- LICM.cpp | 4 ++-- LoopRotation.cpp | 4 ++-- LoopStrengthReduce.cpp | 4 ++-- LoopUnroll.cpp | 4 ++-- LoopUnswitch.cpp | 4 ++-- LowerGC.cpp | 4 ++-- LowerPacked.cpp | 4 ++-- PredicateSimplifier.cpp | 4 ++-- Reassociate.cpp | 4 ++-- Reg2Mem.cpp | 4 ++-- SCCP.cpp | 8 ++++---- ScalarReplAggregates.cpp | 4 ++-- SimplifyCFG.cpp | 4 ++-- TailDuplication.cpp | 4 ++-- TailRecursionElimination.cpp | 4 ++-- 26 files changed, 56 insertions(+), 56 deletions(-) Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.107 llvm/lib/Transforms/Scalar/ADCE.cpp:1.108 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.107 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Wed May 2 16:39:19 2007 @@ -52,7 +52,7 @@ // The public interface for this class // public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid ADCE() : FunctionPass((intptr_t)&ID) {} // Execute the Aggressive Dead Code Elimination Algorithm @@ -107,7 +107,7 @@ } }; - const int ADCE::ID = 0; + const char ADCE::ID = 0; RegisterPass X("adce", "Aggressive Dead Code Elimination"); } // End of anonymous namespace Index: llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp diff -u llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.10 llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.11 --- llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.10 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp Wed May 2 16:39:19 2007 @@ -41,7 +41,7 @@ namespace { struct VISIBILITY_HIDDEN BlockPlacement : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid BlockPlacement() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -73,7 +73,7 @@ void PlaceBlocks(BasicBlock *BB); }; - const int BlockPlacement::ID = 0; + const char BlockPlacement::ID = 0; RegisterPass X("block-placement", "Profile Guided Basic Block Placement"); } Index: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp diff -u llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.7 llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.8 --- llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.7 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp Wed May 2 16:39:19 2007 @@ -39,7 +39,7 @@ /// transformation profitability. const TargetLowering *TLI; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid CodeGenPrepare(const TargetLowering *tli = 0) : FunctionPass((intptr_t)&ID), TLI(tli) {} bool runOnFunction(Function &F); @@ -55,7 +55,7 @@ }; } -const int CodeGenPrepare::ID = 0; +const char CodeGenPrepare::ID = 0; static RegisterPass X("codegenprepare", "Optimize for code generation"); Index: llvm/lib/Transforms/Scalar/CondPropagate.cpp diff -u llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.19 llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.20 --- llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.19 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/CondPropagate.cpp Wed May 2 16:39:19 2007 @@ -31,7 +31,7 @@ namespace { struct VISIBILITY_HIDDEN CondProp : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid CondProp() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -49,7 +49,7 @@ void RevectorBlockTo(BasicBlock *FromBB, BasicBlock *ToBB); }; - const int CondProp::ID = 0; + const char CondProp::ID = 0; RegisterPass X("condprop", "Conditional Propagation"); } Index: llvm/lib/Transforms/Scalar/ConstantProp.cpp diff -u llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.57 llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.58 --- llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.57 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/ConstantProp.cpp Wed May 2 16:39:19 2007 @@ -34,7 +34,7 @@ namespace { struct VISIBILITY_HIDDEN ConstantPropagation : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid ConstantPropagation() : FunctionPass((intptr_t)&ID) {} bool runOnFunction(Function &F); @@ -44,7 +44,7 @@ } }; - const int ConstantPropagation::ID = 0; + const char ConstantPropagation::ID = 0; RegisterPass X("constprop", "Simple constant propagation"); } Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.58 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.59 --- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.58 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp Wed May 2 16:39:19 2007 @@ -225,7 +225,7 @@ std::map RegionInfoMap; ETForest *EF; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid CEE() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -288,7 +288,7 @@ bool SimplifyInstruction(Instruction *Inst, const RegionInfo &RI); }; - const int CEE::ID = 0; + const char CEE::ID = 0; RegisterPass X("cee", "Correlated Expression Elimination"); } Index: llvm/lib/Transforms/Scalar/DCE.cpp diff -u llvm/lib/Transforms/Scalar/DCE.cpp:1.64 llvm/lib/Transforms/Scalar/DCE.cpp:1.65 --- llvm/lib/Transforms/Scalar/DCE.cpp:1.64 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/DCE.cpp Wed May 2 16:39:19 2007 @@ -35,7 +35,7 @@ // DeadInstElimination pass implementation // struct VISIBILITY_HIDDEN DeadInstElimination : public BasicBlockPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid DeadInstElimination() : BasicBlockPass(intptr_t(&ID)) {} virtual bool runOnBasicBlock(BasicBlock &BB) { bool Changed = false; @@ -53,7 +53,7 @@ } }; - const int DeadInstElimination::ID = 0; + const char DeadInstElimination::ID = 0; RegisterPass X("die", "Dead Instruction Elimination"); } @@ -67,7 +67,7 @@ // DeadCodeElimination pass implementation // struct DCE : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid DCE() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -77,7 +77,7 @@ } }; - const int DCE::ID = 0; + const char DCE::ID = 0; RegisterPass Y("dce", "Dead Code Elimination"); } Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp diff -u llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.18 llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.19 --- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.18 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp Wed May 2 16:39:19 2007 @@ -34,7 +34,7 @@ namespace { struct VISIBILITY_HIDDEN DSE : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid DSE() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { @@ -58,7 +58,7 @@ AU.addPreserved(); } }; - const int DSE::ID = 0; + const char DSE::ID = 0; RegisterPass X("dse", "Dead Store Elimination"); } Index: llvm/lib/Transforms/Scalar/GCSE.cpp diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.54 llvm/lib/Transforms/Scalar/GCSE.cpp:1.55 --- llvm/lib/Transforms/Scalar/GCSE.cpp:1.54 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/GCSE.cpp Wed May 2 16:39:19 2007 @@ -37,7 +37,7 @@ "with constant values"); namespace { struct VISIBILITY_HIDDEN GCSE : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid GCSE() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -54,7 +54,7 @@ } }; - const int GCSE::ID = 0; + const char GCSE::ID = 0; RegisterPass X("gcse", "Global Common Subexpression Elimination"); } Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.116 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.117 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.116 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Wed May 2 16:39:19 2007 @@ -69,7 +69,7 @@ bool Changed; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid IndVarSimplify() : LoopPass((intptr_t)&ID) {} bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -95,7 +95,7 @@ void DeleteTriviallyDeadInstructions(std::set &Insts); }; - const int IndVarSimplify::ID = 0; + const char IndVarSimplify::ID = 0; RegisterPass X("indvars", "Canonicalize Induction Variables"); } Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.755 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.756 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.755 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed May 2 16:39:19 2007 @@ -76,7 +76,7 @@ TargetData *TD; bool MustPreserveLCSSA; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid InstCombiner() : FunctionPass((intptr_t)&ID) {} /// AddToWorkList - Add the specified instruction to the worklist if it @@ -361,7 +361,7 @@ Value *EvaluateInDifferentType(Value *V, const Type *Ty, bool isSigned); }; - const int InstCombiner::ID = 0; + const char InstCombiner::ID = 0; RegisterPass X("instcombine", "Combine redundant instructions"); } Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.97 llvm/lib/Transforms/Scalar/LICM.cpp:1.98 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.97 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/LICM.cpp Wed May 2 16:39:19 2007 @@ -63,7 +63,7 @@ cl::desc("Disable memory promotion in LICM pass")); struct VISIBILITY_HIDDEN LICM : public LoopPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid LICM() : LoopPass((intptr_t)&ID) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -204,7 +204,7 @@ std::map &Val2AlMap); }; - const int LICM::ID = 0; + const char LICM::ID = 0; RegisterPass X("licm", "Loop Invariant Code Motion"); } Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.11 llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.12 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.11 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Wed May 2 16:39:19 2007 @@ -44,7 +44,7 @@ class VISIBILITY_HIDDEN LoopRotate : public LoopPass { public: - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid LoopRotate() : LoopPass((intptr_t)&ID) {} // Rotate Loop L as many times as possible. Return true if @@ -94,7 +94,7 @@ SmallVector LoopHeaderInfo; }; - const int LoopRotate::ID = 0; + const char LoopRotate::ID = 0; RegisterPass X ("loop-rotate", "Rotate Loops"); } Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.132 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.133 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.132 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Wed May 2 16:39:19 2007 @@ -143,7 +143,7 @@ const TargetLowering *TLI; public: - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid LoopStrengthReduce(const TargetLowering *tli = NULL) : LoopPass((intptr_t)&ID), TLI(tli) { } @@ -188,7 +188,7 @@ Loop *L, bool isOnlyStride); void DeleteTriviallyDeadInstructions(std::set &Insts); }; - const int LoopStrengthReduce::ID = 0; + const char LoopStrengthReduce::ID = 0; RegisterPass X("loop-reduce", "Loop Strength Reduction"); } Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.40 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.41 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.40 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Wed May 2 16:39:19 2007 @@ -49,7 +49,7 @@ class VISIBILITY_HIDDEN LoopUnroll : public LoopPass { LoopInfo *LI; // The current loop information public: - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid LoopUnroll() : LoopPass((intptr_t)&ID) {} bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -66,7 +66,7 @@ AU.addPreserved(); } }; - const int LoopUnroll::ID = 0; + const char LoopUnroll::ID = 0; RegisterPass X("loop-unroll", "Unroll loops"); } Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.66 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.67 --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.66 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Wed May 2 16:39:19 2007 @@ -69,7 +69,7 @@ SmallPtrSet UnswitchedVals; public: - static const int ID; // Pass ID, replacement for typeid + static const char ID; // Pass ID, replacement for typeid LoopUnswitch() : LoopPass((intptr_t)&ID) {} bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -112,7 +112,7 @@ std::vector &Worklist); void RemoveLoopFromHierarchy(Loop *L); }; - const int LoopUnswitch::ID = 0; + const char LoopUnswitch::ID = 0; RegisterPass X("loop-unswitch", "Unswitch loops"); } Index: llvm/lib/Transforms/Scalar/LowerGC.cpp diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.23 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.24 --- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.23 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/LowerGC.cpp Wed May 2 16:39:19 2007 @@ -47,7 +47,7 @@ /// had zero roots. const Type *MainRootRecordType; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid LowerGC() : FunctionPass((intptr_t)&ID), GCRootInt(0), GCReadInt(0), GCWriteInt(0), GCRead(0), GCWrite(0), RootChain(0), MainRootRecordType(0) {} @@ -58,7 +58,7 @@ const StructType *getRootRecordType(unsigned NumRoots); }; - const int LowerGC::ID = 0; + const char LowerGC::ID = 0; RegisterPass X("lowergc", "Lower GC intrinsics, for GCless code generators"); } Index: llvm/lib/Transforms/Scalar/LowerPacked.cpp diff -u llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.22 llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.23 --- llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.22 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/LowerPacked.cpp Wed May 2 16:39:19 2007 @@ -40,7 +40,7 @@ class VISIBILITY_HIDDEN LowerPacked : public FunctionPass, public InstVisitor { public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid LowerPacked() : FunctionPass((intptr_t)&ID) {} /// @brief Lowers packed operations to scalar operations. @@ -107,7 +107,7 @@ std::vector instrsToRemove; }; -const int LowerPacked::ID = 0; +const char LowerPacked::ID = 0; RegisterPass X("lower-packed", "lowers packed operations to operations on smaller packed datatypes"); Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.72 llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.73 --- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.72 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp Wed May 2 16:39:19 2007 @@ -1989,7 +1989,7 @@ std::vector WorkList; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid PredicateSimplifier() : FunctionPass((intptr_t)&ID) {} bool runOnFunction(Function &F); @@ -2377,7 +2377,7 @@ } } - const int PredicateSimplifier::ID = 0; + const char PredicateSimplifier::ID = 0; RegisterPass X("predsimplify", "Predicate Simplifier"); } Index: llvm/lib/Transforms/Scalar/Reassociate.cpp diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.79 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.80 --- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.79 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/Reassociate.cpp Wed May 2 16:39:19 2007 @@ -69,7 +69,7 @@ std::map ValueRankMap; bool MadeChange; public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid Reassociate() : FunctionPass((intptr_t)&ID) {} bool runOnFunction(Function &F); @@ -92,7 +92,7 @@ void RemoveDeadBinaryOp(Value *V); }; - const int Reassociate::ID = 0; + const char Reassociate::ID = 0; RegisterPass X("reassociate", "Reassociate expressions"); } Index: llvm/lib/Transforms/Scalar/Reg2Mem.cpp diff -u llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.13 llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.14 --- llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.13 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/Reg2Mem.cpp Wed May 2 16:39:19 2007 @@ -33,7 +33,7 @@ namespace { struct VISIBILITY_HIDDEN RegToMem : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid RegToMem() : FunctionPass((intptr_t)&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -78,7 +78,7 @@ } }; - const int RegToMem::ID = 0; + const char RegToMem::ID = 0; RegisterPass X("reg2mem", "Demote all values to stack slots"); } Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.166 llvm/lib/Transforms/Scalar/SCCP.cpp:1.167 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.166 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Wed May 2 16:39:19 2007 @@ -1334,7 +1334,7 @@ /// Sparse Conditional Constant Propagator. /// struct VISIBILITY_HIDDEN SCCP : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid SCCP() : FunctionPass((intptr_t)&ID) {} // runOnFunction - Run the Sparse Conditional Constant Propagation @@ -1347,7 +1347,7 @@ } }; - const int SCCP::ID = 0; + const char SCCP::ID = 0; RegisterPass X("sccp", "Sparse Conditional Constant Propagation"); } // end anonymous namespace @@ -1447,12 +1447,12 @@ /// Constant Propagation. /// struct VISIBILITY_HIDDEN IPSCCP : public ModulePass { - static const int ID; + static const char ID; IPSCCP() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); }; - const int IPSCCP::ID = 0; + const char IPSCCP::ID = 0; RegisterPass Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation"); } // end anonymous namespace Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.91 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.92 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.91 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Wed May 2 16:39:19 2007 @@ -47,7 +47,7 @@ namespace { struct VISIBILITY_HIDDEN SROA : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid SROA() : FunctionPass((intptr_t)&ID) {} bool runOnFunction(Function &F); @@ -84,7 +84,7 @@ static Instruction *isOnlyCopiedFromConstantGlobal(AllocationInst *AI); }; - const int SROA::ID = 0; + const char SROA::ID = 0; RegisterPass X("scalarrepl", "Scalar Replacement of Aggregates"); } Index: llvm/lib/Transforms/Scalar/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.22 llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.23 --- llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.22 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/SimplifyCFG.cpp Wed May 2 16:39:19 2007 @@ -35,12 +35,12 @@ namespace { struct VISIBILITY_HIDDEN CFGSimplifyPass : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid CFGSimplifyPass() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); }; - const int CFGSimplifyPass::ID = 0; + const char CFGSimplifyPass::ID = 0; RegisterPass X("simplifycfg", "Simplify the CFG"); } Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp diff -u llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.38 llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.39 --- llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.38 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/TailDuplication.cpp Wed May 2 16:39:19 2007 @@ -43,14 +43,14 @@ class VISIBILITY_HIDDEN TailDup : public FunctionPass { bool runOnFunction(Function &F); public: - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid TailDup() : FunctionPass((intptr_t)&ID) {} private: inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI); inline void eliminateUnconditionalBranch(BranchInst *BI); }; - const int TailDup::ID = 0; + const char TailDup::ID = 0; RegisterPass X("tailduplicate", "Tail Duplication"); } Index: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp diff -u llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.31 llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.32 --- llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.31 Tue May 1 16:15:47 2007 +++ llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp Wed May 2 16:39:19 2007 @@ -67,7 +67,7 @@ namespace { struct VISIBILITY_HIDDEN TailCallElim : public FunctionPass { - static const int ID; // Pass identifcation, replacement for typeid + static const char ID; // Pass identifcation, replacement for typeid TailCallElim() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -80,7 +80,7 @@ bool CanMoveAboveCall(Instruction *I, CallInst *CI); Value *CanTransformAccumulatorRecursion(Instruction *I, CallInst *CI); }; - const int TailCallElim::ID = 0; + const char TailCallElim::ID = 0; RegisterPass X("tailcallelim", "Tail Call Elimination"); } From isanbard at gmail.com Wed May 2 16:42:42 2007 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 2 May 2007 16:42:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/README-MMX.txt Message-ID: <200705022142.l42Lgg3x024726@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: README-MMX.txt updated: 1.3 -> 1.4 --- Log message: Update. --- Diffs of the changes: (+27 -0) README-MMX.txt | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+) Index: llvm/lib/Target/X86/README-MMX.txt diff -u llvm/lib/Target/X86/README-MMX.txt:1.3 llvm/lib/Target/X86/README-MMX.txt:1.4 --- llvm/lib/Target/X86/README-MMX.txt:1.3 Tue Apr 24 16:20:03 2007 +++ llvm/lib/Target/X86/README-MMX.txt Wed May 2 16:42:20 2007 @@ -40,3 +40,30 @@ movl %edx, 4(%eax) addl $12, %esp ret $4 + +//===---------------------------------------------------------------------===// + +int main() { + __m64 A[1] = { _mm_cvtsi32_si64(1) }; + __m64 B[1] = { _mm_cvtsi32_si64(10) }; + __m64 sum = _mm_cvtsi32_si64(0); + + sum = __builtin_ia32_paddq(__builtin_ia32_paddq(A[0], B[0]), sum); + + printf("Sum = %d\n", _mm_cvtsi64_si32(sum)); + return 0; +} + +Generates: + + movl $11, %eax +### movd %eax, %mm0 +### movq %mm0, 8(%esp) +### movl 8(%esp), %eax + movl %eax, 4(%esp) + movl $_str, (%esp) + call L_printf$stub + xorl %eax, %eax + addl $28, %esp + +These instructions are unnecessary. From lauro.venancio at gmail.com Wed May 2 16:58:06 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 2 May 2007 18:58:06 -0300 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h In-Reply-To: <200705022141.l42LfcDQ024624@zion.cs.uiuc.edu> References: <200705022141.l42LfcDQ024624@zion.cs.uiuc.edu> Message-ID: <9c10c9f0705021458h759a9732p5ea37063a7ad29a7@mail.gmail.com> > > > > Use 'static const char' instead of 'static const int'. > Due to darwin gcc bug, one version of darwin linker coalesces > static const int, which defauts PassID based pass identification. I think you should use 'static const signed char' because 'char' is signed on X86 and unsigned on ARM. Lauro -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070502/90b67e65/attachment.html From dpatel at apple.com Wed May 2 17:04:16 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 15:04:16 -0700 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h In-Reply-To: <9c10c9f0705021458h759a9732p5ea37063a7ad29a7@mail.gmail.com> References: <200705022141.l42LfcDQ024624@zion.cs.uiuc.edu> <9c10c9f0705021458h759a9732p5ea37063a7ad29a7@mail.gmail.com> Message-ID: <5962AAB1-9C30-49C8-89F7-29881C92714E@apple.com> On May 2, 2007, at 2:58 PM, Lauro Ramos Venancio wrote: > I think you should use 'static const signed char' because 'char' is > signed on X86 and unsigned on ARM. It does not matter. All I want is unique address of the static member to identify Pass. - Devang -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070502/620527ae/attachment.html From asl at math.spbu.ru Wed May 2 17:16:07 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Wed, 2 May 2007 17:16:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200705022216.l42MG7iV026123@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.444 -> 1.445 --- Log message: Properly set arguments bitwidth of EHSELECT node --- Diffs of the changes: (+2 -2) SelectionDAGISel.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.444 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.445 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.444 Wed May 2 16:39:19 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed May 2 17:15:48 2007 @@ -2632,7 +2632,7 @@ if (Reg) CurMBB->addLiveIn(Reg); // Insert the EHSELECTION instruction. - SDVTList VTs = DAG.getVTList(MVT::i32, MVT::Other); + SDVTList VTs = DAG.getVTList(TLI.getPointerTy(), MVT::Other); SDOperand Ops[2]; Ops[0] = getValue(I.getOperand(1)); Ops[1] = getRoot(); @@ -2640,7 +2640,7 @@ setValue(&I, Op); DAG.setRoot(Op.getValue(1)); } else { - setValue(&I, DAG.getConstant(0, MVT::i32)); + setValue(&I, DAG.getConstant(0, TLI.getPointerTy())); } return 0; From tonic at nondot.org Wed May 2 17:16:32 2007 From: tonic at nondot.org (Tanya Lattner) Date: Wed, 2 May 2007 17:16:32 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/NightlyTestAccept.php Message-ID: <200705022216.l42MGWkk026185@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: NightlyTestAccept.php updated: 1.65 -> 1.66 --- Log message: Die if no nickname is set! --- Diffs of the changes: (+6 -1) NightlyTestAccept.php | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: nightlytest-serverside/NightlyTestAccept.php diff -u nightlytest-serverside/NightlyTestAccept.php:1.65 nightlytest-serverside/NightlyTestAccept.php:1.66 --- nightlytest-serverside/NightlyTestAccept.php:1.65 Sun Apr 29 16:10:32 2007 +++ nightlytest-serverside/NightlyTestAccept.php Wed May 2 17:16:17 2007 @@ -466,7 +466,12 @@ * *******************************************************************************/ function acceptTest() { - + + // If no nickname is set, die here + if (!isset($_POST['nickname'])) { + return; + } + $database = "nightlytestresults"; $loginname = "llvm"; $password = "ll2002vm"; From isanbard at gmail.com Wed May 2 18:12:12 2007 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 2 May 2007 18:12:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrSSE.td Message-ID: <200705022312.l42NCC0c027441@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrSSE.td updated: 1.181 -> 1.182 --- Log message: Non-algorithmic change. Moved definitions around into separate sections for SSE1, SSE2, SSE3, and SSSE3. --- Diffs of the changes: (+1266 -1019) X86InstrSSE.td | 2285 +++++++++++++++++++++++++++++++-------------------------- 1 files changed, 1266 insertions(+), 1019 deletions(-) Index: llvm/lib/Target/X86/X86InstrSSE.td diff -u llvm/lib/Target/X86/X86InstrSSE.td:1.181 llvm/lib/Target/X86/X86InstrSSE.td:1.182 --- llvm/lib/Target/X86/X86InstrSSE.td:1.181 Wed Apr 18 09:09:14 2007 +++ llvm/lib/Target/X86/X86InstrSSE.td Wed May 2 18:11:52 2007 @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by the Evan Cheng and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. +// This file was developed by Evan Cheng and is distributed under the University +// of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -41,6 +41,21 @@ def X86pinsrw : SDNode<"X86ISD::PINSRW", SDTypeProfile<1, 3, []>, []>; //===----------------------------------------------------------------------===// +// SSE 'Special' Instructions +//===----------------------------------------------------------------------===// + +def IMPLICIT_DEF_VR128 : I<0, Pseudo, (ops VR128:$dst), + "#IMPLICIT_DEF $dst", + [(set VR128:$dst, (v4f32 (undef)))]>, + Requires<[HasSSE1]>; +def IMPLICIT_DEF_FR32 : I<0, Pseudo, (ops FR32:$dst), + "#IMPLICIT_DEF $dst", + [(set FR32:$dst, (undef))]>, Requires<[HasSSE2]>; +def IMPLICIT_DEF_FR64 : I<0, Pseudo, (ops FR64:$dst), + "#IMPLICIT_DEF $dst", + [(set FR64:$dst, (undef))]>, Requires<[HasSSE2]>; + +//===----------------------------------------------------------------------===// // SSE Complex Patterns //===----------------------------------------------------------------------===// @@ -70,6 +85,7 @@ def loadv4f32 : PatFrag<(ops node:$ptr), (v4f32 (load node:$ptr))>; def loadv2f64 : PatFrag<(ops node:$ptr), (v2f64 (load node:$ptr))>; +def loadv2i32 : PatFrag<(ops node:$ptr), (v2i32 (load node:$ptr))>; def loadv2i64 : PatFrag<(ops node:$ptr), (v2i64 (load node:$ptr))>; def bc_v4f32 : PatFrag<(ops node:$in), (v4f32 (bitconvert node:$in))>; @@ -182,106 +198,6 @@ // SSE scalar FP Instructions //===----------------------------------------------------------------------===// -// Instruction templates -// SSI - SSE1 instructions with XS prefix. -// SDI - SSE2 instructions with XD prefix. -// PSI - SSE1 instructions with TB prefix. -// PDI - SSE2 instructions with TB and OpSize prefixes. -// PSIi8 - SSE1 instructions with ImmT == Imm8 and TB prefix. -// PDIi8 - SSE2 instructions with ImmT == Imm8 and TB and OpSize prefixes. -// S3I - SSE3 instructions with TB and OpSize prefixes. -// S3SI - SSE3 instructions with XS prefix. -// S3DI - SSE3 instructions with XD prefix. -// SS38I - SSSE3 instructions with T8 and OpSize prefixes. -// SS3AI - SSSE3 instructions with TA and OpSize prefixes. -class SSI o, Format F, dag ops, string asm, list pattern> - : I, XS, Requires<[HasSSE1]>; -class SDI o, Format F, dag ops, string asm, list pattern> - : I, XD, Requires<[HasSSE2]>; -class PSI o, Format F, dag ops, string asm, list pattern> - : I, TB, Requires<[HasSSE1]>; -class PDI o, Format F, dag ops, string asm, list pattern> - : I, TB, OpSize, Requires<[HasSSE2]>; -class PSIi8 o, Format F, dag ops, string asm, list pattern> - : Ii8, TB, Requires<[HasSSE1]>; -class PDIi8 o, Format F, dag ops, string asm, list pattern> - : Ii8, TB, OpSize, Requires<[HasSSE2]>; - -class S3SI o, Format F, dag ops, string asm, list pattern> - : I, XS, Requires<[HasSSE3]>; -class S3DI o, Format F, dag ops, string asm, list pattern> - : I, XD, Requires<[HasSSE3]>; -class S3I o, Format F, dag ops, string asm, list pattern> - : I, TB, OpSize, Requires<[HasSSE3]>; - -class SS38I o, Format F, dag ops, string asm, list pattern> - : I, T8, OpSize, Requires<[HasSSSE3]>; -class SS3AI o, Format F, dag ops, string asm, list pattern> - : I, TA, OpSize, Requires<[HasSSSE3]>; - -//===----------------------------------------------------------------------===// -// Helpers for defining instructions that directly correspond to intrinsics. - -multiclass SS_IntUnary o, string OpcodeStr, Intrinsic IntId> { - def r : SSI; - def m : SSI; -} - -multiclass SD_IntUnary o, string OpcodeStr, Intrinsic IntId> { - def r : SDI; - def m : SDI; -} - -class PS_Intr o, string OpcodeStr, Intrinsic IntId> - : PSI; -class PS_Intm o, string OpcodeStr, Intrinsic IntId> - : PSI; -class PD_Intr o, string OpcodeStr, Intrinsic IntId> - : PDI; -class PD_Intm o, string OpcodeStr, Intrinsic IntId> - : PDI; - -class PS_Intrr o, string OpcodeStr, Intrinsic IntId> - : PSI; -class PS_Intrm o, string OpcodeStr, Intrinsic IntId> - : PSI; -class PD_Intrr o, string OpcodeStr, Intrinsic IntId> - : PDI; -class PD_Intrm o, string OpcodeStr, Intrinsic IntId> - : PDI; - -// Some 'special' instructions -def IMPLICIT_DEF_FR32 : I<0, Pseudo, (ops FR32:$dst), - "#IMPLICIT_DEF $dst", - [(set FR32:$dst, (undef))]>, Requires<[HasSSE2]>; -def IMPLICIT_DEF_FR64 : I<0, Pseudo, (ops FR64:$dst), - "#IMPLICIT_DEF $dst", - [(set FR64:$dst, (undef))]>, Requires<[HasSSE2]>; - // CMOV* - Used to implement the SSE SELECT DAG operation. Expanded by the // scheduler into a branch sequence. let usesCustomDAGSchedInserter = 1 in { // Expanded by the scheduler. @@ -310,28 +226,204 @@ (v2i64 (X86cmov VR128:$t, VR128:$f, imm:$cond)))]>; } +//===----------------------------------------------------------------------===// +// SSE1 Instructions +//===----------------------------------------------------------------------===// + +// SSE1 Instruction Templates: +// +// SSI - SSE1 instructions with XS prefix. +// PSI - SSE1 instructions with TB prefix. +// PSIi8 - SSE1 instructions with ImmT == Imm8 and TB prefix. + +class SSI o, Format F, dag ops, string asm, list pattern> + : I, XS, Requires<[HasSSE1]>; +class PSI o, Format F, dag ops, string asm, list pattern> + : I, TB, Requires<[HasSSE1]>; +class PSIi8 o, Format F, dag ops, string asm, list pattern> + : Ii8, TB, Requires<[HasSSE1]>; + +// Helpers for defining instructions that directly correspond to intrinsics. +multiclass SS_IntUnary o, string OpcodeStr, Intrinsic IntId> { + def r : SSI; + def m : SSI; +} + // Move Instructions def MOVSSrr : SSI<0x10, MRMSrcReg, (ops FR32:$dst, FR32:$src), - "movss {$src, $dst|$dst, $src}", []>; + "movss {$src, $dst|$dst, $src}", []>; def MOVSSrm : SSI<0x10, MRMSrcMem, (ops FR32:$dst, f32mem:$src), - "movss {$src, $dst|$dst, $src}", - [(set FR32:$dst, (loadf32 addr:$src))]>; -def MOVSDrr : SDI<0x10, MRMSrcReg, (ops FR64:$dst, FR64:$src), - "movsd {$src, $dst|$dst, $src}", []>; -def MOVSDrm : SDI<0x10, MRMSrcMem, (ops FR64:$dst, f64mem:$src), - "movsd {$src, $dst|$dst, $src}", - [(set FR64:$dst, (loadf64 addr:$src))]>; - + "movss {$src, $dst|$dst, $src}", + [(set FR32:$dst, (loadf32 addr:$src))]>; def MOVSSmr : SSI<0x11, MRMDestMem, (ops f32mem:$dst, FR32:$src), - "movss {$src, $dst|$dst, $src}", - [(store FR32:$src, addr:$dst)]>; -def MOVSDmr : SDI<0x11, MRMDestMem, (ops f64mem:$dst, FR64:$src), - "movsd {$src, $dst|$dst, $src}", - [(store FR64:$src, addr:$dst)]>; + "movss {$src, $dst|$dst, $src}", + [(store FR32:$src, addr:$dst)]>; -/// scalar_sse12_fp_binop_rm - Scalar SSE binops come in four basic forms: -/// 1. f32 vs f64 - These come in SSE1/SSE2 forms for float/doubles. -/// 2. rr vs rm - They include a reg+reg form and a ref+mem form. +def SQRTSSr : SSI<0x51, MRMSrcReg, (ops FR32:$dst, FR32:$src), + "sqrtss {$src, $dst|$dst, $src}", + [(set FR32:$dst, (fsqrt FR32:$src))]>; +def SQRTSSm : SSI<0x51, MRMSrcMem, (ops FR32:$dst, f32mem:$src), + "sqrtss {$src, $dst|$dst, $src}", + [(set FR32:$dst, (fsqrt (loadf32 addr:$src)))]>; + +// Aliases to match intrinsics which expect XMM operand(s). +defm SQRTSS_Int : SS_IntUnary<0x51, "sqrtss" , int_x86_sse_sqrt_ss>; +defm RSQRTSS_Int : SS_IntUnary<0x52, "rsqrtss", int_x86_sse_rsqrt_ss>; +defm RCPSS_Int : SS_IntUnary<0x53, "rcpss" , int_x86_sse_rcp_ss>; + +// Conversion instructions +def CVTTSS2SIrr : SSI<0x2C, MRMSrcReg, (ops GR32:$dst, FR32:$src), + "cvttss2si {$src, $dst|$dst, $src}", + [(set GR32:$dst, (fp_to_sint FR32:$src))]>; +def CVTTSS2SIrm : SSI<0x2C, MRMSrcMem, (ops GR32:$dst, f32mem:$src), + "cvttss2si {$src, $dst|$dst, $src}", + [(set GR32:$dst, (fp_to_sint (loadf32 addr:$src)))]>; +def CVTSI2SSrr : SSI<0x2A, MRMSrcReg, (ops FR32:$dst, GR32:$src), + "cvtsi2ss {$src, $dst|$dst, $src}", + [(set FR32:$dst, (sint_to_fp GR32:$src))]>; +def CVTSI2SSrm : SSI<0x2A, MRMSrcMem, (ops FR32:$dst, i32mem:$src), + "cvtsi2ss {$src, $dst|$dst, $src}", + [(set FR32:$dst, (sint_to_fp (loadi32 addr:$src)))]>; + +// Match intrinsics which expect XMM operand(s). +def Int_CVTSS2SIrr : SSI<0x2D, MRMSrcReg, (ops GR32:$dst, VR128:$src), + "cvtss2si {$src, $dst|$dst, $src}", + [(set GR32:$dst, (int_x86_sse_cvtss2si VR128:$src))]>; +def Int_CVTSS2SIrm : SSI<0x2D, MRMSrcMem, (ops GR32:$dst, f32mem:$src), + "cvtss2si {$src, $dst|$dst, $src}", + [(set GR32:$dst, (int_x86_sse_cvtss2si + (load addr:$src)))]>; + +// Aliases for intrinsics +def Int_CVTTSS2SIrr : SSI<0x2C, MRMSrcReg, (ops GR32:$dst, VR128:$src), + "cvttss2si {$src, $dst|$dst, $src}", + [(set GR32:$dst, + (int_x86_sse_cvttss2si VR128:$src))]>; +def Int_CVTTSS2SIrm : SSI<0x2C, MRMSrcMem, (ops GR32:$dst, f32mem:$src), + "cvttss2si {$src, $dst|$dst, $src}", + [(set GR32:$dst, + (int_x86_sse_cvttss2si(load addr:$src)))]>; + +let isTwoAddress = 1 in { + def Int_CVTSI2SSrr : SSI<0x2A, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, GR32:$src2), + "cvtsi2ss {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (int_x86_sse_cvtsi2ss VR128:$src1, + GR32:$src2))]>; + def Int_CVTSI2SSrm : SSI<0x2A, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, i32mem:$src2), + "cvtsi2ss {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (int_x86_sse_cvtsi2ss VR128:$src1, + (loadi32 addr:$src2)))]>; +} + +// Comparison instructions +let isTwoAddress = 1 in { + def CMPSSrr : SSI<0xC2, MRMSrcReg, + (ops FR32:$dst, FR32:$src1, FR32:$src, SSECC:$cc), + "cmp${cc}ss {$src, $dst|$dst, $src}", + []>; + def CMPSSrm : SSI<0xC2, MRMSrcMem, + (ops FR32:$dst, FR32:$src1, f32mem:$src, SSECC:$cc), + "cmp${cc}ss {$src, $dst|$dst, $src}", []>; +} + +def UCOMISSrr: PSI<0x2E, MRMSrcReg, (ops FR32:$src1, FR32:$src2), + "ucomiss {$src2, $src1|$src1, $src2}", + [(X86cmp FR32:$src1, FR32:$src2)]>; +def UCOMISSrm: PSI<0x2E, MRMSrcMem, (ops FR32:$src1, f32mem:$src2), + "ucomiss {$src2, $src1|$src1, $src2}", + [(X86cmp FR32:$src1, (loadf32 addr:$src2))]>; + +// Aliases to match intrinsics which expect XMM operand(s). +let isTwoAddress = 1 in { + def Int_CMPSSrr : SSI<0xC2, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src, SSECC:$cc), + "cmp${cc}ss {$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse_cmp_ss VR128:$src1, + VR128:$src, imm:$cc))]>; + def Int_CMPSSrm : SSI<0xC2, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f32mem:$src, SSECC:$cc), + "cmp${cc}ss {$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse_cmp_ss VR128:$src1, + (load addr:$src), imm:$cc))]>; +} + +def Int_UCOMISSrr: PSI<0x2E, MRMSrcReg, (ops VR128:$src1, VR128:$src2), + "ucomiss {$src2, $src1|$src1, $src2}", + [(X86ucomi (v4f32 VR128:$src1), VR128:$src2)]>; +def Int_UCOMISSrm: PSI<0x2E, MRMSrcMem, (ops VR128:$src1, f128mem:$src2), + "ucomiss {$src2, $src1|$src1, $src2}", + [(X86ucomi (v4f32 VR128:$src1), (load addr:$src2))]>; + +def Int_COMISSrr: PSI<0x2F, MRMSrcReg, (ops VR128:$src1, VR128:$src2), + "comiss {$src2, $src1|$src1, $src2}", + [(X86comi (v4f32 VR128:$src1), VR128:$src2)]>; +def Int_COMISSrm: PSI<0x2F, MRMSrcMem, (ops VR128:$src1, f128mem:$src2), + "comiss {$src2, $src1|$src1, $src2}", + [(X86comi (v4f32 VR128:$src1), (load addr:$src2))]>; + +// Aliases of packed SSE1 instructions for scalar use. These all have names that +// start with 'Fs'. + +// Alias instructions that map fld0 to pxor for sse. +def FsFLD0SS : I<0xEF, MRMInitReg, (ops FR32:$dst), + "pxor $dst, $dst", [(set FR32:$dst, fp32imm0)]>, + Requires<[HasSSE1]>, TB, OpSize; + +// Alias instruction to do FR32 reg-to-reg copy using movaps. Upper bits are +// disregarded. +def FsMOVAPSrr : PSI<0x28, MRMSrcReg, (ops FR32:$dst, FR32:$src), + "movaps {$src, $dst|$dst, $src}", []>; + +// Alias instruction to load FR32 from f128mem using movaps. Upper bits are +// disregarded. +def FsMOVAPSrm : PSI<0x28, MRMSrcMem, (ops FR32:$dst, f128mem:$src), + "movaps {$src, $dst|$dst, $src}", + [(set FR32:$dst, (X86loadpf32 addr:$src))]>; + +// Alias bitwise logical operations using SSE logical ops on packed FP values. +let isTwoAddress = 1 in { + +let isCommutable = 1 in { + def FsANDPSrr : PSI<0x54, MRMSrcReg, (ops FR32:$dst, FR32:$src1, FR32:$src2), + "andps {$src2, $dst|$dst, $src2}", + [(set FR32:$dst, (X86fand FR32:$src1, FR32:$src2))]>; + def FsORPSrr : PSI<0x56, MRMSrcReg, (ops FR32:$dst, FR32:$src1, FR32:$src2), + "orps {$src2, $dst|$dst, $src2}", + [(set FR32:$dst, (X86for FR32:$src1, FR32:$src2))]>; + def FsXORPSrr : PSI<0x57, MRMSrcReg, (ops FR32:$dst, FR32:$src1, FR32:$src2), + "xorps {$src2, $dst|$dst, $src2}", + [(set FR32:$dst, (X86fxor FR32:$src1, FR32:$src2))]>; +} + +def FsANDPSrm : PSI<0x54, MRMSrcMem, (ops FR32:$dst, FR32:$src1, f128mem:$src2), + "andps {$src2, $dst|$dst, $src2}", + [(set FR32:$dst, (X86fand FR32:$src1, + (X86loadpf32 addr:$src2)))]>; +def FsORPSrm : PSI<0x56, MRMSrcMem, (ops FR32:$dst, FR32:$src1, f128mem:$src2), + "orps {$src2, $dst|$dst, $src2}", + [(set FR32:$dst, (X86for FR32:$src1, + (X86loadpf32 addr:$src2)))]>; +def FsXORPSrm : PSI<0x57, MRMSrcMem, (ops FR32:$dst, FR32:$src1, f128mem:$src2), + "xorps {$src2, $dst|$dst, $src2}", + [(set FR32:$dst, (X86fxor FR32:$src1, + (X86loadpf32 addr:$src2)))]>; + +def FsANDNPSrr : PSI<0x55, MRMSrcReg, (ops FR32:$dst, FR32:$src1, FR32:$src2), + "andnps {$src2, $dst|$dst, $src2}", []>; +def FsANDNPSrm : PSI<0x55, MRMSrcMem, (ops FR32:$dst, FR32:$src1, f128mem:$src2), + "andnps {$src2, $dst|$dst, $src2}", []>; +} + +/// scalar_sse1_fp_binop_rm - Scalar SSE1 binops come in three basic forms: +/// +/// 1. f32 - This comes in SSE1 form for floats. +/// 2. rr vs rm - They include a reg+reg form and a reg+mem form. /// /// In addition, scalar SSE ops have an intrinsic form. This form is unlike the /// normal form, in that they take an entire vector (instead of a scalar) and @@ -339,27 +431,20 @@ /// above permutations, giving us 8 forms for 'instruction'. /// let isTwoAddress = 1 in { -multiclass scalar_sse12_fp_binop_rm opc, string OpcodeStr, - SDNode OpNode, Intrinsic F32Int, - Intrinsic F64Int, bit Commutable = 0> { +multiclass scalar_sse1_fp_binop_rm opc, string OpcodeStr, + SDNode OpNode, Intrinsic F32Int, + bit Commutable = 0> { // Scalar operation, reg+reg. def SSrr : SSI { let isCommutable = Commutable; } - def SDrr : SDI { - let isCommutable = Commutable; - } + // Scalar operation, reg+mem. def SSrm : SSI; - def SDrm : SDI; // Vector intrinsic operation, reg+reg. def SSrr_Int : SSI { let isCommutable = Commutable; } - def SDrr_Int : SDI { - let isCommutable = Commutable; - } + // Vector intrinsic operation, reg+mem. def SSrm_Int : SSI; - def SDrm_Int : SDI; } } // Arithmetic instructions +defm ADD : scalar_sse1_fp_binop_rm<0x58, "add", fadd, int_x86_sse_add_ss, 1>; +defm MUL : scalar_sse1_fp_binop_rm<0x59, "mul", fmul, int_x86_sse_mul_ss, 1>; +defm SUB : scalar_sse1_fp_binop_rm<0x5C, "sub", fsub, int_x86_sse_sub_ss>; +defm DIV : scalar_sse1_fp_binop_rm<0x5E, "div", fdiv, int_x86_sse_div_ss>; -defm ADD : scalar_sse12_fp_binop_rm<0x58, "add", fadd, - int_x86_sse_add_ss, int_x86_sse2_add_sd, 1>; -defm MUL : scalar_sse12_fp_binop_rm<0x59, "mul", fmul, - int_x86_sse_mul_ss, int_x86_sse2_mul_sd, 1>; -defm SUB : scalar_sse12_fp_binop_rm<0x5C, "sub", fsub, - int_x86_sse_sub_ss, int_x86_sse2_sub_sd>; -defm DIV : scalar_sse12_fp_binop_rm<0x5E, "div", fdiv, - int_x86_sse_div_ss, int_x86_sse2_div_sd>; - -defm MAX : scalar_sse12_fp_binop_rm<0x5F, "max", X86fmax, - int_x86_sse_max_ss, int_x86_sse2_max_sd>; -defm MIN : scalar_sse12_fp_binop_rm<0x5D, "min", X86fmin, - int_x86_sse_min_ss, int_x86_sse2_min_sd>; +defm MAX : scalar_sse1_fp_binop_rm<0x5F, "max", X86fmax, int_x86_sse_max_ss>; +defm MIN : scalar_sse1_fp_binop_rm<0x5D, "min", X86fmin, int_x86_sse_min_ss>; +//===----------------------------------------------------------------------===// +// SSE packed FP Instructions + +// Move Instructions +def MOVAPSrr : PSI<0x28, MRMSrcReg, (ops VR128:$dst, VR128:$src), + "movaps {$src, $dst|$dst, $src}", []>; +def MOVAPSrm : PSI<0x28, MRMSrcMem, (ops VR128:$dst, f128mem:$src), + "movaps {$src, $dst|$dst, $src}", + [(set VR128:$dst, (loadv4f32 addr:$src))]>; + +def MOVAPSmr : PSI<0x29, MRMDestMem, (ops f128mem:$dst, VR128:$src), + "movaps {$src, $dst|$dst, $src}", + [(store (v4f32 VR128:$src), addr:$dst)]>; + +def MOVUPSrr : PSI<0x10, MRMSrcReg, (ops VR128:$dst, VR128:$src), + "movups {$src, $dst|$dst, $src}", []>; +def MOVUPSrm : PSI<0x10, MRMSrcMem, (ops VR128:$dst, f128mem:$src), + "movups {$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse_loadu_ps addr:$src))]>; +def MOVUPSmr : PSI<0x11, MRMDestMem, (ops f128mem:$dst, VR128:$src), + "movups {$src, $dst|$dst, $src}", + [(int_x86_sse_storeu_ps addr:$dst, VR128:$src)]>; + +let isTwoAddress = 1 in { +let AddedComplexity = 20 in { +def MOVLPSrm : PSI<0x12, MRMSrcMem, (ops VR128:$dst, VR128:$src1, f64mem:$src2), + "movlps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4f32 (vector_shuffle VR128:$src1, + (bc_v4f32 (v2f64 (scalar_to_vector (loadf64 addr:$src2)))), + MOVLP_shuffle_mask)))]>; +def MOVHPSrm : PSI<0x16, MRMSrcMem, (ops VR128:$dst, VR128:$src1, f64mem:$src2), + "movhps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4f32 (vector_shuffle VR128:$src1, + (bc_v4f32 (v2f64 (scalar_to_vector (loadf64 addr:$src2)))), + MOVHP_shuffle_mask)))]>; +} // AddedComplexity +} // isTwoAddress + +def MOVLPSmr : PSI<0x13, MRMDestMem, (ops f64mem:$dst, VR128:$src), + "movlps {$src, $dst|$dst, $src}", + [(store (f64 (vector_extract (bc_v2f64 (v4f32 VR128:$src)), + (iPTR 0))), addr:$dst)]>; + +// v2f64 extract element 1 is always custom lowered to unpack high to low +// and extract element 0 so the non-store version isn't too horrible. +def MOVHPSmr : PSI<0x17, MRMDestMem, (ops f64mem:$dst, VR128:$src), + "movhps {$src, $dst|$dst, $src}", + [(store (f64 (vector_extract + (v2f64 (vector_shuffle + (bc_v2f64 (v4f32 VR128:$src)), (undef), + UNPCKH_shuffle_mask)), (iPTR 0))), + addr:$dst)]>; + +let isTwoAddress = 1 in { +let AddedComplexity = 15 in { +def MOVLHPSrr : PSI<0x16, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), + "movlhps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4f32 (vector_shuffle VR128:$src1, VR128:$src2, + MOVHP_shuffle_mask)))]>; + +def MOVHLPSrr : PSI<0x12, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), + "movhlps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4f32 (vector_shuffle VR128:$src1, VR128:$src2, + MOVHLPS_shuffle_mask)))]>; +} // AddedComplexity +} // isTwoAddress + + + +/// packed_sse1_fp_binop_rm - Packed SSE binops come in three basic forms: +/// 1. v4f32 - This comes in SSE1 form for float. +/// 2. rr vs rm - They include a reg+reg form and a ref+mem form. +/// +let isTwoAddress = 1 in { +multiclass packed_sse1_fp_binop_rm opc, string OpcodeStr, + SDNode OpNode, bit Commutable = 0> { + // Packed operation, reg+reg. + def PSrr : PSI { + let isCommutable = Commutable; + } + + // Packed operation, reg+mem. + def PSrm : PSI; +} +} + +defm ADD : packed_sse1_fp_binop_rm<0x58, "add", fadd, 1>; +defm MUL : packed_sse1_fp_binop_rm<0x59, "mul", fmul, 1>; +defm DIV : packed_sse1_fp_binop_rm<0x5E, "div", fdiv>; +defm SUB : packed_sse1_fp_binop_rm<0x5C, "sub", fsub>; + +// Arithmetic + +class PS_Intr o, string OpcodeStr, Intrinsic IntId> + : PSI; +class PS_Intm o, string OpcodeStr, Intrinsic IntId> + : PSI; + +class PS_Intrr o, string OpcodeStr, Intrinsic IntId> + : PSI; +class PS_Intrm o, string OpcodeStr, Intrinsic IntId> + : PSI; + +def SQRTPSr : PS_Intr<0x51, "sqrtps", int_x86_sse_sqrt_ps>; +def SQRTPSm : PS_Intm<0x51, "sqrtps", int_x86_sse_sqrt_ps>; + +def RSQRTPSr : PS_Intr<0x52, "rsqrtps", int_x86_sse_rsqrt_ps>; +def RSQRTPSm : PS_Intm<0x52, "rsqrtps", int_x86_sse_rsqrt_ps>; +def RCPPSr : PS_Intr<0x53, "rcpps", int_x86_sse_rcp_ps>; +def RCPPSm : PS_Intm<0x53, "rcpps", int_x86_sse_rcp_ps>; + +let isTwoAddress = 1 in { + let isCommutable = 1 in { + def MAXPSrr : PS_Intrr<0x5F, "maxps", int_x86_sse_max_ps>; + def MINPSrr : PS_Intrr<0x5D, "minps", int_x86_sse_min_ps>; + } + + def MAXPSrm : PS_Intrm<0x5F, "maxps", int_x86_sse_max_ps>; + def MINPSrm : PS_Intrm<0x5D, "minps", int_x86_sse_min_ps>; +} + +// Logical +let isTwoAddress = 1 in { + let isCommutable = 1 in { + def ANDPSrr : PSI<0x54, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "andps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (v2i64 + (and VR128:$src1, VR128:$src2)))]>; + def ORPSrr : PSI<0x56, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "orps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (v2i64 + (or VR128:$src1, VR128:$src2)))]>; + def XORPSrr : PSI<0x57, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "xorps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (v2i64 + (xor VR128:$src1, VR128:$src2)))]>; + } + + def ANDPSrm : PSI<0x54, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src2), + "andps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (and VR128:$src1, + (bc_v2i64 (loadv4f32 addr:$src2))))]>; + def ORPSrm : PSI<0x56, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src2), + "orps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (or VR128:$src1, + (bc_v2i64 (loadv4f32 addr:$src2))))]>; + def XORPSrm : PSI<0x57, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src2), + "xorps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (xor VR128:$src1, + (bc_v2i64 (loadv4f32 addr:$src2))))]>; + def ANDNPSrr : PSI<0x55, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "andnps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2i64 (and (xor VR128:$src1, + (bc_v2i64 (v4i32 immAllOnesV))), + VR128:$src2)))]>; + def ANDNPSrm : PSI<0x55, MRMSrcMem, + (ops VR128:$dst, VR128:$src1,f128mem:$src2), + "andnps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2i64 (and (xor VR128:$src1, + (bc_v2i64 (v4i32 immAllOnesV))), + (bc_v2i64 (loadv4f32 addr:$src2)))))]>; +} + +let isTwoAddress = 1 in { + def CMPPSrri : PSIi8<0xC2, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src, SSECC:$cc), + "cmp${cc}ps {$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1, + VR128:$src, imm:$cc))]>; + def CMPPSrmi : PSIi8<0xC2, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src, SSECC:$cc), + "cmp${cc}ps {$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1, + (load addr:$src), imm:$cc))]>; +} + +// Shuffle and unpack instructions +let isTwoAddress = 1 in { + let isConvertibleToThreeAddress = 1 in // Convert to pshufd + def SHUFPSrri : PSIi8<0xC6, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, + VR128:$src2, i32i8imm:$src3), + "shufps {$src3, $src2, $dst|$dst, $src2, $src3}", + [(set VR128:$dst, + (v4f32 (vector_shuffle + VR128:$src1, VR128:$src2, + SHUFP_shuffle_mask:$src3)))]>; + def SHUFPSrmi : PSIi8<0xC6, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, + f128mem:$src2, i32i8imm:$src3), + "shufps {$src3, $src2, $dst|$dst, $src2, $src3}", + [(set VR128:$dst, + (v4f32 (vector_shuffle + VR128:$src1, (load addr:$src2), + SHUFP_shuffle_mask:$src3)))]>; + + let AddedComplexity = 10 in { + def UNPCKHPSrr : PSI<0x15, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "unpckhps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4f32 (vector_shuffle + VR128:$src1, VR128:$src2, + UNPCKH_shuffle_mask)))]>; + def UNPCKHPSrm : PSI<0x15, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src2), + "unpckhps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4f32 (vector_shuffle + VR128:$src1, (load addr:$src2), + UNPCKH_shuffle_mask)))]>; + + def UNPCKLPSrr : PSI<0x14, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "unpcklps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4f32 (vector_shuffle + VR128:$src1, VR128:$src2, + UNPCKL_shuffle_mask)))]>; + def UNPCKLPSrm : PSI<0x14, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src2), + "unpcklps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4f32 (vector_shuffle + VR128:$src1, (load addr:$src2), + UNPCKL_shuffle_mask)))]>; + } // AddedComplexity +} // isTwoAddress + +// Mask creation +def MOVMSKPSrr : PSI<0x50, MRMSrcReg, (ops GR32:$dst, VR128:$src), + "movmskps {$src, $dst|$dst, $src}", + [(set GR32:$dst, (int_x86_sse_movmsk_ps VR128:$src))]>; +def MOVMSKPDrr : PSI<0x50, MRMSrcReg, (ops GR32:$dst, VR128:$src), + "movmskpd {$src, $dst|$dst, $src}", + [(set GR32:$dst, (int_x86_sse2_movmsk_pd VR128:$src))]>; + +// Prefetching loads. +// TODO: no intrinsics for these? +def PREFETCHT0 : PSI<0x18, MRM1m, (ops i8mem:$src), "prefetcht0 $src", []>; +def PREFETCHT1 : PSI<0x18, MRM2m, (ops i8mem:$src), "prefetcht1 $src", []>; +def PREFETCHT2 : PSI<0x18, MRM3m, (ops i8mem:$src), "prefetcht2 $src", []>; +def PREFETCHNTA : PSI<0x18, MRM0m, (ops i8mem:$src), "prefetchnta $src", []>; + +// Non-temporal stores +def MOVNTPSmr : PSI<0x2B, MRMDestMem, (ops i128mem:$dst, VR128:$src), + "movntps {$src, $dst|$dst, $src}", + [(int_x86_sse_movnt_ps addr:$dst, VR128:$src)]>; + +// Load, store, and memory fence +def SFENCE : PSI<0xAE, MRM7m, (ops), "sfence", [(int_x86_sse_sfence)]>; + +// MXCSR register +def LDMXCSR : PSI<0xAE, MRM2m, (ops i32mem:$src), + "ldmxcsr $src", [(int_x86_sse_ldmxcsr addr:$src)]>; +def STMXCSR : PSI<0xAE, MRM3m, (ops i32mem:$dst), + "stmxcsr $dst", [(int_x86_sse_stmxcsr addr:$dst)]>; + +// Alias instructions that map zero vector to pxor / xorp* for sse. +// FIXME: remove when we can teach regalloc that xor reg, reg is ok. +let isReMaterializable = 1 in +def V_SET0 : PSI<0x57, MRMInitReg, (ops VR128:$dst), + "xorps $dst, $dst", + [(set VR128:$dst, (v4f32 immAllZerosV))]>; + +// FR32 to 128-bit vector conversion. +def MOVSS2PSrr : SSI<0x10, MRMSrcReg, (ops VR128:$dst, FR32:$src), + "movss {$src, $dst|$dst, $src}", + [(set VR128:$dst, + (v4f32 (scalar_to_vector FR32:$src)))]>; +def MOVSS2PSrm : SSI<0x10, MRMSrcMem, (ops VR128:$dst, f32mem:$src), + "movss {$src, $dst|$dst, $src}", + [(set VR128:$dst, + (v4f32 (scalar_to_vector (loadf32 addr:$src))))]>; + +// FIXME: may not be able to eliminate this movss with coalescing the src and +// dest register classes are different. We really want to write this pattern +// like this: +// def : Pat<(f32 (vector_extract (v4f32 VR128:$src), (iPTR 0))), +// (f32 FR32:$src)>; +def MOVPS2SSrr : SSI<0x10, MRMSrcReg, (ops FR32:$dst, VR128:$src), + "movss {$src, $dst|$dst, $src}", + [(set FR32:$dst, (vector_extract (v4f32 VR128:$src), + (iPTR 0)))]>; +def MOVPS2SSmr : SSI<0x11, MRMDestMem, (ops f32mem:$dst, VR128:$src), + "movss {$src, $dst|$dst, $src}", + [(store (f32 (vector_extract (v4f32 VR128:$src), + (iPTR 0))), addr:$dst)]>; + + +// Move to lower bits of a VR128, leaving upper bits alone. +// Three operand (but two address) aliases. +let isTwoAddress = 1 in { + def MOVLSS2PSrr : SSI<0x10, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, FR32:$src2), + "movss {$src2, $dst|$dst, $src2}", []>; + + let AddedComplexity = 15 in + def MOVLPSrr : SSI<0x10, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "movss {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4f32 (vector_shuffle VR128:$src1, VR128:$src2, + MOVL_shuffle_mask)))]>; +} + +// Move to lower bits of a VR128 and zeroing upper bits. +// Loading from memory automatically zeroing upper bits. +let AddedComplexity = 20 in +def MOVZSS2PSrm : SSI<0x10, MRMSrcMem, (ops VR128:$dst, f32mem:$src), + "movss {$src, $dst|$dst, $src}", + [(set VR128:$dst, (v4f32 (vector_shuffle immAllZerosV, + (v4f32 (scalar_to_vector (loadf32 addr:$src))), + MOVL_shuffle_mask)))]>; + + +//===----------------------------------------------------------------------===// +// SSE2 Instructions +//===----------------------------------------------------------------------===// + +// SSE2 Instruction Templates: +// +// SDI - SSE2 instructions with XD prefix. +// PDI - SSE2 instructions with TB and OpSize prefixes. +// PDIi8 - SSE2 instructions with ImmT == Imm8 and TB and OpSize prefixes. + +class SDI o, Format F, dag ops, string asm, list pattern> + : I, XD, Requires<[HasSSE2]>; +class PDI o, Format F, dag ops, string asm, list pattern> + : I, TB, OpSize, Requires<[HasSSE2]>; +class PDIi8 o, Format F, dag ops, string asm, list pattern> + : Ii8, TB, OpSize, Requires<[HasSSE2]>; + +// Helpers for defining instructions that directly correspond to intrinsics. +multiclass SD_IntUnary o, string OpcodeStr, Intrinsic IntId> { + def r : SDI; + def m : SDI; +} + +// Move Instructions +def MOVSDrr : SDI<0x10, MRMSrcReg, (ops FR64:$dst, FR64:$src), + "movsd {$src, $dst|$dst, $src}", []>; +def MOVSDrm : SDI<0x10, MRMSrcMem, (ops FR64:$dst, f64mem:$src), + "movsd {$src, $dst|$dst, $src}", + [(set FR64:$dst, (loadf64 addr:$src))]>; +def MOVSDmr : SDI<0x11, MRMDestMem, (ops f64mem:$dst, FR64:$src), + "movsd {$src, $dst|$dst, $src}", + [(store FR64:$src, addr:$dst)]>; -def SQRTSSr : SSI<0x51, MRMSrcReg, (ops FR32:$dst, FR32:$src), - "sqrtss {$src, $dst|$dst, $src}", - [(set FR32:$dst, (fsqrt FR32:$src))]>; -def SQRTSSm : SSI<0x51, MRMSrcMem, (ops FR32:$dst, f32mem:$src), - "sqrtss {$src, $dst|$dst, $src}", - [(set FR32:$dst, (fsqrt (loadf32 addr:$src)))]>; def SQRTSDr : SDI<0x51, MRMSrcReg, (ops FR64:$dst, FR64:$src), - "sqrtsd {$src, $dst|$dst, $src}", - [(set FR64:$dst, (fsqrt FR64:$src))]>; + "sqrtsd {$src, $dst|$dst, $src}", + [(set FR64:$dst, (fsqrt FR64:$src))]>; def SQRTSDm : SDI<0x51, MRMSrcMem, (ops FR64:$dst, f64mem:$src), - "sqrtsd {$src, $dst|$dst, $src}", - [(set FR64:$dst, (fsqrt (loadf64 addr:$src)))]>; + "sqrtsd {$src, $dst|$dst, $src}", + [(set FR64:$dst, (fsqrt (loadf64 addr:$src)))]>; // Aliases to match intrinsics which expect XMM operand(s). - -defm SQRTSS_Int : SS_IntUnary<0x51, "sqrtss" , int_x86_sse_sqrt_ss>; -defm SQRTSD_Int : SD_IntUnary<0x51, "sqrtsd" , int_x86_sse2_sqrt_sd>; -defm RSQRTSS_Int : SS_IntUnary<0x52, "rsqrtss", int_x86_sse_rsqrt_ss>; -defm RCPSS_Int : SS_IntUnary<0x53, "rcpss" , int_x86_sse_rcp_ss>; +defm SQRTSD_Int : SD_IntUnary<0x51, "sqrtsd" , int_x86_sse2_sqrt_sd>; // Conversion instructions -def CVTTSS2SIrr: SSI<0x2C, MRMSrcReg, (ops GR32:$dst, FR32:$src), - "cvttss2si {$src, $dst|$dst, $src}", - [(set GR32:$dst, (fp_to_sint FR32:$src))]>; -def CVTTSS2SIrm: SSI<0x2C, MRMSrcMem, (ops GR32:$dst, f32mem:$src), - "cvttss2si {$src, $dst|$dst, $src}", - [(set GR32:$dst, (fp_to_sint (loadf32 addr:$src)))]>; -def CVTTSD2SIrr: SDI<0x2C, MRMSrcReg, (ops GR32:$dst, FR64:$src), - "cvttsd2si {$src, $dst|$dst, $src}", - [(set GR32:$dst, (fp_to_sint FR64:$src))]>; -def CVTTSD2SIrm: SDI<0x2C, MRMSrcMem, (ops GR32:$dst, f64mem:$src), - "cvttsd2si {$src, $dst|$dst, $src}", - [(set GR32:$dst, (fp_to_sint (loadf64 addr:$src)))]>; -def CVTSD2SSrr: SDI<0x5A, MRMSrcReg, (ops FR32:$dst, FR64:$src), - "cvtsd2ss {$src, $dst|$dst, $src}", - [(set FR32:$dst, (fround FR64:$src))]>; -def CVTSD2SSrm: SDI<0x5A, MRMSrcMem, (ops FR32:$dst, f64mem:$src), - "cvtsd2ss {$src, $dst|$dst, $src}", - [(set FR32:$dst, (fround (loadf64 addr:$src)))]>; -def CVTSI2SSrr: SSI<0x2A, MRMSrcReg, (ops FR32:$dst, GR32:$src), - "cvtsi2ss {$src, $dst|$dst, $src}", - [(set FR32:$dst, (sint_to_fp GR32:$src))]>; -def CVTSI2SSrm: SSI<0x2A, MRMSrcMem, (ops FR32:$dst, i32mem:$src), - "cvtsi2ss {$src, $dst|$dst, $src}", - [(set FR32:$dst, (sint_to_fp (loadi32 addr:$src)))]>; -def CVTSI2SDrr: SDI<0x2A, MRMSrcReg, (ops FR64:$dst, GR32:$src), - "cvtsi2sd {$src, $dst|$dst, $src}", - [(set FR64:$dst, (sint_to_fp GR32:$src))]>; -def CVTSI2SDrm: SDI<0x2A, MRMSrcMem, (ops FR64:$dst, i32mem:$src), - "cvtsi2sd {$src, $dst|$dst, $src}", - [(set FR64:$dst, (sint_to_fp (loadi32 addr:$src)))]>; +def CVTTSD2SIrr : SDI<0x2C, MRMSrcReg, (ops GR32:$dst, FR64:$src), + "cvttsd2si {$src, $dst|$dst, $src}", + [(set GR32:$dst, (fp_to_sint FR64:$src))]>; +def CVTTSD2SIrm : SDI<0x2C, MRMSrcMem, (ops GR32:$dst, f64mem:$src), + "cvttsd2si {$src, $dst|$dst, $src}", + [(set GR32:$dst, (fp_to_sint (loadf64 addr:$src)))]>; +def CVTSD2SSrr : SDI<0x5A, MRMSrcReg, (ops FR32:$dst, FR64:$src), + "cvtsd2ss {$src, $dst|$dst, $src}", + [(set FR32:$dst, (fround FR64:$src))]>; +def CVTSD2SSrm : SDI<0x5A, MRMSrcMem, (ops FR32:$dst, f64mem:$src), + "cvtsd2ss {$src, $dst|$dst, $src}", + [(set FR32:$dst, (fround (loadf64 addr:$src)))]>; +def CVTSI2SDrr : SDI<0x2A, MRMSrcReg, (ops FR64:$dst, GR32:$src), + "cvtsi2sd {$src, $dst|$dst, $src}", + [(set FR64:$dst, (sint_to_fp GR32:$src))]>; +def CVTSI2SDrm : SDI<0x2A, MRMSrcMem, (ops FR64:$dst, i32mem:$src), + "cvtsi2sd {$src, $dst|$dst, $src}", + [(set FR64:$dst, (sint_to_fp (loadi32 addr:$src)))]>; // SSE2 instructions with XS prefix -def CVTSS2SDrr: I<0x5A, MRMSrcReg, (ops FR64:$dst, FR32:$src), - "cvtss2sd {$src, $dst|$dst, $src}", - [(set FR64:$dst, (fextend FR32:$src))]>, XS, - Requires<[HasSSE2]>; -def CVTSS2SDrm: I<0x5A, MRMSrcMem, (ops FR64:$dst, f32mem:$src), - "cvtss2sd {$src, $dst|$dst, $src}", - [(set FR64:$dst, (extloadf32 addr:$src))]>, XS, - Requires<[HasSSE2]>; +def CVTSS2SDrr : I<0x5A, MRMSrcReg, (ops FR64:$dst, FR32:$src), + "cvtss2sd {$src, $dst|$dst, $src}", + [(set FR64:$dst, (fextend FR32:$src))]>, XS, + Requires<[HasSSE2]>; +def CVTSS2SDrm : I<0x5A, MRMSrcMem, (ops FR64:$dst, f32mem:$src), + "cvtss2sd {$src, $dst|$dst, $src}", + [(set FR64:$dst, (extloadf32 addr:$src))]>, XS, + Requires<[HasSSE2]>; // Match intrinsics which expect XMM operand(s). -def Int_CVTSS2SIrr: SSI<0x2D, MRMSrcReg, (ops GR32:$dst, VR128:$src), - "cvtss2si {$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse_cvtss2si VR128:$src))]>; -def Int_CVTSS2SIrm: SSI<0x2D, MRMSrcMem, (ops GR32:$dst, f32mem:$src), - "cvtss2si {$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse_cvtss2si - (load addr:$src)))]>; -def Int_CVTSD2SIrr: SDI<0x2D, MRMSrcReg, (ops GR32:$dst, VR128:$src), - "cvtsd2si {$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse2_cvtsd2si VR128:$src))]>; -def Int_CVTSD2SIrm: SDI<0x2D, MRMSrcMem, (ops GR32:$dst, f128mem:$src), - "cvtsd2si {$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse2_cvtsd2si - (load addr:$src)))]>; +def Int_CVTSD2SIrr : SDI<0x2D, MRMSrcReg, (ops GR32:$dst, VR128:$src), + "cvtsd2si {$src, $dst|$dst, $src}", + [(set GR32:$dst, (int_x86_sse2_cvtsd2si VR128:$src))]>; +def Int_CVTSD2SIrm : SDI<0x2D, MRMSrcMem, (ops GR32:$dst, f128mem:$src), + "cvtsd2si {$src, $dst|$dst, $src}", + [(set GR32:$dst, (int_x86_sse2_cvtsd2si + (load addr:$src)))]>; // Aliases for intrinsics -def Int_CVTTSS2SIrr: SSI<0x2C, MRMSrcReg, (ops GR32:$dst, VR128:$src), - "cvttss2si {$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse_cvttss2si VR128:$src))]>; -def Int_CVTTSS2SIrm: SSI<0x2C, MRMSrcMem, (ops GR32:$dst, f32mem:$src), - "cvttss2si {$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse_cvttss2si(load addr:$src)))]>; -def Int_CVTTSD2SIrr: SDI<0x2C, MRMSrcReg, (ops GR32:$dst, VR128:$src), - "cvttsd2si {$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse2_cvttsd2si VR128:$src))]>; -def Int_CVTTSD2SIrm: SDI<0x2C, MRMSrcMem, (ops GR32:$dst, f128mem:$src), - "cvttsd2si {$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse2_cvttsd2si - (load addr:$src)))]>; - -let isTwoAddress = 1 in { -def Int_CVTSI2SSrr: SSI<0x2A, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, GR32:$src2), - "cvtsi2ss {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (int_x86_sse_cvtsi2ss VR128:$src1, - GR32:$src2))]>; -def Int_CVTSI2SSrm: SSI<0x2A, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, i32mem:$src2), - "cvtsi2ss {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (int_x86_sse_cvtsi2ss VR128:$src1, - (loadi32 addr:$src2)))]>; -} +def Int_CVTTSD2SIrr : SDI<0x2C, MRMSrcReg, (ops GR32:$dst, VR128:$src), + "cvttsd2si {$src, $dst|$dst, $src}", + [(set GR32:$dst, + (int_x86_sse2_cvttsd2si VR128:$src))]>; +def Int_CVTTSD2SIrm : SDI<0x2C, MRMSrcMem, (ops GR32:$dst, f128mem:$src), + "cvttsd2si {$src, $dst|$dst, $src}", + [(set GR32:$dst, (int_x86_sse2_cvttsd2si + (load addr:$src)))]>; // Comparison instructions let isTwoAddress = 1 in { -def CMPSSrr : SSI<0xC2, MRMSrcReg, - (ops FR32:$dst, FR32:$src1, FR32:$src, SSECC:$cc), - "cmp${cc}ss {$src, $dst|$dst, $src}", - []>; -def CMPSSrm : SSI<0xC2, MRMSrcMem, - (ops FR32:$dst, FR32:$src1, f32mem:$src, SSECC:$cc), - "cmp${cc}ss {$src, $dst|$dst, $src}", []>; -def CMPSDrr : SDI<0xC2, MRMSrcReg, - (ops FR64:$dst, FR64:$src1, FR64:$src, SSECC:$cc), - "cmp${cc}sd {$src, $dst|$dst, $src}", []>; -def CMPSDrm : SDI<0xC2, MRMSrcMem, - (ops FR64:$dst, FR64:$src1, f64mem:$src, SSECC:$cc), - "cmp${cc}sd {$src, $dst|$dst, $src}", []>; + def CMPSDrr : SDI<0xC2, MRMSrcReg, + (ops FR64:$dst, FR64:$src1, FR64:$src, SSECC:$cc), + "cmp${cc}sd {$src, $dst|$dst, $src}", []>; + def CMPSDrm : SDI<0xC2, MRMSrcMem, + (ops FR64:$dst, FR64:$src1, f64mem:$src, SSECC:$cc), + "cmp${cc}sd {$src, $dst|$dst, $src}", []>; } -def UCOMISSrr: PSI<0x2E, MRMSrcReg, (ops FR32:$src1, FR32:$src2), - "ucomiss {$src2, $src1|$src1, $src2}", - [(X86cmp FR32:$src1, FR32:$src2)]>; -def UCOMISSrm: PSI<0x2E, MRMSrcMem, (ops FR32:$src1, f32mem:$src2), - "ucomiss {$src2, $src1|$src1, $src2}", - [(X86cmp FR32:$src1, (loadf32 addr:$src2))]>; def UCOMISDrr: PDI<0x2E, MRMSrcReg, (ops FR64:$src1, FR64:$src2), - "ucomisd {$src2, $src1|$src1, $src2}", - [(X86cmp FR64:$src1, FR64:$src2)]>; + "ucomisd {$src2, $src1|$src1, $src2}", + [(X86cmp FR64:$src1, FR64:$src2)]>; def UCOMISDrm: PDI<0x2E, MRMSrcMem, (ops FR64:$src1, f64mem:$src2), - "ucomisd {$src2, $src1|$src1, $src2}", - [(X86cmp FR64:$src1, (loadf64 addr:$src2))]>; + "ucomisd {$src2, $src1|$src1, $src2}", + [(X86cmp FR64:$src1, (loadf64 addr:$src2))]>; // Aliases to match intrinsics which expect XMM operand(s). let isTwoAddress = 1 in { -def Int_CMPSSrr : SSI<0xC2, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src, SSECC:$cc), - "cmp${cc}ss {$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse_cmp_ss VR128:$src1, - VR128:$src, imm:$cc))]>; -def Int_CMPSSrm : SSI<0xC2, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, f32mem:$src, SSECC:$cc), - "cmp${cc}ss {$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse_cmp_ss VR128:$src1, - (load addr:$src), imm:$cc))]>; -def Int_CMPSDrr : SDI<0xC2, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src, SSECC:$cc), - "cmp${cc}sd {$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse2_cmp_sd VR128:$src1, - VR128:$src, imm:$cc))]>; -def Int_CMPSDrm : SDI<0xC2, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, f64mem:$src, SSECC:$cc), - "cmp${cc}sd {$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse2_cmp_sd VR128:$src1, - (load addr:$src), imm:$cc))]>; + def Int_CMPSDrr : SDI<0xC2, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src, SSECC:$cc), + "cmp${cc}sd {$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse2_cmp_sd VR128:$src1, + VR128:$src, imm:$cc))]>; + def Int_CMPSDrm : SDI<0xC2, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f64mem:$src, SSECC:$cc), + "cmp${cc}sd {$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse2_cmp_sd VR128:$src1, + (load addr:$src), imm:$cc))]>; } -def Int_UCOMISSrr: PSI<0x2E, MRMSrcReg, (ops VR128:$src1, VR128:$src2), - "ucomiss {$src2, $src1|$src1, $src2}", - [(X86ucomi (v4f32 VR128:$src1), VR128:$src2)]>; -def Int_UCOMISSrm: PSI<0x2E, MRMSrcMem, (ops VR128:$src1, f128mem:$src2), - "ucomiss {$src2, $src1|$src1, $src2}", - [(X86ucomi (v4f32 VR128:$src1), (load addr:$src2))]>; def Int_UCOMISDrr: PDI<0x2E, MRMSrcReg, (ops VR128:$src1, VR128:$src2), "ucomisd {$src2, $src1|$src1, $src2}", [(X86ucomi (v2f64 VR128:$src1), (v2f64 VR128:$src2))]>; def Int_UCOMISDrm: PDI<0x2E, MRMSrcMem, (ops VR128:$src1, f128mem:$src2), "ucomisd {$src2, $src1|$src1, $src2}", - [(X86ucomi (v2f64 VR128:$src1), (load addr:$src2))]>; + [(X86ucomi (v2f64 VR128:$src1), (load addr:$src2))]>; -def Int_COMISSrr: PSI<0x2F, MRMSrcReg, (ops VR128:$src1, VR128:$src2), - "comiss {$src2, $src1|$src1, $src2}", - [(X86comi (v4f32 VR128:$src1), VR128:$src2)]>; -def Int_COMISSrm: PSI<0x2F, MRMSrcMem, (ops VR128:$src1, f128mem:$src2), - "comiss {$src2, $src1|$src1, $src2}", - [(X86comi (v4f32 VR128:$src1), (load addr:$src2))]>; def Int_COMISDrr: PDI<0x2F, MRMSrcReg, (ops VR128:$src1, VR128:$src2), "comisd {$src2, $src1|$src1, $src2}", [(X86comi (v2f64 VR128:$src1), (v2f64 VR128:$src2))]>; @@ -591,123 +956,120 @@ // start with 'Fs'. // Alias instructions that map fld0 to pxor for sse. -def FsFLD0SS : I<0xEF, MRMInitReg, (ops FR32:$dst), - "pxor $dst, $dst", [(set FR32:$dst, fp32imm0)]>, - Requires<[HasSSE1]>, TB, OpSize; def FsFLD0SD : I<0xEF, MRMInitReg, (ops FR64:$dst), "pxor $dst, $dst", [(set FR64:$dst, fp64imm0)]>, Requires<[HasSSE2]>, TB, OpSize; -// Alias instructions to do FR32 / FR64 reg-to-reg copy using movaps / movapd. -// Upper bits are disregarded. -def FsMOVAPSrr : PSI<0x28, MRMSrcReg, (ops FR32:$dst, FR32:$src), - "movaps {$src, $dst|$dst, $src}", []>; +// Alias instructions to do FR64 reg-to-reg copy using movapd. Upper bits are +// disregarded. def FsMOVAPDrr : PDI<0x28, MRMSrcReg, (ops FR64:$dst, FR64:$src), "movapd {$src, $dst|$dst, $src}", []>; -// Alias instructions to load FR32 / FR64 from f128mem using movaps / movapd. -// Upper bits are disregarded. -def FsMOVAPSrm : PSI<0x28, MRMSrcMem, (ops FR32:$dst, f128mem:$src), - "movaps {$src, $dst|$dst, $src}", - [(set FR32:$dst, (X86loadpf32 addr:$src))]>; +// Alias instructions to load FR64 from f128mem using movapd. Upper bits are +// disregarded. def FsMOVAPDrm : PDI<0x28, MRMSrcMem, (ops FR64:$dst, f128mem:$src), "movapd {$src, $dst|$dst, $src}", [(set FR64:$dst, (X86loadpf64 addr:$src))]>; -// Alias bitwise logical operations using SSE logical ops on packed FP values. -let isTwoAddress = 1 in { -let isCommutable = 1 in { -def FsANDPSrr : PSI<0x54, MRMSrcReg, (ops FR32:$dst, FR32:$src1, FR32:$src2), - "andps {$src2, $dst|$dst, $src2}", - [(set FR32:$dst, (X86fand FR32:$src1, FR32:$src2))]>; -def FsANDPDrr : PDI<0x54, MRMSrcReg, (ops FR64:$dst, FR64:$src1, FR64:$src2), - "andpd {$src2, $dst|$dst, $src2}", - [(set FR64:$dst, (X86fand FR64:$src1, FR64:$src2))]>; -def FsORPSrr : PSI<0x56, MRMSrcReg, (ops FR32:$dst, FR32:$src1, FR32:$src2), - "orps {$src2, $dst|$dst, $src2}", - [(set FR32:$dst, (X86for FR32:$src1, FR32:$src2))]>; -def FsORPDrr : PDI<0x56, MRMSrcReg, (ops FR64:$dst, FR64:$src1, FR64:$src2), - "orpd {$src2, $dst|$dst, $src2}", - [(set FR64:$dst, (X86for FR64:$src1, FR64:$src2))]>; -def FsXORPSrr : PSI<0x57, MRMSrcReg, (ops FR32:$dst, FR32:$src1, FR32:$src2), - "xorps {$src2, $dst|$dst, $src2}", - [(set FR32:$dst, (X86fxor FR32:$src1, FR32:$src2))]>; -def FsXORPDrr : PDI<0x57, MRMSrcReg, (ops FR64:$dst, FR64:$src1, FR64:$src2), - "xorpd {$src2, $dst|$dst, $src2}", - [(set FR64:$dst, (X86fxor FR64:$src1, FR64:$src2))]>; -} -def FsANDPSrm : PSI<0x54, MRMSrcMem, (ops FR32:$dst, FR32:$src1, f128mem:$src2), - "andps {$src2, $dst|$dst, $src2}", - [(set FR32:$dst, (X86fand FR32:$src1, - (X86loadpf32 addr:$src2)))]>; -def FsANDPDrm : PDI<0x54, MRMSrcMem, (ops FR64:$dst, FR64:$src1, f128mem:$src2), - "andpd {$src2, $dst|$dst, $src2}", - [(set FR64:$dst, (X86fand FR64:$src1, - (X86loadpf64 addr:$src2)))]>; -def FsORPSrm : PSI<0x56, MRMSrcMem, (ops FR32:$dst, FR32:$src1, f128mem:$src2), - "orps {$src2, $dst|$dst, $src2}", - [(set FR32:$dst, (X86for FR32:$src1, - (X86loadpf32 addr:$src2)))]>; -def FsORPDrm : PDI<0x56, MRMSrcMem, (ops FR64:$dst, FR64:$src1, f128mem:$src2), - "orpd {$src2, $dst|$dst, $src2}", - [(set FR64:$dst, (X86for FR64:$src1, - (X86loadpf64 addr:$src2)))]>; -def FsXORPSrm : PSI<0x57, MRMSrcMem, (ops FR32:$dst, FR32:$src1, f128mem:$src2), - "xorps {$src2, $dst|$dst, $src2}", - [(set FR32:$dst, (X86fxor FR32:$src1, - (X86loadpf32 addr:$src2)))]>; -def FsXORPDrm : PDI<0x57, MRMSrcMem, (ops FR64:$dst, FR64:$src1, f128mem:$src2), - "xorpd {$src2, $dst|$dst, $src2}", - [(set FR64:$dst, (X86fxor FR64:$src1, - (X86loadpf64 addr:$src2)))]>; +// Alias bitwise logical operations using SSE logical ops on packed FP values. +let isTwoAddress = 1 in { +let isCommutable = 1 in { + def FsANDPDrr : PDI<0x54, MRMSrcReg, (ops FR64:$dst, FR64:$src1, FR64:$src2), + "andpd {$src2, $dst|$dst, $src2}", + [(set FR64:$dst, (X86fand FR64:$src1, FR64:$src2))]>; + def FsORPDrr : PDI<0x56, MRMSrcReg, (ops FR64:$dst, FR64:$src1, FR64:$src2), + "orpd {$src2, $dst|$dst, $src2}", + [(set FR64:$dst, (X86for FR64:$src1, FR64:$src2))]>; + def FsXORPDrr : PDI<0x57, MRMSrcReg, (ops FR64:$dst, FR64:$src1, FR64:$src2), + "xorpd {$src2, $dst|$dst, $src2}", + [(set FR64:$dst, (X86fxor FR64:$src1, FR64:$src2))]>; +} + +def FsANDPDrm : PDI<0x54, MRMSrcMem, (ops FR64:$dst, FR64:$src1, f128mem:$src2), + "andpd {$src2, $dst|$dst, $src2}", + [(set FR64:$dst, (X86fand FR64:$src1, + (X86loadpf64 addr:$src2)))]>; +def FsORPDrm : PDI<0x56, MRMSrcMem, (ops FR64:$dst, FR64:$src1, f128mem:$src2), + "orpd {$src2, $dst|$dst, $src2}", + [(set FR64:$dst, (X86for FR64:$src1, + (X86loadpf64 addr:$src2)))]>; +def FsXORPDrm : PDI<0x57, MRMSrcMem, (ops FR64:$dst, FR64:$src1, f128mem:$src2), + "xorpd {$src2, $dst|$dst, $src2}", + [(set FR64:$dst, (X86fxor FR64:$src1, + (X86loadpf64 addr:$src2)))]>; + +def FsANDNPDrr : PDI<0x55, MRMSrcReg, + (ops FR64:$dst, FR64:$src1, FR64:$src2), + "andnpd {$src2, $dst|$dst, $src2}", []>; +def FsANDNPDrm : PDI<0x55, MRMSrcMem, + (ops FR64:$dst, FR64:$src1, f128mem:$src2), + "andnpd {$src2, $dst|$dst, $src2}", []>; +} + +/// scalar_sse2_fp_binop_rm - Scalar SSE2 binops come in three basic forms: +/// +/// 1. f64 - This comes in SSE2 form for doubles. +/// 2. rr vs rm - They include a reg+reg form and a reg+mem form. +/// +/// In addition, scalar SSE ops have an intrinsic form. This form is unlike the +/// normal form, in that they take an entire vector (instead of a scalar) and +/// leave the top elements undefined. This adds another two variants of the +/// above permutations, giving us 8 forms for 'instruction'. +/// +let isTwoAddress = 1 in { +multiclass scalar_sse2_fp_binop_rm opc, string OpcodeStr, + SDNode OpNode, Intrinsic F64Int, + bit Commutable = 0> { + // Scalar operation, reg+reg. + def SDrr : SDI { + let isCommutable = Commutable; + } + + // Scalar operation, reg+mem. + def SDrm : SDI; + + // Vector intrinsic operation, reg+reg. + def SDrr_Int : SDI { + let isCommutable = Commutable; + } -def FsANDNPSrr : PSI<0x55, MRMSrcReg, (ops FR32:$dst, FR32:$src1, FR32:$src2), - "andnps {$src2, $dst|$dst, $src2}", []>; -def FsANDNPSrm : PSI<0x55, MRMSrcMem, (ops FR32:$dst, FR32:$src1, f128mem:$src2), - "andnps {$src2, $dst|$dst, $src2}", []>; -def FsANDNPDrr : PDI<0x55, MRMSrcReg, (ops FR64:$dst, FR64:$src1, FR64:$src2), - "andnpd {$src2, $dst|$dst, $src2}", []>; -def FsANDNPDrm : PDI<0x55, MRMSrcMem, (ops FR64:$dst, FR64:$src1, f128mem:$src2), - "andnpd {$src2, $dst|$dst, $src2}", []>; + // Vector intrinsic operation, reg+mem. + def SDrm_Int : SDI; +} } +// Arithmetic instructions +defm ADD : scalar_sse2_fp_binop_rm<0x58, "add", fadd, int_x86_sse2_add_sd, 1>; +defm MUL : scalar_sse2_fp_binop_rm<0x59, "mul", fmul, int_x86_sse2_mul_sd, 1>; +defm SUB : scalar_sse2_fp_binop_rm<0x5C, "sub", fsub, int_x86_sse2_sub_sd>; +defm DIV : scalar_sse2_fp_binop_rm<0x5E, "div", fdiv, int_x86_sse2_div_sd>; + +defm MAX : scalar_sse2_fp_binop_rm<0x5F, "max", X86fmax, int_x86_sse2_max_sd>; +defm MIN : scalar_sse2_fp_binop_rm<0x5D, "min", X86fmin, int_x86_sse2_min_sd>; + //===----------------------------------------------------------------------===// // SSE packed FP Instructions -//===----------------------------------------------------------------------===// - -// Some 'special' instructions -def IMPLICIT_DEF_VR128 : I<0, Pseudo, (ops VR128:$dst), - "#IMPLICIT_DEF $dst", - [(set VR128:$dst, (v4f32 (undef)))]>, - Requires<[HasSSE1]>; // Move Instructions -def MOVAPSrr : PSI<0x28, MRMSrcReg, (ops VR128:$dst, VR128:$src), - "movaps {$src, $dst|$dst, $src}", []>; -def MOVAPSrm : PSI<0x28, MRMSrcMem, (ops VR128:$dst, f128mem:$src), - "movaps {$src, $dst|$dst, $src}", - [(set VR128:$dst, (loadv4f32 addr:$src))]>; def MOVAPDrr : PDI<0x28, MRMSrcReg, (ops VR128:$dst, VR128:$src), "movapd {$src, $dst|$dst, $src}", []>; def MOVAPDrm : PDI<0x28, MRMSrcMem, (ops VR128:$dst, f128mem:$src), "movapd {$src, $dst|$dst, $src}", [(set VR128:$dst, (loadv2f64 addr:$src))]>; -def MOVAPSmr : PSI<0x29, MRMDestMem, (ops f128mem:$dst, VR128:$src), - "movaps {$src, $dst|$dst, $src}", - [(store (v4f32 VR128:$src), addr:$dst)]>; def MOVAPDmr : PDI<0x29, MRMDestMem, (ops f128mem:$dst, VR128:$src), "movapd {$src, $dst|$dst, $src}", [(store (v2f64 VR128:$src), addr:$dst)]>; -def MOVUPSrr : PSI<0x10, MRMSrcReg, (ops VR128:$dst, VR128:$src), - "movups {$src, $dst|$dst, $src}", []>; -def MOVUPSrm : PSI<0x10, MRMSrcMem, (ops VR128:$dst, f128mem:$src), - "movups {$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse_loadu_ps addr:$src))]>; -def MOVUPSmr : PSI<0x11, MRMDestMem, (ops f128mem:$dst, VR128:$src), - "movups {$src, $dst|$dst, $src}", - [(int_x86_sse_storeu_ps addr:$dst, VR128:$src)]>; def MOVUPDrr : PDI<0x10, MRMSrcReg, (ops VR128:$dst, VR128:$src), "movupd {$src, $dst|$dst, $src}", []>; def MOVUPDrm : PDI<0x10, MRMSrcMem, (ops VR128:$dst, f128mem:$src), @@ -718,38 +1080,24 @@ [(int_x86_sse2_storeu_pd addr:$dst, VR128:$src)]>; let isTwoAddress = 1 in { -let AddedComplexity = 20 in { -def MOVLPSrm : PSI<0x12, MRMSrcMem, (ops VR128:$dst, VR128:$src1, f64mem:$src2), - "movlps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4f32 (vector_shuffle VR128:$src1, - (bc_v4f32 (v2f64 (scalar_to_vector (loadf64 addr:$src2)))), - MOVLP_shuffle_mask)))]>; -def MOVLPDrm : PDI<0x12, MRMSrcMem, (ops VR128:$dst, VR128:$src1, f64mem:$src2), - "movlpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2f64 (vector_shuffle VR128:$src1, - (scalar_to_vector (loadf64 addr:$src2)), - MOVLP_shuffle_mask)))]>; -def MOVHPSrm : PSI<0x16, MRMSrcMem, (ops VR128:$dst, VR128:$src1, f64mem:$src2), - "movhps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4f32 (vector_shuffle VR128:$src1, - (bc_v4f32 (v2f64 (scalar_to_vector (loadf64 addr:$src2)))), - MOVHP_shuffle_mask)))]>; -def MOVHPDrm : PDI<0x16, MRMSrcMem, (ops VR128:$dst, VR128:$src1, f64mem:$src2), - "movhpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2f64 (vector_shuffle VR128:$src1, - (scalar_to_vector (loadf64 addr:$src2)), - MOVHP_shuffle_mask)))]>; -} // AddedComplexity -} + let AddedComplexity = 20 in { + def MOVLPDrm : PDI<0x12, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f64mem:$src2), + "movlpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2f64 (vector_shuffle VR128:$src1, + (scalar_to_vector (loadf64 addr:$src2)), + MOVLP_shuffle_mask)))]>; + def MOVHPDrm : PDI<0x16, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f64mem:$src2), + "movhpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2f64 (vector_shuffle VR128:$src1, + (scalar_to_vector (loadf64 addr:$src2)), + MOVHP_shuffle_mask)))]>; + } // AddedComplexity +} // isTwoAddress -def MOVLPSmr : PSI<0x13, MRMDestMem, (ops f64mem:$dst, VR128:$src), - "movlps {$src, $dst|$dst, $src}", - [(store (f64 (vector_extract (bc_v2f64 (v4f32 VR128:$src)), - (iPTR 0))), addr:$dst)]>; def MOVLPDmr : PDI<0x13, MRMDestMem, (ops f64mem:$dst, VR128:$src), "movlpd {$src, $dst|$dst, $src}", [(store (f64 (vector_extract (v2f64 VR128:$src), @@ -757,13 +1105,6 @@ // v2f64 extract element 1 is always custom lowered to unpack high to low // and extract element 0 so the non-store version isn't too horrible. -def MOVHPSmr : PSI<0x17, MRMDestMem, (ops f64mem:$dst, VR128:$src), - "movhps {$src, $dst|$dst, $src}", - [(store (f64 (vector_extract - (v2f64 (vector_shuffle - (bc_v2f64 (v4f32 VR128:$src)), (undef), - UNPCKH_shuffle_mask)), (iPTR 0))), - addr:$dst)]>; def MOVHPDmr : PDI<0x17, MRMDestMem, (ops f64mem:$dst, VR128:$src), "movhpd {$src, $dst|$dst, $src}", [(store (f64 (vector_extract @@ -771,56 +1112,6 @@ UNPCKH_shuffle_mask)), (iPTR 0))), addr:$dst)]>; -let isTwoAddress = 1 in { -let AddedComplexity = 15 in { -def MOVLHPSrr : PSI<0x16, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), - "movlhps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4f32 (vector_shuffle VR128:$src1, VR128:$src2, - MOVHP_shuffle_mask)))]>; - -def MOVHLPSrr : PSI<0x12, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), - "movhlps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4f32 (vector_shuffle VR128:$src1, VR128:$src2, - MOVHLPS_shuffle_mask)))]>; -} // AddedComplexity -} - -def MOVSHDUPrr : S3SI<0x16, MRMSrcReg, (ops VR128:$dst, VR128:$src), - "movshdup {$src, $dst|$dst, $src}", - [(set VR128:$dst, (v4f32 (vector_shuffle - VR128:$src, (undef), - MOVSHDUP_shuffle_mask)))]>; -def MOVSHDUPrm : S3SI<0x16, MRMSrcMem, (ops VR128:$dst, f128mem:$src), - "movshdup {$src, $dst|$dst, $src}", - [(set VR128:$dst, (v4f32 (vector_shuffle - (loadv4f32 addr:$src), (undef), - MOVSHDUP_shuffle_mask)))]>; - -def MOVSLDUPrr : S3SI<0x12, MRMSrcReg, (ops VR128:$dst, VR128:$src), - "movsldup {$src, $dst|$dst, $src}", - [(set VR128:$dst, (v4f32 (vector_shuffle - VR128:$src, (undef), - MOVSLDUP_shuffle_mask)))]>; -def MOVSLDUPrm : S3SI<0x12, MRMSrcMem, (ops VR128:$dst, f128mem:$src), - "movsldup {$src, $dst|$dst, $src}", - [(set VR128:$dst, (v4f32 (vector_shuffle - (loadv4f32 addr:$src), (undef), - MOVSLDUP_shuffle_mask)))]>; - -def MOVDDUPrr : S3DI<0x12, MRMSrcReg, (ops VR128:$dst, VR128:$src), - "movddup {$src, $dst|$dst, $src}", - [(set VR128:$dst, (v2f64 (vector_shuffle - VR128:$src, (undef), - SSE_splat_lo_mask)))]>; -def MOVDDUPrm : S3DI<0x12, MRMSrcMem, (ops VR128:$dst, f64mem:$src), - "movddup {$src, $dst|$dst, $src}", - [(set VR128:$dst, (v2f64 (vector_shuffle - (scalar_to_vector (loadf64 addr:$src)), - (undef), - SSE_splat_lo_mask)))]>; - // SSE2 instructions without OpSize prefix def Int_CVTDQ2PSrr : I<0x5B, MRMSrcReg, (ops VR128:$dst, VR128:$src), "cvtdq2ps {$src, $dst|$dst, $src}", @@ -871,6 +1162,7 @@ [(set VR128:$dst, (int_x86_sse2_cvtpd2dq (load addr:$src)))]>, XD, Requires<[HasSSE2]>; + def Int_CVTTPD2DQrr : PDI<0xE6, MRMSrcReg, (ops VR128:$dst, VR128:$src), "cvttpd2dq {$src, $dst|$dst, $src}", [(set VR128:$dst, (int_x86_sse2_cvttpd2dq VR128:$src))]>; @@ -935,300 +1227,186 @@ Requires<[HasSSE2]>; } -/// packed_sse12_fp_binop_rm - Packed SSE binops come in four basic forms: -/// 1. v4f32 vs v2f64 - These come in SSE1/SSE2 forms for float/doubles. +/// packed_sse2_fp_binop_rm - Packed SSE binops come in three basic forms: +/// 1. v2f64 - This comes in SSE2 form for doubles. /// 2. rr vs rm - They include a reg+reg form and a ref+mem form. /// let isTwoAddress = 1 in { -multiclass packed_sse12_fp_binop_rm opc, string OpcodeStr, - SDNode OpNode, bit Commutable = 0> { +multiclass packed_sse2_fp_binop_rm opc, string OpcodeStr, + SDNode OpNode, bit Commutable = 0> { // Packed operation, reg+reg. - def PSrr : PSI { - let isCommutable = Commutable; - } def PDrr : PDI { let isCommutable = Commutable; } + // Packed operation, reg+mem. - def PSrm : PSI; def PDrm : PDI; } } -defm ADD : packed_sse12_fp_binop_rm<0x58, "add", fadd, 1>; -defm MUL : packed_sse12_fp_binop_rm<0x59, "mul", fmul, 1>; -defm DIV : packed_sse12_fp_binop_rm<0x5E, "div", fdiv>; -defm SUB : packed_sse12_fp_binop_rm<0x5C, "sub", fsub>; +defm ADD : packed_sse2_fp_binop_rm<0x58, "add", fadd, 1>; +defm MUL : packed_sse2_fp_binop_rm<0x59, "mul", fmul, 1>; +defm DIV : packed_sse2_fp_binop_rm<0x5E, "div", fdiv>; +defm SUB : packed_sse2_fp_binop_rm<0x5C, "sub", fsub>; // Arithmetic -let isTwoAddress = 1 in { -def ADDSUBPSrr : S3DI<0xD0, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "addsubps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (int_x86_sse3_addsub_ps VR128:$src1, - VR128:$src2))]>; -def ADDSUBPSrm : S3DI<0xD0, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, f128mem:$src2), - "addsubps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (int_x86_sse3_addsub_ps VR128:$src1, - (load addr:$src2)))]>; -def ADDSUBPDrr : S3I<0xD0, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "addsubpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (int_x86_sse3_addsub_pd VR128:$src1, - VR128:$src2))]>; -def ADDSUBPDrm : S3I<0xD0, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, f128mem:$src2), - "addsubpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (int_x86_sse3_addsub_pd VR128:$src1, - (load addr:$src2)))]>; -} -def SQRTPSr : PS_Intr<0x51, "sqrtps", int_x86_sse_sqrt_ps>; -def SQRTPSm : PS_Intm<0x51, "sqrtps", int_x86_sse_sqrt_ps>; +class PD_Intr o, string OpcodeStr, Intrinsic IntId> + : PDI; +class PD_Intm o, string OpcodeStr, Intrinsic IntId> + : PDI; + +class PD_Intrr o, string OpcodeStr, Intrinsic IntId> + : PDI; +class PD_Intrm o, string OpcodeStr, Intrinsic IntId> + : PDI; + def SQRTPDr : PD_Intr<0x51, "sqrtpd", int_x86_sse2_sqrt_pd>; def SQRTPDm : PD_Intm<0x51, "sqrtpd", int_x86_sse2_sqrt_pd>; -def RSQRTPSr : PS_Intr<0x52, "rsqrtps", int_x86_sse_rsqrt_ps>; -def RSQRTPSm : PS_Intm<0x52, "rsqrtps", int_x86_sse_rsqrt_ps>; -def RCPPSr : PS_Intr<0x53, "rcpps", int_x86_sse_rcp_ps>; -def RCPPSm : PS_Intm<0x53, "rcpps", int_x86_sse_rcp_ps>; - let isTwoAddress = 1 in { -let isCommutable = 1 in { -def MAXPSrr : PS_Intrr<0x5F, "maxps", int_x86_sse_max_ps>; -def MAXPDrr : PD_Intrr<0x5F, "maxpd", int_x86_sse2_max_pd>; -def MINPSrr : PS_Intrr<0x5D, "minps", int_x86_sse_min_ps>; -def MINPDrr : PD_Intrr<0x5D, "minpd", int_x86_sse2_min_pd>; -} -def MAXPSrm : PS_Intrm<0x5F, "maxps", int_x86_sse_max_ps>; -def MAXPDrm : PD_Intrm<0x5F, "maxpd", int_x86_sse2_max_pd>; -def MINPSrm : PS_Intrm<0x5D, "minps", int_x86_sse_min_ps>; -def MINPDrm : PD_Intrm<0x5D, "minpd", int_x86_sse2_min_pd>; + let isCommutable = 1 in { + def MAXPDrr : PD_Intrr<0x5F, "maxpd", int_x86_sse2_max_pd>; + def MINPDrr : PD_Intrr<0x5D, "minpd", int_x86_sse2_min_pd>; + } + + def MAXPDrm : PD_Intrm<0x5F, "maxpd", int_x86_sse2_max_pd>; + def MINPDrm : PD_Intrm<0x5D, "minpd", int_x86_sse2_min_pd>; } // Logical let isTwoAddress = 1 in { -let isCommutable = 1 in { -def ANDPSrr : PSI<0x54, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), - "andps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v2i64 (and VR128:$src1, VR128:$src2)))]>; -def ANDPDrr : PDI<0x54, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), - "andpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (and (bc_v2i64 (v2f64 VR128:$src1)), + let isCommutable = 1 in { + def ANDPDrr : PDI<0x54, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "andpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (and (bc_v2i64 (v2f64 VR128:$src1)), (bc_v2i64 (v2f64 VR128:$src2))))]>; -def ORPSrr : PSI<0x56, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), - "orps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v2i64 (or VR128:$src1, VR128:$src2)))]>; -def ORPDrr : PDI<0x56, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), - "orpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (or (bc_v2i64 (v2f64 VR128:$src1)), - (bc_v2i64 (v2f64 VR128:$src2))))]>; -def XORPSrr : PSI<0x57, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), - "xorps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v2i64 (xor VR128:$src1, VR128:$src2)))]>; -def XORPDrr : PDI<0x57, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), - "xorpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (xor (bc_v2i64 (v2f64 VR128:$src1)), + def ORPDrr : PDI<0x56, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "orpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (or (bc_v2i64 (v2f64 VR128:$src1)), (bc_v2i64 (v2f64 VR128:$src2))))]>; -} -def ANDPSrm : PSI<0x54, MRMSrcMem, (ops VR128:$dst, VR128:$src1, f128mem:$src2), - "andps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (and VR128:$src1, - (bc_v2i64 (loadv4f32 addr:$src2))))]>; -def ANDPDrm : PDI<0x54, MRMSrcMem, (ops VR128:$dst, VR128:$src1, f128mem:$src2), - "andpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (and (bc_v2i64 (v2f64 VR128:$src1)), + def XORPDrr : PDI<0x57, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "xorpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (xor (bc_v2i64 (v2f64 VR128:$src1)), + (bc_v2i64 (v2f64 VR128:$src2))))]>; + } + + def ANDPDrm : PDI<0x54, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src2), + "andpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (and (bc_v2i64 (v2f64 VR128:$src1)), (bc_v2i64 (loadv2f64 addr:$src2))))]>; -def ORPSrm : PSI<0x56, MRMSrcMem, (ops VR128:$dst, VR128:$src1, f128mem:$src2), - "orps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (or VR128:$src1, - (bc_v2i64 (loadv4f32 addr:$src2))))]>; -def ORPDrm : PDI<0x56, MRMSrcMem, (ops VR128:$dst, VR128:$src1, f128mem:$src2), - "orpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (or (bc_v2i64 (v2f64 VR128:$src1)), + def ORPDrm : PDI<0x56, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src2), + "orpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (or (bc_v2i64 (v2f64 VR128:$src1)), (bc_v2i64 (loadv2f64 addr:$src2))))]>; -def XORPSrm : PSI<0x57, MRMSrcMem, (ops VR128:$dst, VR128:$src1, f128mem:$src2), - "xorps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (xor VR128:$src1, - (bc_v2i64 (loadv4f32 addr:$src2))))]>; -def XORPDrm : PDI<0x57, MRMSrcMem, (ops VR128:$dst, VR128:$src1, f128mem:$src2), - "xorpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (xor (bc_v2i64 (v2f64 VR128:$src1)), + def XORPDrm : PDI<0x57, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src2), + "xorpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (xor (bc_v2i64 (v2f64 VR128:$src1)), (bc_v2i64 (loadv2f64 addr:$src2))))]>; -def ANDNPSrr : PSI<0x55, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), - "andnps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v2i64 (and (xor VR128:$src1, - (bc_v2i64 (v4i32 immAllOnesV))), - VR128:$src2)))]>; -def ANDNPSrm : PSI<0x55, MRMSrcMem, (ops VR128:$dst, VR128:$src1,f128mem:$src2), - "andnps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v2i64 (and (xor VR128:$src1, - (bc_v2i64 (v4i32 immAllOnesV))), - (bc_v2i64 (loadv4f32 addr:$src2)))))]>; -def ANDNPDrr : PDI<0x55, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), - "andnpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (and (vnot (bc_v2i64 (v2f64 VR128:$src1))), - (bc_v2i64 (v2f64 VR128:$src2))))]>; -def ANDNPDrm : PDI<0x55, MRMSrcMem, (ops VR128:$dst, VR128:$src1,f128mem:$src2), - "andnpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (and (vnot (bc_v2i64 (v2f64 VR128:$src1))), - (bc_v2i64 (loadv2f64 addr:$src2))))]>; + def ANDNPDrr : PDI<0x55, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "andnpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (and (vnot (bc_v2i64 (v2f64 VR128:$src1))), + (bc_v2i64 (v2f64 VR128:$src2))))]>; + def ANDNPDrm : PDI<0x55, MRMSrcMem, + (ops VR128:$dst, VR128:$src1,f128mem:$src2), + "andnpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (and (vnot (bc_v2i64 (v2f64 VR128:$src1))), + (bc_v2i64 (loadv2f64 addr:$src2))))]>; } let isTwoAddress = 1 in { -def CMPPSrri : PSIi8<0xC2, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src, SSECC:$cc), - "cmp${cc}ps {$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1, - VR128:$src, imm:$cc))]>; -def CMPPSrmi : PSIi8<0xC2, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, f128mem:$src, SSECC:$cc), - "cmp${cc}ps {$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1, - (load addr:$src), imm:$cc))]>; -def CMPPDrri : PDIi8<0xC2, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src, SSECC:$cc), - "cmp${cc}pd {$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, - VR128:$src, imm:$cc))]>; -def CMPPDrmi : PDIi8<0xC2, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, f128mem:$src, SSECC:$cc), - "cmp${cc}pd {$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, - (load addr:$src), imm:$cc))]>; + def CMPPDrri : PDIi8<0xC2, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src, SSECC:$cc), + "cmp${cc}pd {$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, + VR128:$src, imm:$cc))]>; + def CMPPDrmi : PDIi8<0xC2, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src, SSECC:$cc), + "cmp${cc}pd {$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, + (load addr:$src), imm:$cc))]>; } // Shuffle and unpack instructions let isTwoAddress = 1 in { -let isConvertibleToThreeAddress = 1 in // Convert to pshufd -def SHUFPSrri : PSIi8<0xC6, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2, i32i8imm:$src3), - "shufps {$src3, $src2, $dst|$dst, $src2, $src3}", - [(set VR128:$dst, (v4f32 (vector_shuffle - VR128:$src1, VR128:$src2, - SHUFP_shuffle_mask:$src3)))]>; -def SHUFPSrmi : PSIi8<0xC6, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, f128mem:$src2, i32i8imm:$src3), - "shufps {$src3, $src2, $dst|$dst, $src2, $src3}", - [(set VR128:$dst, (v4f32 (vector_shuffle - VR128:$src1, (load addr:$src2), - SHUFP_shuffle_mask:$src3)))]>; -def SHUFPDrri : PDIi8<0xC6, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2, i8imm:$src3), - "shufpd {$src3, $src2, $dst|$dst, $src2, $src3}", - [(set VR128:$dst, (v2f64 (vector_shuffle - VR128:$src1, VR128:$src2, - SHUFP_shuffle_mask:$src3)))]>; -def SHUFPDrmi : PDIi8<0xC6, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, f128mem:$src2, i8imm:$src3), - "shufpd {$src3, $src2, $dst|$dst, $src2, $src3}", - [(set VR128:$dst, (v2f64 (vector_shuffle - VR128:$src1, (load addr:$src2), - SHUFP_shuffle_mask:$src3)))]>; - -let AddedComplexity = 10 in { -def UNPCKHPSrr : PSI<0x15, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "unpckhps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v4f32 (vector_shuffle - VR128:$src1, VR128:$src2, - UNPCKH_shuffle_mask)))]>; -def UNPCKHPSrm : PSI<0x15, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, f128mem:$src2), - "unpckhps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v4f32 (vector_shuffle - VR128:$src1, (load addr:$src2), - UNPCKH_shuffle_mask)))]>; -def UNPCKHPDrr : PDI<0x15, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "unpckhpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v2f64 (vector_shuffle - VR128:$src1, VR128:$src2, - UNPCKH_shuffle_mask)))]>; -def UNPCKHPDrm : PDI<0x15, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, f128mem:$src2), - "unpckhpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v2f64 (vector_shuffle - VR128:$src1, (load addr:$src2), - UNPCKH_shuffle_mask)))]>; - -def UNPCKLPSrr : PSI<0x14, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "unpcklps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v4f32 (vector_shuffle - VR128:$src1, VR128:$src2, - UNPCKL_shuffle_mask)))]>; -def UNPCKLPSrm : PSI<0x14, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, f128mem:$src2), - "unpcklps {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v4f32 (vector_shuffle - VR128:$src1, (load addr:$src2), - UNPCKL_shuffle_mask)))]>; -def UNPCKLPDrr : PDI<0x14, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "unpcklpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v2f64 (vector_shuffle - VR128:$src1, VR128:$src2, - UNPCKL_shuffle_mask)))]>; -def UNPCKLPDrm : PDI<0x14, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, f128mem:$src2), - "unpcklpd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v2f64 (vector_shuffle - VR128:$src1, (load addr:$src2), - UNPCKL_shuffle_mask)))]>; -} // AddedComplexity -} - -// Horizontal ops - -class S3D_Intrr o, string OpcodeStr, Intrinsic IntId> - : S3DI; -class S3D_Intrm o, string OpcodeStr, Intrinsic IntId> - : S3DI; -class S3_Intrr o, string OpcodeStr, Intrinsic IntId> - : S3I; -class S3_Intrm o, string OpcodeStr, Intrinsic IntId> - : S3I; + def SHUFPDrri : PDIi8<0xC6, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2, i8imm:$src3), + "shufpd {$src3, $src2, $dst|$dst, $src2, $src3}", + [(set VR128:$dst, (v2f64 (vector_shuffle + VR128:$src1, VR128:$src2, + SHUFP_shuffle_mask:$src3)))]>; + def SHUFPDrmi : PDIi8<0xC6, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, + f128mem:$src2, i8imm:$src3), + "shufpd {$src3, $src2, $dst|$dst, $src2, $src3}", + [(set VR128:$dst, + (v2f64 (vector_shuffle + VR128:$src1, (load addr:$src2), + SHUFP_shuffle_mask:$src3)))]>; + + let AddedComplexity = 10 in { + def UNPCKHPDrr : PDI<0x15, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "unpckhpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2f64 (vector_shuffle + VR128:$src1, VR128:$src2, + UNPCKH_shuffle_mask)))]>; + def UNPCKHPDrm : PDI<0x15, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src2), + "unpckhpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2f64 (vector_shuffle + VR128:$src1, (load addr:$src2), + UNPCKH_shuffle_mask)))]>; + + def UNPCKLPDrr : PDI<0x14, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "unpcklpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2f64 (vector_shuffle + VR128:$src1, VR128:$src2, + UNPCKL_shuffle_mask)))]>; + def UNPCKLPDrm : PDI<0x14, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src2), + "unpcklpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2f64 (vector_shuffle + VR128:$src1, (load addr:$src2), + UNPCKL_shuffle_mask)))]>; + } // AddedComplexity +} // isTwoAddress -let isTwoAddress = 1 in { -def HADDPSrr : S3D_Intrr<0x7C, "haddps", int_x86_sse3_hadd_ps>; -def HADDPSrm : S3D_Intrm<0x7C, "haddps", int_x86_sse3_hadd_ps>; -def HADDPDrr : S3_Intrr <0x7C, "haddpd", int_x86_sse3_hadd_pd>; -def HADDPDrm : S3_Intrm <0x7C, "haddpd", int_x86_sse3_hadd_pd>; -def HSUBPSrr : S3D_Intrr<0x7D, "hsubps", int_x86_sse3_hsub_ps>; -def HSUBPSrm : S3D_Intrm<0x7D, "hsubps", int_x86_sse3_hsub_ps>; -def HSUBPDrr : S3_Intrr <0x7D, "hsubpd", int_x86_sse3_hsub_pd>; -def HSUBPDrm : S3_Intrm <0x7D, "hsubpd", int_x86_sse3_hsub_pd>; -} //===----------------------------------------------------------------------===// // SSE integer instructions -//===----------------------------------------------------------------------===// // Move Instructions def MOVDQArr : PDI<0x6F, MRMSrcReg, (ops VR128:$dst, VR128:$src), @@ -1247,12 +1425,10 @@ "movdqu {$src, $dst|$dst, $src}", [(int_x86_sse2_storeu_dq addr:$dst, VR128:$src)]>, XS, Requires<[HasSSE2]>; -def LDDQUrm : S3DI<0xF0, MRMSrcMem, (ops VR128:$dst, i128mem:$src), - "lddqu {$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse3_ldu_dq addr:$src))]>; let isTwoAddress = 1 in { + multiclass PDI_binop_rm_int opc, string OpcodeStr, Intrinsic IntId, bit Commutable = 0> { def rr : PDI; } -} -let isTwoAddress = 1 in { multiclass PDI_binop_rmi_int opc, bits<8> opc2, Format ImmForm, string OpcodeStr, Intrinsic IntId> { def rr : PDI; } -} -let isTwoAddress = 1 in { /// PDI_binop_rm - Simple SSE2 binary operator. multiclass PDI_binop_rm opc, string OpcodeStr, SDNode OpNode, ValueType OpVT, bit Commutable = 0> { @@ -1308,33 +1480,17 @@ multiclass PDI_binop_rm_v2i64 opc, string OpcodeStr, SDNode OpNode, bit Commutable = 0> { def rr : PDI { - let isCommutable = Commutable; - } - def rm : PDI; -} -} - -/// SS3I_binop_rm_int - Simple SSSE3 binary operatr whose type is v2i64. -let isTwoAddress = 1 in { - multiclass SS3I_binop_rm_int opc, string OpcodeStr, Intrinsic IntId, - bit Commutable = 0> { - def rr : SS38I { - let isCommutable = Commutable; - } - def rm : SS38I; + !strconcat(OpcodeStr, " {$src2, $dst|$dst, $src2}"), + [(set VR128:$dst, (v2i64 (OpNode VR128:$src1, VR128:$src2)))]> { + let isCommutable = Commutable; } + def rm : PDI; } +} // isTwoAddress + // 128-bit Integer Arithmetic defm PADDB : PDI_binop_rm<0xFC, "paddb", add, v16i8, 1>; @@ -1363,9 +1519,6 @@ defm PMULHW : PDI_binop_rm_int<0xE5, "pmulhw" , int_x86_sse2_pmulh_w , 1>; defm PMULUDQ : PDI_binop_rm_int<0xF4, "pmuludq", int_x86_sse2_pmulu_dq, 1>; -defm PMULHRSW128 : SS3I_binop_rm_int<0x0B, "pmulhrsw", - int_x86_ssse3_pmulhrsw_128, 1>; - defm PMADDWD : PDI_binop_rm_int<0xF5, "pmaddwd", int_x86_sse2_pmadd_wd, 1>; defm PAVGB : PDI_binop_rm_int<0xE0, "pavgb", int_x86_sse2_pavg_b, 1>; @@ -1391,14 +1544,15 @@ defm PSRAD : PDI_binop_rmi_int<0xE2, 0x72, MRM4r, "psrad", int_x86_sse2_psra_d>; // PSRAQ doesn't exist in SSE[1-3]. - // 128-bit logical shifts. let isTwoAddress = 1 in { -def PSLLDQri : PDIi8<0x73, MRM7r, (ops VR128:$dst, VR128:$src1, i32i8imm:$src2), - "pslldq {$src2, $dst|$dst, $src2}", []>; -def PSRLDQri : PDIi8<0x73, MRM3r, (ops VR128:$dst, VR128:$src1, i32i8imm:$src2), - "psrldq {$src2, $dst|$dst, $src2}", []>; -// PSRADQri doesn't exist in SSE[1-3]. + def PSLLDQri : PDIi8<0x73, MRM7r, + (ops VR128:$dst, VR128:$src1, i32i8imm:$src2), + "pslldq {$src2, $dst|$dst, $src2}", []>; + def PSRLDQri : PDIi8<0x73, MRM3r, + (ops VR128:$dst, VR128:$src1, i32i8imm:$src2), + "psrldq {$src2, $dst|$dst, $src2}", []>; + // PSRADQri doesn't exist in SSE[1-3]. } let Predicates = [HasSSE2] in { @@ -1416,24 +1570,26 @@ defm PXOR : PDI_binop_rm_v2i64<0xEF, "pxor", xor, 1>; let isTwoAddress = 1 in { -def PANDNrr : PDI<0xDF, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), - "pandn {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v2i64 (and (vnot VR128:$src1), - VR128:$src2)))]>; - -def PANDNrm : PDI<0xDF, MRMSrcMem, (ops VR128:$dst, VR128:$src1, i128mem:$src2), - "pandn {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (v2i64 (and (vnot VR128:$src1), - (load addr:$src2))))]>; + def PANDNrr : PDI<0xDF, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "pandn {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (v2i64 (and (vnot VR128:$src1), + VR128:$src2)))]>; + + def PANDNrm : PDI<0xDF, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, i128mem:$src2), + "pandn {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (v2i64 (and (vnot VR128:$src1), + (load addr:$src2))))]>; } // SSE2 Integer comparison -defm PCMPEQB : PDI_binop_rm_int<0x74, "pcmpeqb", int_x86_sse2_pcmpeq_b>; -defm PCMPEQW : PDI_binop_rm_int<0x75, "pcmpeqw", int_x86_sse2_pcmpeq_w>; -defm PCMPEQD : PDI_binop_rm_int<0x76, "pcmpeqd", int_x86_sse2_pcmpeq_d>; -defm PCMPGTB : PDI_binop_rm_int<0x64, "pcmpgtb", int_x86_sse2_pcmpgt_b>; -defm PCMPGTW : PDI_binop_rm_int<0x65, "pcmpgtw", int_x86_sse2_pcmpgt_w>; -defm PCMPGTD : PDI_binop_rm_int<0x66, "pcmpgtd", int_x86_sse2_pcmpgt_d>; +defm PCMPEQB : PDI_binop_rm_int<0x74, "pcmpeqb", int_x86_sse2_pcmpeq_b>; +defm PCMPEQW : PDI_binop_rm_int<0x75, "pcmpeqw", int_x86_sse2_pcmpeq_w>; +defm PCMPEQD : PDI_binop_rm_int<0x76, "pcmpeqd", int_x86_sse2_pcmpeq_d>; +defm PCMPGTB : PDI_binop_rm_int<0x64, "pcmpgtb", int_x86_sse2_pcmpgt_b>; +defm PCMPGTW : PDI_binop_rm_int<0x65, "pcmpgtw", int_x86_sse2_pcmpgt_w>; +defm PCMPGTD : PDI_binop_rm_int<0x66, "pcmpgtd", int_x86_sse2_pcmpgt_d>; // Pack instructions defm PACKSSWB : PDI_binop_rm_int<0x63, "packsswb", int_x86_sse2_packsswb_128>; @@ -1489,112 +1645,113 @@ PSHUFLW_shuffle_mask:$src2)))]>, XD, Requires<[HasSSE2]>; -let isTwoAddress = 1 in { -def PUNPCKLBWrr : PDI<0x60, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "punpcklbw {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v16i8 (vector_shuffle VR128:$src1, VR128:$src2, - UNPCKL_shuffle_mask)))]>; -def PUNPCKLBWrm : PDI<0x60, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, i128mem:$src2), - "punpcklbw {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v16i8 (vector_shuffle VR128:$src1, - (bc_v16i8 (loadv2i64 addr:$src2)), - UNPCKL_shuffle_mask)))]>; -def PUNPCKLWDrr : PDI<0x61, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "punpcklwd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v8i16 (vector_shuffle VR128:$src1, VR128:$src2, - UNPCKL_shuffle_mask)))]>; -def PUNPCKLWDrm : PDI<0x61, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, i128mem:$src2), - "punpcklwd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v8i16 (vector_shuffle VR128:$src1, - (bc_v8i16 (loadv2i64 addr:$src2)), - UNPCKL_shuffle_mask)))]>; -def PUNPCKLDQrr : PDI<0x62, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "punpckldq {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4i32 (vector_shuffle VR128:$src1, VR128:$src2, - UNPCKL_shuffle_mask)))]>; -def PUNPCKLDQrm : PDI<0x62, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, i128mem:$src2), - "punpckldq {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4i32 (vector_shuffle VR128:$src1, - (bc_v4i32 (loadv2i64 addr:$src2)), - UNPCKL_shuffle_mask)))]>; -def PUNPCKLQDQrr : PDI<0x6C, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "punpcklqdq {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2i64 (vector_shuffle VR128:$src1, VR128:$src2, - UNPCKL_shuffle_mask)))]>; -def PUNPCKLQDQrm : PDI<0x6C, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, i128mem:$src2), - "punpcklqdq {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2i64 (vector_shuffle VR128:$src1, - (loadv2i64 addr:$src2), - UNPCKL_shuffle_mask)))]>; -def PUNPCKHBWrr : PDI<0x68, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "punpckhbw {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v16i8 (vector_shuffle VR128:$src1, VR128:$src2, - UNPCKH_shuffle_mask)))]>; -def PUNPCKHBWrm : PDI<0x68, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, i128mem:$src2), - "punpckhbw {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v16i8 (vector_shuffle VR128:$src1, - (bc_v16i8 (loadv2i64 addr:$src2)), - UNPCKH_shuffle_mask)))]>; -def PUNPCKHWDrr : PDI<0x69, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "punpckhwd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v8i16 (vector_shuffle VR128:$src1, VR128:$src2, - UNPCKH_shuffle_mask)))]>; -def PUNPCKHWDrm : PDI<0x69, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, i128mem:$src2), - "punpckhwd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v8i16 (vector_shuffle VR128:$src1, - (bc_v8i16 (loadv2i64 addr:$src2)), - UNPCKH_shuffle_mask)))]>; -def PUNPCKHDQrr : PDI<0x6A, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "punpckhdq {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4i32 (vector_shuffle VR128:$src1, VR128:$src2, - UNPCKH_shuffle_mask)))]>; -def PUNPCKHDQrm : PDI<0x6A, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, i128mem:$src2), - "punpckhdq {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4i32 (vector_shuffle VR128:$src1, - (bc_v4i32 (loadv2i64 addr:$src2)), - UNPCKH_shuffle_mask)))]>; -def PUNPCKHQDQrr : PDI<0x6D, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, VR128:$src2), - "punpckhqdq {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2i64 (vector_shuffle VR128:$src1, VR128:$src2, - UNPCKH_shuffle_mask)))]>; -def PUNPCKHQDQrm : PDI<0x6D, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, i128mem:$src2), - "punpckhqdq {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2i64 (vector_shuffle VR128:$src1, - (loadv2i64 addr:$src2), - UNPCKH_shuffle_mask)))]>; +let isTwoAddress = 1 in { + def PUNPCKLBWrr : PDI<0x60, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "punpcklbw {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v16i8 (vector_shuffle VR128:$src1, VR128:$src2, + UNPCKL_shuffle_mask)))]>; + def PUNPCKLBWrm : PDI<0x60, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, i128mem:$src2), + "punpcklbw {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v16i8 (vector_shuffle VR128:$src1, + (bc_v16i8 (loadv2i64 addr:$src2)), + UNPCKL_shuffle_mask)))]>; + def PUNPCKLWDrr : PDI<0x61, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "punpcklwd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v8i16 (vector_shuffle VR128:$src1, VR128:$src2, + UNPCKL_shuffle_mask)))]>; + def PUNPCKLWDrm : PDI<0x61, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, i128mem:$src2), + "punpcklwd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v8i16 (vector_shuffle VR128:$src1, + (bc_v8i16 (loadv2i64 addr:$src2)), + UNPCKL_shuffle_mask)))]>; + def PUNPCKLDQrr : PDI<0x62, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "punpckldq {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4i32 (vector_shuffle VR128:$src1, VR128:$src2, + UNPCKL_shuffle_mask)))]>; + def PUNPCKLDQrm : PDI<0x62, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, i128mem:$src2), + "punpckldq {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4i32 (vector_shuffle VR128:$src1, + (bc_v4i32 (loadv2i64 addr:$src2)), + UNPCKL_shuffle_mask)))]>; + def PUNPCKLQDQrr : PDI<0x6C, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "punpcklqdq {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2i64 (vector_shuffle VR128:$src1, VR128:$src2, + UNPCKL_shuffle_mask)))]>; + def PUNPCKLQDQrm : PDI<0x6C, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, i128mem:$src2), + "punpcklqdq {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2i64 (vector_shuffle VR128:$src1, + (loadv2i64 addr:$src2), + UNPCKL_shuffle_mask)))]>; + + def PUNPCKHBWrr : PDI<0x68, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "punpckhbw {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v16i8 (vector_shuffle VR128:$src1, VR128:$src2, + UNPCKH_shuffle_mask)))]>; + def PUNPCKHBWrm : PDI<0x68, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, i128mem:$src2), + "punpckhbw {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v16i8 (vector_shuffle VR128:$src1, + (bc_v16i8 (loadv2i64 addr:$src2)), + UNPCKH_shuffle_mask)))]>; + def PUNPCKHWDrr : PDI<0x69, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "punpckhwd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v8i16 (vector_shuffle VR128:$src1, VR128:$src2, + UNPCKH_shuffle_mask)))]>; + def PUNPCKHWDrm : PDI<0x69, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, i128mem:$src2), + "punpckhwd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v8i16 (vector_shuffle VR128:$src1, + (bc_v8i16 (loadv2i64 addr:$src2)), + UNPCKH_shuffle_mask)))]>; + def PUNPCKHDQrr : PDI<0x6A, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "punpckhdq {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4i32 (vector_shuffle VR128:$src1, VR128:$src2, + UNPCKH_shuffle_mask)))]>; + def PUNPCKHDQrm : PDI<0x6A, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, i128mem:$src2), + "punpckhdq {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4i32 (vector_shuffle VR128:$src1, + (bc_v4i32 (loadv2i64 addr:$src2)), + UNPCKH_shuffle_mask)))]>; + def PUNPCKHQDQrr : PDI<0x6D, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "punpckhqdq {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2i64 (vector_shuffle VR128:$src1, VR128:$src2, + UNPCKH_shuffle_mask)))]>; + def PUNPCKHQDQrm : PDI<0x6D, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, i128mem:$src2), + "punpckhqdq {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2i64 (vector_shuffle VR128:$src1, + (loadv2i64 addr:$src2), + UNPCKH_shuffle_mask)))]>; } // Extract / Insert @@ -1604,32 +1761,24 @@ [(set GR32:$dst, (X86pextrw (v8i16 VR128:$src1), (iPTR imm:$src2)))]>; let isTwoAddress = 1 in { -def PINSRWrri : PDIi8<0xC4, MRMSrcReg, - (ops VR128:$dst, VR128:$src1, GR32:$src2, i32i8imm:$src3), - "pinsrw {$src3, $src2, $dst|$dst, $src2, $src3}", - [(set VR128:$dst, (v8i16 (X86pinsrw (v8i16 VR128:$src1), - GR32:$src2, (iPTR imm:$src3))))]>; -def PINSRWrmi : PDIi8<0xC4, MRMSrcMem, - (ops VR128:$dst, VR128:$src1, i16mem:$src2, i32i8imm:$src3), - "pinsrw {$src3, $src2, $dst|$dst, $src2, $src3}", - [(set VR128:$dst, - (v8i16 (X86pinsrw (v8i16 VR128:$src1), - (i32 (anyext (loadi16 addr:$src2))), - (iPTR imm:$src3))))]>; + def PINSRWrri : PDIi8<0xC4, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, + GR32:$src2, i32i8imm:$src3), + "pinsrw {$src3, $src2, $dst|$dst, $src2, $src3}", + [(set VR128:$dst, + (v8i16 (X86pinsrw (v8i16 VR128:$src1), + GR32:$src2, (iPTR imm:$src3))))]>; + def PINSRWrmi : PDIi8<0xC4, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, + i16mem:$src2, i32i8imm:$src3), + "pinsrw {$src3, $src2, $dst|$dst, $src2, $src3}", + [(set VR128:$dst, + (v8i16 (X86pinsrw (v8i16 VR128:$src1), + (i32 (anyext (loadi16 addr:$src2))), + (iPTR imm:$src3))))]>; } -//===----------------------------------------------------------------------===// -// Miscellaneous Instructions -//===----------------------------------------------------------------------===// - // Mask creation -def MOVMSKPSrr : PSI<0x50, MRMSrcReg, (ops GR32:$dst, VR128:$src), - "movmskps {$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse_movmsk_ps VR128:$src))]>; -def MOVMSKPDrr : PSI<0x50, MRMSrcReg, (ops GR32:$dst, VR128:$src), - "movmskpd {$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse2_movmsk_pd VR128:$src))]>; - def PMOVMSKBrr : PDI<0xD7, MRMSrcReg, (ops GR32:$dst, VR128:$src), "pmovmskb {$src, $dst|$dst, $src}", [(set GR32:$dst, (int_x86_sse2_pmovmskb_128 VR128:$src))]>; @@ -1640,17 +1789,7 @@ [(int_x86_sse2_maskmov_dqu VR128:$src, VR128:$mask, EDI)]>, Imp<[EDI],[]>; -// Prefetching loads. -// TODO: no intrinsics for these? -def PREFETCHT0 : PSI<0x18, MRM1m, (ops i8mem:$src), "prefetcht0 $src", []>; -def PREFETCHT1 : PSI<0x18, MRM2m, (ops i8mem:$src), "prefetcht1 $src", []>; -def PREFETCHT2 : PSI<0x18, MRM3m, (ops i8mem:$src), "prefetcht2 $src", []>; -def PREFETCHNTA : PSI<0x18, MRM0m, (ops i8mem:$src), "prefetchnta $src", []>; - // Non-temporal stores -def MOVNTPSmr : PSI<0x2B, MRMDestMem, (ops i128mem:$dst, VR128:$src), - "movntps {$src, $dst|$dst, $src}", - [(int_x86_sse_movnt_ps addr:$dst, VR128:$src)]>; def MOVNTPDmr : PDI<0x2B, MRMDestMem, (ops i128mem:$dst, VR128:$src), "movntpd {$src, $dst|$dst, $src}", [(int_x86_sse2_movnt_pd addr:$dst, VR128:$src)]>; @@ -1668,49 +1807,20 @@ TB, Requires<[HasSSE2]>; // Load, store, and memory fence -def SFENCE : PSI<0xAE, MRM7m, (ops), "sfence", [(int_x86_sse_sfence)]>; def LFENCE : I<0xAE, MRM5m, (ops), "lfence", [(int_x86_sse2_lfence)]>, TB, Requires<[HasSSE2]>; def MFENCE : I<0xAE, MRM6m, (ops), "mfence", [(int_x86_sse2_mfence)]>, TB, Requires<[HasSSE2]>; -// MXCSR register -def LDMXCSR : PSI<0xAE, MRM2m, (ops i32mem:$src), - "ldmxcsr $src", [(int_x86_sse_ldmxcsr addr:$src)]>; -def STMXCSR : PSI<0xAE, MRM3m, (ops i32mem:$dst), - "stmxcsr $dst", [(int_x86_sse_stmxcsr addr:$dst)]>; - -// Thread synchronization -def MONITOR : I<0xC8, RawFrm, (ops), "monitor", - [(int_x86_sse3_monitor EAX, ECX, EDX)]>,TB, Requires<[HasSSE3]>; -def MWAIT : I<0xC9, RawFrm, (ops), "mwait", - [(int_x86_sse3_mwait ECX, EAX)]>, TB, Requires<[HasSSE3]>; - -//===----------------------------------------------------------------------===// -// Alias Instructions -//===----------------------------------------------------------------------===// // Alias instructions that map zero vector to pxor / xorp* for sse. // FIXME: remove when we can teach regalloc that xor reg, reg is ok. -let isReMaterializable = 1 in { -def V_SET0 : PSI<0x57, MRMInitReg, (ops VR128:$dst), - "xorps $dst, $dst", - [(set VR128:$dst, (v4f32 immAllZerosV))]>; - -def V_SETALLONES : PDI<0x76, MRMInitReg, (ops VR128:$dst), - "pcmpeqd $dst, $dst", - [(set VR128:$dst, (v2f64 immAllOnesV))]>; -} +let isReMaterializable = 1 in + def V_SETALLONES : PDI<0x76, MRMInitReg, (ops VR128:$dst), + "pcmpeqd $dst, $dst", + [(set VR128:$dst, (v2f64 immAllOnesV))]>; -// FR32 / FR64 to 128-bit vector conversion. -def MOVSS2PSrr : SSI<0x10, MRMSrcReg, (ops VR128:$dst, FR32:$src), - "movss {$src, $dst|$dst, $src}", - [(set VR128:$dst, - (v4f32 (scalar_to_vector FR32:$src)))]>; -def MOVSS2PSrm : SSI<0x10, MRMSrcMem, (ops VR128:$dst, f32mem:$src), - "movss {$src, $dst|$dst, $src}", - [(set VR128:$dst, - (v4f32 (scalar_to_vector (loadf32 addr:$src))))]>; +// FR64 to 128-bit vector conversion. def MOVSD2PDrr : SDI<0x10, MRMSrcReg, (ops VR128:$dst, FR64:$src), "movsd {$src, $dst|$dst, $src}", [(set VR128:$dst, @@ -1753,14 +1863,6 @@ // like this: // def : Pat<(f32 (vector_extract (v4f32 VR128:$src), (iPTR 0))), // (f32 FR32:$src)>; -def MOVPS2SSrr : SSI<0x10, MRMSrcReg, (ops FR32:$dst, VR128:$src), - "movss {$src, $dst|$dst, $src}", - [(set FR32:$dst, (vector_extract (v4f32 VR128:$src), - (iPTR 0)))]>; -def MOVPS2SSmr : SSI<0x11, MRMDestMem, (ops f32mem:$dst, VR128:$src), - "movss {$src, $dst|$dst, $src}", - [(store (f32 (vector_extract (v4f32 VR128:$src), - (iPTR 0))), addr:$dst)]>; def MOVPD2SDrr : SDI<0x10, MRMSrcReg, (ops FR64:$dst, VR128:$src), "movsd {$src, $dst|$dst, $src}", [(set FR64:$dst, (vector_extract (v2f64 VR128:$src), @@ -1789,23 +1891,17 @@ // Move to lower bits of a VR128, leaving upper bits alone. // Three operand (but two address) aliases. let isTwoAddress = 1 in { -def MOVLSS2PSrr : SSI<0x10, MRMSrcReg, (ops VR128:$dst, VR128:$src1, FR32:$src2), - "movss {$src2, $dst|$dst, $src2}", []>; -def MOVLSD2PDrr : SDI<0x10, MRMSrcReg, (ops VR128:$dst, VR128:$src1, FR64:$src2), - "movsd {$src2, $dst|$dst, $src2}", []>; + def MOVLSD2PDrr : SDI<0x10, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, FR64:$src2), + "movsd {$src2, $dst|$dst, $src2}", []>; -let AddedComplexity = 15 in { -def MOVLPSrr : SSI<0x10, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), - "movss {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4f32 (vector_shuffle VR128:$src1, VR128:$src2, - MOVL_shuffle_mask)))]>; -def MOVLPDrr : SDI<0x10, MRMSrcReg, (ops VR128:$dst, VR128:$src1, VR128:$src2), - "movsd {$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2f64 (vector_shuffle VR128:$src1, VR128:$src2, - MOVL_shuffle_mask)))]>; -} + let AddedComplexity = 15 in + def MOVLPDrr : SDI<0x10, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "movsd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2f64 (vector_shuffle VR128:$src1, VR128:$src2, + MOVL_shuffle_mask)))]>; } // Store / copy lower 64-bits of a XMM register. @@ -1815,31 +1911,31 @@ // Move to lower bits of a VR128 and zeroing upper bits. // Loading from memory automatically zeroing upper bits. -let AddedComplexity = 20 in { -def MOVZSS2PSrm : SSI<0x10, MRMSrcMem, (ops VR128:$dst, f32mem:$src), - "movss {$src, $dst|$dst, $src}", - [(set VR128:$dst, (v4f32 (vector_shuffle immAllZerosV, - (v4f32 (scalar_to_vector (loadf32 addr:$src))), - MOVL_shuffle_mask)))]>; -def MOVZSD2PDrm : SDI<0x10, MRMSrcMem, (ops VR128:$dst, f64mem:$src), - "movsd {$src, $dst|$dst, $src}", - [(set VR128:$dst, (v2f64 (vector_shuffle immAllZerosV, - (v2f64 (scalar_to_vector (loadf64 addr:$src))), - MOVL_shuffle_mask)))]>; -} +let AddedComplexity = 20 in + def MOVZSD2PDrm : SDI<0x10, MRMSrcMem, (ops VR128:$dst, f64mem:$src), + "movsd {$src, $dst|$dst, $src}", + [(set VR128:$dst, + (v2f64 (vector_shuffle immAllZerosV, + (v2f64 (scalar_to_vector + (loadf64 addr:$src))), + MOVL_shuffle_mask)))]>; + let AddedComplexity = 15 in // movd / movq to XMM register zero-extends def MOVZDI2PDIrr : PDI<0x6E, MRMSrcReg, (ops VR128:$dst, GR32:$src), "movd {$src, $dst|$dst, $src}", - [(set VR128:$dst, (v4i32 (vector_shuffle immAllZerosV, - (v4i32 (scalar_to_vector GR32:$src)), - MOVL_shuffle_mask)))]>; + [(set VR128:$dst, + (v4i32 (vector_shuffle immAllZerosV, + (v4i32 (scalar_to_vector GR32:$src)), + MOVL_shuffle_mask)))]>; let AddedComplexity = 20 in def MOVZDI2PDIrm : PDI<0x6E, MRMSrcMem, (ops VR128:$dst, i32mem:$src), "movd {$src, $dst|$dst, $src}", - [(set VR128:$dst, (v4i32 (vector_shuffle immAllZerosV, + [(set VR128:$dst, + (v4i32 (vector_shuffle immAllZerosV, (v4i32 (scalar_to_vector (loadi32 addr:$src))), - MOVL_shuffle_mask)))]>; + MOVL_shuffle_mask)))]>; + // Moving from XMM to XMM but still clear upper 64 bits. let AddedComplexity = 15 in def MOVZQI2PQIrr : I<0x7E, MRMSrcReg, (ops VR128:$dst, VR128:$src), @@ -1849,10 +1945,181 @@ let AddedComplexity = 20 in def MOVZQI2PQIrm : I<0x7E, MRMSrcMem, (ops VR128:$dst, i64mem:$src), "movq {$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse2_movl_dq - (bitconvert (loadv2i64 addr:$src))))]>, + [(set VR128:$dst, (int_x86_sse2_movl_dq + (bitconvert (loadv2i64 addr:$src))))]>, XS, Requires<[HasSSE2]>; + +//===----------------------------------------------------------------------===// +// SSE3 Instructions +//===----------------------------------------------------------------------===// + +// SSE3 Instruction Templates: +// +// S3I - SSE3 instructions with TB and OpSize prefixes. +// S3SI - SSE3 instructions with XS prefix. +// S3DI - SSE3 instructions with XD prefix. + +class S3SI o, Format F, dag ops, string asm, list pattern> + : I, XS, Requires<[HasSSE3]>; +class S3DI o, Format F, dag ops, string asm, list pattern> + : I, XD, Requires<[HasSSE3]>; +class S3I o, Format F, dag ops, string asm, list pattern> + : I, TB, OpSize, Requires<[HasSSE3]>; + +// Move Instructions +def MOVSHDUPrr : S3SI<0x16, MRMSrcReg, (ops VR128:$dst, VR128:$src), + "movshdup {$src, $dst|$dst, $src}", + [(set VR128:$dst, (v4f32 (vector_shuffle + VR128:$src, (undef), + MOVSHDUP_shuffle_mask)))]>; +def MOVSHDUPrm : S3SI<0x16, MRMSrcMem, (ops VR128:$dst, f128mem:$src), + "movshdup {$src, $dst|$dst, $src}", + [(set VR128:$dst, (v4f32 (vector_shuffle + (loadv4f32 addr:$src), (undef), + MOVSHDUP_shuffle_mask)))]>; + +def MOVSLDUPrr : S3SI<0x12, MRMSrcReg, (ops VR128:$dst, VR128:$src), + "movsldup {$src, $dst|$dst, $src}", + [(set VR128:$dst, (v4f32 (vector_shuffle + VR128:$src, (undef), + MOVSLDUP_shuffle_mask)))]>; +def MOVSLDUPrm : S3SI<0x12, MRMSrcMem, (ops VR128:$dst, f128mem:$src), + "movsldup {$src, $dst|$dst, $src}", + [(set VR128:$dst, (v4f32 (vector_shuffle + (loadv4f32 addr:$src), (undef), + MOVSLDUP_shuffle_mask)))]>; + +def MOVDDUPrr : S3DI<0x12, MRMSrcReg, (ops VR128:$dst, VR128:$src), + "movddup {$src, $dst|$dst, $src}", + [(set VR128:$dst, (v2f64 (vector_shuffle + VR128:$src, (undef), + SSE_splat_lo_mask)))]>; +def MOVDDUPrm : S3DI<0x12, MRMSrcMem, (ops VR128:$dst, f64mem:$src), + "movddup {$src, $dst|$dst, $src}", + [(set VR128:$dst, + (v2f64 (vector_shuffle + (scalar_to_vector (loadf64 addr:$src)), + (undef), + SSE_splat_lo_mask)))]>; + +// Arithmetic +let isTwoAddress = 1 in { + def ADDSUBPSrr : S3DI<0xD0, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "addsubps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (int_x86_sse3_addsub_ps VR128:$src1, + VR128:$src2))]>; + def ADDSUBPSrm : S3DI<0xD0, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src2), + "addsubps {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (int_x86_sse3_addsub_ps VR128:$src1, + (load addr:$src2)))]>; + def ADDSUBPDrr : S3I<0xD0, MRMSrcReg, + (ops VR128:$dst, VR128:$src1, VR128:$src2), + "addsubpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (int_x86_sse3_addsub_pd VR128:$src1, + VR128:$src2))]>; + def ADDSUBPDrm : S3I<0xD0, MRMSrcMem, + (ops VR128:$dst, VR128:$src1, f128mem:$src2), + "addsubpd {$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (int_x86_sse3_addsub_pd VR128:$src1, + (load addr:$src2)))]>; +} + +def LDDQUrm : S3DI<0xF0, MRMSrcMem, (ops VR128:$dst, i128mem:$src), + "lddqu {$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse3_ldu_dq addr:$src))]>; + +// Horizontal ops +class S3D_Intrr o, string OpcodeStr, Intrinsic IntId> + : S3DI; +class S3D_Intrm o, string OpcodeStr, Intrinsic IntId> + : S3DI; +class S3_Intrr o, string OpcodeStr, Intrinsic IntId> + : S3I; +class S3_Intrm o, string OpcodeStr, Intrinsic IntId> + : S3I; + +let isTwoAddress = 1 in { + def HADDPSrr : S3D_Intrr<0x7C, "haddps", int_x86_sse3_hadd_ps>; + def HADDPSrm : S3D_Intrm<0x7C, "haddps", int_x86_sse3_hadd_ps>; + def HADDPDrr : S3_Intrr <0x7C, "haddpd", int_x86_sse3_hadd_pd>; + def HADDPDrm : S3_Intrm <0x7C, "haddpd", int_x86_sse3_hadd_pd>; + def HSUBPSrr : S3D_Intrr<0x7D, "hsubps", int_x86_sse3_hsub_ps>; + def HSUBPSrm : S3D_Intrm<0x7D, "hsubps", int_x86_sse3_hsub_ps>; + def HSUBPDrr : S3_Intrr <0x7D, "hsubpd", int_x86_sse3_hsub_pd>; + def HSUBPDrm : S3_Intrm <0x7D, "hsubpd", int_x86_sse3_hsub_pd>; +} + +// Thread synchronization +def MONITOR : I<0xC8, RawFrm, (ops), "monitor", + [(int_x86_sse3_monitor EAX, ECX, EDX)]>,TB, Requires<[HasSSE3]>; +def MWAIT : I<0xC9, RawFrm, (ops), "mwait", + [(int_x86_sse3_mwait ECX, EAX)]>, TB, Requires<[HasSSE3]>; + +// vector_shuffle v1, <1, 1, 3, 3> +let AddedComplexity = 15 in +def : Pat<(v4i32 (vector_shuffle VR128:$src, (undef), + MOVSHDUP_shuffle_mask)), + (MOVSHDUPrr VR128:$src)>, Requires<[HasSSE3]>; +let AddedComplexity = 20 in +def : Pat<(v4i32 (vector_shuffle (bc_v4i32 (loadv2i64 addr:$src)), (undef), + MOVSHDUP_shuffle_mask)), + (MOVSHDUPrm addr:$src)>, Requires<[HasSSE3]>; + +// vector_shuffle v1, <0, 0, 2, 2> +let AddedComplexity = 15 in + def : Pat<(v4i32 (vector_shuffle VR128:$src, (undef), + MOVSLDUP_shuffle_mask)), + (MOVSLDUPrr VR128:$src)>, Requires<[HasSSE3]>; +let AddedComplexity = 20 in + def : Pat<(v4i32 (vector_shuffle (bc_v4i32 (loadv2i64 addr:$src)), (undef), + MOVSLDUP_shuffle_mask)), + (MOVSLDUPrm addr:$src)>, Requires<[HasSSE3]>; + +//===----------------------------------------------------------------------===// +// SSSE3 Instructions +//===----------------------------------------------------------------------===// + +// SSE3 Instruction Templates: +// +// SS38I - SSSE3 instructions with T8 and OpSize prefixes. +// SS3AI - SSSE3 instructions with TA and OpSize prefixes. + +class SS38I o, Format F, dag ops, string asm, list pattern> + : I, T8, OpSize, Requires<[HasSSSE3]>; +class SS3AI o, Format F, dag ops, string asm, list pattern> + : I, TA, OpSize, Requires<[HasSSSE3]>; + +/// SS3I_binop_rm_int - Simple SSSE3 binary operatr whose type is v2i64. +let isTwoAddress = 1 in { + multiclass SS3I_binop_rm_int opc, string OpcodeStr, Intrinsic IntId, + bit Commutable = 0> { + def rr : SS38I { + let isCommutable = Commutable; + } + def rm : SS38I; + } +} + +defm PMULHRSW128 : SS3I_binop_rm_int<0x0B, "pmulhrsw", + int_x86_ssse3_pmulhrsw_128, 1>; + //===----------------------------------------------------------------------===// // Non-Instruction Patterns //===----------------------------------------------------------------------===// @@ -1999,26 +2266,6 @@ (PUNPCKLDQrr VR128:$src, VR128:$src)>, Requires<[HasSSE1]>; } -let AddedComplexity = 15 in -// vector_shuffle v1, <1, 1, 3, 3> -def : Pat<(v4i32 (vector_shuffle VR128:$src, (undef), - MOVSHDUP_shuffle_mask)), - (MOVSHDUPrr VR128:$src)>, Requires<[HasSSE3]>; -let AddedComplexity = 20 in -def : Pat<(v4i32 (vector_shuffle (bc_v4i32 (loadv2i64 addr:$src)), (undef), - MOVSHDUP_shuffle_mask)), - (MOVSHDUPrm addr:$src)>, Requires<[HasSSE3]>; - -// vector_shuffle v1, <0, 0, 2, 2> -let AddedComplexity = 15 in -def : Pat<(v4i32 (vector_shuffle VR128:$src, (undef), - MOVSLDUP_shuffle_mask)), - (MOVSLDUPrr VR128:$src)>, Requires<[HasSSE3]>; -let AddedComplexity = 20 in -def : Pat<(v4i32 (vector_shuffle (bc_v4i32 (loadv2i64 addr:$src)), (undef), - MOVSLDUP_shuffle_mask)), - (MOVSLDUPrm addr:$src)>, Requires<[HasSSE3]>; - let AddedComplexity = 15 in { // vector_shuffle v1, v2 <0, 1, 4, 5> using MOVLHPS def : Pat<(v4i32 (vector_shuffle VR128:$src1, VR128:$src2, From sabre at nondot.org Wed May 2 19:16:27 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 2 May 2007 19:16:27 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetOptions.h Message-ID: <200705030016.l430GR9e028596@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetOptions.h updated: 1.14 -> 1.15 --- Log message: Add a new option. --- Diffs of the changes: (+16 -0) TargetOptions.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) Index: llvm/include/llvm/Target/TargetOptions.h diff -u llvm/include/llvm/Target/TargetOptions.h:1.14 llvm/include/llvm/Target/TargetOptions.h:1.15 --- llvm/include/llvm/Target/TargetOptions.h:1.14 Mon Jan 29 14:48:32 2007 +++ llvm/include/llvm/Target/TargetOptions.h Wed May 2 19:16:07 2007 @@ -49,6 +49,22 @@ extern bool FiniteOnlyFPMathOption; extern bool FiniteOnlyFPMath(); + /// HonorSignDependentRoundingFPMath - This returns true when the + /// -enable-sign-dependent-rounding-fp-math is specified. If this returns + /// false (the default), the code generator is allowed to assume that the + /// rounding behavior is the default (round-to-zero for all floating point to + /// integer conversions, and round-to-nearest for all other arithmetic + /// truncations). If this is enabled (set to true), the code generator must + /// assume that the rounding mode may dynamically change. + extern bool HonorSignDependentRoundingFPMathOption; + extern bool HonorSignDependentRoundingFPMath(); + + /// option is specified on the command line. If this returns false (default), + /// the code generator is not allowed to assume that FP arithmetic arguments + /// and results are never NaNs or +-Infs. + extern bool FiniteOnlyFPMathOption; + extern bool FiniteOnlyFPMath(); + /// UseSoftFloat - This flag is enabled when the -soft-float flag is specified /// on the command line. When this flag is on, the code generator will /// generate libcalls to the software floating point library instead of From sabre at nondot.org Wed May 2 19:16:30 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 2 May 2007 19:16:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetMachine.cpp Message-ID: <200705030016.l430GUE8028601@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetMachine.cpp updated: 1.62 -> 1.63 --- Log message: Add a new option. --- Diffs of the changes: (+17 -4) TargetMachine.cpp | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-) Index: llvm/lib/Target/TargetMachine.cpp diff -u llvm/lib/Target/TargetMachine.cpp:1.62 llvm/lib/Target/TargetMachine.cpp:1.63 --- llvm/lib/Target/TargetMachine.cpp:1.62 Thu Apr 19 13:42:38 2007 +++ llvm/lib/Target/TargetMachine.cpp Wed May 2 19:16:07 2007 @@ -54,20 +54,27 @@ cl::location(UnsafeFPMath), cl::init(false)); cl::opt - EnableFiniteOnltFPMath("enable-finite-only-fp-math", + EnableFiniteOnlyFPMath("enable-finite-only-fp-math", cl::desc("Enable optimizations that assumes non- NaNs / +-Infs"), cl::location(FiniteOnlyFPMathOption), cl::init(false)); cl::opt + EnableHonorSignDependentRoundingFPMath(cl::Hidden, + "enable-sign-dependent-rounding-fp-math", + cl::desc("Force codegen to assume rounding mode can change dynamically"), + cl::location(HonorSignDependentRoundingFPMathOption), + cl::init(false)); + + cl::opt GenerateSoftFloatCalls("soft-float", cl::desc("Generate software floating point library calls"), cl::location(UseSoftFloat), cl::init(false)); cl::opt DontPlaceZerosInBSS("nozero-initialized-in-bss", - cl::desc("Don't place zero-initialized symbols into bss section"), - cl::location(NoZerosInBSS), - cl::init(false)); + cl::desc("Don't place zero-initialized symbols into bss section"), + cl::location(NoZerosInBSS), + cl::init(false)); cl::opt EnableExceptionHandling("enable-eh", cl::desc("Exception handling should be emitted."), @@ -146,5 +153,11 @@ /// the code generator is not allowed to assume that FP arithmetic arguments /// and results are never NaNs or +-Infs. bool FiniteOnlyFPMath() { return UnsafeFPMath || FiniteOnlyFPMathOption; } + + /// HonorSignDependentRoundingFPMath - Return true if the codegen must assume + /// that the rounding mode of the FPU can change from its default. + bool HonorSignDependentRoundingFPMath() { + return !UnsafeFPMath && HonorSignDependentRoundingFPMathOption; + } } From sabre at nondot.org Wed May 2 19:27:29 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 2 May 2007 19:27:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetMachine.cpp Target.td Message-ID: <200705030027.l430RTKM028938@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetMachine.cpp updated: 1.63 -> 1.64 Target.td updated: 1.97 -> 1.98 --- Log message: expose HonorSignDependentRoundingFPMathOption to .td files --- Diffs of the changes: (+6 -0) Target.td | 5 +++++ TargetMachine.cpp | 1 + 2 files changed, 6 insertions(+) Index: llvm/lib/Target/TargetMachine.cpp diff -u llvm/lib/Target/TargetMachine.cpp:1.63 llvm/lib/Target/TargetMachine.cpp:1.64 --- llvm/lib/Target/TargetMachine.cpp:1.63 Wed May 2 19:16:07 2007 +++ llvm/lib/Target/TargetMachine.cpp Wed May 2 19:27:11 2007 @@ -27,6 +27,7 @@ bool NoExcessFPPrecision; bool UnsafeFPMath; bool FiniteOnlyFPMathOption; + bool HonorSignDependentRoundingFPMathOption; bool UseSoftFloat; bool NoZerosInBSS; bool ExceptionHandling; Index: llvm/lib/Target/Target.td diff -u llvm/lib/Target/Target.td:1.97 llvm/lib/Target/Target.td:1.98 --- llvm/lib/Target/Target.td:1.97 Tue May 1 00:57:02 2007 +++ llvm/lib/Target/Target.td Wed May 2 19:27:11 2007 @@ -210,6 +210,11 @@ string CondString = cond; } +/// NoHonorSignDependentRounding - This predicate is true if support for +/// sign-dependent-rounding is not enabled. +def NoHonorSignDependentRounding + : Predicate<"!HonorSignDependentRoundingFPMath()">; + class Requires preds> { list Predicates = preds; } From sabre at nondot.org Wed May 2 19:31:57 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 2 May 2007 19:31:57 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/fnmul.ll Message-ID: <200705030031.l430Vvxq029096@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: fnmul.ll added (r1.1) --- Log message: match a reassociated form of fnmul --- Diffs of the changes: (+11 -0) fnmul.ll | 11 +++++++++++ 1 files changed, 11 insertions(+) Index: llvm/test/CodeGen/ARM/fnmul.ll diff -c /dev/null llvm/test/CodeGen/ARM/fnmul.ll:1.1 *** /dev/null Wed May 2 19:31:50 2007 --- llvm/test/CodeGen/ARM/fnmul.ll Wed May 2 19:31:40 2007 *************** *** 0 **** --- 1,11 ---- + ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | grep fnmuld + ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 -enable-sign-dependent-rounding-fp-math | grep fmul + + + define double @t1(double %a, double %b) { + entry: + %tmp2 = sub double -0.000000e+00, %a ; [#uses=1] + %tmp4 = mul double %tmp2, %b ; [#uses=1] + ret double %tmp4 + } + From sabre at nondot.org Wed May 2 19:32:17 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 2 May 2007 19:32:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp ARMInstrVFP.td Message-ID: <200705030032.l430WHd9029113@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelDAGToDAG.cpp updated: 1.110 -> 1.111 ARMInstrVFP.td updated: 1.1 -> 1.2 --- Log message: match a reassociated form of fnmul. This implements CodeGen/ARM/fnmul.ll --- Diffs of the changes: (+9 -2) ARMISelDAGToDAG.cpp | 1 + ARMInstrVFP.td | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.110 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.111 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.110 Mon Mar 19 02:48:02 2007 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Wed May 2 19:32:00 2007 @@ -27,6 +27,7 @@ #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/CodeGen/SSARegMap.h" #include "llvm/Target/TargetLowering.h" +#include "llvm/Target/TargetOptions.h" #include "llvm/Support/Debug.h" using namespace llvm; Index: llvm/lib/Target/ARM/ARMInstrVFP.td diff -u llvm/lib/Target/ARM/ARMInstrVFP.td:1.1 llvm/lib/Target/ARM/ARMInstrVFP.td:1.2 --- llvm/lib/Target/ARM/ARMInstrVFP.td:1.1 Fri Jan 19 01:51:42 2007 +++ llvm/lib/Target/ARM/ARMInstrVFP.td Wed May 2 19:32:00 2007 @@ -139,8 +139,7 @@ def FMULS : ASI<(ops SPR:$dst, SPR:$a, SPR:$b), "fmuls $dst, $a, $b", [(set SPR:$dst, (fmul SPR:$a, SPR:$b))]>; - - + def FNMULD : ADI<(ops DPR:$dst, DPR:$a, DPR:$b), "fnmuld $dst, $a, $b", [(set DPR:$dst, (fneg (fmul DPR:$a, DPR:$b)))]>; @@ -149,6 +148,13 @@ "fnmuls $dst, $a, $b", [(set SPR:$dst, (fneg (fmul SPR:$a, SPR:$b)))]>; +// Match reassociated forms only if not sign dependent rounding. +def : Pat<(fmul (fneg DPR:$a), DPR:$b), + (FNMULD DPR:$a, DPR:$b)>, Requires<[NoHonorSignDependentRounding]>; +def : Pat<(fmul (fneg SPR:$a), SPR:$b), + (FNMULS SPR:$a, SPR:$b)>, Requires<[NoHonorSignDependentRounding]>; + + def FSUBD : ADI<(ops DPR:$dst, DPR:$a, DPR:$b), "fsubd $dst, $a, $b", [(set DPR:$dst, (fsub DPR:$a, DPR:$b))]>; From dpatel at apple.com Wed May 2 19:42:40 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 19:42:40 -0500 Subject: [llvm-commits] CVS: llvm/test/FrontendObjC/2007-05-02-Strong.m Message-ID: <200705030042.l430geFQ029269@zion.cs.uiuc.edu> Changes in directory llvm/test/FrontendObjC: 2007-05-02-Strong.m added (r1.1) --- Log message: New test. --- Diffs of the changes: (+23 -0) 2007-05-02-Strong.m | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+) Index: llvm/test/FrontendObjC/2007-05-02-Strong.m diff -c /dev/null llvm/test/FrontendObjC/2007-05-02-Strong.m:1.1 *** /dev/null Wed May 2 19:42:32 2007 --- llvm/test/FrontendObjC/2007-05-02-Strong.m Wed May 2 19:42:22 2007 *************** *** 0 **** --- 1,23 ---- + // RUN: %llvmgcc -c %s -fobjc-gc -o /dev/null + typedef int NSInteger; + typedef struct _NSRect { + int origin; + int size; + } NSRect; + + __attribute__((objc_gc(strong))) NSRect *_cachedRectArray; + extern const NSRect NSZeroRect; + @interface A{ + } + -(void)bar:(NSInteger *)rectCount; + @end + + @implementation A + + -(void)bar:(NSInteger *)rectCount { + NSRect appendRect = NSZeroRect; + + _cachedRectArray[*rectCount - 1] = NSZeroRect; + } + + @end From dpatel at apple.com Wed May 2 20:11:10 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Wed, 2 May 2007 18:11:10 -0700 (PDT) Subject: [llvm-commits] [126812] Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/ Week-of-Mon-20070430/048922.html Message-ID: <20070503011110.D1F45B18C01@src> Revision: 126812 Author: dpatel Date: 2007-05-02 18:11:09 -0700 (Wed, 02 May 2007) Log Message: ----------- Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070430/048922.html Modified Paths: -------------- apple-local/branches/llvm/gcc/c-typeck.c Modified: apple-local/branches/llvm/gcc/c-typeck.c =================================================================== --- apple-local/branches/llvm/gcc/c-typeck.c 2007-05-02 23:33:36 UTC (rev 126811) +++ apple-local/branches/llvm/gcc/c-typeck.c 2007-05-03 01:11:09 UTC (rev 126812) @@ -1896,8 +1896,12 @@ * pointer, not an array. The LLVM backend supports this use of ARRAY_REF * and it provides it with more information for optimization. */ - return build4 (ARRAY_REF, TREE_TYPE(TREE_TYPE(ar)), ar, index, - NULL_TREE, NULL_TREE); + { + tree ty = TREE_TYPE(TREE_TYPE(ar)); + if (TREE_CODE(ty) != ARRAY_TYPE) + ty = TYPE_MAIN_VARIANT (ty); + return build4 (ARRAY_REF, ty, ar, index, NULL_TREE, NULL_TREE); + } #endif /* APPLE LOCAL end LLVM */ From dpatel at apple.com Wed May 2 20:13:54 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:13:54 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/RSProfiling.h Message-ID: <200705030113.l431DsmF029954@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: RSProfiling.h updated: 1.4 -> 1.5 --- Log message: Drop 'const' --- Diffs of the changes: (+1 -1) RSProfiling.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Transforms/RSProfiling.h diff -u llvm/include/llvm/Transforms/RSProfiling.h:1.4 llvm/include/llvm/Transforms/RSProfiling.h:1.5 --- llvm/include/llvm/Transforms/RSProfiling.h:1.4 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Transforms/RSProfiling.h Wed May 2 20:11:53 2007 @@ -23,7 +23,7 @@ /// this interface are expected to chain to other implementations, such that /// multiple profilers can be support simultaniously. struct RSProfilers : public ModulePass { - static const char ID; // Pass identification, replacement for typeinfo + static char ID; // Pass identification, replacement for typeinfo RSProfilers() : ModulePass((intptr_t)&ID) {} /// isProfiling - This method returns true if the value passed it was From dpatel at apple.com Wed May 2 20:13:55 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:13:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp PPCCodeEmitter.cpp Message-ID: <200705030113.l431DtwT029969@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCBranchSelector.cpp updated: 1.44 -> 1.45 PPCCodeEmitter.cpp updated: 1.77 -> 1.78 --- Log message: Drop 'const' --- Diffs of the changes: (+4 -4) PPCBranchSelector.cpp | 4 ++-- PPCCodeEmitter.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.44 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.45 --- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.44 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Wed May 2 20:11:54 2007 @@ -32,7 +32,7 @@ namespace { struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass { - static const char ID; + static char ID; PPCBSel() : MachineFunctionPass((intptr_t)&ID) {} /// BlockSizes - The sizes of the basic blocks in the function. @@ -44,7 +44,7 @@ return "PowerPC Branch Selector"; } }; - const char PPCBSel::ID = 0; + char PPCBSel::ID = 0; } /// createPPCBranchSelectionPass - returns an instance of the Branch Selection Index: llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.77 llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.78 --- llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.77 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp Wed May 2 20:11:54 2007 @@ -40,7 +40,7 @@ int getMachineOpValue(MachineInstr &MI, MachineOperand &MO); public: - static const char ID; + static char ID; PPCCodeEmitter(TargetMachine &T, MachineCodeEmitter &M) : MachineFunctionPass((intptr_t)&ID), TM(T), MCE(M) {} @@ -64,7 +64,7 @@ /// unsigned getBinaryCodeForInstr(MachineInstr &MI); }; - const char PPCCodeEmitter::ID = 0; + char PPCCodeEmitter::ID = 0; } /// createPPCCodeEmitterPass - Return a pass that emits the collected PPC code From dpatel at apple.com Wed May 2 20:13:55 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:13:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp EdgeProfiling.cpp RSProfiling.cpp RSProfiling.h Message-ID: <200705030113.l431Dt2p029970@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: BlockProfiling.cpp updated: 1.24 -> 1.25 EdgeProfiling.cpp updated: 1.14 -> 1.15 RSProfiling.cpp updated: 1.26 -> 1.27 RSProfiling.h updated: 1.6 -> 1.7 --- Log message: Drop 'const' --- Diffs of the changes: (+12 -12) BlockProfiling.cpp | 8 ++++---- EdgeProfiling.cpp | 4 ++-- RSProfiling.cpp | 10 +++++----- RSProfiling.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) Index: llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.24 llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.25 --- llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp:1.24 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Instrumentation/BlockProfiling.cpp Wed May 2 20:11:54 2007 @@ -33,11 +33,11 @@ namespace { class VISIBILITY_HIDDEN FunctionProfiler : public RSProfilers_std { public: - static const char ID; + static char ID; bool runOnModule(Module &M); }; - const char FunctionProfiler::ID = 0; + char FunctionProfiler::ID = 0; RegisterPass X("insert-function-profiling", "Insert instrumentation for function profiling"); @@ -84,10 +84,10 @@ class BlockProfiler : public RSProfilers_std { bool runOnModule(Module &M); public: - static const char ID; + static char ID; }; - const char BlockProfiler::ID = 0; + char BlockProfiler::ID = 0; RegisterPass Y("insert-block-profiling", "Insert instrumentation for block profiling"); RegisterAnalysisGroup YG(Y); Index: llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.14 llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.15 --- llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp:1.14 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp Wed May 2 20:11:54 2007 @@ -33,11 +33,11 @@ class VISIBILITY_HIDDEN EdgeProfiler : public ModulePass { bool runOnModule(Module &M); public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid EdgeProfiler() : ModulePass((intptr_t)&ID) {} }; - const char EdgeProfiler::ID = 0; + char EdgeProfiler::ID = 0; RegisterPass X("insert-edge-profiling", "Insert instrumentation for edge profiling"); } Index: llvm/lib/Transforms/Instrumentation/RSProfiling.cpp diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.26 llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.27 --- llvm/lib/Transforms/Instrumentation/RSProfiling.cpp:1.26 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Instrumentation/RSProfiling.cpp Wed May 2 20:11:54 2007 @@ -69,7 +69,7 @@ /// measuring framework overhead class VISIBILITY_HIDDEN NullProfilerRS : public RSProfilers { public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid bool isProfiling(Value* v) { return false; } @@ -139,7 +139,7 @@ /// ProfilerRS - Insert the random sampling framework struct VISIBILITY_HIDDEN ProfilerRS : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid ProfilerRS() : FunctionPass((intptr_t)&ID) {} std::map TransCache; @@ -162,9 +162,9 @@ "Insert random sampling instrumentation framework"); } -const char RSProfilers::ID = 0; -const char NullProfilerRS::ID = 0; -const char ProfilerRS::ID = 0; +char RSProfilers::ID = 0; +char NullProfilerRS::ID = 0; +char ProfilerRS::ID = 0; //Local utilities static void ReplacePhiPred(BasicBlock* btarget, Index: llvm/lib/Transforms/Instrumentation/RSProfiling.h diff -u llvm/lib/Transforms/Instrumentation/RSProfiling.h:1.6 llvm/lib/Transforms/Instrumentation/RSProfiling.h:1.7 --- llvm/lib/Transforms/Instrumentation/RSProfiling.h:1.6 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Instrumentation/RSProfiling.h Wed May 2 20:11:54 2007 @@ -17,7 +17,7 @@ /// RSProfilers_std - a simple support class for profilers that handles most /// of the work of chaining and tracking inserted code. struct RSProfilers_std : public RSProfilers { - static const char ID; + static char ID; std::set profcode; // Lookup up values in profcode virtual bool isProfiling(Value* v); From dpatel at apple.com Wed May 2 20:13:56 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:13:56 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ExtractFunction.cpp TestPasses.cpp Message-ID: <200705030113.l431Du16029980@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: ExtractFunction.cpp updated: 1.60 -> 1.61 TestPasses.cpp updated: 1.12 -> 1.13 --- Log message: Drop 'const' --- Diffs of the changes: (+6 -6) ExtractFunction.cpp | 4 ++-- TestPasses.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/tools/bugpoint/ExtractFunction.cpp diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.60 llvm/tools/bugpoint/ExtractFunction.cpp:1.61 --- llvm/tools/bugpoint/ExtractFunction.cpp:1.60 Wed May 2 16:39:20 2007 +++ llvm/tools/bugpoint/ExtractFunction.cpp Wed May 2 20:11:54 2007 @@ -306,10 +306,10 @@ class BlockExtractorPass : public ModulePass { bool runOnModule(Module &M); public: - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid BlockExtractorPass() : ModulePass((intptr_t)&ID) {} }; - const char BlockExtractorPass::ID = 0; + char BlockExtractorPass::ID = 0; RegisterPass XX("extract-bbs", "Extract Basic Blocks From Module (for bugpoint use)"); } Index: llvm/tools/bugpoint/TestPasses.cpp diff -u llvm/tools/bugpoint/TestPasses.cpp:1.12 llvm/tools/bugpoint/TestPasses.cpp:1.13 --- llvm/tools/bugpoint/TestPasses.cpp:1.12 Wed May 2 16:39:20 2007 +++ llvm/tools/bugpoint/TestPasses.cpp Wed May 2 20:11:54 2007 @@ -26,7 +26,7 @@ /// crashes on any call instructions. class CrashOnCalls : public BasicBlockPass { public: - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid CrashOnCalls() : BasicBlockPass((intptr_t)&ID) {} private: virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -42,7 +42,7 @@ } }; - const char CrashOnCalls::ID = 0; + char CrashOnCalls::ID = 0; RegisterPass X("bugpoint-crashcalls", "BugPoint Test Pass - Intentionally crash on CallInsts"); @@ -53,7 +53,7 @@ /// deletes some call instructions, "misoptimizing" the program. class DeleteCalls : public BasicBlockPass { public: - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid DeleteCalls() : BasicBlockPass((intptr_t)&ID) {} private: bool runOnBasicBlock(BasicBlock &BB) { @@ -68,7 +68,7 @@ } }; - const char DeleteCalls::ID = 0; + char DeleteCalls::ID = 0; RegisterPass Y("bugpoint-deletecalls", "BugPoint Test Pass - Intentionally 'misoptimize' CallInsts"); From dpatel at apple.com Wed May 2 20:13:57 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:13:57 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/AnalysisWrappers.cpp GraphPrinters.cpp PrintSCC.cpp opt.cpp Message-ID: <200705030113.l431Dvsi029991@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: AnalysisWrappers.cpp updated: 1.23 -> 1.24 GraphPrinters.cpp updated: 1.16 -> 1.17 PrintSCC.cpp updated: 1.17 -> 1.18 opt.cpp updated: 1.136 -> 1.137 --- Log message: Drop 'const' --- Diffs of the changes: (+16 -16) AnalysisWrappers.cpp | 8 ++++---- GraphPrinters.cpp | 4 ++-- PrintSCC.cpp | 8 ++++---- opt.cpp | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) Index: llvm/tools/opt/AnalysisWrappers.cpp diff -u llvm/tools/opt/AnalysisWrappers.cpp:1.23 llvm/tools/opt/AnalysisWrappers.cpp:1.24 --- llvm/tools/opt/AnalysisWrappers.cpp:1.23 Wed May 2 16:39:20 2007 +++ llvm/tools/opt/AnalysisWrappers.cpp Wed May 2 20:11:54 2007 @@ -30,7 +30,7 @@ /// useful when looking for standard library functions we should constant fold /// or handle in alias analyses. struct ExternalFunctionsPassedConstants : public ModulePass { - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid ExternalFunctionsPassedConstants() : ModulePass((intptr_t)&ID) {} virtual bool runOnModule(Module &M) { for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) @@ -63,12 +63,12 @@ } }; - const char ExternalFunctionsPassedConstants::ID = 0; + char ExternalFunctionsPassedConstants::ID = 0; RegisterPass P1("externalfnconstants", "Print external fn callsites passed constants"); struct CallGraphPrinter : public ModulePass { - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid CallGraphPrinter() : ModulePass((intptr_t)&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -82,7 +82,7 @@ } }; - const char CallGraphPrinter::ID = 0; + char CallGraphPrinter::ID = 0; RegisterPass P2("callgraph", "Print a call graph"); } Index: llvm/tools/opt/GraphPrinters.cpp diff -u llvm/tools/opt/GraphPrinters.cpp:1.16 llvm/tools/opt/GraphPrinters.cpp:1.17 --- llvm/tools/opt/GraphPrinters.cpp:1.16 Wed May 2 16:39:20 2007 +++ llvm/tools/opt/GraphPrinters.cpp Wed May 2 20:11:54 2007 @@ -60,7 +60,7 @@ namespace { struct CallGraphPrinter : public ModulePass { - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid CallGraphPrinter() : ModulePass((intptr_t)&ID) {} virtual bool runOnModule(Module &M) { @@ -77,7 +77,7 @@ } }; - const char CallGraphPrinter::ID = 0; + char CallGraphPrinter::ID = 0; RegisterPass P2("print-callgraph", "Print Call Graph to 'dot' file"); } Index: llvm/tools/opt/PrintSCC.cpp diff -u llvm/tools/opt/PrintSCC.cpp:1.17 llvm/tools/opt/PrintSCC.cpp:1.18 --- llvm/tools/opt/PrintSCC.cpp:1.17 Wed May 2 16:39:20 2007 +++ llvm/tools/opt/PrintSCC.cpp Wed May 2 20:11:54 2007 @@ -35,7 +35,7 @@ namespace { struct CFGSCC : public FunctionPass { - static const char ID; // Pass identification, replacement for typeid + static char ID; // Pass identification, replacement for typeid CFGSCC() : FunctionPass((intptr_t)&ID) {} bool runOnFunction(Function& func); @@ -47,7 +47,7 @@ }; struct CallGraphSCC : public ModulePass { - static const char ID; // Pass identification, replacement for typeid + static char ID; // Pass identification, replacement for typeid CallGraphSCC() : ModulePass((intptr_t)&ID) {} // run - Print out SCCs in the call graph for the specified module. @@ -62,11 +62,11 @@ } }; - const char CFGSCC::ID = 0; + char CFGSCC::ID = 0; RegisterPass Y("cfgscc", "Print SCCs of each function CFG"); - const char CallGraphSCC::ID = 0; + char CallGraphSCC::ID = 0; RegisterPass Z("callscc", "Print SCCs of the Call Graph"); } Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.136 llvm/tools/opt/opt.cpp:1.137 --- llvm/tools/opt/opt.cpp:1.136 Wed May 2 16:39:20 2007 +++ llvm/tools/opt/opt.cpp Wed May 2 20:11:54 2007 @@ -98,7 +98,7 @@ namespace { struct ModulePassPrinter : public ModulePass { - static const char ID; + static char ID; const PassInfo *PassToPrint; ModulePassPrinter(const PassInfo *PI) : ModulePass((intptr_t)&ID), PassToPrint(PI) {} @@ -121,10 +121,10 @@ } }; -const char ModulePassPrinter::ID = 0; +char ModulePassPrinter::ID = 0; struct FunctionPassPrinter : public FunctionPass { const PassInfo *PassToPrint; - static const char ID; + static char ID; FunctionPassPrinter(const PassInfo *PI) : FunctionPass((intptr_t)&ID), PassToPrint(PI) {} @@ -146,10 +146,10 @@ } }; -const char FunctionPassPrinter::ID = 0; +char FunctionPassPrinter::ID = 0; struct BasicBlockPassPrinter : public BasicBlockPass { const PassInfo *PassToPrint; - static const char ID; + static char ID; BasicBlockPassPrinter(const PassInfo *PI) : BasicBlockPass((intptr_t)&ID), PassToPrint(PI) {} @@ -172,7 +172,7 @@ } }; -const char BasicBlockPassPrinter::ID = 0; +char BasicBlockPassPrinter::ID = 0; inline void addPass(PassManager &PM, Pass *P) { // Add the pass to the pass manager... PM.add(P); From dpatel at apple.com Wed May 2 20:13:57 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:13:57 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Assembly/PrintModulePass.h Message-ID: <200705030113.l431Dvrq029996@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Assembly: PrintModulePass.h updated: 1.23 -> 1.24 --- Log message: Drop 'const' --- Diffs of the changes: (+2 -2) PrintModulePass.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Assembly/PrintModulePass.h diff -u llvm/include/llvm/Assembly/PrintModulePass.h:1.23 llvm/include/llvm/Assembly/PrintModulePass.h:1.24 --- llvm/include/llvm/Assembly/PrintModulePass.h:1.23 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Assembly/PrintModulePass.h Wed May 2 20:11:53 2007 @@ -28,7 +28,7 @@ OStream *Out; // ostream to print on bool DeleteStream; // Delete the ostream in our dtor? public: - static const char ID; + static char ID; PrintModulePass() : ModulePass((intptr_t)&ID), Out(&cerr), DeleteStream(false) {} PrintModulePass(OStream *o, bool DS = false) : ModulePass((intptr_t)&ID), Out(o), DeleteStream(DS) {} @@ -52,7 +52,7 @@ OStream *Out; // ostream to print on bool DeleteStream; // Delete the ostream in our dtor? public: - static const char ID; + static char ID; PrintFunctionPass() : FunctionPass((intptr_t)&ID), Banner(""), Out(&cerr), DeleteStream(false) {} PrintFunctionPass(const std::string &B, OStream *o = &cout, From dpatel at apple.com Wed May 2 20:14:00 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:00 -0500 Subject: [llvm-commits] CVS: llvm/docs/WritingAnLLVMPass.html Message-ID: <200705030114.l431E0I0030009@zion.cs.uiuc.edu> Changes in directory llvm/docs: WritingAnLLVMPass.html updated: 1.58 -> 1.59 --- Log message: Drop 'const' --- Diffs of the changes: (+4 -4) WritingAnLLVMPass.html | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/docs/WritingAnLLVMPass.html diff -u llvm/docs/WritingAnLLVMPass.html:1.58 llvm/docs/WritingAnLLVMPass.html:1.59 --- llvm/docs/WritingAnLLVMPass.html:1.58 Wed May 2 16:39:18 2007 +++ llvm/docs/WritingAnLLVMPass.html Wed May 2 20:11:53 2007 @@ -263,7 +263,7 @@ time.

-     static const char ID;
+     static char ID;
      Hello() : FunctionPass((intptr_t)&ID) {}
 

@@ -285,7 +285,7 @@ function.

-  const char Hello::ID = 0;
+  char Hello::ID = 0;
 

We initialize pass ID here. LLVM uses ID's address to identify pass so @@ -311,7 +311,7 @@ namespace { struct Hello : public FunctionPass { - static const char ID; + static char ID; Hello() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { @@ -1807,7 +1807,7 @@ Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2007/05/02 21:39:18 $ + Last modified: $Date: 2007/05/03 01:11:53 $ From dpatel at apple.com Wed May 2 20:14:00 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200705030114.l431E0dG030014@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.341 -> 1.342 --- Log message: Drop 'const' --- Diffs of the changes: (+4 -4) CBackend.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.341 llvm/lib/Target/CBackend/CBackend.cpp:1.342 --- llvm/lib/Target/CBackend/CBackend.cpp:1.341 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Wed May 2 20:11:53 2007 @@ -57,7 +57,7 @@ /// class CBackendNameAllUsedStructsAndMergeFunctions : public ModulePass { public: - static const char ID; + static char ID; CBackendNameAllUsedStructsAndMergeFunctions() : ModulePass((intptr_t)&ID) {} void getAnalysisUsage(AnalysisUsage &AU) const { @@ -71,7 +71,7 @@ virtual bool runOnModule(Module &M); }; - const char CBackendNameAllUsedStructsAndMergeFunctions::ID = 0; + char CBackendNameAllUsedStructsAndMergeFunctions::ID = 0; /// CWriter - This class is the main chunk of code that converts an LLVM /// module to a C translation unit. @@ -88,7 +88,7 @@ std::set intrinsicPrototypesAlreadyGenerated; public: - static const char ID; + static char ID; CWriter(std::ostream &o) : FunctionPass((intptr_t)&ID), Out(o), IL(0), Mang(0), LI(0), TheModule(0), TAsm(0), TD(0) {} @@ -264,7 +264,7 @@ }; } -const char CWriter::ID = 0; +char CWriter::ID = 0; /// This method inserts names for any unnamed structure types that are used by /// the program, and removes names from structure types that are not used by the From dpatel at apple.com Wed May 2 20:14:01 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Dominators.cpp PassManager.cpp Verifier.cpp Message-ID: <200705030114.l431E1PP030022@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.281 -> 1.282 Dominators.cpp updated: 1.99 -> 1.100 PassManager.cpp updated: 1.155 -> 1.156 Verifier.cpp updated: 1.211 -> 1.212 --- Log message: Drop 'const' --- Diffs of the changes: (+16 -16) AsmWriter.cpp | 4 ++-- Dominators.cpp | 6 +++--- PassManager.cpp | 18 +++++++++--------- Verifier.cpp | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.281 llvm/lib/VMCore/AsmWriter.cpp:1.282 --- llvm/lib/VMCore/AsmWriter.cpp:1.281 Wed May 2 16:39:19 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Wed May 2 20:11:54 2007 @@ -135,10 +135,10 @@ } // end namespace llvm -const char PrintModulePass::ID = 0; +char PrintModulePass::ID = 0; static RegisterPass X("printm", "Print module to stderr"); -const char PrintFunctionPass::ID = 0; +char PrintFunctionPass::ID = 0; static RegisterPass Y("print","Print function to stderr"); Index: llvm/lib/VMCore/Dominators.cpp diff -u llvm/lib/VMCore/Dominators.cpp:1.99 llvm/lib/VMCore/Dominators.cpp:1.100 --- llvm/lib/VMCore/Dominators.cpp:1.99 Wed May 2 16:39:20 2007 +++ llvm/lib/VMCore/Dominators.cpp Wed May 2 20:11:54 2007 @@ -58,7 +58,7 @@ // //===----------------------------------------------------------------------===// -const char DominatorTree::ID = 0; +char DominatorTree::ID = 0; static RegisterPass E("domtree", "Dominator Tree Construction", true); @@ -354,7 +354,7 @@ // DominanceFrontier Implementation //===----------------------------------------------------------------------===// -const char DominanceFrontier::ID = 0; +char DominanceFrontier::ID = 0; static RegisterPass G("domfrontier", "Dominance Frontier Construction", true); @@ -835,7 +835,7 @@ // ETForest implementation //===----------------------------------------------------------------------===// -const char ETForest::ID = 0; +char ETForest::ID = 0; static RegisterPass D("etforest", "ET Forest Construction", true); Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.155 llvm/lib/VMCore/PassManager.cpp:1.156 --- llvm/lib/VMCore/PassManager.cpp:1.155 Wed May 2 16:39:20 2007 +++ llvm/lib/VMCore/PassManager.cpp Wed May 2 20:11:54 2007 @@ -63,7 +63,7 @@ public FunctionPass { public: - static const char ID; + static char ID; BBPassManager(int Depth) : PMDataManager(Depth), FunctionPass((intptr_t)&ID) {} @@ -106,7 +106,7 @@ } }; -const char BBPassManager::ID = 0; +char BBPassManager::ID = 0; } namespace llvm { @@ -119,7 +119,7 @@ public PMDataManager, public PMTopLevelManager { public: - static const char ID; + static char ID; FunctionPassManagerImpl(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth), PMTopLevelManager(TLM_Function) { } @@ -173,7 +173,7 @@ } }; -const char FunctionPassManagerImpl::ID = 0; +char FunctionPassManagerImpl::ID = 0; //===----------------------------------------------------------------------===// // MPPassManager // @@ -183,7 +183,7 @@ class MPPassManager : public Pass, public PMDataManager { public: - static const char ID; + static char ID; MPPassManager(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth) { } // Delete on the fly managers. @@ -247,7 +247,7 @@ std::map OnTheFlyManagers; }; -const char MPPassManager::ID = 0; +char MPPassManager::ID = 0; //===----------------------------------------------------------------------===// // PassManagerImpl // @@ -258,7 +258,7 @@ public PMTopLevelManager { public: - static const char ID; + static char ID; PassManagerImpl(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth), PMTopLevelManager(TLM_Pass) { } @@ -304,7 +304,7 @@ }; -const char PassManagerImpl::ID = 0; +char PassManagerImpl::ID = 0; } // End of llvm namespace namespace { @@ -1108,7 +1108,7 @@ //===----------------------------------------------------------------------===// // FPPassManager implementation -const char FPPassManager::ID = 0; +char FPPassManager::ID = 0; /// Print passes managed by this manager void FPPassManager::dumpPassStructure(unsigned Offset) { llvm::cerr << std::string(Offset*2, ' ') << "FunctionPass Manager\n"; Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.211 llvm/lib/VMCore/Verifier.cpp:1.212 --- llvm/lib/VMCore/Verifier.cpp:1.211 Wed May 2 16:39:20 2007 +++ llvm/lib/VMCore/Verifier.cpp Wed May 2 20:11:54 2007 @@ -69,7 +69,7 @@ struct VISIBILITY_HIDDEN Verifier : public FunctionPass, InstVisitor { - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid bool Broken; // Is this module found to be broken? bool RealPass; // Are we not being run by a PassManager? VerifierFailureAction action; @@ -266,7 +266,7 @@ } }; - const char Verifier::ID = 0; + char Verifier::ID = 0; RegisterPass X("verify", "Module Verifier"); } // End anonymous namespace From dpatel at apple.com Wed May 2 20:14:02 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/MSIL/MSILWriter.cpp MSILWriter.h Message-ID: <200705030114.l431E2dE030034@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/MSIL: MSILWriter.cpp updated: 1.6 -> 1.7 MSILWriter.h updated: 1.4 -> 1.5 --- Log message: Drop 'const' --- Diffs of the changes: (+4 -4) MSILWriter.cpp | 4 ++-- MSILWriter.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/MSIL/MSILWriter.cpp diff -u llvm/lib/Target/MSIL/MSILWriter.cpp:1.6 llvm/lib/Target/MSIL/MSILWriter.cpp:1.7 --- llvm/lib/Target/MSIL/MSILWriter.cpp:1.6 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/MSIL/MSILWriter.cpp Wed May 2 20:11:53 2007 @@ -80,8 +80,8 @@ return Changed; } -const char MSILModule::ID = 0; -const char MSILWriter::ID = 0; +char MSILModule::ID = 0; +char MSILWriter::ID = 0; bool MSILWriter::runOnFunction(Function &F) { if (F.isDeclaration()) return false; Index: llvm/lib/Target/MSIL/MSILWriter.h diff -u llvm/lib/Target/MSIL/MSILWriter.h:1.4 llvm/lib/Target/MSIL/MSILWriter.h:1.5 --- llvm/lib/Target/MSIL/MSILWriter.h:1.4 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/MSIL/MSILWriter.h Wed May 2 20:11:53 2007 @@ -37,7 +37,7 @@ const TargetData*& TD; public: - static const char ID; + static char ID; MSILModule(const std::set*& _UsedTypes, const TargetData*& _TD) : ModulePass((intptr_t)&ID), UsedTypes(_UsedTypes), TD(_TD) {} @@ -83,7 +83,7 @@ std::map > StaticInitList; const std::set* UsedTypes; - static const char ID; + static char ID; MSILWriter(std::ostream &o) : FunctionPass((intptr_t)&ID), Out(o) { UniqID = 0; } From dpatel at apple.com Wed May 2 20:14:02 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200705030114.l431E2lT030048@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.445 -> 1.446 --- Log message: Drop 'const' --- Diffs of the changes: (+1 -1) SelectionDAGISel.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.445 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.446 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.445 Wed May 2 17:15:48 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed May 2 20:11:53 2007 @@ -5012,4 +5012,4 @@ Ops.push_back(InOps.back()); } -const char SelectionDAGISel::ID = 0; +char SelectionDAGISel::ID = 0; From dpatel at apple.com Wed May 2 20:14:02 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:02 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h Message-ID: <200705030114.l431E2NL030053@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetData.h updated: 1.62 -> 1.63 --- Log message: Drop 'const' --- Diffs of the changes: (+1 -1) TargetData.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Target/TargetData.h diff -u llvm/include/llvm/Target/TargetData.h:1.62 llvm/include/llvm/Target/TargetData.h:1.63 --- llvm/include/llvm/Target/TargetData.h:1.62 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Target/TargetData.h Wed May 2 20:11:53 2007 @@ -202,7 +202,7 @@ /// requested alignment (if the global has one). unsigned getPreferredAlignmentLog(const GlobalVariable *GV) const; - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid }; /// StructLayout - used to lazily calculate structure layout information for a From dpatel at apple.com Wed May 2 20:14:02 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp X86FloatingPoint.cpp Message-ID: <200705030114.l431E2J5030063@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.135 -> 1.136 X86FloatingPoint.cpp updated: 1.70 -> 1.71 --- Log message: Drop 'const' --- Diffs of the changes: (+4 -4) X86CodeEmitter.cpp | 4 ++-- X86FloatingPoint.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.135 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.136 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.135 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Wed May 2 20:11:54 2007 @@ -39,7 +39,7 @@ MachineCodeEmitter &MCE; bool Is64BitMode; public: - static const char ID; + static char ID; explicit Emitter(TargetMachine &tm, MachineCodeEmitter &mce) : MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm), MCE(mce), Is64BitMode(false) {} @@ -82,7 +82,7 @@ bool isX86_64ExtendedReg(const MachineOperand &MO); unsigned determineREX(const MachineInstr &MI); }; - const char Emitter::ID = 0; + char Emitter::ID = 0; } /// createX86CodeEmitterPass - Return a pass that emits the collected X86 code Index: llvm/lib/Target/X86/X86FloatingPoint.cpp diff -u llvm/lib/Target/X86/X86FloatingPoint.cpp:1.70 llvm/lib/Target/X86/X86FloatingPoint.cpp:1.71 --- llvm/lib/Target/X86/X86FloatingPoint.cpp:1.70 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/X86/X86FloatingPoint.cpp Wed May 2 20:11:54 2007 @@ -52,7 +52,7 @@ namespace { struct VISIBILITY_HIDDEN FPS : public MachineFunctionPass { - static const char ID; + static char ID; FPS() : MachineFunctionPass((intptr_t)&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); @@ -154,7 +154,7 @@ void handleCondMovFP(MachineBasicBlock::iterator &I); void handleSpecialFP(MachineBasicBlock::iterator &I); }; - const char FPS::ID = 0; + char FPS::ID = 0; } FunctionPass *llvm::createX86FloatingPointStackifierPass() { return new FPS(); } From dpatel at apple.com Wed May 2 20:13:59 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:13:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/DelaySlotFiller.cpp FPMover.cpp Message-ID: <200705030113.l431DxSt030003@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: DelaySlotFiller.cpp updated: 1.15 -> 1.16 FPMover.cpp updated: 1.20 -> 1.21 --- Log message: Drop 'const' --- Diffs of the changes: (+4 -4) DelaySlotFiller.cpp | 4 ++-- FPMover.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/Sparc/DelaySlotFiller.cpp diff -u llvm/lib/Target/Sparc/DelaySlotFiller.cpp:1.15 llvm/lib/Target/Sparc/DelaySlotFiller.cpp:1.16 --- llvm/lib/Target/Sparc/DelaySlotFiller.cpp:1.15 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/Sparc/DelaySlotFiller.cpp Wed May 2 20:11:54 2007 @@ -30,7 +30,7 @@ TargetMachine &TM; const TargetInstrInfo *TII; - static const char ID; + static char ID; Filler(TargetMachine &tm) : MachineFunctionPass((intptr_t)&ID), TM(tm), TII(tm.getInstrInfo()) { } @@ -48,7 +48,7 @@ } }; - const char Filler::ID = 0; + char Filler::ID = 0; } // end of anonymous namespace /// createSparcDelaySlotFillerPass - Returns a pass that fills in delay Index: llvm/lib/Target/Sparc/FPMover.cpp diff -u llvm/lib/Target/Sparc/FPMover.cpp:1.20 llvm/lib/Target/Sparc/FPMover.cpp:1.21 --- llvm/lib/Target/Sparc/FPMover.cpp:1.20 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/Sparc/FPMover.cpp Wed May 2 20:11:54 2007 @@ -32,7 +32,7 @@ /// TargetMachine &TM; - static const char ID; + static char ID; FPMover(TargetMachine &tm) : MachineFunctionPass((intptr_t)&ID), TM(tm) { } @@ -43,7 +43,7 @@ bool runOnMachineBasicBlock(MachineBasicBlock &MBB); bool runOnMachineFunction(MachineFunction &F); }; - const char FPMover::ID = 0; + char FPMover::ID = 0; } // end of anonymous namespace /// createSparcFPMoverPass - Returns a pass that turns FpMOVD From dpatel at apple.com Wed May 2 20:14:04 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp BasicBlockPlacement.cpp CodeGenPrepare.cpp CondPropagate.cpp ConstantProp.cpp CorrelatedExprs.cpp DCE.cpp DeadStoreElimination.cpp GCSE.cpp IndVarSimplify.cpp InstructionCombining.cpp LICM.cpp LoopRotation.cpp LoopStrengthReduce.cpp LoopUnroll.cpp LoopUnswitch.cpp LowerGC.cpp LowerPacked.cpp PredicateSimplifier.cpp Reassociate.cpp Reg2Mem.cpp SCCP.cpp ScalarReplAggregates.cpp SimplifyCFG.cpp TailDuplication.cpp TailRecursionElimination.cpp Message-ID: <200705030114.l431E4g2030104@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.108 -> 1.109 BasicBlockPlacement.cpp updated: 1.11 -> 1.12 CodeGenPrepare.cpp updated: 1.8 -> 1.9 CondPropagate.cpp updated: 1.20 -> 1.21 ConstantProp.cpp updated: 1.58 -> 1.59 CorrelatedExprs.cpp updated: 1.59 -> 1.60 DCE.cpp updated: 1.65 -> 1.66 DeadStoreElimination.cpp updated: 1.19 -> 1.20 GCSE.cpp updated: 1.55 -> 1.56 IndVarSimplify.cpp updated: 1.117 -> 1.118 InstructionCombining.cpp updated: 1.756 -> 1.757 LICM.cpp updated: 1.98 -> 1.99 LoopRotation.cpp updated: 1.12 -> 1.13 LoopStrengthReduce.cpp updated: 1.133 -> 1.134 LoopUnroll.cpp updated: 1.41 -> 1.42 LoopUnswitch.cpp updated: 1.67 -> 1.68 LowerGC.cpp updated: 1.24 -> 1.25 LowerPacked.cpp updated: 1.23 -> 1.24 PredicateSimplifier.cpp updated: 1.73 -> 1.74 Reassociate.cpp updated: 1.80 -> 1.81 Reg2Mem.cpp updated: 1.14 -> 1.15 SCCP.cpp updated: 1.167 -> 1.168 ScalarReplAggregates.cpp updated: 1.92 -> 1.93 SimplifyCFG.cpp updated: 1.23 -> 1.24 TailDuplication.cpp updated: 1.39 -> 1.40 TailRecursionElimination.cpp updated: 1.32 -> 1.33 --- Log message: Drop 'const' --- Diffs of the changes: (+56 -56) ADCE.cpp | 4 ++-- BasicBlockPlacement.cpp | 4 ++-- CodeGenPrepare.cpp | 4 ++-- CondPropagate.cpp | 4 ++-- ConstantProp.cpp | 4 ++-- CorrelatedExprs.cpp | 4 ++-- DCE.cpp | 8 ++++---- DeadStoreElimination.cpp | 4 ++-- GCSE.cpp | 4 ++-- IndVarSimplify.cpp | 4 ++-- InstructionCombining.cpp | 4 ++-- LICM.cpp | 4 ++-- LoopRotation.cpp | 4 ++-- LoopStrengthReduce.cpp | 4 ++-- LoopUnroll.cpp | 4 ++-- LoopUnswitch.cpp | 4 ++-- LowerGC.cpp | 4 ++-- LowerPacked.cpp | 4 ++-- PredicateSimplifier.cpp | 4 ++-- Reassociate.cpp | 4 ++-- Reg2Mem.cpp | 4 ++-- SCCP.cpp | 8 ++++---- ScalarReplAggregates.cpp | 4 ++-- SimplifyCFG.cpp | 4 ++-- TailDuplication.cpp | 4 ++-- TailRecursionElimination.cpp | 4 ++-- 26 files changed, 56 insertions(+), 56 deletions(-) Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.108 llvm/lib/Transforms/Scalar/ADCE.cpp:1.109 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.108 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Wed May 2 20:11:54 2007 @@ -52,7 +52,7 @@ // The public interface for this class // public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid ADCE() : FunctionPass((intptr_t)&ID) {} // Execute the Aggressive Dead Code Elimination Algorithm @@ -107,7 +107,7 @@ } }; - const char ADCE::ID = 0; + char ADCE::ID = 0; RegisterPass X("adce", "Aggressive Dead Code Elimination"); } // End of anonymous namespace Index: llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp diff -u llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.11 llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.12 --- llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.11 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp Wed May 2 20:11:54 2007 @@ -41,7 +41,7 @@ namespace { struct VISIBILITY_HIDDEN BlockPlacement : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid BlockPlacement() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -73,7 +73,7 @@ void PlaceBlocks(BasicBlock *BB); }; - const char BlockPlacement::ID = 0; + char BlockPlacement::ID = 0; RegisterPass X("block-placement", "Profile Guided Basic Block Placement"); } Index: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp diff -u llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.8 llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.9 --- llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.8 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp Wed May 2 20:11:54 2007 @@ -39,7 +39,7 @@ /// transformation profitability. const TargetLowering *TLI; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid CodeGenPrepare(const TargetLowering *tli = 0) : FunctionPass((intptr_t)&ID), TLI(tli) {} bool runOnFunction(Function &F); @@ -55,7 +55,7 @@ }; } -const char CodeGenPrepare::ID = 0; +char CodeGenPrepare::ID = 0; static RegisterPass X("codegenprepare", "Optimize for code generation"); Index: llvm/lib/Transforms/Scalar/CondPropagate.cpp diff -u llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.20 llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.21 --- llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.20 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/CondPropagate.cpp Wed May 2 20:11:54 2007 @@ -31,7 +31,7 @@ namespace { struct VISIBILITY_HIDDEN CondProp : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid CondProp() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -49,7 +49,7 @@ void RevectorBlockTo(BasicBlock *FromBB, BasicBlock *ToBB); }; - const char CondProp::ID = 0; + char CondProp::ID = 0; RegisterPass X("condprop", "Conditional Propagation"); } Index: llvm/lib/Transforms/Scalar/ConstantProp.cpp diff -u llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.58 llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.59 --- llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.58 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/ConstantProp.cpp Wed May 2 20:11:54 2007 @@ -34,7 +34,7 @@ namespace { struct VISIBILITY_HIDDEN ConstantPropagation : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid ConstantPropagation() : FunctionPass((intptr_t)&ID) {} bool runOnFunction(Function &F); @@ -44,7 +44,7 @@ } }; - const char ConstantPropagation::ID = 0; + char ConstantPropagation::ID = 0; RegisterPass X("constprop", "Simple constant propagation"); } Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.59 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.60 --- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.59 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp Wed May 2 20:11:54 2007 @@ -225,7 +225,7 @@ std::map RegionInfoMap; ETForest *EF; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid CEE() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -288,7 +288,7 @@ bool SimplifyInstruction(Instruction *Inst, const RegionInfo &RI); }; - const char CEE::ID = 0; + char CEE::ID = 0; RegisterPass X("cee", "Correlated Expression Elimination"); } Index: llvm/lib/Transforms/Scalar/DCE.cpp diff -u llvm/lib/Transforms/Scalar/DCE.cpp:1.65 llvm/lib/Transforms/Scalar/DCE.cpp:1.66 --- llvm/lib/Transforms/Scalar/DCE.cpp:1.65 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/DCE.cpp Wed May 2 20:11:54 2007 @@ -35,7 +35,7 @@ // DeadInstElimination pass implementation // struct VISIBILITY_HIDDEN DeadInstElimination : public BasicBlockPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid DeadInstElimination() : BasicBlockPass(intptr_t(&ID)) {} virtual bool runOnBasicBlock(BasicBlock &BB) { bool Changed = false; @@ -53,7 +53,7 @@ } }; - const char DeadInstElimination::ID = 0; + char DeadInstElimination::ID = 0; RegisterPass X("die", "Dead Instruction Elimination"); } @@ -67,7 +67,7 @@ // DeadCodeElimination pass implementation // struct DCE : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid DCE() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -77,7 +77,7 @@ } }; - const char DCE::ID = 0; + char DCE::ID = 0; RegisterPass Y("dce", "Dead Code Elimination"); } Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp diff -u llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.19 llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.20 --- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.19 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp Wed May 2 20:11:54 2007 @@ -34,7 +34,7 @@ namespace { struct VISIBILITY_HIDDEN DSE : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid DSE() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { @@ -58,7 +58,7 @@ AU.addPreserved(); } }; - const char DSE::ID = 0; + char DSE::ID = 0; RegisterPass X("dse", "Dead Store Elimination"); } Index: llvm/lib/Transforms/Scalar/GCSE.cpp diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.55 llvm/lib/Transforms/Scalar/GCSE.cpp:1.56 --- llvm/lib/Transforms/Scalar/GCSE.cpp:1.55 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/GCSE.cpp Wed May 2 20:11:54 2007 @@ -37,7 +37,7 @@ "with constant values"); namespace { struct VISIBILITY_HIDDEN GCSE : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid GCSE() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -54,7 +54,7 @@ } }; - const char GCSE::ID = 0; + char GCSE::ID = 0; RegisterPass X("gcse", "Global Common Subexpression Elimination"); } Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.117 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.118 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.117 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Wed May 2 20:11:54 2007 @@ -69,7 +69,7 @@ bool Changed; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid IndVarSimplify() : LoopPass((intptr_t)&ID) {} bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -95,7 +95,7 @@ void DeleteTriviallyDeadInstructions(std::set &Insts); }; - const char IndVarSimplify::ID = 0; + char IndVarSimplify::ID = 0; RegisterPass X("indvars", "Canonicalize Induction Variables"); } Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.756 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.757 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.756 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed May 2 20:11:54 2007 @@ -76,7 +76,7 @@ TargetData *TD; bool MustPreserveLCSSA; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid InstCombiner() : FunctionPass((intptr_t)&ID) {} /// AddToWorkList - Add the specified instruction to the worklist if it @@ -361,7 +361,7 @@ Value *EvaluateInDifferentType(Value *V, const Type *Ty, bool isSigned); }; - const char InstCombiner::ID = 0; + char InstCombiner::ID = 0; RegisterPass X("instcombine", "Combine redundant instructions"); } Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.98 llvm/lib/Transforms/Scalar/LICM.cpp:1.99 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.98 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/LICM.cpp Wed May 2 20:11:54 2007 @@ -63,7 +63,7 @@ cl::desc("Disable memory promotion in LICM pass")); struct VISIBILITY_HIDDEN LICM : public LoopPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid LICM() : LoopPass((intptr_t)&ID) {} virtual bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -204,7 +204,7 @@ std::map &Val2AlMap); }; - const char LICM::ID = 0; + char LICM::ID = 0; RegisterPass X("licm", "Loop Invariant Code Motion"); } Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.12 llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.13 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.12 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Wed May 2 20:11:54 2007 @@ -44,7 +44,7 @@ class VISIBILITY_HIDDEN LoopRotate : public LoopPass { public: - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid LoopRotate() : LoopPass((intptr_t)&ID) {} // Rotate Loop L as many times as possible. Return true if @@ -94,7 +94,7 @@ SmallVector LoopHeaderInfo; }; - const char LoopRotate::ID = 0; + char LoopRotate::ID = 0; RegisterPass X ("loop-rotate", "Rotate Loops"); } Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.133 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.134 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.133 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Wed May 2 20:11:54 2007 @@ -143,7 +143,7 @@ const TargetLowering *TLI; public: - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid LoopStrengthReduce(const TargetLowering *tli = NULL) : LoopPass((intptr_t)&ID), TLI(tli) { } @@ -188,7 +188,7 @@ Loop *L, bool isOnlyStride); void DeleteTriviallyDeadInstructions(std::set &Insts); }; - const char LoopStrengthReduce::ID = 0; + char LoopStrengthReduce::ID = 0; RegisterPass X("loop-reduce", "Loop Strength Reduction"); } Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.41 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.42 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.41 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Wed May 2 20:11:54 2007 @@ -49,7 +49,7 @@ class VISIBILITY_HIDDEN LoopUnroll : public LoopPass { LoopInfo *LI; // The current loop information public: - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid LoopUnroll() : LoopPass((intptr_t)&ID) {} bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -66,7 +66,7 @@ AU.addPreserved(); } }; - const char LoopUnroll::ID = 0; + char LoopUnroll::ID = 0; RegisterPass X("loop-unroll", "Unroll loops"); } Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.67 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.68 --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.67 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Wed May 2 20:11:54 2007 @@ -69,7 +69,7 @@ SmallPtrSet UnswitchedVals; public: - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid LoopUnswitch() : LoopPass((intptr_t)&ID) {} bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -112,7 +112,7 @@ std::vector &Worklist); void RemoveLoopFromHierarchy(Loop *L); }; - const char LoopUnswitch::ID = 0; + char LoopUnswitch::ID = 0; RegisterPass X("loop-unswitch", "Unswitch loops"); } Index: llvm/lib/Transforms/Scalar/LowerGC.cpp diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.24 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.25 --- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.24 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/LowerGC.cpp Wed May 2 20:11:54 2007 @@ -47,7 +47,7 @@ /// had zero roots. const Type *MainRootRecordType; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid LowerGC() : FunctionPass((intptr_t)&ID), GCRootInt(0), GCReadInt(0), GCWriteInt(0), GCRead(0), GCWrite(0), RootChain(0), MainRootRecordType(0) {} @@ -58,7 +58,7 @@ const StructType *getRootRecordType(unsigned NumRoots); }; - const char LowerGC::ID = 0; + char LowerGC::ID = 0; RegisterPass X("lowergc", "Lower GC intrinsics, for GCless code generators"); } Index: llvm/lib/Transforms/Scalar/LowerPacked.cpp diff -u llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.23 llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.24 --- llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.23 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/LowerPacked.cpp Wed May 2 20:11:54 2007 @@ -40,7 +40,7 @@ class VISIBILITY_HIDDEN LowerPacked : public FunctionPass, public InstVisitor { public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid LowerPacked() : FunctionPass((intptr_t)&ID) {} /// @brief Lowers packed operations to scalar operations. @@ -107,7 +107,7 @@ std::vector instrsToRemove; }; -const char LowerPacked::ID = 0; +char LowerPacked::ID = 0; RegisterPass X("lower-packed", "lowers packed operations to operations on smaller packed datatypes"); Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.73 llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.74 --- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.73 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp Wed May 2 20:11:54 2007 @@ -1989,7 +1989,7 @@ std::vector WorkList; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid PredicateSimplifier() : FunctionPass((intptr_t)&ID) {} bool runOnFunction(Function &F); @@ -2377,7 +2377,7 @@ } } - const char PredicateSimplifier::ID = 0; + char PredicateSimplifier::ID = 0; RegisterPass X("predsimplify", "Predicate Simplifier"); } Index: llvm/lib/Transforms/Scalar/Reassociate.cpp diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.80 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.81 --- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.80 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/Reassociate.cpp Wed May 2 20:11:54 2007 @@ -69,7 +69,7 @@ std::map ValueRankMap; bool MadeChange; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid Reassociate() : FunctionPass((intptr_t)&ID) {} bool runOnFunction(Function &F); @@ -92,7 +92,7 @@ void RemoveDeadBinaryOp(Value *V); }; - const char Reassociate::ID = 0; + char Reassociate::ID = 0; RegisterPass X("reassociate", "Reassociate expressions"); } Index: llvm/lib/Transforms/Scalar/Reg2Mem.cpp diff -u llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.14 llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.15 --- llvm/lib/Transforms/Scalar/Reg2Mem.cpp:1.14 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/Reg2Mem.cpp Wed May 2 20:11:54 2007 @@ -33,7 +33,7 @@ namespace { struct VISIBILITY_HIDDEN RegToMem : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid RegToMem() : FunctionPass((intptr_t)&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -78,7 +78,7 @@ } }; - const char RegToMem::ID = 0; + char RegToMem::ID = 0; RegisterPass X("reg2mem", "Demote all values to stack slots"); } Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.167 llvm/lib/Transforms/Scalar/SCCP.cpp:1.168 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.167 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Wed May 2 20:11:54 2007 @@ -1334,7 +1334,7 @@ /// Sparse Conditional Constant Propagator. /// struct VISIBILITY_HIDDEN SCCP : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid SCCP() : FunctionPass((intptr_t)&ID) {} // runOnFunction - Run the Sparse Conditional Constant Propagation @@ -1347,7 +1347,7 @@ } }; - const char SCCP::ID = 0; + char SCCP::ID = 0; RegisterPass X("sccp", "Sparse Conditional Constant Propagation"); } // end anonymous namespace @@ -1447,12 +1447,12 @@ /// Constant Propagation. /// struct VISIBILITY_HIDDEN IPSCCP : public ModulePass { - static const char ID; + static char ID; IPSCCP() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); }; - const char IPSCCP::ID = 0; + char IPSCCP::ID = 0; RegisterPass Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation"); } // end anonymous namespace Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.92 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.93 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.92 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Wed May 2 20:11:54 2007 @@ -47,7 +47,7 @@ namespace { struct VISIBILITY_HIDDEN SROA : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid SROA() : FunctionPass((intptr_t)&ID) {} bool runOnFunction(Function &F); @@ -84,7 +84,7 @@ static Instruction *isOnlyCopiedFromConstantGlobal(AllocationInst *AI); }; - const char SROA::ID = 0; + char SROA::ID = 0; RegisterPass X("scalarrepl", "Scalar Replacement of Aggregates"); } Index: llvm/lib/Transforms/Scalar/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.23 llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.24 --- llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.23 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/SimplifyCFG.cpp Wed May 2 20:11:54 2007 @@ -35,12 +35,12 @@ namespace { struct VISIBILITY_HIDDEN CFGSimplifyPass : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid CFGSimplifyPass() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); }; - const char CFGSimplifyPass::ID = 0; + char CFGSimplifyPass::ID = 0; RegisterPass X("simplifycfg", "Simplify the CFG"); } Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp diff -u llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.39 llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.40 --- llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.39 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/TailDuplication.cpp Wed May 2 20:11:54 2007 @@ -43,14 +43,14 @@ class VISIBILITY_HIDDEN TailDup : public FunctionPass { bool runOnFunction(Function &F); public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid TailDup() : FunctionPass((intptr_t)&ID) {} private: inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI); inline void eliminateUnconditionalBranch(BranchInst *BI); }; - const char TailDup::ID = 0; + char TailDup::ID = 0; RegisterPass X("tailduplicate", "Tail Duplication"); } Index: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp diff -u llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.32 llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.33 --- llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.32 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp Wed May 2 20:11:54 2007 @@ -67,7 +67,7 @@ namespace { struct VISIBILITY_HIDDEN TailCallElim : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid TailCallElim() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -80,7 +80,7 @@ bool CanMoveAboveCall(Instruction *I, CallInst *CI); Value *CanTransformAccumulatorRecursion(Instruction *I, CallInst *CI); }; - const char TailCallElim::ID = 0; + char TailCallElim::ID = 0; RegisterPass X("tailcallelim", "Tail Call Elimination"); } From dpatel at apple.com Wed May 2 20:14:05 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetData.cpp Message-ID: <200705030114.l431E5uC030110@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.110 -> 1.111 --- Log message: Drop 'const' --- Diffs of the changes: (+1 -1) TargetData.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.110 llvm/lib/Target/TargetData.cpp:1.111 --- llvm/lib/Target/TargetData.cpp:1.110 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/TargetData.cpp Wed May 2 20:11:53 2007 @@ -35,7 +35,7 @@ // Register the default SparcV9 implementation... RegisterPass X("targetdata", "Target Data Layout"); } -const char TargetData::ID = 0; +char TargetData::ID = 0; //===----------------------------------------------------------------------===// // Support for StructLayout From dpatel at apple.com Wed May 2 20:14:08 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp ConstantMerge.cpp DeadArgumentElimination.cpp DeadTypeElimination.cpp ExtractFunction.cpp GlobalDCE.cpp GlobalOpt.cpp IPConstantPropagation.cpp IndMemRemoval.cpp InlineSimple.cpp Inliner.cpp Inliner.h Internalize.cpp LoopExtractor.cpp LowerSetJmp.cpp PruneEH.cpp RaiseAllocations.cpp SimplifyLibCalls.cpp StripDeadPrototypes.cpp StripSymbols.cpp Message-ID: <200705030114.l431E8Ln030157@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ArgumentPromotion.cpp updated: 1.41 -> 1.42 ConstantMerge.cpp updated: 1.41 -> 1.42 DeadArgumentElimination.cpp updated: 1.42 -> 1.43 DeadTypeElimination.cpp updated: 1.64 -> 1.65 ExtractFunction.cpp updated: 1.22 -> 1.23 GlobalDCE.cpp updated: 1.47 -> 1.48 GlobalOpt.cpp updated: 1.103 -> 1.104 IPConstantPropagation.cpp updated: 1.25 -> 1.26 IndMemRemoval.cpp updated: 1.17 -> 1.18 InlineSimple.cpp updated: 1.80 -> 1.81 Inliner.cpp updated: 1.39 -> 1.40 Inliner.h updated: 1.11 -> 1.12 Internalize.cpp updated: 1.47 -> 1.48 LoopExtractor.cpp updated: 1.26 -> 1.27 LowerSetJmp.cpp updated: 1.42 -> 1.43 PruneEH.cpp updated: 1.33 -> 1.34 RaiseAllocations.cpp updated: 1.42 -> 1.43 SimplifyLibCalls.cpp updated: 1.114 -> 1.115 StripDeadPrototypes.cpp updated: 1.7 -> 1.8 StripSymbols.cpp updated: 1.17 -> 1.18 --- Log message: Drop 'const' --- Diffs of the changes: (+44 -44) ArgumentPromotion.cpp | 4 ++-- ConstantMerge.cpp | 4 ++-- DeadArgumentElimination.cpp | 8 ++++---- DeadTypeElimination.cpp | 4 ++-- ExtractFunction.cpp | 4 ++-- GlobalDCE.cpp | 4 ++-- GlobalOpt.cpp | 4 ++-- IPConstantPropagation.cpp | 4 ++-- IndMemRemoval.cpp | 4 ++-- InlineSimple.cpp | 4 ++-- Inliner.cpp | 2 +- Inliner.h | 2 +- Internalize.cpp | 4 ++-- LoopExtractor.cpp | 12 ++++++------ LowerSetJmp.cpp | 4 ++-- PruneEH.cpp | 4 ++-- RaiseAllocations.cpp | 4 ++-- SimplifyLibCalls.cpp | 4 ++-- StripDeadPrototypes.cpp | 4 ++-- StripSymbols.cpp | 4 ++-- 20 files changed, 44 insertions(+), 44 deletions(-) Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.41 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.42 --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.41 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Wed May 2 20:11:54 2007 @@ -63,7 +63,7 @@ } virtual bool runOnSCC(const std::vector &SCC); - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid ArgPromotion() : CallGraphSCCPass((intptr_t)&ID) {} private: @@ -72,7 +72,7 @@ Function *DoPromotion(Function *F, std::vector &ArgsToPromote); }; - const char ArgPromotion::ID = 0; + char ArgPromotion::ID = 0; RegisterPass X("argpromotion", "Promote 'by reference' arguments to scalars"); } Index: llvm/lib/Transforms/IPO/ConstantMerge.cpp diff -u llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.41 llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.42 --- llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.41 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/ConstantMerge.cpp Wed May 2 20:11:54 2007 @@ -29,7 +29,7 @@ namespace { struct VISIBILITY_HIDDEN ConstantMerge : public ModulePass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid ConstantMerge() : ModulePass((intptr_t)&ID) {} // run - For this pass, process all of the globals in the module, @@ -38,7 +38,7 @@ bool runOnModule(Module &M); }; - const char ConstantMerge::ID = 0; + char ConstantMerge::ID = 0; RegisterPassX("constmerge","Merge Duplicate Global Constants"); } Index: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.42 llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.43 --- llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.42 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp Wed May 2 20:11:54 2007 @@ -76,7 +76,7 @@ std::multimap CallSites; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid DAE() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); @@ -95,17 +95,17 @@ void RemoveDeadArgumentsFromFunction(Function *F); }; - const char DAE::ID = 0; + char DAE::ID = 0; RegisterPass X("deadargelim", "Dead Argument Elimination"); /// DAH - DeadArgumentHacking pass - Same as dead argument elimination, but /// deletes arguments to functions which are external. This is only for use /// by bugpoint. struct DAH : public DAE { - static const char ID; + static char ID; virtual bool ShouldHackArguments() const { return true; } }; - const char DAH::ID = 0; + char DAH::ID = 0; RegisterPass Y("deadarghaX0r", "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)"); } Index: llvm/lib/Transforms/IPO/DeadTypeElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.64 llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.65 --- llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.64 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/DeadTypeElimination.cpp Wed May 2 20:11:54 2007 @@ -26,7 +26,7 @@ namespace { struct VISIBILITY_HIDDEN DTE : public ModulePass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid DTE() : ModulePass((intptr_t)&ID) {} // doPassInitialization - For this pass, it removes global symbol table @@ -43,7 +43,7 @@ AU.addRequired(); } }; - const char DTE::ID = 0; + char DTE::ID = 0; RegisterPass X("deadtypeelim", "Dead Type Elimination"); } Index: llvm/lib/Transforms/IPO/ExtractFunction.cpp diff -u llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.22 llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.23 --- llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.22 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/ExtractFunction.cpp Wed May 2 20:11:54 2007 @@ -25,7 +25,7 @@ bool deleteFunc; bool reLink; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid /// FunctionExtractorPass - If deleteFn is true, this pass deletes as the /// specified function. Otherwise, it deletes as much of the module as @@ -134,7 +134,7 @@ } }; - const char FunctionExtractorPass::ID = 0; + char FunctionExtractorPass::ID = 0; RegisterPass X("extract", "Function Extractor"); } Index: llvm/lib/Transforms/IPO/GlobalDCE.cpp diff -u llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.47 llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.48 --- llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.47 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/GlobalDCE.cpp Wed May 2 20:11:54 2007 @@ -30,7 +30,7 @@ namespace { struct VISIBILITY_HIDDEN GlobalDCE : public ModulePass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid GlobalDCE() : ModulePass((intptr_t)&ID) {} // run - Do the GlobalDCE pass on the specified module, optionally updating @@ -49,7 +49,7 @@ bool SafeToDestroyConstant(Constant* C); bool RemoveUnusedGlobalValue(GlobalValue &GV); }; - const char GlobalDCE::ID = 0; + char GlobalDCE::ID = 0; RegisterPass X("globaldce", "Dead Global Elimination"); } Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.103 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.104 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.103 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Wed May 2 20:11:54 2007 @@ -50,7 +50,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); } - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid GlobalOpt() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); @@ -63,7 +63,7 @@ bool ProcessInternalGlobal(GlobalVariable *GV,Module::global_iterator &GVI); }; - const char GlobalOpt::ID = 0; + char GlobalOpt::ID = 0; RegisterPass X("globalopt", "Global Variable Optimizer"); } Index: llvm/lib/Transforms/IPO/IPConstantPropagation.cpp diff -u llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.25 llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.26 --- llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.25 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/IPConstantPropagation.cpp Wed May 2 20:11:54 2007 @@ -33,7 +33,7 @@ /// IPCP - The interprocedural constant propagation pass /// struct VISIBILITY_HIDDEN IPCP : public ModulePass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid IPCP() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M); @@ -41,7 +41,7 @@ bool PropagateConstantsIntoArguments(Function &F); bool PropagateConstantReturn(Function &F); }; - const char IPCP::ID = 0; + char IPCP::ID = 0; RegisterPass X("ipconstprop", "Interprocedural constant propagation"); } Index: llvm/lib/Transforms/IPO/IndMemRemoval.cpp diff -u llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.17 llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.18 --- llvm/lib/Transforms/IPO/IndMemRemoval.cpp:1.17 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/IndMemRemoval.cpp Wed May 2 20:11:54 2007 @@ -32,12 +32,12 @@ namespace { class VISIBILITY_HIDDEN IndMemRemPass : public ModulePass { public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid IndMemRemPass() : ModulePass((intptr_t)&ID) {} virtual bool runOnModule(Module &M); }; - const char IndMemRemPass::ID = 0; + char IndMemRemPass::ID = 0; RegisterPass X("indmemrem","Indirect Malloc and Free Removal"); } // end anonymous namespace Index: llvm/lib/Transforms/IPO/InlineSimple.cpp diff -u llvm/lib/Transforms/IPO/InlineSimple.cpp:1.80 llvm/lib/Transforms/IPO/InlineSimple.cpp:1.81 --- llvm/lib/Transforms/IPO/InlineSimple.cpp:1.80 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/InlineSimple.cpp Wed May 2 20:11:54 2007 @@ -54,10 +54,10 @@ class VISIBILITY_HIDDEN SimpleInliner : public Inliner { std::map CachedFunctionInfo; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid int getInlineCost(CallSite CS); }; - const char SimpleInliner::ID = 0; + char SimpleInliner::ID = 0; RegisterPass X("inline", "Function Integration/Inlining"); } Index: llvm/lib/Transforms/IPO/Inliner.cpp diff -u llvm/lib/Transforms/IPO/Inliner.cpp:1.39 llvm/lib/Transforms/IPO/Inliner.cpp:1.40 --- llvm/lib/Transforms/IPO/Inliner.cpp:1.39 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/Inliner.cpp Wed May 2 20:11:54 2007 @@ -36,7 +36,7 @@ cl::desc("Control the amount of inlining to perform (default = 200)")); } -const char Inliner::ID = 0; +char Inliner::ID = 0; Inliner::Inliner() : CallGraphSCCPass((intptr_t)&ID), InlineThreshold(InlineLimit) {} Index: llvm/lib/Transforms/IPO/Inliner.h diff -u llvm/lib/Transforms/IPO/Inliner.h:1.11 llvm/lib/Transforms/IPO/Inliner.h:1.12 --- llvm/lib/Transforms/IPO/Inliner.h:1.11 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/Inliner.h Wed May 2 20:11:54 2007 @@ -27,7 +27,7 @@ /// perform the inlining operations that does not depend on the policy. /// struct Inliner : public CallGraphSCCPass { - static const char ID; + static char ID; Inliner(); /// getAnalysisUsage - For this class, we declare that we require and preserve Index: llvm/lib/Transforms/IPO/Internalize.cpp diff -u llvm/lib/Transforms/IPO/Internalize.cpp:1.47 llvm/lib/Transforms/IPO/Internalize.cpp:1.48 --- llvm/lib/Transforms/IPO/Internalize.cpp:1.47 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/Internalize.cpp Wed May 2 20:11:54 2007 @@ -46,13 +46,13 @@ std::set ExternalNames; bool DontInternalize; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid InternalizePass(bool InternalizeEverything = true); InternalizePass(const std::vector & exportList); void LoadFile(const char *Filename); virtual bool runOnModule(Module &M); }; - const char InternalizePass::ID = 0; + char InternalizePass::ID = 0; RegisterPass X("internalize", "Internalize Global Symbols"); } // end anonymous namespace Index: llvm/lib/Transforms/IPO/LoopExtractor.cpp diff -u llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.26 llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.27 --- llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.26 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/LoopExtractor.cpp Wed May 2 20:11:54 2007 @@ -34,7 +34,7 @@ // Module passes to require FunctionPasses, so we can't get loop info if we're // not a function pass. struct VISIBILITY_HIDDEN LoopExtractor : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid unsigned NumLoops; LoopExtractor(unsigned numLoops = ~0) @@ -51,17 +51,17 @@ } }; - const char LoopExtractor::ID = 0; + char LoopExtractor::ID = 0; RegisterPass X("loop-extract", "Extract loops into new functions"); /// SingleLoopExtractor - For bugpoint. struct SingleLoopExtractor : public LoopExtractor { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid SingleLoopExtractor() : LoopExtractor(1) {} }; - const char SingleLoopExtractor::ID = 0; + char SingleLoopExtractor::ID = 0; RegisterPass Y("loop-extract-single", "Extract at most one loop into a new function"); } // End anonymous namespace @@ -152,7 +152,7 @@ class BlockExtractorPass : public ModulePass { std::vector BlocksToNotExtract; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid BlockExtractorPass(std::vector &B) : ModulePass((intptr_t)&ID), BlocksToNotExtract(B) {} BlockExtractorPass() : ModulePass((intptr_t)&ID) {} @@ -160,7 +160,7 @@ bool runOnModule(Module &M); }; - const char BlockExtractorPass::ID = 0; + char BlockExtractorPass::ID = 0; RegisterPass XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)"); } Index: llvm/lib/Transforms/IPO/LowerSetJmp.cpp diff -u llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.42 llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.43 --- llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.42 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/LowerSetJmp.cpp Wed May 2 20:11:54 2007 @@ -109,7 +109,7 @@ bool IsTransformableFunction(const std::string& Name); public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid LowerSetJmp() : ModulePass((intptr_t)&ID) {} void visitCallInst(CallInst& CI); @@ -121,7 +121,7 @@ bool doInitialization(Module& M); }; - const char LowerSetJmp::ID = 0; + char LowerSetJmp::ID = 0; RegisterPass X("lowersetjmp", "Lower Set Jump"); } // end anonymous namespace Index: llvm/lib/Transforms/IPO/PruneEH.cpp diff -u llvm/lib/Transforms/IPO/PruneEH.cpp:1.33 llvm/lib/Transforms/IPO/PruneEH.cpp:1.34 --- llvm/lib/Transforms/IPO/PruneEH.cpp:1.33 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/PruneEH.cpp Wed May 2 20:11:54 2007 @@ -35,7 +35,7 @@ namespace { struct VISIBILITY_HIDDEN PruneEH : public CallGraphSCCPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid PruneEH() : CallGraphSCCPass((intptr_t)&ID) {} /// DoesNotUnwind - This set contains all of the functions which we have @@ -53,7 +53,7 @@ void DeleteBasicBlock(BasicBlock *BB); }; - const char PruneEH::ID = 0; + char PruneEH::ID = 0; RegisterPass X("prune-eh", "Remove unused exception handling info"); } Index: llvm/lib/Transforms/IPO/RaiseAllocations.cpp diff -u llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.42 llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.43 --- llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.42 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/RaiseAllocations.cpp Wed May 2 20:11:54 2007 @@ -35,7 +35,7 @@ Function *MallocFunc; // Functions in the module we are processing Function *FreeFunc; // Initialized by doPassInitializationVirt public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid RaiseAllocations() : ModulePass((intptr_t)&ID), MallocFunc(0), FreeFunc(0) {} @@ -49,7 +49,7 @@ bool runOnModule(Module &M); }; - const char RaiseAllocations::ID = 0; + char RaiseAllocations::ID = 0; RegisterPass X("raiseallocs", "Raise allocations from calls to instructions"); } // end anonymous namespace Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.114 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.115 --- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.114 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp Wed May 2 20:11:54 2007 @@ -152,7 +152,7 @@ /// @brief A ModulePass for optimizing well-known function calls. class VISIBILITY_HIDDEN SimplifyLibCalls : public ModulePass { public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid SimplifyLibCalls() : ModulePass((intptr_t)&ID) {} /// We need some target data for accurate signature details that are @@ -376,7 +376,7 @@ TargetData *TD; ///< Cached TargetData }; -const char SimplifyLibCalls::ID = 0; +char SimplifyLibCalls::ID = 0; // Register the pass RegisterPass X("simplify-libcalls", "Simplify well-known library calls"); Index: llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp diff -u llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.7 llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.8 --- llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp:1.7 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp Wed May 2 20:11:54 2007 @@ -27,12 +27,12 @@ /// @brief Pass to remove unused function declarations. class VISIBILITY_HIDDEN StripDeadPrototypesPass : public ModulePass { public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid StripDeadPrototypesPass() : ModulePass((intptr_t)&ID) { } virtual bool runOnModule(Module &M); }; -const char StripDeadPrototypesPass::ID = 0; +char StripDeadPrototypesPass::ID = 0; RegisterPass X("strip-dead-prototypes", "Strip Unused Function Prototypes"); Index: llvm/lib/Transforms/IPO/StripSymbols.cpp diff -u llvm/lib/Transforms/IPO/StripSymbols.cpp:1.17 llvm/lib/Transforms/IPO/StripSymbols.cpp:1.18 --- llvm/lib/Transforms/IPO/StripSymbols.cpp:1.17 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/IPO/StripSymbols.cpp Wed May 2 20:11:54 2007 @@ -37,7 +37,7 @@ class VISIBILITY_HIDDEN StripSymbols : public ModulePass { bool OnlyDebugInfo; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid StripSymbols(bool ODI = false) : ModulePass((intptr_t)&ID), OnlyDebugInfo(ODI) {} @@ -48,7 +48,7 @@ } }; - const char StripSymbols::ID = 0; + char StripSymbols::ID = 0; RegisterPass X("strip", "Strip all symbols from a module"); } From dpatel at apple.com Wed May 2 20:14:09 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:09 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h Message-ID: <200705030114.l431E9cP030189@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms/Utils: UnifyFunctionExitNodes.h updated: 1.22 -> 1.23 --- Log message: Drop 'const' --- Diffs of the changes: (+1 -1) UnifyFunctionExitNodes.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h diff -u llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:1.22 llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:1.23 --- llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:1.22 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h Wed May 2 20:11:53 2007 @@ -25,7 +25,7 @@ struct UnifyFunctionExitNodes : public FunctionPass { BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid UnifyFunctionExitNodes() : FunctionPass((intptr_t)&ID), ReturnBlock(0), UnwindBlock(0) {} From dpatel at apple.com Wed May 2 20:14:09 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Hello/Hello.cpp Message-ID: <200705030114.l431E9dA030210@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Hello: Hello.cpp updated: 1.16 -> 1.17 --- Log message: Drop 'const' --- Diffs of the changes: (+4 -4) Hello.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Transforms/Hello/Hello.cpp diff -u llvm/lib/Transforms/Hello/Hello.cpp:1.16 llvm/lib/Transforms/Hello/Hello.cpp:1.17 --- llvm/lib/Transforms/Hello/Hello.cpp:1.16 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Hello/Hello.cpp Wed May 2 20:11:54 2007 @@ -25,7 +25,7 @@ namespace { // Hello - The first implementation, without getAnalysisUsage. struct Hello : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid Hello() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { @@ -37,12 +37,12 @@ } }; - const char Hello::ID = 0; + char Hello::ID = 0; RegisterPass X("hello", "Hello World Pass"); // Hello2 - The second implementation with getAnalysisUsage implemented. struct Hello2 : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid Hello2() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { @@ -58,7 +58,7 @@ AU.setPreservesAll(); }; }; - const char Hello2::ID = 0; + char Hello2::ID = 0; RegisterPass Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)"); } From dpatel at apple.com Wed May 2 20:14:10 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:10 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasAnalysis.h CallGraph.h Dominators.h FindUsedTypes.h IntervalPartition.h LoopInfo.h LoopPass.h PostDominators.h ProfileInfo.h ScalarEvolution.h ValueNumbering.h Message-ID: <200705030114.l431EA9t030252@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasAnalysis.h updated: 1.30 -> 1.31 CallGraph.h updated: 1.55 -> 1.56 Dominators.h updated: 1.78 -> 1.79 FindUsedTypes.h updated: 1.31 -> 1.32 IntervalPartition.h updated: 1.25 -> 1.26 LoopInfo.h updated: 1.65 -> 1.66 LoopPass.h updated: 1.17 -> 1.18 PostDominators.h updated: 1.19 -> 1.20 ProfileInfo.h updated: 1.7 -> 1.8 ScalarEvolution.h updated: 1.18 -> 1.19 ValueNumbering.h updated: 1.12 -> 1.13 --- Log message: Drop 'const' --- Diffs of the changes: (+15 -15) AliasAnalysis.h | 2 +- CallGraph.h | 2 +- Dominators.h | 6 +++--- FindUsedTypes.h | 2 +- IntervalPartition.h | 2 +- LoopInfo.h | 2 +- LoopPass.h | 2 +- PostDominators.h | 6 +++--- ProfileInfo.h | 2 +- ScalarEvolution.h | 2 +- ValueNumbering.h | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) Index: llvm/include/llvm/Analysis/AliasAnalysis.h diff -u llvm/include/llvm/Analysis/AliasAnalysis.h:1.30 llvm/include/llvm/Analysis/AliasAnalysis.h:1.31 --- llvm/include/llvm/Analysis/AliasAnalysis.h:1.30 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Analysis/AliasAnalysis.h Wed May 2 20:11:53 2007 @@ -61,7 +61,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const; public: - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo AliasAnalysis() : TD(0), AA(0) {} virtual ~AliasAnalysis(); // We want to be subclassed Index: llvm/include/llvm/Analysis/CallGraph.h diff -u llvm/include/llvm/Analysis/CallGraph.h:1.55 llvm/include/llvm/Analysis/CallGraph.h:1.56 --- llvm/include/llvm/Analysis/CallGraph.h:1.55 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Analysis/CallGraph.h Wed May 2 20:11:53 2007 @@ -73,7 +73,7 @@ FunctionMapTy FunctionMap; // Map from a function to its node public: - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo //===--------------------------------------------------------------------- // Accessors... // Index: llvm/include/llvm/Analysis/Dominators.h diff -u llvm/include/llvm/Analysis/Dominators.h:1.78 llvm/include/llvm/Analysis/Dominators.h:1.79 --- llvm/include/llvm/Analysis/Dominators.h:1.78 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Analysis/Dominators.h Wed May 2 20:11:53 2007 @@ -208,7 +208,7 @@ /// class DominatorTree : public DominatorTreeBase { public: - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid DominatorTree() : DominatorTreeBase((intptr_t)&ID, false) {} BasicBlock *getRoot() const { @@ -399,7 +399,7 @@ class ETForest : public ETForestBase { public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid ETForest() : ETForestBase((intptr_t)&ID, false) {} @@ -477,7 +477,7 @@ /// class DominanceFrontier : public DominanceFrontierBase { public: - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid DominanceFrontier() : DominanceFrontierBase((intptr_t)& ID, false) {} Index: llvm/include/llvm/Analysis/FindUsedTypes.h diff -u llvm/include/llvm/Analysis/FindUsedTypes.h:1.31 llvm/include/llvm/Analysis/FindUsedTypes.h:1.32 --- llvm/include/llvm/Analysis/FindUsedTypes.h:1.31 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Analysis/FindUsedTypes.h Wed May 2 20:11:53 2007 @@ -24,7 +24,7 @@ class FindUsedTypes : public ModulePass { std::set UsedTypes; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid FindUsedTypes() : ModulePass((intptr_t)&ID) {} /// getTypes - After the pass has been run, return the set containing all of Index: llvm/include/llvm/Analysis/IntervalPartition.h diff -u llvm/include/llvm/Analysis/IntervalPartition.h:1.25 llvm/include/llvm/Analysis/IntervalPartition.h:1.26 --- llvm/include/llvm/Analysis/IntervalPartition.h:1.25 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Analysis/IntervalPartition.h Wed May 2 20:11:53 2007 @@ -45,7 +45,7 @@ std::vector Intervals; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid IntervalPartition() : FunctionPass((intptr_t)&ID), RootInterval(0) {} Index: llvm/include/llvm/Analysis/LoopInfo.h diff -u llvm/include/llvm/Analysis/LoopInfo.h:1.65 llvm/include/llvm/Analysis/LoopInfo.h:1.66 --- llvm/include/llvm/Analysis/LoopInfo.h:1.65 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Analysis/LoopInfo.h Wed May 2 20:11:53 2007 @@ -241,7 +241,7 @@ std::vector TopLevelLoops; friend class Loop; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid LoopInfo() : FunctionPass((intptr_t)&ID) {} ~LoopInfo() { releaseMemory(); } Index: llvm/include/llvm/Analysis/LoopPass.h diff -u llvm/include/llvm/Analysis/LoopPass.h:1.17 llvm/include/llvm/Analysis/LoopPass.h:1.18 --- llvm/include/llvm/Analysis/LoopPass.h:1.17 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Analysis/LoopPass.h Wed May 2 20:11:53 2007 @@ -68,7 +68,7 @@ class LPPassManager : public FunctionPass, public PMDataManager { public: - static const char ID; + static char ID; LPPassManager(int Depth); /// run - Execute all of the passes scheduled for execution. Keep track of Index: llvm/include/llvm/Analysis/PostDominators.h diff -u llvm/include/llvm/Analysis/PostDominators.h:1.19 llvm/include/llvm/Analysis/PostDominators.h:1.20 --- llvm/include/llvm/Analysis/PostDominators.h:1.19 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Analysis/PostDominators.h Wed May 2 20:11:53 2007 @@ -22,7 +22,7 @@ /// compute the a post-dominator tree. /// struct PostDominatorTree : public DominatorTreeBase { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid PostDominatorTree() : DominatorTreeBase((intptr_t)&ID, true) {} @@ -54,7 +54,7 @@ /// PostETForest Class - Concrete subclass of ETForestBase that is used to /// compute a forwards post-dominator ET-Forest. struct PostETForest : public ETForestBase { - static const char ID; + static char ID; PostETForest() : ETForestBase((intptr_t)&ID, true) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -79,7 +79,7 @@ /// used to compute the a post-dominance frontier. /// struct PostDominanceFrontier : public DominanceFrontierBase { - static const char ID; + static char ID; PostDominanceFrontier() : DominanceFrontierBase((intptr_t) &ID, true) {} Index: llvm/include/llvm/Analysis/ProfileInfo.h diff -u llvm/include/llvm/Analysis/ProfileInfo.h:1.7 llvm/include/llvm/Analysis/ProfileInfo.h:1.8 --- llvm/include/llvm/Analysis/ProfileInfo.h:1.7 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Analysis/ProfileInfo.h Wed May 2 20:11:53 2007 @@ -38,7 +38,7 @@ // entered. std::map, unsigned> EdgeCounts; public: - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo virtual ~ProfileInfo(); // We want to be subclassed //===------------------------------------------------------------------===// Index: llvm/include/llvm/Analysis/ScalarEvolution.h diff -u llvm/include/llvm/Analysis/ScalarEvolution.h:1.18 llvm/include/llvm/Analysis/ScalarEvolution.h:1.19 --- llvm/include/llvm/Analysis/ScalarEvolution.h:1.18 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Analysis/ScalarEvolution.h Wed May 2 20:11:53 2007 @@ -197,7 +197,7 @@ class ScalarEvolution : public FunctionPass { void *Impl; // ScalarEvolution uses the pimpl pattern public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid ScalarEvolution() : FunctionPass((intptr_t)&ID), Impl(0) {} /// getSCEV - Return a SCEV expression handle for the full generality of the Index: llvm/include/llvm/Analysis/ValueNumbering.h diff -u llvm/include/llvm/Analysis/ValueNumbering.h:1.12 llvm/include/llvm/Analysis/ValueNumbering.h:1.13 --- llvm/include/llvm/Analysis/ValueNumbering.h:1.12 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Analysis/ValueNumbering.h Wed May 2 20:11:53 2007 @@ -29,7 +29,7 @@ class Instruction; struct ValueNumbering { - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo virtual ~ValueNumbering(); // We want to be subclassed /// getEqualNumberNodes - Return nodes with the same value number as the From dpatel at apple.com Wed May 2 20:14:10 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp LCSSA.cpp LoopSimplify.cpp LowerAllocations.cpp LowerInvoke.cpp LowerSelect.cpp LowerSwitch.cpp Mem2Reg.cpp UnifyFunctionExitNodes.cpp Message-ID: <200705030114.l431EA6Y030298@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: BreakCriticalEdges.cpp updated: 1.46 -> 1.47 LCSSA.cpp updated: 1.40 -> 1.41 LoopSimplify.cpp updated: 1.94 -> 1.95 LowerAllocations.cpp updated: 1.75 -> 1.76 LowerInvoke.cpp updated: 1.61 -> 1.62 LowerSelect.cpp updated: 1.14 -> 1.15 LowerSwitch.cpp updated: 1.40 -> 1.41 Mem2Reg.cpp updated: 1.28 -> 1.29 UnifyFunctionExitNodes.cpp updated: 1.38 -> 1.39 --- Log message: Drop 'const' --- Diffs of the changes: (+17 -17) BreakCriticalEdges.cpp | 4 ++-- LCSSA.cpp | 4 ++-- LoopSimplify.cpp | 4 ++-- LowerAllocations.cpp | 4 ++-- LowerInvoke.cpp | 4 ++-- LowerSelect.cpp | 4 ++-- LowerSwitch.cpp | 4 ++-- Mem2Reg.cpp | 4 ++-- UnifyFunctionExitNodes.cpp | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) Index: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp diff -u llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.46 llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.47 --- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.46 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp Wed May 2 20:11:54 2007 @@ -34,7 +34,7 @@ namespace { struct VISIBILITY_HIDDEN BreakCriticalEdges : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid BreakCriticalEdges() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -50,7 +50,7 @@ } }; - const char BreakCriticalEdges::ID = 0; + char BreakCriticalEdges::ID = 0; RegisterPass X("break-crit-edges", "Break critical edges in CFG"); } Index: llvm/lib/Transforms/Utils/LCSSA.cpp diff -u llvm/lib/Transforms/Utils/LCSSA.cpp:1.40 llvm/lib/Transforms/Utils/LCSSA.cpp:1.41 --- llvm/lib/Transforms/Utils/LCSSA.cpp:1.40 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Utils/LCSSA.cpp Wed May 2 20:11:54 2007 @@ -47,7 +47,7 @@ namespace { struct VISIBILITY_HIDDEN LCSSA : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid LCSSA() : FunctionPass((intptr_t)&ID) {} // Cached analysis information for the current function. @@ -84,7 +84,7 @@ } }; - const char LCSSA::ID = 0; + char LCSSA::ID = 0; RegisterPass X("lcssa", "Loop-Closed SSA Form Pass"); } Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.94 llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.95 --- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.94 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Utils/LoopSimplify.cpp Wed May 2 20:11:54 2007 @@ -54,7 +54,7 @@ namespace { struct VISIBILITY_HIDDEN LoopSimplify : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid LoopSimplify() : FunctionPass((intptr_t)&ID) {} // AA - If we have an alias analysis object to update, this is it, otherwise @@ -92,7 +92,7 @@ std::vector &PredBlocks); }; - const char LoopSimplify::ID = 0; + char LoopSimplify::ID = 0; RegisterPass X("loopsimplify", "Canonicalize natural loops", true); } Index: llvm/lib/Transforms/Utils/LowerAllocations.cpp diff -u llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.75 llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.76 --- llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.75 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Utils/LowerAllocations.cpp Wed May 2 20:11:54 2007 @@ -36,7 +36,7 @@ Constant *FreeFunc; // Initialized by doInitialization bool LowerMallocArgToInteger; public: - static const char ID; // Pass ID, replacement for typeid + static char ID; // Pass ID, replacement for typeid LowerAllocations(bool LowerToInt = false) : BasicBlockPass((intptr_t)&ID), MallocFunc(0), FreeFunc(0), LowerMallocArgToInteger(LowerToInt) {} @@ -68,7 +68,7 @@ bool runOnBasicBlock(BasicBlock &BB); }; - const char LowerAllocations::ID = 0; + char LowerAllocations::ID = 0; RegisterPass X("lowerallocs", "Lower allocations from instructions to calls"); } Index: llvm/lib/Transforms/Utils/LowerInvoke.cpp diff -u llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.61 llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.62 --- llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.61 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Utils/LowerInvoke.cpp Wed May 2 20:11:54 2007 @@ -75,7 +75,7 @@ const TargetLowering *TLI; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid LowerInvoke(const TargetLowering *tli = NULL) : FunctionPass((intptr_t)&ID), TLI(tli) { } bool doInitialization(Module &M); @@ -99,7 +99,7 @@ bool insertExpensiveEHSupport(Function &F); }; - const char LowerInvoke::ID = 0; + char LowerInvoke::ID = 0; RegisterPass X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators"); } Index: llvm/lib/Transforms/Utils/LowerSelect.cpp diff -u llvm/lib/Transforms/Utils/LowerSelect.cpp:1.14 llvm/lib/Transforms/Utils/LowerSelect.cpp:1.15 --- llvm/lib/Transforms/Utils/LowerSelect.cpp:1.14 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Utils/LowerSelect.cpp Wed May 2 20:11:54 2007 @@ -33,7 +33,7 @@ class VISIBILITY_HIDDEN LowerSelect : public FunctionPass { bool OnlyFP; // Only lower FP select instructions? public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid LowerSelect(bool onlyfp = false) : FunctionPass((intptr_t)&ID), OnlyFP(onlyfp) {} @@ -50,7 +50,7 @@ bool runOnFunction(Function &F); }; - const char LowerSelect::ID = 0; + char LowerSelect::ID = 0; RegisterPass X("lowerselect", "Lower select instructions to branches"); } Index: llvm/lib/Transforms/Utils/LowerSwitch.cpp diff -u llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.40 llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.41 --- llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.40 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Utils/LowerSwitch.cpp Wed May 2 20:11:54 2007 @@ -30,7 +30,7 @@ /// modifies the CFG! class VISIBILITY_HIDDEN LowerSwitch : public FunctionPass { public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid LowerSwitch() : FunctionPass((intptr_t) &ID) {} virtual bool runOnFunction(Function &F); @@ -78,7 +78,7 @@ } }; - const char LowerSwitch::ID = 0; + char LowerSwitch::ID = 0; RegisterPass X("lowerswitch", "Lower SwitchInst's to branches"); } Index: llvm/lib/Transforms/Utils/Mem2Reg.cpp diff -u llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.28 llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.29 --- llvm/lib/Transforms/Utils/Mem2Reg.cpp:1.28 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Utils/Mem2Reg.cpp Wed May 2 20:11:54 2007 @@ -27,7 +27,7 @@ namespace { struct VISIBILITY_HIDDEN PromotePass : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid PromotePass() : FunctionPass((intptr_t)&ID) {} // runOnFunction - To run this pass, first we calculate the alloca @@ -50,7 +50,7 @@ } }; - const char PromotePass::ID = 0; + char PromotePass::ID = 0; RegisterPass X("mem2reg", "Promote Memory to Register"); } // end of anonymous namespace Index: llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp diff -u llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.38 llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.39 --- llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:1.38 Wed May 2 16:39:19 2007 +++ llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp Wed May 2 20:11:54 2007 @@ -22,7 +22,7 @@ #include "llvm/Type.h" using namespace llvm; -const char UnifyFunctionExitNodes::ID = 0; +char UnifyFunctionExitNodes::ID = 0; static RegisterPass X("mergereturn", "Unify function exit nodes"); From dpatel at apple.com Wed May 2 20:14:11 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:11 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/WriteBytecodePass.h Message-ID: <200705030114.l431EBZj030336@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bytecode: WriteBytecodePass.h updated: 1.21 -> 1.22 --- Log message: Drop 'const' --- Diffs of the changes: (+1 -1) WriteBytecodePass.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Bytecode/WriteBytecodePass.h diff -u llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.21 llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.22 --- llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.21 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/Bytecode/WriteBytecodePass.h Wed May 2 20:11:53 2007 @@ -26,7 +26,7 @@ bool DeleteStream; bool CompressFile; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid WriteBytecodePass() : ModulePass((intptr_t) &ID), Out(&cout), DeleteStream(false), CompressFile(false) {} From dpatel at apple.com Wed May 2 20:14:10 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaBranchSelector.cpp AlphaCodeEmitter.cpp AlphaLLRP.cpp Message-ID: <200705030114.l431EAvu030265@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaBranchSelector.cpp updated: 1.4 -> 1.5 AlphaCodeEmitter.cpp updated: 1.23 -> 1.24 AlphaLLRP.cpp updated: 1.10 -> 1.11 --- Log message: Drop 'const' --- Diffs of the changes: (+6 -6) AlphaBranchSelector.cpp | 4 ++-- AlphaCodeEmitter.cpp | 4 ++-- AlphaLLRP.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/lib/Target/Alpha/AlphaBranchSelector.cpp diff -u llvm/lib/Target/Alpha/AlphaBranchSelector.cpp:1.4 llvm/lib/Target/Alpha/AlphaBranchSelector.cpp:1.5 --- llvm/lib/Target/Alpha/AlphaBranchSelector.cpp:1.4 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/Alpha/AlphaBranchSelector.cpp Wed May 2 20:11:53 2007 @@ -22,7 +22,7 @@ namespace { struct VISIBILITY_HIDDEN AlphaBSel : public MachineFunctionPass { - static const char ID; + static char ID; AlphaBSel() : MachineFunctionPass((intptr_t)&ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); @@ -31,7 +31,7 @@ return "Alpha Branch Selection"; } }; - const char AlphaBSel::ID = 0; + char AlphaBSel::ID = 0; } /// createAlphaBranchSelectionPass - returns an instance of the Branch Selection Index: llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp diff -u llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.23 llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.24 --- llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp:1.23 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/Alpha/AlphaCodeEmitter.cpp Wed May 2 20:11:53 2007 @@ -36,7 +36,7 @@ int getMachineOpValue(MachineInstr &MI, MachineOperand &MO); public: - static const char ID; + static char ID; explicit AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce) : MachineFunctionPass((intptr_t)&ID), II(0), TM(tm), MCE(mce) {} AlphaCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce, @@ -61,7 +61,7 @@ void emitBasicBlock(MachineBasicBlock &MBB); }; - const char AlphaCodeEmitter::ID = 0; + char AlphaCodeEmitter::ID = 0; } /// createAlphaCodeEmitterPass - Return a pass that emits the collected Alpha code Index: llvm/lib/Target/Alpha/AlphaLLRP.cpp diff -u llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.10 llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.11 --- llvm/lib/Target/Alpha/AlphaLLRP.cpp:1.10 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/Alpha/AlphaLLRP.cpp Wed May 2 20:11:53 2007 @@ -37,7 +37,7 @@ /// AlphaTargetMachine &TM; - static const char ID; + static char ID; AlphaLLRPPass(AlphaTargetMachine &tm) : MachineFunctionPass((intptr_t)&ID), TM(tm) { } @@ -154,7 +154,7 @@ return Changed; } }; - const char AlphaLLRPPass::ID = 0; + char AlphaLLRPPass::ID = 0; } // end of anonymous namespace FunctionPass *llvm::createAlphaLLRPPass(AlphaTargetMachine &tm) { From dpatel at apple.com Wed May 2 20:14:10 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp BranchFolding.cpp ELFWriter.cpp ELFWriter.h LiveIntervalAnalysis.cpp LiveVariables.cpp MachOWriter.cpp MachOWriter.h MachineFunction.cpp MachineModuleInfo.cpp PHIElimination.cpp PrologEpilogInserter.cpp RegAllocLinearScan.cpp RegAllocLocal.cpp RegAllocSimple.cpp TwoAddressInstructionPass.cpp UnreachableBlockElim.cpp Message-ID: <200705030114.l431EA6K030288@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.162 -> 1.163 BranchFolding.cpp updated: 1.48 -> 1.49 ELFWriter.cpp updated: 1.40 -> 1.41 ELFWriter.h updated: 1.3 -> 1.4 LiveIntervalAnalysis.cpp updated: 1.242 -> 1.243 LiveVariables.cpp updated: 1.81 -> 1.82 MachOWriter.cpp updated: 1.34 -> 1.35 MachOWriter.h updated: 1.5 -> 1.6 MachineFunction.cpp updated: 1.113 -> 1.114 MachineModuleInfo.cpp updated: 1.8 -> 1.9 PHIElimination.cpp updated: 1.59 -> 1.60 PrologEpilogInserter.cpp updated: 1.86 -> 1.87 RegAllocLinearScan.cpp updated: 1.147 -> 1.148 RegAllocLocal.cpp updated: 1.104 -> 1.105 RegAllocSimple.cpp updated: 1.85 -> 1.86 TwoAddressInstructionPass.cpp updated: 1.49 -> 1.50 UnreachableBlockElim.cpp updated: 1.11 -> 1.12 --- Log message: Drop 'const' --- Diffs of the changes: (+30 -30) AsmPrinter.cpp | 2 +- BranchFolding.cpp | 4 ++-- ELFWriter.cpp | 2 +- ELFWriter.h | 2 +- LiveIntervalAnalysis.cpp | 2 +- LiveVariables.cpp | 2 +- MachOWriter.cpp | 2 +- MachOWriter.h | 2 +- MachineFunction.cpp | 8 ++++---- MachineModuleInfo.cpp | 6 +++--- PHIElimination.cpp | 4 ++-- PrologEpilogInserter.cpp | 4 ++-- RegAllocLinearScan.cpp | 4 ++-- RegAllocLocal.cpp | 4 ++-- RegAllocSimple.cpp | 4 ++-- TwoAddressInstructionPass.cpp | 4 ++-- UnreachableBlockElim.cpp | 4 ++-- 17 files changed, 30 insertions(+), 30 deletions(-) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.162 llvm/lib/CodeGen/AsmPrinter.cpp:1.163 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.162 Wed May 2 16:39:18 2007 +++ llvm/lib/CodeGen/AsmPrinter.cpp Wed May 2 20:11:53 2007 @@ -32,7 +32,7 @@ static cl::opt AsmVerbose("asm-verbose", cl::Hidden, cl::desc("Add comments to directives.")); -const char AsmPrinter::ID = 0; +char AsmPrinter::ID = 0; AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm, const TargetAsmInfo *T) : MachineFunctionPass((intptr_t)&ID), FunctionNumber(0), O(o), TM(tm), TAI(T) Index: llvm/lib/CodeGen/BranchFolding.cpp diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.48 llvm/lib/CodeGen/BranchFolding.cpp:1.49 --- llvm/lib/CodeGen/BranchFolding.cpp:1.48 Wed May 2 16:39:18 2007 +++ llvm/lib/CodeGen/BranchFolding.cpp Wed May 2 20:11:53 2007 @@ -39,7 +39,7 @@ namespace { struct BranchFolder : public MachineFunctionPass { - static const char ID; + static char ID; BranchFolder() : MachineFunctionPass((intptr_t)&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); @@ -67,7 +67,7 @@ MachineBasicBlock *TBB, MachineBasicBlock *FBB, const std::vector &Cond); }; - const char BranchFolder::ID = 0; + char BranchFolder::ID = 0; } FunctionPass *llvm::createBranchFoldingPass() { return new BranchFolder(); } Index: llvm/lib/CodeGen/ELFWriter.cpp diff -u llvm/lib/CodeGen/ELFWriter.cpp:1.40 llvm/lib/CodeGen/ELFWriter.cpp:1.41 --- llvm/lib/CodeGen/ELFWriter.cpp:1.40 Wed May 2 16:39:18 2007 +++ llvm/lib/CodeGen/ELFWriter.cpp Wed May 2 20:11:53 2007 @@ -47,7 +47,7 @@ #include using namespace llvm; -const char ELFWriter::ID = 0; +char ELFWriter::ID = 0; /// AddELFWriter - Concrete function to add the ELF writer to the function pass /// manager. MachineCodeEmitter *llvm::AddELFWriter(FunctionPassManager &FPM, Index: llvm/lib/CodeGen/ELFWriter.h diff -u llvm/lib/CodeGen/ELFWriter.h:1.3 llvm/lib/CodeGen/ELFWriter.h:1.4 --- llvm/lib/CodeGen/ELFWriter.h:1.3 Wed May 2 16:39:18 2007 +++ llvm/lib/CodeGen/ELFWriter.h Wed May 2 20:11:53 2007 @@ -30,7 +30,7 @@ class ELFWriter : public MachineFunctionPass { friend class ELFCodeEmitter; public: - static const char ID; + static char ID; MachineCodeEmitter &getMachineCodeEmitter() const { return *(MachineCodeEmitter*)MCE; Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.242 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.243 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.242 Wed May 2 16:39:18 2007 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Wed May 2 20:11:53 2007 @@ -44,7 +44,7 @@ STATISTIC(numFolded , "Number of loads/stores folded into instructions"); STATISTIC(numAborts , "Number of times interval joining aborted"); -const char LiveIntervals::ID = 0; +char LiveIntervals::ID = 0; namespace { RegisterPass X("liveintervals", "Live Interval Analysis"); Index: llvm/lib/CodeGen/LiveVariables.cpp diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.81 llvm/lib/CodeGen/LiveVariables.cpp:1.82 --- llvm/lib/CodeGen/LiveVariables.cpp:1.81 Wed May 2 16:39:18 2007 +++ llvm/lib/CodeGen/LiveVariables.cpp Wed May 2 20:11:53 2007 @@ -37,7 +37,7 @@ #include using namespace llvm; -const char LiveVariables::ID = 0; +char LiveVariables::ID = 0; static RegisterPass X("livevars", "Live Variable Analysis"); void LiveVariables::VarInfo::dump() const { Index: llvm/lib/CodeGen/MachOWriter.cpp diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.34 llvm/lib/CodeGen/MachOWriter.cpp:1.35 --- llvm/lib/CodeGen/MachOWriter.cpp:1.34 Wed May 2 16:39:19 2007 +++ llvm/lib/CodeGen/MachOWriter.cpp Wed May 2 20:11:53 2007 @@ -317,7 +317,7 @@ // MachOWriter Implementation //===----------------------------------------------------------------------===// -const char MachOWriter::ID = 0; +char MachOWriter::ID = 0; MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm) : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) { is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64; Index: llvm/lib/CodeGen/MachOWriter.h diff -u llvm/lib/CodeGen/MachOWriter.h:1.5 llvm/lib/CodeGen/MachOWriter.h:1.6 --- llvm/lib/CodeGen/MachOWriter.h:1.5 Wed May 2 16:39:19 2007 +++ llvm/lib/CodeGen/MachOWriter.h Wed May 2 20:11:53 2007 @@ -84,7 +84,7 @@ class MachOWriter : public MachineFunctionPass { friend class MachOCodeEmitter; public: - static const char ID; + static char ID; MachineCodeEmitter &getMachineCodeEmitter() const { return *(MachineCodeEmitter*)MCE; } Index: llvm/lib/CodeGen/MachineFunction.cpp diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.113 llvm/lib/CodeGen/MachineFunction.cpp:1.114 --- llvm/lib/CodeGen/MachineFunction.cpp:1.113 Wed May 2 16:39:19 2007 +++ llvm/lib/CodeGen/MachineFunction.cpp Wed May 2 20:11:53 2007 @@ -44,7 +44,7 @@ namespace { struct VISIBILITY_HIDDEN Printer : public MachineFunctionPass { - static const char ID; + static char ID; std::ostream *OS; const std::string Banner; @@ -64,7 +64,7 @@ return false; } }; - const char Printer::ID = 0; + char Printer::ID = 0; } /// Returns a newly-created MachineFunction Printer pass. The default output @@ -77,7 +77,7 @@ namespace { struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass { - static const char ID; + static char ID; Deleter() : MachineFunctionPass((intptr_t)&ID) {} const char *getPassName() const { return "Machine Code Deleter"; } @@ -88,7 +88,7 @@ return true; } }; - const char Deleter::ID = 0; + char Deleter::ID = 0; } /// MachineCodeDeletion Pass - This pass deletes all of the machine code for Index: llvm/lib/CodeGen/MachineModuleInfo.cpp diff -u llvm/lib/CodeGen/MachineModuleInfo.cpp:1.8 llvm/lib/CodeGen/MachineModuleInfo.cpp:1.9 --- llvm/lib/CodeGen/MachineModuleInfo.cpp:1.8 Wed May 2 16:39:19 2007 +++ llvm/lib/CodeGen/MachineModuleInfo.cpp Wed May 2 20:11:53 2007 @@ -30,7 +30,7 @@ namespace { RegisterPass X("machinemoduleinfo", "Module Information"); } -const char MachineModuleInfo::ID = 0; +char MachineModuleInfo::ID = 0; //===----------------------------------------------------------------------===// @@ -1751,14 +1751,14 @@ namespace llvm { struct DebugLabelFolder : public MachineFunctionPass { - static const char ID; + static char ID; DebugLabelFolder() : MachineFunctionPass((intptr_t)&ID) {} virtual bool runOnMachineFunction(MachineFunction &MF); virtual const char *getPassName() const { return "Label Folder"; } }; -const char DebugLabelFolder::ID = 0; +char DebugLabelFolder::ID = 0; bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) { // Get machine module info. Index: llvm/lib/CodeGen/PHIElimination.cpp diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.59 llvm/lib/CodeGen/PHIElimination.cpp:1.60 --- llvm/lib/CodeGen/PHIElimination.cpp:1.59 Wed May 2 16:39:19 2007 +++ llvm/lib/CodeGen/PHIElimination.cpp Wed May 2 20:11:53 2007 @@ -33,7 +33,7 @@ namespace { struct VISIBILITY_HIDDEN PNE : public MachineFunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid PNE() : MachineFunctionPass((intptr_t)&ID) {} bool runOnMachineFunction(MachineFunction &Fn) { @@ -76,7 +76,7 @@ VRegPHIUse VRegPHIUseCount; }; - const char PNE::ID = 0; + char PNE::ID = 0; RegisterPass X("phi-node-elimination", "Eliminate PHI nodes for register allocation"); } Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.86 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.87 --- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.86 Wed May 2 16:39:19 2007 +++ llvm/lib/CodeGen/PrologEpilogInserter.cpp Wed May 2 20:11:53 2007 @@ -32,7 +32,7 @@ namespace { struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass { - static const char ID; + static char ID; PEI() : MachineFunctionPass((intptr_t)&ID) {} const char *getPassName() const { @@ -101,7 +101,7 @@ void replaceFrameIndices(MachineFunction &Fn); void insertPrologEpilogCode(MachineFunction &Fn); }; - const char PEI::ID = 0; + char PEI::ID = 0; } Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.147 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.148 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.147 Wed May 2 16:39:19 2007 +++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Wed May 2 20:11:53 2007 @@ -48,7 +48,7 @@ static unsigned numIntervals = 0; struct VISIBILITY_HIDDEN RA : public MachineFunctionPass { - static const char ID; + static char ID; RA() : MachineFunctionPass((intptr_t)&ID) {} typedef std::pair IntervalPtr; @@ -149,7 +149,7 @@ } } }; - const char RA::ID = 0; + char RA::ID = 0; } void RA::ComputeRelatedRegClasses() { Index: llvm/lib/CodeGen/RegAllocLocal.cpp diff -u llvm/lib/CodeGen/RegAllocLocal.cpp:1.104 llvm/lib/CodeGen/RegAllocLocal.cpp:1.105 --- llvm/lib/CodeGen/RegAllocLocal.cpp:1.104 Wed May 2 16:39:19 2007 +++ llvm/lib/CodeGen/RegAllocLocal.cpp Wed May 2 20:11:53 2007 @@ -44,7 +44,7 @@ class VISIBILITY_HIDDEN RA : public MachineFunctionPass { public: - static const char ID; + static char ID; RA() : MachineFunctionPass((intptr_t)&ID) {} private: const TargetMachine *TM; @@ -228,7 +228,7 @@ void reloadPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I, unsigned PhysReg); }; - const char RA::ID = 0; + char RA::ID = 0; } /// getStackSpaceFor - This allocates space for the specified virtual register Index: llvm/lib/CodeGen/RegAllocSimple.cpp diff -u llvm/lib/CodeGen/RegAllocSimple.cpp:1.85 llvm/lib/CodeGen/RegAllocSimple.cpp:1.86 --- llvm/lib/CodeGen/RegAllocSimple.cpp:1.85 Wed May 2 16:39:19 2007 +++ llvm/lib/CodeGen/RegAllocSimple.cpp Wed May 2 20:11:53 2007 @@ -39,7 +39,7 @@ class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass { public: - static const char ID; + static char ID; RegAllocSimple() : MachineFunctionPass((intptr_t)&ID) {} private: MachineFunction *MF; @@ -94,7 +94,7 @@ void spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, unsigned VirtReg, unsigned PhysReg); }; - const char RegAllocSimple::ID = 0; + char RegAllocSimple::ID = 0; } /// getStackSpaceFor - This allocates space for the specified virtual Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.49 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.50 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.49 Wed May 2 16:39:19 2007 +++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Wed May 2 20:11:53 2007 @@ -50,7 +50,7 @@ namespace { struct VISIBILITY_HIDDEN TwoAddressInstructionPass : public MachineFunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid TwoAddressInstructionPass() : MachineFunctionPass((intptr_t)&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const; @@ -59,7 +59,7 @@ bool runOnMachineFunction(MachineFunction&); }; - const char TwoAddressInstructionPass::ID = 0; + char TwoAddressInstructionPass::ID = 0; RegisterPass X("twoaddressinstruction", "Two-Address instruction pass"); } Index: llvm/lib/CodeGen/UnreachableBlockElim.cpp diff -u llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.11 llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.12 --- llvm/lib/CodeGen/UnreachableBlockElim.cpp:1.11 Wed May 2 16:39:19 2007 +++ llvm/lib/CodeGen/UnreachableBlockElim.cpp Wed May 2 20:11:53 2007 @@ -35,10 +35,10 @@ class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass { virtual bool runOnFunction(Function &F); public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {} }; - const char UnreachableBlockElim::ID = 0; + char UnreachableBlockElim::ID = 0; RegisterPass X("unreachableblockelim", "Remove unreachable blocks from the CFG"); } From dpatel at apple.com Wed May 2 20:14:11 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:11 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/PassManagers.h Message-ID: <200705030114.l431EBRH030341@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: PassManagers.h updated: 1.18 -> 1.19 --- Log message: Drop 'const' --- Diffs of the changes: (+1 -1) PassManagers.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/PassManagers.h diff -u llvm/include/llvm/PassManagers.h:1.18 llvm/include/llvm/PassManagers.h:1.19 --- llvm/include/llvm/PassManagers.h:1.18 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/PassManagers.h Wed May 2 20:11:53 2007 @@ -336,7 +336,7 @@ class FPPassManager : public ModulePass, public PMDataManager { public: - static const char ID; + static char ID; explicit FPPassManager(int Depth) : ModulePass((intptr_t)&ID), PMDataManager(Depth) { } From dpatel at apple.com Wed May 2 20:14:10 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200705030114.l431EAlr030306@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.181 -> 1.182 --- Log message: Drop 'const' --- Diffs of the changes: (+1 -1) Writer.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.181 llvm/lib/Bytecode/Writer/Writer.cpp:1.182 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.181 Wed May 2 16:39:18 2007 +++ llvm/lib/Bytecode/Writer/Writer.cpp Wed May 2 20:11:53 2007 @@ -47,7 +47,7 @@ /// @brief The bytecode version number const unsigned BCVersionNum = 7; -const char WriteBytecodePass::ID = 0; +char WriteBytecodePass::ID = 0; static RegisterPass X("emitbytecode", "Bytecode Writer"); STATISTIC(BytesWritten, "Number of bytecode bytes written"); From dpatel at apple.com Wed May 2 20:14:11 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp ARMLoadStoreOptimizer.cpp Message-ID: <200705030114.l431EBMc030331@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.41 -> 1.42 ARMLoadStoreOptimizer.cpp updated: 1.10 -> 1.11 --- Log message: Drop 'const' --- Diffs of the changes: (+4 -4) ARMConstantIslandPass.cpp | 4 ++-- ARMLoadStoreOptimizer.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.41 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.42 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.41 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Wed May 2 20:11:53 2007 @@ -128,7 +128,7 @@ ARMFunctionInfo *AFI; bool isThumb; public: - static const char ID; + static char ID; ARMConstantIslands() : MachineFunctionPass((intptr_t)&ID) {} virtual bool runOnMachineFunction(MachineFunction &Fn); @@ -174,7 +174,7 @@ void dumpBBs(); void verify(MachineFunction &Fn); }; - const char ARMConstantIslands::ID = 0; + char ARMConstantIslands::ID = 0; } /// verify - check BBOffsets, BBSizes, alignment of islands Index: llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp diff -u llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp:1.10 llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp:1.11 --- llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp:1.10 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Wed May 2 20:11:53 2007 @@ -38,7 +38,7 @@ namespace { struct VISIBILITY_HIDDEN ARMLoadStoreOpt : public MachineFunctionPass { - static const char ID; + static char ID; ARMLoadStoreOpt() : MachineFunctionPass((intptr_t)&ID) {} const TargetInstrInfo *TII; @@ -73,7 +73,7 @@ bool LoadStoreMultipleOpti(MachineBasicBlock &MBB); bool MergeReturnIntoLDM(MachineBasicBlock &MBB); }; - const char ARMLoadStoreOpt::ID = 0; + char ARMLoadStoreOpt::ID = 0; } /// createARMLoadStoreOptimizationPass - returns an instance of the load / store From dpatel at apple.com Wed May 2 20:14:11 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp CallGraph.cpp CallGraphSCCPass.cpp FindUsedTypes.cpp GlobalsModRef.cpp Message-ID: <200705030114.l431EBow030326@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: Andersens.cpp updated: 1.48 -> 1.49 CallGraph.cpp updated: 1.68 -> 1.69 CallGraphSCCPass.cpp updated: 1.23 -> 1.24 FindUsedTypes.cpp updated: 1.40 -> 1.41 GlobalsModRef.cpp updated: 1.31 -> 1.32 --- Log message: Drop 'const' --- Diffs of the changes: (+10 -10) Andersens.cpp | 4 ++-- CallGraph.cpp | 6 +++--- CallGraphSCCPass.cpp | 4 ++-- FindUsedTypes.cpp | 2 +- GlobalsModRef.cpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) Index: llvm/lib/Analysis/IPA/Andersens.cpp diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.48 llvm/lib/Analysis/IPA/Andersens.cpp:1.49 --- llvm/lib/Analysis/IPA/Andersens.cpp:1.48 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/IPA/Andersens.cpp Wed May 2 20:11:53 2007 @@ -76,7 +76,7 @@ class VISIBILITY_HIDDEN Andersens : public ModulePass, public AliasAnalysis, private InstVisitor { public: - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo Andersens() : ModulePass((intptr_t)&ID) {} private: /// Node class - This class is used to represent a memory object in the @@ -339,7 +339,7 @@ void visitInstruction(Instruction &I); }; - const char Andersens::ID = 0; + char Andersens::ID = 0; RegisterPass X("anders-aa", "Andersen's Interprocedural Alias Analysis"); RegisterAnalysisGroup Y(X); Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.68 llvm/lib/Analysis/IPA/CallGraph.cpp:1.69 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.68 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Wed May 2 20:11:53 2007 @@ -51,7 +51,7 @@ CallGraphNode *CallsExternalNode; public: - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo BasicCallGraph() : ModulePass((intptr_t)&ID), Root(0), ExternalCallingNode(0), CallsExternalNode(0) {} @@ -196,8 +196,8 @@ } //End anonymous namespace -const char CallGraph::ID = 0; -const char BasicCallGraph::ID = 0; +char CallGraph::ID = 0; +char BasicCallGraph::ID = 0; void CallGraph::initialize(Module &M) { Mod = &M; Index: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp diff -u llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.23 llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.24 --- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.23 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Wed May 2 20:11:53 2007 @@ -30,7 +30,7 @@ class CGPassManager : public ModulePass, public PMDataManager { public: - static const char ID; + static char ID; CGPassManager(int Depth) : ModulePass((intptr_t)&ID), PMDataManager(Depth) { } @@ -73,7 +73,7 @@ } }; -const char CGPassManager::ID = 0; +char CGPassManager::ID = 0; /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. bool CGPassManager::runOnModule(Module &M) { Index: llvm/lib/Analysis/IPA/FindUsedTypes.cpp diff -u llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.40 llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.41 --- llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.40 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/IPA/FindUsedTypes.cpp Wed May 2 20:11:53 2007 @@ -21,7 +21,7 @@ #include "llvm/Support/InstIterator.h" using namespace llvm; -const char FindUsedTypes::ID = 0; +char FindUsedTypes::ID = 0; static RegisterPass X("printusedtypes", "Find Used Types"); Index: llvm/lib/Analysis/IPA/GlobalsModRef.cpp diff -u llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.31 llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.32 --- llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.31 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/IPA/GlobalsModRef.cpp Wed May 2 20:11:53 2007 @@ -83,7 +83,7 @@ std::map FunctionInfo; public: - static const char ID; + static char ID; GlobalsModRef() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M) { @@ -146,7 +146,7 @@ bool AnalyzeIndirectGlobalMemory(GlobalValue *GV); }; - const char GlobalsModRef::ID = 0; + char GlobalsModRef::ID = 0; RegisterPass X("globalsmodref-aa", "Simple mod/ref analysis for globals"); RegisterAnalysisGroup Y(X); From dpatel at apple.com Wed May 2 20:14:11 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64Bundling.cpp Message-ID: <200705030114.l431EBi3030343@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64Bundling.cpp updated: 1.10 -> 1.11 --- Log message: Drop 'const' --- Diffs of the changes: (+2 -2) IA64Bundling.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/IA64/IA64Bundling.cpp diff -u llvm/lib/Target/IA64/IA64Bundling.cpp:1.10 llvm/lib/Target/IA64/IA64Bundling.cpp:1.11 --- llvm/lib/Target/IA64/IA64Bundling.cpp:1.10 Wed May 2 16:39:19 2007 +++ llvm/lib/Target/IA64/IA64Bundling.cpp Wed May 2 20:11:53 2007 @@ -36,7 +36,7 @@ namespace { struct IA64BundlingPass : public MachineFunctionPass { - static const char ID; + static char ID; /// Target machine description which we query for reg. names, data /// layout, etc. /// @@ -63,7 +63,7 @@ // 'fallthrough' code std::set PendingRegWrites; }; - const char IA64BundlingPass::ID = 0; + char IA64BundlingPass::ID = 0; } // end of anonymous namespace /// createIA64BundlingPass - Returns a pass that adds STOP (;;) instructions From dpatel at apple.com Wed May 2 20:14:10 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:10 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/AsmPrinter.h LiveIntervalAnalysis.h LiveVariables.h MachineModuleInfo.h SelectionDAGISel.h Message-ID: <200705030114.l431EAoG030301@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: AsmPrinter.h updated: 1.65 -> 1.66 LiveIntervalAnalysis.h updated: 1.82 -> 1.83 LiveVariables.h updated: 1.43 -> 1.44 MachineModuleInfo.h updated: 1.9 -> 1.10 SelectionDAGISel.h updated: 1.39 -> 1.40 --- Log message: Drop 'const' --- Diffs of the changes: (+5 -5) AsmPrinter.h | 2 +- LiveIntervalAnalysis.h | 2 +- LiveVariables.h | 2 +- MachineModuleInfo.h | 2 +- SelectionDAGISel.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/include/llvm/CodeGen/AsmPrinter.h diff -u llvm/include/llvm/CodeGen/AsmPrinter.h:1.65 llvm/include/llvm/CodeGen/AsmPrinter.h:1.66 --- llvm/include/llvm/CodeGen/AsmPrinter.h:1.65 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/CodeGen/AsmPrinter.h Wed May 2 20:11:53 2007 @@ -34,7 +34,7 @@ /// AsmPrinter - This class is intended to be used as a driving class for all /// asm writers. class AsmPrinter : public MachineFunctionPass { - static const char ID; + static char ID; /// FunctionNumber - This provides a unique ID for each function emitted in /// this translation unit. It is autoincremented by SetupMachineFunction, Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.82 llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.83 --- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.82 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Wed May 2 20:11:53 2007 @@ -65,7 +65,7 @@ BitVector JoinedLIs; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid LiveIntervals() : MachineFunctionPass((intptr_t)&ID) {} struct CopyRec { Index: llvm/include/llvm/CodeGen/LiveVariables.h diff -u llvm/include/llvm/CodeGen/LiveVariables.h:1.43 llvm/include/llvm/CodeGen/LiveVariables.h:1.44 --- llvm/include/llvm/CodeGen/LiveVariables.h:1.43 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/CodeGen/LiveVariables.h Wed May 2 20:11:53 2007 @@ -40,7 +40,7 @@ class LiveVariables : public MachineFunctionPass { public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid LiveVariables() : MachineFunctionPass((intptr_t)&ID) {} /// VarInfo - This represents the regions where a virtual register is live in Index: llvm/include/llvm/CodeGen/MachineModuleInfo.h diff -u llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.9 llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.10 --- llvm/include/llvm/CodeGen/MachineModuleInfo.h:1.9 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/CodeGen/MachineModuleInfo.h Wed May 2 20:11:53 2007 @@ -1022,7 +1022,7 @@ std::vector TypeInfos; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid MachineModuleInfo(); ~MachineModuleInfo(); Index: llvm/include/llvm/CodeGen/SelectionDAGISel.h diff -u llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.39 llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.40 --- llvm/include/llvm/CodeGen/SelectionDAGISel.h:1.39 Wed May 2 16:39:18 2007 +++ llvm/include/llvm/CodeGen/SelectionDAGISel.h Wed May 2 20:11:53 2007 @@ -41,7 +41,7 @@ MachineBasicBlock *BB; std::vector TopOrder; unsigned DAGSize; - static const char ID; + static char ID; explicit SelectionDAGISel(TargetLowering &tli) : FunctionPass((intptr_t)&ID), TLI(tli), DAGSize(0) {} From dpatel at apple.com Wed May 2 20:14:09 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 2 May 2007 20:14:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysis.cpp AliasAnalysisCounter.cpp AliasAnalysisEvaluator.cpp AliasDebugger.cpp AliasSetTracker.cpp BasicAliasAnalysis.cpp CFGPrinter.cpp InstCount.cpp IntervalPartition.cpp LoadValueNumbering.cpp LoopInfo.cpp LoopPass.cpp PostDominators.cpp ProfileInfo.cpp ProfileInfoLoaderPass.cpp ScalarEvolution.cpp ValueNumbering.cpp Message-ID: <200705030114.l431E9Wk030196@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasAnalysis.cpp updated: 1.33 -> 1.34 AliasAnalysisCounter.cpp updated: 1.22 -> 1.23 AliasAnalysisEvaluator.cpp updated: 1.35 -> 1.36 AliasDebugger.cpp updated: 1.5 -> 1.6 AliasSetTracker.cpp updated: 1.48 -> 1.49 BasicAliasAnalysis.cpp updated: 1.110 -> 1.111 CFGPrinter.cpp updated: 1.24 -> 1.25 InstCount.cpp updated: 1.22 -> 1.23 IntervalPartition.cpp updated: 1.34 -> 1.35 LoadValueNumbering.cpp updated: 1.41 -> 1.42 LoopInfo.cpp updated: 1.85 -> 1.86 LoopPass.cpp updated: 1.20 -> 1.21 PostDominators.cpp updated: 1.69 -> 1.70 ProfileInfo.cpp updated: 1.14 -> 1.15 ProfileInfoLoaderPass.cpp updated: 1.20 -> 1.21 ScalarEvolution.cpp updated: 1.115 -> 1.116 ValueNumbering.cpp updated: 1.27 -> 1.28 --- Log message: Drop 'const' --- Diffs of the changes: (+36 -36) AliasAnalysis.cpp | 2 +- AliasAnalysisCounter.cpp | 4 ++-- AliasAnalysisEvaluator.cpp | 4 ++-- AliasDebugger.cpp | 4 ++-- AliasSetTracker.cpp | 4 ++-- BasicAliasAnalysis.cpp | 8 ++++---- CFGPrinter.cpp | 8 ++++---- InstCount.cpp | 4 ++-- IntervalPartition.cpp | 2 +- LoadValueNumbering.cpp | 4 ++-- LoopInfo.cpp | 2 +- LoopPass.cpp | 2 +- PostDominators.cpp | 6 +++--- ProfileInfo.cpp | 6 +++--- ProfileInfoLoaderPass.cpp | 4 ++-- ScalarEvolution.cpp | 2 +- ValueNumbering.cpp | 6 +++--- 17 files changed, 36 insertions(+), 36 deletions(-) Index: llvm/lib/Analysis/AliasAnalysis.cpp diff -u llvm/lib/Analysis/AliasAnalysis.cpp:1.33 llvm/lib/Analysis/AliasAnalysis.cpp:1.34 --- llvm/lib/Analysis/AliasAnalysis.cpp:1.33 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/AliasAnalysis.cpp Wed May 2 20:11:53 2007 @@ -36,7 +36,7 @@ namespace { RegisterAnalysisGroup Z("Alias Analysis"); } -const char AliasAnalysis::ID = 0; +char AliasAnalysis::ID = 0; //===----------------------------------------------------------------------===// // Default chaining methods Index: llvm/lib/Analysis/AliasAnalysisCounter.cpp diff -u llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.22 llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.23 --- llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.22 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/AliasAnalysisCounter.cpp Wed May 2 20:11:53 2007 @@ -34,7 +34,7 @@ const char *Name; Module *M; public: - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo AliasAnalysisCounter() : ModulePass((intptr_t) &ID) { No = May = Must = 0; NoMR = JustRef = JustMod = MR = 0; @@ -108,7 +108,7 @@ } }; - const char AliasAnalysisCounter::ID = 0; + char AliasAnalysisCounter::ID = 0; RegisterPass X("count-aa", "Count Alias Analysis Query Responses"); RegisterAnalysisGroup Y(X); Index: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp diff -u llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.35 llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.36 --- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.35 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Wed May 2 20:11:53 2007 @@ -50,7 +50,7 @@ unsigned NoModRef, Mod, Ref, ModRef; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid AAEval() : FunctionPass((intptr_t)&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -73,7 +73,7 @@ bool doFinalization(Module &M); }; - const char AAEval::ID = 0; + char AAEval::ID = 0; RegisterPass X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator"); } Index: llvm/lib/Analysis/AliasDebugger.cpp diff -u llvm/lib/Analysis/AliasDebugger.cpp:1.5 llvm/lib/Analysis/AliasDebugger.cpp:1.6 --- llvm/lib/Analysis/AliasDebugger.cpp:1.5 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/AliasDebugger.cpp Wed May 2 20:11:53 2007 @@ -40,7 +40,7 @@ std::set Vals; public: - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo AliasDebugger() : ModulePass((intptr_t)&ID) {} bool runOnModule(Module &M) { @@ -122,7 +122,7 @@ }; - const char AliasDebugger::ID = 0; + char AliasDebugger::ID = 0; RegisterPass X("debug-aa", "AA use debugger"); RegisterAnalysisGroup Y(X); } Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.48 llvm/lib/Analysis/AliasSetTracker.cpp:1.49 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.48 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/AliasSetTracker.cpp Wed May 2 20:11:53 2007 @@ -555,7 +555,7 @@ class VISIBILITY_HIDDEN AliasSetPrinter : public FunctionPass { AliasSetTracker *Tracker; public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid AliasSetPrinter() : FunctionPass((intptr_t)&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -573,6 +573,6 @@ return false; } }; - const char AliasSetPrinter::ID = 0; + char AliasSetPrinter::ID = 0; RegisterPass X("print-alias-sets", "Alias Set Printer"); } Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.110 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.111 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.110 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Wed May 2 20:11:53 2007 @@ -36,7 +36,7 @@ /// such it doesn't follow many of the rules that other alias analyses must. /// struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public AliasAnalysis { - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo NoAA() : ImmutablePass((intptr_t)&ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -77,7 +77,7 @@ }; // Register this pass... - const char NoAA::ID = 0; + char NoAA::ID = 0; RegisterPass U("no-aa", "No Alias Analysis (always returns 'may' alias)"); @@ -92,7 +92,7 @@ /// Because it doesn't chain to a previous alias analysis (like -no-aa), it /// derives from the NoAA class. struct VISIBILITY_HIDDEN BasicAliasAnalysis : public NoAA { - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo AliasResult alias(const Value *V1, unsigned V1Size, const Value *V2, unsigned V2Size); @@ -124,7 +124,7 @@ }; // Register this pass... - const char BasicAliasAnalysis::ID = 0; + char BasicAliasAnalysis::ID = 0; RegisterPass X("basicaa", "Basic Alias Analysis (default AA impl)"); Index: llvm/lib/Analysis/CFGPrinter.cpp diff -u llvm/lib/Analysis/CFGPrinter.cpp:1.24 llvm/lib/Analysis/CFGPrinter.cpp:1.25 --- llvm/lib/Analysis/CFGPrinter.cpp:1.24 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/CFGPrinter.cpp Wed May 2 20:11:53 2007 @@ -91,7 +91,7 @@ namespace { struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid CFGPrinter() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F) { @@ -114,12 +114,12 @@ } }; - const char CFGPrinter::ID = 0; + char CFGPrinter::ID = 0; RegisterPass P1("print-cfg", "Print CFG of function to 'dot' file"); struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter { - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid virtual bool runOnFunction(Function &F) { bool OldCFGOnly = CFGOnly; CFGOnly = true; @@ -134,7 +134,7 @@ } }; - const char CFGOnlyPrinter::ID = 0; + char CFGOnlyPrinter::ID = 0; RegisterPass P2("print-cfg-only", "Print CFG of function to 'dot' file (with no function bodies)"); Index: llvm/lib/Analysis/InstCount.cpp diff -u llvm/lib/Analysis/InstCount.cpp:1.22 llvm/lib/Analysis/InstCount.cpp:1.23 --- llvm/lib/Analysis/InstCount.cpp:1.22 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/InstCount.cpp Wed May 2 20:11:53 2007 @@ -51,7 +51,7 @@ abort(); } public: - static const char ID; // Pass identifcation, replacement for typeid + static char ID; // Pass identifcation, replacement for typeid InstCount() : FunctionPass((intptr_t)&ID) {} virtual bool runOnFunction(Function &F); @@ -63,7 +63,7 @@ }; - const char InstCount::ID = 0; + char InstCount::ID = 0; RegisterPass X("instcount", "Counts the various types of Instructions"); } Index: llvm/lib/Analysis/IntervalPartition.cpp diff -u llvm/lib/Analysis/IntervalPartition.cpp:1.34 llvm/lib/Analysis/IntervalPartition.cpp:1.35 --- llvm/lib/Analysis/IntervalPartition.cpp:1.34 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/IntervalPartition.cpp Wed May 2 20:11:53 2007 @@ -15,7 +15,7 @@ #include "llvm/Analysis/IntervalIterator.h" using namespace llvm; -const char IntervalPartition::ID = 0; +char IntervalPartition::ID = 0; static RegisterPass X("intervals", "Interval Partition Construction", true); Index: llvm/lib/Analysis/LoadValueNumbering.cpp diff -u llvm/lib/Analysis/LoadValueNumbering.cpp:1.41 llvm/lib/Analysis/LoadValueNumbering.cpp:1.42 --- llvm/lib/Analysis/LoadValueNumbering.cpp:1.41 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/LoadValueNumbering.cpp Wed May 2 20:11:53 2007 @@ -40,7 +40,7 @@ namespace { // FIXME: This should not be a FunctionPass. struct VISIBILITY_HIDDEN LoadVN : public FunctionPass, public ValueNumbering { - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo LoadVN() : FunctionPass((intptr_t)&ID) {} /// Pass Implementation stuff. This doesn't do any analysis. @@ -83,7 +83,7 @@ std::vector &RetVals) const; }; - const char LoadVN::ID = 0; + char LoadVN::ID = 0; // Register this pass... RegisterPass X("load-vn", "Load Value Numbering"); Index: llvm/lib/Analysis/LoopInfo.cpp diff -u llvm/lib/Analysis/LoopInfo.cpp:1.85 llvm/lib/Analysis/LoopInfo.cpp:1.86 --- llvm/lib/Analysis/LoopInfo.cpp:1.85 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/LoopInfo.cpp Wed May 2 20:11:53 2007 @@ -27,7 +27,7 @@ #include using namespace llvm; -const char LoopInfo::ID = 0; +char LoopInfo::ID = 0; static RegisterPass X("loops", "Natural Loop Construction", true); Index: llvm/lib/Analysis/LoopPass.cpp diff -u llvm/lib/Analysis/LoopPass.cpp:1.20 llvm/lib/Analysis/LoopPass.cpp:1.21 --- llvm/lib/Analysis/LoopPass.cpp:1.20 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/LoopPass.cpp Wed May 2 20:11:53 2007 @@ -21,7 +21,7 @@ // LPPassManager // -const char LPPassManager::ID = 0; +char LPPassManager::ID = 0; /// LPPassManager manages FPPassManagers and CalLGraphSCCPasses. LPPassManager::LPPassManager(int Depth) Index: llvm/lib/Analysis/PostDominators.cpp diff -u llvm/lib/Analysis/PostDominators.cpp:1.69 llvm/lib/Analysis/PostDominators.cpp:1.70 --- llvm/lib/Analysis/PostDominators.cpp:1.69 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/PostDominators.cpp Wed May 2 20:11:53 2007 @@ -22,9 +22,9 @@ // PostDominatorTree Implementation //===----------------------------------------------------------------------===// -const char PostDominatorTree::ID = 0; -const char PostDominanceFrontier::ID = 0; -const char PostETForest::ID = 0; +char PostDominatorTree::ID = 0; +char PostDominanceFrontier::ID = 0; +char PostETForest::ID = 0; static RegisterPass F("postdomtree", "Post-Dominator Tree Construction", true); Index: llvm/lib/Analysis/ProfileInfo.cpp diff -u llvm/lib/Analysis/ProfileInfo.cpp:1.14 llvm/lib/Analysis/ProfileInfo.cpp:1.15 --- llvm/lib/Analysis/ProfileInfo.cpp:1.14 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/ProfileInfo.cpp Wed May 2 20:11:53 2007 @@ -24,7 +24,7 @@ namespace { RegisterAnalysisGroup Z("Profile Information"); } -const char ProfileInfo::ID = 0; +char ProfileInfo::ID = 0; ProfileInfo::~ProfileInfo() {} @@ -86,11 +86,11 @@ namespace { struct VISIBILITY_HIDDEN NoProfileInfo : public ImmutablePass, public ProfileInfo { - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo NoProfileInfo() : ImmutablePass((intptr_t)&ID) {} }; - const char NoProfileInfo::ID = 0; + char NoProfileInfo::ID = 0; // Register this pass... RegisterPass X("no-profile", "No Profile Information"); Index: llvm/lib/Analysis/ProfileInfoLoaderPass.cpp diff -u llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.20 llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.21 --- llvm/lib/Analysis/ProfileInfoLoaderPass.cpp:1.20 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/ProfileInfoLoaderPass.cpp Wed May 2 20:11:53 2007 @@ -32,7 +32,7 @@ class VISIBILITY_HIDDEN LoaderPass : public ModulePass, public ProfileInfo { std::string Filename; public: - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo LoaderPass(const std::string &filename = "") : ModulePass((intptr_t)&ID), Filename(filename) { if (filename.empty()) Filename = ProfileInfoFilename; @@ -50,7 +50,7 @@ virtual bool runOnModule(Module &M); }; - const char LoaderPass::ID = 0; + char LoaderPass::ID = 0; RegisterPass X("profile-loader", "Load profile information from llvmprof.out"); Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.115 llvm/lib/Analysis/ScalarEvolution.cpp:1.116 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.115 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/ScalarEvolution.cpp Wed May 2 20:11:53 2007 @@ -105,7 +105,7 @@ RegisterPass R("scalar-evolution", "Scalar Evolution Analysis"); } -const char ScalarEvolution::ID = 0; +char ScalarEvolution::ID = 0; //===----------------------------------------------------------------------===// // SCEV class definitions Index: llvm/lib/Analysis/ValueNumbering.cpp diff -u llvm/lib/Analysis/ValueNumbering.cpp:1.27 llvm/lib/Analysis/ValueNumbering.cpp:1.28 --- llvm/lib/Analysis/ValueNumbering.cpp:1.27 Wed May 2 16:39:18 2007 +++ llvm/lib/Analysis/ValueNumbering.cpp Wed May 2 20:11:53 2007 @@ -22,7 +22,7 @@ #include "llvm/Support/Compiler.h" using namespace llvm; -const char ValueNumbering::ID = 0; +char ValueNumbering::ID = 0; // Register the ValueNumbering interface, providing a nice name to refer to. static RegisterAnalysisGroup X("Value Numbering"); @@ -52,7 +52,7 @@ /// struct VISIBILITY_HIDDEN BasicVN : public ImmutablePass, public ValueNumbering { - static const char ID; // Class identification, replacement for typeinfo + static char ID; // Class identification, replacement for typeinfo BasicVN() : ImmutablePass((intptr_t)&ID) {} /// getEqualNumberNodes - Return nodes with the same value number as the @@ -65,7 +65,7 @@ std::vector &RetVals) const; }; - const char BasicVN::ID = 0; + char BasicVN::ID = 0; // Register this pass... RegisterPass X("basicvn", "Basic Value Numbering (default GVN impl)"); From evan.cheng at apple.com Wed May 2 21:00:36 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 2 May 2007 21:00:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200705030200.l4320aqm031056@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.47 -> 1.48 --- Log message: Typo. It's checking if V is multiple of 4, not multiple of 3. :-) --- Diffs of the changes: (+1 -1) ARMISelLowering.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.47 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.48 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.47 Fri Apr 27 08:54:47 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Wed May 2 21:00:18 2007 @@ -1486,7 +1486,7 @@ case MVT::f64: if (!Subtarget->hasVFP2()) return false; - if ((V % 3) != 0) + if ((V & 3) != 0) return false; V >>= 2; return V == V & ((1LL << 8) - 1); From fbrandne at mail.tuwien.ac.at Wed May 2 04:38:10 2007 From: fbrandne at mail.tuwien.ac.at (Florian Brandner) Date: Wed, 02 May 2007 11:38:10 +0200 Subject: [llvm-commits] minor bugs in STLExtras.h and GraphWriter.cpp Message-ID: <46385C02.5060509@mail.tuwien.ac.at> This is a patch to fix a compile error in STLExtras.h, and a bug in GraphWriter.cpp. cheers, florian ps: i'm not subscribed to the commits list, so please cc me in replies. -------------- next part -------------- A non-text attachment was scrubbed... Name: minor_bugs.patch Type: text/x-patch Size: 1607 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070502/c80e65f9/attachment.bin From raulherbster at gmail.com Wed May 2 06:53:44 2007 From: raulherbster at gmail.com (Raul Fernandes Herbster) Date: Wed, 2 May 2007 08:53:44 -0300 Subject: [llvm-commits] Patch for ARM/ELF debugger Message-ID: <6fbb4ff20705020453m749bca40o2a0f93cebe3d7196@mail.gmail.com> This patch provides ARM/ELF application debugging (DWARF format) for ARM backend. -- Raul Fernandes Herbster Embedded and Pervasive Computing Laboratory - embedded.dee.ufcg.edu.br Electrical Engineering Department - DEE - www.ee.ufcg.edu.br Electrical Engineering and Informatics Center - CEEI Federal University of Campina Grande - UFCG - www.ufcg.edu.br Caixa Postal 10105 58109-970 Campina Grande - PB - Brasil -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070502/07d2afd0/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: arm_debugger.patch Type: text/x-patch Size: 5358 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070502/07d2afd0/attachment.bin From sabre at nondot.org Wed May 2 21:57:31 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 2 May 2007 21:57:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200705030257.l432vVKZ031983@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.342 -> 1.343 --- Log message: revert reid's patch to fix these failures: test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll for PR1099: http://llvm.org/PR1099 [DEJAGNU] Applications/SPASS/SPASS [CBE] Regression/C/2004-03-15-IndirectGoto [CBE] --- Diffs of the changes: (+28 -100) CBackend.cpp | 128 ++++++++++++----------------------------------------------- 1 files changed, 28 insertions(+), 100 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.342 llvm/lib/Target/CBackend/CBackend.cpp:1.343 --- llvm/lib/Target/CBackend/CBackend.cpp:1.342 Wed May 2 20:11:53 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Wed May 2 21:57:13 2007 @@ -412,29 +412,6 @@ } } -#define IMPL_SIGN_EXTENSION(OpTy, Func) { \ - const IntegerType* IntTy = cast(OpTy); \ - unsigned BitWidth = IntTy->getBitWidth(); \ - if (BitWidth != 8 && BitWidth != 16 && BitWidth != 32 && \ - BitWidth != 64 && BitWidth != 128) { \ - const char * Suffix; \ - if (BitWidth <=32)\ - Suffix = "U"; \ - else \ - Suffix = "ULL"; \ - Out << "("; \ - Func; \ - Out << " & (1" << Suffix << " << " << BitWidth - 1 << " ) ? "; \ - Func; \ - Out << " | " << (~IntTy->getBitMask()) << Suffix << " : "; \ - Func; \ - Out << " & " << IntTy->getBitMask() << Suffix; \ - Out << ")";\ - } \ - else \ - Func; \ - } - // Pass the Type* and the variable name and this prints out the variable // declaration. // @@ -734,39 +711,23 @@ case Instruction::BitCast: Out << "("; printCast(CE->getOpcode(), CE->getOperand(0)->getType(), CE->getType()); - if (CE->getOpcode() == Instruction::Trunc || - CE->getOpcode() == Instruction::FPToUI || - CE->getOpcode() == Instruction::FPToSI || - CE->getOpcode() == Instruction::PtrToInt) { - if (const IntegerType* IntTy = dyn_cast(CE->getType())) { - uint64_t BitMask = IntTy->getBitMask(); - printConstant(CE->getOperand(0)); - Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); - } - } - else if (CE->getOpcode() == Instruction::SExt && - CE->getOperand(0)->getType() == Type::Int1Ty) { + if (CE->getOpcode() == Instruction::SExt && + CE->getOperand(0)->getType() == Type::Int1Ty) { // Make sure we really sext from bool here by subtracting from 0 Out << "0-"; - printConstant(CE->getOperand(0)); } - else if (CE->getOpcode() == Instruction::SExt && - CE->getOperand(0)->getType()->getTypeID() == Type::IntegerTyID) { - IMPL_SIGN_EXTENSION(CE->getOperand(0)->getType(), - printConstant(CE->getOperand(0))); - } - else if (CE->getOpcode() == Instruction::ZExt && - CE->getOperand(0)->getType()->getTypeID() == Type::IntegerTyID){ - const IntegerType* IntTy = - cast(CE->getOperand(0)->getType()); - uint64_t BitMask = IntTy->getBitMask(); - writeOperand(CE->getOperand(0)); - Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); - } - else - printConstant(CE->getOperand(0)); - Out << ")"; + printConstant(CE->getOperand(0)); + if (CE->getType() == Type::Int1Ty && + (CE->getOpcode() == Instruction::Trunc || + CE->getOpcode() == Instruction::FPToUI || + CE->getOpcode() == Instruction::FPToSI || + CE->getOpcode() == Instruction::PtrToInt)) { + // Make sure we really truncate to bool here by anding with 1 + Out << "&1u"; + } + Out << ')'; return; + case Instruction::GetElementPtr: Out << "(&("; printIndexingExpression(CE->getOperand(0), gep_type_begin(CPV), @@ -1267,11 +1228,7 @@ Out << "(("; printSimpleType(Out, OpTy, castIsSigned); Out << ")"; - if (castIsSigned && OpTy->getTypeID() == Type::IntegerTyID) { - IMPL_SIGN_EXTENSION(OpTy, writeOperand(Operand)); - } - else - writeOperand(Operand); + writeOperand(Operand); Out << ")"; } else writeOperand(Operand); @@ -1296,9 +1253,7 @@ switch (predicate) { default: // for eq and ne, it doesn't matter - break; - case ICmpInst::ICMP_EQ: - case ICmpInst::ICMP_NE: + break; case ICmpInst::ICMP_UGT: case ICmpInst::ICMP_UGE: case ICmpInst::ICMP_ULT: @@ -1323,25 +1278,10 @@ else printType(Out, OpTy); // not integer, sign doesn't matter Out << ")"; - if(castIsSigned && OpTy->getTypeID() == Type::IntegerTyID) { - IMPL_SIGN_EXTENSION(OpTy, writeOperand(Operand)); - } else { - writeOperand(Operand); - if(OpTy->getTypeID() == Type::IntegerTyID){ - const IntegerType * IntTy = cast(OpTy); - uint64_t BitMask = IntTy->getBitMask(); - Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); - } - } + writeOperand(Operand); Out << ")"; - } else { + } else writeOperand(Operand); - if(OpTy->getTypeID() == Type::IntegerTyID){ - const IntegerType * IntTy = cast(OpTy); - uint64_t BitMask = IntTy->getBitMask(); - Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); - } - } } // generateCompilerSpecificCode - This is where we add conditional compilation @@ -2406,33 +2346,21 @@ << getFloatBitCastField(I.getType()); } else { printCast(I.getOpcode(), SrcTy, DstTy); - if (I.getOpcode() == Instruction::Trunc || - I.getOpcode() == Instruction::FPToUI || - I.getOpcode() == Instruction::FPToSI || - I.getOpcode() == Instruction::PtrToInt) { - if (const IntegerType* IntTy = dyn_cast(DstTy)){ - uint64_t BitMask = IntTy->getBitMask(); - writeOperand(I.getOperand(0)); - Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); - } - } else if (I.getOpcode() == Instruction::SExt && SrcTy == Type::Int1Ty) { + if (I.getOpcode() == Instruction::SExt && SrcTy == Type::Int1Ty) { // Make sure we really get a sext from bool by subtracing the bool from 0 Out << "0-"; - writeOperand(I.getOperand(0)); - } else if (I.getOpcode() == Instruction::SExt && - SrcTy->getTypeID() == Type::IntegerTyID) { - IMPL_SIGN_EXTENSION(SrcTy, writeOperand(I.getOperand(0)) ); - } else if (I.getOpcode() == Instruction::ZExt && - SrcTy->getTypeID() == Type::IntegerTyID) { - const IntegerType* IntTy = cast(SrcTy); - uint64_t BitMask = IntTy->getBitMask(); - writeOperand(I.getOperand(0)); - Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); } - else - writeOperand(I.getOperand(0)); + writeOperand(I.getOperand(0)); + if (DstTy == Type::Int1Ty && + (I.getOpcode() == Instruction::Trunc || + I.getOpcode() == Instruction::FPToUI || + I.getOpcode() == Instruction::FPToSI || + I.getOpcode() == Instruction::PtrToInt)) { + // Make sure we really get a trunc to bool by anding the operand with 1 + Out << "&1u"; + } } - Out << ")"; + Out << ')'; } void CWriter::visitSelectInst(SelectInst &I) { From rspencer at reidspencer.com Wed May 2 23:06:57 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Thu, 03 May 2007 00:06:57 -0400 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp In-Reply-To: <200705030257.l432vVKZ031983@zion.cs.uiuc.edu> References: <200705030257.l432vVKZ031983@zion.cs.uiuc.edu> Message-ID: Leo, Looks like Chris didn't wait very long before reverting the CBE patch. Please try your patch again. It *must* pass all of llvm/test and llvm-test to be accepted. Thanks, Reid. On Wed, 2 May 2007 21:57:31 -0500 Chris Lattner wrote: > > >Changes in directory llvm/lib/Target/CBackend: > >CBackend.cpp updated: 1.342 -> 1.343 >--- >Log message: > >revert reid's patch to fix these failures: >test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll for PR1099: http://llvm.org/PR1099 [DEJAGNU] >Applications/SPASS/SPASS [CBE] >Regression/C/2004-03-15-IndirectGoto [CBE] > > > >--- >Diffs of the changes: (+28 -100) > > CBackend.cpp | 128 ++++++++++++----------------------------------------------- > 1 files changed, 28 insertions(+), 100 deletions(-) > > >Index: llvm/lib/Target/CBackend/CBackend.cpp >diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.342 llvm/lib/Target/CBackend/CBackend.cpp:1.343 >--- llvm/lib/Target/CBackend/CBackend.cpp:1.342 Wed May 2 20:11:53 2007 >+++ llvm/lib/Target/CBackend/CBackend.cpp Wed May 2 21:57:13 2007 >@@ -412,29 +412,6 @@ > } > } > >-#define IMPL_SIGN_EXTENSION(OpTy, Func) { \ >- const IntegerType* IntTy = cast(OpTy); \ >- unsigned BitWidth = IntTy->getBitWidth(); \ >- if (BitWidth != 8 && BitWidth != 16 && BitWidth != 32 && \ >- BitWidth != 64 && BitWidth != 128) { \ >- const char * Suffix; \ >- if (BitWidth <=32)\ >- Suffix = "U"; \ >- else \ >- Suffix = "ULL"; \ >- Out << "("; \ >- Func; \ >- Out << " & (1" << Suffix << " << " << BitWidth - 1 << " ) ? "; \ >- Func; \ >- Out << " | " << (~IntTy->getBitMask()) << Suffix << " : "; \ >- Func; \ >- Out << " & " << IntTy->getBitMask() << Suffix; \ >- Out << ")";\ >- } \ >- else \ >- Func; \ >- } >- > // Pass the Type* and the variable name and this prints out the variable > // declaration. > // >@@ -734,39 +711,23 @@ > case Instruction::BitCast: > Out << "("; > printCast(CE->getOpcode(), CE->getOperand(0)->getType(), CE->getType()); >- if (CE->getOpcode() == Instruction::Trunc || >- CE->getOpcode() == Instruction::FPToUI || >- CE->getOpcode() == Instruction::FPToSI || >- CE->getOpcode() == Instruction::PtrToInt) { >- if (const IntegerType* IntTy = dyn_cast(CE->getType())) { >- uint64_t BitMask = IntTy->getBitMask(); >- printConstant(CE->getOperand(0)); >- Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); >- } >- } >- else if (CE->getOpcode() == Instruction::SExt && >- CE->getOperand(0)->getType() == Type::Int1Ty) { >+ if (CE->getOpcode() == Instruction::SExt && >+ CE->getOperand(0)->getType() == Type::Int1Ty) { > // Make sure we really sext from bool here by subtracting from 0 > Out << "0-"; >- printConstant(CE->getOperand(0)); > } >- else if (CE->getOpcode() == Instruction::SExt && >- CE->getOperand(0)->getType()->getTypeID() == Type::IntegerTyID) { >- IMPL_SIGN_EXTENSION(CE->getOperand(0)->getType(), >- printConstant(CE->getOperand(0))); >- } >- else if (CE->getOpcode() == Instruction::ZExt && >- CE->getOperand(0)->getType()->getTypeID() == Type::IntegerTyID){ >- const IntegerType* IntTy = >- cast(CE->getOperand(0)->getType()); >- uint64_t BitMask = IntTy->getBitMask(); >- writeOperand(CE->getOperand(0)); >- Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); >- } >- else >- printConstant(CE->getOperand(0)); >- Out << ")"; >+ printConstant(CE->getOperand(0)); >+ if (CE->getType() == Type::Int1Ty && >+ (CE->getOpcode() == Instruction::Trunc || >+ CE->getOpcode() == Instruction::FPToUI || >+ CE->getOpcode() == Instruction::FPToSI || >+ CE->getOpcode() == Instruction::PtrToInt)) { >+ // Make sure we really truncate to bool here by anding with 1 >+ Out << "&1u"; >+ } >+ Out << ')'; > return; >+ > case Instruction::GetElementPtr: > Out << "(&("; > printIndexingExpression(CE->getOperand(0), gep_type_begin(CPV), >@@ -1267,11 +1228,7 @@ > Out << "(("; > printSimpleType(Out, OpTy, castIsSigned); > Out << ")"; >- if (castIsSigned && OpTy->getTypeID() == Type::IntegerTyID) { >- IMPL_SIGN_EXTENSION(OpTy, writeOperand(Operand)); >- } >- else >- writeOperand(Operand); >+ writeOperand(Operand); > Out << ")"; > } else > writeOperand(Operand); >@@ -1296,9 +1253,7 @@ > switch (predicate) { > default: > // for eq and ne, it doesn't matter >- break; >- case ICmpInst::ICMP_EQ: >- case ICmpInst::ICMP_NE: >+ break; > case ICmpInst::ICMP_UGT: > case ICmpInst::ICMP_UGE: > case ICmpInst::ICMP_ULT: >@@ -1323,25 +1278,10 @@ > else > printType(Out, OpTy); // not integer, sign doesn't matter > Out << ")"; >- if(castIsSigned && OpTy->getTypeID() == Type::IntegerTyID) { >- IMPL_SIGN_EXTENSION(OpTy, writeOperand(Operand)); >- } else { >- writeOperand(Operand); >- if(OpTy->getTypeID() == Type::IntegerTyID){ >- const IntegerType * IntTy = cast(OpTy); >- uint64_t BitMask = IntTy->getBitMask(); >- Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); >- } >- } >+ writeOperand(Operand); > Out << ")"; >- } else { >+ } else > writeOperand(Operand); >- if(OpTy->getTypeID() == Type::IntegerTyID){ >- const IntegerType * IntTy = cast(OpTy); >- uint64_t BitMask = IntTy->getBitMask(); >- Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); >- } >- } > } > > // generateCompilerSpecificCode - This is where we add conditional compilation >@@ -2406,33 +2346,21 @@ > << getFloatBitCastField(I.getType()); > } else { > printCast(I.getOpcode(), SrcTy, DstTy); >- if (I.getOpcode() == Instruction::Trunc || >- I.getOpcode() == Instruction::FPToUI || >- I.getOpcode() == Instruction::FPToSI || >- I.getOpcode() == Instruction::PtrToInt) { >- if (const IntegerType* IntTy = dyn_cast(DstTy)){ >- uint64_t BitMask = IntTy->getBitMask(); >- writeOperand(I.getOperand(0)); >- Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); >- } >- } else if (I.getOpcode() == Instruction::SExt && SrcTy == Type::Int1Ty) { >+ if (I.getOpcode() == Instruction::SExt && SrcTy == Type::Int1Ty) { > // Make sure we really get a sext from bool by subtracing the bool from 0 > Out << "0-"; >- writeOperand(I.getOperand(0)); >- } else if (I.getOpcode() == Instruction::SExt && >- SrcTy->getTypeID() == Type::IntegerTyID) { >- IMPL_SIGN_EXTENSION(SrcTy, writeOperand(I.getOperand(0)) ); >- } else if (I.getOpcode() == Instruction::ZExt && >- SrcTy->getTypeID() == Type::IntegerTyID) { >- const IntegerType* IntTy = cast(SrcTy); >- uint64_t BitMask = IntTy->getBitMask(); >- writeOperand(I.getOperand(0)); >- Out << "&" << BitMask << (IntTy->getBitWidth() <=32 ? "U": "ULL"); > } >- else >- writeOperand(I.getOperand(0)); >+ writeOperand(I.getOperand(0)); >+ if (DstTy == Type::Int1Ty && >+ (I.getOpcode() == Instruction::Trunc || >+ I.getOpcode() == Instruction::FPToUI || >+ I.getOpcode() == Instruction::FPToSI || >+ I.getOpcode() == Instruction::PtrToInt)) { >+ // Make sure we really get a trunc to bool by anding the operand with 1 >+ Out << "&1u"; >+ } > } >- Out << ")"; >+ Out << ')'; > } > > void CWriter::visitSelectInst(SelectInst &I) { > > > >_______________________________________________ >llvm-commits mailing list >llvm-commits at cs.uiuc.edu >http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From reid at x10sys.com Thu May 3 06:17:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 3 May 2007 06:17:17 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200705031117.l43BHH0U024893@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.116 -> 1.117 --- Log message: Add Kelly Wilson. --- Diffs of the changes: (+5 -4) DevMtgMay2007.html | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.116 llvm-www/DevMtgMay2007.html:1.117 --- llvm-www/DevMtgMay2007.html:1.116 Tue May 1 20:42:00 2007 +++ llvm-www/DevMtgMay2007.html Thu May 3 06:16:53 2007 @@ -312,13 +312,13 @@

+
SpeakerTopic
Evan ChengBack end talk
Nick Lewycky Design and implementation of the PredicateSimplifier pass, or, "VRP in LLVM"
NameOrganization
Paul McJonesAdobe Systems Incorporated.
Scott MichelAerospace
Alireza MoshtaghiMicrochip Technology
Robert MyklandAscenium Corp.
Steve NaroffApple Inc.
Devang PatelApple Inc.
Nick LewyckyIndependent
Efrem LipkinCoDesign
Gabe McArthurIndependent
Paul McJonesAdobe Systems Incorporated.
- @@ -343,16 +343,17 @@
Confirmed Attendees
NameOrganization
Paul McJonesAdobe Systems Incorporated.
Scott MichelAerospace
Alireza MoshtaghiMicrochip Technology
Robert MyklandAscenium Corp.
-

Total confirmed: 40

+

Total confirmed: 41

+
Unconfirmed Attendees
NameOrganization
Rafael EspindolaGoogle
Lang HamesUniversity of Sydney
Michael McCrackenUCSD, Ph.D. Candidate
Kelly WilsonUniversity of Calgary
Unconfirmed 1NASA, Ames
-

Total unconfirmed: 4

+

Total unconfirmed: 5

@@ -362,6 +363,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
Last modified: $Date: 2007/05/02 01:42:00 $ +
Last modified: $Date: 2007/05/03 11:16:53 $ From raulherbster at gmail.com Thu May 3 08:32:11 2007 From: raulherbster at gmail.com (Raul Fernandes Herbster) Date: Thu, 3 May 2007 10:32:11 -0300 Subject: [llvm-commits] Path ARM/ELF debug support Message-ID: <6fbb4ff20705030632u6e592348lb25914c7c4d8bdd1@mail.gmail.com> This patch provides ARM/ELF debug support. Please, send me any problem related to it. Best regards, Raul Herbster. -- Raul Fernandes Herbster Embedded and Pervasive Computing Laboratory - embedded.dee.ufcg.edu.br Electrical Engineering Department - DEE - www.ee.ufcg.edu.br Electrical Engineering and Informatics Center - CEEI Federal University of Campina Grande - UFCG - www.ufcg.edu.br Caixa Postal 10105 58109-970 Campina Grande - PB - Brasil -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070503/4f450515/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: arm_debugger.patch Type: text/x-patch Size: 5358 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070503/4f450515/attachment.bin From lauro.venancio at gmail.com Thu May 3 09:05:25 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 09:05:25 -0500 Subject: [llvm-commits] CVS: llvm/utils/NewNightlyTest.pl Message-ID: <200705031405.l43E5PKT027456@zion.cs.uiuc.edu> Changes in directory llvm/utils: NewNightlyTest.pl updated: 1.71 -> 1.72 --- Log message: Make my proxy happy. --- Diffs of the changes: (+1 -0) NewNightlyTest.pl | 1 + 1 files changed, 1 insertion(+) Index: llvm/utils/NewNightlyTest.pl diff -u llvm/utils/NewNightlyTest.pl:1.71 llvm/utils/NewNightlyTest.pl:1.72 --- llvm/utils/NewNightlyTest.pl:1.71 Thu Apr 12 23:36:48 2007 +++ llvm/utils/NewNightlyTest.pl Thu May 3 09:05:07 2007 @@ -454,6 +454,7 @@ $length = length($content); my $send= "POST $file HTTP/1.0\n"; + $send.= "Host: $host\n"; $send.= "Content-Type: application/x-www-form-urlencoded\n"; $send.= "Content-length: $length\n\n"; $send.= "$content"; From djg at cray.com Thu May 3 11:39:17 2007 From: djg at cray.com (Dan Gohman) Date: Thu, 3 May 2007 11:39:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp Message-ID: <200705031639.l43GdH82030386@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetAsmInfo.cpp updated: 1.39 -> 1.40 --- Log message: Sets the section names for fixed-size constants and use the mergeable flag for ELF on x86 so that duplicate constants can be eliminated by the linker. This matches what GCC does with its -fmerge-constants option, which is enabled at most -O levels. --- Diffs of the changes: (+5 -0) X86TargetAsmInfo.cpp | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.39 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.40 --- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.39 Tue May 1 17:23:12 2007 +++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp Thu May 3 11:38:57 2007 @@ -107,6 +107,11 @@ // HasDotFile - True if target asm supports .file directives. // bool HasDotFile; // Defaults to false. ReadOnlySection = "\t.section\t.rodata\n"; + FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\", at progbits,4"; + EightByteConstantSection = "\t.section\t.rodata.cst8,\"aM\", at progbits,8"; + SixteenByteConstantSection = + "\t.section\t.rodata.cst16,\"aM\", at progbits,16"; + CStringSection = "\t.section\t.rodata.str1.1,\"aMS\", at progbits,1"; PrivateGlobalPrefix = ".L"; WeakRefDirective = "\t.weak\t"; SetDirective = "\t.set\t"; From sabre at nondot.org Thu May 3 11:40:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 11:40:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp PPCCallingConv.td Message-ID: <200705031640.l43Ge7jZ030437@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.238 -> 1.239 PPCCallingConv.td updated: 1.3 -> 1.4 --- Log message: add support for printing offset of global --- Diffs of the changes: (+6 -3) PPCAsmPrinter.cpp | 5 +++++ PPCCallingConv.td | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.238 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.239 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.238 Tue Apr 24 17:51:03 2007 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Thu May 3 11:39:48 2007 @@ -396,6 +396,11 @@ } O << Name; + if (MO.getOffset() > 0) + O << "+" << MO.getOffset(); + else if (MO.getOffset() < 0) + O << MO.getOffset(); + if (GV->hasExternalWeakLinkage()) ExtWeakSymbols.insert(GV); return; Index: llvm/lib/Target/PowerPC/PPCCallingConv.td diff -u llvm/lib/Target/PowerPC/PPCCallingConv.td:1.3 llvm/lib/Target/PowerPC/PPCCallingConv.td:1.4 --- llvm/lib/Target/PowerPC/PPCCallingConv.td:1.3 Tue Apr 3 07:35:28 2007 +++ llvm/lib/Target/PowerPC/PPCCallingConv.td Thu May 3 11:39:48 2007 @@ -35,7 +35,7 @@ //===----------------------------------------------------------------------===// // PowerPC Argument Calling Conventions //===----------------------------------------------------------------------===// -/* + def CC_PPC : CallingConv<[ // The first 8 integer arguments are passed in integer registers. CCIfType<[i32], CCAssignToReg<[R3, R4, R5, R6, R7, R8, R9, R10]>>, @@ -61,5 +61,3 @@ CCAssignToStack<16, 16>>*/ ]>; -*/ - From sabre at nondot.org Thu May 3 11:40:42 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 11:40:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCCallingConv.td Message-ID: <200705031640.l43Gegsp030494@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCCallingConv.td updated: 1.4 -> 1.5 --- Log message: revert accidental commit --- Diffs of the changes: (+3 -1) PPCCallingConv.td | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCCallingConv.td diff -u llvm/lib/Target/PowerPC/PPCCallingConv.td:1.4 llvm/lib/Target/PowerPC/PPCCallingConv.td:1.5 --- llvm/lib/Target/PowerPC/PPCCallingConv.td:1.4 Thu May 3 11:39:48 2007 +++ llvm/lib/Target/PowerPC/PPCCallingConv.td Thu May 3 11:40:25 2007 @@ -35,7 +35,7 @@ //===----------------------------------------------------------------------===// // PowerPC Argument Calling Conventions //===----------------------------------------------------------------------===// - +/* def CC_PPC : CallingConv<[ // The first 8 integer arguments are passed in integer registers. CCIfType<[i32], CCAssignToReg<[R3, R4, R5, R6, R7, R8, R9, R10]>>, @@ -61,3 +61,5 @@ CCAssignToStack<16, 16>>*/ ]>; +*/ + From sabre at nondot.org Thu May 3 11:42:41 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 11:42:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp Message-ID: <200705031642.l43GgfV6030579@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.69 -> 1.70 --- Log message: add support for printing offset from global --- Diffs of the changes: (+6 -0) ARMAsmPrinter.cpp | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.69 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.70 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.69 Sun Apr 29 19:23:51 2007 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Thu May 3 11:42:23 2007 @@ -294,6 +294,12 @@ FnStubs.insert(Name); } else O << Name; + + if (MO.getOffset() > 0) + O << '+' << MO.getOffset(); + else if (MO.getOffset() < 0) + O << MO.getOffset(); + if (isCallOp && Subtarget->isTargetELF() && TM.getRelocationModel() == Reloc::PIC_) O << "(PLT)"; From asl at math.spbu.ru Thu May 3 11:42:44 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Thu, 03 May 2007 20:42:44 +0400 Subject: [llvm-commits] llvm-gcc mirror problems Message-ID: <1178210564.13114.5.camel@asl.dorms.spbu.ru> Hello, Bill. What happened with llvm-gcc mirror? Currently it shows last update time to be 29.03. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From sabre at nondot.org Thu May 3 11:52:47 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 11:52:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200705031652.l43Gqlpr030824@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.398 -> 1.399 --- Log message: Fix two classes of bugs: 1. x86 backend rejected (&gv+c) for the 'i' constraint when in static mode. 2. the matcher didn't correctly reject and accept some global addresses. the right predicate is GVRequiresExtraLoad, not "relomodel = pic". --- Diffs of the changes: (+32 -8) X86ISelLowering.cpp | 40 ++++++++++++++++++++++++++++++++-------- 1 files changed, 32 insertions(+), 8 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.398 llvm/lib/Target/X86/X86ISelLowering.cpp:1.399 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.398 Wed May 2 14:53:33 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Thu May 3 11:52:29 2007 @@ -4734,25 +4734,49 @@ return Op; } return SDOperand(0,0); - case 'i': + case 'i': { // Literal immediates are always ok. if (isa(Op)) return Op; - // If we are in non-pic codegen mode, we allow the address of a global to - // be used with 'i'. - if (GlobalAddressSDNode *GA = dyn_cast(Op)) { - if (getTargetMachine().getRelocationModel() == Reloc::PIC_) + // If we are in non-pic codegen mode, we allow the address of a global (with + // an optional displacement) to be used with 'i'. + GlobalAddressSDNode *GA = dyn_cast(Op); + int64_t Offset = 0; + + // Match either (GA) or (GA+C) + if (GA) { + Offset = GA->getOffset(); + } else if (Op.getOpcode() == ISD::ADD) { + ConstantSDNode *C = dyn_cast(Op.getOperand(1)); + GA = dyn_cast(Op.getOperand(0)); + if (C && GA) { + Offset = GA->getOffset()+C->getValue(); + } else { + C = dyn_cast(Op.getOperand(1)); + GA = dyn_cast(Op.getOperand(0)); + if (C && GA) + Offset = GA->getOffset()+C->getValue(); + else + C = 0, GA = 0; + } + } + + if (GA) { + // If addressing this global requires a load (e.g. in PIC mode), we can't + // match. + if (Subtarget->GVRequiresExtraLoad(GA->getGlobal(), getTargetMachine(), + false)) return SDOperand(0, 0); - if (GA->getOpcode() != ISD::TargetGlobalAddress) - Op = DAG.getTargetGlobalAddress(GA->getGlobal(), GA->getValueType(0), - GA->getOffset()); + Op = DAG.getTargetGlobalAddress(GA->getGlobal(), GA->getValueType(0), + Offset); return Op; } // Otherwise, not valid for this mode. return SDOperand(0, 0); } + } return TargetLowering::isOperandValidForConstraint(Op, Constraint, DAG); } From sabre at nondot.org Thu May 3 11:54:25 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 11:54:25 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/2007-05-03-InlineAsm-S-Constraint.ll Message-ID: <200705031654.l43GsPEq030926@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: 2007-05-03-InlineAsm-S-Constraint.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+12 -0) 2007-05-03-InlineAsm-S-Constraint.ll | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/test/CodeGen/PowerPC/2007-05-03-InlineAsm-S-Constraint.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/2007-05-03-InlineAsm-S-Constraint.ll:1.1 *** /dev/null Thu May 3 11:54:18 2007 --- llvm/test/CodeGen/PowerPC/2007-05-03-InlineAsm-S-Constraint.ll Thu May 3 11:54:08 2007 *************** *** 0 **** --- 1,12 ---- + ; RUN: llvm-as < %s | llc + ; PR1382 + + 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 = "powerpc-apple-darwin8.8.0" + @x = global [2 x i32] [ i32 1, i32 2 ] ; <[2 x i32]*> [#uses=1] + + define void @foo() { + entry: + tail call void asm sideeffect "$0 $1", "s,i"( i8* bitcast (i32* getelementptr ([2 x i32]* @x, i32 0, i32 1) to i8*), i8* bitcast (i32* getelementptr ([2 x i32]* @x, i32 0, i32 1) to i8*) ) + ret void + } From sabre at nondot.org Thu May 3 11:54:52 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 11:54:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Message-ID: <200705031654.l43Gsqr3030948@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: TargetLowering.cpp updated: 1.112 -> 1.113 --- Log message: Allow i/s to match (gv+c). This fixes CodeGen/PowerPC/2007-05-03-InlineAsm-S-Constraint.ll and PR1382: http://llvm.org/PR1382 --- Diffs of the changes: (+31 -10) TargetLowering.cpp | 41 +++++++++++++++++++++++++++++++---------- 1 files changed, 31 insertions(+), 10 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.112 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.113 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.112 Tue Apr 17 22:01:40 2007 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Thu May 3 11:54:34 2007 @@ -1915,22 +1915,43 @@ case 'i': // Simple Integer or Relocatable Constant case 'n': // Simple Integer case 's': // Relocatable Constant - case 'X': // Allows any operand. - // These are okay if the operand is either a global variable address or a - // simple immediate value. If we have one of these, map to the TargetXXX - // version so that the value itself doesn't get selected. - if (ConstantSDNode *C = dyn_cast(Op)) { + case 'X': { // Allows any operand. + // These operands are interested in values of the form (GV+C), where C may + // be folded in as an offset of GV, or it may be explicitly added. Also, it + // is possible and fine if either GV or C are missing. + ConstantSDNode *C = dyn_cast(Op); + GlobalAddressSDNode *GA = dyn_cast(Op); + + // If we have "(add GV, C)", pull out GV/C + if (Op.getOpcode() == ISD::ADD) { + C = dyn_cast(Op.getOperand(1)); + GA = dyn_cast(Op.getOperand(0)); + if (C == 0 || GA == 0) { + C = dyn_cast(Op.getOperand(0)); + GA = dyn_cast(Op.getOperand(1)); + } + if (C == 0 || GA == 0) + C = 0, GA = 0; + } + + // If we find a valid operand, map to the TargetXXX version so that the + // value itself doesn't get selected. + if (GA) { // Either &GV or &GV+C + if (ConstraintLetter != 'n') { + int64_t Offs = GA->getOffset(); + if (C) Offs += C->getValue(); + return DAG.getTargetGlobalAddress(GA->getGlobal(), Op.getValueType(), + Offs); + } + } + if (C) { // just C, no GV. // Simple constants are not allowed for 's'. if (ConstraintLetter != 's') return DAG.getTargetConstant(C->getValue(), Op.getValueType()); } - if (GlobalAddressSDNode *GA = dyn_cast(Op)) { - if (ConstraintLetter != 'n') - return DAG.getTargetGlobalAddress(GA->getGlobal(), Op.getValueType(), - GA->getOffset()); - } break; } + } return SDOperand(0,0); } From lauro.venancio at gmail.com Thu May 3 11:56:37 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 11:56:37 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/SPASS/small_problem.dfg Makefile Message-ID: <200705031656.l43GubNj031108@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/SPASS: small_problem.dfg added (r1.1) Makefile updated: 1.7 -> 1.8 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+158 -0) Makefile | 4 + small_problem.dfg | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+) Index: llvm-test/MultiSource/Applications/SPASS/small_problem.dfg diff -c /dev/null llvm-test/MultiSource/Applications/SPASS/small_problem.dfg:1.1 *** /dev/null Thu May 3 11:55:56 2007 --- llvm-test/MultiSource/Applications/SPASS/small_problem.dfg Thu May 3 11:55:46 2007 *************** *** 0 **** --- 1,154 ---- + %------------------------------------------------------------------------------ + % File : SET002+4 : TPTP v3.1.0. Released v2.2.0. + % Domain : Set Theory (Naive) + % Problem : Idempotency of union + % Version : [Pas99] axioms. + % English : + + % Refs : [Pas99] Pastre (1999), Email to G. Sutcliffe + % Source : [Pas99] + % Names : + + % Status : Theorem + % Rating : 0.36 v3.1.0, 0.56 v2.7.0, 0.33 v2.6.0, 0.57 v2.5.0, 0.50 v2.4.0, 0.25 v2.3.0, 0.00 v2.2.1 + % Syntax : Number of formulae : 12 ( 2 unit) + % Number of atoms : 30 ( 3 equality) + % Maximal formula depth : 7 ( 5 average) + % Number of connectives : 20 ( 2 ~ ; 2 |; 4 &) + % ( 10 <=>; 2 =>; 0 <=) + % ( 0 <~>; 0 ~|; 0 ~&) + % Number of predicates : 4 ( 0 propositional; 2-2 arity) + % Number of functors : 9 ( 1 constant; 0-2 arity) + % Number of variables : 29 ( 0 singleton; 28 !; 1 ?) + % Maximal term depth : 2 ( 1 average) + + % Comments : + % : tptp2X -f dfg -t rm_equality:rstfp SET002+4.p + %------------------------------------------------------------------------------ + + begin_problem(TPTP_Problem). + + list_of_descriptions. + name({*[ File : SET002+4 : TPTP v3.1.0. Released v2.2.0.],[ Names :]*}). + author({*[ Source : [Pas99]]*}). + status(unknown). + description({*[ Refs : [Pas99] Pastre (1999), Email to G. Sutcliffe]*}). + end_of_list. + + list_of_symbols. + functions[(difference,2), (empty_set,0), (intersection,2), (power_set,1), (product,1), (singleton,1), (sum,1), (union,2), (unordered_pair,2)]. + predicates[(equal_set,2), (member,2), (subset,2)]. + end_of_list. + + list_of_formulae(axioms). + + formula( + forall([A,B], + equiv( + subset(A,B), + forall([X], + implies( + member(X,A), + member(X,B))))), + subset ). + + formula( + forall([A,B], + equiv( + equal_set(A,B), + and( + subset(A,B), + subset(B,A)))), + equal_set ). + + formula( + forall([X,A], + equiv( + member(X,power_set(A)), + subset(X,A))), + power_set ). + + formula( + forall([X,A,B], + equiv( + member(X,intersection(A,B)), + and( + member(X,A), + member(X,B)))), + intersection ). + + formula( + forall([X,A,B], + equiv( + member(X,union(A,B)), + or( + member(X,A), + member(X,B)))), + union ). + + formula( + forall([X], + not( + member(X,empty_set))), + empty_set ). + + formula( + forall([B,A,E], + equiv( + member(B,difference(E,A)), + and( + member(B,E), + not( + member(B,A))))), + difference ). + + formula( + forall([X,A], + equiv( + member(X,singleton(A)), + equal(X,A))), + singleton ). + + formula( + forall([X,A,B], + equiv( + member(X,unordered_pair(A,B)), + or( + equal(X,A), + equal(X,B)))), + unordered_pair ). + + formula( + forall([X,A], + equiv( + member(X,sum(A)), + exists([Y], + and( + member(Y,A), + member(X,Y))))), + sum ). + + formula( + forall([X,A], + equiv( + member(X,product(A)), + forall([Y], + implies( + member(Y,A), + member(X,Y))))), + product ). + + end_of_list. + + %----NOTE WELL: conjecture has been negated + list_of_formulae(conjectures). + + formula( %(conjecture) + forall([A], + equal_set(union(A,A),A)), + thI14 ). + + end_of_list. + + end_problem. + %------------------------------------------------------------------------------ Index: llvm-test/MultiSource/Applications/SPASS/Makefile diff -u llvm-test/MultiSource/Applications/SPASS/Makefile:1.7 llvm-test/MultiSource/Applications/SPASS/Makefile:1.8 --- llvm-test/MultiSource/Applications/SPASS/Makefile:1.7 Thu Sep 1 13:55:05 2005 +++ llvm-test/MultiSource/Applications/SPASS/Makefile Thu May 3 11:55:46 2007 @@ -4,6 +4,10 @@ CPPFLAGS = -DCLOCK_NO_TIMING -fno-strict-aliasing -w LDFLAGS = -lm +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS="$(PROJ_SRC_DIR)/small_problem.dfg" +else RUN_OPTIONS="$(PROJ_SRC_DIR)/problem.dfg" +endif include ../../Makefile.multisrc From lauro.venancio at gmail.com Thu May 3 11:56:37 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 11:56:37 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/Dhrystone/dry.c fldry.c Message-ID: <200705031656.l43Gubx4031117@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Benchmarks/Dhrystone: dry.c updated: 1.6 -> 1.7 fldry.c updated: 1.6 -> 1.7 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+8 -0) dry.c | 4 ++++ fldry.c | 4 ++++ 2 files changed, 8 insertions(+) Index: llvm-test/SingleSource/Benchmarks/Dhrystone/dry.c diff -u llvm-test/SingleSource/Benchmarks/Dhrystone/dry.c:1.6 llvm-test/SingleSource/Benchmarks/Dhrystone/dry.c:1.7 --- llvm-test/SingleSource/Benchmarks/Dhrystone/dry.c:1.6 Sat Nov 25 02:51:02 2006 +++ llvm-test/SingleSource/Benchmarks/Dhrystone/dry.c Thu May 3 11:55:46 2007 @@ -88,7 +88,11 @@ /*#define MYSTRFNS */ /* Accuracy of timings and human fatigue controlled by next two lines */ +#ifdef SMALL_PROBLEM_SIZE +#define LOOPS 2000000 +#else #define LOOPS 20000000 +#endif /* Compiler dependent options */ #undef NOENUM /* Define if compiler has no enum's */ Index: llvm-test/SingleSource/Benchmarks/Dhrystone/fldry.c diff -u llvm-test/SingleSource/Benchmarks/Dhrystone/fldry.c:1.6 llvm-test/SingleSource/Benchmarks/Dhrystone/fldry.c:1.7 --- llvm-test/SingleSource/Benchmarks/Dhrystone/fldry.c:1.6 Sat Nov 25 02:51:02 2006 +++ llvm-test/SingleSource/Benchmarks/Dhrystone/fldry.c Thu May 3 11:55:46 2007 @@ -88,7 +88,11 @@ /*#define MYSTRFNS*/ /* Accuracy of timings and human fatigue controlled by next two lines */ +#ifdef SMALL_PROBLEM_SIZE +#define LOOPS 2000000 +#else #define LOOPS 20000000 +#endif /* Compiler dependent options */ #undef NOENUM /* Define if compiler has no enum's */ From lauro.venancio at gmail.com Thu May 3 11:56:37 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 11:56:37 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/Shootout/ary3.c fib2.c hash.c heapsort.c lists.c matrix.c methcall.c nestedloop.c objinst.c random.c sieve.c Message-ID: <200705031656.l43GubiY031113@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Benchmarks/Shootout: ary3.c updated: 1.4 -> 1.5 fib2.c updated: 1.4 -> 1.5 hash.c updated: 1.2 -> 1.3 heapsort.c updated: 1.3 -> 1.4 lists.c updated: 1.6 -> 1.7 matrix.c updated: 1.3 -> 1.4 methcall.c updated: 1.2 -> 1.3 nestedloop.c updated: 1.2 -> 1.3 objinst.c updated: 1.3 -> 1.4 random.c updated: 1.4 -> 1.5 sieve.c updated: 1.3 -> 1.4 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+77 -22) ary3.c | 9 +++++++-- fib2.c | 9 +++++++-- hash.c | 9 +++++++-- heapsort.c | 9 +++++++-- lists.c | 9 +++++++-- matrix.c | 9 +++++++-- methcall.c | 9 +++++++-- nestedloop.c | 9 +++++++-- objinst.c | 9 +++++++-- random.c | 9 +++++++-- sieve.c | 9 +++++++-- 11 files changed, 77 insertions(+), 22 deletions(-) Index: llvm-test/SingleSource/Benchmarks/Shootout/ary3.c diff -u llvm-test/SingleSource/Benchmarks/Shootout/ary3.c:1.4 llvm-test/SingleSource/Benchmarks/Shootout/ary3.c:1.5 --- llvm-test/SingleSource/Benchmarks/Shootout/ary3.c:1.4 Fri Jul 16 13:11:07 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout/ary3.c Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ /* -*- mode: c -*- - * $Id: ary3.c,v 1.4 2004/07/16 18:11:07 brukman Exp $ + * $Id: ary3.c,v 1.5 2007/05/03 16:55:46 laurov Exp $ * http://www.bagley.org/~doug/shootout/ * * this program is modified from: @@ -15,7 +15,12 @@ #include int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 1500000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 150000 +#else +#define LENGTH 1500000 +#endif + int n = ((argc == 2) ? atoi(argv[1]) : LENGTH); int i, k, *x, *y; x = (int *) calloc(n, sizeof(int)); Index: llvm-test/SingleSource/Benchmarks/Shootout/fib2.c diff -u llvm-test/SingleSource/Benchmarks/Shootout/fib2.c:1.4 llvm-test/SingleSource/Benchmarks/Shootout/fib2.c:1.5 --- llvm-test/SingleSource/Benchmarks/Shootout/fib2.c:1.4 Thu May 25 13:31:14 2006 +++ llvm-test/SingleSource/Benchmarks/Shootout/fib2.c Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ /* -*- mode: c -*- - * $Id: fib2.c,v 1.4 2006/05/25 18:31:14 lattner Exp $ + * $Id: fib2.c,v 1.5 2007/05/03 16:55:46 laurov Exp $ * http://www.bagley.org/~doug/shootout/ */ @@ -16,7 +16,12 @@ int main(int argc, char *argv[]) { - int N = ((argc == 2) ? atoi(argv[1]) : 43); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 40 +#else +#define LENGTH 43 +#endif + int N = ((argc == 2) ? atoi(argv[1]) : LENGTH); printf("%ld\n", fib(N)); return(0); } Index: llvm-test/SingleSource/Benchmarks/Shootout/hash.c diff -u llvm-test/SingleSource/Benchmarks/Shootout/hash.c:1.2 llvm-test/SingleSource/Benchmarks/Shootout/hash.c:1.3 --- llvm-test/SingleSource/Benchmarks/Shootout/hash.c:1.2 Tue Jun 8 12:21:42 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout/hash.c Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ /* -*- mode: c -*- - * $Id: hash.c,v 1.2 2004/06/08 17:21:42 lattner Exp $ + * $Id: hash.c,v 1.3 2007/05/03 16:55:46 laurov Exp $ * http://www.bagley.org/~doug/shootout/ */ @@ -9,7 +9,12 @@ #include "simple_hash.h" int main(int argc, char *argv[]) { - int i, c=0, n = ((argc == 2) ? atoi(argv[1]) : 3500000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 350000 +#else +#define LENGTH 3500000 +#endif + int i, c=0, n = ((argc == 2) ? atoi(argv[1]) : LENGTH); char buf[32]; struct ht_ht *ht = ht_create(n); Index: llvm-test/SingleSource/Benchmarks/Shootout/heapsort.c diff -u llvm-test/SingleSource/Benchmarks/Shootout/heapsort.c:1.3 llvm-test/SingleSource/Benchmarks/Shootout/heapsort.c:1.4 --- llvm-test/SingleSource/Benchmarks/Shootout/heapsort.c:1.3 Tue Jun 8 12:21:42 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout/heapsort.c Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ /* -*- mode: c -*- - * $Id: heapsort.c,v 1.3 2004/06/08 17:21:42 lattner Exp $ + * $Id: heapsort.c,v 1.4 2007/05/03 16:55:46 laurov Exp $ * http://www.bagley.org/~doug/shootout/ */ @@ -56,7 +56,12 @@ int main(int argc, char *argv[]) { - int N = ((argc == 2) ? atoi(argv[1]) : 8000000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 800000 +#else +#define LENGTH 8000000 +#endif + int N = ((argc == 2) ? atoi(argv[1]) : LENGTH); double *ary; int i; Index: llvm-test/SingleSource/Benchmarks/Shootout/lists.c diff -u llvm-test/SingleSource/Benchmarks/Shootout/lists.c:1.6 llvm-test/SingleSource/Benchmarks/Shootout/lists.c:1.7 --- llvm-test/SingleSource/Benchmarks/Shootout/lists.c:1.6 Tue Jun 8 12:21:42 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout/lists.c Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ /* -*- mode: c -*- - * $Id: lists.c,v 1.6 2004/06/08 17:21:42 lattner Exp $ + * $Id: lists.c,v 1.7 2007/05/03 16:55:46 laurov Exp $ * http://www.bagley.org/~doug/shootout/ */ @@ -217,7 +217,12 @@ } int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 3000000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 300000 +#else +#define LENGTH 3000000 +#endif + int n = ((argc == 2) ? atoi(argv[1]) : LENGTH); int result = 0; while(n--) result = test_lists(); printf("%d\n", result); Index: llvm-test/SingleSource/Benchmarks/Shootout/matrix.c diff -u llvm-test/SingleSource/Benchmarks/Shootout/matrix.c:1.3 llvm-test/SingleSource/Benchmarks/Shootout/matrix.c:1.4 --- llvm-test/SingleSource/Benchmarks/Shootout/matrix.c:1.3 Tue Jun 8 12:21:42 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout/matrix.c Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ /* -*- mode: c -*- - * $Id: matrix.c,v 1.3 2004/06/08 17:21:42 lattner Exp $ + * $Id: matrix.c,v 1.4 2007/05/03 16:55:46 laurov Exp $ * http://www.bagley.org/~doug/shootout/ */ @@ -48,7 +48,12 @@ } int main(int argc, char *argv[]) { - int i, n = ((argc == 2) ? atoi(argv[1]) : 3000000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 300000 +#else +#define LENGTH 3000000 +#endif + int i, n = ((argc == 2) ? atoi(argv[1]) : LENGTH); int **m1 = mkmatrix(SIZE, SIZE); int **m2 = mkmatrix(SIZE, SIZE); Index: llvm-test/SingleSource/Benchmarks/Shootout/methcall.c diff -u llvm-test/SingleSource/Benchmarks/Shootout/methcall.c:1.2 llvm-test/SingleSource/Benchmarks/Shootout/methcall.c:1.3 --- llvm-test/SingleSource/Benchmarks/Shootout/methcall.c:1.2 Tue Jun 8 12:21:42 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout/methcall.c Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ /* -*- mode: c -*- - * $Id: methcall.c,v 1.2 2004/06/08 17:21:42 lattner Exp $ + * $Id: methcall.c,v 1.3 2007/05/03 16:55:46 laurov Exp $ * http://www.bagley.org/~doug/shootout/ */ @@ -66,7 +66,12 @@ int main(int argc, char *argv[]) { - int i, n = ((argc == 2) ? atoi(argv[1]) : 500000000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 50000000 +#else +#define LENGTH 500000000 +#endif + int i, n = ((argc == 2) ? atoi(argv[1]) : LENGTH); Toggle *tog; NthToggle *ntog; char val = true; Index: llvm-test/SingleSource/Benchmarks/Shootout/nestedloop.c diff -u llvm-test/SingleSource/Benchmarks/Shootout/nestedloop.c:1.2 llvm-test/SingleSource/Benchmarks/Shootout/nestedloop.c:1.3 --- llvm-test/SingleSource/Benchmarks/Shootout/nestedloop.c:1.2 Tue Jun 8 12:21:42 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout/nestedloop.c Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ /* -*- mode: c -*- - * $Id: nestedloop.c,v 1.2 2004/06/08 17:21:42 lattner Exp $ + * $Id: nestedloop.c,v 1.3 2007/05/03 16:55:46 laurov Exp $ * http://www.bagley.org/~doug/shootout/ */ @@ -8,7 +8,12 @@ int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 46); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 30 +#else +#define LENGTH 46 +#endif + int n = ((argc == 2) ? atoi(argv[1]) : LENGTH); int a, b, c, d, e, f, x=0; for (a=0; a Changes in directory llvm-test/SingleSource/Benchmarks/Shootout-C++: ackermann.cpp updated: 1.2 -> 1.3 ary.cpp updated: 1.4 -> 1.5 ary2.cpp updated: 1.5 -> 1.6 ary3.cpp updated: 1.2 -> 1.3 except.cpp updated: 1.2 -> 1.3 fibo.cpp updated: 1.2 -> 1.3 hash.cpp updated: 1.3 -> 1.4 hash2.cpp updated: 1.2 -> 1.3 heapsort.cpp updated: 1.3 -> 1.4 lists.cpp updated: 1.3 -> 1.4 lists1.cpp updated: 1.5 -> 1.6 matrix.cpp updated: 1.2 -> 1.3 methcall.cpp updated: 1.2 -> 1.3 moments.cpp updated: 1.4 -> 1.5 nestedloop.cpp updated: 1.2 -> 1.3 objinst.cpp updated: 1.2 -> 1.3 random.cpp updated: 1.2 -> 1.3 sieve.cpp updated: 1.3 -> 1.4 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+124 -34) ackermann.cpp | 9 +++++++-- ary.cpp | 9 +++++++-- ary2.cpp | 9 +++++++-- ary3.cpp | 9 +++++++-- except.cpp | 9 +++++++-- fibo.cpp | 9 +++++++-- hash.cpp | 9 +++++++-- hash2.cpp | 9 +++++++-- heapsort.cpp | 9 +++++++-- lists.cpp | 9 +++++++-- lists1.cpp | 9 +++++++-- matrix.cpp | 9 +++++++-- methcall.cpp | 9 +++++++-- moments.cpp | 7 ++++++- nestedloop.cpp | 9 +++++++-- objinst.cpp | 9 +++++++-- random.cpp | 9 +++++++-- sieve.cpp | 7 ++++++- 18 files changed, 124 insertions(+), 34 deletions(-) Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp:1.3 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp:1.2 Tue Jun 15 15:48:16 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/ackermann.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: ackermann.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ +// $Id: ackermann.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -10,7 +10,12 @@ int Ack(int M, int N) { return(M ? (Ack(M-1,N ? Ack(M,(N-1)) : 1)) : N+1); } int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 12); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 11 +#else +#define LENGTH 12 +#endif + int n = ((argc == 2) ? atoi(argv[1]) : LENGTH); cout << "Ack(3," << n << "): " << Ack(3, n) << endl; return(0); Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/ary.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/ary.cpp:1.4 llvm-test/SingleSource/Benchmarks/Shootout-C++/ary.cpp:1.5 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/ary.cpp:1.4 Sat Jul 24 05:44:11 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/ary.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: ary.cpp,v 1.4 2004/07/24 10:44:11 alkis Exp $ +// $Id: ary.cpp,v 1.5 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -7,7 +7,12 @@ int main(int argc, char *argv[]) { - int i, n = ((argc == 2) ? atoi(argv[1]) : 9000000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 900000 +#else +#define LENGTH 9000000 +#endif + int i, n = ((argc == 2) ? atoi(argv[1]) : LENGTH); typedef std::vector ARY; ARY x(n); ARY y(n); Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/ary2.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/ary2.cpp:1.5 llvm-test/SingleSource/Benchmarks/Shootout-C++/ary2.cpp:1.6 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/ary2.cpp:1.5 Sat Jul 24 05:44:11 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/ary2.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: ary2.cpp,v 1.5 2004/07/24 10:44:11 alkis Exp $ +// $Id: ary2.cpp,v 1.6 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -7,7 +7,12 @@ int main(int argc, char *argv[]) { - int i, n = 10*((argc == 2) ? atoi(argv[1]) : 900000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 90000 +#else +#define LENGTH 900000 +#endif + int i, n = 10*((argc == 2) ? atoi(argv[1]) : LENGTH); typedef std::vector ARY; ARY x(n); ARY y(n); Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/ary3.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/ary3.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/ary3.cpp:1.3 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/ary3.cpp:1.2 Tue Jun 15 15:48:16 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/ary3.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: ary3.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ +// $Id: ary3.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -8,7 +8,12 @@ using namespace std; int main(int argc, char *argv[]) { - int i, k, n = ((argc == 2) ? atoi(argv[1]) : 1500000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 150000 +#else +#define LENGTH 1500000 +#endif + int i, k, n = ((argc == 2) ? atoi(argv[1]) : LENGTH); typedef vector ARY; ARY x(n); ARY y(n); Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/except.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/except.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/except.cpp:1.3 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/except.cpp:1.2 Tue Jun 15 15:48:16 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/except.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: except.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ +// $Id: except.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ // from Bill Lear @@ -61,7 +61,12 @@ int main(int argc, char* argv[]) { - size_t NUM = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 100000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 10000 +#else +#define LENGTH 100000 +#endif + size_t NUM = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): LENGTH); while (NUM--) { some_function(NUM); } Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/fibo.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/fibo.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/fibo.cpp:1.3 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/fibo.cpp:1.2 Tue Jun 15 15:48:16 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/fibo.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: fibo.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ +// $Id: fibo.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -15,7 +15,12 @@ } int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 43); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 40 +#else +#define LENGTH 43 +#endif + int n = ((argc == 2) ? atoi(argv[1]) : LENGTH); cout << fib(n) << endl; return(0); Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/hash.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/hash.cpp:1.3 llvm-test/SingleSource/Benchmarks/Shootout-C++/hash.cpp:1.4 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/hash.cpp:1.3 Sat Jul 24 05:44:11 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/hash.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: hash.cpp,v 1.3 2004/07/24 10:44:11 alkis Exp $ +// $Id: hash.cpp,v 1.4 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -16,7 +16,12 @@ int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 500000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 50000 +#else +#define LENGTH 500000 +#endif + int n = ((argc == 2) ? atoi(argv[1]) : LENGTH); char buf[16]; typedef hash_map, eqstr> HM; HM X; Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/hash2.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/hash2.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/hash2.cpp:1.3 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/hash2.cpp:1.2 Tue Jun 15 15:48:16 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/hash2.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: hash2.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ +// $Id: hash2.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -16,7 +16,12 @@ int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 2000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 200 +#else +#define LENGTH 2000 +#endif + int n = ((argc == 2) ? atoi(argv[1]) : LENGTH); char buf[16]; typedef hash_map, eqstr> HM; HM hash1, hash2; Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp:1.3 llvm-test/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp:1.4 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp:1.3 Tue Jun 15 15:48:16 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/heapsort.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: heapsort.cpp,v 1.3 2004/06/15 20:48:16 lattner Exp $ +// $Id: heapsort.cpp,v 1.4 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -53,7 +53,12 @@ int main(int argc, char *argv[]) { - int N = ((argc == 2) ? atoi(argv[1]) : 8000000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 800000 +#else +#define LENGTH 8000000 +#endif + int N = ((argc == 2) ? atoi(argv[1]) : LENGTH); double *ary; int i; Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/lists.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/lists.cpp:1.3 llvm-test/SingleSource/Benchmarks/Shootout-C++/lists.cpp:1.4 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/lists.cpp:1.3 Tue Jun 15 15:48:16 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/lists.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: lists.cpp,v 1.3 2004/06/15 20:48:16 lattner Exp $ +// $Id: lists.cpp,v 1.4 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ // from Bill Lear @@ -46,7 +46,12 @@ } int main(int argc, char* argv[]) { - size_t ITER = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 3000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 300 +#else +#define LENGTH 3000 +#endif + size_t ITER = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): LENGTH); size_t result = 0; while (ITER > 0) { Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/lists1.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.5 llvm-test/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.6 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/lists1.cpp:1.5 Sat Jul 24 05:44:11 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/lists1.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: lists1.cpp,v 1.5 2004/07/24 10:44:11 alkis Exp $ +// $Id: lists1.cpp,v 1.6 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -27,7 +27,12 @@ } int main(int argc, char* argv[]) { - int N = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 1000000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 100000 +#else +#define LENGTH 1000000 +#endif + int N = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): LENGTH); list::iterator i; // create empty list B Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/matrix.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/matrix.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/matrix.cpp:1.3 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/matrix.cpp:1.2 Tue Jun 15 15:48:16 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/matrix.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: matrix.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ +// $Id: matrix.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -48,7 +48,12 @@ } int main(int argc, char *argv[]) { - int i, n = ((argc == 2) ? atoi(argv[1]) : 100000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 10000 +#else +#define LENGTH 100000 +#endif + int i, n = ((argc == 2) ? atoi(argv[1]) : LENGTH); int **m1 = mkmatrix(SIZE, SIZE); int **m2 = mkmatrix(SIZE, SIZE); Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/methcall.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/methcall.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/methcall.cpp:1.3 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/methcall.cpp:1.2 Tue Jun 15 15:48:16 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/methcall.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: methcall.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ +// $Id: methcall.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ // with some help from Bill Lear @@ -43,7 +43,12 @@ int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 1000000000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 100000000 +#else +#define LENGTH 1000000000 +#endif + int n = ((argc == 2) ? atoi(argv[1]) : LENGTH); bool val = true; Toggle *toggle = new Toggle(val); Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/moments.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/moments.cpp:1.4 llvm-test/SingleSource/Benchmarks/Shootout-C++/moments.cpp:1.5 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/moments.cpp:1.4 Sat Jul 24 05:44:11 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/moments.cpp Thu May 3 11:55:46 2007 @@ -66,7 +66,12 @@ }; int main(int argc, char**argv) { - int n = ((argc == 2) ? atoi(argv[1]) : 5000000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 500000 +#else +#define LENGTH 5000000 +#endif + int n = ((argc == 2) ? atoi(argv[1]) : LENGTH); vector v; double d; Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp:1.3 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp:1.2 Tue Jun 15 15:48:16 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/nestedloop.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: nestedloop.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ +// $Id: nestedloop.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -8,7 +8,12 @@ using namespace std; int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 46); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 30 +#else +#define LENGTH 46 +#endif + int n = ((argc == 2) ? atoi(argv[1]) : LENGTH); int a, b, c, d, e, f, x=0; for (a=0; a @@ -40,7 +40,12 @@ int main(int argc, char *argv[]) { - int n = ((argc == 2) ? atoi(argv[1]) : 70000000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 7000000 +#else +#define LENGTH 70000000 +#endif + int n = ((argc == 2) ? atoi(argv[1]) : LENGTH); Toggle *toggle1 = new Toggle(true); for (int i=0; i<5; i++) { Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/random.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/random.cpp:1.2 llvm-test/SingleSource/Benchmarks/Shootout-C++/random.cpp:1.3 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/random.cpp:1.2 Tue Jun 15 15:48:16 2004 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/random.cpp Thu May 3 11:55:46 2007 @@ -1,5 +1,5 @@ // -*- mode: c++ -*- -// $Id: random.cpp,v 1.2 2004/06/15 20:48:16 lattner Exp $ +// $Id: random.cpp,v 1.3 2007/05/03 16:55:46 laurov Exp $ // http://www.bagley.org/~doug/shootout/ #include @@ -19,7 +19,12 @@ } int main(int argc, char *argv[]) { - int N = ((argc == 2) ? atoi(argv[1]) : 400000000); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 4000000 +#else +#define LENGTH 400000000 +#endif + int N = ((argc == 2) ? atoi(argv[1]) : LENGTH); double result = 0; while (N--) { Index: llvm-test/SingleSource/Benchmarks/Shootout-C++/sieve.cpp diff -u llvm-test/SingleSource/Benchmarks/Shootout-C++/sieve.cpp:1.3 llvm-test/SingleSource/Benchmarks/Shootout-C++/sieve.cpp:1.4 --- llvm-test/SingleSource/Benchmarks/Shootout-C++/sieve.cpp:1.3 Fri Nov 17 15:22:26 2006 +++ llvm-test/SingleSource/Benchmarks/Shootout-C++/sieve.cpp Thu May 3 11:55:46 2007 @@ -25,7 +25,12 @@ int main(int argc, char *argv[]) { - size_t NUM = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): 500); +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 50 +#else +#define LENGTH 500 +#endif + size_t NUM = (argc == 2 ? (atoi(argv[1]) < 1 ? 1 : atoi(argv[1])): LENGTH); vector primes; From lauro.venancio at gmail.com Thu May 3 11:56:37 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 11:56:37 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/Misc-C++/mandel-text.cpp Message-ID: <200705031656.l43GubAg031120@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Benchmarks/Misc-C++: mandel-text.cpp updated: 1.2 -> 1.3 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+4 -0) mandel-text.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-test/SingleSource/Benchmarks/Misc-C++/mandel-text.cpp diff -u llvm-test/SingleSource/Benchmarks/Misc-C++/mandel-text.cpp:1.2 llvm-test/SingleSource/Benchmarks/Misc-C++/mandel-text.cpp:1.3 --- llvm-test/SingleSource/Benchmarks/Misc-C++/mandel-text.cpp:1.2 Tue Jan 31 10:39:37 2006 +++ llvm-test/SingleSource/Benchmarks/Misc-C++/mandel-text.cpp Thu May 3 11:55:46 2007 @@ -7,7 +7,11 @@ // number of iterations before we quit int maxiter = 255; +#ifdef SMALL_PROBLEM_SIZE + int slowdown = 20; +#else int slowdown = 2000; +#endif // size and position of the rect on the imaginary plane double fViewRectReal = -2.3, fViewRectImg = -1.0; From lauro.venancio at gmail.com Thu May 3 11:56:38 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 11:56:38 -0500 Subject: [llvm-commits] CVS: llvm-test/Makefile.rules Message-ID: <200705031656.l43GucJc031134@zion.cs.uiuc.edu> Changes in directory llvm-test: Makefile.rules updated: 1.25 -> 1.26 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+4 -0) Makefile.rules | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-test/Makefile.rules diff -u llvm-test/Makefile.rules:1.25 llvm-test/Makefile.rules:1.26 --- llvm-test/Makefile.rules:1.25 Thu Feb 8 21:43:45 2007 +++ llvm-test/Makefile.rules Thu May 3 11:55:46 2007 @@ -344,6 +344,10 @@ TARGET_FLAGS += $(EXTRA_OPTIONS) endif +ifdef SMALL_PROBLEM_SIZE +CPPFLAGS += -DSMALL_PROBLEM_SIZE +endif + # # Compile commands with libtool. # From lauro.venancio at gmail.com Thu May 3 11:56:39 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 11:56:39 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/Misc/ReedSolomon.c mandel.c pi.c richards_benchmark.c whetstone.c Message-ID: <200705031656.l43GudxL031157@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Benchmarks/Misc: ReedSolomon.c updated: 1.2 -> 1.3 mandel.c updated: 1.11 -> 1.12 pi.c updated: 1.5 -> 1.6 richards_benchmark.c updated: 1.4 -> 1.5 whetstone.c updated: 1.3 -> 1.4 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+26 -2) ReedSolomon.c | 10 ++++++++-- mandel.c | 4 ++++ pi.c | 4 ++++ richards_benchmark.c | 6 ++++++ whetstone.c | 4 ++++ 5 files changed, 26 insertions(+), 2 deletions(-) Index: llvm-test/SingleSource/Benchmarks/Misc/ReedSolomon.c diff -u llvm-test/SingleSource/Benchmarks/Misc/ReedSolomon.c:1.2 llvm-test/SingleSource/Benchmarks/Misc/ReedSolomon.c:1.3 --- llvm-test/SingleSource/Benchmarks/Misc/ReedSolomon.c:1.2 Sat Nov 25 02:51:02 2006 +++ llvm-test/SingleSource/Benchmarks/Misc/ReedSolomon.c Thu May 3 11:55:46 2007 @@ -416,8 +416,14 @@ int main(void) { unsigned char rs_in[204], rs_out[204]; int i, j, k; - - for (i=0; i<150000; ++i) { + +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 15000 +#else +#define LENGTH 150000 +#endif + + for (i=0; i #include +#ifdef SMALL_PROBLEM_SIZE +#define Count 1000*1000 +#define Qpktcountval 2326389 +#define Holdcountval 930555 +#else #define Count 10000*1000 #define Qpktcountval 23263894 #define Holdcountval 9305557 +#endif #define TRUE 1 Index: llvm-test/SingleSource/Benchmarks/Misc/whetstone.c diff -u llvm-test/SingleSource/Benchmarks/Misc/whetstone.c:1.3 llvm-test/SingleSource/Benchmarks/Misc/whetstone.c:1.4 --- llvm-test/SingleSource/Benchmarks/Misc/whetstone.c:1.3 Sun Feb 29 21:39:02 2004 +++ llvm-test/SingleSource/Benchmarks/Misc/whetstone.c Thu May 3 11:55:46 2007 @@ -99,7 +99,11 @@ float KIPS; int continuous; +#ifdef SMALL_PROBLEM_SIZE + loopstart = 2500; +#else loopstart = 100000; /* see the note about LOOP below */ +#endif continuous = 0; II = 1; /* start at the first arg (temp use of II here) */ From lauro.venancio at gmail.com Thu May 3 11:56:39 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 11:56:39 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Makefile.singlesrc Message-ID: <200705031656.l43GudWB031139@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource: Makefile.singlesrc updated: 1.37 -> 1.38 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+2 -2) Makefile.singlesrc | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-test/SingleSource/Makefile.singlesrc diff -u llvm-test/SingleSource/Makefile.singlesrc:1.37 llvm-test/SingleSource/Makefile.singlesrc:1.38 --- llvm-test/SingleSource/Makefile.singlesrc:1.37 Thu Mar 1 00:14:14 2007 +++ llvm-test/SingleSource/Makefile.singlesrc Thu May 3 11:55:46 2007 @@ -34,10 +34,10 @@ # FIXME: LIBS should be specified, not hardcoded to -lm Output/%.native: $(SourceDir)/%.c Output/.dir - -$(CC) -O2 $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) + -$(CC) -O2 $(CPPFLAGS) $(CFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) Output/%.native: $(SourceDir)/%.cpp Output/.dir - -$(CXX) -O2 $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) + -$(CXX) -O2 $(CPPFLAGS) $(CXXFLAGS) $(TARGET_FLAGS) $< -lm -o $@ $(LDFLAGS) bugpoint-gccas bugpoint-opt bugpoint-llvm-ld bugpoint-gccld bugpoint-jit bugpoint-llc bugpoint-llc-beta: From lauro.venancio at gmail.com Thu May 3 11:56:40 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 11:56:40 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/McGill/chomp.c misr.c queens.c Message-ID: <200705031656.l43Gue7Y031170@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Benchmarks/McGill: chomp.c updated: 1.2 -> 1.3 misr.c updated: 1.3 -> 1.4 queens.c updated: 1.2 -> 1.3 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+17 -1) chomp.c | 10 +++++++++- misr.c | 4 ++++ queens.c | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) Index: llvm-test/SingleSource/Benchmarks/McGill/chomp.c diff -u llvm-test/SingleSource/Benchmarks/McGill/chomp.c:1.2 llvm-test/SingleSource/Benchmarks/McGill/chomp.c:1.3 --- llvm-test/SingleSource/Benchmarks/McGill/chomp.c:1.2 Fri Nov 24 15:19:41 2006 +++ llvm-test/SingleSource/Benchmarks/McGill/chomp.c Thu May 3 11:55:46 2007 @@ -375,13 +375,21 @@ #if 0 scanf("%d",&ncol); #else +#ifdef SMALL_PROBLEM_SIZE ncol = 7; +#else + ncol = 7; +#endif #endif printf("Enter number of Rows : "); #if 0 scanf("%d",&nrow); #else - nrow = 8; +#ifdef SMALL_PROBLEM_SIZE + nrow = 7; +#else + nrow = 8; +#endif #endif tree = make_play(1); /* create entire tree structure, not just the */ player = 0; /* needed part for first move */ Index: llvm-test/SingleSource/Benchmarks/McGill/misr.c diff -u llvm-test/SingleSource/Benchmarks/McGill/misr.c:1.3 llvm-test/SingleSource/Benchmarks/McGill/misr.c:1.4 --- llvm-test/SingleSource/Benchmarks/McGill/misr.c:1.3 Fri Nov 24 15:19:41 2006 +++ llvm-test/SingleSource/Benchmarks/McGill/misr.c Thu May 3 11:55:46 2007 @@ -80,7 +80,11 @@ reg_len = num_vect = 10; prob = .25; +#ifdef SMALL_PROBLEM_SIZE + num_times = 30000; +#else num_times = 100000; +#endif if (argc > 6) strcpy(structure, argv[6]); Index: llvm-test/SingleSource/Benchmarks/McGill/queens.c diff -u llvm-test/SingleSource/Benchmarks/McGill/queens.c:1.2 llvm-test/SingleSource/Benchmarks/McGill/queens.c:1.3 --- llvm-test/SingleSource/Benchmarks/McGill/queens.c:1.2 Fri Nov 24 15:19:41 2006 +++ llvm-test/SingleSource/Benchmarks/McGill/queens.c Thu May 3 11:55:46 2007 @@ -220,7 +220,11 @@ /**** DECODE COMMAND LINE ARGUMENTS ****/ printing = 0; +#ifdef SMALL_PROBLEM_SIZE + queens = 13; +#else queens = 14; +#endif findall = 1; for(i = 1; i < argc; ++i) { /* Scan through arguments */ From lauro.venancio at gmail.com Thu May 3 11:56:39 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 11:56:39 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/CoyoteBench/almabench.c fftbench.cpp huffbench.c Message-ID: <200705031656.l43GudJX031158@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Benchmarks/CoyoteBench: almabench.c updated: 1.1 -> 1.2 fftbench.cpp updated: 1.1 -> 1.2 huffbench.c updated: 1.1 -> 1.2 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+17 -0) almabench.c | 8 ++++++++ fftbench.cpp | 4 ++++ huffbench.c | 5 +++++ 3 files changed, 17 insertions(+) Index: llvm-test/SingleSource/Benchmarks/CoyoteBench/almabench.c diff -u llvm-test/SingleSource/Benchmarks/CoyoteBench/almabench.c:1.1 llvm-test/SingleSource/Benchmarks/CoyoteBench/almabench.c:1.2 --- llvm-test/SingleSource/Benchmarks/CoyoteBench/almabench.c:1.1 Sat Mar 4 16:35:18 2006 +++ llvm-test/SingleSource/Benchmarks/CoyoteBench/almabench.c Thu May 3 11:55:46 2007 @@ -53,10 +53,18 @@ static const int TEST_LOOPS = 1; #endif #else +#ifdef SMALL_PROBLEM_SIZE +static const int TEST_LOOPS = 1; +#else static const int TEST_LOOPS = 20; #endif +#endif +#ifdef SMALL_PROBLEM_SIZE +static const int TEST_LENGTH = 3652; +#else static const int TEST_LENGTH = 36525; +#endif // sin and cos of j2000 mean obliquity (iau 1976) static const double sineps = 0.3977771559319137; Index: llvm-test/SingleSource/Benchmarks/CoyoteBench/fftbench.cpp diff -u llvm-test/SingleSource/Benchmarks/CoyoteBench/fftbench.cpp:1.1 llvm-test/SingleSource/Benchmarks/CoyoteBench/fftbench.cpp:1.2 --- llvm-test/SingleSource/Benchmarks/CoyoteBench/fftbench.cpp:1.1 Sat Mar 4 16:35:18 2006 +++ llvm-test/SingleSource/Benchmarks/CoyoteBench/fftbench.cpp Thu May 3 11:55:46 2007 @@ -43,8 +43,12 @@ static const int TEST_SIZE = 131072; #endif #else +#ifdef SMALL_PROBLEM_SIZE +static const int TEST_SIZE = 50000; +#else static const int TEST_SIZE = 2097152; #endif +#endif //--------------------------------------------------------------------------- // embedded random number generator; ala Park and Miller Index: llvm-test/SingleSource/Benchmarks/CoyoteBench/huffbench.c diff -u llvm-test/SingleSource/Benchmarks/CoyoteBench/huffbench.c:1.1 llvm-test/SingleSource/Benchmarks/CoyoteBench/huffbench.c:1.2 --- llvm-test/SingleSource/Benchmarks/CoyoteBench/huffbench.c:1.1 Sat Mar 4 16:35:18 2006 +++ llvm-test/SingleSource/Benchmarks/CoyoteBench/huffbench.c Thu May 3 11:55:46 2007 @@ -71,9 +71,14 @@ static const int TEST_SIZE = 5000000; #endif #else +#ifdef SMALL_PROBLEM_SIZE +static const int NUM_LOOPS = 2; +static const int TEST_SIZE = 5000000; +#else static const int NUM_LOOPS = 30; static const int TEST_SIZE = 10000000; #endif +#endif typedef unsigned long bits32; typedef unsigned char byte; From sabre at nondot.org Thu May 3 11:57:43 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 11:57:43 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/AbstractTypeUser.h Message-ID: <200705031657.l43GvhDj031219@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: AbstractTypeUser.h updated: 1.29 -> 1.30 --- Log message: avoid invalid C++ token in #error --- Diffs of the changes: (+1 -1) AbstractTypeUser.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/AbstractTypeUser.h diff -u llvm/include/llvm/AbstractTypeUser.h:1.29 llvm/include/llvm/AbstractTypeUser.h:1.30 --- llvm/include/llvm/AbstractTypeUser.h:1.29 Sun Apr 22 17:16:55 2007 +++ llvm/include/llvm/AbstractTypeUser.h Thu May 3 11:57:26 2007 @@ -16,7 +16,7 @@ #if !defined(LLVM_TYPE_H) && !defined(LLVM_VALUE_H) #error Do not include this file directly. Include Type.h instead. -#error Some versions of GCC (e.g. 3.4 and 4.1) can't handle the inlined method +#error Some versions of GCC (e.g. 3.4 and 4.1) can not handle the inlined method #error PATypeHolder::dropRef() correctly otherwise. #endif From sabre at nondot.org Thu May 3 12:09:57 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 12:09:57 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/APInt.h Message-ID: <200705031709.l43H9vP9031517@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: APInt.h updated: 1.66 -> 1.67 --- Log message: remove useless type qualifiers --- Diffs of the changes: (+2 -2) APInt.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/ADT/APInt.h diff -u llvm/include/llvm/ADT/APInt.h:1.66 llvm/include/llvm/ADT/APInt.h:1.67 --- llvm/include/llvm/ADT/APInt.h:1.66 Fri Apr 13 14:19:07 2007 +++ llvm/include/llvm/ADT/APInt.h Thu May 3 12:09:36 2007 @@ -1038,13 +1038,13 @@ /// @returns true if the argument APInt value is a sequence of ones /// starting at the least significant bit with the remainder zero. -inline const bool isMask(uint32_t numBits, const APInt& APIVal) { +inline bool isMask(uint32_t numBits, const APInt& APIVal) { return APIVal.getBoolValue() && ((APIVal + APInt(numBits,1)) & APIVal) == 0; } /// @returns true if the argument APInt value contains a sequence of ones /// with the remainder zero. -inline const bool isShiftedMask(uint32_t numBits, const APInt& APIVal) { +inline bool isShiftedMask(uint32_t numBits, const APInt& APIVal) { return isMask(numBits, (APIVal - APInt(numBits,1)) | APIVal); } From lauro.venancio at gmail.com Thu May 3 12:09:58 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 12:09:58 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/McGill/chomp.c Message-ID: <200705031709.l43H9w5m031522@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Benchmarks/McGill: chomp.c updated: 1.3 -> 1.4 --- Log message: Remove unnecessary code. --- Diffs of the changes: (+0 -4) chomp.c | 4 ---- 1 files changed, 4 deletions(-) Index: llvm-test/SingleSource/Benchmarks/McGill/chomp.c diff -u llvm-test/SingleSource/Benchmarks/McGill/chomp.c:1.3 llvm-test/SingleSource/Benchmarks/McGill/chomp.c:1.4 --- llvm-test/SingleSource/Benchmarks/McGill/chomp.c:1.3 Thu May 3 11:55:46 2007 +++ llvm-test/SingleSource/Benchmarks/McGill/chomp.c Thu May 3 12:09:30 2007 @@ -375,12 +375,8 @@ #if 0 scanf("%d",&ncol); #else -#ifdef SMALL_PROBLEM_SIZE - ncol = 7; -#else ncol = 7; #endif -#endif printf("Enter number of Rows : "); #if 0 scanf("%d",&nrow); From sabre at nondot.org Thu May 3 12:10:39 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 12:10:39 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h Message-ID: <200705031710.l43HAdHs031570@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: DerivedTypes.h updated: 1.92 -> 1.93 --- Log message: remove two useless functions. Just inherit Type's implementation instead. --- Diffs of the changes: (+0 -8) DerivedTypes.h | 8 -------- 1 files changed, 8 deletions(-) Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.92 llvm/include/llvm/DerivedTypes.h:1.93 --- llvm/include/llvm/DerivedTypes.h:1.92 Sun Apr 22 00:46:44 2007 +++ llvm/include/llvm/DerivedTypes.h Thu May 3 12:10:20 2007 @@ -407,14 +407,6 @@ return new OpaqueType(); // All opaque types are distinct } - // Implement the AbstractTypeUser interface. - virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy) { - abort(); // FIXME: this is not really an AbstractTypeUser! - } - virtual void typeBecameConcrete(const DerivedType *AbsTy) { - abort(); // FIXME: this is not really an AbstractTypeUser! - } - // Implement support for type inquiry through isa, cast, and dyn_cast: static inline bool classof(const OpaqueType *T) { return true; } static inline bool classof(const Type *T) { From sabre at nondot.org Thu May 3 13:05:21 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 11:05:21 -0700 (PDT) Subject: [llvm-commits] [LLVMdev] which g++ to compile LLVM CVS on Linux/AMD64? In-Reply-To: <20070503164152.GA2563@ours.starynkevitch.net> References: <20070503143859.GA31755@ours.starynkevitch.net> <20070503164152.GA2563@ours.starynkevitch.net> Message-ID: On Thu, 3 May 2007, Basile STARYNKEVITCH wrote: > I'm sorry to reply on the list (but I failed even waiting 15 minutes to get > a mailed password from the LLVM bugzilla system). > Hope that this could help someone. I really don't know if it is a bug in GCC > (tuesday's SVN snapshot) or in LLVM (today's CVS snapshot) These should all be fixed now. Please update and try again. -Chris -- http://nondot.org/sabre/ http://llvm.org/ From clattner at apple.com Thu May 3 12:44:16 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 3 May 2007 10:44:16 -0700 Subject: [llvm-commits] CVS: llvm-test/Makefile.rules In-Reply-To: <200705031656.l43GucJc031134@zion.cs.uiuc.edu> References: <200705031656.l43GucJc031134@zion.cs.uiuc.edu> Message-ID: > Implement SMALL_PROBLEM_SIZE. Cool! -Chris > > --- > Diffs of the changes: (+4 -0) > > Makefile.rules | 4 ++++ > 1 files changed, 4 insertions(+) > > > Index: llvm-test/Makefile.rules > diff -u llvm-test/Makefile.rules:1.25 llvm-test/Makefile.rules:1.26 > --- llvm-test/Makefile.rules:1.25 Thu Feb 8 21:43:45 2007 > +++ llvm-test/Makefile.rules Thu May 3 11:55:46 2007 > @@ -344,6 +344,10 @@ > TARGET_FLAGS += $(EXTRA_OPTIONS) > endif > > +ifdef SMALL_PROBLEM_SIZE > +CPPFLAGS += -DSMALL_PROBLEM_SIZE > +endif > + > # > # Compile commands with libtool. > # > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Thu May 3 12:59:03 2007 From: isanbard at gmail.com (Bill) Date: Thu, 3 May 2007 10:59:03 -0700 Subject: [llvm-commits] llvm-gcc mirror problems In-Reply-To: <1178210564.13114.5.camel@asl.dorms.spbu.ru> References: <1178210564.13114.5.camel@asl.dorms.spbu.ru> Message-ID: <16e5fdf90705031059v4a760812m50170cbdb2d4445c@mail.gmail.com> No clue. It's *way* out of date. It's supposed to be picked up by the rsync gods here, but apparently hasn't. I'll figure out who to ping about it and see what's up. -bw On 5/3/07, Anton Korobeynikov wrote: > Hello, Bill. > > What happened with llvm-gcc mirror? Currently it shows last update time > to be 29.03. > > -- > With best regards, Anton Korobeynikov. > > Faculty of Mathematics & Mechanics, Saint Petersburg State University. > > > From sabre at nondot.org Thu May 3 13:13:34 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 13:13:34 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/TimeValue.h Message-ID: <200705031813.l43IDYCg000410@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: TimeValue.h updated: 1.16 -> 1.17 --- Log message: remove extraneous top-level semi's --- Diffs of the changes: (+2 -2) TimeValue.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/System/TimeValue.h diff -u llvm/include/llvm/System/TimeValue.h:1.16 llvm/include/llvm/System/TimeValue.h:1.17 --- llvm/include/llvm/System/TimeValue.h:1.16 Tue Aug 22 12:38:05 2006 +++ llvm/include/llvm/System/TimeValue.h Thu May 3 13:13:15 2007 @@ -303,14 +303,14 @@ void microseconds ( int32_t micros ) { this->nanos_ = micros * NANOSECONDS_PER_MICROSECOND; this->normalize(); - }; + } /// The seconds component remains unchanged. /// @brief Set the nanoseconds component using a number of milliseconds. void milliseconds ( int32_t millis ) { this->nanos_ = millis * NANOSECONDS_PER_MILLISECOND; this->normalize(); - }; + } /// @brief Converts from microsecond format to TimeValue format void usec( int64_t microseconds ) { From sabre at nondot.org Thu May 3 13:15:14 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 13:15:14 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200705031815.l43IFEqb000493@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.56 -> 1.57 --- Log message: remove extraneous type qualifiers --- Diffs of the changes: (+1 -1) Path.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.56 llvm/include/llvm/System/Path.h:1.57 --- llvm/include/llvm/System/Path.h:1.56 Sun Apr 29 12:44:10 2007 +++ llvm/include/llvm/System/Path.h Thu May 3 13:14:56 2007 @@ -264,7 +264,7 @@ /// Obtain a 'C' string for the path name. /// @returns a 'C' string containing the path name. /// @brief Returns the path as a C string. - const char *const c_str() const { return path.c_str(); } + const char *c_str() const { return path.c_str(); } /// @} /// @name Disk Accessors From sabre at nondot.org Thu May 3 13:15:19 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 13:15:19 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/MathExtras.h Message-ID: <200705031815.l43IFJ5i000519@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: MathExtras.h updated: 1.45 -> 1.46 --- Log message: remove extraneous type qualifiers --- Diffs of the changes: (+4 -4) MathExtras.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/include/llvm/Support/MathExtras.h diff -u llvm/include/llvm/Support/MathExtras.h:1.45 llvm/include/llvm/Support/MathExtras.h:1.46 --- llvm/include/llvm/Support/MathExtras.h:1.45 Mon Apr 16 13:10:22 2007 +++ llvm/include/llvm/Support/MathExtras.h Thu May 3 13:14:56 2007 @@ -55,27 +55,27 @@ /// isMask_32 - This function returns true if the argument is a sequence of ones /// starting at the least significant bit with the remainder zero (32 bit /// version). Ex. isMask_32(0x0000FFFFU) == true. -inline const bool isMask_32(uint32_t Value) { +inline bool isMask_32(uint32_t Value) { return Value && ((Value + 1) & Value) == 0; } /// isMask_64 - This function returns true if the argument is a sequence of ones /// starting at the least significant bit with the remainder zero (64 bit /// version). -inline const bool isMask_64(uint64_t Value) { +inline bool isMask_64(uint64_t Value) { return Value && ((Value + 1) & Value) == 0; } /// isShiftedMask_32 - This function returns true if the argument contains a /// sequence of ones with the remainder zero (32 bit version.) /// Ex. isShiftedMask_32(0x0000FF00U) == true. -inline const bool isShiftedMask_32(uint32_t Value) { +inline bool isShiftedMask_32(uint32_t Value) { return isMask_32((Value - 1) | Value); } /// isShiftedMask_64 - This function returns true if the argument contains a /// sequence of ones with the remainder zero (64 bit version.) -inline const bool isShiftedMask_64(uint64_t Value) { +inline bool isShiftedMask_64(uint64_t Value) { return isMask_64((Value - 1) | Value); } From sabre at nondot.org Thu May 3 13:15:54 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 13:15:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp Message-ID: <200705031815.l43IFsEJ000603@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: APInt.cpp updated: 1.78 -> 1.79 --- Log message: silence some annoying gcc 4.3 warnings --- Diffs of the changes: (+10 -7) APInt.cpp | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.78 llvm/lib/Support/APInt.cpp:1.79 --- llvm/lib/Support/APInt.cpp:1.78 Fri Apr 13 19:00:10 2007 +++ llvm/lib/Support/APInt.cpp Thu May 3 13:15:36 2007 @@ -1066,11 +1066,12 @@ // If all the bits were shifted out, the result is, technically, undefined. // We return -1 if it was negative, 0 otherwise. We check this early to avoid // issues in the algorithm below. - if (shiftAmt == BitWidth) + if (shiftAmt == BitWidth) { if (isNegative()) return APInt(BitWidth, -1ULL); else return APInt(BitWidth, 0); + } // Create some space for the result. uint64_t * val = new uint64_t[getNumWords()]; @@ -1108,7 +1109,7 @@ // Deal with sign extenstion in the break word, and possibly the word before // it. - if (isNegative()) + if (isNegative()) { if (wordShift > bitsInWord) { if (breakWord > 0) val[breakWord-1] |= @@ -1116,6 +1117,7 @@ val[breakWord] |= ~0ULL; } else val[breakWord] |= (~0ULL << (bitsInWord - wordShift)); + } } // Remaining words are 0 or -1, just assign them. @@ -1128,11 +1130,12 @@ /// Logical right-shift this APInt by shiftAmt. /// @brief Logical right-shift function. APInt APInt::lshr(uint32_t shiftAmt) const { - if (isSingleWord()) + if (isSingleWord()) { if (shiftAmt == BitWidth) return APInt(BitWidth, 0); else return APInt(BitWidth, this->VAL >> shiftAmt); + } // If all the bits were shifted out, the result is 0. This avoids issues // with shifting by the size of the integer type, which produces undefined @@ -1760,10 +1763,10 @@ bool isNeg = str[0] == '-'; if (isNeg) str++, slen--; - assert(slen <= numbits || radix != 2 && "Insufficient bit width"); - assert(slen*3 <= numbits || radix != 8 && "Insufficient bit width"); - assert(slen*4 <= numbits || radix != 16 && "Insufficient bit width"); - assert((slen*64)/22 <= numbits || radix != 10 && "Insufficient bit width"); + assert((slen <= numbits || radix != 2) && "Insufficient bit width"); + assert((slen*3 <= numbits || radix != 8) && "Insufficient bit width"); + assert((slen*4 <= numbits || radix != 16) && "Insufficient bit width"); + assert(((slen*64)/22 <= numbits || radix != 10) && "Insufficient bit width"); // Allocate memory if (!isSingleWord()) From sabre at nondot.org Thu May 3 13:16:14 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 13:16:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Path.cpp Message-ID: <200705031816.l43IGEvH000621@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Path.cpp updated: 1.25 -> 1.26 --- Log message: silence annoying gcc 4.3 warnings --- Diffs of the changes: (+4 -2) Path.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/System/Path.cpp diff -u llvm/lib/System/Path.cpp:1.25 llvm/lib/System/Path.cpp:1.26 --- llvm/lib/System/Path.cpp:1.25 Tue Apr 10 22:15:35 2007 +++ llvm/lib/System/Path.cpp Thu May 3 13:15:56 2007 @@ -44,11 +44,12 @@ assert(length >=4 && "Invalid magic number length"); switch (magic[0]) { case 'l': - if (magic[1] == 'l' && magic[2] == 'v') + if (magic[1] == 'l' && magic[2] == 'v') { if (magic[3] == 'c') return CompressedBytecode_FileType; else if (magic[3] == 'm') return Bytecode_FileType; + } break; case '!': if (length >= 8) @@ -57,7 +58,7 @@ break; case '\177': - if (magic[1] == 'E' && magic[2] == 'L' && magic[3] == 'F') + if (magic[1] == 'E' && magic[2] == 'L' && magic[3] == 'F') { if (length >= 18 && magic[17] == 0) switch (magic[16]) { default: break; @@ -66,6 +67,7 @@ case 3: return ELF_SharedObject_FileType; case 4: return ELF_Core_FileType; } + } break; case 0xCA: From lauro.venancio at gmail.com Thu May 3 13:18:37 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 13:18:37 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/viterbi/Dist_demux_small test.c Message-ID: <200705031818.l43IIbhs000688@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/viterbi: Dist_demux_small added (r1.1) test.c updated: 1.3 -> 1.4 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+6005 -0) Dist_demux_small | 6001 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ test.c | 4 2 files changed, 6005 insertions(+) Index: llvm-test/MultiSource/Applications/viterbi/Dist_demux_small diff -c /dev/null llvm-test/MultiSource/Applications/viterbi/Dist_demux_small:1.1 *** /dev/null Thu May 3 13:18:27 2007 --- llvm-test/MultiSource/Applications/viterbi/Dist_demux_small Thu May 3 13:18:17 2007 *************** *** 0 **** --- 1,6001 ---- + 2 3000 + 3.999833e+000 + 9.999801e-001 + 1.000077e+000 + 1.815028e-011 + 2.151892e-010 + 6.064788e-012 + 9.998647e-001 + 6.090177e-009 + 9.999263e-001 + 1.664030e-009 + 1.000011e+000 + 9.999155e-001 + 8.999647e+000 + 4.000077e+000 + 1.000109e+000 + 3.271596e-009 + 4.254328e-010 + 1.000121e+000 + 9.999133e-001 + 9.998800e-001 + 1.000051e+000 + 8.252326e-010 + 7.486613e-009 + 8.907479e-010 + 3.999839e+000 + 4.000043e+000 + 9.998695e-001 + 4.357409e-009 + 2.023402e-009 + 3.444728e-009 + 1.723240e-009 + 1.720462e-009 + 6.264097e-009 + 6.240866e-009 + 1.662113e-010 + 1.000065e+000 + 7.591720e-010 + 1.194451e-010 + 9.999336e-001 + 8.999913e+000 + 1.000011e+000 + 1.000019e+000 + 9.000196e+000 + 9.383256e-011 + 7.239834e-010 + 1.004515e-008 + 6.039360e-009 + 8.144281e-010 + 9.998854e-001 + 4.000127e+000 + 9.998746e-001 + 1.600062e+001 + 5.386459e-009 + 3.919586e-009 + 1.985655e-010 + 3.999893e+000 + 1.000092e+000 + 1.102531e-010 + 9.999603e-001 + 9.998203e-001 + 1.000132e+000 + 9.999543e-001 + 1.000135e+000 + 8.999988e+000 + 6.476157e-010 + 9.999926e-001 + 8.999753e+000 + 3.262805e-010 + 1.000067e+000 + 2.366085e-011 + 3.999778e+000 + 9.674445e-011 + 1.000074e+000 + 4.907428e-009 + 2.201961e-009 + 5.402559e-011 + 5.573667e-010 + 1.470368e-010 + 8.233176e-009 + 4.000011e+000 + 1.461055e-010 + 9.999891e-001 + 6.284072e-011 + 1.394330e-010 + 3.546088e-010 + 9.998196e-001 + 1.000046e+000 + 3.999908e+000 + 3.999759e+000 + 9.999058e-001 + 4.472159e-009 + 3.999732e+000 + 1.602897e-009 + 2.160587e-009 + 3.999920e+000 + 5.302418e-010 + 9.999532e-001 + 6.215830e-011 + 5.262374e-010 + 8.271006e-010 + 2.114370e-010 + 2.092096e-009 + 1.315842e-010 + 5.008679e-010 + 2.573617e-009 + 1.000067e+000 + 1.000002e+000 + 4.766363e-009 + 1.029368e-009 + 4.175005e-010 + 9.999669e-001 + 3.999839e+000 + 2.079867e-009 + 1.657084e-010 + 7.833105e-010 + 7.894393e-010 + 1.000121e+000 + 9.999200e-001 + 4.073363e-011 + 9.619229e-010 + 2.400540e-009 + 9.999716e-001 + 1.543788e-010 + 1.600006e+001 + 3.903732e-010 + 1.727340e-009 + 4.000040e+000 + 1.636291e-009 + 9.999163e-001 + 2.151892e-010 + 9.999089e-001 + 1.815028e-011 + 6.090177e-009 + 3.999856e+000 + 4.576178e-009 + 2.927609e-011 + 4.000039e+000 + 1.664030e-009 + 9.999613e-001 + 3.595328e-009 + 1.000118e+000 + 4.254328e-010 + 3.036137e-012 + 1.000114e+000 + 3.602310e-009 + 5.009370e-009 + 1.878132e-009 + 1.599931e+001 + 7.505174e-011 + 8.252326e-010 + 1.135009e-010 + 9.998093e-001 + 9.999197e-001 + 2.023402e-009 + 1.000053e+000 + 9.998680e-001 + 8.999751e+000 + 2.791001e-009 + 9.999170e-001 + 9.000077e+000 + 6.570498e-009 + 6.240866e-009 + 1.194451e-010 + 3.999949e+000 + 9.999449e-001 + 2.926183e-011 + 3.999618e+000 + 1.000029e+000 + 1.599992e+001 + 7.077271e-012 + 9.999345e-001 + 6.039360e-009 + 1.560128e-010 + 9.997996e-001 + 1.014800e-009 + 9.999534e-001 + 3.282492e-009 + 1.599941e+001 + 1.409278e-009 + 6.095842e-009 + 7.174457e-010 + 1.460604e-008 + 1.985655e-010 + 3.943690e-010 + 3.563790e-009 + 9.999790e-001 + 5.225438e-010 + 1.565037e-009 + 4.336160e-009 + 6.476157e-010 + 1.592726e-009 + 1.000004e+000 + 1.600014e+001 + 2.558417e-012 + 1.000082e+000 + 3.074714e-009 + 7.468954e-010 + 9.999903e-001 + 1.600056e+001 + 2.012064e-009 + 1.374540e-009 + 5.573667e-010 + 2.267219e-010 + 5.402559e-011 + 9.999946e-001 + 1.468754e-009 + 9.998185e-001 + 6.284072e-011 + 4.000138e+000 + 2.987735e-011 + 4.000361e+000 + 5.911386e-012 + 3.546088e-010 + 3.622344e-009 + 2.360902e-009 + 9.999538e-001 + 4.481946e-009 + 1.625056e-010 + 9.998663e-001 + 4.021655e-010 + 7.702452e-010 + 9.999070e-001 + 6.215830e-011 + 9.998071e-001 + 5.482992e-010 + 8.999913e+000 + 2.834678e-009 + 8.271006e-010 + 9.000134e+000 + 2.694420e-010 + 1.315842e-010 + 7.715644e-013 + 5.227529e-012 + 1.111377e-009 + 8.999877e+000 + 9.999718e-001 + 9.999358e-001 + 9.000274e+000 + 3.999866e+000 + 9.999193e-001 + 7.894393e-010 + 3.866475e-010 + 7.833105e-010 + 4.073363e-011 + 4.000047e+000 + 1.600385e-009 + 2.019711e-010 + 4.000160e+000 + 2.400540e-009 + 9.000119e+000 + 3.999831e+000 + 5.215238e-011 + 1.636291e-009 + 4.024107e-009 + 1.000020e+000 + 2.072771e-009 + 4.321511e-010 + 2.151892e-010 + 1.302025e-009 + 3.064748e-010 + 6.090177e-009 + 9.999804e-001 + 1.000048e+000 + 9.999892e-001 + 1.600048e+001 + 4.581360e-011 + 3.743373e-010 + 3.036137e-012 + 5.820796e-009 + 1.000041e+000 + 1.599943e+001 + 3.999806e+000 + 1.000120e+000 + 9.000052e+000 + 1.000024e+000 + 7.486613e-009 + 9.094445e-009 + 3.999884e+000 + 1.135009e-010 + 7.133065e-010 + 1.000093e+000 + 1.000090e+000 + 1.599958e+001 + 1.115522e-009 + 1.000083e+000 + 6.570498e-009 + 1.000032e+000 + 9.999742e-001 + 1.647598e-010 + 4.343698e-010 + 1.000022e+000 + 1.000191e+000 + 9.999355e-001 + 9.999892e-001 + 8.999984e+000 + 5.031588e-009 + 9.383256e-011 + 1.560128e-010 + 1.026003e-008 + 1.000155e+000 + 4.000093e+000 + 1.123079e-009 + 1.014800e-009 + 1.409278e-009 + 4.000051e+000 + 5.386459e-009 + 9.000725e+000 + 1.000103e+000 + 7.174457e-010 + 3.563790e-009 + 7.159618e-010 + 1.000040e+000 + 1.565037e-009 + 2.949418e-010 + 1.000046e+000 + 8.999761e+000 + 1.711807e-010 + 6.476157e-010 + 8.999990e+000 + 4.000016e+000 + 3.262805e-010 + 1.600022e+001 + 3.031770e-010 + 3.074714e-009 + 1.599964e+001 + 1.000017e+000 + 4.907428e-009 + 2.267219e-010 + 9.999674e-001 + 5.573667e-010 + 1.468754e-009 + 1.927637e-009 + 7.211280e-012 + 1.195084e-009 + 2.657138e-009 + 6.284072e-011 + 9.000015e+000 + 4.000183e+000 + 1.000180e+000 + 9.000292e+000 + 1.676741e-009 + 3.622344e-009 + 1.625056e-010 + 2.372157e-009 + 4.481946e-009 + 7.702452e-010 + 4.000005e+000 + 4.021655e-010 + 9.300649e-009 + 1.000034e+000 + 6.215830e-011 + 2.834678e-009 + 9.998380e-001 + 1.000029e+000 + 1.600013e+001 + 1.000042e+000 + 9.999552e-001 + 1.599998e+001 + 9.999438e-001 + 9.999982e-001 + 4.000056e+000 + 9.999521e-001 + 1.000041e+000 + 1.000067e+000 + 4.000109e+000 + 9.999088e-001 + 3.866475e-010 + 5.847128e-009 + 1.000056e+000 + 1.377612e-010 + 5.988088e-010 + 9.999872e-001 + 9.999202e-001 + 5.891502e-011 + 1.000028e+000 + 1.789734e-009 + 4.000229e+000 + 9.999605e-001 + 1.599949e+001 + 1.000071e+000 + 1.636291e-009 + 1.599983e+001 + 1.159550e-010 + 1.000091e+000 + 3.064748e-010 + 8.839874e-010 + 1.302025e-009 + 5.734521e-010 + 8.736789e-010 + 9.604333e-011 + 4.581360e-011 + 2.126688e-011 + 3.595328e-009 + 8.999542e+000 + 1.817830e-010 + 3.036137e-012 + 2.346570e-009 + 3.999962e+000 + 5.009370e-009 + 1.465778e-010 + 1.746099e-010 + 9.999827e-001 + 8.380262e-010 + 2.955271e-009 + 1.000191e+000 + 3.999813e+000 + 4.000250e+000 + 9.999466e-001 + 1.115522e-009 + 3.944275e-011 + 2.791001e-009 + 2.556265e-010 + 3.999997e+000 + 6.570498e-009 + 1.599983e+001 + 2.915939e-009 + 1.647598e-010 + 1.038777e-009 + 3.672974e-009 + 9.111377e-009 + 5.031588e-009 + 1.000113e+000 + 1.000005e+000 + 1.600081e+001 + 3.999971e+000 + 1.000025e+000 + 1.123079e-009 + 3.999968e+000 + 1.000047e+000 + 1.622327e-010 + 9.999160e-001 + 1.409278e-009 + 2.650367e-009 + 2.153496e-010 + 9.997583e-001 + 7.159618e-010 + 3.100697e-009 + 1.000119e+000 + 2.949418e-010 + 2.424502e-009 + 1.000079e+000 + 1.599990e+001 + 1.867085e-010 + 1.000080e+000 + 9.999918e-001 + 9.999899e-001 + 1.000003e+000 + 3.031770e-010 + 5.944694e-010 + 7.468954e-010 + 3.999966e+000 + 1.000062e+000 + 2.012064e-009 + 2.655301e-010 + 2.371351e-009 + 2.267219e-010 + 1.927637e-009 + 3.999831e+000 + 9.999234e-001 + 1.599959e+001 + 4.000001e+000 + 1.195084e-009 + 9.999088e-001 + 1.883860e-010 + 9.999951e-001 + 1.676741e-009 + 3.999971e+000 + 9.999028e-001 + 1.600039e+001 + 7.556036e-010 + 1.000025e+000 + 9.999976e-001 + 2.693147e-009 + 7.702452e-010 + 2.941392e-010 + 9.999666e-001 + 1.000193e+000 + 6.563056e-009 + 8.763028e-010 + 2.834678e-009 + 3.999916e+000 + 3.999875e+000 + 2.694420e-010 + 7.901174e-010 + 5.520993e-009 + 5.227529e-012 + 5.736898e-010 + 2.970524e-014 + 1.000028e+000 + 7.420321e-010 + 3.999960e+000 + 1.122789e-009 + 5.847128e-009 + 3.999985e+000 + 3.866475e-010 + 8.999853e+000 + 4.000027e+000 + 1.377612e-010 + 5.891502e-011 + 4.000028e+000 + 1.591628e-009 + 9.998855e-001 + 7.263080e-010 + 1.789734e-009 + 3.999858e+000 + 1.471943e-009 + 4.024107e-009 + 9.000065e+000 + 4.000010e+000 + 4.321511e-010 + 8.999822e+000 + 1.356596e-009 + 9.999650e-001 + 8.736789e-010 + 1.784035e-009 + 9.999521e-001 + 2.126688e-011 + 2.957156e-009 + 4.581360e-011 + 1.817830e-010 + 3.635844e-009 + 1.000153e+000 + 1.000019e+000 + 6.475615e-010 + 2.346570e-009 + 1.746099e-010 + 8.907479e-010 + 9.999758e-001 + 1.599957e+001 + 1.000131e+000 + 8.380262e-010 + 3.913451e-009 + 3.444728e-009 + 9.999065e-001 + 8.999962e+000 + 3.999683e+000 + 1.000067e+000 + 1.000001e+000 + 9.999350e-001 + 9.999680e-001 + 2.915939e-009 + 1.000066e+000 + 4.343698e-010 + 8.999636e+000 + 9.999815e-001 + 1.000064e+000 + 3.999774e+000 + 4.000108e+000 + 5.031588e-009 + 1.000014e+000 + 4.000114e+000 + 1.026003e-008 + 6.285324e-011 + 3.932511e-009 + 9.999330e-001 + 4.000168e+000 + 4.000250e+000 + 1.622327e-010 + 2.153496e-010 + 2.134465e-009 + 9.998970e-001 + 3.100697e-009 + 1.000180e+000 + 1.000054e+000 + 2.424502e-009 + 9.998652e-001 + 9.999657e-001 + 1.867085e-010 + 1.385830e-011 + 1.711807e-010 + 2.546387e-011 + 9.999329e-001 + 1.664847e-011 + 5.944694e-010 + 9.674445e-011 + 1.000035e+000 + 3.999877e+000 + 4.000188e+000 + 9.999828e-001 + 2.371351e-009 + 1.470368e-010 + 1.000033e+000 + 1.793334e-009 + 4.000048e+000 + 9.999122e-001 + 3.771199e-014 + 1.394330e-010 + 2.657138e-009 + 1.883860e-010 + 9.999541e-001 + 2.081710e-009 + 1.000014e+000 + 1.000094e+000 + 1.676741e-009 + 8.999835e+000 + 3.999840e+000 + 2.372157e-009 + 2.693147e-009 + 3.999908e+000 + 1.471417e-012 + 2.784533e-010 + 4.000092e+000 + 9.999657e-001 + 8.999822e+000 + 2.092096e-009 + 1.000162e+000 + 9.716249e-010 + 2.573617e-009 + 9.999580e-001 + 9.000446e+000 + 4.766363e-009 + 1.000056e+000 + 2.970524e-014 + 1.000033e+000 + 1.000048e+000 + 1.000020e+000 + 1.657084e-010 + 7.420321e-010 + 1.000008e+000 + 9.998794e-001 + 1.000153e+000 + 4.467716e-011 + 9.619229e-010 + 1.000049e+000 + 9.999862e-001 + 4.000050e+000 + 1.000015e+000 + 7.263080e-010 + 1.727340e-009 + 3.279938e-009 + 8.999770e+000 + 1.000084e+000 + 9.999291e-001 + 6.064788e-012 + 3.999983e+000 + 9.999785e-001 + 1.356596e-009 + 4.000271e+000 + 1.000059e+000 + 1.784035e-009 + 1.664030e-009 + 8.736789e-010 + 8.999674e+000 + 3.458457e-009 + 9.999908e-001 + 3.635844e-009 + 9.998856e-001 + 1.817830e-010 + 8.999847e+000 + 4.000173e+000 + 9.089283e-011 + 8.907479e-010 + 8.252326e-010 + 1.746099e-010 + 3.999739e+000 + 1.000080e+000 + 2.955271e-009 + 1.599953e+001 + 1.000132e+000 + 3.913451e-009 + 1.000158e+000 + 1.723240e-009 + 1.000013e+000 + 4.000130e+000 + 6.240866e-009 + 5.315118e-013 + 3.999867e+000 + 7.591720e-010 + 2.915939e-009 + 8.560126e-011 + 2.124739e-010 + 1.000121e+000 + 7.239834e-010 + 1.071302e-009 + 9.998869e-001 + 8.144281e-010 + 1.004515e-008 + 5.202683e-011 + 9.000376e+000 + 4.000229e+000 + 6.285324e-011 + 3.919586e-009 + 6.095842e-009 + 1.000084e+000 + 2.134465e-009 + 1.985655e-010 + 9.999707e-001 + 3.999641e+000 + 1.102531e-010 + 1.000111e+000 + 4.541136e-009 + 3.999737e+000 + 1.000098e+000 + 9.000022e+000 + 4.084948e-012 + 1.867085e-010 + 1.125366e-009 + 1.691299e-009 + 1.000010e+000 + 1.599992e+001 + 1.000010e+000 + 1.000049e+000 + 2.201961e-009 + 3.999852e+000 + 9.999383e-001 + 1.470368e-010 + 3.999971e+000 + 2.371351e-009 + 9.999758e-001 + 8.233176e-009 + 1.793334e-009 + 1.600009e+001 + 4.000022e+000 + 3.771199e-014 + 4.000092e+000 + 4.000075e+000 + 1.000027e+000 + 2.217788e-009 + 1.000046e+000 + 5.232195e-011 + 1.602897e-009 + 4.472159e-009 + 1.000055e+000 + 1.000046e+000 + 1.000093e+000 + 9.998962e-001 + 9.999541e-001 + 4.000094e+000 + 1.000033e+000 + 2.092096e-009 + 8.271006e-010 + 1.000059e+000 + 1.599959e+001 + 1.315842e-010 + 9.716249e-010 + 1.600055e+001 + 3.999867e+000 + 9.998514e-001 + 3.999934e+000 + 1.000064e+000 + 2.970524e-014 + 1.599990e+001 + 1.000081e+000 + 1.004449e-010 + 4.000241e+000 + 3.999888e+000 + 1.497463e-011 + 1.599975e+001 + 4.000160e+000 + 4.467716e-011 + 9.999752e-001 + 2.400540e-009 + 4.785372e-011 + 1.727340e-009 + 5.215238e-011 + 7.263080e-010 + 1.600016e+001 + 9.556281e-011 + 1.078941e-009 + 2.190688e-009 + 9.658478e-010 + 9.999109e-001 + 1.499492e-009 + 3.999762e+000 + 1.000008e+000 + 9.998622e-001 + 3.999723e+000 + 9.998867e-001 + 1.783796e-011 + 4.000298e+000 + 2.402785e-010 + 9.000005e+000 + 9.999227e-001 + 4.556133e-009 + 9.998117e-001 + 9.999868e-001 + 1.564500e-010 + 3.922349e-012 + 9.998333e-001 + 1.262215e-008 + 1.600029e+001 + 7.314262e-009 + 1.420268e-009 + 1.000025e+000 + 4.000152e+000 + 7.574103e-010 + 1.599972e+001 + 4.000190e+000 + 2.068044e-010 + 1.826283e-009 + 1.000004e+000 + 2.740720e-009 + 6.629556e-014 + 9.999575e-001 + 9.998178e-001 + 9.999713e-001 + 8.083375e-011 + 1.000026e+000 + 4.692160e-011 + 6.422682e-010 + 9.998790e-001 + 8.999840e+000 + 1.000081e+000 + 4.321669e-009 + 7.028347e-010 + 6.570610e-010 + 2.248564e-012 + 4.000039e+000 + 4.000192e+000 + 3.391449e-009 + 2.367202e-009 + 1.076608e-009 + 9.999474e-001 + 6.304102e-010 + 1.725371e-010 + 1.251291e-010 + 3.999702e+000 + 8.705988e-010 + 1.000052e+000 + 1.058422e-009 + 9.999690e-001 + 1.000051e+000 + 4.419500e-010 + 4.139754e-011 + 1.104637e-010 + 6.665703e-010 + 1.000001e+000 + 6.884044e-009 + 8.999877e+000 + 9.998843e-001 + 6.100198e-009 + 1.092622e-009 + 4.000312e+000 + 3.528101e-009 + 3.973015e-010 + 7.448768e-010 + 1.579987e-009 + 2.891612e-010 + 3.810885e-010 + 9.999665e-001 + 9.000505e+000 + 2.326759e-009 + 9.998990e-001 + 1.599973e+001 + 3.999889e+000 + 9.999416e-001 + 3.539403e-010 + 2.550492e-010 + 9.999574e-001 + 9.999259e-001 + 9.999126e-001 + 2.273140e-009 + 9.000039e+000 + 9.999087e-001 + 9.999063e-001 + 1.062664e-009 + 4.000024e+000 + 1.003779e-008 + 4.000107e+000 + 9.998559e-001 + 9.999009e-001 + 4.000401e+000 + 9.143575e-011 + 4.505128e-010 + 8.999578e+000 + 3.529962e-009 + 9.999022e-001 + 1.000028e+000 + 4.000281e+000 + 9.998574e-001 + 3.999963e+000 + 2.582747e-009 + 1.533812e-011 + 4.525686e-009 + 9.999329e-001 + 1.000005e+000 + 8.999846e+000 + 9.999763e-001 + 1.000063e+000 + 9.000089e+000 + 5.513340e-009 + 2.356980e-010 + 9.556281e-011 + 4.000096e+000 + 4.107533e-010 + 9.658478e-010 + 4.000252e+000 + 9.999064e-001 + 3.527386e-009 + 4.000162e+000 + 1.499492e-009 + 1.000138e+000 + 9.471623e-011 + 4.748273e-009 + 9.998512e-001 + 1.888413e-010 + 1.783796e-011 + 1.494185e-009 + 1.393394e-008 + 9.999984e-001 + 4.324073e-011 + 4.000040e+000 + 8.864157e-009 + 4.000333e+000 + 3.999959e+000 + 1.000004e+000 + 8.999487e+000 + 3.999997e+000 + 1.308677e-009 + 1.439274e-009 + 4.000195e+000 + 1.523000e-010 + 2.264081e-009 + 3.999994e+000 + 1.183100e-009 + 3.468364e-012 + 9.852705e-010 + 1.000085e+000 + 4.516740e-010 + 3.660917e-010 + 9.999995e-001 + 1.599993e+001 + 4.000188e+000 + 2.064271e-010 + 9.000152e+000 + 2.479652e-010 + 4.692160e-011 + 3.999838e+000 + 9.999355e-001 + 1.000053e+000 + 6.570610e-010 + 9.108825e-009 + 9.999470e-001 + 9.999042e-001 + 3.210747e-008 + 1.000020e+000 + 1.076608e-009 + 1.039413e-009 + 2.367202e-009 + 1.600011e+001 + 9.999374e-001 + 1.000050e+000 + 8.705988e-010 + 9.997429e-001 + 9.998508e-001 + 4.000062e+000 + 1.772298e-009 + 9.999349e-001 + 1.600005e+001 + 4.000124e+000 + 4.419500e-010 + 5.556754e-013 + 9.999955e-001 + 6.665703e-010 + 4.000232e+000 + 4.000491e+000 + 1.000041e+000 + 9.998440e-001 + 1.976222e-010 + 1.092622e-009 + 8.999836e+000 + 9.998002e-001 + 9.999601e-001 + 1.599984e+001 + 9.999848e-001 + 2.891612e-010 + 2.326759e-009 + 4.000136e+000 + 9.998316e-001 + 1.000056e+000 + 9.405651e-010 + 1.114567e-009 + 2.550492e-010 + 1.985440e-009 + 3.539403e-010 + 4.000175e+000 + 5.380456e-010 + 1.371711e-009 + 2.084709e-009 + 9.999287e-001 + 9.999871e-001 + 9.999879e-001 + 1.055932e-012 + 1.062664e-009 + 5.192584e-009 + 3.999849e+000 + 1.000053e+000 + 9.000057e+000 + 9.999780e-001 + 1.000200e+000 + 3.529962e-009 + 1.031199e-010 + 1.000141e+000 + 9.998593e-001 + 3.999859e+000 + 1.997428e-010 + 2.582747e-009 + 5.926461e-010 + 9.999816e-001 + 4.000134e+000 + 2.725540e-009 + 4.525686e-009 + 1.405098e-010 + 3.999804e+000 + 1.000051e+000 + 9.000446e+000 + 4.049555e-012 + 9.999702e-001 + 9.999521e-001 + 7.180263e-010 + 9.999804e-001 + 3.967481e-009 + 4.000176e+000 + 1.000062e+000 + 9.999191e-001 + 1.642960e-010 + 3.527386e-009 + 1.600008e+001 + 2.082297e-009 + 4.790086e-009 + 1.599989e+001 + 9.999347e-001 + 5.535447e-009 + 1.393394e-008 + 8.425120e-009 + 1.000077e+000 + 9.999799e-001 + 3.999782e+000 + 1.000013e+000 + 1.037218e-010 + 3.999992e+000 + 1.000167e+000 + 1.000002e+000 + 3.999950e+000 + 1.000171e+000 + 9.999026e-001 + 4.000163e+000 + 1.439274e-009 + 1.000003e+000 + 2.159540e-009 + 2.264081e-009 + 9.000188e+000 + 3.999919e+000 + 9.999963e-001 + 3.660917e-010 + 6.160021e-010 + 1.000043e+000 + 9.999060e-001 + 1.000061e+000 + 8.083375e-011 + 8.999906e+000 + 1.454236e-009 + 9.999493e-001 + 1.038581e-009 + 3.999868e+000 + 9.999191e-001 + 9.108825e-009 + 3.210779e-009 + 6.570610e-010 + 3.210747e-008 + 6.427505e-013 + 2.294761e-009 + 1.039413e-009 + 2.950235e-009 + 1.076608e-009 + 9.808149e-010 + 1.183149e-008 + 1.725371e-010 + 4.000514e+000 + 9.999893e-001 + 1.000059e+000 + 1.772298e-009 + 3.999993e+000 + 1.000031e+000 + 9.548181e-010 + 4.801002e-009 + 4.139754e-011 + 4.000009e+000 + 4.000220e+000 + 9.999985e-001 + 1.503895e-008 + 3.999813e+000 + 1.000116e+000 + 1.599989e+001 + 9.829555e-011 + 6.087592e-009 + 4.000400e+000 + 4.806042e-010 + 1.000055e+000 + 4.000030e+000 + 7.250749e-009 + 3.810885e-010 + 9.999322e-001 + 5.194962e-011 + 2.326759e-009 + 9.405651e-010 + 1.503659e-009 + 7.736513e-010 + 1.600036e+001 + 3.094209e-010 + 2.550492e-010 + 5.380456e-010 + 1.000043e+000 + 1.000087e+000 + 4.000143e+000 + 1.821121e-009 + 1.000091e+000 + 1.599999e+001 + 3.999566e+000 + 3.686303e-011 + 1.000076e+000 + 9.999628e-001 + 1.000144e+000 + 1.214516e-010 + 9.999950e-001 + 9.999809e-001 + 1.031199e-010 + 1.992071e-013 + 9.998812e-001 + 1.000070e+000 + 3.999987e+000 + 4.951238e-009 + 5.926461e-010 + 4.000010e+000 + 9.998984e-001 + 8.999687e+000 + 1.704278e-009 + 1.000067e+000 + 2.410183e-009 + 9.999598e-001 + 1.000024e+000 + 4.049555e-012 + 4.581012e-009 + 9.998515e-001 + 7.180263e-010 + 4.000361e+000 + 5.738124e-010 + 9.999122e-001 + 8.930383e-010 + 3.967481e-009 + 1.642960e-010 + 6.544306e-010 + 1.638010e-009 + 2.082297e-009 + 1.000102e+000 + 9.471623e-011 + 1.064984e-009 + 4.000335e+000 + 1.888413e-010 + 8.999449e+000 + 4.000039e+000 + 1.393394e-008 + 1.000109e+000 + 1.000134e+000 + 1.008756e-010 + 3.763571e-012 + 1.059260e-013 + 1.037218e-010 + 1.000025e+000 + 4.041054e-009 + 6.431914e-013 + 1.651447e-009 + 9.999888e-001 + 2.372370e-009 + 8.999721e+000 + 2.492255e-009 + 2.367304e-012 + 1.000040e+000 + 3.999873e+000 + 9.999372e-001 + 1.600020e+001 + 4.000043e+000 + 9.999617e-001 + 9.299957e-010 + 9.465512e-012 + 2.210623e-009 + 8.999771e+000 + 4.000037e+000 + 1.000031e+000 + 1.000066e+000 + 9.999205e-001 + 1.000064e+000 + 1.599955e+001 + 4.000119e+000 + 9.108825e-009 + 6.427505e-013 + 3.545415e-010 + 9.996417e-001 + 2.950235e-009 + 3.536520e-010 + 1.000064e+000 + 1.599913e+001 + 1.027672e-009 + 1.000063e+000 + 2.873619e-011 + 4.000149e+000 + 1.000257e+000 + 1.000004e+000 + 1.555402e-009 + 1.772298e-009 + 9.000416e+000 + 1.000029e+000 + 9.548181e-010 + 9.998900e-001 + 1.000065e+000 + 1.000005e+000 + 2.179993e-009 + 1.155851e-010 + 1.503895e-008 + 9.000059e+000 + 1.934366e-010 + 1.976222e-010 + 4.806042e-010 + 4.000122e+000 + 1.000200e+000 + 1.600068e+001 + 1.000068e+000 + 1.000015e+000 + 5.194962e-011 + 1.011383e-009 + 1.150539e-009 + 1.599969e+001 + 1.212257e-010 + 9.999387e-001 + 1.600014e+001 + 9.998406e-001 + 1.985440e-009 + 4.686200e-010 + 1.000035e+000 + 5.380456e-010 + 1.821121e-009 + 1.594527e-010 + 1.000071e+000 + 1.000217e+000 + 8.374936e-010 + 1.055932e-012 + 4.000074e+000 + 1.000012e+000 + 1.425096e-009 + 6.315390e-012 + 1.718737e-012 + 1.000022e+000 + 1.992071e-013 + 1.521904e-011 + 9.999797e-001 + 1.097440e-011 + 2.359994e-009 + 1.235451e-009 + 6.710234e-012 + 4.000089e+000 + 9.999513e-001 + 1.600033e+001 + 6.750258e-009 + 1.000104e+000 + 4.000080e+000 + 6.653972e-009 + 2.410183e-009 + 4.581012e-009 + 6.548006e-009 + 4.049555e-012 + 8.139232e-009 + 4.000131e+000 + 9.999464e-001 + 8.930383e-010 + 1.000089e+000 + 1.928992e-009 + 1.599980e+001 + 1.511850e-011 + 1.000026e+000 + 3.999796e+000 + 3.206684e-009 + 9.999087e-001 + 9.998325e-001 + 4.000062e+000 + 1.000065e+000 + 9.999805e-001 + 3.999730e+000 + 1.000184e+000 + 3.999733e+000 + 1.564500e-010 + 2.980727e-009 + 1.059260e-013 + 4.000449e+000 + 3.763571e-012 + 4.041054e-009 + 1.420268e-009 + 1.585118e-010 + 3.130320e-011 + 7.574103e-010 + 1.651447e-009 + 2.492255e-009 + 4.000058e+000 + 1.000093e+000 + 1.000064e+000 + 4.000209e+000 + 4.054464e-010 + 9.999783e-001 + 8.299112e-009 + 6.160021e-010 + 1.600002e+001 + 1.688134e-010 + 9.999390e-001 + 9.999817e-001 + 3.662379e-009 + 1.000076e+000 + 1.579052e-009 + 4.321669e-009 + 1.095914e-009 + 9.999407e-001 + 2.248564e-012 + 3.210779e-009 + 3.545415e-010 + 3.391449e-009 + 9.999984e-001 + 8.999887e+000 + 1.000053e+000 + 2.950235e-009 + 8.999808e+000 + 4.000045e+000 + 1.183149e-008 + 1.391526e-009 + 6.671775e-010 + 1.000011e+000 + 8.999763e+000 + 6.620601e-010 + 3.365585e-012 + 3.999942e+000 + 4.000042e+000 + 9.998614e-001 + 1.062984e-009 + 4.000332e+000 + 3.024716e-009 + 1.155851e-010 + 6.100198e-009 + 2.179993e-009 + 1.934366e-010 + 3.999762e+000 + 9.999802e-001 + 9.254242e-010 + 1.579987e-009 + 4.806042e-010 + 1.172868e-009 + 1.000034e+000 + 7.250749e-009 + 1.011383e-009 + 2.551106e-009 + 5.194962e-011 + 1.212257e-010 + 1.000058e+000 + 1.503659e-009 + 4.000319e+000 + 1.000043e+000 + 3.094209e-010 + 3.999930e+000 + 2.273140e-009 + 9.999567e-001 + 1.599990e+001 + 1.000094e+000 + 1.821121e-009 + 8.374936e-010 + 4.000401e+000 + 1.179036e-008 + 3.999977e+000 + 1.000099e+000 + 1.000037e+000 + 1.718737e-012 + 4.505128e-010 + 1.000005e+000 + 1.599997e+001 + 1.000098e+000 + 1.992071e-013 + 2.359994e-009 + 1.000143e+000 + 1.097440e-011 + 4.989071e-010 + 3.999984e+000 + 6.710234e-012 + 1.600066e+001 + 9.999945e-001 + 1.704278e-009 + 1.599935e+001 + 9.999367e-001 + 1.000040e+000 + 1.600065e+001 + 4.000061e+000 + 4.581012e-009 + 9.999343e-001 + 4.107533e-010 + 8.139232e-009 + 3.999822e+000 + 1.000094e+000 + 8.930383e-010 + 1.511850e-011 + 3.999845e+000 + 6.544306e-010 + 3.206684e-009 + 4.000276e+000 + 9.998981e-001 + 9.999690e-001 + 1.783796e-011 + 7.014322e-009 + 4.556133e-009 + 6.028887e-013 + 9.533803e-011 + 1.600010e+001 + 4.000377e+000 + 9.998664e-001 + 9.997753e-001 + 9.999960e-001 + 9.999993e-001 + 1.420268e-009 + 1.308677e-009 + 1.000127e+000 + 1.599978e+001 + 3.999951e+000 + 1.000011e+000 + 2.068044e-010 + 1.183100e-009 + 2.492255e-009 + 9.998953e-001 + 9.999145e-001 + 1.015651e-009 + 9.000547e+000 + 1.000001e+000 + 1.180837e-010 + 1.688134e-010 + 4.000057e+000 + 9.465512e-012 + 9.000363e+000 + 4.000027e+000 + 8.378606e-011 + 4.321669e-009 + 7.122328e-010 + 1.000079e+000 + 2.248564e-012 + 1.000053e+000 + 8.788630e-010 + 1.600047e+001 + 9.999803e-001 + 3.545415e-010 + 3.999895e+000 + 3.999805e+000 + 1.000038e+000 + 1.251291e-010 + 9.999498e-001 + 1.000064e+000 + 6.671775e-010 + 1.000149e+000 + 1.391526e-009 + 6.620601e-010 + 1.058422e-009 + 1.000079e+000 + 1.104637e-010 + 4.000084e+000 + 9.999709e-001 + 9.998341e-001 + 6.665703e-010 + 9.999348e-001 + 1.600062e+001 + 4.210203e-010 + 9.999785e-001 + 3.528101e-009 + 4.000132e+000 + 1.934366e-010 + 1.579987e-009 + 3.973015e-010 + 9.254242e-010 + 2.810008e-010 + 2.891612e-010 + 9.999315e-001 + 9.000303e+000 + 7.089058e-009 + 9.999364e-001 + 8.532508e-010 + 1.114567e-009 + 1.000022e+000 + 4.535857e-010 + 4.000075e+000 + 1.000159e+000 + 2.273140e-009 + 4.000148e+000 + 9.999648e-001 + 3.999813e+000 + 4.136071e-011 + 1.594527e-010 + 1.003779e-008 + 1.062664e-009 + 8.374936e-010 + 2.455702e-009 + 9.999466e-001 + 9.999883e-001 + 4.505128e-010 + 9.997997e-001 + 1.000003e+000 + 2.392536e-009 + 4.949785e-009 + 1.521904e-011 + 3.999715e+000 + 3.999943e+000 + 2.359994e-009 + 1.533812e-011 + 1.000018e+000 + 4.989071e-010 + 4.000011e+000 + 3.999731e+000 + 6.750258e-009 + 1.003132e-009 + 6.623690e-010 + 6.653972e-009 + 2.356980e-010 + 2.224594e-010 + 6.548006e-009 + 3.999941e+000 + 1.889622e-010 + 2.967534e-009 + 2.209242e-010 + 1.565056e-009 + 3.040860e-009 + 1.599985e+001 + 3.724638e-009 + 1.000070e+000 + 1.599995e+001 + 3.999858e+000 + 2.597330e-010 + 1.320923e-009 + 5.142749e-015 + 5.834071e-010 + 1.000006e+000 + 2.751246e-009 + 1.000158e+000 + 1.000046e+000 + 1.000005e+000 + 4.052316e-009 + 7.519376e-010 + 1.086355e-009 + 3.196143e-009 + 4.899070e-011 + 1.994630e-011 + 5.521484e-010 + 1.600011e+001 + 3.999924e+000 + 1.795570e-010 + 1.000169e+000 + 2.250302e-009 + 4.256249e-009 + 1.643153e-009 + 1.180842e-009 + 6.771689e-011 + 9.999085e-001 + 4.036180e-009 + 1.000004e+000 + 8.999749e+000 + 4.000073e+000 + 9.999908e-001 + 3.264252e-009 + 1.000022e+000 + 1.041521e-009 + 9.999904e-001 + 3.602961e-010 + 1.000046e+000 + 1.600006e+001 + 4.421598e-010 + 9.999868e-001 + 4.235031e-010 + 3.999951e+000 + 9.999746e-001 + 4.000396e+000 + 3.999952e+000 + 2.558830e-009 + 1.000023e+000 + 3.013968e-009 + 1.000097e+000 + 3.999928e+000 + 1.000101e+000 + 2.499221e-010 + 3.999904e+000 + 9.998739e-001 + 6.623294e-010 + 8.999839e+000 + 7.523774e-009 + 3.975231e-010 + 1.600020e+001 + 9.998246e-001 + 2.834240e-009 + 9.000153e+000 + 1.000081e+000 + 9.999161e-001 + 4.350610e-010 + 4.000268e+000 + 7.148213e-010 + 4.847173e-009 + 5.023409e-009 + 9.802647e-011 + 3.037506e-012 + 1.000045e+000 + 2.152377e-009 + 8.999552e+000 + 8.227591e-010 + 1.345542e-009 + 9.998966e-001 + 1.951791e-013 + 6.514893e-011 + 1.599991e+001 + 4.000052e+000 + 1.000099e+000 + 3.764080e-009 + 4.000192e+000 + 9.999410e-001 + 7.107657e-010 + 3.999947e+000 + 9.998264e-001 + 6.307650e-010 + 4.743439e-010 + 4.426299e-010 + 8.112050e-010 + 3.999664e+000 + 9.999350e-001 + 1.600017e+001 + 8.281877e-010 + 4.987068e-009 + 1.600006e+001 + 1.666887e-009 + 1.000018e+000 + 9.298511e-009 + 1.000027e+000 + 1.196652e-009 + 1.855238e-010 + 3.503238e-009 + 1.702880e-010 + 2.151148e-010 + 1.198584e-009 + 6.720089e-010 + 1.174965e-009 + 2.788467e-009 + 4.918976e-009 + 1.081266e-010 + 1.036129e-009 + 9.999507e-001 + 8.999918e+000 + 1.022353e-009 + 9.999707e-001 + 1.565056e-009 + 3.999792e+000 + 1.000030e+000 + 3.724638e-009 + 3.999724e+000 + 3.713743e-010 + 1.269029e-009 + 3.999951e+000 + 3.738999e-011 + 5.142749e-015 + 3.999870e+000 + 1.320923e-009 + 2.751246e-009 + 2.252215e-009 + 8.782263e-012 + 3.999990e+000 + 3.999671e+000 + 5.359300e-010 + 1.086355e-009 + 4.025115e-010 + 9.999452e-001 + 1.994630e-011 + 5.649586e-009 + 4.899070e-011 + 1.000038e+000 + 3.999732e+000 + 1.916318e-010 + 1.599962e+001 + 4.040789e-010 + 7.115864e-009 + 1.180842e-009 + 2.133313e-009 + 9.999189e-001 + 4.036180e-009 + 1.998302e-012 + 2.091100e-009 + 9.999637e-001 + 4.000098e+000 + 1.000084e+000 + 1.246984e-010 + 1.000065e+000 + 9.998857e-001 + 1.599985e+001 + 9.998315e-001 + 2.316693e-011 + 4.421598e-010 + 1.000095e+000 + 5.815679e-011 + 1.502999e-010 + 1.010831e-009 + 4.235031e-010 + 1.460438e-010 + 9.999876e-001 + 1.000198e+000 + 9.000329e+000 + 3.999908e+000 + 1.284080e-010 + 2.544844e-009 + 7.365550e-009 + 9.999640e-001 + 3.978473e-009 + 1.442227e-009 + 9.999519e-001 + 7.523774e-009 + 1.667081e-009 + 1.000054e+000 + 7.690658e-009 + 2.481252e-009 + 6.099304e-010 + 3.999838e+000 + 9.999507e-001 + 9.999490e-001 + 4.489777e-009 + 3.999911e+000 + 4.350610e-010 + 5.023409e-009 + 7.455108e-011 + 9.998608e-001 + 5.136105e-010 + 9.999885e-001 + 9.999965e-001 + 8.227591e-010 + 1.000092e+000 + 1.000149e+000 + 1.600000e+001 + 4.000017e+000 + 2.674939e-009 + 1.685314e-010 + 4.422119e-009 + 1.145663e-010 + 9.999040e-001 + 7.946025e-010 + 3.764080e-009 + 1.782871e-010 + 9.999577e-001 + 1.000053e+000 + 4.743439e-010 + 1.205279e-011 + 6.307650e-010 + 7.061536e-009 + 5.097307e-010 + 9.999430e-001 + 1.599977e+001 + 1.000100e+000 + 4.300937e-010 + 1.666887e-009 + 9.750377e-013 + 5.125951e-011 + 1.837340e-010 + 1.908484e-010 + 1.000193e+000 + 3.503238e-009 + 1.832713e-009 + 1.000027e+000 + 1.599972e+001 + 3.999872e+000 + 2.151148e-010 + 1.599958e+001 + 3.999939e+000 + 1.174965e-009 + 1.036129e-009 + 2.237276e-009 + 1.081266e-010 + 1.599974e+001 + 6.847474e-010 + 1.000027e+000 + 2.697422e-009 + 2.192293e-009 + 1.000079e+000 + 1.000138e+000 + 2.227802e-009 + 9.998779e-001 + 1.000025e+000 + 5.097089e-009 + 1.269029e-009 + 1.056297e-009 + 4.000160e+000 + 5.142749e-015 + 2.252215e-009 + 1.000097e+000 + 2.751246e-009 + 6.770277e-009 + 9.999968e-001 + 9.999951e-001 + 9.000120e+000 + 1.523525e-009 + 9.999341e-001 + 5.649586e-009 + 1.000016e+000 + 9.999911e-001 + 4.495909e-009 + 9.999385e-001 + 3.587022e-010 + 4.040789e-010 + 2.966927e-009 + 2.250302e-009 + 2.133313e-009 + 9.999360e-001 + 9.999313e-001 + 1.600001e+001 + 4.058136e-010 + 9.998729e-001 + 9.999511e-001 + 4.000131e+000 + 3.288838e-010 + 1.064211e-009 + 3.999900e+000 + 9.999777e-001 + 7.097597e-009 + 4.000027e+000 + 3.602961e-010 + 2.267288e-009 + 1.040752e-010 + 4.421598e-010 + 9.000191e+000 + 4.000083e+000 + 1.502999e-010 + 4.000025e+000 + 2.312453e-009 + 1.460438e-010 + 5.336218e-010 + 6.841777e-010 + 9.998902e-001 + 9.000515e+000 + 1.000046e+000 + 9.998991e-001 + 8.999772e+000 + 1.000034e+000 + 1.000126e+000 + 1.667081e-009 + 1.724563e-009 + 9.998265e-001 + 1.600040e+001 + 3.840289e-011 + 1.000175e+000 + 6.087783e-010 + 1.011738e-010 + 9.999191e-001 + 1.000045e+000 + 5.408596e-010 + 4.489777e-009 + 7.455108e-011 + 3.999679e+000 + 1.000142e+000 + 3.317052e-011 + 1.000010e+000 + 9.999547e-001 + 3.999817e+000 + 3.999770e+000 + 8.227591e-010 + 1.776119e-011 + 1.000710e-010 + 1.951791e-013 + 9.000399e+000 + 4.000217e+000 + 1.685314e-010 + 9.000169e+000 + 9.883682e-010 + 2.302349e-009 + 4.000085e+000 + 9.383510e-010 + 1.782871e-010 + 9.000021e+000 + 2.113005e-010 + 1.000044e+000 + 8.999865e+000 + 1.540439e-009 + 7.061536e-009 + 3.999800e+000 + 1.135153e-009 + 8.281877e-010 + 9.750377e-013 + 4.000104e+000 + 9.999183e-001 + 1.908484e-010 + 2.947704e-009 + 9.999729e-001 + 1.832713e-009 + 1.717826e-008 + 3.503238e-009 + 1.000064e+000 + 1.338314e-011 + 1.198584e-009 + 1.000031e+000 + 2.064924e-009 + 2.788467e-009 + 2.237276e-009 + 4.000062e+000 + 9.999356e-001 + 1.599979e+001 + 1.000031e+000 + 1.022353e-009 + 2.192293e-009 + 4.000036e+000 + 2.697422e-009 + 8.999717e+000 + 5.976894e-009 + 4.768258e-009 + 5.097089e-009 + 3.999930e+000 + 1.509747e-010 + 1.596374e-009 + 1.000060e+000 + 1.056297e-009 + 3.999806e+000 + 9.999960e-001 + 2.252215e-009 + 4.000006e+000 + 5.635083e-009 + 6.770277e-009 + 1.600031e+001 + 9.999957e-001 + 9.999599e-001 + 6.754033e-011 + 2.765142e-009 + 9.998497e-001 + 9.447519e-010 + 4.813685e-009 + 4.495909e-009 + 2.966927e-009 + 6.967330e-010 + 9.999598e-001 + 1.025336e-009 + 9.999600e-001 + 1.000092e+000 + 4.058136e-010 + 9.999621e-001 + 1.998302e-012 + 9.999343e-001 + 8.215708e-010 + 5.977143e-010 + 6.247831e-010 + 1.000029e+000 + 9.999348e-001 + 9.999865e-001 + 9.999913e-001 + 1.000169e+000 + 1.040752e-010 + 1.000094e+000 + 9.999048e-001 + 9.999585e-001 + 3.999918e+000 + 9.999364e-001 + 2.312453e-009 + 4.665183e-010 + 1.000012e+000 + 6.841777e-010 + 7.881351e-010 + 5.336218e-010 + 5.192411e-010 + 3.999582e+000 + 9.998284e-001 + 2.886577e-010 + 2.250164e-009 + 1.000076e+000 + 1.599967e+001 + 3.999910e+000 + 1.667081e-009 + 3.840289e-011 + 9.999104e-001 + 2.481252e-009 + 1.011738e-010 + 1.001282e-010 + 1.000049e+000 + 1.600019e+001 + 3.237045e-010 + 4.961374e-010 + 1.000161e+000 + 9.999067e-001 + 9.999827e-001 + 3.999979e+000 + 3.999957e+000 + 1.000012e+000 + 3.316114e-009 + 1.972747e-010 + 9.999085e-001 + 9.000060e+000 + 6.147446e-010 + 1.776119e-011 + 2.951351e-009 + 3.999986e+000 + 9.998670e-001 + 9.000189e+000 + 9.999425e-001 + 9.999436e-001 + 9.383510e-010 + 1.000019e+000 + 1.000042e+000 + 2.113005e-010 + 2.053166e-011 + 9.999931e-001 + 9.000235e+000 + 1.109289e-008 + 1.000045e+000 + 1.135153e-009 + 3.999661e+000 + 9.998999e-001 + 6.721339e-010 + 9.999206e-001 + 9.750377e-013 + 1.600043e+001 + 2.939941e-010 + 1.908484e-010 + 1.717826e-008 + 2.490960e-010 + 1.832713e-009 + 1.600003e+001 + 9.999657e-001 + 1.021863e-009 + 1.599964e+001 + 9.999424e-001 + 2.347027e-010 + 2.368180e-010 + 2.809996e-009 + 1.000095e+000 + 2.440102e-010 + 4.000218e+000 + 6.847474e-010 + 7.980160e-011 + 3.040860e-009 + 2.192293e-009 + 5.976894e-009 + 9.999301e-001 + 1.000094e+000 + 3.034581e-010 + 2.597330e-010 + 5.097089e-009 + 9.125516e-010 + 4.000097e+000 + 1.596374e-009 + 4.074715e-012 + 6.208279e-009 + 9.999029e-001 + 8.999550e+000 + 4.000255e+000 + 1.000003e+000 + 4.701932e-012 + 4.000226e+000 + 1.523525e-009 + 8.999684e+000 + 4.000094e+000 + 9.999836e-001 + 4.813685e-009 + 1.795570e-010 + 1.000061e+000 + 8.999842e+000 + 4.256249e-009 + 1.000109e+000 + 4.000080e+000 + 6.771689e-011 + 1.000064e+000 + 4.000076e+000 + 3.063478e-012 + 9.999597e-001 + 8.999828e+000 + 1.000009e+000 + 1.080106e-009 + 3.999942e+000 + 1.041521e-009 + 6.247831e-010 + 4.000017e+000 + 9.999543e-001 + 4.538131e-011 + 3.999811e+000 + 1.000013e+000 + 9.999796e-001 + 1.000041e+000 + 1.614680e-010 + 4.315687e-010 + 8.999870e+000 + 2.558830e-009 + 2.312453e-009 + 7.881351e-010 + 9.999031e-001 + 6.841777e-010 + 1.091348e-008 + 2.499221e-010 + 9.999544e-001 + 2.250164e-009 + 4.000103e+000 + 9.999660e-001 + 5.036706e-010 + 4.000080e+000 + 1.724563e-009 + 4.000179e+000 + 3.999787e+000 + 3.840289e-011 + 1.001282e-010 + 1.000084e+000 + 1.011738e-010 + 9.000108e+000 + 4.000107e+000 + 5.408596e-010 + 4.000187e+000 + 9.802647e-011 + 6.447307e-009 + 1.141151e-010 + 2.152377e-009 + 9.999896e-001 + 1.600011e+001 + 1.345542e-009 + 3.316114e-009 + 8.999851e+000 + 6.514893e-011 + 9.999800e-001 + 1.000007e+000 + 9.999012e-001 + 2.951351e-009 + 4.000115e+000 + 1.000059e+000 + 9.999371e-001 + 8.585130e-011 + 1.000174e+000 + 9.999387e-001 + 2.053166e-011 + 4.426299e-010 + 9.999709e-001 + 1.109289e-008 + 1.000065e+000 + 9.999215e-001 + 7.179882e-009 + 4.000282e+000 + 1.000067e+000 + 4.000159e+000 + 7.991817e-011 + 6.721339e-010 + 2.939941e-010 + 1.196652e-009 + 2.947704e-009 + 9.000095e+000 + 1.702880e-010 + 1.717826e-008 + 2.944619e-010 + 6.720089e-010 + 1.338314e-011 + 8.298969e-010 + 4.918976e-009 + 2.064924e-009 + 2.809996e-009 + 1.000049e+000 + 2.368180e-010 + 2.967534e-009 + 1.000029e+000 + 9.999688e-001 + 1.600044e+001 + 9.999703e-001 + 7.980160e-011 + 4.000140e+000 + 3.713743e-010 + 9.998454e-001 + 1.599987e+001 + 3.738999e-011 + 3.034581e-010 + 5.834071e-010 + 4.000145e+000 + 9.999396e-001 + 8.999527e+000 + 3.999988e+000 + 1.000004e+000 + 9.998727e-001 + 3.999907e+000 + 1.000150e+000 + 3.196143e-009 + 1.000055e+000 + 1.000004e+000 + 9.999530e-001 + 3.999972e+000 + 1.000105e+000 + 1.795570e-010 + 1.916318e-010 + 1.000139e+000 + 4.256249e-009 + 3.999663e+000 + 1.000053e+000 + 6.771689e-011 + 1.643153e-009 + 1.000040e+000 + 8.999989e+000 + 4.000183e+000 + 1.000038e+000 + 3.999982e+000 + 1.751366e-009 + 1.000057e+000 + 1.041521e-009 + 1.000114e+000 + 9.999710e-001 + 5.232317e-010 + 4.000019e+000 + 1.000009e+000 + 4.349844e-011 + 5.815679e-011 + 9.999057e-001 + 1.614680e-010 + 4.000082e+000 + 4.220440e-010 + 2.558830e-009 + 9.998021e-001 + 1.000043e+000 + 2.347065e-009 + 3.999955e+000 + 9.999439e-001 + 1.600013e+001 + 1.000036e+000 + 1.091348e-008 + 6.623294e-010 + 1.000048e+000 + 2.250164e-009 + 3.975231e-010 + 7.224881e-010 + 5.036706e-010 + 1.000106e+000 + 6.099304e-010 + 1.000090e+000 + 1.758873e-009 + 6.502974e-010 + 1.001282e-010 + 9.999465e-001 + 4.350610e-010 + 9.999640e-001 + 9.802647e-011 + 4.847173e-009 + 1.000093e+000 + 2.152377e-009 + 3.037506e-012 + 1.141151e-010 + 1.600029e+001 + 5.578355e-009 + 1.972747e-010 + 6.514893e-011 + 4.000207e+000 + 1.000050e+000 + 4.000198e+000 + 1.145663e-010 + 1.174966e-011 + 3.999882e+000 + 3.764080e-009 + 1.000057e+000 + 7.537739e-009 + 7.107657e-010 + 9.999815e-001 + 4.426299e-010 + 6.307650e-010 + 2.053166e-011 + 1.056289e-009 + 8.112050e-010 + 9.997894e-001 + 9.998588e-001 + 4.300937e-010 + 7.179882e-009 + 8.999946e+000 + 5.125951e-011 + 1.000079e+000 + 1.196652e-009 + 9.298511e-009 + 9.999657e-001 + 1.702880e-010 + 1.855238e-010 + 9.999684e-001 + 1.600021e+001 + 2.151148e-010 + 1.000034e+000 + 1.599944e+001 + 1.174965e-009 + 1.000058e+000 + 3.999901e+000 + 1.081266e-010 + 2.809996e-009 + 1.592905e-010 + 3.062622e-009 + 9.997384e-001 + 1.000018e+000 + 4.000058e+000 + 4.087893e-011 + 4.000016e+000 + 1.000107e+000 + 2.122402e-011 + 3.394616e-009 + 5.204206e-011 + 9.999234e-001 + 1.599985e+001 + 1.000189e+000 + 9.808298e-010 + 1.600059e+001 + 1.000031e+000 + 9.999628e-001 + 1.000059e+000 + 3.999645e+000 + 3.537187e-009 + 1.235244e-009 + 4.039041e-009 + 1.016854e-009 + 4.000075e+000 + 4.000052e+000 + 9.999328e-001 + 1.689511e-010 + 1.296760e-008 + 9.999285e-001 + 1.000100e+000 + 3.999953e+000 + 9.999401e-001 + 4.050900e-010 + 3.600458e-010 + 1.193412e-009 + 1.449052e-010 + 3.770192e-009 + 1.000104e+000 + 8.999939e+000 + 2.690473e-010 + 1.000088e+000 + 3.999857e+000 + 4.000063e+000 + 8.416543e-010 + 9.000045e+000 + 3.999729e+000 + 1.000011e+000 + 1.443063e-009 + 1.000059e+000 + 6.951910e-010 + 4.408795e-009 + 1.597627e-009 + 9.999898e-001 + 5.174645e-010 + 1.906314e-009 + 9.998171e-001 + 1.603651e-009 + 3.999970e+000 + 5.172537e-010 + 9.999204e-001 + 1.000007e+000 + 1.000157e+000 + 4.532641e-009 + 4.000186e+000 + 1.000103e+000 + 9.999255e-001 + 5.798512e-009 + 3.799671e-009 + 9.000282e+000 + 4.000149e+000 + 9.998233e-001 + 1.599975e+001 + 3.999996e+000 + 4.428034e-010 + 4.128732e-010 + 9.998782e-001 + 5.004524e-012 + 6.102732e-010 + 1.000115e+000 + 1.000027e+000 + 3.999850e+000 + 7.009368e-010 + 2.971269e-009 + 6.348064e-009 + 9.999175e-001 + 1.000039e+000 + 1.599999e+001 + 1.000099e+000 + 1.474435e-011 + 4.000103e+000 + 1.522089e-009 + 9.998773e-001 + 2.382324e-009 + 4.391714e-009 + 1.125191e-009 + 8.402828e-010 + 1.540233e-009 + 8.372743e-009 + 3.016971e-010 + 4.000261e+000 + 1.000064e+000 + 5.578902e-009 + 9.999891e-001 + 2.373706e-010 + 5.169085e-009 + 9.999812e-001 + 4.049296e-010 + 3.999695e+000 + 1.282713e-009 + 3.857486e-009 + 5.982414e-010 + 1.000042e+000 + 1.000092e+000 + 4.000159e+000 + 2.344310e-010 + 3.467276e-009 + 9.998266e-001 + 1.266617e-010 + 2.597830e-009 + 1.599983e+001 + 4.917596e-009 + 3.219852e-009 + 7.224782e-009 + 6.600927e-009 + 5.073213e-010 + 9.000332e+000 + 4.000187e+000 + 1.592905e-010 + 2.103325e-010 + 3.999829e+000 + 8.186979e-011 + 3.999786e+000 + 2.535056e-010 + 1.000008e+000 + 5.204206e-011 + 1.000082e+000 + 3.394616e-009 + 8.973467e-009 + 9.662035e-013 + 3.716571e-010 + 3.999938e+000 + 5.855533e-010 + 5.480081e-009 + 1.000177e+000 + 7.870272e-009 + 8.703866e-010 + 8.999619e+000 + 7.325231e-011 + 1.000070e+000 + 9.999739e-001 + 2.287603e-010 + 1.000037e+000 + 1.296760e-008 + 1.000044e+000 + 1.689511e-010 + 1.000023e+000 + 5.094868e-009 + 2.507161e-009 + 8.999886e+000 + 3.999939e+000 + 4.050900e-010 + 3.770192e-009 + 1.573226e-010 + 1.449052e-010 + 2.690473e-010 + 1.015500e-009 + 1.000020e+000 + 2.516107e-010 + 6.558890e-010 + 9.999285e-001 + 4.594286e-009 + 4.000139e+000 + 9.999850e-001 + 8.613986e-010 + 4.267087e-010 + 1.443063e-009 + 1.599968e+001 + 1.000023e+000 + 9.998672e-001 + 9.000262e+000 + 2.650766e-009 + 5.174645e-010 + 1.000015e+000 + 9.999981e-001 + 9.999199e-001 + 3.999986e+000 + 8.377554e-010 + 1.582702e-009 + 9.999071e-001 + 1.000133e+000 + 4.532641e-009 + 5.798512e-009 + 3.999750e+000 + 1.386798e-009 + 9.999257e-001 + 3.999809e+000 + 9.999061e-001 + 1.000002e+000 + 9.999786e-001 + 9.834677e-010 + 3.711504e-009 + 3.999942e+000 + 4.128732e-010 + 3.298696e-009 + 3.999882e+000 + 6.102732e-010 + 7.009368e-010 + 6.861106e-009 + 9.999252e-001 + 1.701599e-009 + 2.755576e-009 + 9.998407e-001 + 3.999802e+000 + 1.000027e+000 + 4.668356e-013 + 1.600031e+001 + 6.849820e-009 + 1.000052e+000 + 4.391714e-009 + 4.000231e+000 + 2.382324e-009 + 1.599969e+001 + 1.589070e-011 + 1.000058e+000 + 4.271211e-009 + 1.464493e-009 + 3.016971e-010 + 2.983365e-011 + 6.087553e-010 + 5.578902e-009 + 4.000038e+000 + 4.000103e+000 + 5.169085e-009 + 8.999785e+000 + 2.702642e-009 + 9.998474e-001 + 4.330533e-010 + 8.692124e-009 + 5.982414e-010 + 8.999908e+000 + 9.999655e-001 + 1.000079e+000 + 1.600009e+001 + 4.000260e+000 + 7.513724e-009 + 4.917596e-009 + 3.230026e-010 + 4.651641e-010 + 6.600927e-009 + 8.350839e-011 + 7.224782e-009 + 9.999065e-001 + 3.396524e-009 + 9.998893e-001 + 1.823997e-009 + 4.146359e-009 + 2.103325e-010 + 1.599987e+001 + 4.000009e+000 + 9.998932e-001 + 3.999837e+000 + 4.000060e+000 + 1.000014e+000 + 1.600001e+001 + 2.889061e-009 + 9.998106e-001 + 5.855533e-010 + 4.000105e+000 + 9.999688e-001 + 7.870272e-009 + 1.167104e-009 + 7.854989e-009 + 7.325231e-011 + 8.020627e-010 + 1.000127e+000 + 8.999909e+000 + 1.438991e-009 + 1.702419e-010 + 3.999912e+000 + 1.663465e-009 + 9.997723e-001 + 9.000428e+000 + 7.888902e-009 + 1.362569e-010 + 2.288256e-010 + 4.000187e+000 + 1.000038e+000 + 1.600010e+001 + 3.321000e-010 + 1.000123e+000 + 1.015500e-009 + 3.999676e+000 + 2.690473e-010 + 6.558890e-010 + 1.000094e+000 + 2.516107e-010 + 1.200982e-009 + 1.000070e+000 + 4.594286e-009 + 9.000124e+000 + 9.412774e-010 + 9.999413e-001 + 1.337353e-010 + 4.000090e+000 + 1.597627e-009 + 2.650766e-009 + 4.000158e+000 + 9.999127e-001 + 4.000004e+000 + 1.000160e+000 + 5.499121e-011 + 1.599977e+001 + 6.960059e-010 + 9.999928e-001 + 4.447171e-009 + 3.999974e+000 + 2.158184e-009 + 1.000125e+000 + 9.999314e-001 + 1.000152e+000 + 1.000096e+000 + 3.520079e-009 + 1.378566e-009 + 1.145632e-010 + 1.330531e-009 + 1.099194e-012 + 2.088312e-010 + 4.000031e+000 + 1.000122e+000 + 1.000059e+000 + 3.999911e+000 + 9.998851e-001 + 6.861106e-009 + 4.530338e-009 + 7.009368e-010 + 9.000315e+000 + 5.082854e-011 + 1.000083e+000 + 3.999946e+000 + 5.854270e-010 + 9.999010e-001 + 6.849820e-009 + 4.000472e+000 + 1.522089e-009 + 9.998846e-001 + 1.000005e+000 + 1.000133e+000 + 1.600003e+001 + 1.543596e-010 + 1.540233e-009 + 1.600031e+001 + 4.000069e+000 + 4.271211e-009 + 8.999852e+000 + 7.195060e-012 + 1.000011e+000 + 9.999484e-001 + 4.000048e+000 + 1.000019e+000 + 2.702642e-009 + 1.000020e+000 + 1.000072e+000 + 8.692124e-009 + 2.104858e-009 + 9.999584e-001 + 4.000069e+000 + 2.932153e-010 + 1.000031e+000 + 4.227603e-009 + 4.232426e-010 + 1.266617e-010 + 8.999892e+000 + 4.000030e+000 + 4.917596e-009 + 9.000055e+000 + 4.000048e+000 + 6.600927e-009 + 8.999650e+000 + 6.817866e-012 + 2.184882e-009 + 1.599948e+001 + 1.077992e-009 + 1.823997e-009 + 9.999954e-001 + 9.999478e-001 + 2.535056e-010 + 2.223623e-010 + 3.999882e+000 + 9.999184e-001 + 2.889061e-009 + 1.349250e-010 + 9.662035e-013 + 9.999475e-001 + 8.418605e-010 + 5.855533e-010 + 8.999795e+000 + 4.973648e-010 + 7.870272e-009 + 8.020627e-010 + 4.838016e-009 + 9.999829e-001 + 1.438991e-009 + 1.130424e-009 + 1.000030e+000 + 1.599967e+001 + 4.902353e-010 + 9.999558e-001 + 8.999467e+000 + 3.999652e+000 + 9.998572e-001 + 9.999064e-001 + 4.000100e+000 + 2.288256e-010 + 1.600015e+001 + 5.271989e-009 + 1.573226e-010 + 1.000162e+000 + 4.000022e+000 + 1.015500e-009 + 2.198540e-009 + 1.000006e+000 + 1.000051e+000 + 3.999861e+000 + 1.000016e+000 + 1.200982e-009 + 1.599975e+001 + 4.000099e+000 + 9.999587e-001 + 9.999552e-001 + 1.463219e-009 + 9.999769e-001 + 1.557745e-009 + 1.000090e+000 + 9.998970e-001 + 6.383744e-009 + 1.000049e+000 + 1.000002e+000 + 6.960059e-010 + 3.203032e-009 + 8.377554e-010 + 1.000013e+000 + 9.998435e-001 + 9.998666e-001 + 1.174891e-009 + 3.348245e-009 + 3.895499e-009 + 1.599953e+001 + 9.998593e-001 + 2.290233e-009 + 8.999781e+000 + 1.525806e-009 + 1.000021e+000 + 9.999844e-001 + 3.999851e+000 + 2.088312e-010 + 4.916195e-010 + 3.999952e+000 + 8.692730e-010 + 4.530338e-009 + 1.000075e+000 + 1.000166e+000 + 9.000043e+000 + 1.000072e+000 + 9.998950e-001 + 1.600019e+001 + 9.999549e-001 + 9.999730e-001 + 1.389444e-008 + 4.924439e-009 + 9.998345e-001 + 6.602732e-012 + 3.999876e+000 + 3.330328e-009 + 1.600010e+001 + 9.999863e-001 + 1.589070e-011 + 2.941206e-010 + 4.000211e+000 + 1.464493e-009 + 9.000016e+000 + 3.102519e-010 + 1.000049e+000 + 1.461479e-010 + 6.519537e-009 + 6.644035e-010 + 9.703038e-011 + 1.363174e-009 + 2.702642e-009 + 2.104858e-009 + 2.074035e-009 + 8.692124e-009 + 9.000103e+000 + 1.000097e+000 + 1.000035e+000 + 1.599984e+001 + 9.998619e-001 + 4.227603e-009 + 9.999851e-001 + 1.000042e+000 + 1.000036e+000 + 9.999759e-001 + 6.574487e-009 + 9.999817e-001 + 6.817866e-012 + 1.711663e-008 + 1.000117e+000 + 1.599974e+001 + 4.087893e-011 + 4.146359e-009 + 6.823751e-010 + 3.999982e+000 + 5.256218e-012 + 1.000059e+000 + 1.000077e+000 + 2.223623e-010 + 8.999930e+000 + 9.808298e-010 + 2.889061e-009 + 8.418605e-010 + 3.463217e-010 + 6.899733e-010 + 8.999866e+000 + 3.999762e+000 + 1.000068e+000 + 4.838016e-009 + 3.999872e+000 + 9.999434e-001 + 1.130424e-009 + 1.000067e+000 + 1.438991e-009 + 4.902353e-010 + 1.278355e-009 + 1.663465e-009 + 7.575626e-009 + 8.982828e-010 + 1.000178e+000 + 9.999500e-001 + 4.000138e+000 + 2.188345e-009 + 8.999564e+000 + 2.704959e-009 + 3.321000e-010 + 9.999889e-001 + 9.999118e-001 + 6.568012e-009 + 3.999987e+000 + 8.416543e-010 + 9.999062e-001 + 6.765929e-011 + 9.999888e-001 + 9.999305e-001 + 9.999505e-001 + 3.999895e+000 + 9.412774e-010 + 1.463219e-009 + 2.624426e-011 + 5.010586e-010 + 2.018711e-009 + 8.366540e-009 + 1.557745e-009 + 5.990238e-010 + 5.172537e-010 + 9.998402e-001 + 9.000340e+000 + 6.199773e-009 + 6.960059e-010 + 4.000313e+000 + 9.998969e-001 + 4.367655e-011 + 3.348245e-009 + 3.799671e-009 + 1.000069e+000 + 4.000281e+000 + 7.805783e-009 + 3.520079e-009 + 9.000234e+000 + 4.428034e-010 + 1.000073e+000 + 1.000075e+000 + 4.000009e+000 + 6.063798e-011 + 1.448843e-010 + 1.781761e-010 + 4.916195e-010 + 3.999851e+000 + 4.000218e+000 + 4.530338e-009 + 3.999855e+000 + 3.772089e-010 + 9.999857e-001 + 5.084775e-010 + 4.000015e+000 + 5.854270e-010 + 8.999579e+000 + 1.000123e+000 + 1.389444e-008 + 1.000062e+000 + 4.000134e+000 + 9.999949e-001 + 4.680074e-011 + 8.372743e-009 + 1.543596e-010 + 9.998947e-001 + 9.999355e-001 + 2.941206e-010 + 8.999894e+000 + 2.373706e-010 + 9.999946e-001 + 8.999516e+000 + 4.000080e+000 + 1.461479e-010 + 9.000222e+000 + 3.857486e-009 + 9.999803e-001 + 2.074035e-009 + 9.999081e-001 + 9.999082e-001 + 3.999807e+000 + 3.467276e-009 + 9.999658e-001 + 4.000276e+000 + 2.597830e-009 + 4.232426e-010 + 4.423903e-010 + 4.000227e+000 + 5.574040e-011 + 8.999514e+000 + 4.000090e+000 + 1.451244e-010 + 1.711663e-008 + 1.592905e-010 + 6.817866e-012 + 4.087893e-011 + 3.999964e+000 + 1.077992e-009 + 2.122402e-011 + 9.999922e-001 + 1.000052e+000 + 3.999847e+000 + 3.394616e-009 + 8.699271e-010 + 1.599975e+001 + 3.716571e-010 + 1.000023e+000 + 3.463217e-010 + 5.480081e-009 + 8.418605e-010 + 1.000119e+000 + 3.999882e+000 + 1.000045e+000 + 1.000064e+000 + 1.235244e-009 + 4.838016e-009 + 3.999866e+000 + 9.999627e-001 + 9.999328e-001 + 9.000215e+000 + 1.689511e-010 + 4.902353e-010 + 8.982828e-010 + 3.999800e+000 + 7.575626e-009 + 9.999309e-001 + 3.999919e+000 + 6.258826e-010 + 2.704959e-009 + 4.000048e+000 + 1.000145e+000 + 1.943820e-009 + 1.046981e-010 + 3.075263e-011 + 8.416543e-010 + 1.000071e+000 + 9.999935e-001 + 4.000022e+000 + 5.613189e-011 + 9.999835e-001 + 6.951910e-010 + 1.443063e-009 + 6.133571e-010 + 2.624426e-011 + 4.408795e-009 + 9.999235e-001 + 8.366540e-009 + 3.999909e+000 + 9.999101e-001 + 1.600018e+001 + 1.000080e+000 + 9.999511e-001 + 8.999528e+000 + 4.000159e+000 + 9.998868e-001 + 2.657118e-009 + 4.532641e-009 + 1.000156e+000 + 1.599951e+001 + 4.000149e+000 + 9.998843e-001 + 9.000530e+000 + 2.206473e-009 + 1.000141e+000 + 4.428034e-010 + 9.834677e-010 + 9.999219e-001 + 9.999955e-001 + 4.128732e-010 + 1.395503e-009 + 8.999920e+000 + 6.102732e-010 + 1.448843e-010 + 2.971269e-009 + 1.000075e+000 + 9.999253e-001 + 8.999883e+000 + 6.348064e-009 + 9.999277e-001 + 9.999923e-001 + 4.668356e-013 + 1.000045e+000 + 3.761714e-009 + 9.999483e-001 + 1.000140e+000 + 1.125191e-009 + 3.999805e+000 + 9.651707e-010 + 8.372743e-009 + 8.402828e-010 + 1.000014e+000 + 4.000129e+000 + 3.999931e+000 + 2.770728e-009 + 2.373706e-010 + 5.578902e-009 + 1.000035e+000 + 4.049296e-010 + 4.000288e+000 + 1.000161e+000 + 3.857486e-009 + 1.000153e+000 + 9.999262e-001 + 2.112329e-009 + 5.982414e-010 + 2.074035e-009 + 3.467276e-009 + 9.999207e-001 + 9.999033e-001 + 1.599959e+001 + 4.000347e+000 + 1.000138e+000 + 3.219852e-009 + 4.651641e-010 + 9.999579e-001 + 5.073213e-010 + 4.000340e+000 + 1.000162e+000 + 2.478780e-009 + 8.640065e-010 + 2.707847e-011 + 4.829447e-010 + 3.999972e+000 + 9.999821e-001 + 1.000083e+000 + 3.999932e+000 + 1.294443e-009 + 3.999833e+000 + 1.000030e+000 + 4.439812e-009 + 1.005474e-008 + 4.000115e+000 + 1.000027e+000 + 1.000056e+000 + 2.110014e-011 + 3.256073e-009 + 1.600012e+001 + 2.974497e-009 + 9.998845e-001 + 4.000017e+000 + 3.999916e+000 + 7.776212e-010 + 1.016913e-010 + 3.999982e+000 + 1.000049e+000 + 1.000023e+000 + 5.267273e-010 + 9.338283e-011 + 4.779987e-009 + 9.998465e-001 + 2.845285e-010 + 1.839704e-009 + 1.555503e-009 + 4.552541e-009 + 1.000008e+000 + 1.479613e-010 + 9.999493e-001 + 1.600012e+001 + 7.643828e-011 + 1.038159e-009 + 1.000052e+000 + 9.999709e-001 + 1.173797e-009 + 1.600000e+001 + 3.999842e+000 + 1.000079e+000 + 6.389986e-010 + 1.007163e-009 + 3.509994e-011 + 3.999937e+000 + 9.999811e-001 + 1.000031e+000 + 4.424430e-009 + 5.189384e-009 + 4.147437e-011 + 8.999963e+000 + 1.000018e+000 + 4.135942e-010 + 1.226757e-011 + 3.999764e+000 + 1.000133e+000 + 3.968060e-009 + 9.999363e-001 + 1.000057e+000 + 1.599984e+001 + 3.767732e-010 + 2.225183e-013 + 3.999733e+000 + 1.485220e-009 + 9.999384e-001 + 1.600048e+001 + 2.224040e-009 + 8.604255e-010 + 2.849072e-009 + 4.000006e+000 + 2.688222e-013 + 1.599942e+001 + 1.000115e+000 + 2.142578e-010 + 4.000114e+000 + 9.999567e-001 + 9.999771e-001 + 1.600050e+001 + 4.879289e-011 + 9.868734e-010 + 2.270952e-009 + 9.999453e-001 + 4.732842e-010 + 9.177122e-011 + 1.000138e+000 + 3.966639e-010 + 2.070040e-009 + 1.022492e-012 + 1.000063e+000 + 1.667544e-009 + 1.000031e+000 + 9.999983e-001 + 3.309015e-010 + 9.999620e-001 + 1.639184e-009 + 3.999996e+000 + 2.311101e-010 + 1.000008e+000 + 1.599919e+001 + 3.999676e+000 + 1.000027e+000 + 9.000140e+000 + 4.000001e+000 + 1.695503e-014 + 4.000087e+000 + 1.387728e-009 + 9.999987e-001 + 3.922815e-011 + 2.945510e-009 + 4.647694e-009 + 9.000300e+000 + 2.837718e-010 + 9.999135e-001 + 4.581870e-009 + 2.653152e-010 + 1.000046e+000 + 2.475789e-010 + 4.678690e-009 + 5.101861e-009 + 1.599976e+001 + 6.442499e-012 + 1.000100e+000 + 1.000014e+000 + 4.793325e-009 + 9.999560e-001 + 1.000034e+000 + 1.750746e-010 + 1.728121e-009 + 2.177308e-010 + 1.528305e-010 + 9.999166e-001 + 9.999426e-001 + 9.999223e-001 + 1.005474e-008 + 2.110014e-011 + 1.000019e+000 + 7.714493e-010 + 2.974497e-009 + 1.000078e+000 + 2.109694e-010 + 4.410856e-010 + 1.000006e+000 + 1.000008e+000 + 1.956836e-011 + 2.989192e-009 + 1.000020e+000 + 5.267273e-010 + 4.000192e+000 + 1.306488e-010 + 5.892677e-009 + 3.937779e-009 + 1.000138e+000 + 1.555503e-009 + 3.166558e-009 + 9.999142e-001 + 8.999927e+000 + 5.452758e-009 + 1.616167e-011 + 7.643828e-011 + 1.000023e+000 + 2.151033e-010 + 4.000058e+000 + 9.999561e-001 + 6.711648e-010 + 1.000079e+000 + 1.994627e-009 + 3.056530e-013 + 1.007163e-009 + 8.454648e-010 + 6.389986e-010 + 8.908299e-011 + 4.000144e+000 + 9.999687e-001 + 1.600058e+001 + 3.330955e-010 + 9.998670e-001 + 8.326378e-011 + 5.597783e-009 + 1.000012e+000 + 1.000118e+000 + 3.293752e-011 + 9.999930e-001 + 1.013183e-009 + 3.999955e+000 + 3.968060e-009 + 3.767732e-010 + 2.587340e-010 + 3.795694e-010 + 1.599969e+001 + 4.000073e+000 + 9.998663e-001 + 2.224040e-009 + 1.270422e-010 + 3.664206e-009 + 9.999971e-001 + 7.467912e-012 + 2.849072e-009 + 3.999771e+000 + 6.201866e-009 + 5.271049e-009 + 4.000087e+000 + 4.000051e+000 + 1.000057e+000 + 4.879289e-011 + 4.000252e+000 + 3.920834e-009 + 4.000109e+000 + 1.060055e-009 + 1.000095e+000 + 4.766214e-009 + 1.508987e-009 + 9.999808e-001 + 9.000006e+000 + 9.999644e-001 + 9.999090e-001 + 2.446109e-010 + 5.489896e-009 + 1.667544e-009 + 4.000076e+000 + 9.999038e-001 + 1.000036e+000 + 2.311101e-010 + 4.000031e+000 + 9.999978e-001 + 6.543114e-009 + 9.999662e-001 + 1.027780e-008 + 9.999995e-001 + 3.999788e+000 + 9.999533e-001 + 1.387728e-009 + 1.425803e-009 + 1.000043e+000 + 8.999674e+000 + 4.000162e+000 + 3.922815e-011 + 1.599987e+001 + 4.000004e+000 + 9.998999e-001 + 2.653152e-010 + 9.998467e-001 + 4.581870e-009 + 9.000410e+000 + 1.946411e-010 + 2.475789e-010 + 6.442499e-012 + 2.802088e-012 + 8.640065e-010 + 8.999585e+000 + 1.000053e+000 + 4.771950e-011 + 1.750746e-010 + 1.211465e-012 + 2.913601e-010 + 9.000074e+000 + 4.000004e+000 + 9.999705e-001 + 4.000155e+000 + 3.999868e+000 + 8.228926e-010 + 8.801388e-011 + 2.141187e-010 + 1.000009e+000 + 3.999843e+000 + 9.866367e-012 + 1.000109e+000 + 1.041684e-011 + 9.998922e-001 + 4.410856e-010 + 1.600044e+001 + 9.998659e-001 + 1.956836e-011 + 9.999040e-001 + 4.000114e+000 + 1.000046e+000 + 1.600050e+001 + 4.000059e+000 + 1.000154e+000 + 1.599955e+001 + 1.000068e+000 + 1.555503e-009 + 5.452758e-009 + 4.167849e-010 + 1.000024e+000 + 1.298016e-010 + 3.999486e+000 + 9.999825e-001 + 4.825128e-010 + 4.000143e+000 + 1.000029e+000 + 1.994627e-009 + 5.417227e-010 + 1.552099e-009 + 8.454648e-010 + 4.000114e+000 + 9.999365e-001 + 9.999279e-001 + 3.999897e+000 + 1.000019e+000 + 3.330955e-010 + 3.582563e-010 + 5.189384e-009 + 9.000449e+000 + 4.314630e-010 + 9.999818e-001 + 3.293752e-011 + 6.855568e-011 + 3.469763e-009 + 1.000023e+000 + 1.000161e+000 + 1.000064e+000 + 9.000097e+000 + 1.000122e+000 + 1.000039e+000 + 3.342077e-010 + 4.000001e+000 + 1.485220e-009 + 1.599991e+001 + 4.574827e-009 + 2.224040e-009 + 7.467912e-012 + 9.998469e-001 + 2.161853e-012 + 6.201866e-009 + 1.207239e-010 + 9.998854e-001 + 1.637488e-010 + 1.740473e-010 + 1.000043e+000 + 9.998742e-001 + 9.059387e-013 + 9.999860e-001 + 1.060055e-009 + 1.721672e-009 + 1.000055e+000 + 8.999767e+000 + 4.000277e+000 + 9.998619e-001 + 4.000071e+000 + 3.999677e+000 + 9.999980e-001 + 5.489896e-009 + 9.999536e-001 + 9.999687e-001 + 4.000192e+000 + 3.999925e+000 + 1.000038e+000 + 9.999844e-001 + 3.186877e-011 + 2.311101e-010 + 4.000068e+000 + 3.360008e-009 + 6.543114e-009 + 2.806523e-009 + 5.227129e-010 + 6.069532e-014 + 1.425803e-009 + 9.999635e-001 + 1.387728e-009 + 9.999189e-001 + 4.155154e-009 + 1.000109e+000 + 9.999982e-001 + 4.000410e+000 + 2.837718e-010 + 5.879099e-009 + 1.000056e+000 + 1.000033e+000 + 1.946411e-010 + 1.000050e+000 + 9.998632e-001 + 2.802088e-012 + 3.999601e+000 + 9.999949e-001 + 6.910925e-010 + 9.998920e-001 + 1.000138e+000 + 8.999993e+000 + 1.152429e-010 + 9.999735e-001 + 9.197442e-013 + 1.115397e-008 + 9.999753e-001 + 1.000066e+000 + 3.407075e-010 + 1.000078e+000 + 9.000088e+000 + 9.999001e-001 + 9.999812e-001 + 9.866367e-012 + 6.900322e-009 + 9.999216e-001 + 2.905730e-009 + 9.999058e-001 + 9.999935e-001 + 4.000268e+000 + 4.000115e+000 + 2.989192e-009 + 9.999429e-001 + 9.999437e-001 + 2.306352e-009 + 2.159772e-010 + 1.753331e-009 + 3.937779e-009 + 1.141284e-009 + 8.972345e-009 + 3.166558e-009 + 9.000122e+000 + 4.000094e+000 + 5.452758e-009 + 1.000257e+000 + 9.999781e-001 + 9.999772e-001 + 9.999284e-001 + 1.000000e+000 + 1.000044e+000 + 9.000140e+000 + 1.072539e-009 + 1.994627e-009 + 9.999430e-001 + 4.000055e+000 + 8.454648e-010 + 1.000052e+000 + 1.240693e-010 + 1.299997e-009 + 3.582563e-010 + 3.818163e-009 + 3.330955e-010 + 8.999875e+000 + 4.000242e+000 + 9.998504e-001 + 6.855568e-011 + 4.743189e-009 + 1.000011e+000 + 3.999679e+000 + 1.000110e+000 + 1.285250e-010 + 3.999756e+000 + 9.999727e-001 + 9.999678e-001 + 9.999997e-001 + 4.913827e-010 + 3.342077e-010 + 4.574827e-009 + 1.000119e+000 + 1.270422e-010 + 5.863034e-009 + 4.000138e+000 + 7.467912e-012 + 1.207239e-010 + 4.554211e-010 + 6.201866e-009 + 1.599989e+001 + 3.966768e-010 + 1.637488e-010 + 9.000006e+000 + 4.000097e+000 + 3.958638e-009 + 8.999751e+000 + 2.099377e-009 + 1.060055e-009 + 9.998614e-001 + 6.666200e-009 + 1.000078e+000 + 1.000161e+000 + 3.402753e-009 + 1.000036e+000 + 4.000093e+000 + 9.999504e-001 + 9.998518e-001 + 3.561656e-010 + 9.999961e-001 + 1.000096e+000 + 3.186877e-011 + 2.747398e-010 + 6.102205e-011 + 8.999652e+000 + 9.787594e-011 + 1.000034e+000 + 5.227129e-010 + 3.999851e+000 + 2.806523e-009 + 4.000073e+000 + 1.142576e-009 + 9.999245e-001 + 4.155154e-009 + 9.999991e-001 + 1.645577e-009 + 1.051737e-008 + 4.000066e+000 + 8.342294e-013 + 3.999888e+000 + 3.999766e+000 + 1.000153e+000 + 6.150335e-010 + 1.000018e+000 + 1.000028e+000 + 9.972548e-009 + 4.000021e+000 + 9.999967e-001 + 2.916497e-009 + 8.020625e-011 + 9.999474e-001 + 8.999936e+000 + 3.999856e+000 + 1.000002e+000 + 1.115397e-008 + 3.999733e+000 + 9.197442e-013 + 1.600015e+001 + 1.886609e-010 + 1.087340e-009 + 4.000200e+000 + 3.256073e-009 + 9.999707e-001 + 6.900322e-009 + 3.332705e-009 + 9.866367e-012 + 2.218074e-009 + 7.776212e-010 + 1.000108e+000 + 9.999427e-001 + 9.999506e-001 + 1.000134e+000 + 7.920019e-010 + 9.338283e-011 + 8.142519e-010 + 1.599967e+001 + 2.845285e-010 + 2.159772e-010 + 1.599924e+001 + 3.999730e+000 + 9.999324e-001 + 9.999531e-001 + 1.000051e+000 + 9.999592e-001 + 1.204194e-010 + 3.999871e+000 + 1.653175e-008 + 4.000000e+000 + 4.000137e+000 + 1.283307e-009 + 1.600026e+001 + 1.541082e-009 + 9.999535e-001 + 9.999723e-001 + 3.509994e-011 + 8.134443e-010 + 1.240693e-010 + 2.461090e-010 + 6.657897e-010 + 3.818163e-009 + 4.000026e+000 + 9.999621e-001 + 9.998789e-001 + 4.000081e+000 + 1.000042e+000 + 9.000413e+000 + 4.453562e-009 + 1.000017e+000 + 3.999781e+000 + 9.999432e-001 + 9.998393e-001 + 4.000055e+000 + 4.000002e+000 + 9.998779e-001 + 1.600018e+001 + 9.494478e-010 + 2.819807e-014 + 3.999761e+000 + 3.999883e+000 + 4.574827e-009 + 1.191201e-009 + 2.688222e-013 + 1.000153e+000 + 4.554211e-010 + 2.142578e-010 + 1.207239e-010 + 8.999880e+000 + 1.000023e+000 + 1.740473e-010 + 9.999517e-001 + 9.868734e-010 + 9.999981e-001 + 9.000275e+000 + 4.000087e+000 + 1.000083e+000 + 6.666200e-009 + 3.966639e-010 + 4.799727e-009 + 3.402753e-009 + 9.871440e-010 + 6.510245e-009 + 6.141376e-010 + 6.980451e-013 + 1.000046e+000 + 3.797438e-012 + 1.639184e-009 + 3.561656e-010 + 1.599987e+001 + 1.580136e-011 + 3.186877e-011 + 9.000059e+000 + 9.999733e-001 + 1.000116e+000 + 1.000075e+000 + 4.000001e+000 + 5.227129e-010 + 1.600027e+001 + 1.000001e+000 + 1.000036e+000 + 4.000002e+000 + 4.647694e-009 + 4.155154e-009 + 9.999672e-001 + 1.000086e+000 + 1.051737e-008 + 3.424196e-009 + 5.248440e-010 + 9.999438e-001 + 3.999963e+000 + 5.101861e-009 + 9.999504e-001 + 9.999896e-001 + 9.999004e-001 + 9.972548e-009 + 8.020625e-011 + 1.000044e+000 + 1.000108e+000 + 1.000072e+000 + 3.999834e+000 + 1.000021e+000 + 4.439812e-009 + 1.000083e+000 + 1.000211e+000 + 8.999918e+000 + 4.000401e+000 + 3.407075e-010 + 1.600046e+001 + 3.999889e+000 + 1.000100e+000 + 9.000346e+000 + 2.109694e-010 + 1.000166e+000 + 7.776212e-010 + 9.999915e-001 + 1.000094e+000 + 6.095609e-010 + 9.999798e-001 + 8.206601e-010 + 9.338283e-011 + 3.999954e+000 + 1.000056e+000 + 2.845285e-010 + 4.779987e-009 + 1.753331e-009 + 4.552541e-009 + 1.839704e-009 + 8.972345e-009 + 6.433107e-010 + 3.999984e+000 + 5.499053e-010 + 1.038159e-009 + 2.151033e-010 + 1.000022e+000 + 9.999315e-001 + 3.999896e+000 + 1.000000e+000 + 8.999764e+000 + 3.056530e-013 + 1.072539e-009 + 1.600005e+001 + 6.389986e-010 + 1.913094e-010 + 2.461090e-010 + 1.000031e+000 + 1.240693e-010 + 9.999871e-001 + 1.000133e+000 + 3.818163e-009 + 4.135942e-010 + 3.701050e-011 + 3.664485e-009 + 4.453562e-009 + 1.000007e+000 + 9.998623e-001 + 4.000114e+000 + 4.000252e+000 + 9.998904e-001 + 2.225183e-013 + 3.795694e-010 + 1.000027e+000 + 9.000185e+000 + 1.000134e+000 + 4.913827e-010 + 8.604255e-010 + 3.664206e-009 + 9.998805e-001 + 1.600000e+001 + 2.849072e-009 + 1.191201e-009 + 1.600012e+001 + 5.271049e-009 + 1.000043e+000 + 1.307103e-010 + 9.999429e-001 + 1.000040e+000 + 9.868734e-010 + 3.920834e-009 + 5.841936e-010 + 9.999565e-001 + 9.999047e-001 + 9.999084e-001 + 3.966639e-010 + 9.177122e-011 + 6.666200e-009 + 8.999811e+000 + 1.000091e+000 + 3.402753e-009 + 9.000005e+000 + 1.667544e-009 + 1.000050e+000 + 1.600032e+001 + 3.309015e-010 + 1.000004e+000 + 8.999976e+000 + 1.000002e+000 + 2.747398e-010 + 1.777935e-010 + 1.027780e-008 + 9.999802e-001 + 9.999997e-001 + 5.460988e-010 + 1.392311e-009 + 3.999997e+000 + 9.999567e-001 + 1.142576e-009 + 4.647694e-009 + 3.922815e-011 + 1.000001e+000 + 3.999827e+000 + 2.505946e-009 + 2.687267e-010 + 5.248440e-010 + 4.000271e+000 + 3.424196e-009 + 1.600057e+001 + 2.475789e-010 + 9.999817e-001 + 1.600025e+001 + 3.999948e+000 + 1.000008e+000 + 5.078625e-011 + 4.000241e+000 + 3.355259e-009 + 3.999761e+000 + 1.000029e+000 + 1.000051e+000 + 9.999548e-001 + 9.526028e-010 + 9.144733e-011 + 2.705877e-010 + 3.999920e+000 + 1.044609e-009 + 9.000189e+000 + 8.159683e-010 + 3.210989e-009 + 1.600010e+001 + 2.452111e-011 + 9.998390e-001 + 1.591475e-009 + 6.563655e-009 + 9.999745e-001 + 4.000016e+000 + 9.999581e-001 + 9.998797e-001 + 1.599967e+001 + 4.017341e-010 + 1.000042e+000 + 9.000403e+000 + 1.461929e-011 + 9.999243e-001 + 1.599974e+001 + 4.000056e+000 + 7.206449e-011 + 5.044418e-010 + 6.913303e-009 + 9.999803e-001 + 7.138874e-009 + 9.999753e-001 + 1.020401e-008 + 9.000280e+000 + 4.958215e-010 + 9.999075e-001 + 4.075631e-010 + 9.999504e-001 + 2.639716e-011 + 4.000198e+000 + 6.444459e-009 + 9.999754e-001 + 1.600099e+001 + 4.000130e+000 + 1.703627e-009 + 1.000094e+000 + 4.774904e-011 + 1.145721e-010 + 9.000215e+000 + 3.999856e+000 + 5.416970e-011 + 1.201102e-009 + 2.615384e-009 + 1.000100e+000 + 4.374497e-010 + 1.605823e-010 + 9.999789e-001 + 1.000009e+000 + 4.930401e-010 + 1.278922e-011 + 6.601759e-009 + 7.774640e-011 + 9.999809e-001 + 9.000459e+000 + 6.410813e-009 + 4.597339e-010 + 1.007815e-009 + 4.000111e+000 + 1.000001e+000 + 1.538777e-010 + 4.000332e+000 + 1.000056e+000 + 5.808284e-009 + 9.999239e-001 + 5.323925e-010 + 1.000024e+000 + 1.454352e-010 + 1.000028e+000 + 1.012282e-009 + 1.945341e-010 + 4.562988e-012 + 2.375954e-011 + 6.212961e-009 + 1.000078e+000 + 2.170346e-009 + 1.047138e-009 + 1.423188e-010 + 9.000261e+000 + 2.976248e-011 + 1.000073e+000 + 8.999701e+000 + 4.000154e+000 + 1.000008e+000 + 3.508639e-009 + 9.999110e-001 + 1.000017e+000 + 1.000094e+000 + 1.415504e-009 + 9.999413e-001 + 3.999839e+000 + 3.999920e+000 + 5.523623e-011 + 3.999992e+000 + 1.363569e-009 + 1.654260e-009 + 9.000313e+000 + 1.315938e-010 + 1.788845e-009 + 9.999051e-001 + 3.999979e+000 + 9.999894e-001 + 4.000122e+000 + 2.576658e-010 + 3.429675e-010 + 5.378939e-009 + 3.796469e-009 + 1.434877e-009 + 1.719275e-010 + 7.171629e-009 + 9.595727e-010 + 3.642933e-009 + 1.000020e+000 + 5.078625e-011 + 3.999942e+000 + 5.262628e-010 + 9.998805e-001 + 9.526028e-010 + 4.600929e-010 + 5.112299e-010 + 1.000040e+000 + 3.999974e+000 + 2.705877e-010 + 1.600023e+001 + 8.666303e-010 + 9.999370e-001 + 8.999970e+000 + 1.000032e+000 + 1.487877e-010 + 6.563655e-009 + 1.000127e+000 + 9.999202e-001 + 4.383401e-010 + 3.999843e+000 + 1.000008e+000 + 1.600016e+001 + 3.610991e-009 + 1.687244e-009 + 1.461929e-011 + 4.000255e+000 + 9.998655e-001 + 9.999720e-001 + 1.611191e-009 + 1.042029e-009 + 8.999501e+000 + 1.022885e-010 + 5.044418e-010 + 1.525566e-010 + 4.000146e+000 + 7.138874e-009 + 9.000134e+000 + 1.605406e-008 + 9.999067e-001 + 6.147414e-010 + 5.992904e-009 + 9.999596e-001 + 6.444459e-009 + 4.271271e-011 + 1.000099e+000 + 1.063337e-009 + 1.000092e+000 + 1.521197e-008 + 4.774904e-011 + 1.000029e+000 + 2.222577e-009 + 1.289566e-009 + 2.677768e-009 + 9.999283e-001 + 1.600041e+001 + 2.234570e-010 + 1.201102e-009 + 1.600010e+001 + 6.580761e-012 + 4.374497e-010 + 9.000133e+000 + 3.461767e-009 + 2.213297e-011 + 8.999947e+000 + 3.620511e-009 + 6.601759e-009 + 8.999520e+000 + 1.355150e-011 + 9.998469e-001 + 9.999443e-001 + 9.999778e-001 + 1.007815e-009 + 9.998341e-001 + 4.000169e+000 + 1.000025e+000 + 1.447624e-009 + 4.267713e-010 + 5.808284e-009 + 9.000072e+000 + 9.446144e-010 + 1.428978e-010 + 1.945341e-010 + 1.261615e-009 + 9.999364e-001 + 1.599937e+001 + 2.215421e-009 + 1.000010e+000 + 1.600026e+001 + 9.349282e-010 + 2.170346e-009 + 2.976248e-011 + 8.844296e-010 + 9.999129e-001 + 9.999230e-001 + 6.934413e-011 + 1.000100e+000 + 4.000178e+000 + 1.649421e-010 + 3.508639e-009 + 9.000226e+000 + 1.000072e+000 + 2.220190e-009 + 1.000040e+000 + 8.798783e-012 + 9.999194e-001 + 1.600030e+001 + 3.603656e-010 + 9.999958e-001 + 8.999931e+000 + 1.542623e-009 + 9.998958e-001 + 2.789182e-011 + 2.340996e-009 + 2.253325e-009 + 8.999904e+000 + 3.999719e+000 + 1.000061e+000 + 1.599951e+001 + 1.000079e+000 + 5.378939e-009 + 7.171629e-009 + 2.479701e-009 + 1.719275e-010 + 9.718826e-011 + 1.078766e-009 + 3.642933e-009 + 5.262628e-010 + 3.999799e+000 + 9.999708e-001 + 8.999871e+000 + 1.000081e+000 + 9.526028e-010 + 4.159771e-011 + 4.000047e+000 + 4.010274e-010 + 8.666303e-010 + 2.136739e-010 + 8.159683e-010 + 3.999936e+000 + 3.015828e-010 + 1.000010e+000 + 4.008610e-009 + 2.574442e-010 + 6.563655e-009 + 1.548501e-009 + 9.999815e-001 + 1.000042e+000 + 9.000361e+000 + 4.000102e+000 + 4.017341e-010 + 4.063044e-009 + 1.000011e+000 + 1.000008e+000 + 1.611191e-009 + 8.954638e-010 + 1.966260e-010 + 1.022885e-010 + 1.423766e-009 + 1.000166e+000 + 9.999270e-001 + 9.999756e-001 + 1.000025e+000 + 9.000760e+000 + 2.492797e-009 + 9.999555e-001 + 5.992904e-009 + 2.913312e-010 + 1.000050e+000 + 1.600005e+001 + 4.000153e+000 + 6.444459e-009 + 2.120407e-009 + 4.512448e-010 + 1.063337e-009 + 2.120732e-010 + 1.825571e-010 + 4.774904e-011 + 1.599959e+001 + 3.999765e+000 + 1.289566e-009 + 2.234570e-010 + 3.999938e+000 + 2.615384e-009 + 1.600002e+001 + 9.998359e-001 + 1.605823e-010 + 3.461767e-009 + 1.057049e-009 + 9.999556e-001 + 8.999639e+000 + 1.899635e-010 + 1.000018e+000 + 1.355150e-011 + 3.886763e-010 + 1.000160e+000 + 1.236941e-010 + 1.287176e-010 + 7.755575e-010 + 1.792972e-009 + 4.120961e-009 + 6.885352e-009 + 1.600017e+001 + 3.999570e+000 + 1.000076e+000 + 9.446144e-010 + 9.998785e-001 + 9.999759e-001 + 1.261615e-009 + 1.000038e+000 + 1.945341e-010 + 8.999718e+000 + 9.999584e-001 + 6.212961e-009 + 8.999817e+000 + 4.594762e-009 + 1.047138e-009 + 9.000178e+000 + 7.700664e-011 + 2.976248e-011 + 9.000050e+000 + 3.424377e-009 + 1.483066e-009 + 1.649421e-010 + 4.053097e-010 + 1.000089e+000 + 3.999856e+000 + 9.999012e-001 + 9.999248e-001 + 1.600002e+001 + 9.999687e-001 + 4.020188e-010 + 3.603656e-010 + 2.162735e-009 + 1.363569e-009 + 1.542623e-009 + 3.999936e+000 + 1.000023e+000 + 8.999710e+000 + 1.000042e+000 + 2.789182e-011 + 4.945256e-009 + 9.999218e-001 + 1.000032e+000 + 3.999842e+000 + 1.000063e+000 + 3.796469e-009 + 1.600040e+001 + 3.986495e-010 + 9.998306e-001 + 8.999803e+000 + 9.999408e-001 + 9.999803e-001 + 1.000101e+000 + 1.000032e+000 + 9.999541e-001 + 3.999838e+000 + 3.327051e-010 + 1.000043e+000 + 1.403827e-010 + 1.000104e+000 + 4.159771e-011 + 8.999912e+000 + 1.355238e-009 + 8.666303e-010 + 3.015828e-010 + 9.999956e-001 + 9.999681e-001 + 9.000096e+000 + 3.527647e-013 + 9.998734e-001 + 4.000037e+000 + 7.498289e-012 + 1.548501e-009 + 6.523936e-010 + 9.998259e-001 + 9.998798e-001 + 3.999978e+000 + 4.000089e+000 + 4.063044e-009 + 8.999820e+000 + 3.999929e+000 + 1.611191e-009 + 1.423766e-009 + 8.878714e-010 + 1.000020e+000 + 1.482844e-010 + 1.331299e-011 + 1.331626e-009 + 2.492797e-009 + 4.000094e+000 + 9.997466e-001 + 9.000102e+000 + 4.164764e-010 + 9.998452e-001 + 1.455529e-009 + 3.999929e+000 + 4.271271e-011 + 9.000127e+000 + 7.958724e-009 + 9.999079e-001 + 1.600011e+001 + 6.485821e-011 + 9.999709e-001 + 1.000117e+000 + 1.184642e-008 + 2.677768e-009 + 2.377650e-010 + 4.457724e-011 + 1.000030e+000 + 6.733553e-009 + 3.155415e-010 + 6.580761e-012 + 8.999805e+000 + 5.289959e-010 + 9.998823e-001 + 1.899635e-010 + 5.620881e-009 + 1.000120e+000 + 1.600016e+001 + 9.999987e-001 + 1.355150e-011 + 1.287176e-010 + 1.000035e+000 + 1.000022e+000 + 1.600051e+001 + 5.940729e-009 + 1.792972e-009 + 1.000215e+000 + 4.167739e-010 + 4.267713e-010 + 3.691456e-009 + 1.043534e-009 + 9.446144e-010 + 3.598822e-010 + 7.396350e-009 + 1.000071e+000 + 4.000083e+000 + 3.999837e+000 + 1.000094e+000 + 4.594762e-009 + 2.512195e-010 + 1.000061e+000 + 7.700664e-011 + 2.326563e-010 + 9.999405e-001 + 9.000351e+000 + 4.000083e+000 + 9.999833e-001 + 8.999879e+000 + 1.000016e+000 + 1.649421e-010 + 2.441036e-009 + 1.097370e-011 + 9.999279e-001 + 2.449542e-010 + 3.253833e-015 + 8.798783e-012 + 2.162735e-009 + 9.999127e-001 + 9.999620e-001 + 1.000032e+000 + 2.576127e-010 + 1.000079e+000 + 3.999917e+000 + 1.428613e-009 + 1.000097e+000 + 4.000156e+000 + 4.000056e+000 + 4.945256e-009 + 3.999874e+000 + 5.224977e-009 + 9.999211e-001 + 1.600016e+001 + 9.999920e-001 + 2.479701e-009 + 4.000118e+000 + 4.000232e+000 + 1.000066e+000 + 3.999937e+000 + 9.999494e-001 + 2.529629e-009 + 9.000109e+000 + 9.144733e-011 + 9.999189e-001 + 3.999792e+000 + 4.000129e+000 + 1.403827e-010 + 9.000221e+000 + 3.210989e-009 + 1.000029e+000 + 4.747124e-012 + 6.479086e-009 + 3.015828e-010 + 8.999996e+000 + 1.000025e+000 + 9.999679e-001 + 1.599998e+001 + 1.000120e+000 + 1.000019e+000 + 7.580186e-009 + 9.999580e-001 + 6.523936e-010 + 4.921561e-010 + 1.000076e+000 + 9.999892e-001 + 3.157916e-010 + 7.206449e-011 + 1.000060e+000 + 8.878714e-010 + 9.674417e-011 + 9.999245e-001 + 1.599997e+001 + 1.020401e-008 + 1.000024e+000 + 9.999531e-001 + 2.140914e-009 + 2.492797e-009 + 4.164764e-010 + 2.639716e-011 + 9.999659e-001 + 1.000036e+000 + 1.518817e-010 + 1.455529e-009 + 1.599929e+001 + 1.703627e-009 + 9.999575e-001 + 6.485821e-011 + 1.145721e-010 + 1.825571e-010 + 1.184642e-008 + 4.000029e+000 + 3.451062e-009 + 4.457724e-011 + 9.999002e-001 + 2.377650e-010 + 1.599986e+001 + 1.000021e+000 + 1.000164e+000 + 9.000138e+000 + 1.278922e-011 + 1.000065e+000 + 8.999550e+000 + 1.000019e+000 + 1.899635e-010 + 4.555969e-013 + 4.597339e-010 + 3.886763e-010 + 3.999930e+000 + 9.999989e-001 + 1.287176e-010 + 8.999538e+000 + 7.845645e-010 + 4.120961e-009 + 8.999878e+000 + 5.323925e-010 + 1.153587e-008 + 1.043534e-009 + 1.915206e-010 + 1.000122e+000 + 7.396350e-009 + 3.999991e+000 + 9.999621e-001 + 1.000082e+000 + 1.510919e-009 + 1.000042e+000 + 8.999905e+000 + 3.999952e+000 + 9.998644e-001 + 9.000092e+000 + 1.325699e-009 + 7.700664e-011 + 4.284682e-010 + 9.999920e-001 + 9.998830e-001 + 3.999967e+000 + 9.999828e-001 + 1.000040e+000 + 1.599997e+001 + 1.000059e+000 + 1.000099e+000 + 1.600000e+001 + 4.000030e+000 + 1.000031e+000 + 4.000175e+000 + 1.654260e-009 + 2.162735e-009 + 8.999904e+000 + 1.788845e-009 + 2.570996e-010 + 1.599970e+001 + 2.823541e-011 + 9.999583e-001 + 9.999718e-001 + 3.999926e+000 + 1.000078e+000 + 5.224977e-009 + 4.000152e+000 + 9.999370e-001 + 4.000016e+000 + 9.595727e-010 + 3.986495e-010 + 3.355259e-009 + 5.078625e-011 + 1.000059e+000 + 6.395688e-010 + 1.000120e+000 + 9.999685e-001 + 1.600008e+001 + 4.000090e+000 + 9.999635e-001 + 9.999354e-001 + 2.705877e-010 + 9.998962e-001 + 1.599955e+001 + 9.928073e-010 + 9.999264e-001 + 6.479086e-009 + 1.487877e-010 + 1.000004e+000 + 3.999949e+000 + 1.591475e-009 + 1.000001e+000 + 3.620874e-009 + 9.999918e-001 + 7.498289e-012 + 4.402970e-010 + 1.687244e-009 + 1.000174e+000 + 3.999849e+000 + 4.519677e-009 + 4.921561e-010 + 1.600007e+001 + 1.042029e-009 + 3.157916e-010 + 9.674417e-011 + 3.999910e+000 + 8.878714e-010 + 1.020401e-008 + 4.000338e+000 + 1.331299e-011 + 2.140914e-009 + 2.177817e-009 + 5.507777e-010 + 2.639716e-011 + 1.000040e+000 + 4.164764e-010 + 1.518817e-010 + 9.999012e-001 + 3.156652e-010 + 1.600033e+001 + 1.521197e-008 + 7.958724e-009 + 1.599991e+001 + 3.999811e+000 + 1.000016e+000 + 5.416970e-011 + 1.286382e-009 + 9.997823e-001 + 2.491995e-009 + 3.999861e+000 + 9.999866e-001 + 3.999958e+000 + 4.374497e-010 + 3.155415e-010 + 1.599997e+001 + 3.999981e+000 + 9.999540e-001 + 3.999962e+000 + 4.000325e+000 + 1.000150e+000 + 1.599983e+001 + 5.856754e-009 + 1.000001e+000 + 4.000002e+000 + 1.007815e-009 + 9.999652e-001 + 8.999832e+000 + 1.538777e-010 + 1.000154e+000 + 1.600018e+001 + 3.999695e+000 + 1.000041e+000 + 8.999917e+000 + 3.999952e+000 + 9.999354e-001 + 4.562988e-012 + 1.012282e-009 + 7.396350e-009 + 8.999767e+000 + 2.375954e-011 + 1.663523e-009 + 1.423188e-010 + 4.000186e+000 + 1.000032e+000 + 8.999782e+000 + 1.897902e-009 + 9.999695e-001 + 1.608996e-011 + 2.475944e-009 + 4.284682e-010 + 4.000034e+000 + 3.508639e-009 + 9.999837e-001 + 3.999883e+000 + 3.999812e+000 + 1.097370e-011 + 5.523623e-011 + 1.000081e+000 + 3.253833e-015 + 1.599967e+001 + 1.000004e+000 + 1.000087e+000 + 1.600034e+001 + 2.714163e-009 + 1.000032e+000 + 9.000032e+000 + 4.000190e+000 + 1.428613e-009 + 1.000037e+000 + 9.999390e-001 + 1.989521e-010 + 1.434877e-009 + 3.999707e+000 + 9.998554e-001 + 1.599967e+001 + 1.539775e-009 + 1.401730e-010 + 9.000049e+000 + 9.550264e-010 + 9.994940e-010 + 1.537952e-010 + 1.870070e-012 + 1.000118e+000 + 1.000116e+000 + 1.000116e+000 + 1.000040e+000 + 1.599989e+001 + 9.998229e-001 + 9.999119e-001 + 1.000272e+000 + 1.877316e-009 + 1.000081e+000 + 9.999290e-001 + 9.999389e-001 + 9.999125e-001 + 3.993148e-010 + 9.999802e-001 + 1.000011e+000 + 1.397862e-009 + 3.999795e+000 + 9.998772e-001 + 4.000162e+000 + 2.239643e-009 + 3.879443e-009 + 2.881821e-009 + 3.662910e-010 + 1.000049e+000 + 8.999838e+000 + 9.166560e-010 + 9.999683e-001 + 1.600004e+001 + 2.946418e-009 + 9.999512e-001 + 3.044991e-011 + 6.378154e-012 + 2.210116e-009 + 4.706516e-010 + 3.999970e+000 + 1.444584e-010 + 8.762528e-011 + 1.000134e+000 + 9.047938e-011 + 2.123149e-010 + 3.999658e+000 + 9.999417e-001 + 3.500154e-009 + 2.197317e-009 + 6.322151e-011 + 1.908021e-009 + 9.999396e-001 + 8.657622e-010 + 8.999858e+000 + 3.999928e+000 + 1.734947e-009 + 1.600001e+001 + 3.999949e+000 + 3.427533e-009 + 4.722224e-010 + 9.999915e-001 + 4.452404e-010 + 4.974161e-009 + 1.000070e+000 + 1.469205e-009 + 2.164556e-009 + 9.999815e-001 + 1.000004e+000 + 1.621793e-009 + 3.371172e-010 + 1.174159e-009 + 8.999772e+000 + 9.999575e-001 + 1.000000e+000 + 4.309645e-009 + 4.000249e+000 + 1.000092e+000 + 1.850411e-009 + 3.735047e-010 + 9.999003e-001 + 1.773139e-009 + 4.000180e+000 + 9.999409e-001 + 6.938280e-010 + 4.000198e+000 + 9.999535e-001 + 1.000093e+000 + 1.264565e-009 + 9.999187e-001 + 1.000018e+000 + 1.000055e+000 + 1.044480e-008 + 1.206390e-009 + 9.998339e-001 + 1.057207e-008 + 3.428828e-010 + 1.668618e-010 + 1.000180e+000 + 5.960073e-011 + 2.455965e-009 + 2.656216e-009 + 2.091538e-013 + 4.000062e+000 + 1.000056e+000 + 1.600003e+001 + 3.999963e+000 + 1.000159e+000 + 4.588899e-009 + 4.231044e-009 + 9.998902e-001 + 1.599999e+001 + 3.999911e+000 + 9.999493e-001 + 1.599986e+001 + 6.685421e-011 + 1.000124e+000 + 1.297773e-009 + 1.992978e-010 + 1.000069e+000 + 3.999817e+000 + 2.228404e-010 + 1.417659e-010 + 1.599969e+001 + 2.987612e-009 + 1.681213e-009 + 9.550264e-010 + 9.999991e-001 + 9.999836e-001 + 8.999992e+000 + 3.618439e-010 + 9.999752e-001 + 3.999768e+000 + 3.999832e+000 + 3.356494e-009 + 7.842096e-009 + 2.939603e-009 + 1.889889e-010 + 1.877316e-009 + 3.953957e-010 + 1.849316e-008 + 9.341151e-010 + 2.276468e-009 + 1.261558e-009 + 4.000040e+000 + 2.422408e-009 + 3.993148e-010 + 1.000102e+000 + 8.287338e-010 + 1.000075e+000 + 2.239643e-009 + 7.803814e-010 + 1.000081e+000 + 3.662910e-010 + 4.000024e+000 + 1.000107e+000 + 8.999818e+000 + 4.000022e+000 + 1.000054e+000 + 9.000326e+000 + 1.000005e+000 + 2.042509e-011 + 6.378154e-012 + 2.321448e-009 + 1.000011e+000 + 1.000015e+000 + 1.289526e-008 + 1.000043e+000 + 3.999732e+000 + 9.760627e-009 + 8.762528e-011 + 7.319999e-009 + 4.000057e+000 + 9.999709e-001 + 2.197317e-009 + 3.999909e+000 + 3.500154e-009 + 4.000121e+000 + 9.999869e-001 + 1.908021e-009 + 1.000036e+000 + 9.998997e-001 + 1.000047e+000 + 1.616758e-010 + 1.927772e-009 + 5.995182e-013 + 4.000017e+000 + 9.999932e-001 + 4.722224e-010 + 3.999860e+000 + 1.171604e-010 + 4.974161e-009 + 8.549285e-011 + 3.999868e+000 + 1.000093e+000 + 3.371172e-010 + 7.807127e-010 + 1.621793e-009 + 4.510861e-010 + 9.999738e-001 + 1.000076e+000 + 3.859676e-009 + 2.780045e-009 + 9.998687e-001 + 3.735047e-010 + 3.999928e+000 + 9.999140e-001 + 9.999100e-001 + 1.000022e+000 + 9.999158e-001 + 2.453493e-009 + 3.999674e+000 + 9.999473e-001 + 1.264565e-009 + 4.000326e+000 + 2.166400e-009 + 7.482920e-010 + 2.079638e-009 + 7.876731e-011 + 4.000332e+000 + 9.999856e-001 + 1.206390e-009 + 9.000078e+000 + 3.999673e+000 + 3.428828e-010 + 2.455965e-009 + 7.053021e-010 + 5.960073e-011 + 2.365553e-010 + 3.432256e-010 + 2.091538e-013 + 8.749528e-011 + 5.067230e-009 + 1.119749e-011 + 4.231044e-009 + 7.763287e-009 + 1.000135e+000 + 1.000044e+000 + 4.186616e-009 + 1.894622e-012 + 1.599993e+001 + 3.999808e+000 + 2.890205e-010 + 9.000085e+000 + 4.000192e+000 + 1.297773e-009 + 1.600012e+001 + 4.000173e+000 + 9.999083e-001 + 9.000328e+000 + 5.624729e-010 + 1.539775e-009 + 4.000002e+000 + 1.298858e-008 + 9.550264e-010 + 3.618439e-010 + 1.036312e-009 + 1.000003e+000 + 1.772224e-009 + 5.328870e-010 + 9.998841e-001 + 9.000325e+000 + 1.645337e-009 + 1.000177e+000 + 3.953957e-010 + 4.000341e+000 + 1.000087e+000 + 2.276468e-009 + 3.715136e-010 + 1.000061e+000 + 8.999705e+000 + 1.252981e-009 + 1.000020e+000 + 8.287338e-010 + 9.999761e-001 + 2.617466e-009 + 7.803814e-010 + 1.000117e+000 + 9.999054e-001 + 3.649735e-011 + 4.000084e+000 + 3.662910e-010 + 9.999890e-001 + 2.956660e-012 + 1.000061e+000 + 3.999989e+000 + 9.999275e-001 + 9.998914e-001 + 9.000289e+000 + 5.087659e-010 + 6.378154e-012 + 1.600091e+001 + 6.205302e-010 + 5.725039e-011 + 8.999407e+000 + 1.000003e+000 + 9.998662e-001 + 9.999716e-001 + 4.000268e+000 + 7.319999e-009 + 5.181275e-010 + 3.999673e+000 + 2.197317e-009 + 4.000026e+000 + 1.400024e-009 + 1.000060e+000 + 2.516110e-009 + 3.999990e+000 + 3.254522e-010 + 1.599965e+001 + 3.999794e+000 + 1.616758e-010 + 1.163495e-011 + 1.843820e-009 + 1.000009e+000 + 8.999935e+000 + 6.482269e-010 + 9.999300e-001 + 1.091430e-009 + 1.000039e+000 + 1.000018e+000 + 7.807127e-010 + 1.000028e+000 + 1.000037e+000 + 4.000052e+000 + 3.999748e+000 + 1.000042e+000 + 9.000316e+000 + 9.999264e-001 + 3.859676e-009 + 1.000036e+000 + 3.999978e+000 + 3.735047e-010 + 1.212637e-010 + 4.000268e+000 + 2.023809e-009 + 6.637556e-009 + 3.999945e+000 + 2.453493e-009 + 9.998368e-001 + 3.077668e-010 + 1.000071e+000 + 2.079638e-009 + 5.160090e-012 + 9.999453e-001 + 5.153250e-011 + 1.650332e-009 + 1.000166e+000 + 6.668726e-009 + 1.472456e-009 + 9.999742e-001 + 7.053021e-010 + 4.182188e-009 + 2.455965e-009 + 1.600015e+001 + 4.000239e+000 + 2.365553e-010 + 9.000427e+000 + 9.999511e-001 + 8.749528e-011 + 7.763287e-009 + 2.608152e-009 + 4.231044e-009 + 9.000388e+000 + 3.999959e+000 + 4.946344e-010 + 1.000096e+000 + 4.000026e+000 + 6.685421e-011 + 2.311038e-009 + 9.999505e-001 + 9.999718e-001 + 1.864434e-009 + 9.999898e-001 + 2.228404e-010 + 5.624729e-010 + 2.582210e-009 + 9.998907e-001 + 1.600091e+001 + 8.533759e-011 + 1.000001e+000 + 8.999807e+000 + 5.886359e-009 + 3.618439e-010 + 1.599982e+001 + 1.740170e-010 + 1.772224e-009 + 1.645337e-009 + 1.000031e+000 + 9.998916e-001 + 9.998295e-001 + 9.999586e-001 + 1.000040e+000 + 8.999884e+000 + 3.914248e-010 + 2.276468e-009 + 1.599972e+001 + 4.000044e+000 + 1.000098e+000 + 4.000048e+000 + 1.298156e-011 + 9.999424e-001 + 3.999766e+000 + 4.000202e+000 + 7.803814e-010 + 4.421944e-010 + 6.026414e-009 + 3.649735e-011 + 9.000010e+000 + 3.999878e+000 + 3.019008e-011 + 4.000145e+000 + 8.381198e-010 + 9.999946e-001 + 5.087659e-010 + 1.201028e-010 + 9.999036e-001 + 9.000149e+000 + 5.696614e-011 + 1.289526e-008 + 3.035181e-012 + 3.999666e+000 + 1.000198e+000 + 4.486513e-009 + 2.185332e-009 + 2.010561e-010 + 1.000163e+000 + 4.000009e+000 + 5.181275e-010 + 1.600030e+001 + 4.000220e+000 + 1.000013e+000 + 1.000005e+000 + 3.999821e+000 + 1.000100e+000 + 2.657420e-009 + 9.998250e-001 + 1.927772e-009 + 8.999742e+000 + 3.999923e+000 + 1.000007e+000 + 6.482269e-010 + 1.448654e-010 + 1.000022e+000 + 3.999923e+000 + 9.999509e-001 + 1.091430e-009 + 1.899033e-010 + 4.000190e+000 + 9.999441e-001 + 1.000126e+000 + 2.459714e-009 + 1.000026e+000 + 1.352660e-009 + 4.000004e+000 + 9.998946e-001 + 2.897881e-011 + 9.999024e-001 + 3.199871e-010 + 9.998660e-001 + 9.998883e-001 + 9.999780e-001 + 1.912325e-010 + 5.000394e-009 + 6.637556e-009 + 1.599986e+001 + 1.254336e-008 + 6.660420e-009 + 1.600002e+001 + 1.000007e+000 + 9.999088e-001 + 1.650332e-009 + 1.054714e-009 + 1.000014e+000 + 8.999770e+000 + 1.036145e-009 + 6.668726e-009 + 4.182188e-009 + 1.000057e+000 + 7.053021e-010 + 9.998805e-001 + 7.960048e-010 + 3.432256e-010 + 5.977672e-010 + 1.000059e+000 + 9.998576e-001 + 1.600041e+001 + 1.000158e+000 + 1.000176e+000 + 1.057751e-010 + 9.999940e-001 + 9.998706e-001 + 9.999871e-001 + 1.797476e-010 + 2.299408e-009 + 6.119154e-010 + 9.999410e-001 + 2.311038e-009 + 2.579994e-011 + 9.999506e-001 + 1.864434e-009 + 2.582210e-009 + 3.999953e+000 + 9.999526e-001 + 1.599993e+001 + 3.999874e+000 + 1.298858e-008 + 9.000460e+000 + 9.998818e-001 + 1.000064e+000 + 1.740170e-010 + 3.915220e-010 + 5.328870e-010 + 2.366706e-010 + 1.000088e+000 + 1.645337e-009 + 4.000083e+000 + 1.621261e-009 + 7.266720e-009 + 3.914248e-010 + 1.000088e+000 + 1.000039e+000 + 1.234501e-010 + 9.999887e-001 + 1.252981e-009 + 9.000022e+000 + 3.771936e-009 + 1.000024e+000 + 2.549074e-009 + 4.000249e+000 + 9.998832e-001 + 6.026414e-009 + 9.999508e-001 + 4.421944e-010 + 9.291553e-010 + 2.515421e-010 + 9.999966e-001 + 9.000174e+000 + 1.000049e+000 + 1.000072e+000 + 9.000066e+000 + 2.210116e-009 + 5.087659e-010 + 1.600006e+001 + 1.444584e-010 + 9.999502e-001 + 1.000167e+000 + 4.000038e+000 + 9.999965e-001 + 8.999720e+000 + 8.500439e-010 + 4.486513e-009 + 4.876113e-012 + 6.322151e-011 + 6.677083e-009 + 9.998902e-001 + 8.657622e-010 + 1.400024e-009 + 1.000090e+000 + 4.000167e+000 + 6.040083e-012 + 4.000350e+000 + 3.427533e-009 + 2.657420e-009 + 3.751241e-010 + 4.452404e-010 + 1.000086e+000 + 8.999928e+000 + 1.469205e-009 + 6.482269e-010 + 4.000098e+000 + 4.066486e-012 + 9.999614e-001 + 2.260313e-009 + 1.174159e-009 + 9.999724e-001 + 1.600040e+001 + 1.013987e-014 + 3.971855e-009 + 9.999978e-001 + 2.115552e-009 + 1.000074e+000 + 2.383299e-009 + 2.485255e-009 + 2.897881e-011 + 3.121475e-009 + 1.000059e+000 + 4.486565e-009 + 5.000394e-009 + 5.402288e-010 + 1.912325e-010 + 1.599910e+001 + 1.653398e-009 + 3.077668e-010 + 3.999985e+000 + 1.044480e-008 + 5.160090e-012 + 8.999805e+000 + 1.057207e-008 + 1.650332e-009 + 1.599974e+001 + 8.080255e-009 + 1.000077e+000 + 7.993694e-010 + 2.656216e-009 + 4.182188e-009 + 8.999831e+000 + 9.999438e-001 + 3.569574e-009 + 8.616578e-010 + 6.288674e-009 + 1.000049e+000 + 6.253958e-009 + 3.016535e-009 + 2.608152e-009 + 8.866043e-012 + 1.000051e+000 + 1.057751e-010 + 1.797476e-010 + 3.868250e-009 + 4.135671e-011 + 8.688403e-010 + 1.175097e-009 + 1.000049e+000 + 6.110383e-010 + 3.999952e+000 + 1.000010e+000 + 1.000024e+000 + 1.681213e-009 + 2.582210e-009 + 1.000063e+000 + 6.740440e-011 + 8.533759e-011 + 3.493650e-009 + 1.000025e+000 + 9.998466e-001 + 8.999881e+000 + 3.999768e+000 + 1.740170e-010 + 1.938702e-009 + 1.889889e-010 + 9.999692e-001 + 8.999758e+000 + 3.999456e+000 + 1.000041e+000 + 1.914142e-009 + 4.000142e+000 + 3.914248e-010 + 3.197357e-011 + 3.993148e-010 + 1.234501e-010 + 9.000369e+000 + 9.999252e-001 + 9.999928e-001 + 9.998754e-001 + 9.999189e-001 + 2.549074e-009 + 4.000098e+000 + 2.881821e-009 + 6.026414e-009 + 9.000095e+000 + 7.312300e-010 + 9.291553e-010 + 3.999902e+000 + 2.042509e-011 + 9.999421e-001 + 1.599962e+001 + 9.999890e-001 + 9.999781e-001 + 1.444584e-010 + 9.999566e-001 + 5.696614e-011 + 9.047938e-011 + 8.762528e-011 + 6.952657e-009 + 9.000175e+000 + 2.123149e-010 + 1.000093e+000 + 6.322151e-011 + 4.000237e+000 + 4.876113e-012 + 8.657622e-010 + 4.000175e+000 + 3.012013e-009 + 9.999167e-001 + 5.625610e-010 + 2.010136e-009 + 3.427533e-009 + 5.995182e-013 + 1.000175e+000 + 4.452404e-010 + 4.000087e+000 + 3.751241e-010 + 1.599969e+001 + 3.999718e+000 + 1.000024e+000 + 8.999988e+000 + 9.999070e-001 + 1.000049e+000 + 1.174159e-009 + 1.621793e-009 + 2.260313e-009 + 1.013987e-014 + 1.438616e-009 + 2.459714e-009 + 8.999724e+000 + 4.309645e-009 + 1.251607e-012 + 9.000299e+000 + 1.000086e+000 + 1.000098e+000 + 3.999882e+000 + 1.773139e-009 + 1.000112e+000 + 5.402288e-010 + 6.938280e-010 + 5.000394e-009 + 1.653398e-009 + 3.999814e+000 + 1.254336e-008 + 1.044480e-008 + 3.999964e+000 + 9.999927e-001 + 1.600082e+001 + 4.000139e+000 + 1.000065e+000 + 8.999461e+000 + 4.000074e+000 + 1.036145e-009 + 2.656216e-009 + 4.000031e+000 + 9.999435e-001 + 7.899062e-010 + 2.091538e-013 + 1.000056e+000 + 6.288674e-009 + 1.119749e-011 + 9.999413e-001 + 3.016535e-009 + 9.998645e-001 + 9.998418e-001 + 6.433987e-010 + 1.894622e-012 + 1.000006e+000 + 8.999627e+000 + 2.890205e-010 + 1.797476e-010 + 8.999794e+000 + 1.297773e-009 + 1.000059e+000 + 1.000024e+000 + 1.000092e+000 + 1.000049e+000 + 1.600005e+001 + 1.612616e-012 + 1.520492e-009 + 2.213027e-009 + 2.376758e-009 + 1.277441e-009 + 1.000073e+000 + 7.375784e-009 + 5.491827e-010 + 9.998954e-001 + 4.000460e+000 + 4.877041e-009 + 4.200746e-009 + 1.000027e+000 + 9.998940e-001 + 2.758260e-009 + 4.000223e+000 + 1.486875e-009 + 4.000133e+000 + 6.016489e-009 + 9.998998e-001 + 8.999984e+000 + 9.999648e-001 + 1.000009e+000 + 1.051726e-010 + 5.173022e-012 + 9.999655e-001 + 1.000040e+000 + 3.397818e-009 + 1.000067e+000 + 1.600082e+001 + 1.999539e-010 + 3.245067e-012 + 6.986664e-009 + 1.003797e-008 + 5.250084e-009 + 1.600011e+001 + 3.999870e+000 + 1.881223e-009 + 4.000274e+000 + 9.999948e-001 + 3.751713e-012 + 4.213157e-010 + 5.519023e-010 + 4.245897e-010 + 1.106726e-010 + 2.162289e-009 + 1.790524e-009 + 3.999929e+000 + 4.000178e+000 + 9.998603e-001 + 1.199772e-009 + 9.647783e-012 + 1.000090e+000 + 9.000081e+000 + 9.999139e-001 + 1.770447e-010 + 1.600067e+001 + 4.068450e-010 + 9.999832e-001 + 9.999887e-001 + 5.890276e-010 + 9.998729e-001 + 1.035382e-009 + 4.010254e-010 + 1.954293e-009 + 1.599992e+001 + 1.000026e+000 + 9.999855e-001 + 1.124570e-009 + 3.999996e+000 + 9.999129e-001 + 4.000172e+000 + 3.999983e+000 + 9.998418e-001 + 4.171312e-010 + 8.964423e-010 + 1.000087e+000 + 9.998666e-001 + 5.369986e-009 + 1.000020e+000 + 1.600025e+001 + 3.999834e+000 + 9.998885e-001 + 8.999674e+000 + 1.459908e-009 + 9.998814e-001 + 1.031990e-009 + 5.529731e-009 + 9.999325e-001 + 7.936984e-010 + 4.000351e+000 + 4.588059e-010 + 2.106504e-010 + 1.407913e-011 + 1.000005e+000 + 1.000021e+000 + 9.998932e-001 + 1.000074e+000 + 5.971092e-010 + 1.082545e-009 + 2.452694e-010 + 1.000047e+000 + 9.999791e-001 + 4.228513e-009 + 3.662022e-010 + 1.086280e-009 + 8.668027e-011 + 6.563198e-011 + 1.000189e+000 + 1.000152e+000 + 1.599995e+001 + 3.518992e-011 + 9.999740e-001 + 9.827176e-009 + 7.268543e-011 + 1.144758e-010 + 8.999918e+000 + 9.999139e-001 + 1.000037e+000 + 1.000007e+000 + 4.000047e+000 + 1.000090e+000 + 9.999433e-001 + 2.059870e-009 + 6.158991e-010 + 9.000008e+000 + 1.000055e+000 + 4.629908e-011 + 1.600039e+001 + 2.595259e-012 + 2.213027e-009 + 7.375784e-009 + 3.632364e-009 + 1.325941e-009 + 9.997702e-001 + 3.038869e-010 + 2.733332e-009 + 1.873227e-010 + 4.000136e+000 + 4.200746e-009 + 9.998885e-001 + 1.000095e+000 + 1.000105e+000 + 6.016489e-009 + 9.999511e-001 + 1.000067e+000 + 3.089529e-010 + 6.309062e-009 + 1.000005e+000 + 5.173022e-012 + 7.098781e-010 + 9.999795e-001 + 8.999650e+000 + 5.315459e-009 + 4.088778e-010 + 1.999539e-010 + 2.527880e-010 + 1.048953e-008 + 1.599920e+001 + 1.000068e+000 + 1.000167e+000 + 1.000065e+000 + 1.586634e-010 + 1.840601e-010 + 4.000010e+000 + 9.999881e-001 + 1.000137e+000 + 1.600019e+001 + 2.985989e-012 + 4.213157e-010 + 8.999721e+000 + 3.934974e-010 + 9.999790e-001 + 9.999111e-001 + 1.000067e+000 + 9.999647e-001 + 9.647783e-012 + 1.000074e+000 + 9.999307e-001 + 4.000172e+000 + 2.476985e-009 + 9.999730e-001 + 1.600016e+001 + 3.105668e-009 + 7.107533e-009 + 1.599981e+001 + 1.000030e+000 + 3.207534e-011 + 8.999880e+000 + 1.345803e-009 + 1.035382e-009 + 3.999947e+000 + 4.442827e-011 + 1.025063e-010 + 1.000002e+000 + 7.934442e-010 + 1.000067e+000 + 1.000009e+000 + 3.531399e-009 + 1.000086e+000 + 8.964423e-010 + 1.153649e-009 + 9.999592e-001 + 5.369986e-009 + 8.003009e-010 + 4.450734e-009 + 1.000083e+000 + 1.985316e-009 + 9.600516e-010 + 1.459908e-009 + 3.999802e+000 + 1.000109e+000 + 5.529731e-009 + 4.173602e-011 + 1.031990e-009 + 7.716829e-009 + 1.577620e-009 + 7.936984e-010 + 1.407913e-011 + 6.221651e-011 + 2.106504e-010 + 4.000214e+000 + 9.998974e-001 + 1.073739e-010 + 1.082545e-009 + 4.000102e+000 + 1.000049e+000 + 4.000042e+000 + 1.701094e-010 + 5.602222e-010 + 1.086280e-009 + 3.999998e+000 + 1.000038e+000 + 3.999622e+000 + 3.999983e+000 + 6.563198e-011 + 3.518992e-011 + 3.999854e+000 + 4.068478e-011 + 7.268543e-011 + 3.999888e+000 + 1.000198e+000 + 1.851912e-009 + 2.885325e-009 + 1.000027e+000 + 1.379938e-010 + 9.999852e-001 + 1.395697e-011 + 2.059870e-009 + 4.000207e+000 + 8.031745e-010 + 3.999889e+000 + 9.152036e-010 + 9.999975e-001 + 1.599999e+001 + 5.466758e-010 + 2.376758e-009 + 1.599952e+001 + 9.999878e-001 + 9.998282e-001 + 1.600014e+001 + 3.999887e+000 + 1.320158e-008 + 9.999318e-001 + 1.000089e+000 + 9.999726e-001 + 3.999810e+000 + 3.999758e+000 + 3.106767e-009 + 5.979710e-010 + 4.000177e+000 + 9.998449e-001 + 6.309062e-009 + 3.999760e+000 + 1.000035e+000 + 7.098781e-010 + 2.315705e-009 + 1.000005e+000 + 8.999563e+000 + 9.999581e-001 + 1.000117e+000 + 1.600013e+001 + 1.600337e-009 + 1.999539e-010 + 1.162769e-009 + 1.000127e+000 + 1.003797e-008 + 1.600010e+001 + 4.000094e+000 + 1.062710e-009 + 4.000024e+000 + 6.328811e-009 + 1.000005e+000 + 2.985989e-012 + 3.999654e+000 + 5.519023e-010 + 3.934974e-010 + 1.000016e+000 + 1.000093e+000 + 1.126459e-009 + 6.307938e-009 + 1.976681e-009 + 3.999852e+000 + 1.000091e+000 + 9.999938e-001 + 2.476985e-009 + 1.000068e+000 + 1.000086e+000 + 3.105668e-009 + 3.999830e+000 + 4.068450e-010 + 2.224946e-010 + 3.705936e-009 + 5.890276e-010 + 1.345803e-009 + 1.237372e-009 + 1.000040e+000 + 4.442827e-011 + 9.999307e-001 + 9.999737e-001 + 1.600023e+001 + 4.739289e-010 + 1.050055e-012 + 3.531399e-009 + 1.000007e+000 + 1.893239e-011 + 1.599973e+001 + 1.000012e+000 + 8.964423e-010 + 8.003009e-010 + 1.687485e-009 + 5.369986e-009 + 1.985316e-009 + 3.999929e+000 + 1.715065e-009 + 2.449584e-009 + 1.000013e+000 + 9.999236e-001 + 1.599995e+001 + 1.925011e-010 + 5.529731e-009 + 1.577620e-009 + 1.000031e+000 + 7.716829e-009 + 6.221651e-011 + 4.464780e-009 + 1.407913e-011 + 4.000205e+000 + 7.344559e-011 + 1.000107e+000 + 9.999491e-001 + 1.500405e-009 + 1.082545e-009 + 1.599990e+001 + 4.000336e+000 + 1.000021e+000 + 3.181293e-013 + 4.000195e+000 + 1.086280e-009 + 1.909235e-011 + 4.000067e+000 + 9.998112e-001 + 1.337029e-009 + 2.363952e-009 + 9.999881e-001 + 7.836575e-010 + 4.621635e-009 + 9.999829e-001 + 1.599957e+001 + 1.075262e-009 + 1.000086e+000 + 5.506764e-011 + 3.999873e+000 + 1.379938e-010 + 9.998963e-001 + 1.475071e-009 + 2.059870e-009 + 9.152036e-010 + 9.999832e-001 + 9.999447e-001 + 1.600019e+001 + 4.000356e+000 + 2.595259e-012 + 4.000024e+000 + 1.000131e+000 + 3.632364e-009 + 1.000057e+000 + 4.399775e-011 + 3.038869e-010 + 3.999822e+000 + 7.414561e-010 + 1.161906e-009 + 3.656542e-009 + 9.400847e-010 + 9.999048e-001 + 1.953121e-009 + 5.925092e-011 + 1.000049e+000 + 1.000120e+000 + 1.000009e+000 + 6.309062e-009 + 9.000289e+000 + 8.296388e-012 + 1.000053e+000 + 4.383963e-010 + 9.501330e-011 + 1.000146e+000 + 9.000240e+000 + 1.000052e+000 + 2.527880e-010 + 4.049777e-009 + 1.382985e-010 + 9.999318e-001 + 9.999529e-001 + 2.028084e-009 + 1.586634e-010 + 6.328811e-009 + 3.999626e+000 + 1.000012e+000 + 1.000173e+000 + 3.999970e+000 + 9.999965e-001 + 6.798925e-011 + 1.428889e-009 + 3.934974e-010 + 1.600064e+001 + 9.998742e-001 + 9.999329e-001 + 2.057364e-009 + 8.333070e-009 + 9.999261e-001 + 1.159408e-009 + 4.000238e+000 + 9.999005e-001 + 1.000085e+000 + 1.141882e-009 + 3.105668e-009 + 9.000365e+000 + 1.000032e+000 + 9.999702e-001 + 1.599972e+001 + 3.999936e+000 + 1.000073e+000 + 4.000139e+000 + 1.179341e-009 + 4.442827e-011 + 4.739289e-010 + 8.391418e-010 + 7.934442e-010 + 1.222037e-011 + 4.997820e-009 + 3.531399e-009 + 3.999976e+000 + 1.504547e-009 + 1.153649e-009 + 1.600033e+001 + 1.000015e+000 + 8.003009e-010 + 3.154481e-010 + 5.313248e-009 + 1.985316e-009 + 3.999973e+000 + 1.000012e+000 + 2.449584e-009 + 1.925011e-010 + 9.999495e-001 + 4.173602e-011 + 2.384724e-010 + 4.943432e-010 + 1.000079e+000 + 4.464780e-009 + 9.998601e-001 + 9.999842e-001 + 7.344559e-011 + 1.113591e-010 + 1.000103e+000 + 1.600031e+001 + 1.291654e-010 + 6.489764e-010 + 7.054231e-009 + 3.999812e+000 + 1.701094e-010 + 9.999023e-001 + 4.070453e-009 + 3.181293e-013 + 2.781679e-010 + 1.000119e+000 + 1.909235e-011 + 2.363952e-009 + 4.000014e+000 + 1.337029e-009 + 8.999592e+000 + 4.000052e+000 + 7.836575e-010 + 1.599974e+001 + 4.159885e-018 + 2.885325e-009 + 1.000063e+000 + 4.000065e+000 + 1.000015e+000 + 1.475071e-009 + 6.221925e-009 + 2.687958e-009 + 4.000034e+000 + 1.520492e-009 + 9.152036e-010 + 7.917919e-009 + 1.277441e-009 + 5.466758e-010 + 4.319717e-009 + 5.491827e-010 + 1.000012e+000 + 4.399775e-011 + 4.000279e+000 + 8.046934e-010 + 1.600022e+001 + 1.000106e+000 + 9.999110e-001 + 9.400847e-010 + 3.999846e+000 + 3.656542e-009 + 5.925092e-011 + 2.511597e-009 + 1.953121e-009 + 1.939240e-011 + 9.999907e-001 + 3.605618e-009 + 8.296388e-012 + 1.000035e+000 + 9.999038e-001 + 8.999942e+000 + 9.999331e-001 + 1.000042e+000 + 6.717001e-010 + 3.245067e-012 + 9.999200e-001 + 1.382985e-010 + 5.250084e-009 + 9.998727e-001 + 1.600036e+001 + 4.000173e+000 + 5.536137e-010 + 8.749795e-009 + 3.999992e+000 + 6.328811e-009 + 5.512891e-011 + 3.999918e+000 + 7.463497e-009 + 1.599970e+001 + 1.790524e-009 + 9.999835e-001 + 3.957122e-009 + 1.000140e+000 + 6.307938e-009 + 8.333070e-009 + 2.027085e-009 + 9.999093e-001 + 3.545161e-009 + 4.000053e+000 + 9.999319e-001 + 1.141882e-009 + 1.000017e+000 + 1.797309e-009 + 2.598614e-010 + 1.000127e+000 + 9.998783e-001 + 2.587786e-010 + 3.999823e+000 + 1.237372e-009 + 1.179341e-009 + 5.246291e-011 + 1.000069e+000 + 8.999826e+000 + 1.896390e-009 + 1.000044e+000 + 4.997820e-009 + 1.000158e+000 + 9.999930e-001 + 8.999767e+000 + 9.999134e-001 + 9.999880e-001 + 3.999970e+000 + 9.629311e-011 + 1.687485e-009 + 5.313248e-009 + 3.109078e-009 + 3.154481e-010 + 3.518052e-011 + 1.000119e+000 + 9.999866e-001 + 4.000101e+000 + 1.000068e+000 + 1.925011e-010 + 4.943432e-010 + 4.588059e-010 + 9.999691e-001 + 4.895671e-009 + 9.999948e-001 + 4.464780e-009 + 1.113591e-010 + 9.999264e-001 + 9.999829e-001 + 8.999932e+000 + 2.452694e-010 + 1.500405e-009 + 1.000094e+000 + 4.000260e+000 + 7.054231e-009 + 9.000383e+000 + 8.668027e-011 + 2.385893e-009 + 3.537547e-009 + 9.998476e-001 + 2.781679e-010 + 1.177778e-011 + 1.694377e-010 + 2.363952e-009 + 1.660926e-010 + 3.999957e+000 + 1.000136e+000 + 1.600000e+001 + 3.339492e-010 + 1.075262e-009 + 9.999675e-001 + 9.999101e-001 + 1.005440e-009 + 1.599937e+001 + 6.158991e-010 + 1.000077e+000 + 1.520492e-009 + 4.629908e-011 + 1.000017e+000 + 1.600029e+001 + 4.000188e+000 + 7.917919e-009 + 1.599981e+001 + 3.999854e+000 + 9.998686e-001 + 4.877041e-009 + 4.000209e+000 + 1.000013e+000 + 3.999788e+000 + 4.200746e-009 + 7.414561e-010 + 1.486875e-009 + 9.998950e-001 + 9.400847e-010 + 9.000301e+000 + 9.999333e-001 + 9.999846e-001 + 4.000019e+000 + 6.908486e-012 + 9.999912e-001 + 2.978934e-010 + 1.051726e-010 + 9.999942e-001 + 4.000134e+000 + 3.999919e+000 + 1.000019e+000 + 3.245067e-012 + 1.048953e-008 + 9.999482e-001 + 1.599942e+001 + 9.998328e-001 + 9.999765e-001 + 1.881223e-009 + 1.840601e-010 + 2.028084e-009 + 1.000004e+000 + 9.998628e-001 + 8.749795e-009 + 4.245897e-010 + 4.213157e-010 + 5.512891e-011 + 1.600034e+001 + 1.106726e-010 + 1.428889e-009 + 4.878058e-009 + 1.000035e+000 + 1.000126e+000 + 8.999730e+000 + 1.000069e+000 + 8.333070e-009 + 9.999734e-001 + 1.819770e-010 + 3.545161e-009 + 7.073920e-011 + 7.107533e-009 + 1.141882e-009 + 4.041374e-009 + 4.000023e+000 + 9.999678e-001 + 1.000088e+000 + 1.035382e-009 + 2.587786e-010 + 5.246291e-011 + 1.025063e-010 + 9.999313e-001 + 9.000261e+000 + 1.124570e-009 + 1.000058e+000 + 6.256505e-009 + 9.999142e-001 + 9.998586e-001 + 4.000173e+000 + 4.171312e-010 + 1.000078e+000 Index: llvm-test/MultiSource/Applications/viterbi/test.c diff -u llvm-test/MultiSource/Applications/viterbi/test.c:1.3 llvm-test/MultiSource/Applications/viterbi/test.c:1.4 --- llvm-test/MultiSource/Applications/viterbi/test.c:1.3 Wed Oct 4 23:16:13 2006 +++ llvm-test/MultiSource/Applications/viterbi/test.c Thu May 3 13:18:17 2007 @@ -3,7 +3,11 @@ #include "common.h" +#ifdef SMALL_PROBLEM_SIZE +#define INPUT_FILE PROJ_SRC_DIR "/Dist_demux_small" +#else #define INPUT_FILE PROJ_SRC_DIR "/Dist_demux" +#endif size_t read_dmatrix(dvarray* out, const char* filename); void dec_viterbi_F(dvector* Metr_mem, unsigned char* history_mem, bitvector* bit_stream, From evan.cheng at apple.com Thu May 3 13:20:36 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 13:20:36 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/negative_zero.ll negatize_zero.ll Message-ID: <200705031820.l43IKa5g000744@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: negative_zero.ll added (r1.1) negatize_zero.ll (r1.4) removed --- Log message: negatize -> negative --- Diffs of the changes: (+6 -0) negative_zero.ll | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/test/CodeGen/X86/negative_zero.ll diff -c /dev/null llvm/test/CodeGen/X86/negative_zero.ll:1.1 *** /dev/null Thu May 3 13:20:27 2007 --- llvm/test/CodeGen/X86/negative_zero.ll Thu May 3 13:20:16 2007 *************** *** 0 **** --- 1,6 ---- + ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=-sse2,-sse3 | grep fchs + + + double %T() { + ret double -1.0 ;; codegen as fld1/fchs, not as a load from cst pool + } From clattner at apple.com Thu May 3 13:27:29 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 3 May 2007 11:27:29 -0700 Subject: [llvm-commits] Path ARM/ELF debug support In-Reply-To: <6fbb4ff20705030632u6e592348lb25914c7c4d8bdd1@mail.gmail.com> References: <6fbb4ff20705030632u6e592348lb25914c7c4d8bdd1@mail.gmail.com> Message-ID: <1B6CC27A-A8F0-4A68-A4C7-7D4356E3D5EB@apple.com> On May 3, 2007, at 6:32 AM, Raul Fernandes Herbster wrote: > This patch provides ARM/ELF debug support. Please, send me any > problem related to it. The patch looks great to me. Lauro, will you please commit it? -Chris > Best regards, Raul Herbster. > > -- > Raul Fernandes Herbster > Embedded and Pervasive Computing Laboratory - embedded.dee.ufcg.edu.br > Electrical Engineering Department - DEE - www.ee.ufcg.edu.br > Electrical Engineering and Informatics Center - CEEI > Federal University of Campina Grande - UFCG - www.ufcg.edu.br > Caixa Postal 10105 > 58109-970 Campina Grande - PB - Brasil > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Thu May 3 13:32:28 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 13:32:28 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/STLExtras.h Message-ID: <200705031832.l43IWS2b000985@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: STLExtras.h updated: 1.21 -> 1.22 --- Log message: This is a patch to fix a compile error in STLExtras.h, and a bug in GraphWriter.cpp. Patch by Florian Brandner --- Diffs of the changes: (+1 -1) STLExtras.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/ADT/STLExtras.h diff -u llvm/include/llvm/ADT/STLExtras.h:1.21 llvm/include/llvm/ADT/STLExtras.h:1.22 --- llvm/include/llvm/ADT/STLExtras.h:1.21 Thu Apr 21 15:13:50 2005 +++ llvm/include/llvm/ADT/STLExtras.h Thu May 3 13:32:10 2007 @@ -71,7 +71,7 @@ typedef RootIt iterator_type; typedef mapped_iterator _Self; - inline RootIt &getCurrent() const { return current; } + inline const RootIt &getCurrent() const { return current; } inline explicit mapped_iterator(const RootIt &I, UnaryFunc F) : current(I), Fn(F) {} From sabre at nondot.org Thu May 3 13:32:33 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 13:32:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/GraphWriter.cpp Message-ID: <200705031832.l43IWXS1000992@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: GraphWriter.cpp updated: 1.8 -> 1.9 --- Log message: This is a patch to fix a compile error in STLExtras.h, and a bug in GraphWriter.cpp. Patch by Florian Brandner --- Diffs of the changes: (+1 -0) GraphWriter.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Support/GraphWriter.cpp diff -u llvm/lib/Support/GraphWriter.cpp:1.8 llvm/lib/Support/GraphWriter.cpp:1.9 --- llvm/lib/Support/GraphWriter.cpp:1.8 Fri Feb 16 13:11:06 2007 +++ llvm/lib/Support/GraphWriter.cpp Thu May 3 13:32:10 2007 @@ -70,6 +70,7 @@ sys::Path dotty(LLVM_PATH_DOTTY); std::vector args; + args.push_back(dotty.c_str()); args.push_back(Filename.c_str()); args.push_back(0); From clattner at apple.com Thu May 3 13:33:01 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 3 May 2007 11:33:01 -0700 Subject: [llvm-commits] minor bugs in STLExtras.h and GraphWriter.cpp In-Reply-To: <46385C02.5060509@mail.tuwien.ac.at> References: <46385C02.5060509@mail.tuwien.ac.at> Message-ID: <9B8CC73A-D43D-4E3B-9024-B575637832C9@apple.com> On May 2, 2007, at 2:38 AM, Florian Brandner wrote: > This is a patch to fix a compile error in STLExtras.h, and > a bug in GraphWriter.cpp. Looks great, applied! Thanks, http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of- Mon-20070430/048996.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of- Mon-20070430/048997.html -Chris From evan.cheng at apple.com Thu May 3 13:36:33 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 13:36:33 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ToolRunner.cpp ToolRunner.h Message-ID: <200705031836.l43IaXFF001081@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: ToolRunner.cpp updated: 1.61 -> 1.62 ToolRunner.h updated: 1.24 -> 1.25 --- Log message: Added -rsh-host and -rsh-user to support remote execution. --- Diffs of the changes: (+44 -6) ToolRunner.cpp | 46 +++++++++++++++++++++++++++++++++++++++++----- ToolRunner.h | 4 +++- 2 files changed, 44 insertions(+), 6 deletions(-) Index: llvm/tools/bugpoint/ToolRunner.cpp diff -u llvm/tools/bugpoint/ToolRunner.cpp:1.61 llvm/tools/bugpoint/ToolRunner.cpp:1.62 --- llvm/tools/bugpoint/ToolRunner.cpp:1.61 Fri Feb 16 13:11:07 2007 +++ llvm/tools/bugpoint/ToolRunner.cpp Thu May 3 13:36:15 2007 @@ -15,6 +15,7 @@ #include "ToolRunner.h" #include "llvm/Config/config.h" // for HAVE_LINK_R #include "llvm/System/Program.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/FileUtilities.h" #include @@ -22,6 +23,16 @@ #include using namespace llvm; +namespace { + cl::opt + RSHHost("rsh-host", + cl::desc("Remote execution (rsh) host")); + + cl::opt + RSHUser("rsh-user", + cl::desc("Remote execution (rsh) user id")); +} + ToolExecutionError::~ToolExecutionError() throw() { } /// RunProgramWithTimeout - This function provides an alternate interface to the @@ -482,7 +493,22 @@ std::vector ProgramArgs; - ProgramArgs.push_back(OutputBinary.c_str()); + if (RSHPath.isEmpty()) + ProgramArgs.push_back(OutputBinary.c_str()); + else { + ProgramArgs.push_back(RSHPath.c_str()); + ProgramArgs.push_back(RSHHost.c_str()); + ProgramArgs.push_back("-l"); + ProgramArgs.push_back(RSHUser.c_str()); + + char* env_pwd = getenv("PWD"); + std::string Exec = "cd "; + Exec += env_pwd; + Exec += "; ./"; + Exec += OutputBinary.c_str(); + ProgramArgs.push_back(Exec.c_str()); + } + // Add optional parameters to the running program from Argv for (unsigned i=0, e = Args.size(); i != e; ++i) ProgramArgs.push_back(Args[i].c_str()); @@ -497,9 +523,15 @@ ); FileRemover OutputBinaryRemover(OutputBinary); - return RunProgramWithTimeout(OutputBinary, &ProgramArgs[0], - sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), - Timeout, MemoryLimit); + + if (RSHPath.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], + sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), + Timeout, MemoryLimit); } int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, @@ -583,6 +615,10 @@ return 0; } + sys::Path RSHPath; + if (!RSHHost.empty()) + RSHPath = FindExecutable("rsh", ProgramPath); + Message = "Found gcc: " + GCCPath.toString() + "\n"; - return new GCC(GCCPath); + return new GCC(GCCPath, RSHPath); } Index: llvm/tools/bugpoint/ToolRunner.h diff -u llvm/tools/bugpoint/ToolRunner.h:1.24 llvm/tools/bugpoint/ToolRunner.h:1.25 --- llvm/tools/bugpoint/ToolRunner.h:1.24 Fri Feb 16 13:11:07 2007 +++ llvm/tools/bugpoint/ToolRunner.h Thu May 3 13:36:15 2007 @@ -44,7 +44,9 @@ // class GCC { sys::Path GCCPath; // The path to the gcc executable - GCC(const sys::Path &gccPath) : GCCPath(gccPath) { } + sys::Path RSHPath; // The path to the rsh executable + GCC(const sys::Path &gccPath, const sys::Path &rshPath) + : GCCPath(gccPath), RSHPath(rshPath) { } public: enum FileType { AsmFile, CFile }; From baldrick at free.fr Thu May 3 13:39:13 2007 From: baldrick at free.fr (Duncan Sands) Date: Thu, 3 May 2007 20:39:13 +0200 Subject: [llvm-commits] Handle constant folded bitcasts in eh lowering Message-ID: <200705032039.14139.baldrick@free.fr> The eh_selector, eh_filter and eh_typeid_for intrinsics take arguments that should be a global variable or a bitcast of a global variable. A bitcast of a global variable can be constant folded to a GEP in some cases, causing the current code to assert. The attached patch fixes this. Best wishes, Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: eh_typeid.diff Type: text/x-diff Size: 3558 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070503/3bbe9c75/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: testcase.diff Type: text/x-diff Size: 717 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070503/3bbe9c75/attachment-0001.bin From djg at cray.com Thu May 3 13:45:26 2007 From: djg at cray.com (Dan Gohman) Date: Thu, 3 May 2007 13:45:26 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/ScalarEvolution.h Message-ID: <200705031845.l43IjQdA001273@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: ScalarEvolution.h updated: 1.19 -> 1.20 --- Log message: Use the explicit keyword for the SCEV class' constructor. --- Diffs of the changes: (+1 -1) ScalarEvolution.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Analysis/ScalarEvolution.h diff -u llvm/include/llvm/Analysis/ScalarEvolution.h:1.19 llvm/include/llvm/Analysis/ScalarEvolution.h:1.20 --- llvm/include/llvm/Analysis/ScalarEvolution.h:1.19 Wed May 2 20:11:53 2007 +++ llvm/include/llvm/Analysis/ScalarEvolution.h Thu May 3 13:45:06 2007 @@ -54,7 +54,7 @@ protected: virtual ~SCEV(); public: - SCEV(unsigned SCEVTy) : SCEVType(SCEVTy), RefCount(0) {} + explicit SCEV(unsigned SCEVTy) : SCEVType(SCEVTy), RefCount(0) {} /// getNegativeSCEV - Return the SCEV object corresponding to -V. /// From djg at cray.com Thu May 3 13:46:49 2007 From: djg at cray.com (Dan Gohman) Date: Thu, 3 May 2007 13:46:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetAsmInfo.cpp Message-ID: <200705031846.l43IknhE001308@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetAsmInfo.cpp updated: 1.25 -> 1.26 --- Log message: Indent the .text, .data, and .bss directives in assembly output, so that they are consistent with the other directives. --- Diffs of the changes: (+3 -3) TargetAsmInfo.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Target/TargetAsmInfo.cpp diff -u llvm/lib/Target/TargetAsmInfo.cpp:1.25 llvm/lib/Target/TargetAsmInfo.cpp:1.26 --- llvm/lib/Target/TargetAsmInfo.cpp:1.25 Tue May 1 17:23:12 2007 +++ llvm/lib/Target/TargetAsmInfo.cpp Thu May 3 13:46:30 2007 @@ -19,9 +19,9 @@ using namespace llvm; TargetAsmInfo::TargetAsmInfo() : - TextSection(".text"), - DataSection(".data"), - BSSSection(".bss"), + TextSection("\t.text"), + DataSection("\t.data"), + BSSSection("\t.bss"), TLSDataSection("\t.section .tdata,\"awT\", at progbits"), TLSBSSSection("\t.section .tbss,\"awT\", at nobits"), ZeroFillDirective(0), From sabre at nondot.org Thu May 3 13:58:27 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 13:58:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705031858.l43IwR8a001656@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.24 -> 1.25 --- Log message: add a few more instructions, getting close --- Diffs of the changes: (+53 -10) BitcodeReader.cpp | 63 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 53 insertions(+), 10 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.24 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.25 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.24 Wed May 2 00:46:45 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 13:58:09 2007 @@ -1178,7 +1178,8 @@ if (Record.size() == 2) { const Type *OpTy = getTypeByID(Record[0]); Value *Op = getFnValueByID(Record[1], OpTy); - if (OpTy && Op); + if (!OpTy || !Op) + return Error("Invalid RET record"); I = new ReturnInst(Op); break; } @@ -1276,16 +1277,58 @@ case bitc::FUNC_CODE_INST_UNREACHABLE: // UNREACHABLE I = new UnreachableInst(); break; + case bitc::FUNC_CODE_INST_PHI: { // PHI: [ty, #ops, val0,bb0, ...] + if (Record.size() < 2 || Record.size() < 2+Record[1] || (Record[1]&1)) + return Error("Invalid PHI record"); + const Type *Ty = getTypeByID(Record[0]); + if (!Ty) return Error("Invalid PHI record"); + + PHINode *PN = new PHINode(Ty); + PN->reserveOperandSpace(Record[1]); + + for (unsigned i = 0, e = Record[1]; i != e; i += 2) { + Value *V = getFnValueByID(Record[2+i], Ty); + BasicBlock *BB = getBasicBlock(Record[3+i]); + if (!V || !BB) return Error("Invalid PHI record"); + PN->addIncoming(V, BB); + } + I = PN; + break; + } + + case bitc::FUNC_CODE_INST_MALLOC: { // MALLOC: [instty, op, align] + if (Record.size() < 3) + return Error("Invalid MALLOC record"); + const PointerType *Ty = + dyn_cast_or_null(getTypeByID(Record[0])); + Value *Size = getFnValueByID(Record[1], Type::Int32Ty); + unsigned Align = Record[2]; + if (!Ty || !Size) return Error("Invalid MALLOC record"); + I = new MallocInst(Ty->getElementType(), Size, (1 << Align) >> 1); + break; + } + case bitc::FUNC_CODE_INST_FREE: { // FREE: [opty, op] + if (Record.size() < 2) + return Error("Invalid FREE record"); + const Type *OpTy = getTypeByID(Record[0]); + Value *Op = getFnValueByID(Record[1], OpTy); + if (!OpTy || !Op) + return Error("Invalid FREE record"); + I = new FreeInst(Op); + break; + } + case bitc::FUNC_CODE_INST_ALLOCA: { // ALLOCA: [instty, op, align] + if (Record.size() < 3) + return Error("Invalid ALLOCA record"); + const PointerType *Ty = + dyn_cast_or_null(getTypeByID(Record[0])); + Value *Size = getFnValueByID(Record[1], Type::Int32Ty); + unsigned Align = Record[2]; + if (!Ty || !Size) return Error("Invalid ALLOCA record"); + I = new AllocaInst(Ty->getElementType(), Size, (1 << Align) >> 1); + break; + } #if 0 - - case bitc::FUNC_CODE_INST_PHI: - // PHI: [ty, #ops, val0,bb0, ...] - case bitc::FUNC_CODE_INST_MALLOC: - // MALLOC: [instty, op, align] - case bitc::FUNC_CODE_INST_FREE: - // FREE: [opty, op] - case bitc::FUNC_CODE_INST_ALLOCA: - // ALLOCA: [instty, op, align] case bitc::FUNC_CODE_INST_LOAD: // LOAD: [opty, op, align, vol] case bitc::FUNC_CODE_INST_STORE: From reid at x10sys.com Thu May 3 14:12:03 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 3 May 2007 14:12:03 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200705031912.l43JC3wp002057@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.117 -> 1.118 --- Log message: Add Tomas Evensen. --- Diffs of the changes: (+4 -3) DevMtgMay2007.html | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.117 llvm-www/DevMtgMay2007.html:1.118 --- llvm-www/DevMtgMay2007.html:1.117 Thu May 3 06:16:53 2007 +++ llvm-www/DevMtgMay2007.html Thu May 3 14:11:45 2007 @@ -300,6 +300,7 @@ Jeff CohenIndependent John CriswellUIUC Mike EnglerAdobe Systems Incorporated. + Tomas EvensenWind River Han GaoAdobe Systems Incorporated. Dan GohmanCray Inc. Stuart HastingsApple Inc. @@ -312,13 +313,13 @@ Nick LewyckyIndependent Efrem LipkinCoDesign Gabe McArthurIndependent - Paul McJonesAdobe Systems Incorporated. + @@ -343,7 +344,7 @@
Confirmed Attendees
NameOrganization
Paul McJonesAdobe Systems Incorporated.
Scott MichelAerospace
Alireza MoshtaghiMicrochip Technology
Robert MyklandAscenium Corp.
-

Total confirmed: 41

+

Total confirmed: 42

@@ -363,6 +364,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
Last modified: $Date: 2007/05/03 11:16:53 $ +
Last modified: $Date: 2007/05/03 19:11:45 $ From lauro.venancio at gmail.com Thu May 3 15:06:45 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 15:06:45 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/CoyoteBench/lpbench.c Message-ID: <200705032006.l43K6jo7003161@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Benchmarks/CoyoteBench: lpbench.c updated: 1.1 -> 1.2 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+6 -0) lpbench.c | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm-test/SingleSource/Benchmarks/CoyoteBench/lpbench.c diff -u llvm-test/SingleSource/Benchmarks/CoyoteBench/lpbench.c:1.1 llvm-test/SingleSource/Benchmarks/CoyoteBench/lpbench.c:1.2 --- llvm-test/SingleSource/Benchmarks/CoyoteBench/lpbench.c:1.1 Sat Mar 4 16:35:18 2006 +++ llvm-test/SingleSource/Benchmarks/CoyoteBench/lpbench.c Thu May 3 15:06:22 2007 @@ -78,10 +78,16 @@ static const int NP1 = 601; // N + 1 #endif #else +#ifdef SMALL_PROBLEM_SIZE +static const int N = 400; +static const int NM1 = 399; // N - 1 +static const int NP1 = 401; // N + 1 +#else static const int N = 2000; static const int NM1 = 1999; // N - 1 static const int NP1 = 2001; // N + 1 #endif +#endif // benchmark code void matgen (double ** a, double * b) From lauro.venancio at gmail.com Thu May 3 15:10:04 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 15:10:04 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Olden/power/power.h Message-ID: <200705032010.l43KA4Sg003226@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/Olden/power: power.h updated: 1.4 -> 1.5 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+5 -5) power.h | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-test/MultiSource/Benchmarks/Olden/power/power.h diff -u llvm-test/MultiSource/Benchmarks/Olden/power/power.h:1.4 llvm-test/MultiSource/Benchmarks/Olden/power/power.h:1.5 --- llvm-test/MultiSource/Benchmarks/Olden/power/power.h:1.4 Fri Jun 6 23:16:02 2003 +++ llvm-test/MultiSource/Benchmarks/Olden/power/power.h Thu May 3 15:09:45 2007 @@ -23,11 +23,11 @@ #define NULL 0 -#if 0 /* __llvm__ SCALED BACK SETTINGS */ -#define NUM_FEEDERS 4 -#define LATERALS_PER_FEEDER 4 -#define BRANCHES_PER_LATERAL 2 -#define LEAVES_PER_BRANCH 4 +#ifdef SMALL_PROBLEM_SIZE /* __llvm__ SCALED BACK SETTINGS */ +#define NUM_FEEDERS 6 +#define LATERALS_PER_FEEDER 6 +#define BRANCHES_PER_LATERAL 4 +#define LEAVES_PER_BRANCH 6 #else #if 0 /* DEFAULT SETTINGS */ #define NUM_FEEDERS 10 From lauro.venancio at gmail.com Thu May 3 15:28:53 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 15:28:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp ARMISelLowering.cpp ARMRegisterInfo.cpp ARMTargetAsmInfo.cpp Message-ID: <200705032028.l43KSrcH003706@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.70 -> 1.71 ARMISelLowering.cpp updated: 1.48 -> 1.49 ARMRegisterInfo.cpp updated: 1.92 -> 1.93 ARMTargetAsmInfo.cpp updated: 1.19 -> 1.20 --- Log message: Debug support for arm-linux. Patch by Raul Herbster. --- Diffs of the changes: (+32 -18) ARMAsmPrinter.cpp | 25 ++++++++++--------------- ARMISelLowering.cpp | 3 --- ARMRegisterInfo.cpp | 5 +++++ ARMTargetAsmInfo.cpp | 17 +++++++++++++++++ 4 files changed, 32 insertions(+), 18 deletions(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.70 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.71 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.70 Thu May 3 11:42:23 2007 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Thu May 3 15:28:35 2007 @@ -175,9 +175,7 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) { AFI = MF.getInfo(); - if (Subtarget->isTargetDarwin()) { - DW.SetModuleInfo(&getAnalysis()); - } + DW.SetModuleInfo(&getAnalysis()); SetupMachineFunction(MF); O << "\n"; @@ -231,10 +229,8 @@ EmitAlignment(2, F); O << CurrentFnName << ":\n"; - if (Subtarget->isTargetDarwin()) { - // Emit pre-function debug information. - DW.BeginFunction(&MF); - } + // Emit pre-function debug information. + DW.BeginFunction(&MF); // Print out code for the function. for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); @@ -254,10 +250,8 @@ if (TAI->hasDotTypeDotSizeDirective()) O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n"; - if (Subtarget->isTargetDarwin()) { - // Emit post-function debug information. - DW.EndFunction(); - } + // Emit post-function debug information. + DW.EndFunction(); return false; } @@ -769,10 +763,8 @@ } bool ARMAsmPrinter::doInitialization(Module &M) { - if (Subtarget->isTargetDarwin()) { - // Emit initial debug information. - DW.BeginModule(&M); - } + // Emit initial debug information. + DW.BeginModule(&M); return AsmPrinter::doInitialization(M); } @@ -998,6 +990,9 @@ // linker can safely perform dead code stripping. Since LLVM never // generates code that does this, it is always safe to set. O << "\t.subsections_via_symbols\n"; + } else { + // Emit final debug information for ELF. + DW.EndModule(); } AsmPrinter::doFinalization(M); Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.48 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.49 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.48 Wed May 2 21:00:18 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Thu May 3 15:28:35 2007 @@ -178,9 +178,6 @@ // Support label based line numbers. setOperationAction(ISD::LOCATION, MVT::Other, Expand); setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); - // FIXME - use subtarget debug flags - if (!Subtarget->isTargetDarwin()) - setOperationAction(ISD::LABEL, MVT::Other, Expand); setOperationAction(ISD::RET, MVT::Other, Custom); setOperationAction(ISD::GlobalAddress, MVT::i32, Custom); Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.92 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.93 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.92 Tue May 1 04:13:03 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Thu May 3 15:28:35 2007 @@ -1373,6 +1373,11 @@ emitSPUpdate(MBB, MBBI, -NumBytes, isThumb, TII); } + if(STI.isTargetELF() && hasFP(MF)) { + MFI->setOffsetAdjustment(MFI->getOffsetAdjustment() - + AFI->getFramePtrSpillOffset()); + } + AFI->setGPRCalleeSavedArea1Size(GPRCS1Size); AFI->setGPRCalleeSavedArea2Size(GPRCS2Size); AFI->setDPRCalleeSavedAreaSize(DPRCSSize); Index: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp diff -u llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.19 llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.20 --- llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.19 Tue May 1 20:02:40 2007 +++ llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp Thu May 3 15:28:35 2007 @@ -63,8 +63,25 @@ DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug"; DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug"; } else { + NeedsSet = false; + HasLEB128 = true; + AbsoluteDebugSectionOffsets = true; + ReadOnlySection = "\t.section\t.rodata\n"; PrivateGlobalPrefix = ".L"; WeakRefDirective = "\t.weak\t"; + DwarfRequiresFrameSection = false; + DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",%progbits"; + DwarfInfoSection = "\t.section\t.debug_info,\"\",%progbits"; + DwarfLineSection = "\t.section\t.debug_line,\"\",%progbits"; + DwarfFrameSection = "\t.section\t.debug_frame,\"\",%progbits"; + DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",%progbits"; + DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",%progbits"; + DwarfStrSection = "\t.section\t.debug_str,\"\",%progbits"; + DwarfLocSection = "\t.section\t.debug_loc,\"\",%progbits"; + DwarfARangesSection = "\t.section\t.debug_aranges,\"\",%progbits"; + DwarfRangesSection = "\t.section\t.debug_ranges,\"\",%progbits"; + DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\",%progbits"; + if (Subtarget->isAAPCS_ABI()) { StaticCtorsSection = "\t.section .init_array,\"aw\",%init_array"; StaticDtorsSection = "\t.section .fini_array,\"aw\",%fini_array"; From lauro.venancio at gmail.com Thu May 3 15:31:11 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 15:31:11 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Benchmarks/Misc-C++/bigfib.cpp Message-ID: <200705032031.l43KVB4r003799@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/Benchmarks/Misc-C++: bigfib.cpp updated: 1.1 -> 1.2 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+4 -0) bigfib.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-test/SingleSource/Benchmarks/Misc-C++/bigfib.cpp diff -u llvm-test/SingleSource/Benchmarks/Misc-C++/bigfib.cpp:1.1 llvm-test/SingleSource/Benchmarks/Misc-C++/bigfib.cpp:1.2 --- llvm-test/SingleSource/Benchmarks/Misc-C++/bigfib.cpp:1.1 Tue Oct 5 11:58:46 2004 +++ llvm-test/SingleSource/Benchmarks/Misc-C++/bigfib.cpp Thu May 3 15:30:53 2007 @@ -274,7 +274,11 @@ // usage (argv); // return 1; option = TH_FIB; +#ifdef SMALL_PROBLEM_SIZE + N = 15000; +#else N = 50000; +#endif } else { N = atoi (argv[2]); } From lauro.venancio at gmail.com Thu May 3 15:45:38 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 15:45:38 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Olden/tsp/Makefile Message-ID: <200705032045.l43Kjc1l004051@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/Olden/tsp: Makefile updated: 1.7 -> 1.8 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+4 -0) Makefile | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-test/MultiSource/Benchmarks/Olden/tsp/Makefile diff -u llvm-test/MultiSource/Benchmarks/Olden/tsp/Makefile:1.7 llvm-test/MultiSource/Benchmarks/Olden/tsp/Makefile:1.8 --- llvm-test/MultiSource/Benchmarks/Olden/tsp/Makefile:1.7 Wed Sep 1 09:33:25 2004 +++ llvm-test/MultiSource/Benchmarks/Olden/tsp/Makefile Thu May 3 15:45:19 2007 @@ -6,8 +6,12 @@ ifdef LARGE_PROBLEM_SIZE RUN_OPTIONS = 2048000 else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 10240 +else RUN_OPTIONS = 1024000 endif +endif include $(LEVEL)/MultiSource/Makefile.multisrc From lauro.venancio at gmail.com Thu May 3 15:52:42 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 15:52:42 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Olden/health/Makefile Message-ID: <200705032052.l43KqgUA004281@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/Olden/health: Makefile updated: 1.15 -> 1.16 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+4 -0) Makefile | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-test/MultiSource/Benchmarks/Olden/health/Makefile diff -u llvm-test/MultiSource/Benchmarks/Olden/health/Makefile:1.15 llvm-test/MultiSource/Benchmarks/Olden/health/Makefile:1.16 --- llvm-test/MultiSource/Benchmarks/Olden/health/Makefile:1.15 Wed Sep 1 09:33:25 2004 +++ llvm-test/MultiSource/Benchmarks/Olden/health/Makefile Thu May 3 15:52:25 2007 @@ -9,7 +9,11 @@ ifdef LARGE_PROBLEM_SIZE RUN_OPTIONS = 10 40 1 else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 8 15 1 +else RUN_OPTIONS = 9 20 1 endif +endif include $(LEVEL)/MultiSource/Makefile.multisrc From dalej at apple.com Thu May 3 15:55:00 2007 From: dalej at apple.com (Dale Johannesen) Date: Thu, 3 May 2007 15:55:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrVFP.td Message-ID: <200705032055.l43Kt066004345@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMInstrVFP.td updated: 1.2 -> 1.3 --- Log message: Evan's patch to avoid FPreg->intreg copy for cvt; store to mem --- Diffs of the changes: (+5 -0) ARMInstrVFP.td | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/lib/Target/ARM/ARMInstrVFP.td diff -u llvm/lib/Target/ARM/ARMInstrVFP.td:1.2 llvm/lib/Target/ARM/ARMInstrVFP.td:1.3 --- llvm/lib/Target/ARM/ARMInstrVFP.td:1.2 Wed May 2 19:32:00 2007 +++ llvm/lib/Target/ARM/ARMInstrVFP.td Thu May 3 15:54:42 2007 @@ -78,6 +78,11 @@ [(store SPR:$src, addrmode5:$addr)]>; } // isStore +// avoid copying result of FTOUIZ to int reg when we're just storing it +let AddedComplexity = 1 in +def : ARMPat<(store (i32 (bitconvert SPR:$src)), addrmode5:$addr), + (FSTS SPR:$src, addrmode5:$addr)>; + //===----------------------------------------------------------------------===// // Load / store multiple Instructions. // From dalej at apple.com Thu May 3 15:55:05 2007 From: dalej at apple.com (Dale Johannesen) Date: Thu, 3 May 2007 15:55:05 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/fptoint.ll Message-ID: <200705032055.l43Kt5Vv004352@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: fptoint.ll added (r1.1) --- Log message: Evan's patch to avoid FPreg->intreg copy for cvt; store to mem --- Diffs of the changes: (+33 -0) fptoint.ll | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+) Index: llvm/test/CodeGen/ARM/fptoint.ll diff -c /dev/null llvm/test/CodeGen/ARM/fptoint.ll:1.1 *** /dev/null Thu May 3 15:54:52 2007 --- llvm/test/CodeGen/ARM/fptoint.ll Thu May 3 15:54:42 2007 *************** *** 0 **** --- 1,33 ---- + ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 > %t + ; RUN: not grep fmrs %t + + @i = weak global i32 0 ; [#uses=2] + @u = weak global i32 0 ; [#uses=2] + + define void @foo5(float %x) { + entry: + %tmp1 = fptosi float %x to i32 ; [#uses=1] + store i32 %tmp1, i32* @i + ret void + } + + define void @foo6(float %x) { + entry: + %tmp1 = fptoui float %x to i32 ; [#uses=1] + store i32 %tmp1, i32* @u + ret void + } + + define void @foo7(double %x) { + entry: + %tmp1 = fptosi double %x to i32 ; [#uses=1] + store i32 %tmp1, i32* @i + ret void + } + + define void @foo8(double %x) { + entry: + %tmp1 = fptoui double %x to i32 ; [#uses=1] + store i32 %tmp1, i32* @u + ret void + } From dpatel at apple.com Thu May 3 15:55:42 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 3 May 2007 15:55:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp Message-ID: <200705032055.l43Ktg9C004384@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Dominators.cpp updated: 1.100 -> 1.101 --- Log message: Use iterative while loop instead of recursive function call. --- Diffs of the changes: (+34 -14) Dominators.cpp | 48 ++++++++++++++++++++++++++++++++++-------------- 1 files changed, 34 insertions(+), 14 deletions(-) Index: llvm/lib/VMCore/Dominators.cpp diff -u llvm/lib/VMCore/Dominators.cpp:1.100 llvm/lib/VMCore/Dominators.cpp:1.101 --- llvm/lib/VMCore/Dominators.cpp:1.100 Wed May 2 20:11:54 2007 +++ llvm/lib/VMCore/Dominators.cpp Thu May 3 15:55:18 2007 @@ -124,20 +124,40 @@ return N; } -void DominatorTree::Compress(BasicBlock *V, InfoRec &VInfo) { - BasicBlock *VAncestor = VInfo.Ancestor; - InfoRec &VAInfo = Info[VAncestor]; - if (VAInfo.Ancestor == 0) - return; +void DominatorTree::Compress(BasicBlock *VIn) { - Compress(VAncestor, VAInfo); - - BasicBlock *VAncestorLabel = VAInfo.Label; - BasicBlock *VLabel = VInfo.Label; - if (Info[VAncestorLabel].Semi < Info[VLabel].Semi) - VInfo.Label = VAncestorLabel; + std::vector Work; + std::set Visited; + InfoRec &VInInfo = Info[VIn]; + BasicBlock *VInAncestor = VInInfo.Ancestor; + InfoRec &VInVAInfo = Info[VInAncestor]; + + if (VInVAInfo.Ancestor != 0) + Work.push_back(VIn); + + while (!Work.empty()) { + BasicBlock *V = Work.back(); + InfoRec &VInfo = Info[V]; + BasicBlock *VAncestor = VInfo.Ancestor; + InfoRec &VAInfo = Info[VAncestor]; + + // Process Ancestor first + if (Visited.count(VAncestor) == 0 && VAInfo.Ancestor != 0) { + Work.push_back(VAncestor); + Visited.insert(VAncestor); + continue; + } + Work.pop_back(); - VInfo.Ancestor = VAInfo.Ancestor; + // Update VINfo based on Ancestor info + if (VAInfo.Ancestor == 0) + continue; + BasicBlock *VAncestorLabel = VAInfo.Label; + BasicBlock *VLabel = VInfo.Label; + if (Info[VAncestorLabel].Semi < Info[VLabel].Semi) + VInfo.Label = VAncestorLabel; + VInfo.Ancestor = VAInfo.Ancestor; + } } BasicBlock *DominatorTree::Eval(BasicBlock *V) { @@ -146,13 +166,13 @@ // Higher-complexity but faster implementation if (VInfo.Ancestor == 0) return V; - Compress(V, VInfo); + Compress(V); return VInfo.Label; #else // Lower-complexity but slower implementation if (VInfo.Ancestor == 0) return VInfo.Label; - Compress(V, VInfo); + Compress(V); BasicBlock *VLabel = VInfo.Label; BasicBlock *VAncestorLabel = Info[VInfo.Ancestor].Label; From dpatel at apple.com Thu May 3 15:55:45 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 3 May 2007 15:55:45 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/Dominators.h Message-ID: <200705032055.l43Ktjda004391@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: Dominators.h updated: 1.79 -> 1.80 --- Log message: Use iterative while loop instead of recursive function call. --- Diffs of the changes: (+1 -1) Dominators.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Analysis/Dominators.h diff -u llvm/include/llvm/Analysis/Dominators.h:1.79 llvm/include/llvm/Analysis/Dominators.h:1.80 --- llvm/include/llvm/Analysis/Dominators.h:1.79 Wed May 2 20:11:53 2007 +++ llvm/include/llvm/Analysis/Dominators.h Thu May 3 15:55:18 2007 @@ -225,7 +225,7 @@ void calculate(Function& F); Node *getNodeForBlock(BasicBlock *BB); unsigned DFSPass(BasicBlock *V, InfoRec &VInfo, unsigned N); - void Compress(BasicBlock *V, InfoRec &VInfo); + void Compress(BasicBlock *V); BasicBlock *Eval(BasicBlock *v); void Link(BasicBlock *V, BasicBlock *W, InfoRec &WInfo); inline BasicBlock *getIDom(BasicBlock *BB) const { From lauro.venancio at gmail.com Thu May 3 15:55:49 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 15:55:49 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Olden/perimeter/Makefile Message-ID: <200705032055.l43KtnXY004396@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/Olden/perimeter: Makefile updated: 1.12 -> 1.13 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+4 -0) Makefile | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-test/MultiSource/Benchmarks/Olden/perimeter/Makefile diff -u llvm-test/MultiSource/Benchmarks/Olden/perimeter/Makefile:1.12 llvm-test/MultiSource/Benchmarks/Olden/perimeter/Makefile:1.13 --- llvm-test/MultiSource/Benchmarks/Olden/perimeter/Makefile:1.12 Sat Nov 6 15:40:46 2004 +++ llvm-test/MultiSource/Benchmarks/Olden/perimeter/Makefile Thu May 3 15:55:20 2007 @@ -6,8 +6,12 @@ ifdef LARGE_PROBLEM_SIZE RUN_OPTIONS = 11 else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 9 +else RUN_OPTIONS = 10 endif +endif include $(LEVEL)/MultiSource/Makefile.multisrc From lauro.venancio at gmail.com Thu May 3 16:16:24 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 16:16:24 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Olden/treeadd/Makefile Message-ID: <200705032116.l43LGOA1004824@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/Olden/treeadd: Makefile updated: 1.10 -> 1.11 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+6 -0) Makefile | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm-test/MultiSource/Benchmarks/Olden/treeadd/Makefile diff -u llvm-test/MultiSource/Benchmarks/Olden/treeadd/Makefile:1.10 llvm-test/MultiSource/Benchmarks/Olden/treeadd/Makefile:1.11 --- llvm-test/MultiSource/Benchmarks/Olden/treeadd/Makefile:1.10 Wed Sep 1 09:33:25 2004 +++ llvm-test/MultiSource/Benchmarks/Olden/treeadd/Makefile Thu May 3 16:16:04 2007 @@ -3,6 +3,12 @@ PROG = treeadd CPPFLAGS = -DTORONTO LDFLAGS = + +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 20 +else RUN_OPTIONS = 22 +endif + include $(LEVEL)/MultiSource/Makefile.multisrc From reid at x10sys.com Thu May 3 16:18:09 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 3 May 2007 16:18:09 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200705032118.l43LI9EU004909@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.118 -> 1.119 --- Log message: Add Dan Moniz and Lakshmankumar Mukkavilli. --- Diffs of the changes: (+5 -3) DevMtgMay2007.html | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.118 llvm-www/DevMtgMay2007.html:1.119 --- llvm-www/DevMtgMay2007.html:1.118 Thu May 3 14:11:45 2007 +++ llvm-www/DevMtgMay2007.html Thu May 3 16:17:51 2007 @@ -313,15 +313,17 @@ +
Unconfirmed Attendees
NameOrganization
Nick LewyckyIndependent
Efrem LipkinCoDesign
Gabe McArthurIndependent
Paul McJonesAdobe Systems Incorporated.
- + + @@ -344,7 +346,7 @@
Confirmed Attendees
NameOrganization
Paul McJonesAdobe Systems Incorporated.
Scott MichelAerospace
Dan MonizMatasano
Alireza MoshtaghiMicrochip Technology
Lakshmankumar MukkavilliCisco Systems
Robert MyklandAscenium Corp.
Steve NaroffApple Inc.
Devang PatelApple Inc.
-

Total confirmed: 42

+

Total confirmed: 44

@@ -364,6 +366,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
Last modified: $Date: 2007/05/03 19:11:45 $ +
Last modified: $Date: 2007/05/03 21:17:51 $ From evan.cheng at apple.com Thu May 3 16:32:56 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 16:32:56 -0500 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs RunSafely.sh TimedExec.sh Message-ID: <200705032132.l43LWuMH005171@zion.cs.uiuc.edu> Changes in directory llvm-test: Makefile.programs updated: 1.264 -> 1.265 RunSafely.sh updated: 1.27 -> 1.28 TimedExec.sh updated: 1.5 -> 1.6 --- Log message: Added support to do remote execution using rsh. e.g. make TARGET_LLCFLAGS="-mcpu=armcpuname" TARGET_ARCH=arm REMOTE_HOST=board REMOTE_USER=id TARGET_ARCH=<> specifies the arch. of the target (i.e. remote host), e.g. arm, x86 TARGET_LLCFLAGS=<> specifies additional flags passed to llc, e.g. --enable-tail-merge REMOTE_HOST=<> specifies the remote host name where the programs are being run REMOTE_USER=<> specifies the account user id on the remote host (passed along by rsh -l). --- Diffs of the changes: (+72 -13) Makefile.programs | 31 ++++++++++++++++++++++++++++--- RunSafely.sh | 44 ++++++++++++++++++++++++++++++++++++++------ TimedExec.sh | 10 ++++++---- 3 files changed, 72 insertions(+), 13 deletions(-) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.264 llvm-test/Makefile.programs:1.265 --- llvm-test/Makefile.programs:1.264 Wed Mar 28 03:31:17 2007 +++ llvm-test/Makefile.programs Thu May 3 16:32:39 2007 @@ -88,10 +88,18 @@ else EXIT_OK := 0 endif -ifndef GET_STABLE_NUMBERS -RUNSAFELY := $(PROGDIR)/RunSafely.sh $(RUNTIMELIMIT) $(EXIT_OK) -else +ifdef GET_STABLE_NUMBERS RUNSAFELY := $(PROGDIR)/RunSafelyAndStable.sh $(RUNTIMELIMIT) $(EXIT_OK) +else +ifdef REMOTE_HOST +ifdef REMOTE_USER +RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) -l $(REMOTE_USER) $(RUNTIMELIMIT) $(EXIT_OK) +else +RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) $(RUNTIMELIMIT) $(EXIT_OK) +endif +else +RUNSAFELY := $(PROGDIR)/RunSafely.sh $(RUNTIMELIMIT) $(EXIT_OK) +endif endif # LLVMGCCLD - This sets up the command to use for linking test programs @@ -229,6 +237,9 @@ ifeq ($(ARCH),Sparc) LLCBETAOPTION := -enable-sparc-v9-insts endif +ifeq ($(TARGET_ARCH),ARM) +LLCBETAOPTION := -march=thumb +endif print-llcbeta-option: @echo $(LLCBETAOPTION) @@ -302,6 +313,11 @@ LLCFLAGS += -enable-correct-eh-support endif +# Pass target specific llc flags +ifdef TARGET_LLCFLAGS +LLCFLAGS += $(TARGET_LLCFLAGS) +endif + # # Rules to compile the program for the C Back End # @@ -408,6 +424,15 @@ # output with the program's output. BUGPOINT_OPTIONS += -append-exit-code +# Support remote execution +ifdef REMOTE_HOST +ifdef REMOTE_USER +BUGPOINT_OPTIONS += -rsh-host=$(REMOTE_HOST) -rsh-user=$(REMOTE_USER) +else +BUGPOINT_OPTIONS += -rsh-host=$(REMOTE_HOST) +endif +endif + # If a tolerance is set, pass it off to bugpoint ifdef FP_TOLERANCE BUGPOINT_OPTIONS += -rel-tolerance $(FP_TOLERANCE) Index: llvm-test/RunSafely.sh diff -u llvm-test/RunSafely.sh:1.27 llvm-test/RunSafely.sh:1.28 --- llvm-test/RunSafely.sh:1.27 Thu Jan 11 15:01:31 2007 +++ llvm-test/RunSafely.sh Thu May 3 16:32:39 2007 @@ -11,17 +11,23 @@ # fourth argument specified, and outputs a .time file which # contains a timing of the program and the program's exit code. # -# If the (2nd) parameter is 0 then this script always -# returns 0, regardless of the actual exit of the . +# If the parameter is 0 then this script always returns 0, +# regardless of the actual exit of the . # If the parameter is non-zero then this script returns # the exit code of the . If there is an error in getting # the 's exit code, this script returns 99. # +# If optional parameters -r -l are +# specified, it execute the program remotely using rsh. +# # Syntax: # -# RunSafely.sh +# RunSafely.sh [-r ] [-l ] +# # # where: +# is the remote host to execute the program +# is the username on the remote host # 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 @@ -35,6 +41,19 @@ fi DIR=${0%%`basename $0`} + +RHOST= +RUSER=`id -un` +FLAG=$1 +if [ $1 = "-r" ]; then + RHOST=$2 + shift 2 +fi +if [ $1 = "-l" ]; then + RUSER=$2 + shift 2 +fi + ULIMIT=$1 EXITOK=$2 INFILE=$3 @@ -75,18 +94,31 @@ # we tell time to launch a shell which in turn executes $PROGRAM with the # necessary I/O redirection. # +PWD=`pwd` COMMAND="$PROGRAM $*" if [ "$SYSTEM" = "Darwin" ]; then - COMMAND="${DIR}TimedExec.sh $ULIMIT $COMMAND" + COMMAND="${DIR}TimedExec.sh $ULIMIT $PWD $COMMAND" fi -( time -p sh -c "$COMMAND >$OUTFILE 2>&1 < $INFILE" ; echo exit $? ) 2>&1 \ - | awk -- '\ +if [ "x$RHOST" = x ] ; then + ( time -p sh -c "$COMMAND >$OUTFILE 2>&1 < $INFILE" ; echo exit $? ) 2>&1 \ + | awk -- '\ +BEGIN { cpu = 0.0; } +/^user/ { cpu += $2; print; } +/^sys/ { cpu += $2; print; } +!/^user/ && !/^sys/ { print; } +END { printf("program %f\n", cpu); }' > $OUTFILE.time +else + ( rsh -l $RUSER $RHOST "cd $PWD; time -p $COMMAND >$OUTFILE.remote 2>&1 < $INFILE" ; echo exit $? ) 2>&1 \ + | awk -- '\ BEGIN { cpu = 0.0; } /^user/ { cpu += $2; print; } /^sys/ { cpu += $2; print; } !/^user/ && !/^sys/ { print; } END { printf("program %f\n", cpu); }' > $OUTFILE.time +cp $OUTFILE.remote $OUTFILE +rm -f $OUTFILE.remote +fi exitval=`grep '^exit ' $OUTFILE.time | sed -e 's/^exit //'` if [ -z "$exitval" ] ; then Index: llvm-test/TimedExec.sh diff -u llvm-test/TimedExec.sh:1.5 llvm-test/TimedExec.sh:1.6 --- llvm-test/TimedExec.sh:1.5 Wed Jan 10 11:51:45 2007 +++ llvm-test/TimedExec.sh Thu May 3 16:32:39 2007 @@ -4,11 +4,11 @@ # # Synopsis: This script is a watchdog wrapper. It runs the specified program # but times out if it does not complete in the allocated time frame. -# Syntax: ./TimedExec.sh +# Syntax: ./TimedExec.sh # -if [ $# -lt 2 ]; then - echo "./TimedExec.sh " +if [ $# -lt 3 ]; then + echo "./TimedExec.sh " exit 1 fi @@ -18,11 +18,13 @@ fi TIMEOUT=$1 -shift +DIR=$2 +shift 2 if [ -z "$PARENT" ]; then # Start a watchdog process $0 -p $$ $TIMEOUT $* & + cd $DIR exec "$@" else # Sleep for a specified time then wake up to kill the parent process. From lauro.venancio at gmail.com Thu May 3 16:34:15 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 16:34:15 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Olden/voronoi/Makefile Message-ID: <200705032134.l43LYFqG005212@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/Olden/voronoi: Makefile updated: 1.16 -> 1.17 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+4 -0) Makefile | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-test/MultiSource/Benchmarks/Olden/voronoi/Makefile diff -u llvm-test/MultiSource/Benchmarks/Olden/voronoi/Makefile:1.16 llvm-test/MultiSource/Benchmarks/Olden/voronoi/Makefile:1.17 --- llvm-test/MultiSource/Benchmarks/Olden/voronoi/Makefile:1.16 Tue Feb 22 11:20:28 2005 +++ llvm-test/MultiSource/Benchmarks/Olden/voronoi/Makefile Thu May 3 16:33:56 2007 @@ -8,8 +8,12 @@ ifdef LARGE_PROBLEM_SIZE RUN_OPTIONS = 1000000 20 32 7 else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 10000 20 32 7 +else RUN_OPTIONS = 100000 20 32 7 endif +endif include $(LEVEL)/MultiSource/Makefile.multisrc From clattner at apple.com Thu May 3 16:51:16 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 3 May 2007 14:51:16 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrVFP.td In-Reply-To: <200705032055.l43Kt066004345@zion.cs.uiuc.edu> References: <200705032055.l43Kt066004345@zion.cs.uiuc.edu> Message-ID: > Evan's patch to avoid FPreg->intreg copy for cvt; store to mem > > +// avoid copying result of FTOUIZ to int reg when we're just > storing it > +let AddedComplexity = 1 in > +def : ARMPat<(store (i32 (bitconvert SPR:$src)), addrmode5:$addr), > + (FSTS SPR:$src, addrmode5:$addr)>; > + > // > ===------------------------------------------------------------------- > ---===// > // Load / store multiple Instructions. > // Interesting approach. Instead of adding this to one target's .td file, can you please investigate whether we can enable the dag combine xform at DAGCombiner.cpp:3412 now? The primary thing blocking that xform was that we need to know (in this case) that an f32 store doesn't require greater alignment than an i32 store has. -Chris From lauro.venancio at gmail.com Thu May 3 17:00:13 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 19:00:13 -0300 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs RunSafely.sh TimedExec.sh In-Reply-To: <200705032132.l43LWuMH005171@zion.cs.uiuc.edu> References: <200705032132.l43LWuMH005171@zion.cs.uiuc.edu> Message-ID: <9c10c9f0705031500l197eae2fha575aa06ad861a6a@mail.gmail.com> I think we should coordinate the work. We are doing the same thing in different ways. I will try merge the changes. > > @@ -229,6 +237,9 @@ > ifeq ($(ARCH),Sparc) > LLCBETAOPTION := -enable-sparc-v9-insts > endif > +ifeq ($(TARGET_ARCH),ARM) > +LLCBETAOPTION := -march=thumb > +endif I think this is not a good choice. We will not be able to compare gcc thumb with llvm thumb times. I think it is better to run the tests two times: one for thumb and other for arm. Lauro -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070503/0e7d24b1/attachment.html From sabre at nondot.org Thu May 3 17:05:03 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 17:05:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705032205.l43M53v9005914@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.25 -> 1.26 --- Log message: implement the rest of the instructions --- Diffs of the changes: (+68 -10) BitcodeReader.cpp | 78 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 68 insertions(+), 10 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.25 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.26 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.25 Thu May 3 13:58:09 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 17:04:19 2007 @@ -1328,17 +1328,75 @@ I = new AllocaInst(Ty->getElementType(), Size, (1 << Align) >> 1); break; } -#if 0 - case bitc::FUNC_CODE_INST_LOAD: - // LOAD: [opty, op, align, vol] - case bitc::FUNC_CODE_INST_STORE: - // STORE: [ptrty,val,ptr, align, vol] - case bitc::FUNC_CODE_INST_CALL: - // CALL: [fnty, fnid, arg0, arg1...] - case bitc::FUNC_CODE_INST_VAARG: - // VAARG: [valistty, valist, instty] + case bitc::FUNC_CODE_INST_LOAD: { // LOAD: [opty, op, align, vol] + if (Record.size() < 4) + return Error("Invalid LOAD record"); + const Type *OpTy = getTypeByID(Record[0]); + Value *Op = getFnValueByID(Record[1], OpTy); + if (!OpTy || !Op) + return Error("Invalid LOAD record"); + I = new LoadInst(Op, "", Record[3], (1 << Record[2]) >> 1); break; -#endif + } + case bitc::FUNC_CODE_INST_STORE: { // STORE:[ptrty,val,ptr, align, vol] + if (Record.size() < 5) + return Error("Invalid LOAD record"); + const Type *OpTy = getTypeByID(Record[0]); + Value *Op = getFnValueByID(Record[1], OpTy); + Value *Ptr = getFnValueByID(Record[2], PointerType::get(OpTy)); + if (!OpTy || !Op || !Ptr) + return Error("Invalid STORE record"); + I = new StoreInst(Op, Ptr, (1 << Record[3]) >> 1, Record[4]); + break; + } + case bitc::FUNC_CODE_INST_CALL: { // CALL: [fnty, fnid, arg0, arg1...] + if (Record.size() < 2) + return Error("Invalid CALL record"); + const PointerType *OpTy = + dyn_cast_or_null(getTypeByID(Record[0])); + const FunctionType *FTy = 0; + if (OpTy) FTy = dyn_cast(OpTy->getElementType()); + Value *Callee = getFnValueByID(Record[1], OpTy); + if (!FTy || !Callee || Record.size() < FTy->getNumParams()+2) + return Error("Invalid CALL record"); + + SmallVector Args; + // Read the fixed params. + for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) { + Args.push_back(getFnValueByID(Record[i+2], FTy->getParamType(i))); + if (Args.back() == 0) return Error("Invalid CALL record"); + } + + + // Read type/value pairs for varargs params. + unsigned NextArg = FTy->getNumParams()+2; + if (!FTy->isVarArg()) { + if (NextArg != Record.size()) + return Error("Invalid CALL record"); + } else { + if ((Record.size()-NextArg) & 1) + return Error("Invalid CALL record"); + for (unsigned e = Record.size(); NextArg != e; NextArg += 2) { + Args.push_back(getFnValueByID(Record[NextArg+1], + getTypeByID(Record[NextArg]))); + if (Args.back() == 0) return Error("Invalid CALL record"); + } + } + + I = new CallInst(Callee, &Args[0], Args.size()); + break; + } + case bitc::FUNC_CODE_INST_VAARG: { // VAARG: [valistty, valist, instty] + if (Record.size() < 3) + return Error("Invalid VAARG record"); + const Type *OpTy = getTypeByID(Record[0]); + Value *Op = getFnValueByID(Record[1], OpTy); + const Type *ResTy = getTypeByID(Record[2]); + if (!OpTy || !Op || !ResTy) + return Error("Invalid VAARG record"); + I = new VAArgInst(Op, ResTy); + break; + } } // Add instruction to end of current BB. If there is no current BB, reject From evan.cheng at apple.com Thu May 3 17:06:52 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 15:06:52 -0700 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs RunSafely.sh TimedExec.sh In-Reply-To: <9c10c9f0705031500l197eae2fha575aa06ad861a6a@mail.gmail.com> References: <200705032132.l43LWuMH005171@zion.cs.uiuc.edu> <9c10c9f0705031500l197eae2fha575aa06ad861a6a@mail.gmail.com> Message-ID: <45DD6FB4-A7B3-477C-A47D-67D32B87A484@apple.com> That's how I am running my nightly tests now. You can add a couple of lines for your target. e.g. ifeq ($(TARGET_ARCH),ARM4) LLCBETAOPTION := .. endif It's just a makefile. Easy to hack. :-) Evan On May 3, 2007, at 3:00 PM, Lauro Ramos Venancio wrote: > I think we should coordinate the work. We are doing the same thing > in different ways. I will try merge the changes. > > @@ -229,6 +237,9 @@ > ifeq ($(ARCH),Sparc) > LLCBETAOPTION := -enable-sparc-v9-insts > endif > +ifeq ($(TARGET_ARCH),ARM) > +LLCBETAOPTION := -march=thumb > +endif > > > I think this is not a good choice. We will not be able to compare > gcc thumb with llvm thumb times. I think it is better to run the > tests two times: one for thumb and other for arm. > > Lauro > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From jeffc at jolt-lang.org Thu May 3 17:09:45 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Thu, 3 May 2007 17:09:45 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Pass.h Message-ID: <200705032209.l43M9j1n006209@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Pass.h updated: 1.89 -> 1.90 --- Log message: Unbreak VC++ build. --- Diffs of the changes: (+0 -1) Pass.h | 1 - 1 files changed, 1 deletion(-) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.89 llvm/include/llvm/Pass.h:1.90 --- llvm/include/llvm/Pass.h:1.89 Wed May 2 15:38:25 2007 +++ llvm/include/llvm/Pass.h Thu May 3 17:09:21 2007 @@ -35,7 +35,6 @@ #include #include #include -#include namespace llvm { From jeffc at jolt-lang.org Thu May 3 17:09:45 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Thu, 3 May 2007 17:09:45 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Globals.cpp Message-ID: <200705032209.l43M9jcO006216@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Globals.cpp updated: 1.23 -> 1.24 --- Log message: Unbreak VC++ build. --- Diffs of the changes: (+2 -2) Globals.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/VMCore/Globals.cpp diff -u llvm/lib/VMCore/Globals.cpp:1.23 llvm/lib/VMCore/Globals.cpp:1.24 --- llvm/lib/VMCore/Globals.cpp:1.23 Mon Apr 30 05:28:40 2007 +++ llvm/lib/VMCore/Globals.cpp Thu May 3 17:09:21 2007 @@ -223,7 +223,7 @@ else assert(0 && "Unsupported aliasee"); } - } else - return 0; + } + return 0; } From sabre at nondot.org Thu May 3 17:10:12 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 17:10:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705032210.l43MACGF006344@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.26 -> 1.27 --- Log message: bug fixes --- Diffs of the changes: (+3 -3) BitcodeReader.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.26 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.27 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.26 Thu May 3 17:04:19 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 17:09:51 2007 @@ -400,7 +400,7 @@ switch (Stream.ReadRecord(Code, Record)) { default: // Default behavior: unknown type. break; - case bitc::TST_CODE_ENTRY: // VST_ENTRY: [valueid, namelen, namechar x N] + case bitc::VST_CODE_ENTRY: // VST_ENTRY: [valueid, namelen, namechar x N] if (ConvertToString(Record, 1, ValueName)) return Error("Invalid TST_ENTRY record"); unsigned ValueID = Record[0]; @@ -1054,7 +1054,7 @@ if (Record.size() < 1 || Record[0] == 0) return Error("Invalid DECLAREBLOCKS record"); // Create all the basic blocks for the function. - FunctionBBs.resize(Record.size()); + FunctionBBs.resize(Record[0]); for (unsigned i = 0, e = FunctionBBs.size(); i != e; ++i) FunctionBBs[i] = new BasicBlock("", F); CurBB = FunctionBBs[0]; @@ -1185,7 +1185,7 @@ } return Error("Invalid RET record"); case bitc::FUNC_CODE_INST_BR: { // BR: [bb#, bb#, opval] or [bb#] - if (Record.size() != 1 || Record.size() != 3) + if (Record.size() != 1 && Record.size() != 3) return Error("Invalid BR record"); BasicBlock *TrueDest = getBasicBlock(Record[0]); if (TrueDest == 0) From evan.cheng at apple.com Thu May 3 17:10:18 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 17:10:18 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000/Makefile Message-ID: <200705032210.l43MAIAU006362@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000: Makefile updated: 1.2 -> 1.3 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+4 -0) Makefile | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000/Makefile diff -u llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000/Makefile:1.2 llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000/Makefile:1.3 --- llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000/Makefile:1.2 Wed Oct 11 21:35:28 2006 +++ llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000/Makefile Thu May 3 17:09:59 2007 @@ -10,6 +10,10 @@ #include $(LLVM_OBJ_ROOT)/Makefile.config +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS ="-n 40 20 40 -c 0.1 1.0 10.0" +else RUN_OPTIONS ="-n 100 40 100 -c 0.1 1.0 10.0" +endif include ../../../Makefile.multisrc From jeffc at jolt-lang.org Thu May 3 17:11:30 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Thu, 3 May 2007 17:11:30 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200705032211.l43MBU6k006524@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.119 -> 1.120 --- Log message: Add "Using LLVM in Jolt compiler" talk. Gabe McArthur is only attending once. --- Diffs of the changes: (+3 -3) DevMtgMay2007.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.119 llvm-www/DevMtgMay2007.html:1.120 --- llvm-www/DevMtgMay2007.html:1.119 Thu May 3 16:17:51 2007 +++ llvm-www/DevMtgMay2007.html Thu May 3 17:11:12 2007 @@ -157,6 +157,7 @@ +
Unconfirmed Attendees
NameOrganization
Scott MichelBuilding The Cell BE Symbiotic Processor Element Backend: Practice and Experience
John CriswellUIUC Research, TBA
Jeff CohenUsing LLVM in the Jolt compiler
@@ -328,7 +329,6 @@ Steve NaroffApple Inc. Devang PatelApple Inc. Fernando Magno Quintao PereiraUCLA - Gabe McArthurIndependent Jeff PoznanovicCray Inc. Ron PriceApple Inc. Chuck RoseAdobe Systems Incorporated. @@ -346,7 +346,7 @@ -

Total confirmed: 44

+

Total confirmed: 43

@@ -366,6 +366,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
Last modified: $Date: 2007/05/03 21:17:51 $ +
Last modified: $Date: 2007/05/03 22:11:12 $ From evan.cheng at apple.com Thu May 3 17:13:45 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 17:13:45 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/tramp3d-v4/Makefile Message-ID: <200705032213.l43MDjuc006700@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/tramp3d-v4: Makefile updated: 1.3 -> 1.4 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+4 -0) Makefile | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-test/MultiSource/Benchmarks/tramp3d-v4/Makefile diff -u llvm-test/MultiSource/Benchmarks/tramp3d-v4/Makefile:1.3 llvm-test/MultiSource/Benchmarks/tramp3d-v4/Makefile:1.4 --- llvm-test/MultiSource/Benchmarks/tramp3d-v4/Makefile:1.3 Sat Feb 10 16:42:10 2007 +++ llvm-test/MultiSource/Benchmarks/tramp3d-v4/Makefile Thu May 3 17:13:28 2007 @@ -3,7 +3,11 @@ PROG = tramp3d-v4 CPPFLAGS = -fno-exceptions LDFLAGS = -lstdc++ +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = --cartvis 1.0 0.0 --rhomin 1e-8 -n 2 +else RUN_OPTIONS = --cartvis 1.0 0.0 --rhomin 1e-8 -n 25 +endif FP_ABSTOLERANCE := 0.0000001 include ../../Makefile.multisrc From sabre at nondot.org Thu May 3 17:16:30 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 17:16:30 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/LLVMBitCodes.h Message-ID: <200705032216.l43MGUOu006810@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: LLVMBitCodes.h updated: 1.11 -> 1.12 --- Log message: add a new code --- Diffs of the changes: (+2 -1) LLVMBitCodes.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Bitcode/LLVMBitCodes.h diff -u llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.11 llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.12 --- llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.11 Wed May 2 00:47:22 2007 +++ llvm/include/llvm/Bitcode/LLVMBitCodes.h Thu May 3 17:16:11 2007 @@ -87,7 +87,8 @@ // The value symbol table only has one code (VST_ENTRY_CODE). enum ValueSymtabCodes { - VST_CODE_ENTRY = 1 // VST_ENTRY: [valid, namelen, namechar x N] + VST_CODE_ENTRY = 1, // VST_ENTRY: [valid, namelen, namechar x N] + VST_CODE_BBENTRY = 2 // VST_BBENTRY: [bbid, namelen, namechar x N] }; // The constants block (CONSTANTS_BLOCK_ID) describes emission for each From sabre at nondot.org Thu May 3 17:18:43 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 17:18:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705032218.l43MIh4d006902@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.27 -> 1.28 --- Log message: fix encoding of BB names in the symtab --- Diffs of the changes: (+10 -0) BitcodeReader.cpp | 10 ++++++++++ 1 files changed, 10 insertions(+) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.27 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.28 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.27 Thu May 3 17:09:51 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 17:18:21 2007 @@ -411,6 +411,16 @@ V->setName(&ValueName[0], ValueName.size()); ValueName.clear(); break; + case bitc::VST_CODE_BBENTRY: + if (ConvertToString(Record, 1, ValueName)) + return Error("Invalid VST_BBENTRY record"); + BasicBlock *BB = getBasicBlock(Record[0]); + if (BB == 0) + return Error("Invalid BB ID in VST_BBENTRY record"); + + BB->setName(&ValueName[0], ValueName.size()); + ValueName.clear(); + break; } } } From sabre at nondot.org Thu May 3 17:18:47 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 17:18:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp ValueEnumerator.cpp Message-ID: <200705032218.l43MIlgV006912@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.21 -> 1.22 ValueEnumerator.cpp updated: 1.7 -> 1.8 --- Log message: fix encoding of BB names in the symtab --- Diffs of the changes: (+11 -5) BitcodeWriter.cpp | 14 ++++++++++---- ValueEnumerator.cpp | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.21 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.22 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.21 Wed May 2 00:46:45 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Thu May 3 17:18:21 2007 @@ -669,7 +669,6 @@ } break; } - case Instruction::VAArg: Code = bitc::FUNC_CODE_INST_VAARG; Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); // valistty @@ -697,16 +696,23 @@ SI != SE; ++SI) { unsigned AbbrevToUse = 0; - // VST_ENTRY: [valueid, namelen, namechar x N] - NameVals.push_back(VE.getValueID(SI->getValue())); + // VST_ENTRY: [valueid, namelen, namechar x N] + // VST_BBENTRY: [bbid, namelen, namechar x N] + unsigned Code; + if (isa(SI->getValue())) { + Code = bitc::VST_CODE_BBENTRY; + } else { + Code = bitc::VST_CODE_ENTRY; + } + NameVals.push_back(VE.getValueID(SI->getValue())); NameVals.push_back(SI->getKeyLength()); for (const char *P = SI->getKeyData(), *E = SI->getKeyData()+SI->getKeyLength(); P != E; ++P) NameVals.push_back((unsigned char)*P); // Emit the finished record. - Stream.EmitRecord(bitc::VST_CODE_ENTRY, NameVals, AbbrevToUse); + Stream.EmitRecord(Code, NameVals, AbbrevToUse); NameVals.clear(); } Stream.ExitBlock(); Index: llvm/lib/Bitcode/Writer/ValueEnumerator.cpp diff -u llvm/lib/Bitcode/Writer/ValueEnumerator.cpp:1.7 llvm/lib/Bitcode/Writer/ValueEnumerator.cpp:1.8 --- llvm/lib/Bitcode/Writer/ValueEnumerator.cpp:1.7 Thu Apr 26 00:53:54 2007 +++ llvm/lib/Bitcode/Writer/ValueEnumerator.cpp Thu May 3 17:18:21 2007 @@ -180,8 +180,8 @@ isa(*OI)) EnumerateValue(*OI); } - ValueMap[BB] = BasicBlocks.size(); BasicBlocks.push_back(BB); + ValueMap[BB] = BasicBlocks.size(); } FirstInstID = Values.size(); From sabre at nondot.org Thu May 3 17:19:52 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 17:19:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705032219.l43MJqcQ006965@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.22 -> 1.23 --- Log message: don't bother encoding # varargs --- Diffs of the changes: (+0 -1) BitcodeWriter.cpp | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.22 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.23 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.22 Thu May 3 17:18:21 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Thu May 3 17:19:34 2007 @@ -660,7 +660,6 @@ // Emit type/value pairs for varargs params. if (FTy->isVarArg()) { unsigned NumVarargs = I.getNumOperands()-1-FTy->getNumParams(); - Vals.push_back(NumVarargs); for (unsigned i = I.getNumOperands()-NumVarargs, e = I.getNumOperands(); i != e; ++i) { Vals.push_back(VE.getTypeID(I.getOperand(i)->getType())); From sabre at nondot.org Thu May 3 17:22:17 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 17:22:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705032222.l43MMHpg007087@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.28 -> 1.29 --- Log message: the type field for a store is the type of the pointer, not the value. With this fix I can round trip treeaadd, only losing calling conv info. --- Diffs of the changes: (+4 -3) BitcodeReader.cpp | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.28 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.29 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.28 Thu May 3 17:18:21 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 17:21:59 2007 @@ -1351,9 +1351,10 @@ case bitc::FUNC_CODE_INST_STORE: { // STORE:[ptrty,val,ptr, align, vol] if (Record.size() < 5) return Error("Invalid LOAD record"); - const Type *OpTy = getTypeByID(Record[0]); - Value *Op = getFnValueByID(Record[1], OpTy); - Value *Ptr = getFnValueByID(Record[2], PointerType::get(OpTy)); + const PointerType *OpTy = + dyn_cast_or_null(getTypeByID(Record[0])); + Value *Op = getFnValueByID(Record[1], OpTy ? OpTy->getElementType() : 0); + Value *Ptr = getFnValueByID(Record[2], OpTy); if (!OpTy || !Op || !Ptr) return Error("Invalid STORE record"); I = new StoreInst(Op, Ptr, (1 << Record[3]) >> 1, Record[4]); From rspencer at reidspencer.com Thu May 3 17:33:17 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Thu, 03 May 2007 18:33:17 -0400 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp In-Reply-To: <200705032222.l43MMHpg007087@zion.cs.uiuc.edu> References: <200705032222.l43MMHpg007087@zion.cs.uiuc.edu> Message-ID: On Thu, 3 May 2007 17:22:17 -0500 Chris Lattner wrote: > > >Changes in directory llvm/lib/Bitcode/Reader: > >BitcodeReader.cpp updated: 1.28 -> 1.29 >--- >Log message: > >the type field for a store is the type of the pointer, not the value. > >With this fix I can round trip treeaadd, only losing calling conv info. Nice. Sounds like you're getting close. Reid. > > >--- >Diffs of the changes: (+4 -3) > > BitcodeReader.cpp | 7 ++++--- > 1 files changed, 4 insertions(+), 3 deletions(-) > > >Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp >diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.28 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.29 >--- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.28 Thu May 3 17:18:21 2007 >+++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 17:21:59 2007 >@@ -1351,9 +1351,10 @@ > case bitc::FUNC_CODE_INST_STORE: { // STORE:[ptrty,val,ptr, align, vol] > if (Record.size() < 5) > return Error("Invalid LOAD record"); >- const Type *OpTy = getTypeByID(Record[0]); >- Value *Op = getFnValueByID(Record[1], OpTy); >- Value *Ptr = getFnValueByID(Record[2], PointerType::get(OpTy)); >+ const PointerType *OpTy = >+ dyn_cast_or_null(getTypeByID(Record[0])); >+ Value *Op = getFnValueByID(Record[1], OpTy ? OpTy->getElementType() : 0); >+ Value *Ptr = getFnValueByID(Record[2], OpTy); > if (!OpTy || !Op || !Ptr) > return Error("Invalid STORE record"); > I = new StoreInst(Op, Ptr, (1 << Record[3]) >> 1, Record[4]); > > > >_______________________________________________ >llvm-commits mailing list >llvm-commits at cs.uiuc.edu >http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Thu May 3 17:34:26 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 17:34:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705032234.l43MYQiT007439@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.29 -> 1.30 --- Log message: Encoding calling conv info in call/invoke instrs, tree add now round trips completely --- Diffs of the changes: (+21 -16) BitcodeReader.cpp | 37 +++++++++++++++++++++---------------- 1 files changed, 21 insertions(+), 16 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.29 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.30 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.29 Thu May 3 17:21:59 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 17:34:03 2007 @@ -1236,14 +1236,15 @@ break; } - case bitc::FUNC_CODE_INST_INVOKE: { // INVOKE: [fnty, op0,op1,op2, ...] - if (Record.size() < 4) + case bitc::FUNC_CODE_INST_INVOKE: { // INVOKE: [cc,fnty, op0,op1,op2, ...] + if (Record.size() < 5) return Error("Invalid INVOKE record"); + unsigned CCInfo = Record[0]; const PointerType *CalleeTy = - dyn_cast_or_null(getTypeByID(Record[0])); - Value *Callee = getFnValueByID(Record[1], CalleeTy); - BasicBlock *NormalBB = getBasicBlock(Record[2]); - BasicBlock *UnwindBB = getBasicBlock(Record[3]); + dyn_cast_or_null(getTypeByID(Record[1])); + Value *Callee = getFnValueByID(Record[2], CalleeTy); + BasicBlock *NormalBB = getBasicBlock(Record[3]); + BasicBlock *UnwindBB = getBasicBlock(Record[4]); if (CalleeTy == 0 || Callee == 0 || NormalBB == 0 || UnwindBB == 0) return Error("Invalid INVOKE record"); @@ -1251,17 +1252,17 @@ dyn_cast(CalleeTy->getElementType()); // Check that the right number of fixed parameters are here. - if (FTy == 0 || Record.size() < 4+FTy->getNumParams()) + if (FTy == 0 || Record.size() < 5+FTy->getNumParams()) return Error("Invalid INVOKE record"); SmallVector Ops; for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) { - Ops.push_back(getFnValueByID(Record[4+i], FTy->getParamType(4+i))); + Ops.push_back(getFnValueByID(Record[5+i], FTy->getParamType(i))); if (Ops.back() == 0) return Error("Invalid INVOKE record"); } - unsigned FirstVarargParam = 4+FTy->getNumParams(); + unsigned FirstVarargParam = 5+FTy->getNumParams(); if (FTy->isVarArg()) { // Read type/value pairs for varargs params. if ((Record.size()-FirstVarargParam) & 1) @@ -1279,6 +1280,7 @@ } I = new InvokeInst(Callee, NormalBB, UnwindBB, &Ops[0], Ops.size()); + cast(I)->setCallingConv(CCInfo); break; } case bitc::FUNC_CODE_INST_UNWIND: // UNWIND @@ -1360,27 +1362,28 @@ I = new StoreInst(Op, Ptr, (1 << Record[3]) >> 1, Record[4]); break; } - case bitc::FUNC_CODE_INST_CALL: { // CALL: [fnty, fnid, arg0, arg1...] - if (Record.size() < 2) + case bitc::FUNC_CODE_INST_CALL: { // CALL: [cc, fnty, fnid, arg0, arg1...] + if (Record.size() < 3) return Error("Invalid CALL record"); + unsigned CCInfo = Record[0]; const PointerType *OpTy = - dyn_cast_or_null(getTypeByID(Record[0])); + dyn_cast_or_null(getTypeByID(Record[1])); const FunctionType *FTy = 0; if (OpTy) FTy = dyn_cast(OpTy->getElementType()); - Value *Callee = getFnValueByID(Record[1], OpTy); - if (!FTy || !Callee || Record.size() < FTy->getNumParams()+2) + Value *Callee = getFnValueByID(Record[2], OpTy); + if (!FTy || !Callee || Record.size() < FTy->getNumParams()+3) return Error("Invalid CALL record"); SmallVector Args; // Read the fixed params. for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i) { - Args.push_back(getFnValueByID(Record[i+2], FTy->getParamType(i))); + Args.push_back(getFnValueByID(Record[i+3], FTy->getParamType(i))); if (Args.back() == 0) return Error("Invalid CALL record"); } // Read type/value pairs for varargs params. - unsigned NextArg = FTy->getNumParams()+2; + unsigned NextArg = FTy->getNumParams()+3; if (!FTy->isVarArg()) { if (NextArg != Record.size()) return Error("Invalid CALL record"); @@ -1395,6 +1398,8 @@ } I = new CallInst(Callee, &Args[0], Args.size()); + cast(I)->setCallingConv(CCInfo>>1); + cast(I)->setTailCall(CCInfo & 1); break; } case bitc::FUNC_CODE_INST_VAARG: { // VAARG: [valistty, valist, instty] From sabre at nondot.org Thu May 3 17:34:27 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 17:34:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705032234.l43MYRnW007444@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.23 -> 1.24 --- Log message: Encoding calling conv info in call/invoke instrs, tree add now round trips completely --- Diffs of the changes: (+3 -2) BitcodeWriter.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.23 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.24 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.23 Thu May 3 17:19:34 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Thu May 3 17:34:03 2007 @@ -571,7 +571,7 @@ break; case Instruction::Invoke: { Code = bitc::FUNC_CODE_INST_INVOKE; - // FIXME: param attrs + Vals.push_back(cast(I).getCallingConv()); Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); Vals.push_back(VE.getValueID(I.getOperand(0))); // callee Vals.push_back(VE.getValueID(I.getOperand(1))); // normal @@ -647,7 +647,8 @@ break; case Instruction::Call: { Code = bitc::FUNC_CODE_INST_CALL; - // FIXME: param attrs + Vals.push_back((cast(I).getCallingConv() << 1) | + cast(I).isTailCall()); Vals.push_back(VE.getTypeID(I.getOperand(0)->getType())); Vals.push_back(VE.getValueID(I.getOperand(0))); // callee From evan.cheng at apple.com Thu May 3 17:46:16 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 17:46:16 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/JM/lencod/data/encoder_small.cfg Message-ID: <200705032246.l43MkGi5007854@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/JM/lencod/data: encoder_small.cfg added (r1.1) --- Log message: Implement SMALL_PROBLEM_SIZE=1. --- Diffs of the changes: (+394 -0) encoder_small.cfg | 394 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 394 insertions(+) Index: llvm-test/MultiSource/Applications/JM/lencod/data/encoder_small.cfg diff -c /dev/null llvm-test/MultiSource/Applications/JM/lencod/data/encoder_small.cfg:1.1 *** /dev/null Thu May 3 17:46:07 2007 --- llvm-test/MultiSource/Applications/JM/lencod/data/encoder_small.cfg Thu May 3 17:45:57 2007 *************** *** 0 **** --- 1,394 ---- + # New Input File Format is as follows + # = # Comment + # + # See configfile.h for a list of supported ParameterNames + + + ########################################################################################## + # Files + ########################################################################################## + InputFile = "foreman_part_qcif_444.yuv" # Input sequence + InputHeaderLength = 0 # If the inputfile has a header, state it's length in byte here + StartFrame = 0 # Start frame for encoding. (0-N) + FramesToBeEncoded = 2 # Number of frames to be coded + FrameRate = 30.0 # Frame Rate per second (0.1-100.0) + SourceWidth = 176 # Frame width + SourceHeight = 144 # Frame height + TraceFile = "trace_enc.txt" + ReconFile = "Output/test_rec.yuv" + OutputFile = "Output/test.264" + + ########################################################################################## + # Encoder Control + ########################################################################################## + ProfileIDC = 144 # Profile IDC (66=baseline, 77=main, 88=extended; FREXT Profiles: 100=High, 110=High 10, 122=High 4:2:2, 144=High 4:4:4, for params see below) + LevelIDC = 40 # Level IDC (e.g. 20 = level 2.0) + + IntraPeriod = 0 # Period of I-Frames (0=only first) + EnableOpenGOP = 0 # Support for open GOPs (0: disabled, 1: enabled) + IDRIntraEnable = 0 # Force IDR Intra (0=disable 1=enable) + QPISlice = 28 # Quant. param for I Slices (0-51) + QPPSlice = 28 # Quant. param for P Slices (0-51) + FrameSkip = 1 # Number of frames to be skipped in input (e.g 2 will code every third frame) + ChromaQPOffset = 0 # Chroma QP offset (-51..51) + + DisableSubpelME = 0 # Disable Subpixel Motion Estimation (0=off/default, 1=on) + SearchRange = 16 # Max search range + + MEDistortionFPel = 0 # Select error metric for Full-Pel ME (0: SAD, 1: SSE, 2: Hadamard SAD) + MEDistortionHPel = 2 # Select error metric for Half-Pel ME (0: SAD, 1: SSE, 2: Hadamard SAD) + MEDistortionQPel = 2 # Select error metric for Quarter-Pel ME (0: SAD, 1: SSE, 2: Hadamard SAD) + MDDistortion = 2 # Select error metric for Mode Decision (0: SAD, 1: SSE, 2: Hadamard SAD) + ChromaMCBuffer = 0 # Calculate Color component interpolated values in advance and store them. + # Provides a trade-off between memory and computational complexity + # (0: disabled/default, 1: enabled) + ChromaMEEnable = 0 # Take into account Color component information during ME + # (0: only first component/default, 1: All Color components) + + NumberReferenceFrames = 5 # Number of previous frames used for inter motion search (1-16) + + PList0References = 0 # P slice List 0 reference override (0 disable, N <= NumberReferenceFrames) + Log2MaxFNumMinus4 = 0 # Sets log2_max_frame_num_minus4 (-1 : based on FramesToBeEncoded/Auto, >=0 : Log2MaxFNumMinus4) + Log2MaxPOCLsbMinus4 = -1 # Sets log2_max_pic_order_cnt_lsb_minus4 (-1 : Auto, >=0 : Log2MaxPOCLsbMinus4) + + GenerateMultiplePPS = 0 # Transmit multiple parameter sets. Currently parameters basically enable all WP modes (0: diabled, 1: enabled) + ResendPPS = 0 # Resend PPS (with pic_parameter_set_id 0) for every coded Frame/Field pair (0: disabled, 1: enabled) + + MbLineIntraUpdate = 0 # Error robustness(extra intra macro block updates)(0=off, N: One GOB every N frames are intra coded) + RandomIntraMBRefresh = 0 # Forced intra MBs per picture + InterSearch16x16 = 1 # Inter block search 16x16 (0=disable, 1=enable) + InterSearch16x8 = 1 # Inter block search 16x8 (0=disable, 1=enable) + InterSearch8x16 = 1 # Inter block search 8x16 (0=disable, 1=enable) + InterSearch8x8 = 1 # Inter block search 8x8 (0=disable, 1=enable) + InterSearch8x4 = 1 # Inter block search 8x4 (0=disable, 1=enable) + InterSearch4x8 = 1 # Inter block search 4x8 (0=disable, 1=enable) + InterSearch4x4 = 1 # Inter block search 4x4 (0=disable, 1=enable) + + IntraDisableInterOnly = 0 # Apply Disabling Intra conditions only to Inter Slices (0:disable/default,1: enable) + Intra4x4ParDisable = 0 # Disable Vertical & Horizontal 4x4 + Intra4x4DiagDisable = 0 # Disable Diagonal 45degree 4x4 + Intra4x4DirDisable = 0 # Disable Other Diagonal 4x4 + Intra16x16ParDisable = 0 # Disable Vertical & Horizontal 16x16 + Intra16x16PlaneDisable = 0 # Disable Planar 16x16 + ChromaIntraDisable = 0 # Disable Intra Chroma modes other than DC + EnableIPCM = 1 # Enable IPCM macroblock mode + + DisposableP = 0 # Enable Disposable P slices in the primary layer (0: disable/default, 1: enable) + DispPQPOffset = 0 # Quantizer offset for disposable P slices (0: default) + + ########################################################################################## + # B Slices + ########################################################################################## + + NumberBFrames = 1 # Number of B coded frames inserted (0=not used) + QPBSlice = 30 # Quant. param for B slices (0-51) + BRefPicQPOffset = -1 # Quantization offset for reference B coded pictures (-51..51) + DirectModeType = 1 # Direct Mode Type (0:Temporal 1:Spatial) + DirectInferenceFlag = 1 # Direct Inference Flag (0: Disable 1: Enable) + BList0References = 0 # B slice List 0 reference override (0 disable, N <= NumberReferenceFrames) + BList1References = 1 # B slice List 1 reference override (0 disable, N <= NumberReferenceFrames) + # 1 List1 reference is usually recommended for normal GOP Structures. + # A larger value is usually more appropriate if a more flexible + # structure is used (i.e. using HierarchicalCoding) + + BReferencePictures = 0 # Referenced B coded pictures (0=off, 1=on) + + HierarchicalCoding = 0 # B hierarchical coding (0= off, 1= 2 layers, 2= 2 full hierarchy, 3 = explicit) + HierarchyLevelQPEnable = 1 # Adjust QP based on hierarchy level (in increments of 1). Overrides BRefPicQPOffset behavior.(0=off, 1=on) + ExplicitHierarchyFormat = "b1r0b3r0b2e2b0e2b4r2" # Explicit Enhancement GOP. Format is {FrameDisplay_orderReferenceQP}. + # Valid values for reference type is r:reference, e:non reference. + ReferenceReorder = 1 # Reorder References according to Poc distance for HierarchicalCoding (0=off, 1=enable) + PocMemoryManagement = 1 # Memory management based on Poc Distances for HierarchicalCoding (0=off, 1=on) + + BiPredMotionEstimation = 1 # Enable Bipredictive based Motion Estimation (0:disabled, 1:enabled) + BiPredMERefinements = 3 # Bipredictive ME extra refinements (0: single, N: N extra refinements (1 default) + BiPredMESearchRange = 16 # Bipredictive ME Search range (8 default). Note that range is halved for every extra refinement. + BiPredMESubPel = 2 # Bipredictive ME Subpixel Consideration (0: disabled, 1: single level, 2: dual level) + + + ########################################################################################## + # SP Frames + ########################################################################################## + + SPPicturePeriodicity = 0 # SP-Picture Periodicity (0=not used) + QPSPSlice = 36 # Quant. param of SP-Slices for Prediction Error (0-51) + QPSP2Slice = 35 # Quant. param of SP-Slices for Predicted Blocks (0-51) + SI_FRAMES = 0 # SI frame encoding flag (0=not used, 1=used) + SP_output = 0 # Controls whether coefficients will be output to encode switching SP frames (0=no, 1=yes) + SP_output_name = "low_quality.dat" # Filename for SP output coefficients + SP2_FRAMES = 0 # switching SP frame encoding flag (0=not used, 1=used) + SP2_input_name1 = "high_quality.dat" # Filename for the first swithed bitstream coefficients + SP2_input_name2 = "low_quality.dat" # Filename for the second switched bitstream coefficients + + ########################################################################################## + # Output Control, NALs + ########################################################################################## + + SymbolMode = 1 # Symbol mode (Entropy coding method: 0=UVLC, 1=CABAC) + OutFileMode = 0 # Output file mode, 0:Annex B, 1:RTP + PartitionMode = 0 # Partition Mode, 0: no DP, 1: 3 Partitions per Slice + + ########################################################################################## + # CABAC context initialization + ########################################################################################## + + ContextInitMethod = 1 # Context init (0: fixed, 1: adaptive) + FixedModelNumber = 0 # model number for fixed decision for inter slices ( 0, 1, or 2 ) + + ########################################################################################## + # Interlace Handling + ######################################################################################### + + PicInterlace = 0 # Picture AFF (0: frame coding, 1: field coding, 2:adaptive frame/field coding) + MbInterlace = 0 # Macroblock AFF (0: frame coding, 1: field coding, 2:adaptive frame/field coding) + IntraBottom = 0 # Force Intra Bottom at GOP Period + + ########################################################################################## + # Weighted Prediction + ######################################################################################### + + WeightedPrediction = 0 # P picture Weighted Prediction (0=off, 1=explicit mode) + WeightedBiprediction = 0 # B picture Weighted Prediciton (0=off, 1=explicit mode, 2=implicit mode) + UseWeightedReferenceME = 1 # Use weighted reference for ME (0=off, 1=on) + + ########################################################################################## + # Picture based Multi-pass encoding + ######################################################################################### + + RDPictureDecision = 0 # Perform RD optimal decision between different coded picture versions. + # If GenerateMultiplePPS is enabled then this will test different WP methods. + # Otherwise it will test QP +-1 (0: disabled, 1: enabled) + RDPictureIntra = 0 # Perform RD optimal decision also for intra coded pictures (0: disabled (default), 1: enabled). + RDPSliceWeightOnly = 1 # Only consider Weighted Prediction for P slices in Picture RD decision. (0: disabled, 1: enabled (default)) + RDBSliceWeightOnly = 0 # Only consider Weighted Prediction for B slices in Picture RD decision. (0: disabled (default), 1: enabled ) + + ########################################################################################## + # Loop filter parameters + ########################################################################################## + + LoopFilterParametersFlag = 0 # Configure loop filter (0=parameter below ingored, 1=parameters sent) + LoopFilterDisable = 0 # Disable loop filter in slice header (0=Filter, 1=No Filter) + LoopFilterAlphaC0Offset = 0 # Alpha & C0 offset div. 2, {-6, -5, ... 0, +1, .. +6} + LoopFilterBetaOffset = 0 # Beta offset div. 2, {-6, -5, ... 0, +1, .. +6} + + ########################################################################################## + # Error Resilience / Slices + ########################################################################################## + + SliceMode = 0 # Slice mode (0=off 1=fixed #mb in slice 2=fixed #bytes in slice 3=use callback) + SliceArgument = 50 # Slice argument (Arguments to modes 1 and 2 above) + + num_slice_groups_minus1 = 0 # Number of Slice Groups Minus 1, 0 == no FMO, 1 == two slice groups, etc. + slice_group_map_type = 0 # 0: Interleave, 1: Dispersed, 2: Foreground with left-over, + # 3: Box-out, 4: Raster Scan 5: Wipe + # 6: Explicit, slice_group_id read from SliceGroupConfigFileName + slice_group_change_direction_flag = 0 # 0: box-out clockwise, raster scan or wipe right, + # 1: box-out counter clockwise, reverse raster scan or wipe left + slice_group_change_rate_minus1 = 85 # + SliceGroupConfigFileName = "sg0conf.cfg" # Used for slice_group_map_type 0, 2, 6 + + UseRedundantPicture = 0 # 0: not used, 1: enabled + NumRedundantHierarchy = 1 # 0-4 + PrimaryGOPLength = 10 # GOP length for redundant allocation (1-16) + # NumberReferenceFrames must be no less than PrimaryGOPLength when redundant slice enabled + NumRefPrimary = 1 # Actually used number of references for primary slices (1-16) + + ########################################################################################## + # Search Range Restriction / RD Optimization + ########################################################################################## + + RestrictSearchRange = 2 # restriction for (0: blocks and ref, 1: ref, 2: no restrictions) + RDOptimization = 1 # rd-optimized mode decision + # 0: RD-off (Low complexity mode) + # 1: RD-on (High complexity mode) + # 2: RD-on (Fast high complexity mode - not work in FREX Profiles) + # 3: with losses + CtxAdptLagrangeMult = 0 # Context Adaptive Lagrange Multiplier + # 0: disabled (default) + # 1: enabled (works best when RDOptimization=0) + FastCrIntraDecision = 1 # Fast Chroma intra mode decision (0:off, 1:on) + DisableThresholding = 0 # Disable Thresholding of Transform Coefficients (0:off, 1:on) + DisableBSkipRDO = 0 # Disable B Skip Mode consideration from RDO Mode decision (0:off, 1:on) + SkipIntraInInterSlices = 0 # Skips Intra mode checking in inter slices if certain mode decisions are satisfied (0: off, 1: on) + + # Explicit Lambda Usage + UseExplicitLambdaParams = 0 # Use explicit lambda scaling parameters (0:disabled, 1:enable lambda weight, 2: use explicit lambda value) + FixedLambdaIslice = 0.1 # Fixed Lambda value for I slices + FixedLambdaPslice = 0.1 # Fixed Lambda value for P slices + FixedLambdaBslice = 0.1 # Fixed Lambda value for B slices + FixedLambdaRefBslice = 0.1 # Fixed Lambda value for Referenced B slices + FixedLambdaSPslice = 0.1 # Fixed Lambda value for SP slices + FixedLambdaSIslice = 0.1 # Fixed Lambda value for SI slices + + LambdaWeightIslice = 0.65 # scaling param for I slices. This will be used as a multiplier i.e. lambda=LambdaWeightISlice * 2^((QP-12)/3) + LambdaWeightPslice = 0.68 # scaling param for P slices. This will be used as a multiplier i.e. lambda=LambdaWeightPSlice * 2^((QP-12)/3) + LambdaWeightBslice = 2.00 # scaling param for B slices. This will be used as a multiplier i.e. lambda=LambdaWeightBSlice * 2^((QP-12)/3) + LambdaWeightRefBslice = 1.50 # scaling param for Referenced B slices. This will be used as a multiplier i.e. lambda=LambdaWeightRefBSlice * 2^((QP-12)/3) + LambdaWeightSPslice = 1.50 # scaling param for SP slices. This will be used as a multiplier i.e. lambda=LambdaWeightSPSlice * 2^((QP-12)/3) + LambdaWeightSIslice = 0.65 # scaling param for SI slices. This will be used as a multiplier i.e. lambda=LambdaWeightSISlice * 2^((QP-12)/3) + + LossRateA = 5 # expected packet loss rate of the channel for the first partition, only valid if RDOptimization = 3 + LossRateB = 0 # expected packet loss rate of the channel for the second partition, only valid if RDOptimization = 3 + LossRateC = 0 # expected packet loss rate of the channel for the third partition, only valid if RDOptimization = 3 + NumberOfDecoders = 30 # Numbers of decoders used to simulate the channel, only valid if RDOptimization = 3 + RestrictRefFrames = 0 # Doesnt allow reference to areas that have been intra updated in a later frame. + + ########################################################################################## + # Additional Stuff + ######################################################################################### + + UseConstrainedIntraPred = 0 # If 1, Inter pixels are not used for Intra macroblock prediction. + LastFrameNumber = 0 # Last frame number that have to be coded (0: no effect) + ChangeQPI = 16 # QP (I-slices) for second part of sequence (0-51) + ChangeQPP = 16 # QP (P-slices) for second part of sequence (0-51) + ChangeQPB = 18 # QP (B-slices) for second part of sequence (0-51) + ChangeQPBSRefOffset = 2 # QP offset (stored B-slices) for second part of sequence (-51..51) + ChangeQPStart = 0 # Frame no. for second part of sequence (0: no second part) + + NumberofLeakyBuckets = 8 # Number of Leaky Bucket values + LeakyBucketRateFile = "leakybucketrate.cfg" # File from which encoder derives rate values + LeakyBucketParamFile = "Output/leakybucketparam.cfg" # File where encoder stores leakybucketparams + + NumberFramesInEnhancementLayerSubSequence = 0 # number of frames in the Enhanced Scalability Layer(0: no Enhanced Layer) + NumberOfFrameInSecondIGOP = 0 # Number of frames to be coded in the second IGOP + + SparePictureOption = 0 # (0: no spare picture info, 1: spare picture available) + SparePictureDetectionThr = 6 # Threshold for spare reference pictures detection + SparePicturePercentageThr = 92 # Threshold for the spare macroblock percentage + + PicOrderCntType = 0 # (0: POC mode 0, 1: POC mode 1, 2: POC mode 2) + + ######################################################################################## + #Rate control + ######################################################################################## + + RateControlEnable = 0 # 0 Disable, 1 Enable + Bitrate = 45020 # Bitrate(bps) + InitialQP = 0 # Initial Quantization Parameter for the first I frame + # InitialQp depends on two values: Bits Per Picture, + # and the GOP length + BasicUnit = 11 # Number of MBs in the basic unit + # should be a fractor of the total number + # of MBs in a frame + ChannelType = 0 # type of channel( 1=time varying channel; 0=Constant channel) + RCUpdateMode = 0 # Rate Control type. Modes supported : + # 0 = original JM rate control, + # 1 = rate control that is applied to all frames regardless of the slice type, + # 2 = original plus intelligent QP selection for I and B slices (including Hierarchical), + # 3 = original + hybrid quadratic rate control for I and B slice using bit rate statistics + # + RCISliceBitRatio = 1.0 # target ratio of bits for I-coded pictures compared to P-coded Pictures (for RCUpdateMode=3) + RCBSliceBitRatio0 = 0.5 # target ratio of bits for B-coded pictures compared to P-coded Pictures - temporal level 0 (for RCUpdateMode=3) + RCBSliceBitRatio1 = 0.25 # target ratio of bits for B-coded pictures compared to P-coded Pictures - temporal level 1 (for RCUpdateMode=3) + RCBSliceBitRatio2 = 0.25 # target ratio of bits for B-coded pictures compared to P-coded Pictures - temporal level 2 (for RCUpdateMode=3) + RCBSliceBitRatio3 = 0.25 # target ratio of bits for B-coded pictures compared to P-coded Pictures - temporal level 3 (for RCUpdateMode=3) + RCBSliceBitRatio4 = 0.25 # target ratio of bits for B-coded pictures compared to P-coded Pictures - temporal level 4 (for RCUpdateMode=3) + RCBoverPRatio = 0.45 # ratio of bit rate usage of a B-coded picture over a P-coded picture for the SAME QP (for RCUpdateMode=3) + RCIoverPRatio = 3.80 # ratio of bit rate usage of an I-coded picture over a P-coded picture for the SAME QP (for RCUpdateMode=3) + + ######################################################################################## + #Fast Mode Decision + ######################################################################################## + EarlySkipEnable = 0 # Early skip detection (0: Disable 1: Enable) + SelectiveIntraEnable = 0 # Selective Intra mode decision (0: Disable 1: Enable) + + ######################################################################################## + #FREXT stuff + ######################################################################################## + + YUVFormat = 2 # YUV format (0=4:0:0, 1=4:2:0, 2=4:2:2, 3=4:4:4) + RGBInput = 0 # 1=RGB input, 0=GBR or YUV input + BitDepthLuma = 8 # Bit Depth for Luminance (8...12 bits) + BitDepthChroma = 8 # Bit Depth for Chrominance (8...12 bits) + CbQPOffset = 0 # Chroma QP offset for Cb-part (-51..51) + CrQPOffset = 0 # Chroma QP offset for Cr-part (-51..51) + Transform8x8Mode = 1 # (0: only 4x4 transform, 1: allow using 8x8 transform additionally, 2: only 8x8 transform) + ReportFrameStats = 0 # (0:Disable Frame Statistics 1: Enable) + DisplayEncParams = 0 # (0:Disable Display of Encoder Params 1: Enable) + Verbose = 1 # level of display verboseness (0:short, 1:normal, 2:detailed) + + ######################################################################################## + #Q-Matrix (FREXT) + ######################################################################################## + QmatrixFile = "q_matrix.cfg" + + ScalingMatrixPresentFlag = 0 # Enable Q_Matrix (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS) + ScalingListPresentFlag0 = 3 # Intra4x4_Luma (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS) + ScalingListPresentFlag1 = 3 # Intra4x4_ChromaU (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS) + ScalingListPresentFlag2 = 3 # Intra4x4_chromaV (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS) + ScalingListPresentFlag3 = 3 # Inter4x4_Luma (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS) + ScalingListPresentFlag4 = 3 # Inter4x4_ChromaU (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS) + ScalingListPresentFlag5 = 3 # Inter4x4_ChromaV (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS) + ScalingListPresentFlag6 = 3 # Intra8x8_Luma (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS) + ScalingListPresentFlag7 = 3 # Inter8x8_Luma (0 Not present, 1 Present in SPS, 2 Present in PPS, 3 Present in both SPS & PPS) + + ######################################################################################## + #Rounding Offset control + ######################################################################################## + + OffsetMatrixPresentFlag = 0 # Enable Explicit Offset Quantization Matrices (0: disable 1: enable) + QOffsetMatrixFile = "q_offset.cfg" # Explicit Quantization Matrices file + + AdaptiveRounding = 1 # Enable Adaptive Rounding based on JVT-N011 (0: disable, 1: enable) + AdaptRndPeriod = 1 # Period in terms of MBs for updating rounding offsets. + # 0 performs update at the picture level. Default is 16. 1 is as in JVT-N011. + AdaptRndChroma = 1 # Enables coefficient rounding adaptation for chroma + + AdaptRndWFactorIRef = 4 # Adaptive Rounding Weight for I/SI slices in reference pictures /4096 + AdaptRndWFactorPRef = 4 # Adaptive Rounding Weight for P/SP slices in reference pictures /4096 + AdaptRndWFactorBRef = 4 # Adaptive Rounding Weight for B slices in reference pictures /4096 + AdaptRndWFactorINRef = 4 # Adaptive Rounding Weight for I/SI slices in non reference pictures /4096 + AdaptRndWFactorPNRef = 4 # Adaptive Rounding Weight for P/SP slices in non reference pictures /4096 + AdaptRndWFactorBNRef = 4 # Adaptive Rounding Weight for B slices in non reference pictures /4096 + + AdaptRndCrWFactorIRef = 4 # Chroma Adaptive Rounding Weight for I/SI slices in reference pictures /4096 + AdaptRndCrWFactorPRef = 4 # Chroma Adaptive Rounding Weight for P/SP slices in reference pictures /4096 + AdaptRndCrWFactorBRef = 4 # Chroma Adaptive Rounding Weight for B slices in reference pictures /4096 + AdaptRndCrWFactorINRef = 4 # Chroma Adaptive Rounding Weight for I/SI slices in non reference pictures /4096 + AdaptRndCrWFactorPNRef = 4 # Chroma Adaptive Rounding Weight for P/SP slices in non reference pictures /4096 + AdaptRndCrWFactorBNRef = 4 # Chroma Adaptive Rounding Weight for B slices in non reference pictures /4096 + + ######################################################################################## + #Lossless Coding (FREXT) + ######################################################################################## + + QPPrimeYZeroTransformBypassFlag = 0 # Enable lossless coding when qpprime_y is zero (0 Disabled, 1 Enabled) + + ######################################################################################## + #Fast Motion Estimation Control Parameters + ######################################################################################## + + SearchMode = 0 # Use fast motion estimation (0=disable/default, 1=UMHexagonS, + # 2=Simplified UMHexagonS, 3=EPZS patterns) + UMHexDSR = 1 # Use Search Range Prediction. Only for UMHexagonS method + # (0:disable, 1:enabled/default) + UMHexScale = 3 # Use Scale_factor for different image sizes. Only for UMHexagonS method + # (0:disable, 3:/default) + # Increasing value can speed up Motion Search. + + EPZSPattern = 2 # Select EPZS primary refinement pattern. + # (0: small diamond, 1: square, 2: extended diamond/default, + # 3: large diamond) + EPZSDualRefinement = 3 # Enables secondary refinement pattern. + # (0:disabled, 1: small diamond, 2: square, + # 3: extended diamond/default, 4: large diamond) + EPZSFixedPredictors = 2 # Enables Window based predictors + # (0:disabled, 1: P only, 2: P and B/default) + EPZSTemporal = 1 # Enables temporal predictors + # (0: disabled, 1: enabled/default) + EPZSSpatialMem = 1 # Enables spatial memory predictors + # (0: disabled, 1: enabled/default) + EPZSMinThresScale = 0 # Scaler for EPZS minimum threshold (0 default). + # Increasing value can speed up encoding. + EPZSMedThresScale = 1 # Scaler for EPZS median threshold (1 default). + # Increasing value can speed up encoding. + EPZSMaxThresScale = 2 # Scaler for EPZS maximum threshold (1 default). + # Increasing value can speed up encoding. + EPZSSubPelME = 1 # EPZS Subpel ME consideration + EPZSSubPelMEBiPred = 1 # EPZS Subpel ME consideration for BiPred partitions + EPZSSubPelThresScale = 2 # EPZS Subpel ME Threshold scaler + EPZSSubPelGrid = 0 # Perform EPZS using a subpixel grid + + Generate_SEIVUI = 0 + SEIMessageText = "H.264/AVC Encoder" + From evan.cheng at apple.com Thu May 3 17:46:21 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 17:46:21 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/JM/lencod/Makefile Message-ID: <200705032246.l43MkLGo007859@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/JM/lencod: Makefile updated: 1.4 -> 1.5 --- Log message: Implement SMALL_PROBLEM_SIZE=1. --- Diffs of the changes: (+4 -0) Makefile | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-test/MultiSource/Applications/JM/lencod/Makefile diff -u llvm-test/MultiSource/Applications/JM/lencod/Makefile:1.4 llvm-test/MultiSource/Applications/JM/lencod/Makefile:1.5 --- llvm-test/MultiSource/Applications/JM/lencod/Makefile:1.4 Thu Mar 29 18:38:42 2007 +++ llvm-test/MultiSource/Applications/JM/lencod/Makefile Thu May 3 17:45:57 2007 @@ -4,6 +4,10 @@ LDFLAGS = -lm $(TOOLLINKOPTS) FP_TOLERANCE = 0.025 +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = -d $(PROJ_SRC_DIR)/data/encoder_small.cfg -p InputFile=$(PROJ_SRC_DIR)/data/foreman_part_qcif_444.yuv -p LeakyBucketRateFile=$(PROJ_SRC_DIR)/data/leakybucketrate.cfg -p QmatrixFile=$(PROJ_SRC_DIR)/data/q_matrix.cfg +else RUN_OPTIONS = -d $(PROJ_SRC_DIR)/data/encoder.cfg -p InputFile=$(PROJ_SRC_DIR)/data/foreman_part_qcif_444.yuv -p LeakyBucketRateFile=$(PROJ_SRC_DIR)/data/leakybucketrate.cfg -p QmatrixFile=$(PROJ_SRC_DIR)/data/q_matrix.cfg +endif include ../../../Makefile.multisrc From sabre at nondot.org Thu May 3 17:47:01 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 17:47:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/ValueEnumerator.cpp ValueEnumerator.h Message-ID: <200705032247.l43Ml1NR007927@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: ValueEnumerator.cpp updated: 1.8 -> 1.9 ValueEnumerator.h updated: 1.7 -> 1.8 --- Log message: enumerate parameter attr lists. --- Diffs of the changes: (+33 -0) ValueEnumerator.cpp | 17 +++++++++++++++++ ValueEnumerator.h | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) Index: llvm/lib/Bitcode/Writer/ValueEnumerator.cpp diff -u llvm/lib/Bitcode/Writer/ValueEnumerator.cpp:1.8 llvm/lib/Bitcode/Writer/ValueEnumerator.cpp:1.9 --- llvm/lib/Bitcode/Writer/ValueEnumerator.cpp:1.8 Thu May 3 17:18:21 2007 +++ llvm/lib/Bitcode/Writer/ValueEnumerator.cpp Thu May 3 17:46:43 2007 @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "ValueEnumerator.h" +#include "llvm/DerivedTypes.h" #include "llvm/Module.h" #include "llvm/TypeSymbolTable.h" #include "llvm/ValueSymbolTable.h" @@ -143,8 +144,24 @@ for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end(); I != E; ++I) EnumerateType(*I); + + // If this is a function type, enumerate the param attrs. + if (const FunctionType *FTy = dyn_cast(Ty)) + EnumerateParamAttrs(FTy->getParamAttrs()); } +void ValueEnumerator::EnumerateParamAttrs(const ParamAttrsList *PAL) { + if (PAL == 0) return; // null is always 0. + // Do a lookup. + unsigned &Entry = ParamAttrMap[PAL]; + if (Entry == 0) { + // Never saw this before, add it. + ParamAttrs.push_back(PAL); + Entry = ParamAttrs.size(); + } +} + + /// PurgeAggregateValues - If there are any aggregate values at the end of the /// value list, remove them and return the count of the remaining values. If /// there are none, return -1. Index: llvm/lib/Bitcode/Writer/ValueEnumerator.h diff -u llvm/lib/Bitcode/Writer/ValueEnumerator.h:1.7 llvm/lib/Bitcode/Writer/ValueEnumerator.h:1.8 --- llvm/lib/Bitcode/Writer/ValueEnumerator.h:1.7 Thu Apr 26 00:53:54 2007 +++ llvm/lib/Bitcode/Writer/ValueEnumerator.h Thu May 3 17:46:43 2007 @@ -24,6 +24,7 @@ class BasicBlock; class Function; class Module; +class ParamAttrsList; class TypeSymbolTable; class ValueSymbolTable; @@ -43,6 +44,10 @@ ValueMapType ValueMap; ValueList Values; + typedef DenseMap ParamAttrMapType; + ParamAttrMapType ParamAttrMap; + std::vector ParamAttrs; + /// BasicBlocks - This contains all the basic blocks for the currently /// incorporated function. Their reverse mapping is stored in ValueMap. std::vector BasicBlocks; @@ -69,6 +74,13 @@ assert(I != TypeMap.end() && "Type not in ValueEnumerator!"); return I->second-1; } + + unsigned getParamAttrID(const ParamAttrsList *PAL) const { + if (PAL == 0) return 0; // Null maps to zero. + ParamAttrMapType::const_iterator I = ParamAttrMap.find(PAL); + assert(I != ParamAttrMap.end() && "ParamAttr not in ValueEnumerator!"); + return I->second; + } /// getFunctionConstantRange - Return the range of values that corresponds to /// function-local constants. @@ -82,6 +94,9 @@ const std::vector &getBasicBlocks() const { return BasicBlocks; } + const std::vector getParamAttrs() const { + return ParamAttrs; + } /// PurgeAggregateValues - If there are any aggregate values at the end of the /// value list, remove them and return the count of the remaining values. If @@ -97,6 +112,7 @@ private: void EnumerateValue(const Value *V); void EnumerateType(const Type *T); + void EnumerateParamAttrs(const ParamAttrsList *PAL); void EnumerateTypeSymbolTable(const TypeSymbolTable &ST); void EnumerateValueSymbolTable(const ValueSymbolTable &ST); From lauro.venancio at gmail.com Thu May 3 17:55:45 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 3 May 2007 17:55:45 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000/Makefile Message-ID: <200705032255.l43MtjBl008127@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000: Makefile updated: 1.3 -> 1.4 --- Log message: I need to reduce more. My board has only 32MB of RAM. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000/Makefile diff -u llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000/Makefile:1.3 llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000/Makefile:1.4 --- llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000/Makefile:1.3 Thu May 3 17:09:59 2007 +++ llvm-test/MultiSource/Benchmarks/ASCI_Purple/SMG2000/Makefile Thu May 3 17:55:27 2007 @@ -11,7 +11,7 @@ #include $(LLVM_OBJ_ROOT)/Makefile.config ifdef SMALL_PROBLEM_SIZE -RUN_OPTIONS ="-n 40 20 40 -c 0.1 1.0 10.0" +RUN_OPTIONS ="-n 30 15 30 -c 0.1 1.0 10.0" else RUN_OPTIONS ="-n 100 40 100 -c 0.1 1.0 10.0" endif From evan.cheng at apple.com Thu May 3 17:59:35 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 17:59:35 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/minisat/small.cnf.gz Makefile Message-ID: <200705032259.l43MxZID008715@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/minisat: small.cnf.gz added (r1.1) Makefile updated: 1.11 -> 1.12 --- Log message: Implement SMALL_PROBLEM_SIZE=1. --- Diffs of the changes: (+7 -2) Makefile | 9 +++++++-- small.cnf.gz | 0 2 files changed, 7 insertions(+), 2 deletions(-) Index: llvm-test/MultiSource/Applications/minisat/small.cnf.gz Index: llvm-test/MultiSource/Applications/minisat/Makefile diff -u llvm-test/MultiSource/Applications/minisat/Makefile:1.11 llvm-test/MultiSource/Applications/minisat/Makefile:1.12 --- llvm-test/MultiSource/Applications/minisat/Makefile:1.11 Thu Mar 29 19:38:42 2007 +++ llvm-test/MultiSource/Applications/minisat/Makefile Thu May 3 17:59:17 2007 @@ -4,11 +4,16 @@ PROG = minisat CPPFLAGS = -D NDEBUG LDFLAGS = -lz -lm -RUN_OPTIONS = -verbosity=0 $(PROJ_SRC_DIR)/short.cnf.gz -FP_TOLERANCE = 0.1 +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = -verbosity=0 $(PROJ_SRC_DIR)/small.cnf.gz +else ifdef LARGE_PROBLEM_SIZE RUN_OPTIONS = -verbosity=0 $(PROJ_SRC_DIR)/long.cnf.gz +else +RUN_OPTIONS = -verbosity=0 $(PROJ_SRC_DIR)/short.cnf.gz endif +endif +FP_TOLERANCE = 0.1 include ../../Makefile.multisrc From evan.cheng at apple.com Thu May 3 18:08:55 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 18:08:55 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/Makefile.spec2000 Makefile.spec2006 Makefile.spec95 Message-ID: <200705032308.l43N8tE2009131@zion.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC: Makefile.spec2000 updated: 1.8 -> 1.9 Makefile.spec2006 updated: 1.2 -> 1.3 Makefile.spec95 updated: 1.11 -> 1.12 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+15 -3) Makefile.spec2000 | 4 ++++ Makefile.spec2006 | 10 +++++++--- Makefile.spec95 | 4 ++++ 3 files changed, 15 insertions(+), 3 deletions(-) Index: llvm-test/External/SPEC/Makefile.spec2000 diff -u llvm-test/External/SPEC/Makefile.spec2000:1.8 llvm-test/External/SPEC/Makefile.spec2000:1.9 --- llvm-test/External/SPEC/Makefile.spec2000:1.8 Tue Nov 28 18:47:17 2006 +++ llvm-test/External/SPEC/Makefile.spec2000 Thu May 3 18:08:37 2007 @@ -12,12 +12,16 @@ # RUN_TYPE - Either ref, test, or train. May be specified on the command line. # individual tests may override this to provide better input sizes ifndef RUN_TYPE +ifdef SMALL_PROBLEM_SIZE +RUN_TYPE := test +else ifdef LARGE_PROBLEM_SIZE RUN_TYPE := ref else RUN_TYPE := train endif endif +endif include $(LEVEL)/External/SPEC/Makefile.spec.config include $(LEVEL)/External/SPEC/Makefile.spec Index: llvm-test/External/SPEC/Makefile.spec2006 diff -u llvm-test/External/SPEC/Makefile.spec2006:1.2 llvm-test/External/SPEC/Makefile.spec2006:1.3 --- llvm-test/External/SPEC/Makefile.spec2006:1.2 Tue Nov 28 18:47:17 2006 +++ llvm-test/External/SPEC/Makefile.spec2006 Thu May 3 18:08:37 2007 @@ -12,10 +12,14 @@ # RUN_TYPE - Either ref, test, or train. May be specified on the command line. # Individual tests may override this to provide better input sizes. ifndef RUN_TYPE -ifdef LARGE_PROBLEM_SIZE - RUN_TYPE := train -else +ifdef SMALL_PROBLEM_SIZE RUN_TYPE := test +else + ifdef LARGE_PROBLEM_SIZE + RUN_TYPE := train + else + RUN_TYPE := test + endif endif endif Index: llvm-test/External/SPEC/Makefile.spec95 diff -u llvm-test/External/SPEC/Makefile.spec95:1.11 llvm-test/External/SPEC/Makefile.spec95:1.12 --- llvm-test/External/SPEC/Makefile.spec95:1.11 Tue Nov 28 18:47:17 2006 +++ llvm-test/External/SPEC/Makefile.spec95 Thu May 3 18:08:37 2007 @@ -12,12 +12,16 @@ # RUN_TYPE - Either ref, test, or train. May be specified on the command line. # individual tests may override this to provide better input sizes ifndef RUN_TYPE +ifdef SMALL_PROBLEM_SIZE +RUN_TYPE := test +else ifdef LARGE_PROBLEM_SIZE RUN_TYPE := ref else RUN_TYPE := train endif endif +endif include $(LEVEL)/External/SPEC/Makefile.spec.config include $(LEVEL)/External/SPEC/Makefile.spec From djg at cray.com Thu May 3 18:20:50 2007 From: djg at cray.com (Dan Gohman) Date: Thu, 3 May 2007 18:20:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <200705032320.l43NKonT009506@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopStrengthReduce.cpp updated: 1.134 -> 1.135 --- Log message: Allow strength reduction to make use of addressing modes for the address operand in a prefetch intrinsic. --- Diffs of the changes: (+10 -1) LoopStrengthReduce.cpp | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.134 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.135 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.134 Wed May 2 20:11:54 2007 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Thu May 3 18:20:33 2007 @@ -19,6 +19,7 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Constants.h" #include "llvm/Instructions.h" +#include "llvm/Intrinsics.h" #include "llvm/Type.h" #include "llvm/DerivedTypes.h" #include "llvm/Analysis/Dominators.h" @@ -1039,9 +1040,17 @@ // Addressing modes can be folded into loads and stores. Be careful that // the store is through the expression, not of the expression though. bool isAddress = isa(UsersToProcess[i].Inst); - if (StoreInst *SI = dyn_cast(UsersToProcess[i].Inst)) + if (StoreInst *SI = dyn_cast(UsersToProcess[i].Inst)) { if (SI->getOperand(1) == UsersToProcess[i].OperandValToReplace) isAddress = true; + } else if (CallInst *CI = dyn_cast(UsersToProcess[i].Inst)) { + // Addressing modes can also be folded into prefetches. + Function *CalledFunc = CI->getCalledFunction(); + if (CalledFunc != NULL && + CalledFunc->getIntrinsicID() == Intrinsic::prefetch && + CI->getOperand(1) == UsersToProcess[i].OperandValToReplace) + isAddress = true; + } MoveImmediateValues(TLI, UsersToProcess[i].Inst, UsersToProcess[i].Base, UsersToProcess[i].Imm, isAddress, L); From evan.cheng at apple.com Thu May 3 18:30:54 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 18:30:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp Message-ID: <200705032330.l43NUs2E009793@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.71 -> 1.72 --- Log message: Should never see an indexed load / store with zero offset. --- Diffs of the changes: (+7 -5) ARMAsmPrinter.cpp | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.71 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.72 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.71 Thu May 3 15:28:35 2007 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Thu May 3 18:30:36 2007 @@ -433,10 +433,11 @@ const MachineOperand &MO2 = MI->getOperand(Op+1); if (!MO1.getReg()) { - if (ARM_AM::getAM2Offset(MO2.getImm())) // Don't print +0. - O << "#" - << (char)ARM_AM::getAM2Op(MO2.getImm()) - << ARM_AM::getAM2Offset(MO2.getImm()); + unsigned ImmOffs = ARM_AM::getAM2Offset(MO2.getImm()); + assert(ImmOffs && "Malformed indexed load / store!"); + O << "#" + << (char)ARM_AM::getAM2Op(MO2.getImm()) + << ImmOffs; return; } @@ -483,8 +484,9 @@ } unsigned ImmOffs = ARM_AM::getAM3Offset(MO2.getImm()); + assert(ImmOffs && "Malformed indexed load / store!"); O << "#" - << (char)ARM_AM::getAM3Op(MO2.getImm()) + << (char)ARM_AM::getAM3Op(MO2.getImm()) << ImmOffs; } From evan.cheng at apple.com Thu May 3 18:51:08 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 18:51:08 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/2006-01-23-UnionInit.c Message-ID: <200705032351.l43Np8lw010111@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests: 2006-01-23-UnionInit.c updated: 1.2 -> 1.3 --- Log message: Temporarily disable this until we've fixed a FE bug. --- Diffs of the changes: (+4 -0) 2006-01-23-UnionInit.c | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-test/SingleSource/UnitTests/2006-01-23-UnionInit.c diff -u llvm-test/SingleSource/UnitTests/2006-01-23-UnionInit.c:1.2 llvm-test/SingleSource/UnitTests/2006-01-23-UnionInit.c:1.3 --- llvm-test/SingleSource/UnitTests/2006-01-23-UnionInit.c:1.2 Sat Nov 25 02:51:03 2006 +++ llvm-test/SingleSource/UnitTests/2006-01-23-UnionInit.c Thu May 3 18:50:50 2007 @@ -1,5 +1,9 @@ #include +#if defined(__arm__) && defined(__APPLE__) +#error "Temporarily disabled" +#endif + //===- PR156 --------------------------------------------------------------===// struct task_struct { char comm[16]; From evan.cheng at apple.com Thu May 3 18:52:38 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 18:52:38 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200705032352.l43Nqc3p010152@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.298 -> 1.299 --- Log message: Don't create indexed load / store with zero offset! --- Diffs of the changes: (+8 -0) DAGCombiner.cpp | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.298 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.299 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.298 Tue May 1 03:53:39 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu May 3 18:52:19 2007 @@ -3110,6 +3110,10 @@ ISD::MemIndexedMode AM = ISD::UNINDEXED; if (!TLI.getPreIndexedAddressParts(N, BasePtr, Offset, AM, DAG)) return false; + // Don't create a indexed load / store with zero offset. + if (isa(Offset) && + cast(Offset)->getValue() == 0) + return false; // Try turning it into a pre-indexed load / store except when: // 1) The base is a frame index. @@ -3239,6 +3243,10 @@ std::swap(BasePtr, Offset); if (Ptr != BasePtr) continue; + // Don't create a indexed load / store with zero offset. + if (isa(Offset) && + cast(Offset)->getValue() == 0) + continue; // Try turning it into a post-indexed load / store except when // 1) All uses are load / store ops that use it as base ptr. From evan.cheng at apple.com Thu May 3 18:53:55 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 18:53:55 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-05-03-BadPostIndexedLd.ll Message-ID: <200705032353.l43NrthN010190@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: 2007-05-03-BadPostIndexedLd.ll added (r1.1) --- Log message: New test case. --- Diffs of the changes: (+113 -0) 2007-05-03-BadPostIndexedLd.ll | 113 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 113 insertions(+) Index: llvm/test/CodeGen/ARM/2007-05-03-BadPostIndexedLd.ll diff -c /dev/null llvm/test/CodeGen/ARM/2007-05-03-BadPostIndexedLd.ll:1.1 *** /dev/null Thu May 3 18:53:46 2007 --- llvm/test/CodeGen/ARM/2007-05-03-BadPostIndexedLd.ll Thu May 3 18:53:36 2007 *************** *** 0 **** --- 1,113 ---- + ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin + + %struct.Connection = type { i32, [10 x i8], i32 } + %struct.IntChunk = type { %struct.cppobjtype, i32, i32*, i32 } + %struct.Point = type { i8*, %struct.cppobjtype, i16 (%struct.Point*) sext *, i16 (%struct.Point*) sext *, double (%struct.Point*)*, double (%struct.Point*)* } + %struct.RefPoint = type { %struct.Point*, %struct.cppobjtype } + %struct.ShortArray = type { %struct.cppobjtype, i32, i16* } + %struct.TestObj = type { i8*, %struct.cppobjtype, i8, [32 x i8], i8*, i8**, i16, i16, i32, i32, i32, i32, float, double, %struct.cppobjtype, i32, i16*, i16**, i8**, i32, %struct.XyPoint, [3 x %struct.Connection], %struct.Point*, %struct.XyPoint*, i32, i8*, i8*, i16*, %struct.ShortArray, %struct.IntChunk, %struct.cppobjtype, %struct.cppobjtype, %struct.RefPoint, i32, %struct.cppobjtype, %struct.cppobjtype } + %struct.XyPoint = type { i16, i16 } + %struct.cppobjtype = type { i32, i16, i16 } + @Msg = external global [256 x i8] ; <[256 x i8]*> [#uses=1] + @.str53615 = external constant [48 x i8] ; <[48 x i8]*> [#uses=1] + @FirstTime.4637.b = external global i1 ; [#uses=1] + + define fastcc void @Draw7(i32 %Option, i32* %Status) { + entry: + %tmp115.b = load i1* @FirstTime.4637.b ; [#uses=1] + br i1 %tmp115.b, label %cond_next239, label %cond_next.i + + cond_next.i: ; preds = %entry + ret void + + cond_next239: ; preds = %entry + %tmp242 = icmp eq i32 0, 0 ; [#uses=1] + br i1 %tmp242, label %cond_next253, label %cond_next296 + + cond_next253: ; preds = %cond_next239 + switch i32 %Option, label %bb1326 [ + i32 3, label %cond_true258 + i32 4, label %cond_true268 + i32 2, label %cond_true279 + i32 1, label %cond_next315 + ] + + cond_true258: ; preds = %cond_next253 + ret void + + cond_true268: ; preds = %cond_next253 + ret void + + cond_true279: ; preds = %cond_next253 + ret void + + cond_next296: ; preds = %cond_next239 + ret void + + cond_next315: ; preds = %cond_next253 + %tmp1140 = icmp eq i32 0, 0 ; [#uses=1] + br i1 %tmp1140, label %cond_true1143, label %bb1326 + + cond_true1143: ; preds = %cond_next315 + %tmp1148 = icmp eq i32 0, 0 ; [#uses=4] + br i1 %tmp1148, label %cond_next1153, label %cond_true1151 + + cond_true1151: ; preds = %cond_true1143 + ret void + + cond_next1153: ; preds = %cond_true1143 + %tmp8.i.i185 = icmp eq i32 0, 0 ; [#uses=1] + br i1 %tmp8.i.i185, label %TestObj_new1.exit, label %cond_true.i.i187 + + cond_true.i.i187: ; preds = %cond_next1153 + ret void + + TestObj_new1.exit: ; preds = %cond_next1153 + %tmp1167 = icmp eq i16 0, 0 ; [#uses=1] + %tmp1178 = icmp eq i32 0, 0 ; [#uses=1] + %bothcond = and i1 %tmp1167, %tmp1178 ; [#uses=1] + br i1 %bothcond, label %bb1199, label %bb1181 + + bb1181: ; preds = %TestObj_new1.exit + ret void + + bb1199: ; preds = %TestObj_new1.exit + br i1 %tmp1148, label %cond_next1235, label %Object_Dump.exit302 + + Object_Dump.exit302: ; preds = %bb1199 + ret void + + cond_next1235: ; preds = %bb1199 + %bothcond10485 = or i1 false, %tmp1148 ; [#uses=1] + br i1 %bothcond10485, label %cond_next1267, label %cond_true1248 + + cond_true1248: ; preds = %cond_next1235 + ret void + + cond_next1267: ; preds = %cond_next1235 + br i1 %tmp1148, label %cond_next1275, label %cond_true1272 + + cond_true1272: ; preds = %cond_next1267 + %tmp1273 = load %struct.TestObj** null ; <%struct.TestObj*> [#uses=2] + %tmp2930.i = ptrtoint %struct.TestObj* %tmp1273 to i32 ; [#uses=1] + %tmp42.i348 = sub i32 0, %tmp2930.i ; [#uses=1] + %tmp45.i = getelementptr %struct.TestObj* %tmp1273, i32 0, i32 0 ; [#uses=2] + %tmp48.i = load i8** %tmp45.i ; [#uses=1] + %tmp50.i350 = call i32 (i8*, i8*, ...)* @sprintf( i8* getelementptr ([256 x i8]* @Msg, i32 0, i32 0), i8* getelementptr ([48 x i8]* @.str53615, i32 0, i32 0), i8* null, i8** %tmp45.i, i8* %tmp48.i ) ; [#uses=0] + br i1 false, label %cond_true.i632.i, label %Ut_TraceMsg.exit648.i + + cond_true.i632.i: ; preds = %cond_true1272 + ret void + + Ut_TraceMsg.exit648.i: ; preds = %cond_true1272 + %tmp57.i = getelementptr i8* null, i32 %tmp42.i348 ; [#uses=0] + ret void + + cond_next1275: ; preds = %cond_next1267 + ret void + + bb1326: ; preds = %cond_next315, %cond_next253 + ret void + } + + declare i32 @sprintf(i8*, i8*, ...) From clattner at apple.com Thu May 3 19:18:55 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 3 May 2007 17:18:55 -0700 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp In-Reply-To: <200705032320.l43NKonT009506@zion.cs.uiuc.edu> References: <200705032320.l43NKonT009506@zion.cs.uiuc.edu> Message-ID: <7D340831-9D63-41BC-AD74-F07C237C24F1@apple.com> > + } else if (CallInst *CI = dyn_cast(UsersToProcess > [i].Inst)) { > + // Addressing modes can also be folded into prefetches. > + Function *CalledFunc = CI->getCalledFunction(); > + if (CalledFunc != NULL && > + CalledFunc->getIntrinsicID() == Intrinsic::prefetch && > + CI->getOperand(1) == UsersToProcess > [i].OperandValToReplace) > + isAddress = true; > + } Cool. One easier way to do this is with llvm/IntrinsicInst.h. You can do stuff like: } else if (IntrinsicInst *II = dyn_cast(UsersToProcess [i].Inst)) { if (II->getIntrinsicID() == Intrinsic::prefetch && ... Which is ever so slightly nicer :) -Chris > > MoveImmediateValues(TLI, UsersToProcess[i].Inst, > UsersToProcess[i].Base, > UsersToProcess[i].Imm, isAddress, L); > > > > _______________________________________________ > 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 Thu May 3 19:27:17 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 19:27:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200705040027.l440RHSu010755@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.49 -> 1.50 --- Log message: On Mac OS X, GV requires an extra load only when relocation-model is non-static. --- Diffs of the changes: (+6 -5) ARMISelLowering.cpp | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.49 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.50 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.49 Thu May 3 15:28:35 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Thu May 3 19:26:58 2007 @@ -812,10 +812,11 @@ } /// GVIsIndirectSymbol - true if the GV will be accessed via an indirect symbol -/// even in dynamic-no-pic mode. -static bool GVIsIndirectSymbol(GlobalValue *GV) { - return (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || - (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode())); +/// even in non-static mode. +static bool GVIsIndirectSymbol(GlobalValue *GV, Reloc::Model RelocM) { + return RelocM != Reloc::Static && + (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || + (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode())); } SDOperand ARMTargetLowering::LowerGlobalAddressDarwin(SDOperand Op, @@ -823,7 +824,7 @@ MVT::ValueType PtrVT = getPointerTy(); GlobalValue *GV = cast(Op)->getGlobal(); Reloc::Model RelocM = getTargetMachine().getRelocationModel(); - bool IsIndirect = GVIsIndirectSymbol(GV); + bool IsIndirect = GVIsIndirectSymbol(GV, RelocM); SDOperand CPAddr; if (RelocM == Reloc::Static) CPAddr = DAG.getTargetConstantPool(GV, PtrVT, 2); From evan.cheng at apple.com Thu May 3 19:29:53 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 19:29:53 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/load-global.ll Message-ID: <200705040029.l440TrKL010808@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: load-global.ll updated: 1.3 -> 1.4 --- Log message: Test load global in static mode. --- Diffs of the changes: (+10 -7) load-global.ll | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) Index: llvm/test/CodeGen/ARM/load-global.ll diff -u llvm/test/CodeGen/ARM/load-global.ll:1.3 llvm/test/CodeGen/ARM/load-global.ll:1.4 --- llvm/test/CodeGen/ARM/load-global.ll:1.3 Sat Apr 21 19:04:12 2007 +++ llvm/test/CodeGen/ARM/load-global.ll Thu May 3 19:29:34 2007 @@ -1,16 +1,19 @@ -; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: llvm-as < %s | \ +; RUN: llc -mtriple=arm-apple-darwin -relocation-model=static | \ +; RUN: not grep {L_G\$non_lazy_ptr} +; RUN: llvm-as < %s | \ ; RUN: llc -mtriple=arm-apple-darwin -relocation-model=dynamic-no-pic | \ ; RUN: grep {L_G\$non_lazy_ptr} | wc -l | grep 2 -; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: llvm-as < %s | \ ; RUN: llc -mtriple=arm-apple-darwin -relocation-model=pic | \ ; RUN: grep {ldr.*pc} | wc -l | grep 1 -; RUN: llvm-upgrade < %s | llvm-as | \ +; RUN: llvm-as < %s | \ ; RUN: llc -mtriple=arm-linux-gnueabi -relocation-model=pic | \ ; RUN: grep {GOT} | wc -l | grep 1 -%G = external global int + at G = external global i32 -int %test1() { - %tmp = load int* %G - ret int %tmp +define i32 @test1() { + %tmp = load i32* @G + ret i32 %tmp } From dpatel at apple.com Thu May 3 19:31:01 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Thu, 3 May 2007 17:31:01 -0700 (PDT) Subject: [llvm-commits] [126856] Handle edge case, when starting offset for bit field Message-ID: <20070504003101.18241E6B8DF@src> Revision: 126856 Author: dpatel Date: 2007-05-03 17:31:00 -0700 (Thu, 03 May 2007) Log Message: ----------- Handle edge case, when starting offset for bit field is outside allocated bytes and starting offset is not at byte boundry. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-types.cpp Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-05-04 00:26:47 UTC (rev 126855) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-05-04 00:31:00 UTC (rev 126856) @@ -1384,10 +1384,11 @@ if (StartOffsetFromByteBoundry != 0) { // New field does not start at byte boundry. PadBits = StartOffsetInBits - (FirstUnallocatedByte*8); - PadBytes = PadBits/8 + 1; - } + PadBytes = PadBits/8; + PadBits = PadBits - PadBytes*8; + } else + PadBytes = StartOffsetInBits/8-FirstUnallocatedByte; - PadBytes += StartOffsetInBits/8-FirstUnallocatedByte; const Type *Pad = Type::Int8Ty; if (PadBytes != 1) Pad = ArrayType::get(Pad, PadBytes); @@ -1396,7 +1397,7 @@ // This field will use some of the bits from this PadBytes, if // starting offset is not at byte boundry. if (StartOffsetFromByteBoundry != 0) - FieldSizeInBits = FieldSizeInBits - (8 - PadBits); + FieldSizeInBits = PadBits; } // Now, Field starts at FirstUnallocatedByte and everything is aligned. From clattner at apple.com Thu May 3 19:33:49 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 3 May 2007 17:33:49 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp In-Reply-To: <200705040027.l440RHSu010755@zion.cs.uiuc.edu> References: <200705040027.l440RHSu010755@zion.cs.uiuc.edu> Message-ID: <419C73E0-2540-4E30-97FF-F7DA1CB49448@apple.com> On May 3, 2007, at 5:27 PM, Evan Cheng wrote: > > > Changes in directory llvm/lib/Target/ARM: > > ARMISelLowering.cpp updated: 1.49 -> 1.50 > --- > Log message: > > On Mac OS X, GV requires an extra load only when relocation-model > is non-static. Does ELF do something similar? If not, this should probably be method on ARMSubTarget, like the X86 backend does. -Chris > --- > Diffs of the changes: (+6 -5) > > ARMISelLowering.cpp | 11 ++++++----- > 1 files changed, 6 insertions(+), 5 deletions(-) > > > Index: llvm/lib/Target/ARM/ARMISelLowering.cpp > diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.49 llvm/lib/ > Target/ARM/ARMISelLowering.cpp:1.50 > --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.49 Thu May 3 > 15:28:35 2007 > +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Thu May 3 19:26:58 2007 > @@ -812,10 +812,11 @@ > } > > /// GVIsIndirectSymbol - true if the GV will be accessed via an > indirect symbol > -/// even in dynamic-no-pic mode. > -static bool GVIsIndirectSymbol(GlobalValue *GV) { > - return (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || > - (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode > ())); > +/// even in non-static mode. > +static bool GVIsIndirectSymbol(GlobalValue *GV, Reloc::Model > RelocM) { > + return RelocM != Reloc::Static && > + (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || > + (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode())); > } > > SDOperand ARMTargetLowering::LowerGlobalAddressDarwin(SDOperand Op, > @@ -823,7 +824,7 @@ > MVT::ValueType PtrVT = getPointerTy(); > GlobalValue *GV = cast(Op)->getGlobal(); > Reloc::Model RelocM = getTargetMachine().getRelocationModel(); > - bool IsIndirect = GVIsIndirectSymbol(GV); > + bool IsIndirect = GVIsIndirectSymbol(GV, RelocM); > SDOperand CPAddr; > if (RelocM == Reloc::Static) > CPAddr = DAG.getTargetConstantPool(GV, PtrVT, 2); > > > > _______________________________________________ > 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 Thu May 3 19:36:55 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 3 May 2007 17:36:55 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp In-Reply-To: <419C73E0-2540-4E30-97FF-F7DA1CB49448@apple.com> References: <200705040027.l440RHSu010755@zion.cs.uiuc.edu> <419C73E0-2540-4E30-97FF-F7DA1CB49448@apple.com> Message-ID: <401819E6-C1E7-411D-AB05-79EFCDD8D79A@apple.com> No idea. Lauro? Evan On May 3, 2007, at 5:33 PM, Chris Lattner wrote: > > On May 3, 2007, at 5:27 PM, Evan Cheng wrote: > >> >> >> Changes in directory llvm/lib/Target/ARM: >> >> ARMISelLowering.cpp updated: 1.49 -> 1.50 >> --- >> Log message: >> >> On Mac OS X, GV requires an extra load only when relocation-model >> is non-static. > > Does ELF do something similar? If not, this should probably be > method on ARMSubTarget, like the X86 backend does. > > -Chris > >> --- >> Diffs of the changes: (+6 -5) >> >> ARMISelLowering.cpp | 11 ++++++----- >> 1 files changed, 6 insertions(+), 5 deletions(-) >> >> >> Index: llvm/lib/Target/ARM/ARMISelLowering.cpp >> diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.49 llvm/lib/ >> Target/ARM/ARMISelLowering.cpp:1.50 >> --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.49 Thu May 3 >> 15:28:35 2007 >> +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Thu May 3 19:26:58 2007 >> @@ -812,10 +812,11 @@ >> } >> >> /// GVIsIndirectSymbol - true if the GV will be accessed via an >> indirect symbol >> -/// even in dynamic-no-pic mode. >> -static bool GVIsIndirectSymbol(GlobalValue *GV) { >> - return (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || >> - (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode >> ())); >> +/// even in non-static mode. >> +static bool GVIsIndirectSymbol(GlobalValue *GV, Reloc::Model >> RelocM) { >> + return RelocM != Reloc::Static && >> + (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || >> + (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode())); >> } >> >> SDOperand ARMTargetLowering::LowerGlobalAddressDarwin(SDOperand Op, >> @@ -823,7 +824,7 @@ >> MVT::ValueType PtrVT = getPointerTy(); >> GlobalValue *GV = cast(Op)->getGlobal(); >> Reloc::Model RelocM = getTargetMachine().getRelocationModel(); >> - bool IsIndirect = GVIsIndirectSymbol(GV); >> + bool IsIndirect = GVIsIndirectSymbol(GV, RelocM); >> SDOperand CPAddr; >> if (RelocM == Reloc::Static) >> CPAddr = DAG.getTargetConstantPool(GV, PtrVT, 2); >> >> >> >> _______________________________________________ >> 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 sabre at nondot.org Thu May 3 19:45:10 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 19:45:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705040045.l440jALo011113@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.24 -> 1.25 --- Log message: trivial scaffolding for param attrs --- Diffs of the changes: (+12 -0) BitcodeWriter.cpp | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.24 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.25 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.24 Thu May 3 17:34:03 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Thu May 3 19:44:52 2007 @@ -80,6 +80,15 @@ Stream.EmitRecord(Code, Vals, AbbrevToUse); } +// Emit information about parameter attributes. +static void WriteParamAttrTable(const ValueEnumerator &VE, + BitstreamWriter &Stream) { + const std::vector &Attrs = VE.getParamAttrs(); + if (Attrs.empty()) return; + + + +} /// WriteTypeTable - Write out the type table for a module. static void WriteTypeTable(const ValueEnumerator &VE, BitstreamWriter &Stream) { @@ -799,6 +808,9 @@ // Analyze the module, enumerating globals, functions, etc. ValueEnumerator VE(M); + // Emit information about parameter attributes. + WriteParamAttrTable(VE, Stream); + // Emit information describing all of the types in the module. WriteTypeTable(VE, Stream); From sabre at nondot.org Thu May 3 19:45:43 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 19:45:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/ValueEnumerator.h Message-ID: <200705040045.l440jh81011171@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: ValueEnumerator.h updated: 1.8 -> 1.9 --- Log message: pass by reference, not by value --- Diffs of the changes: (+1 -1) ValueEnumerator.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bitcode/Writer/ValueEnumerator.h diff -u llvm/lib/Bitcode/Writer/ValueEnumerator.h:1.8 llvm/lib/Bitcode/Writer/ValueEnumerator.h:1.9 --- llvm/lib/Bitcode/Writer/ValueEnumerator.h:1.8 Thu May 3 17:46:43 2007 +++ llvm/lib/Bitcode/Writer/ValueEnumerator.h Thu May 3 19:45:24 2007 @@ -94,7 +94,7 @@ const std::vector &getBasicBlocks() const { return BasicBlocks; } - const std::vector getParamAttrs() const { + const std::vector &getParamAttrs() const { return ParamAttrs; } From sabre at nondot.org Thu May 3 19:51:40 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 19:51:40 -0500 Subject: [llvm-commits] CVS: llvm/test/C++Frontend/2007-05-03-VectorInit.cpp Message-ID: <200705040051.l440peXk011325@zion.cs.uiuc.edu> Changes in directory llvm/test/C++Frontend: 2007-05-03-VectorInit.cpp added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+17 -0) 2007-05-03-VectorInit.cpp | 17 +++++++++++++++++ 1 files changed, 17 insertions(+) Index: llvm/test/C++Frontend/2007-05-03-VectorInit.cpp diff -c /dev/null llvm/test/C++Frontend/2007-05-03-VectorInit.cpp:1.1 *** /dev/null Thu May 3 19:51:33 2007 --- llvm/test/C++Frontend/2007-05-03-VectorInit.cpp Thu May 3 19:51:23 2007 *************** *** 0 **** --- 1,17 ---- + // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - + // PR1378 + + typedef float v4sf __attribute__((vector_size(16))); + + typedef v4sf float4; + + static float4 splat4(float a) + { + float4 tmp = {a,a,a,a}; + return tmp; + } + + float4 foo(float a) + { + return splat4(a); + } From clattner at apple.com Thu May 3 19:52:00 2007 From: clattner at apple.com (clattner at apple.com) Date: Thu, 3 May 2007 17:52:00 -0700 (PDT) Subject: [llvm-commits] [126860] Fix C++Frontend/2007-05-03-VectorInit.cpp and PR1378. Message-ID: <20070504005200.D4BE3E7CBC6@src> Revision: 126860 Author: clattner Date: 2007-05-03 17:52:00 -0700 (Thu, 03 May 2007) Log Message: ----------- Fix C++Frontend/2007-05-03-VectorInit.cpp and PR1378. It isn't clear whether a VECTOR_CST with no elements is supposed to be undef or zero. Default to zero for now. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-convert.cpp Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-05-04 00:48:51 UTC (rev 126859) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-05-04 00:52:00 UTC (rev 126860) @@ -5189,11 +5189,14 @@ } Constant *TreeConstantToLLVM::ConvertVECTOR_CST(tree exp) { - std::vector Elts; - - for (tree elt = TREE_VECTOR_CST_ELTS(exp); elt; elt = TREE_CHAIN(elt)) - Elts.push_back(Convert(TREE_VALUE(elt))); - return ConstantVector::get(Elts); + if (TREE_VECTOR_CST_ELTS(exp)) { + std::vector Elts; + for (tree elt = TREE_VECTOR_CST_ELTS(exp); elt; elt = TREE_CHAIN(elt)) + Elts.push_back(Convert(TREE_VALUE(elt))); + return ConstantVector::get(Elts); + } else { + return Constant::getNullValue(ConvertType(TREE_TYPE(exp))); + } } Constant *TreeConstantToLLVM::ConvertSTRING_CST(tree exp) { From reid at x10sys.com Thu May 3 20:43:50 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 3 May 2007 20:43:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705040143.l441hoRL012183@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.30 -> 1.31 --- Log message: Allow this to compile with gcc 4.0.X --- Diffs of the changes: (+4 -2) BitcodeReader.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.30 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.31 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.30 Thu May 3 17:34:03 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 20:43:33 2007 @@ -400,7 +400,7 @@ switch (Stream.ReadRecord(Code, Record)) { default: // Default behavior: unknown type. break; - case bitc::VST_CODE_ENTRY: // VST_ENTRY: [valueid, namelen, namechar x N] + case bitc::VST_CODE_ENTRY: { // VST_ENTRY: [valueid, namelen, namechar x N] if (ConvertToString(Record, 1, ValueName)) return Error("Invalid TST_ENTRY record"); unsigned ValueID = Record[0]; @@ -411,7 +411,8 @@ V->setName(&ValueName[0], ValueName.size()); ValueName.clear(); break; - case bitc::VST_CODE_BBENTRY: + } + case bitc::VST_CODE_BBENTRY: { if (ConvertToString(Record, 1, ValueName)) return Error("Invalid VST_BBENTRY record"); BasicBlock *BB = getBasicBlock(Record[0]); @@ -422,6 +423,7 @@ ValueName.clear(); break; } + } } } From clattner at apple.com Thu May 3 21:28:14 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 3 May 2007 19:28:14 -0700 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp In-Reply-To: <200705040143.l441hoRL012183@zion.cs.uiuc.edu> References: <200705040143.l441hoRL012183@zion.cs.uiuc.edu> Message-ID: > > Allow this to compile with gcc 4.0.X Doh, thanks Reid, FWIW, that bug is fixed in apple gcc 4.2. Now they just need to finish it :) -Chris > > --- > Diffs of the changes: (+4 -2) > > BitcodeReader.cpp | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) > > > Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp > diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.30 llvm/lib/ > Bitcode/Reader/BitcodeReader.cpp:1.31 > --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.30 Thu May 3 > 17:34:03 2007 > +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 20:43:33 2007 > @@ -400,7 +400,7 @@ > switch (Stream.ReadRecord(Code, Record)) { > default: // Default behavior: unknown type. > break; > - case bitc::VST_CODE_ENTRY: // VST_ENTRY: [valueid, namelen, > namechar x N] > + case bitc::VST_CODE_ENTRY: { // VST_ENTRY: [valueid, namelen, > namechar x N] > if (ConvertToString(Record, 1, ValueName)) > return Error("Invalid TST_ENTRY record"); > unsigned ValueID = Record[0]; > @@ -411,7 +411,8 @@ > V->setName(&ValueName[0], ValueName.size()); > ValueName.clear(); > break; > - case bitc::VST_CODE_BBENTRY: > + } > + case bitc::VST_CODE_BBENTRY: { > if (ConvertToString(Record, 1, ValueName)) > return Error("Invalid VST_BBENTRY record"); > BasicBlock *BB = getBasicBlock(Record[0]); > @@ -422,6 +423,7 @@ > ValueName.clear(); > break; > } > + } > } > } > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From rspencer at reidspencer.com Thu May 3 21:32:10 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Thu, 03 May 2007 22:32:10 -0400 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp In-Reply-To: References: <200705040143.l441hoRL012183@zion.cs.uiuc.edu> Message-ID: On Thu, 3 May 2007 19:28:14 -0700 Chris Lattner wrote: >> >> Allow this to compile with gcc 4.0.X > >Doh, thanks Reid, FWIW, that bug is fixed in apple gcc 4.2. Now they >just need to finish it :) Yeah, plight of the "compiler poor" like me :) > >-Chris > >> >> --- >> Diffs of the changes: (+4 -2) >> >> BitcodeReader.cpp | 6 ++++-- >> 1 files changed, 4 insertions(+), 2 deletions(-) >> >> >> Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp >> diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.30 llvm/lib/ >> Bitcode/Reader/BitcodeReader.cpp:1.31 >> --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.30 Thu May 3 >> 17:34:03 2007 >> +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 20:43:33 2007 >> @@ -400,7 +400,7 @@ >> switch (Stream.ReadRecord(Code, Record)) { >> default: // Default behavior: unknown type. >> break; >> - case bitc::VST_CODE_ENTRY: // VST_ENTRY: [valueid, namelen, >> namechar x N] >> + case bitc::VST_CODE_ENTRY: { // VST_ENTRY: [valueid, namelen, >> namechar x N] >> if (ConvertToString(Record, 1, ValueName)) >> return Error("Invalid TST_ENTRY record"); >> unsigned ValueID = Record[0]; >> @@ -411,7 +411,8 @@ >> V->setName(&ValueName[0], ValueName.size()); >> ValueName.clear(); >> break; >> - case bitc::VST_CODE_BBENTRY: >> + } >> + case bitc::VST_CODE_BBENTRY: { >> if (ConvertToString(Record, 1, ValueName)) >> return Error("Invalid VST_BBENTRY record"); >> BasicBlock *BB = getBasicBlock(Record[0]); >> @@ -422,6 +423,7 @@ >> ValueName.clear(); >> break; >> } >> + } >> } >> } >> >> >> >> >> _______________________________________________ >> 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 clattner at apple.com Thu May 3 21:37:45 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 3 May 2007 19:37:45 -0700 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp In-Reply-To: References: <200705040143.l441hoRL012183@zion.cs.uiuc.edu> Message-ID: <72E9312F-8C58-4209-BCFF-68DF1985F6B8@apple.com> On May 3, 2007, at 7:32 PM, Reid Spencer wrote: > On Thu, 3 May 2007 19:28:14 -0700 > Chris Lattner wrote: >>> >>> Allow this to compile with gcc 4.0.X >> >> Doh, thanks Reid, FWIW, that bug is fixed in apple gcc 4.2. Now they >> just need to finish it :) > > Yeah, plight of the "compiler poor" like me :) By fixing it, I mean gcc 4.2 will actually catch and emit an error about this stuff. -Chris From sabre at nondot.org Thu May 3 21:59:22 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 21:59:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705040259.l442xM8w013397@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.25 -> 1.26 --- Log message: add writer support for param attrs --- Diffs of the changes: (+15 -1) BitcodeWriter.cpp | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletion(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.25 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.26 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.25 Thu May 3 19:44:52 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Thu May 3 21:59:04 2007 @@ -19,6 +19,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Instructions.h" #include "llvm/Module.h" +#include "llvm/ParameterAttributes.h" #include "llvm/TypeSymbolTable.h" #include "llvm/ValueSymbolTable.h" #include "llvm/Support/MathExtras.h" @@ -86,8 +87,21 @@ const std::vector &Attrs = VE.getParamAttrs(); if (Attrs.empty()) return; + Stream.EnterSubblock(bitc::PARAMATTR_BLOCK_ID, 3); + + SmallVector Record; + for (unsigned i = 0, e = Attrs.size(); i != e; ++i) { + const ParamAttrsList *A = Attrs[i]; + for (unsigned op = 0, e = A->size(); op != e; ++op) { + Record.push_back(A->getParamIndex(op)); + Record.push_back(A->getParamAttrs(op)); + } + + Stream.EmitRecord(bitc::PARAMATTR_CODE_ENTRY, Record); + Record.clear(); + } - + Stream.ExitBlock(); } /// WriteTypeTable - Write out the type table for a module. From sabre at nondot.org Thu May 3 22:00:18 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:00:18 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/LLVMBitCodes.h Message-ID: <200705040300.l4430Iom013444@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: LLVMBitCodes.h updated: 1.12 -> 1.13 --- Log message: add new codes --- Diffs of the changes: (+11 -5) LLVMBitCodes.h | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) Index: llvm/include/llvm/Bitcode/LLVMBitCodes.h diff -u llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.12 llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.13 --- llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.12 Thu May 3 17:16:11 2007 +++ llvm/include/llvm/Bitcode/LLVMBitCodes.h Thu May 3 22:00:00 2007 @@ -28,11 +28,12 @@ MODULE_BLOCK_ID = 0, // Module sub-block id's - TYPE_BLOCK_ID = 1, - CONSTANTS_BLOCK_ID = 2, - FUNCTION_BLOCK_ID = 3, - TYPE_SYMTAB_BLOCK_ID = 4, - VALUE_SYMTAB_BLOCK_ID = 5 + PARAMATTR_BLOCK_ID = 1, + TYPE_BLOCK_ID = 2, + CONSTANTS_BLOCK_ID = 3, + FUNCTION_BLOCK_ID = 4, + TYPE_SYMTAB_BLOCK_ID = 5, + VALUE_SYMTAB_BLOCK_ID = 6 }; @@ -60,6 +61,11 @@ MODULE_CODE_PURGEVALS = 10 }; + /// PARAMATTR blocks have code for defining a parameter attribute set. + enum ParamAttrCodes { + PARAMATTR_CODE_ENTRY = 1 // ENTRY: [paramidx0, attr0, paramidx1, attr1...] + }; + /// TYPE blocks have codes for each type primitive they use. enum TypeCodes { TYPE_CODE_NUMENTRY = 1, // TYPE_CODE_NUMENTRY: [numentries] From sabre at nondot.org Thu May 3 22:02:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:02:07 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Message-ID: <200705040302.l44327IG013555@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-bcanalyzer: llvm-bcanalyzer.cpp updated: 1.16 -> 1.17 --- Log message: add support for new codes/block --- Diffs of the changes: (+7 -1) llvm-bcanalyzer.cpp | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp diff -u llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.16 llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.17 --- llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.16 Mon Apr 30 21:43:46 2007 +++ llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Thu May 3 22:01:41 2007 @@ -80,6 +80,7 @@ switch (BlockID) { default: return 0; case bitc::MODULE_BLOCK_ID: return "MODULE_BLOCK"; + case bitc::PARAMATTR_BLOCK_ID: return "PARAMATTR_BLOCK"; case bitc::TYPE_BLOCK_ID: return "TYPE_BLOCK"; case bitc::CONSTANTS_BLOCK_ID: return "CONSTANTS_BLOCK"; case bitc::FUNCTION_BLOCK_ID: return "FUNCTION_BLOCK"; @@ -109,11 +110,15 @@ case bitc::MODULE_CODE_ALIAS: return "ALIAS"; case bitc::MODULE_CODE_PURGEVALS: return "PURGEVALS"; } + case bitc::PARAMATTR_BLOCK_ID: + switch (CodeID) { + default: return 0; + case bitc::PARAMATTR_CODE_ENTRY: return "ENTRY"; + } case bitc::TYPE_BLOCK_ID: switch (CodeID) { default: return 0; case bitc::TYPE_CODE_NUMENTRY: return "NUMENTRY"; - case bitc::TYPE_CODE_META: return "META"; case bitc::TYPE_CODE_VOID: return "VOID"; case bitc::TYPE_CODE_FLOAT: return "FLOAT"; case bitc::TYPE_CODE_DOUBLE: return "DOUBLE"; @@ -185,6 +190,7 @@ switch (CodeID) { default: return 0; case bitc::VST_CODE_ENTRY: return "ENTRY"; + case bitc::VST_CODE_BBENTRY: return "BBENTRY"; } } } From sabre at nondot.org Thu May 3 22:02:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:02:07 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/LLVMBitCodes.h Message-ID: <200705040302.l44327EX013560@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: LLVMBitCodes.h updated: 1.13 -> 1.14 --- Log message: remove unused code --- Diffs of the changes: (+11 -12) LLVMBitCodes.h | 23 +++++++++++------------ 1 files changed, 11 insertions(+), 12 deletions(-) Index: llvm/include/llvm/Bitcode/LLVMBitCodes.h diff -u llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.13 llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.14 --- llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.13 Thu May 3 22:00:00 2007 +++ llvm/include/llvm/Bitcode/LLVMBitCodes.h Thu May 3 22:01:46 2007 @@ -69,20 +69,19 @@ /// TYPE blocks have codes for each type primitive they use. enum TypeCodes { TYPE_CODE_NUMENTRY = 1, // TYPE_CODE_NUMENTRY: [numentries] - TYPE_CODE_META = 2, // TYPE_CODE_META: [metacode]... - Future use // Type Codes - TYPE_CODE_VOID = 3, // VOID - TYPE_CODE_FLOAT = 4, // FLOAT - TYPE_CODE_DOUBLE = 5, // DOUBLE - TYPE_CODE_LABEL = 6, // LABEL - TYPE_CODE_OPAQUE = 7, // OPAQUE - TYPE_CODE_INTEGER = 8, // INTEGER: [width] - TYPE_CODE_POINTER = 9, // POINTER: [pointee type] - TYPE_CODE_FUNCTION = 10, // FUNCTION: [vararg, retty, #pararms, paramty N] - TYPE_CODE_STRUCT = 11, // STRUCT: [ispacked, #elts, eltty x N] - TYPE_CODE_ARRAY = 12, // ARRAY: [numelts, eltty] - TYPE_CODE_VECTOR = 13 // VECTOR: [numelts, eltty] + TYPE_CODE_VOID = 2, // VOID + TYPE_CODE_FLOAT = 3, // FLOAT + TYPE_CODE_DOUBLE = 4, // DOUBLE + TYPE_CODE_LABEL = 5, // LABEL + TYPE_CODE_OPAQUE = 6, // OPAQUE + TYPE_CODE_INTEGER = 7, // INTEGER: [width] + TYPE_CODE_POINTER = 8, // POINTER: [pointee type] + TYPE_CODE_FUNCTION = 9, // FUNCTION: [vararg, retty, #pararms, paramty N] + TYPE_CODE_STRUCT = 10, // STRUCT: [ispacked, #elts, eltty x N] + TYPE_CODE_ARRAY = 11, // ARRAY: [numelts, eltty] + TYPE_CODE_VECTOR = 12 // VECTOR: [numelts, eltty] // Any other type code is assumed to be an unknown type. }; From sabre at nondot.org Thu May 3 22:03:12 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:03:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705040303.l4433CFU013624@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.31 -> 1.32 --- Log message: remove dead code --- Diffs of the changes: (+0 -6) BitcodeReader.cpp | 6 ------ 1 files changed, 6 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.31 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.32 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.31 Thu May 3 20:43:33 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 22:02:54 2007 @@ -221,12 +221,6 @@ return Error("Invalid TYPE_CODE_NUMENTRY record"); TypeList.reserve(Record[0]); continue; - case bitc::TYPE_CODE_META: // TYPE_CODE_META: [metacode]... - // No metadata supported yet. - if (Record.size() < 1) - return Error("Invalid TYPE_CODE_META record"); - continue; - case bitc::TYPE_CODE_VOID: // VOID ResultTy = Type::VoidTy; break; From sabre at nondot.org Thu May 3 22:13:59 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:13:59 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ParameterAttributes.h Message-ID: <200705040313.l443DxI1013855@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: ParameterAttributes.h updated: 1.11 -> 1.12 --- Log message: add a helper --- Diffs of the changes: (+4 -0) ParameterAttributes.h | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/include/llvm/ParameterAttributes.h diff -u llvm/include/llvm/ParameterAttributes.h:1.11 llvm/include/llvm/ParameterAttributes.h:1.12 --- llvm/include/llvm/ParameterAttributes.h:1.11 Sun Apr 22 12:28:03 2007 +++ llvm/include/llvm/ParameterAttributes.h Thu May 3 22:13:39 2007 @@ -161,6 +161,10 @@ return attrs[attr_index].index; } + uint16_t getParamAttrsAtIndex(unsigned attr_index) const { + return attrs[attr_index].attrs; + } + /// Determines how many parameter attributes are set in this ParamAttrsList. /// This says nothing about how many parameters the function has. It also /// says nothing about the highest parameter index that has attributes. From sabre at nondot.org Thu May 3 22:14:27 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:14:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705040314.l443ER4x013891@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.26 -> 1.27 --- Log message: fix a bug encoding param attrs --- Diffs of the changes: (+1 -1) BitcodeWriter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.26 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.27 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.26 Thu May 3 21:59:04 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Thu May 3 22:14:09 2007 @@ -94,7 +94,7 @@ const ParamAttrsList *A = Attrs[i]; for (unsigned op = 0, e = A->size(); op != e; ++op) { Record.push_back(A->getParamIndex(op)); - Record.push_back(A->getParamAttrs(op)); + Record.push_back(A->getParamAttrsAtIndex(op)); } Stream.EmitRecord(bitc::PARAMATTR_CODE_ENTRY, Record); From sabre at nondot.org Thu May 3 22:30:34 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:30:34 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp BitcodeReader.h Message-ID: <200705040330.l443UYXb014158@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.32 -> 1.33 BitcodeReader.h updated: 1.16 -> 1.17 --- Log message: add support for reading the param attrs block --- Diffs of the changes: (+82 -0) BitcodeReader.cpp | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ BitcodeReader.h | 13 ++++++++++ 2 files changed, 82 insertions(+) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.32 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.33 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.32 Thu May 3 22:02:54 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 22:30:17 2007 @@ -17,6 +17,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Instructions.h" #include "llvm/Module.h" +#include "llvm/ParameterAttributes.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/MemoryBuffer.h" @@ -26,6 +27,9 @@ delete Buffer; } +//===----------------------------------------------------------------------===// +// Helper functions to implement forward reference resolution, etc. +//===----------------------------------------------------------------------===// /// ConvertToString - Convert a string from a record into an std::string, return /// true on failure. @@ -173,6 +177,67 @@ return TypeList.back().get(); } +//===----------------------------------------------------------------------===// +// Functions for parsing blocks from the bitcode file +//===----------------------------------------------------------------------===// + +bool BitcodeReader::ParseParamAttrBlock() { + if (Stream.EnterSubBlock()) + return Error("Malformed block record"); + + if (!ParamAttrs.empty()) + return Error("Multiple PARAMATTR blocks found!"); + + SmallVector Record; + + ParamAttrsVector Attrs; + + // Read all the records. + while (1) { + unsigned Code = Stream.ReadCode(); + if (Code == bitc::END_BLOCK) { + if (Stream.ReadBlockEnd()) + return Error("Error at end of PARAMATTR block"); + return false; + } + + if (Code == bitc::ENTER_SUBBLOCK) { + // No known subblocks, always skip them. + Stream.ReadSubBlockID(); + if (Stream.SkipBlock()) + return Error("Malformed block record"); + continue; + } + + if (Code == bitc::DEFINE_ABBREV) { + Stream.ReadAbbrevRecord(); + continue; + } + + // Read a record. + Record.clear(); + switch (Stream.ReadRecord(Code, Record)) { + default: // Default behavior: ignore. + break; + case bitc::PARAMATTR_CODE_ENTRY: { // ENTRY: [paramidx0, attr0, ...] + if (Record.size() & 1) + return Error("Invalid ENTRY record"); + + ParamAttrsWithIndex PAWI; + for (unsigned i = 0, e = Record.size(); i != e; i += 2) { + PAWI.index = Record[i]; + PAWI.attrs = Record[i+1]; + Attrs.push_back(PAWI); + } + ParamAttrs.push_back(ParamAttrsList::get(Attrs)); + Attrs.clear(); + break; + } + } + } +} + + bool BitcodeReader::ParseTypeTable() { if (Stream.EnterSubBlock()) return Error("Malformed block record"); @@ -742,6 +807,10 @@ if (Stream.SkipBlock()) return Error("Malformed block record"); break; + case bitc::PARAMATTR_BLOCK_ID: + if (ParseParamAttrBlock()) + return true; + break; case bitc::TYPE_BLOCK_ID: if (ParseTypeTable()) return true; Index: llvm/lib/Bitcode/Reader/BitcodeReader.h diff -u llvm/lib/Bitcode/Reader/BitcodeReader.h:1.16 llvm/lib/Bitcode/Reader/BitcodeReader.h:1.17 --- llvm/lib/Bitcode/Reader/BitcodeReader.h:1.16 Wed May 2 00:46:45 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.h Thu May 3 22:30:17 2007 @@ -24,6 +24,7 @@ namespace llvm { class MemoryBuffer; + class ParamAttrsList; class BitcodeReaderValueList : public User { std::vector Uses; @@ -85,6 +86,11 @@ std::vector > GlobalInits; std::vector > AliasInits; + /// ParamAttrs - The set of parameter attributes by index. Index zero in the + /// file is for null, and is thus not represented here. As such all indices + /// are off by one. + std::vector ParamAttrs; + /// FunctionBBs - While parsing a function body, this is a list of the basic /// blocks for the function. std::vector FunctionBBs; @@ -136,8 +142,15 @@ if (ID >= FunctionBBs.size()) return 0; // Invalid ID return FunctionBBs[ID]; } + const ParamAttrsList *getParamAttrs(unsigned i) const { + if (i-1 < ParamAttrs.size()) + return ParamAttrs[i-1]; + return 0; + } + bool ParseModule(const std::string &ModuleID); + bool ParseParamAttrBlock(); bool ParseTypeTable(); bool ParseTypeSymbolTable(); bool ParseValueSymbolTable(); From reid at x10sys.com Thu May 3 22:35:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 3 May 2007 22:35:37 -0500 Subject: [llvm-commits] CVS: llvm/test/ExecutionEngine/fpbitcast.ll Message-ID: <200705040335.l443Zb54014252@zion.cs.uiuc.edu> Changes in directory llvm/test/ExecutionEngine: fpbitcast.ll added (r1.1) --- Log message: Add a test case for testing the LLI interpreter wrt bitcast of fp to integer. --- Diffs of the changes: (+21 -0) fpbitcast.ll | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+) Index: llvm/test/ExecutionEngine/fpbitcast.ll diff -c /dev/null llvm/test/ExecutionEngine/fpbitcast.ll:1.1 *** /dev/null Thu May 3 22:35:28 2007 --- llvm/test/ExecutionEngine/fpbitcast.ll Thu May 3 22:35:17 2007 *************** *** 0 **** --- 1,21 ---- + ; RUN: llvm-as < %s > %t.bc + ; RUN: lli -force-interpreter=true %t.bc | grep 40091eb8 + ; + define i32 @test(double %x) { + entry: + %x46.i = bitcast double %x to i64 + %tmp343.i = lshr i64 %x46.i, 32 + %tmp344.i = trunc i64 %tmp343.i to i32 + ret i32 %tmp344.i + } + + define i32 @main() + { + %res = call i32 @test(double 3.14) + %ptr = getelementptr [4 x i8]* @format, i32 0, i32 0 + call i32 (i8*,...)* @printf(i8* %ptr, i32 %res) + ret i32 0 + } + + declare i32 @printf(i8*, ...) + @format = internal constant [4 x i8] c"%x\0A\00" From reid at x10sys.com Thu May 3 22:37:56 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 3 May 2007 22:37:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Message-ID: <200705040337.l443bug8014299@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Execution.cpp updated: 1.180 -> 1.181 --- Log message: Bitcast all the bits of a floating point value, not just one. The zero extension is needed because the constructor for the Destination value causes the APInt to have a bit width of 1. Patch by Guoling Han. --- Diffs of the changes: (+2 -0) Execution.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.180 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.181 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.180 Thu Apr 26 13:19:35 2007 +++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Thu May 3 22:37:38 2007 @@ -1087,8 +1087,10 @@ Dest.PointerVal = Src.PointerVal; } else if (DstTy->isInteger()) { if (SrcTy == Type::FloatTy) { + Dest.IntVal.zext(sizeof(Src.FloatVal) * 8); Dest.IntVal.floatToBits(Src.FloatVal); } else if (SrcTy == Type::DoubleTy) { + Dest.IntVal.zext(sizeof(Src.DoubleVal) * 8); Dest.IntVal.doubleToBits(Src.DoubleVal); } else if (SrcTy->isInteger()) { Dest.IntVal = Src.IntVal; From sabre at nondot.org Thu May 3 22:39:52 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:39:52 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h Message-ID: <200705040339.l443dqDs014373@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: DerivedTypes.h updated: 1.93 -> 1.94 --- Log message: if functiontype is going to have a pointer to a paramattr object, it better be const. The only way to get a pointer to these returns a const pointer. --- Diffs of the changes: (+3 -3) DerivedTypes.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.93 llvm/include/llvm/DerivedTypes.h:1.94 --- llvm/include/llvm/DerivedTypes.h:1.93 Thu May 3 12:10:20 2007 +++ llvm/include/llvm/DerivedTypes.h Thu May 3 22:39:28 2007 @@ -140,12 +140,12 @@ class FunctionType : public DerivedType { friend class TypeMap; bool isVarArgs; - ParamAttrsList *ParamAttrs; + const ParamAttrsList *ParamAttrs; FunctionType(const FunctionType &); // Do not implement const FunctionType &operator=(const FunctionType &); // Do not implement FunctionType(const Type *Result, const std::vector &Params, - bool IsVarArgs, ParamAttrsList *Attrs = 0); + bool IsVarArgs, const ParamAttrsList *Attrs = 0); public: /// FunctionType::get - This static method is the primary way of constructing @@ -155,7 +155,7 @@ const Type *Result, ///< The result type const std::vector &Params, ///< The types of the parameters bool isVarArg, ///< Whether this is a variable argument length function - ParamAttrsList *Attrs = 0 + const ParamAttrsList *Attrs = 0 ///< Indicates the parameter attributes to use, if any. The 0th entry ///< in the list refers to the return type. Parameters are numbered ///< starting at 1. This argument must be on the heap and FunctionType From sabre at nondot.org Thu May 3 22:39:52 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:39:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp Message-ID: <200705040339.l443dq8v014368@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Type.cpp updated: 1.186 -> 1.187 --- Log message: if functiontype is going to have a pointer to a paramattr object, it better be const. The only way to get a pointer to these returns a const pointer. --- Diffs of the changes: (+2 -2) Type.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.186 llvm/lib/VMCore/Type.cpp:1.187 --- llvm/lib/VMCore/Type.cpp:1.186 Sun Apr 22 17:16:55 2007 +++ llvm/lib/VMCore/Type.cpp Thu May 3 22:39:28 2007 @@ -417,7 +417,7 @@ FunctionType::FunctionType(const Type *Result, const std::vector &Params, - bool IsVarArgs, ParamAttrsList *Attrs) + bool IsVarArgs, const ParamAttrsList *Attrs) : DerivedType(FunctionTyID), isVarArgs(IsVarArgs), ParamAttrs(Attrs) { ContainedTys = reinterpret_cast(this+1); NumContainedTys = Params.size() + 1; // + 1 for result type @@ -1084,7 +1084,7 @@ FunctionType *FunctionType::get(const Type *ReturnType, const std::vector &Params, bool isVarArg, - ParamAttrsList *Attrs) { + const ParamAttrsList *Attrs) { FunctionValType VT(ReturnType, Params, isVarArg, Attrs); FunctionType *FT = FunctionTypes->get(VT); From sabre at nondot.org Thu May 3 22:41:52 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:41:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705040341.l443fqe7014468@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.33 -> 1.34 --- Log message: encode and read param attrs along with function type. WE can now roundtrip Olden/voronoi loslessly --- Diffs of the changes: (+6 -7) BitcodeReader.cpp | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.33 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.34 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.33 Thu May 3 22:30:17 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 22:41:34 2007 @@ -313,16 +313,15 @@ ResultTy = PointerType::get(getTypeByID(Record[0], true)); break; case bitc::TYPE_CODE_FUNCTION: { - // FUNCTION: [vararg, retty, #pararms, paramty N] - if (Record.size() < 3 || Record.size() < Record[2]+3) + // FUNCTION: [vararg, attrid, retty, #pararms, paramty N] + if (Record.size() < 4 || Record.size() < Record[3]+4) return Error("Invalid FUNCTION type record"); std::vector ArgTys; - for (unsigned i = 0, e = Record[2]; i != e; ++i) - ArgTys.push_back(getTypeByID(Record[3+i], true)); + for (unsigned i = 0, e = Record[3]; i != e; ++i) + ArgTys.push_back(getTypeByID(Record[4+i], true)); - // FIXME: PARAM TYS. - ResultTy = FunctionType::get(getTypeByID(Record[1], true), ArgTys, - Record[0]); + ResultTy = FunctionType::get(getTypeByID(Record[2], true), ArgTys, + Record[0], getParamAttrs(Record[1])); break; } case bitc::TYPE_CODE_STRUCT: { // STRUCT: [ispacked, #elts, eltty x N] From sabre at nondot.org Thu May 3 22:41:57 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:41:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705040341.l443fvQr014474@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.27 -> 1.28 --- Log message: encode and read param attrs along with function type. WE can now roundtrip Olden/voronoi loslessly --- Diffs of the changes: (+2 -2) BitcodeWriter.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.27 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.28 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.27 Thu May 3 22:14:09 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Thu May 3 22:41:34 2007 @@ -145,11 +145,11 @@ case Type::FunctionTyID: { const FunctionType *FT = cast(T); - // FUNCTION: [isvararg, #pararms, paramty x N] + // FUNCTION: [isvararg, attrid, #pararms, paramty x N] Code = bitc::TYPE_CODE_FUNCTION; TypeVals.push_back(FT->isVarArg()); + TypeVals.push_back(VE.getParamAttrID(FT->getParamAttrs())); TypeVals.push_back(VE.getTypeID(FT->getReturnType())); - // FIXME: PARAM ATTR ID! TypeVals.push_back(FT->getNumParams()); for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i) TypeVals.push_back(VE.getTypeID(FT->getParamType(i))); From sabre at nondot.org Thu May 3 22:50:47 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:50:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705040350.l443oltL014770@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.34 -> 1.35 --- Log message: fix a misplaced error --- Diffs of the changes: (+1 -1) BitcodeReader.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.34 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.35 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.34 Thu May 3 22:41:34 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 22:50:29 2007 @@ -1508,8 +1508,8 @@ delete A; } } + return Error("Never resolved value found in function!"); } - return Error("Never resolved value found in function!"); } // Trim the value list down to the size it was before we parsed this function. From sabre at nondot.org Thu May 3 22:52:42 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:52:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705040352.l443qgrt014832@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.28 -> 1.29 --- Log message: fix encoding of invoke instructions. kc++ now round trips --- Diffs of the changes: (+0 -1) BitcodeWriter.cpp | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.28 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.29 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.28 Thu May 3 22:41:34 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Thu May 3 22:52:24 2007 @@ -609,7 +609,6 @@ // Emit type/value pairs for varargs params. if (FTy->isVarArg()) { unsigned NumVarargs = I.getNumOperands()-3-FTy->getNumParams(); - Vals.push_back(NumVarargs); for (unsigned i = I.getNumOperands()-NumVarargs, e = I.getNumOperands(); i != e; ++i) { Vals.push_back(VE.getTypeID(I.getOperand(i)->getType())); From sabre at nondot.org Thu May 3 22:57:48 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 22:57:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705040357.l443vmji014930@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.35 -> 1.36 --- Log message: storeinst ctor takes isvolatile before alignment. With this, 176.gcc roundtrips --- Diffs of the changes: (+1 -1) BitcodeReader.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.35 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.36 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.35 Thu May 3 22:50:29 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 3 22:57:30 2007 @@ -1423,7 +1423,7 @@ Value *Ptr = getFnValueByID(Record[2], OpTy); if (!OpTy || !Op || !Ptr) return Error("Invalid STORE record"); - I = new StoreInst(Op, Ptr, (1 << Record[3]) >> 1, Record[4]); + I = new StoreInst(Op, Ptr, Record[4], (1 << Record[3]) >> 1); break; } case bitc::FUNC_CODE_INST_CALL: { // CALL: [cc, fnty, fnid, arg0, arg1...] From sabre at nondot.org Thu May 3 23:01:25 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 23:01:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200705040401.l4441P5s015046@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.355 -> 1.356 --- Log message: fix a bug where llvm-as couldn't assemble the .ll file for 252.eon. --- Diffs of the changes: (+1 -1) llvmAsmParser.y | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.355 llvm/lib/AsmParser/llvmAsmParser.y:1.356 --- llvm/lib/AsmParser/llvmAsmParser.y:1.355 Sun Apr 29 13:35:00 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Thu May 3 23:01:07 2007 @@ -2574,7 +2574,7 @@ std::vector ParamTypes; ParamAttrsVector Attrs; if ($8 != ParamAttr::None) { - ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = 8; + ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = $8; Attrs.push_back(PAWI); } ValueRefList::iterator I = $6->begin(), E = $6->end(); From sabre at nondot.org Thu May 3 23:01:55 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 3 May 2007 23:01:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200705040401.l4441t6j015087@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.97 -> 1.98 llvmAsmParser.h.cvs updated: 1.75 -> 1.76 llvmAsmParser.y.cvs updated: 1.97 -> 1.98 --- Log message: regenerate --- Diffs of the changes: (+3347 -4635) llvmAsmParser.cpp.cvs | 7514 +++++++++++++++++++++----------------------------- llvmAsmParser.h.cvs | 466 --- llvmAsmParser.y.cvs | 2 3 files changed, 3347 insertions(+), 4635 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.97 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.98 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.97 Sun Apr 29 13:38:24 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Thu May 3 23:01:37 2007 @@ -1,356 +1,152 @@ -/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* A Bison parser, made from /Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y + by GNU Bison version 1.28 */ - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. +#define YYBISON 1 /* Identify Bison output. */ - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.3" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* Substitute the variable and function names. */ #define yyparse llvmAsmparse -#define yylex llvmAsmlex +#define yylex llvmAsmlex #define yyerror llvmAsmerror -#define yylval llvmAsmlval -#define yychar llvmAsmchar +#define yylval llvmAsmlval +#define yychar llvmAsmchar #define yydebug llvmAsmdebug #define yynerrs llvmAsmnerrs +#define ESINT64VAL 257 +#define EUINT64VAL 258 +#define ESAPINTVAL 259 +#define EUAPINTVAL 260 +#define LOCALVAL_ID 261 +#define GLOBALVAL_ID 262 +#define FPVAL 263 +#define VOID 264 +#define INTTYPE 265 +#define FLOAT 266 +#define DOUBLE 267 +#define LABEL 268 +#define TYPE 269 +#define LOCALVAR 270 +#define GLOBALVAR 271 +#define LABELSTR 272 +#define STRINGCONSTANT 273 +#define ATSTRINGCONSTANT 274 +#define ZEROINITIALIZER 275 +#define TRUETOK 276 +#define FALSETOK 277 +#define BEGINTOK 278 +#define ENDTOK 279 +#define DECLARE 280 +#define DEFINE 281 +#define GLOBAL 282 +#define CONSTANT 283 +#define SECTION 284 +#define ALIAS 285 +#define VOLATILE 286 +#define THREAD_LOCAL 287 +#define TO 288 +#define DOTDOTDOT 289 +#define NULL_TOK 290 +#define UNDEF 291 +#define INTERNAL 292 +#define LINKONCE 293 +#define WEAK 294 +#define APPENDING 295 +#define DLLIMPORT 296 +#define DLLEXPORT 297 +#define EXTERN_WEAK 298 +#define OPAQUE 299 +#define EXTERNAL 300 +#define TARGET 301 +#define TRIPLE 302 +#define ALIGN 303 +#define DEPLIBS 304 +#define CALL 305 +#define TAIL 306 +#define ASM_TOK 307 +#define MODULE 308 +#define SIDEEFFECT 309 +#define CC_TOK 310 +#define CCC_TOK 311 +#define FASTCC_TOK 312 +#define COLDCC_TOK 313 +#define X86_STDCALLCC_TOK 314 +#define X86_FASTCALLCC_TOK 315 +#define DATALAYOUT 316 +#define RET 317 +#define BR 318 +#define SWITCH 319 +#define INVOKE 320 +#define UNWIND 321 +#define UNREACHABLE 322 +#define ADD 323 +#define SUB 324 +#define MUL 325 +#define UDIV 326 +#define SDIV 327 +#define FDIV 328 +#define UREM 329 +#define SREM 330 +#define FREM 331 +#define AND 332 +#define OR 333 +#define XOR 334 +#define SHL 335 +#define LSHR 336 +#define ASHR 337 +#define ICMP 338 +#define FCMP 339 +#define EQ 340 +#define NE 341 +#define SLT 342 +#define SGT 343 +#define SLE 344 +#define SGE 345 +#define ULT 346 +#define UGT 347 +#define ULE 348 +#define UGE 349 +#define OEQ 350 +#define ONE 351 +#define OLT 352 +#define OGT 353 +#define OLE 354 +#define OGE 355 +#define ORD 356 +#define UNO 357 +#define UEQ 358 +#define UNE 359 +#define MALLOC 360 +#define ALLOCA 361 +#define FREE 362 +#define LOAD 363 +#define STORE 364 +#define GETELEMENTPTR 365 +#define TRUNC 366 +#define ZEXT 367 +#define SEXT 368 +#define FPTRUNC 369 +#define FPEXT 370 +#define BITCAST 371 +#define UITOFP 372 +#define SITOFP 373 +#define FPTOUI 374 +#define FPTOSI 375 +#define INTTOPTR 376 +#define PTRTOINT 377 +#define PHI_TOK 378 +#define SELECT 379 +#define VAARG 380 +#define EXTRACTELEMENT 381 +#define INSERTELEMENT 382 +#define SHUFFLEVECTOR 383 +#define NORETURN 384 +#define INREG 385 +#define SRET 386 +#define NOUNWIND 387 +#define DEFAULT 388 +#define HIDDEN 389 +#define PROTECTED 390 - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - ESAPINTVAL = 260, - EUAPINTVAL = 261, - LOCALVAL_ID = 262, - GLOBALVAL_ID = 263, - FPVAL = 264, - VOID = 265, - INTTYPE = 266, - FLOAT = 267, - DOUBLE = 268, - LABEL = 269, - TYPE = 270, - LOCALVAR = 271, - GLOBALVAR = 272, - LABELSTR = 273, - STRINGCONSTANT = 274, - ATSTRINGCONSTANT = 275, - ZEROINITIALIZER = 276, - TRUETOK = 277, - FALSETOK = 278, - BEGINTOK = 279, - ENDTOK = 280, - DECLARE = 281, - DEFINE = 282, - GLOBAL = 283, - CONSTANT = 284, - SECTION = 285, - ALIAS = 286, - VOLATILE = 287, - THREAD_LOCAL = 288, - TO = 289, - DOTDOTDOT = 290, - NULL_TOK = 291, - UNDEF = 292, - INTERNAL = 293, - LINKONCE = 294, - WEAK = 295, - APPENDING = 296, - DLLIMPORT = 297, - DLLEXPORT = 298, - EXTERN_WEAK = 299, - OPAQUE = 300, - EXTERNAL = 301, - TARGET = 302, - TRIPLE = 303, - ALIGN = 304, - DEPLIBS = 305, - CALL = 306, - TAIL = 307, - ASM_TOK = 308, - MODULE = 309, - SIDEEFFECT = 310, - CC_TOK = 311, - CCC_TOK = 312, - FASTCC_TOK = 313, - COLDCC_TOK = 314, - X86_STDCALLCC_TOK = 315, - X86_FASTCALLCC_TOK = 316, - DATALAYOUT = 317, - RET = 318, - BR = 319, - SWITCH = 320, - INVOKE = 321, - UNWIND = 322, - UNREACHABLE = 323, - ADD = 324, - SUB = 325, - MUL = 326, - UDIV = 327, - SDIV = 328, - FDIV = 329, - UREM = 330, - SREM = 331, - FREM = 332, - AND = 333, - OR = 334, - XOR = 335, - SHL = 336, - LSHR = 337, - ASHR = 338, - ICMP = 339, - FCMP = 340, - EQ = 341, - NE = 342, - SLT = 343, - SGT = 344, - SLE = 345, - SGE = 346, - ULT = 347, - UGT = 348, - ULE = 349, - UGE = 350, - OEQ = 351, - ONE = 352, - OLT = 353, - OGT = 354, - OLE = 355, - OGE = 356, - ORD = 357, - UNO = 358, - UEQ = 359, - UNE = 360, - MALLOC = 361, - ALLOCA = 362, - FREE = 363, - LOAD = 364, - STORE = 365, - GETELEMENTPTR = 366, - TRUNC = 367, - ZEXT = 368, - SEXT = 369, - FPTRUNC = 370, - FPEXT = 371, - BITCAST = 372, - UITOFP = 373, - SITOFP = 374, - FPTOUI = 375, - FPTOSI = 376, - INTTOPTR = 377, - PTRTOINT = 378, - PHI_TOK = 379, - SELECT = 380, - VAARG = 381, - EXTRACTELEMENT = 382, - INSERTELEMENT = 383, - SHUFFLEVECTOR = 384, - NORETURN = 385, - INREG = 386, - SRET = 387, - NOUNWIND = 388, - DEFAULT = 389, - HIDDEN = 390, - PROTECTED = 391 - }; -#endif -/* Tokens. */ -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define ESAPINTVAL 260 -#define EUAPINTVAL 261 -#define LOCALVAL_ID 262 -#define GLOBALVAL_ID 263 -#define FPVAL 264 -#define VOID 265 -#define INTTYPE 266 -#define FLOAT 267 -#define DOUBLE 268 -#define LABEL 269 -#define TYPE 270 -#define LOCALVAR 271 -#define GLOBALVAR 272 -#define LABELSTR 273 -#define STRINGCONSTANT 274 -#define ATSTRINGCONSTANT 275 -#define ZEROINITIALIZER 276 -#define TRUETOK 277 -#define FALSETOK 278 -#define BEGINTOK 279 -#define ENDTOK 280 -#define DECLARE 281 -#define DEFINE 282 -#define GLOBAL 283 -#define CONSTANT 284 -#define SECTION 285 -#define ALIAS 286 -#define VOLATILE 287 -#define THREAD_LOCAL 288 -#define TO 289 -#define DOTDOTDOT 290 -#define NULL_TOK 291 -#define UNDEF 292 -#define INTERNAL 293 -#define LINKONCE 294 -#define WEAK 295 -#define APPENDING 296 -#define DLLIMPORT 297 -#define DLLEXPORT 298 -#define EXTERN_WEAK 299 -#define OPAQUE 300 -#define EXTERNAL 301 -#define TARGET 302 -#define TRIPLE 303 -#define ALIGN 304 -#define DEPLIBS 305 -#define CALL 306 -#define TAIL 307 -#define ASM_TOK 308 -#define MODULE 309 -#define SIDEEFFECT 310 -#define CC_TOK 311 -#define CCC_TOK 312 -#define FASTCC_TOK 313 -#define COLDCC_TOK 314 -#define X86_STDCALLCC_TOK 315 -#define X86_FASTCALLCC_TOK 316 -#define DATALAYOUT 317 -#define RET 318 -#define BR 319 -#define SWITCH 320 -#define INVOKE 321 -#define UNWIND 322 -#define UNREACHABLE 323 -#define ADD 324 -#define SUB 325 -#define MUL 326 -#define UDIV 327 -#define SDIV 328 -#define FDIV 329 -#define UREM 330 -#define SREM 331 -#define FREM 332 -#define AND 333 -#define OR 334 -#define XOR 335 -#define SHL 336 -#define LSHR 337 -#define ASHR 338 -#define ICMP 339 -#define FCMP 340 -#define EQ 341 -#define NE 342 -#define SLT 343 -#define SGT 344 -#define SLE 345 -#define SGE 346 -#define ULT 347 -#define UGT 348 -#define ULE 349 -#define UGE 350 -#define OEQ 351 -#define ONE 352 -#define OLT 353 -#define OGT 354 -#define OLE 355 -#define OGE 356 -#define ORD 357 -#define UNO 358 -#define UEQ 359 -#define UNE 360 -#define MALLOC 361 -#define ALLOCA 362 -#define FREE 363 -#define LOAD 364 -#define STORE 365 -#define GETELEMENTPTR 366 -#define TRUNC 367 -#define ZEXT 368 -#define SEXT 369 -#define FPTRUNC 370 -#define FPEXT 371 -#define BITCAST 372 -#define UITOFP 373 -#define SITOFP 374 -#define FPTOUI 375 -#define FPTOSI 376 -#define INTTOPTR 377 -#define PTRTOINT 378 -#define PHI_TOK 379 -#define SELECT 380 -#define VAARG 381 -#define EXTRACTELEMENT 382 -#define INSERTELEMENT 383 -#define SHUFFLEVECTOR 384 -#define NORETURN 385 -#define INREG 386 -#define SRET 387 -#define NOUNWIND 388 -#define DEFAULT 389 -#define HIDDEN 390 -#define PROTECTED 391 - - - - -/* Copy the first part of user declarations. */ -#line 14 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 14 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1291,29 +1087,8 @@ } - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 955 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" -{ +#line 955 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1358,1769 +1133,1084 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} -/* Line 187 of yacc.c. */ -#line 1364 "llvmAsmParser.tab.c" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - +} YYSTYPE; +#include +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif -/* Copy the second part of user declarations. */ -/* Line 216 of yacc.c. */ -#line 1377 "llvmAsmParser.tab.c" +#define YYFINAL 581 +#define YYFLAG -32768 +#define YYNTBASE 151 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 390 ? yytranslate[x] : 232) + +static const short yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 141, + 142, 139, 2, 138, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 146, + 137, 147, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 143, 140, 145, 2, 2, 2, 2, 2, 150, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 144, + 2, 2, 148, 2, 149, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136 +}; -#ifdef short -# undef short -#endif +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, + 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, + 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, + 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, + 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, + 119, 122, 123, 125, 127, 129, 130, 133, 135, 137, + 139, 141, 143, 145, 147, 149, 150, 152, 154, 156, + 157, 159, 161, 162, 164, 166, 168, 170, 171, 173, + 175, 176, 178, 180, 182, 184, 186, 189, 191, 193, + 195, 197, 198, 201, 203, 205, 207, 208, 211, 212, + 215, 216, 220, 223, 224, 226, 227, 231, 233, 236, + 238, 240, 242, 244, 246, 248, 251, 253, 256, 262, + 268, 274, 280, 284, 287, 293, 298, 301, 303, 305, + 307, 311, 313, 317, 319, 320, 322, 326, 331, 335, + 339, 344, 349, 353, 360, 366, 369, 372, 375, 378, + 381, 384, 387, 390, 393, 396, 399, 402, 409, 415, + 424, 431, 438, 446, 454, 461, 470, 479, 483, 485, + 487, 489, 491, 492, 495, 502, 504, 505, 507, 510, + 511, 515, 516, 520, 524, 528, 532, 533, 541, 542, + 551, 552, 561, 567, 570, 574, 576, 580, 584, 588, + 592, 594, 595, 601, 605, 607, 611, 613, 614, 624, + 626, 628, 633, 635, 637, 640, 644, 645, 647, 649, + 651, 653, 655, 657, 659, 661, 663, 667, 669, 675, + 677, 679, 681, 683, 685, 687, 690, 693, 696, 700, + 703, 704, 706, 709, 712, 716, 726, 736, 745, 760, + 762, 764, 771, 777, 780, 787, 795, 799, 805, 806, + 807, 811, 814, 816, 822, 828, 835, 842, 847, 854, + 859, 864, 871, 878, 881, 890, 892, 894, 895, 899, + 906, 910, 917, 920, 926, 934 +}; -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif +static const short yyrhs[] = { 69, + 0, 70, 0, 71, 0, 72, 0, 73, 0, 74, + 0, 75, 0, 76, 0, 77, 0, 81, 0, 82, + 0, 83, 0, 78, 0, 79, 0, 80, 0, 112, + 0, 113, 0, 114, 0, 115, 0, 116, 0, 117, + 0, 118, 0, 119, 0, 120, 0, 121, 0, 122, + 0, 123, 0, 86, 0, 87, 0, 88, 0, 89, + 0, 90, 0, 91, 0, 92, 0, 93, 0, 94, + 0, 95, 0, 96, 0, 97, 0, 98, 0, 99, + 0, 100, 0, 101, 0, 102, 0, 103, 0, 104, + 0, 105, 0, 92, 0, 93, 0, 94, 0, 95, + 0, 22, 0, 23, 0, 11, 0, 12, 0, 13, + 0, 16, 0, 19, 0, 158, 0, 0, 158, 137, + 0, 0, 17, 0, 20, 0, 163, 0, 0, 161, + 137, 0, 38, 0, 40, 0, 39, 0, 41, 0, + 43, 0, 42, 0, 44, 0, 46, 0, 0, 134, + 0, 135, 0, 136, 0, 0, 42, 0, 44, 0, + 0, 38, 0, 39, 0, 40, 0, 43, 0, 0, + 40, 0, 38, 0, 0, 57, 0, 58, 0, 59, + 0, 60, 0, 61, 0, 56, 4, 0, 113, 0, + 114, 0, 131, 0, 132, 0, 0, 172, 171, 0, + 130, 0, 133, 0, 171, 0, 0, 174, 173, 0, + 0, 49, 4, 0, 0, 138, 49, 4, 0, 30, + 19, 0, 0, 177, 0, 0, 138, 180, 179, 0, + 177, 0, 49, 4, 0, 11, 0, 12, 0, 13, + 0, 14, 0, 45, 0, 181, 0, 182, 139, 0, + 216, 0, 140, 4, 0, 182, 141, 186, 142, 174, + 0, 10, 141, 186, 142, 174, 0, 143, 4, 144, + 182, 145, 0, 146, 4, 144, 182, 147, 0, 148, + 187, 149, 0, 148, 149, 0, 146, 148, 187, 149, + 147, 0, 146, 148, 149, 147, 0, 182, 172, 0, + 182, 0, 10, 0, 183, 0, 185, 138, 183, 0, + 185, 0, 185, 138, 35, 0, 35, 0, 0, 182, + 0, 187, 138, 182, 0, 182, 143, 190, 145, 0, + 182, 143, 145, 0, 182, 150, 19, 0, 182, 146, + 190, 147, 0, 182, 148, 190, 149, 0, 182, 148, + 149, 0, 182, 146, 148, 190, 149, 147, 0, 182, + 146, 148, 149, 147, 0, 182, 36, 0, 182, 37, + 0, 182, 216, 0, 182, 189, 0, 182, 21, 0, + 156, 3, 0, 156, 5, 0, 156, 4, 0, 156, + 6, 0, 11, 22, 0, 11, 23, 0, 157, 9, + 0, 153, 141, 188, 34, 182, 142, 0, 111, 141, + 188, 227, 142, 0, 125, 141, 188, 138, 188, 138, + 188, 142, 0, 151, 141, 188, 138, 188, 142, 0, + 152, 141, 188, 138, 188, 142, 0, 84, 154, 141, + 188, 138, 188, 142, 0, 85, 155, 141, 188, 138, + 188, 142, 0, 127, 141, 188, 138, 188, 142, 0, + 128, 141, 188, 138, 188, 138, 188, 142, 0, 129, + 141, 188, 138, 188, 138, 188, 142, 0, 190, 138, + 188, 0, 188, 0, 28, 0, 29, 0, 33, 0, + 0, 184, 216, 0, 117, 141, 193, 34, 182, 142, + 0, 195, 0, 0, 196, 0, 195, 196, 0, 0, + 27, 197, 212, 0, 0, 26, 198, 213, 0, 54, + 53, 202, 0, 160, 15, 182, 0, 160, 15, 10, + 0, 0, 162, 166, 192, 191, 188, 199, 179, 0, + 0, 162, 164, 166, 192, 191, 188, 200, 179, 0, + 0, 162, 165, 166, 192, 191, 182, 201, 179, 0, + 162, 166, 31, 169, 193, 0, 47, 203, 0, 50, + 137, 204, 0, 19, 0, 48, 137, 19, 0, 62, + 137, 19, 0, 143, 205, 145, 0, 205, 138, 19, + 0, 19, 0, 0, 206, 138, 182, 172, 159, 0, + 182, 172, 159, 0, 206, 0, 206, 138, 35, 0, + 35, 0, 0, 170, 184, 161, 141, 207, 142, 174, + 178, 175, 0, 24, 0, 148, 0, 168, 166, 208, + 209, 0, 25, 0, 149, 0, 219, 211, 0, 167, + 166, 208, 0, 0, 55, 0, 3, 0, 4, 0, + 9, 0, 22, 0, 23, 0, 36, 0, 37, 0, + 21, 0, 146, 190, 147, 0, 189, 0, 53, 214, + 19, 138, 19, 0, 7, 0, 8, 0, 158, 0, + 161, 0, 216, 0, 215, 0, 182, 217, 0, 219, + 220, 0, 210, 220, 0, 221, 160, 222, 0, 221, + 224, 0, 0, 18, 0, 63, 218, 0, 63, 10, + 0, 64, 14, 217, 0, 64, 11, 217, 138, 14, + 217, 138, 14, 217, 0, 65, 156, 217, 138, 14, + 217, 143, 223, 145, 0, 65, 156, 217, 138, 14, + 217, 143, 145, 0, 66, 170, 184, 217, 141, 226, + 142, 174, 34, 14, 217, 67, 14, 217, 0, 67, + 0, 68, 0, 223, 156, 215, 138, 14, 217, 0, + 156, 215, 138, 14, 217, 0, 160, 229, 0, 182, + 143, 217, 138, 217, 145, 0, 225, 138, 143, 217, + 138, 217, 145, 0, 182, 217, 172, 0, 226, 138, + 182, 217, 172, 0, 0, 0, 227, 138, 218, 0, + 52, 51, 0, 51, 0, 151, 182, 217, 138, 217, + 0, 152, 182, 217, 138, 217, 0, 84, 154, 182, + 217, 138, 217, 0, 85, 155, 182, 217, 138, 217, + 0, 153, 218, 34, 182, 0, 125, 218, 138, 218, + 138, 218, 0, 126, 218, 138, 182, 0, 127, 218, + 138, 218, 0, 128, 218, 138, 218, 138, 218, 0, + 129, 218, 138, 218, 138, 218, 0, 124, 225, 0, + 228, 170, 184, 217, 141, 226, 142, 174, 0, 231, + 0, 32, 0, 0, 106, 182, 176, 0, 106, 182, + 138, 11, 217, 176, 0, 107, 182, 176, 0, 107, + 182, 138, 11, 217, 176, 0, 108, 218, 0, 230, + 109, 182, 217, 176, 0, 230, 110, 218, 138, 182, + 217, 176, 0, 111, 182, 217, 227, 0 +}; -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; #endif -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1112, + 1112, 1112, 1112, 1112, 1112, 1113, 1113, 1113, 1113, 1113, + 1113, 1113, 1114, 1114, 1114, 1114, 1114, 1117, 1117, 1118, + 1118, 1119, 1119, 1120, 1120, 1121, 1121, 1125, 1125, 1126, + 1126, 1127, 1127, 1128, 1128, 1129, 1129, 1130, 1130, 1131, + 1131, 1132, 1133, 1138, 1139, 1139, 1141, 1141, 1142, 1142, + 1146, 1150, 1155, 1155, 1157, 1158, 1163, 1169, 1170, 1171, + 1172, 1173, 1177, 1178, 1179, 1183, 1184, 1185, 1186, 1190, + 1191, 1192, 1196, 1197, 1198, 1199, 1200, 1204, 1205, 1206, + 1209, 1209, 1210, 1211, 1212, 1213, 1214, 1222, 1223, 1224, + 1225, 1228, 1229, 1234, 1235, 1236, 1239, 1240, 1247, 1247, + 1254, 1254, 1263, 1271, 1271, 1277, 1277, 1279, 1284, 1297, + 1297, 1297, 1297, 1300, 1304, 1308, 1315, 1320, 1328, 1358, + 1389, 1394, 1406, 1416, 1420, 1430, 1437, 1444, 1451, 1456, + 1461, 1468, 1469, 1476, 1483, 1491, 1497, 1509, 1537, 1553, + 1582, 1610, 1636, 1656, 1682, 1702, 1714, 1721, 1787, 1797, + 1807, 1813, 1823, 1829, 1839, 1844, 1849, 1857, 1869, 1891, + 1899, 1905, 1916, 1921, 1926, 1932, 1938, 1947, 1951, 1959, + 1959, 1962, 1962, 1965, 1976, 1997, 2002, 2010, 2011, 2015, + 2015, 2019, 2019, 2022, 2025, 2049, 2060, 2067, 2070, 2076, + 2079, 2086, 2090, 2105, 2108, 2114, 2127, 2131, 2136, 2138, + 2143, 2148, 2157, 2167, 2178, 2182, 2191, 2200, 2205, 2327, + 2327, 2329, 2338, 2338, 2340, 2345, 2357, 2361, 2366, 2370, + 2374, 2378, 2382, 2386, 2390, 2394, 2398, 2423, 2427, 2441, + 2445, 2449, 2453, 2459, 2459, 2465, 2474, 2478, 2487, 2496, + 2505, 2509, 2514, 2518, 2522, 2527, 2537, 2556, 2565, 2645, + 2649, 2656, 2667, 2680, 2690, 2701, 2711, 2720, 2729, 2732, + 2733, 2740, 2744, 2749, 2770, 2787, 2801, 2815, 2827, 2835, + 2842, 2848, 2854, 2860, 2875, 2960, 2965, 2969, 2976, 2983, + 2991, 2998, 3006, 3014, 3028, 3045 +}; #endif -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} +static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", +"EUINT64VAL","ESAPINTVAL","EUAPINTVAL","LOCALVAL_ID","GLOBALVAL_ID","FPVAL", +"VOID","INTTYPE","FLOAT","DOUBLE","LABEL","TYPE","LOCALVAR","GLOBALVAR","LABELSTR", +"STRINGCONSTANT","ATSTRINGCONSTANT","ZEROINITIALIZER","TRUETOK","FALSETOK","BEGINTOK", +"ENDTOK","DECLARE","DEFINE","GLOBAL","CONSTANT","SECTION","ALIAS","VOLATILE", +"THREAD_LOCAL","TO","DOTDOTDOT","NULL_TOK","UNDEF","INTERNAL","LINKONCE","WEAK", +"APPENDING","DLLIMPORT","DLLEXPORT","EXTERN_WEAK","OPAQUE","EXTERNAL","TARGET", +"TRIPLE","ALIGN","DEPLIBS","CALL","TAIL","ASM_TOK","MODULE","SIDEEFFECT","CC_TOK", +"CCC_TOK","FASTCC_TOK","COLDCC_TOK","X86_STDCALLCC_TOK","X86_FASTCALLCC_TOK", +"DATALAYOUT","RET","BR","SWITCH","INVOKE","UNWIND","UNREACHABLE","ADD","SUB", +"MUL","UDIV","SDIV","FDIV","UREM","SREM","FREM","AND","OR","XOR","SHL","LSHR", +"ASHR","ICMP","FCMP","EQ","NE","SLT","SGT","SLE","SGE","ULT","UGT","ULE","UGE", +"OEQ","ONE","OLT","OGT","OLE","OGE","ORD","UNO","UEQ","UNE","MALLOC","ALLOCA", +"FREE","LOAD","STORE","GETELEMENTPTR","TRUNC","ZEXT","SEXT","FPTRUNC","FPEXT", +"BITCAST","UITOFP","SITOFP","FPTOUI","FPTOSI","INTTOPTR","PTRTOINT","PHI_TOK", +"SELECT","VAARG","EXTRACTELEMENT","INSERTELEMENT","SHUFFLEVECTOR","NORETURN", +"INREG","SRET","NOUNWIND","DEFAULT","HIDDEN","PROTECTED","'='","','","'*'","'\\\\'", +"'('","')'","'['","'x'","']'","'<'","'>'","'{'","'}'","'c'","ArithmeticOps", +"LogicalOps","CastOps","IPredicates","FPredicates","IntType","FPType","LocalName", +"OptLocalName","OptLocalAssign","GlobalName","OptGlobalAssign","GlobalAssign", +"GVInternalLinkage","GVExternalLinkage","GVVisibilityStyle","FunctionDeclareLinkage", +"FunctionDefineLinkage","AliasLinkage","OptCallingConv","ParamAttr","OptParamAttrs", +"FuncAttr","OptFuncAttrs","OptAlign","OptCAlign","SectionString","OptSection", +"GlobalVarAttributes","GlobalVarAttribute","PrimType","Types","ArgType","ResultTypes", +"ArgTypeList","ArgTypeListI","TypeListI","ConstVal","ConstExpr","ConstVector", +"GlobalType","ThreadLocal","AliaseeRef","Module","DefinitionList","Definition", +"@1","@2","@3","@4","@5","AsmBlock","TargetDefinition","LibrariesDefinition", +"LibList","ArgListH","ArgList","FunctionHeaderH","BEGIN","FunctionHeader","END", +"Function","FunctionProto","OptSideEffect","ConstValueRef","SymbolicValueRef", +"ValueRef","ResolvedVal","BasicBlockList","BasicBlock","InstructionList","BBTerminatorInst", +"JumpTable","Inst","PHIList","ValueRefList","IndexList","OptTailCall","InstVal", +"OptVolatile","MemoryInst", NULL +}; #endif -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 42 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1491 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 151 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 82 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 297 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 581 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 391 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 141, 142, 139, 2, 138, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 146, 137, 147, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 143, 140, 145, 2, 2, 2, 2, 2, 150, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 144, 2, 2, 148, 2, 149, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136 +static const short yyr1[] = { 0, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 152, + 152, 152, 152, 152, 152, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 154, 154, 154, + 154, 154, 154, 154, 154, 154, 154, 155, 155, 155, + 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, + 155, 155, 155, 156, 157, 157, 158, 158, 159, 159, + 160, 160, 161, 161, 162, 162, 163, 164, 164, 164, + 164, 164, 165, 165, 165, 166, 166, 166, 166, 167, + 167, 167, 168, 168, 168, 168, 168, 169, 169, 169, + 170, 170, 170, 170, 170, 170, 170, 171, 171, 171, + 171, 172, 172, 173, 173, 173, 174, 174, 175, 175, + 176, 176, 177, 178, 178, 179, 179, 180, 180, 181, + 181, 181, 181, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182, 182, 183, 184, 184, 185, + 185, 186, 186, 186, 186, 187, 187, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 189, 189, 189, + 189, 189, 189, 189, 189, 189, 189, 190, 190, 191, + 191, 192, 192, 193, 193, 194, 194, 195, 195, 197, + 196, 198, 196, 196, 196, 196, 199, 196, 200, 196, + 201, 196, 196, 196, 196, 202, 203, 203, 204, 205, + 205, 205, 206, 206, 207, 207, 207, 207, 208, 209, + 209, 210, 211, 211, 212, 213, 214, 214, 215, 215, + 215, 215, 215, 215, 215, 215, 215, 215, 215, 216, + 216, 216, 216, 217, 217, 218, 219, 219, 220, 221, + 221, 221, 222, 222, 222, 222, 222, 222, 222, 222, + 222, 223, 223, 224, 225, 225, 226, 226, 226, 227, + 227, 228, 228, 229, 229, 229, 229, 229, 229, 229, + 229, 229, 229, 229, 229, 229, 230, 230, 231, 231, + 231, 231, 231, 231, 231, 231 }; -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, - 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, - 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, - 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, - 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, - 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, - 119, 121, 122, 125, 126, 128, 130, 132, 133, 136, - 138, 140, 142, 144, 146, 148, 150, 152, 153, 155, - 157, 159, 160, 162, 164, 165, 167, 169, 171, 173, - 174, 176, 178, 179, 181, 183, 185, 187, 189, 192, - 194, 196, 198, 200, 201, 204, 206, 208, 210, 211, - 214, 215, 218, 219, 223, 226, 227, 229, 230, 234, - 236, 239, 241, 243, 245, 247, 249, 251, 254, 256, - 259, 265, 271, 277, 283, 287, 290, 296, 301, 304, - 306, 308, 310, 314, 316, 320, 322, 323, 325, 329, - 334, 338, 342, 347, 352, 356, 363, 369, 372, 375, - 378, 381, 384, 387, 390, 393, 396, 399, 402, 405, - 412, 418, 427, 434, 441, 449, 457, 464, 473, 482, - 486, 488, 490, 492, 494, 495, 498, 505, 507, 508, - 510, 513, 514, 518, 519, 523, 527, 531, 535, 536, - 544, 545, 554, 555, 564, 570, 573, 577, 579, 583, - 587, 591, 595, 597, 598, 604, 608, 610, 614, 616, - 617, 627, 629, 631, 636, 638, 640, 643, 647, 648, - 650, 652, 654, 656, 658, 660, 662, 664, 666, 670, - 672, 678, 680, 682, 684, 686, 688, 690, 693, 696, - 699, 703, 706, 707, 709, 712, 715, 719, 729, 739, - 748, 763, 765, 767, 774, 780, 783, 790, 798, 802, - 808, 809, 810, 814, 817, 819, 825, 831, 838, 845, - 850, 857, 862, 867, 874, 881, 884, 893, 895, 897, - 898, 902, 909, 913, 920, 923, 929, 937 +static const short yyr2[] = { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 2, 0, 1, 1, 1, 0, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, + 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, + 0, 1, 1, 1, 1, 1, 2, 1, 1, 1, + 1, 0, 2, 1, 1, 1, 0, 2, 0, 2, + 0, 3, 2, 0, 1, 0, 3, 1, 2, 1, + 1, 1, 1, 1, 1, 2, 1, 2, 5, 5, + 5, 5, 3, 2, 5, 4, 2, 1, 1, 1, + 3, 1, 3, 1, 0, 1, 3, 4, 3, 3, + 4, 4, 3, 6, 5, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 6, 5, 8, + 6, 6, 7, 7, 6, 8, 8, 3, 1, 1, + 1, 1, 0, 2, 6, 1, 0, 1, 2, 0, + 3, 0, 3, 3, 3, 3, 0, 7, 0, 8, + 0, 8, 5, 2, 3, 1, 3, 3, 3, 3, + 1, 0, 5, 3, 1, 3, 1, 0, 9, 1, + 1, 4, 1, 1, 2, 3, 0, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 1, 5, 1, + 1, 1, 1, 1, 1, 2, 2, 2, 3, 2, + 0, 1, 2, 2, 3, 9, 9, 8, 14, 1, + 1, 6, 5, 2, 6, 7, 3, 5, 0, 0, + 3, 2, 1, 5, 5, 6, 6, 4, 6, 4, + 4, 6, 6, 2, 8, 1, 1, 0, 3, 6, + 3, 6, 2, 5, 7, 4 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 195, 0, -1, 69, -1, 70, -1, 71, -1, 72, - -1, 73, -1, 74, -1, 75, -1, 76, -1, 77, - -1, 81, -1, 82, -1, 83, -1, 78, -1, 79, - -1, 80, -1, 112, -1, 113, -1, 114, -1, 115, - -1, 116, -1, 117, -1, 118, -1, 119, -1, 120, - -1, 121, -1, 122, -1, 123, -1, 86, -1, 87, - -1, 88, -1, 89, -1, 90, -1, 91, -1, 92, - -1, 93, -1, 94, -1, 95, -1, 96, -1, 97, - -1, 98, -1, 99, -1, 100, -1, 101, -1, 102, - -1, 103, -1, 104, -1, 105, -1, 92, -1, 93, - -1, 94, -1, 95, -1, 22, -1, 23, -1, 11, - -1, 12, -1, 13, -1, 16, -1, 19, -1, 159, - -1, -1, 159, 137, -1, -1, 17, -1, 20, -1, - 164, -1, -1, 162, 137, -1, 38, -1, 40, -1, - 39, -1, 41, -1, 43, -1, 42, -1, 44, -1, - 46, -1, -1, 134, -1, 135, -1, 136, -1, -1, - 42, -1, 44, -1, -1, 38, -1, 39, -1, 40, - -1, 43, -1, -1, 40, -1, 38, -1, -1, 57, - -1, 58, -1, 59, -1, 60, -1, 61, -1, 56, - 4, -1, 113, -1, 114, -1, 131, -1, 132, -1, - -1, 173, 172, -1, 130, -1, 133, -1, 172, -1, - -1, 175, 174, -1, -1, 49, 4, -1, -1, 138, - 49, 4, -1, 30, 19, -1, -1, 178, -1, -1, - 138, 181, 180, -1, 178, -1, 49, 4, -1, 11, - -1, 12, -1, 13, -1, 14, -1, 45, -1, 182, - -1, 183, 139, -1, 217, -1, 140, 4, -1, 183, - 141, 187, 142, 175, -1, 10, 141, 187, 142, 175, - -1, 143, 4, 144, 183, 145, -1, 146, 4, 144, - 183, 147, -1, 148, 188, 149, -1, 148, 149, -1, - 146, 148, 188, 149, 147, -1, 146, 148, 149, 147, - -1, 183, 173, -1, 183, -1, 10, -1, 184, -1, - 186, 138, 184, -1, 186, -1, 186, 138, 35, -1, - 35, -1, -1, 183, -1, 188, 138, 183, -1, 183, - 143, 191, 145, -1, 183, 143, 145, -1, 183, 150, - 19, -1, 183, 146, 191, 147, -1, 183, 148, 191, - 149, -1, 183, 148, 149, -1, 183, 146, 148, 191, - 149, 147, -1, 183, 146, 148, 149, 147, -1, 183, - 36, -1, 183, 37, -1, 183, 217, -1, 183, 190, - -1, 183, 21, -1, 157, 3, -1, 157, 5, -1, - 157, 4, -1, 157, 6, -1, 11, 22, -1, 11, - 23, -1, 158, 9, -1, 154, 141, 189, 34, 183, - 142, -1, 111, 141, 189, 228, 142, -1, 125, 141, - 189, 138, 189, 138, 189, 142, -1, 152, 141, 189, - 138, 189, 142, -1, 153, 141, 189, 138, 189, 142, - -1, 84, 155, 141, 189, 138, 189, 142, -1, 85, - 156, 141, 189, 138, 189, 142, -1, 127, 141, 189, - 138, 189, 142, -1, 128, 141, 189, 138, 189, 138, - 189, 142, -1, 129, 141, 189, 138, 189, 138, 189, - 142, -1, 191, 138, 189, -1, 189, -1, 28, -1, - 29, -1, 33, -1, -1, 185, 217, -1, 117, 141, - 194, 34, 183, 142, -1, 196, -1, -1, 197, -1, - 196, 197, -1, -1, 27, 198, 213, -1, -1, 26, - 199, 214, -1, 54, 53, 203, -1, 161, 15, 183, - -1, 161, 15, 10, -1, -1, 163, 167, 193, 192, - 189, 200, 180, -1, -1, 163, 165, 167, 193, 192, - 189, 201, 180, -1, -1, 163, 166, 167, 193, 192, - 183, 202, 180, -1, 163, 167, 31, 170, 194, -1, - 47, 204, -1, 50, 137, 205, -1, 19, -1, 48, - 137, 19, -1, 62, 137, 19, -1, 143, 206, 145, - -1, 206, 138, 19, -1, 19, -1, -1, 207, 138, - 183, 173, 160, -1, 183, 173, 160, -1, 207, -1, - 207, 138, 35, -1, 35, -1, -1, 171, 185, 162, - 141, 208, 142, 175, 179, 176, -1, 24, -1, 148, - -1, 169, 167, 209, 210, -1, 25, -1, 149, -1, - 220, 212, -1, 168, 167, 209, -1, -1, 55, -1, - 3, -1, 4, -1, 9, -1, 22, -1, 23, -1, - 36, -1, 37, -1, 21, -1, 146, 191, 147, -1, - 190, -1, 53, 215, 19, 138, 19, -1, 7, -1, - 8, -1, 159, -1, 162, -1, 217, -1, 216, -1, - 183, 218, -1, 220, 221, -1, 211, 221, -1, 222, - 161, 223, -1, 222, 225, -1, -1, 18, -1, 63, - 219, -1, 63, 10, -1, 64, 14, 218, -1, 64, - 11, 218, 138, 14, 218, 138, 14, 218, -1, 65, - 157, 218, 138, 14, 218, 143, 224, 145, -1, 65, - 157, 218, 138, 14, 218, 143, 145, -1, 66, 171, - 185, 218, 141, 227, 142, 175, 34, 14, 218, 67, - 14, 218, -1, 67, -1, 68, -1, 224, 157, 216, - 138, 14, 218, -1, 157, 216, 138, 14, 218, -1, - 161, 230, -1, 183, 143, 218, 138, 218, 145, -1, - 226, 138, 143, 218, 138, 218, 145, -1, 183, 218, - 173, -1, 227, 138, 183, 218, 173, -1, -1, -1, - 228, 138, 219, -1, 52, 51, -1, 51, -1, 152, - 183, 218, 138, 218, -1, 153, 183, 218, 138, 218, - -1, 84, 155, 183, 218, 138, 218, -1, 85, 156, - 183, 218, 138, 218, -1, 154, 219, 34, 183, -1, - 125, 219, 138, 219, 138, 219, -1, 126, 219, 138, - 183, -1, 127, 219, 138, 219, -1, 128, 219, 138, - 219, 138, 219, -1, 129, 219, 138, 219, 138, 219, - -1, 124, 226, -1, 229, 171, 185, 218, 141, 227, - 142, 175, -1, 232, -1, 32, -1, -1, 106, 183, - 177, -1, 106, 183, 138, 11, 218, 177, -1, 107, - 183, 177, -1, 107, 183, 138, 11, 218, 177, -1, - 108, 219, -1, 231, 109, 183, 218, 177, -1, 231, - 110, 219, 138, 183, 218, 177, -1, 111, 183, 218, - 228, -1 +static const short yydefact[] = { 66, + 57, 63, 58, 64, 192, 190, 0, 0, 0, 0, + 0, 0, 76, 65, 66, 188, 80, 83, 0, 0, + 204, 0, 0, 61, 0, 67, 68, 70, 69, 71, + 73, 72, 74, 75, 77, 78, 79, 76, 76, 183, + 189, 81, 82, 76, 193, 84, 85, 86, 87, 76, + 251, 191, 251, 0, 0, 212, 205, 206, 194, 240, + 241, 196, 120, 121, 122, 123, 124, 0, 0, 0, + 0, 242, 243, 125, 195, 127, 183, 183, 88, 182, + 0, 91, 91, 252, 248, 62, 223, 224, 225, 247, + 207, 208, 211, 0, 145, 128, 0, 0, 0, 0, + 134, 146, 0, 126, 145, 0, 0, 90, 89, 0, + 180, 181, 0, 0, 92, 93, 94, 95, 96, 0, + 226, 0, 288, 250, 0, 209, 144, 102, 140, 142, + 0, 0, 0, 0, 0, 0, 133, 0, 0, 0, + 139, 0, 138, 0, 203, 120, 121, 122, 0, 0, + 0, 197, 97, 0, 220, 221, 222, 287, 273, 0, + 0, 0, 0, 91, 260, 261, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 13, 14, 15, 10, 11, + 12, 0, 0, 0, 0, 0, 0, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 249, 91, + 264, 0, 286, 210, 137, 0, 107, 0, 0, 136, + 0, 147, 107, 199, 201, 0, 184, 165, 166, 161, + 163, 162, 164, 167, 160, 156, 157, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 159, 158, 116, 0, 272, 254, 0, 253, 0, + 0, 54, 0, 0, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 0, 52, 53, 48, 49, 50, + 51, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 0, 111, 111, 293, 0, 0, 284, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, + 99, 100, 101, 103, 143, 141, 130, 131, 132, 135, + 129, 116, 116, 0, 0, 0, 0, 0, 0, 0, + 0, 149, 179, 0, 0, 0, 153, 0, 150, 0, + 0, 0, 0, 198, 218, 229, 230, 231, 236, 232, + 233, 234, 235, 227, 0, 238, 245, 244, 246, 0, + 255, 0, 0, 0, 0, 0, 289, 0, 291, 270, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 104, 105, 106, 108, 200, 202, 0, + 0, 0, 270, 0, 0, 0, 0, 0, 148, 134, + 146, 0, 151, 152, 0, 0, 0, 0, 0, 118, + 116, 217, 102, 215, 0, 228, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 296, 0, 0, 0, + 280, 281, 0, 0, 0, 0, 278, 0, 111, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 178, 155, + 0, 0, 0, 0, 113, 119, 117, 60, 0, 107, + 0, 237, 0, 0, 269, 0, 0, 111, 112, 111, + 0, 0, 0, 0, 0, 0, 274, 275, 269, 0, + 294, 0, 185, 0, 0, 169, 0, 0, 0, 0, + 154, 0, 0, 0, 59, 214, 216, 102, 114, 0, + 0, 0, 0, 0, 276, 277, 290, 292, 271, 0, + 0, 279, 282, 283, 0, 111, 0, 0, 0, 175, + 0, 0, 171, 172, 168, 60, 115, 109, 239, 0, + 0, 102, 0, 107, 265, 0, 107, 295, 173, 174, + 0, 0, 0, 213, 0, 219, 0, 258, 0, 0, + 267, 0, 0, 266, 285, 170, 176, 177, 110, 256, + 0, 257, 0, 102, 0, 0, 0, 268, 0, 0, + 0, 0, 263, 0, 0, 262, 0, 259, 0, 0, + 0 }; -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, - 1111, 1112, 1112, 1112, 1112, 1112, 1112, 1113, 1113, 1113, - 1113, 1113, 1113, 1114, 1114, 1114, 1114, 1114, 1114, 1117, - 1117, 1118, 1118, 1119, 1119, 1120, 1120, 1121, 1121, 1125, - 1125, 1126, 1126, 1127, 1127, 1128, 1128, 1129, 1129, 1130, - 1130, 1131, 1131, 1132, 1133, 1138, 1139, 1139, 1141, 1141, - 1142, 1142, 1146, 1150, 1155, 1155, 1157, 1158, 1163, 1169, - 1170, 1171, 1172, 1173, 1177, 1178, 1179, 1183, 1184, 1185, - 1186, 1190, 1191, 1192, 1196, 1197, 1198, 1199, 1200, 1204, - 1205, 1206, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1222, - 1223, 1224, 1225, 1228, 1229, 1234, 1235, 1236, 1239, 1240, - 1247, 1248, 1254, 1255, 1263, 1271, 1272, 1277, 1278, 1279, - 1284, 1297, 1297, 1297, 1297, 1300, 1304, 1308, 1315, 1320, - 1328, 1358, 1389, 1394, 1406, 1416, 1420, 1430, 1437, 1444, - 1451, 1456, 1461, 1468, 1469, 1476, 1483, 1491, 1497, 1509, - 1537, 1553, 1582, 1610, 1636, 1656, 1682, 1702, 1714, 1721, - 1787, 1797, 1807, 1813, 1823, 1829, 1839, 1844, 1849, 1857, - 1869, 1891, 1899, 1905, 1916, 1921, 1926, 1932, 1938, 1947, - 1951, 1959, 1959, 1962, 1962, 1965, 1976, 1997, 2002, 2010, - 2011, 2015, 2015, 2019, 2019, 2022, 2025, 2049, 2060, 2060, - 2071, 2070, 2080, 2079, 2090, 2105, 2108, 2114, 2127, 2131, - 2136, 2138, 2143, 2148, 2157, 2167, 2178, 2182, 2191, 2200, - 2205, 2327, 2327, 2329, 2338, 2338, 2340, 2345, 2357, 2361, - 2366, 2370, 2374, 2378, 2382, 2386, 2390, 2394, 2398, 2423, - 2427, 2441, 2445, 2449, 2453, 2459, 2459, 2465, 2474, 2478, - 2487, 2496, 2505, 2509, 2514, 2518, 2522, 2527, 2537, 2556, - 2565, 2645, 2649, 2656, 2667, 2680, 2690, 2701, 2711, 2720, - 2729, 2732, 2733, 2740, 2744, 2749, 2770, 2787, 2801, 2815, - 2827, 2835, 2842, 2848, 2854, 2860, 2875, 2960, 2965, 2969, - 2976, 2983, 2991, 2998, 3006, 3014, 3028, 3045 +static const short yydefgoto[] = { 249, + 250, 251, 275, 292, 149, 150, 72, 496, 11, 73, + 13, 14, 38, 39, 40, 44, 50, 110, 120, 314, + 215, 387, 317, 546, 367, 410, 528, 344, 411, 74, + 151, 129, 144, 130, 131, 103, 333, 356, 334, 113, + 81, 145, 579, 15, 16, 18, 17, 254, 322, 323, + 59, 21, 57, 94, 414, 415, 121, 157, 51, 89, + 52, 45, 417, 357, 76, 359, 259, 53, 85, 86, + 209, 550, 124, 298, 504, 427, 210, 211, 212, 213 }; -#endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL", - "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE", - "FLOAT", "DOUBLE", "LABEL", "TYPE", "LOCALVAR", "GLOBALVAR", "LABELSTR", - "STRINGCONSTANT", "ATSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK", - "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL", - "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO", - "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK", - "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", - "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "DEPLIBS", "CALL", "TAIL", - "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK", "FASTCC_TOK", - "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", - "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB", - "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM", "AND", "OR", - "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", - "SLE", "SGE", "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT", - "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "MALLOC", "ALLOCA", "FREE", - "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", - "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", - "PTRTOINT", "PHI_TOK", "SELECT", "VAARG", "EXTRACTELEMENT", - "INSERTELEMENT", "SHUFFLEVECTOR", "NORETURN", "INREG", "SRET", - "NOUNWIND", "DEFAULT", "HIDDEN", "PROTECTED", "'='", "','", "'*'", - "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'", - "'c'", "$accept", "ArithmeticOps", "LogicalOps", "CastOps", - "IPredicates", "FPredicates", "IntType", "FPType", "LocalName", - "OptLocalName", "OptLocalAssign", "GlobalName", "OptGlobalAssign", - "GlobalAssign", "GVInternalLinkage", "GVExternalLinkage", - "GVVisibilityStyle", "FunctionDeclareLinkage", "FunctionDefineLinkage", - "AliasLinkage", "OptCallingConv", "ParamAttr", "OptParamAttrs", - "FuncAttr", "OptFuncAttrs", "OptAlign", "OptCAlign", "SectionString", - "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", - "Types", "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", - "TypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType", - "ThreadLocal", "AliaseeRef", "Module", "DefinitionList", "Definition", - "@1", "@2", "@3", "@4", "@5", "AsmBlock", "TargetDefinition", - "LibrariesDefinition", "LibList", "ArgListH", "ArgList", - "FunctionHeaderH", "BEGIN", "FunctionHeader", "END", "Function", - "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef", - "ValueRef", "ResolvedVal", "BasicBlockList", "BasicBlock", - "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", "PHIList", - "ValueRefList", "IndexList", "OptTailCall", "InstVal", "OptVolatile", - "MemoryInst", 0 +static const short yypact[] = { 58, +-32768,-32768,-32768,-32768,-32768,-32768, -31, -88, 100, -74, + 156, -6, 492,-32768, 595,-32768, 78, 161, 76, 79, +-32768, 99, 202,-32768, 1112,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768, 147, 147, 191, +-32768,-32768,-32768, 147,-32768,-32768,-32768,-32768,-32768, 147, + 235,-32768, 37, 243, 256, 259,-32768,-32768,-32768,-32768, +-32768, 150,-32768,-32768,-32768,-32768,-32768, 284, 300, 4, + 26,-32768,-32768,-32768, 169,-32768, 287, 287, 293,-32768, + 237, 199, 199,-32768,-32768, 95,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, -81, 453,-32768, 181, 184, 198, 150, +-32768, 169, -97,-32768, 453, 237, 237,-32768,-32768, 956, +-32768,-32768, 1148, 328,-32768,-32768,-32768,-32768,-32768, 1194, +-32768, -8, 1356,-32768, 315,-32768,-32768, 169,-32768, 204, + 201, 1208, 1208, 208, -82, 1208,-32768, 206, 1148, 1208, + 150, 215, 169, 299,-32768, 96, 340, 354, 297, 355, + 781,-32768,-32768, 125,-32768,-32768,-32768,-32768,-32768, 314, + 1254, 162, 357, 199,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, 487, 467, 1208, 1208, 1208, 1208,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1208, + 1208, 1208, 1208, 1208, 1208, 1208, 1208, 1208,-32768, 199, +-32768, 187,-32768,-32768, 119, 1001,-32768, 10, 84,-32768, + 223, 169,-32768,-32768, 169, 956,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768, 487, 467, 234, + 236, 238, 239, 240, 1037, 1270, 260, 359, 253, 261, + 263,-32768,-32768, 246, 264,-32768, 150, 631,-32768, 759, + 759,-32768, 759, 1194,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, 1208,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, 1208, -45, -35,-32768, 631, 170, 269, 273, 274, + 275, 276, 278, 631, 631, 342, 1194, 1208, 1208,-32768, +-32768,-32768,-32768,-32768,-32768,-32768, 2,-32768,-32768,-32768, + 2, 246, 246, 363, 279, 280, 1148, 1148, 1148, 1148, + 1148,-32768,-32768, -50, 379, -55,-32768, -69,-32768, 1148, + 1148, 1148, 30,-32768, 1052,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 346, 1148,-32768,-32768,-32768,-32768, 281, +-32768, 290, 759, 631, 631, 17,-32768, 19,-32768,-32768, + 759, 282, 1208, 1208, 1208, 1208, 1208, 292, 296, 1208, + 759, 631, 301,-32768,-32768,-32768,-32768,-32768,-32768, 1208, + 1148, 1148,-32768, 303, 305, 306, 307, 1148,-32768, 288, + 781, -68,-32768,-32768, 308, 309, 404, 430, 446,-32768, + 246,-32768, 169, 316, 313,-32768, 438, -49, 445, 448, + 327, 333, 336, 759, 471, 759, 343, 344, 759, 353, + 169,-32768, 356, 358, 759, 759, 169, 339, 361, 1208, + 49, 362, 364, -1, 1148, 1148, 1148, 1148,-32768,-32768, + 345, 1148, 1148, 1208,-32768,-32768,-32768, 16, 1098,-32768, + 367,-32768, 759, 759, 1208, 759, 759, 361,-32768, 361, + 1208, 759, 368, 1208, 1208, 1208,-32768,-32768, 1208, 452, +-32768, 631,-32768, 1148, 1148,-32768, 369, 366, 371, 373, +-32768, 370, 372, 182,-32768,-32768,-32768, 169, 106, 476, + 375, 374, 631, 18,-32768,-32768,-32768,-32768,-32768, 352, + 759,-32768,-32768,-32768, 60, 361, 376, 378, 1148,-32768, + 1148, 1148,-32768,-32768,-32768, 16,-32768, 472,-32768, 509, + -2,-32768, 1208,-32768,-32768, 384,-32768,-32768,-32768,-32768, + 382, 395, 397,-32768, 536,-32768, 759,-32768, 912, 1, + 119, 631, 116,-32768, 2,-32768,-32768,-32768,-32768,-32768, + 403,-32768, 912,-32768, 528, 529, 406, 119, 759, 759, + 531, 480,-32768, 759, 535,-32768, 759,-32768, 554, 555, +-32768 }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 61, 44, 42, - 92, 40, 41, 91, 120, 93, 60, 62, 123, 125, - 99 +static const short yypgoto[] = { 433, + 460, 461, 349, 351, -162,-32768, 0, 65, 506, 11, +-32768,-32768,-32768,-32768, 15,-32768,-32768,-32768, -120, -292, + -407,-32768, -220,-32768, -281, 98,-32768, -272,-32768,-32768, + -23, 386, -110,-32768, 493, 501, 31, -147, -228, 230, + 262, 377,-32768,-32768, 590,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768, 523,-32768,-32768,-32768, +-32768,-32768,-32768, -502, -137, 122, -181,-32768, 556,-32768, +-32768,-32768,-32768,-32768, 128, 220,-32768,-32768,-32768,-32768 }; -# endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 151, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 153, 153, 153, 153, 153, 153, 154, 154, 154, - 154, 154, 154, 154, 154, 154, 154, 154, 154, 155, - 155, 155, 155, 155, 155, 155, 155, 155, 155, 156, - 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, - 156, 156, 156, 156, 156, 157, 158, 158, 159, 159, - 160, 160, 161, 161, 162, 162, 163, 163, 164, 165, - 165, 165, 165, 165, 166, 166, 166, 167, 167, 167, - 167, 168, 168, 168, 169, 169, 169, 169, 169, 170, - 170, 170, 171, 171, 171, 171, 171, 171, 171, 172, - 172, 172, 172, 173, 173, 174, 174, 174, 175, 175, - 176, 176, 177, 177, 178, 179, 179, 180, 180, 181, - 181, 182, 182, 182, 182, 183, 183, 183, 183, 183, - 183, 183, 183, 183, 183, 183, 183, 183, 184, 185, - 185, 186, 186, 187, 187, 187, 187, 188, 188, 189, - 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, - 189, 189, 189, 189, 189, 189, 189, 189, 189, 190, - 190, 190, 190, 190, 190, 190, 190, 190, 190, 191, - 191, 192, 192, 193, 193, 194, 194, 195, 195, 196, - 196, 198, 197, 199, 197, 197, 197, 197, 200, 197, - 201, 197, 202, 197, 197, 197, 197, 203, 204, 204, - 205, 206, 206, 206, 207, 207, 208, 208, 208, 208, - 209, 210, 210, 211, 212, 212, 213, 214, 215, 215, - 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 216, 217, 217, 217, 217, 218, 218, 219, 220, 220, - 221, 222, 222, 222, 223, 223, 223, 223, 223, 223, - 223, 223, 223, 224, 224, 225, 226, 226, 227, 227, - 227, 228, 228, 229, 229, 230, 230, 230, 230, 230, - 230, 230, 230, 230, 230, 230, 230, 230, 231, 231, - 232, 232, 232, 232, 232, 232, 232, 232 -}; -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0, 2, 0, 1, 1, 1, 0, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, - 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, - 1, 1, 0, 1, 1, 1, 1, 1, 2, 1, - 1, 1, 1, 0, 2, 1, 1, 1, 0, 2, - 0, 2, 0, 3, 2, 0, 1, 0, 3, 1, - 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, - 5, 5, 5, 5, 3, 2, 5, 4, 2, 1, - 1, 1, 3, 1, 3, 1, 0, 1, 3, 4, - 3, 3, 4, 4, 3, 6, 5, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, - 5, 8, 6, 6, 7, 7, 6, 8, 8, 3, - 1, 1, 1, 1, 0, 2, 6, 1, 0, 1, - 2, 0, 3, 0, 3, 3, 3, 3, 0, 7, - 0, 8, 0, 8, 5, 2, 3, 1, 3, 3, - 3, 3, 1, 0, 5, 3, 1, 3, 1, 0, - 9, 1, 1, 4, 1, 1, 2, 3, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, - 5, 1, 1, 1, 1, 1, 1, 2, 2, 2, - 3, 2, 0, 1, 2, 2, 3, 9, 9, 8, - 14, 1, 1, 6, 5, 2, 6, 7, 3, 5, - 0, 0, 3, 2, 1, 5, 5, 6, 6, 4, - 6, 4, 4, 6, 6, 2, 8, 1, 1, 0, - 3, 6, 3, 6, 2, 5, 7, 4 -}; +#define YYLAST 1485 -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint16 yydefact[] = -{ - 67, 58, 64, 59, 65, 193, 191, 0, 0, 0, - 0, 0, 0, 77, 66, 0, 67, 189, 81, 84, - 0, 0, 205, 0, 0, 62, 0, 68, 69, 71, - 70, 72, 74, 73, 75, 76, 78, 79, 80, 77, - 77, 184, 1, 190, 82, 83, 77, 194, 85, 86, - 87, 88, 77, 252, 192, 252, 0, 0, 213, 206, - 207, 195, 241, 242, 197, 121, 122, 123, 124, 125, - 0, 0, 0, 0, 243, 244, 126, 196, 128, 184, - 184, 89, 183, 0, 92, 92, 253, 249, 63, 224, - 225, 226, 248, 208, 209, 212, 0, 146, 129, 0, - 0, 0, 0, 135, 147, 0, 127, 146, 0, 0, - 91, 90, 0, 181, 182, 0, 0, 93, 94, 95, - 96, 97, 0, 227, 0, 289, 251, 0, 210, 145, - 103, 141, 143, 0, 0, 0, 0, 0, 0, 134, - 0, 0, 0, 140, 0, 139, 0, 204, 121, 122, - 123, 0, 0, 0, 198, 98, 0, 221, 222, 223, - 288, 274, 0, 0, 0, 0, 92, 261, 262, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, - 16, 11, 12, 13, 0, 0, 0, 0, 0, 0, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 250, 92, 265, 0, 287, 211, 138, 0, 108, - 0, 0, 137, 0, 148, 108, 200, 202, 0, 185, - 166, 167, 162, 164, 163, 165, 168, 161, 157, 158, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 160, 159, 117, 0, 273, 255, - 0, 254, 0, 0, 55, 0, 0, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 0, 53, 54, - 49, 50, 51, 52, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 0, 112, 112, 294, 0, 0, - 285, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 99, 100, 101, 102, 104, 144, 142, 131, - 132, 133, 136, 130, 117, 117, 0, 0, 0, 0, - 0, 0, 0, 0, 150, 180, 0, 0, 0, 154, - 0, 151, 0, 0, 0, 0, 199, 219, 230, 231, - 232, 237, 233, 234, 235, 236, 228, 0, 239, 246, - 245, 247, 0, 256, 0, 0, 0, 0, 0, 290, - 0, 292, 271, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 105, 106, 107, 109, - 201, 203, 0, 0, 0, 271, 0, 0, 0, 0, - 0, 149, 135, 147, 0, 152, 153, 0, 0, 0, - 0, 0, 119, 117, 218, 103, 216, 0, 229, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 297, - 0, 0, 0, 281, 282, 0, 0, 0, 0, 279, - 0, 112, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 179, 156, 0, 0, 0, 0, 114, 120, 118, - 61, 0, 108, 0, 238, 0, 0, 270, 0, 0, - 112, 113, 112, 0, 0, 0, 0, 0, 0, 275, - 276, 270, 0, 295, 0, 186, 0, 0, 170, 0, - 0, 0, 0, 155, 0, 0, 0, 60, 215, 217, - 103, 115, 0, 0, 0, 0, 0, 277, 278, 291, - 293, 272, 0, 0, 280, 283, 284, 0, 112, 0, - 0, 0, 176, 0, 0, 172, 173, 169, 61, 116, - 110, 240, 0, 0, 103, 0, 108, 266, 0, 108, - 296, 174, 175, 0, 0, 0, 214, 0, 220, 0, - 259, 0, 0, 268, 0, 0, 267, 286, 171, 177, - 178, 111, 257, 0, 258, 0, 103, 0, 0, 0, - 269, 0, 0, 0, 0, 264, 0, 0, 263, 0, - 260 -}; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 251, 252, 253, 277, 294, 151, 152, 74, 498, - 11, 75, 13, 14, 39, 40, 41, 46, 52, 112, - 122, 316, 217, 389, 319, 548, 369, 412, 530, 346, - 413, 76, 153, 131, 146, 132, 133, 105, 335, 358, - 336, 115, 83, 147, 15, 16, 17, 19, 18, 256, - 324, 325, 61, 22, 59, 96, 416, 417, 123, 159, - 53, 91, 54, 47, 419, 359, 78, 361, 261, 55, - 87, 88, 211, 552, 126, 300, 506, 429, 212, 213, - 214, 215 +static const short yytable[] = { 10, + 263, 75, 321, 252, 295, 458, 227, 98, 262, 154, + 12, 262, 369, 253, 10, 155, 19, 336, 338, 299, + 300, 301, 302, 303, 386, 12, 306, 424, 386, 426, + 20, 1, 60, 61, 3, 100, 63, 64, 65, 66, + 136, 1, 2, 264, 3, 4, 561, 102, 22, 388, + 389, 137, 77, 78, 84, 136, 125, -187, 82, 408, + 567, 87, 24, 126, 83, 425, 221, 425, 398, 398, + 67, 128, -62, 1, 2, 102, 3, 4, 409, 404, + 451, 128, 398, 5, 6, 10, 143, 398, 398, 307, + 526, 403, 366, 104, 399, 105, 143, 462, -54, -54, + -54, -54, 368, 104, 7, 105, 402, 8, 218, 219, + 1, 9, 222, 3, 310, 311, 225, 228, 229, 42, + 358, 43, 358, 358, 551, 358, 418, 383, 310, 311, + 26, 384, 312, 313, 385, 408, 471, 258, 457, 156, + 486, 2, 548, 152, 4, 562, 312, 313, 104, 565, + 105, 99, 23, 363, 318, 533, 568, 481, 358, 534, + 293, 294, 258, 296, 255, 68, 358, 358, 69, 224, + 25, 70, 260, 71, 101, 261, 297, 258, 258, 258, + 258, 258, 304, 305, 258, 88, 507, 104, 508, 105, + 483, 430, 128, 432, 433, 434, 381, 533, 46, 47, + 48, 537, 143, 49, 60, 61, 386, 100, 63, 64, + 65, 66, 54, 1, 2, 55, 3, 4, 310, 311, + 58, 79, 104, 80, 105, 358, 358, 358, 310, 311, + 319, 310, 311, 358, 538, 384, 312, 313, 385, 499, + 143, 56, 67, 358, 358, 384, 312, 313, 385, 312, + 313, 364, 84, 252, 114, 115, 116, 117, 118, 119, + 386, 91, 386, 253, 111, 112, 60, 61, 365, 100, + 146, 147, 148, 66, 92, 1, 2, 93, 3, 4, + 35, 36, 37, 143, 382, 258, 358, 96, 358, 509, + 95, 358, 512, 513, 514, 308, 309, 358, 358, 230, + 231, 232, 233, 97, 67, 60, 61, 104, 104, 105, + 105, 401, 371, 553, 1, 2, 555, 3, 4, 80, + 104, 413, 105, 525, 132, 358, 358, 133, 358, 358, + 108, 153, 109, 214, 358, 139, 140, 68, 106, 107, + 69, 216, 217, 70, 358, 71, 134, 223, -55, 258, + 431, 258, 258, 258, 220, 226, 437, 393, 394, 395, + 396, 397, -56, 234, 256, 358, 441, 262, 549, 320, + 405, 406, 407, 358, 327, 380, 328, 339, 329, 330, + 331, 360, 361, 343, 362, 60, 61, 563, 100, 146, + 147, 148, 66, 340, 1, 2, 390, 3, 4, 68, + 416, 341, 69, 342, 345, 70, 372, 71, 337, 358, + 373, 374, 375, 376, 358, 377, 482, 370, 419, 391, + 392, 442, 443, 67, 429, 378, 379, 420, 449, 435, + 494, 358, 358, 436, 450, 498, 358, 454, 440, 358, + 445, 503, 446, 447, 448, 452, 453, 258, 455, 456, + 258, 258, 258, 459, 460, 503, 461, 495, 463, 60, + 61, 464, 100, 63, 64, 65, 66, 465, 1, 2, + 466, 3, 4, 467, 469, 487, 488, 489, 490, 479, + 471, 472, 492, 493, 421, 422, 423, 127, 276, 277, + 474, 491, 428, 475, 529, 476, 535, 67, 480, 484, + 425, 485, 438, 439, 500, 511, 519, 520, 521, 552, + 522, 523, 530, 524, 517, 518, 531, 539, 68, 540, + 545, 69, 547, 556, 70, 495, 71, 400, 554, 27, + 28, 29, 30, 31, 32, 33, 557, 34, 558, 559, + 566, 569, 570, 571, 574, 468, 575, 470, 577, 541, + 473, 542, 543, 580, 581, 206, 477, 478, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 207, 208, 501, 502, 325, 505, 506, 326, + 544, 123, 68, 510, -186, 69, 527, 138, 70, 135, + 71, 316, 324, 516, 41, 122, 515, 0, 90, -62, + 1, 2, 444, 3, 4, 0, 0, 0, 0, 0, + 5, 6, 0, 0, 532, 35, 36, 37, 0, 0, + 0, 0, 536, 346, 347, 0, 0, 60, 61, 348, + 0, 7, 0, 0, 8, 0, 1, 2, 9, 3, + 4, 349, 350, 351, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 352, 353, 560, 0, + 0, 0, 0, 564, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 354, 0, 0, 0, 0, 0, 0, + 572, 573, 0, 0, 0, 576, 0, 0, 578, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 238, 239, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 240, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 0, 241, 0, 242, 243, 244, + 0, 346, 347, 0, 0, 60, 61, 348, 0, 104, + 0, 105, 0, 0, 1, 2, 355, 3, 4, 349, + 350, 351, 0, 0, 0, 0, 0, 60, 61, 0, + 0, 0, 0, 0, 352, 353, 1, 2, 0, 3, + 4, 235, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 354, 0, 0, 0, 0, 236, 237, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 238, 239, 0, 0, 0, 0, 0, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 238, 239, 0, 0, 0, 240, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 0, 241, 0, 242, 243, 244, 0, 0, + 0, 240, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 355, 241, 0, 242, 243, 244, + 0, 0, 0, 0, 346, 347, 0, 0, 0, 104, + 348, 105, 0, 245, 0, 0, 246, 0, 247, 0, + 248, 0, 349, 350, 351, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 352, 353, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 60, 61, 354, 141, 63, 64, 65, 66, + 0, 1, 2, 0, 3, 4, 0, 0, 0, 0, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 238, 239, 0, 0, 0, + 67, 0, 0, 0, 0, 0, 0, 60, 61, 0, + 100, 63, 64, 65, 66, 0, 1, 2, 0, 3, + 4, 0, 240, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 315, 241, 0, 242, 243, + 244, 0, 0, 60, 61, 67, 100, 146, 147, 148, + 66, 0, 1, 2, 0, 3, 4, 355, 60, 61, + 0, 100, 63, 64, 65, 66, 0, 1, 2, 0, + 3, 4, 142, 0, 0, 0, 0, 0, 0, 0, + 0, 67, 0, 0, 0, 0, 412, 0, 0, 0, + 0, 0, 0, 0, 0, 68, 67, 0, 69, 0, + 0, 70, 0, 71, 60, 61, 0, 100, 63, 64, + 65, 66, 0, 1, 2, 0, 3, 4, 60, 61, + 0, 62, 63, 64, 65, 66, 0, 1, 2, 0, + 3, 4, 497, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 67, 69, 0, 0, 70, 0, 71, 0, + 0, 0, 0, 0, 60, 61, 67, 100, 146, 147, + 148, 66, 0, 1, 2, 0, 3, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 68, 0, 0, 69, + 0, 332, 70, 0, 71, 0, 0, 0, 0, 0, + 0, 68, 67, 0, 69, 0, 0, 70, 0, 71, + 60, 61, 0, 141, 63, 64, 65, 66, 0, 1, + 2, 0, 3, 4, 60, 61, 0, 100, 63, 64, + 65, 66, 0, 1, 2, 0, 3, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 68, 67, 0, + 69, 0, 0, 70, 0, 71, 0, 0, 0, 0, + 0, 68, 67, 0, 69, 0, 0, 70, 0, 71, + 60, 61, 0, 257, 63, 64, 65, 66, 0, 1, + 2, 0, 3, 4, 0, 0, 60, 61, 0, 100, + 146, 147, 148, 66, 0, 1, 2, 68, 3, 4, + 69, 0, 0, 70, 0, 71, 0, 0, 67, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 68, 0, 0, 69, 0, 0, 70, + 0, 71, 0, 0, 0, 0, 0, 68, 0, 0, + 69, 0, 0, 70, 0, 71, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 158, 0, 0, + 0, 0, 0, 68, 0, 0, 69, 0, 0, 70, + 0, 71, 0, 0, 0, 0, 159, 160, 0, 68, + 0, 0, 69, 0, 0, 70, 0, 335, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 184, 185, 186, 0, 0, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205 }; -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -460 -static const yytype_int16 yypact[] = -{ - 30, -460, -460, -460, -460, -460, -460, -4, -118, 45, - -108, 70, 36, 432, -460, 151, 558, -460, 148, 200, - 49, 71, -460, 82, 150, -460, 1184, -460, -460, -460, - -460, -460, -460, -460, -460, -460, -460, -460, -460, 189, - 189, 250, -460, -460, -460, -460, 189, -460, -460, -460, - -460, -460, 189, 196, -460, -14, 239, 248, 277, -460, - -460, -460, -460, -460, 129, -460, -460, -460, -460, -460, - 307, 313, 4, 368, -460, -460, -460, 192, -460, 295, - 295, 294, -460, 26, 163, 163, -460, -460, 155, -460, - -460, -460, -460, -460, -460, -460, -114, 54, -460, 194, - 195, 932, 129, -460, 192, -117, -460, 54, 26, 26, - -460, -460, 1028, -460, -460, 1198, 336, -460, -460, -460, - -460, -460, 1225, -460, -6, 1362, -460, 322, -460, -460, - 192, -460, 204, 201, 1240, 1240, 197, -55, 1240, -460, - 205, 1198, 1240, 129, 207, 192, 88, -460, 97, 337, - 340, 274, 346, 757, -460, -460, 184, -460, -460, -460, - -460, -460, 305, 1261, 251, 349, 163, -460, -460, -460, - -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, - -460, -460, -460, -460, 395, 443, 1240, 1240, 1240, 1240, - -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, - -460, -460, 1240, 1240, 1240, 1240, 1240, 1240, 1240, 1240, - 1240, -460, 163, -460, 137, -460, -460, -80, 120, -460, - 31, 109, -460, 215, 192, -460, -460, 192, 1028, -460, - -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, - 395, 443, 222, 227, 228, 231, 232, 1042, 1276, 973, - 358, 242, 245, 249, -460, -460, 253, 252, -460, 129, - 607, -460, 735, 735, -460, 735, 1225, -460, -460, -460, - -460, -460, -460, -460, -460, -460, -460, 1240, -460, -460, - -460, -460, -460, -460, -460, -460, -460, -460, -460, -460, - -460, -460, -460, -460, 1240, 152, 156, -460, 607, 118, - 254, 258, 259, 260, 261, 262, 607, 607, 361, 1225, - 1240, 1240, -460, -460, -460, -460, -460, -460, -460, 99, - -460, -460, -460, 99, 253, 253, 367, 263, 264, 1198, - 1198, 1198, 1198, 1198, -460, -460, -85, 1012, 3, -460, - -27, -460, 1198, 1198, 1198, 29, -460, 1082, -460, -460, - -460, -460, -460, -460, -460, -460, 351, 1198, -460, -460, - -460, -460, 269, -460, 270, 735, 607, 607, 14, -460, - 32, -460, -460, 735, 266, 1240, 1240, 1240, 1240, 1240, - 273, 276, 1240, 735, 607, 278, -460, -460, -460, -460, - -460, -460, 1240, 1198, 1198, -460, 284, 285, 286, 289, - 1198, -460, 265, 757, 9, -460, -460, 290, 291, 396, - 415, 431, -460, 253, -460, 192, 300, 297, -460, 422, - 7, 429, 430, 304, 308, 309, 735, 445, 735, 312, - 316, 735, 317, 192, -460, 321, 326, 735, 735, 192, - 327, 329, 1240, 94, 339, 353, -63, 1198, 1198, 1198, - 1198, -460, -460, 350, 1198, 1198, 1240, -460, -460, -460, - 74, 1118, -460, 355, -460, 735, 735, 1240, 735, 735, - 329, -460, 329, 1240, 735, 360, 1240, 1240, 1240, -460, - -460, 1240, 447, -460, 607, -460, 1198, 1198, -460, 362, - 357, 363, 364, -460, 365, 370, 179, -460, -460, -460, - 192, 85, 484, 366, 372, 607, -24, -460, -460, -460, - -460, -460, 373, 735, -460, -460, -460, 6, 329, 371, - 377, 1198, -460, 1198, 1198, -460, -460, -460, 74, -460, - 456, -460, 492, 1, -460, 1240, -460, -460, 375, -460, - -460, -460, -460, 379, 381, 383, -460, 505, -460, 735, - -460, 888, 11, -80, 607, 141, -460, 99, -460, -460, - -460, -460, -460, 388, -460, 888, -460, 515, 516, 393, - -80, 735, 735, 518, 482, -460, 735, 536, -460, 735, - -460 +static const short yycheck[] = { 0, + 163, 25, 223, 151, 186, 413, 144, 4, 11, 120, + 0, 11, 294, 151, 15, 24, 48, 246, 247, 201, + 202, 203, 204, 205, 317, 15, 208, 11, 321, 11, + 62, 16, 7, 8, 19, 10, 11, 12, 13, 14, + 138, 16, 17, 164, 19, 20, 549, 71, 137, 322, + 323, 149, 38, 39, 18, 138, 138, 0, 44, 30, + 563, 25, 137, 145, 50, 49, 149, 49, 138, 138, + 45, 95, 15, 16, 17, 99, 19, 20, 49, 149, + 149, 105, 138, 26, 27, 86, 110, 138, 138, 210, + 498, 147, 138, 139, 145, 141, 120, 147, 3, 4, + 5, 6, 138, 139, 47, 141, 335, 50, 132, 133, + 16, 54, 136, 19, 113, 114, 140, 22, 23, 42, + 258, 44, 260, 261, 532, 263, 355, 309, 113, 114, + 137, 130, 131, 132, 133, 30, 138, 161, 411, 148, + 142, 17, 145, 113, 20, 145, 131, 132, 139, 34, + 141, 148, 53, 264, 145, 138, 564, 439, 296, 142, + 184, 185, 186, 187, 154, 140, 304, 305, 143, 139, + 15, 146, 11, 148, 149, 14, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 149, 468, 139, 470, 141, + 142, 373, 216, 375, 376, 377, 307, 138, 38, 39, + 40, 142, 226, 43, 7, 8, 499, 10, 11, 12, + 13, 14, 137, 16, 17, 137, 19, 20, 113, 114, + 19, 31, 139, 33, 141, 363, 364, 365, 113, 114, + 147, 113, 114, 371, 516, 130, 131, 132, 133, 460, + 264, 143, 45, 381, 382, 130, 131, 132, 133, 131, + 132, 275, 18, 401, 56, 57, 58, 59, 60, 61, + 553, 19, 555, 401, 28, 29, 7, 8, 292, 10, + 11, 12, 13, 14, 19, 16, 17, 19, 19, 20, + 134, 135, 136, 307, 308, 309, 424, 4, 426, 471, + 141, 429, 474, 475, 476, 109, 110, 435, 436, 3, + 4, 5, 6, 4, 45, 7, 8, 139, 139, 141, + 141, 335, 143, 534, 16, 17, 537, 19, 20, 33, + 139, 345, 141, 142, 144, 463, 464, 144, 466, 467, + 38, 4, 40, 19, 472, 106, 107, 140, 77, 78, + 143, 138, 142, 146, 482, 148, 149, 142, 9, 373, + 374, 375, 376, 377, 147, 141, 380, 327, 328, 329, + 330, 331, 9, 9, 51, 503, 390, 11, 531, 147, + 340, 341, 342, 511, 141, 34, 141, 19, 141, 141, + 141, 260, 261, 138, 263, 7, 8, 550, 10, 11, + 12, 13, 14, 141, 16, 17, 34, 19, 20, 140, + 55, 141, 143, 141, 141, 146, 138, 148, 149, 547, + 138, 138, 138, 138, 552, 138, 440, 296, 138, 141, + 141, 391, 392, 45, 143, 304, 305, 138, 398, 138, + 454, 569, 570, 138, 147, 459, 574, 34, 138, 577, + 138, 465, 138, 138, 138, 138, 138, 471, 19, 4, + 474, 475, 476, 138, 142, 479, 19, 458, 14, 7, + 8, 14, 10, 11, 12, 13, 14, 141, 16, 17, + 138, 19, 20, 138, 4, 445, 446, 447, 448, 141, + 138, 138, 452, 453, 363, 364, 365, 35, 22, 23, + 138, 147, 371, 138, 19, 138, 145, 45, 138, 138, + 49, 138, 381, 382, 138, 138, 138, 142, 138, 533, + 138, 142, 138, 142, 484, 485, 143, 142, 140, 142, + 49, 143, 14, 142, 146, 526, 148, 149, 145, 38, + 39, 40, 41, 42, 43, 44, 142, 46, 142, 4, + 138, 14, 14, 138, 14, 424, 67, 426, 14, 519, + 429, 521, 522, 0, 0, 123, 435, 436, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 123, 123, 463, 464, 238, 466, 467, 239, + 526, 86, 140, 472, 0, 143, 499, 105, 146, 99, + 148, 216, 226, 482, 15, 83, 479, -1, 53, 15, + 16, 17, 393, 19, 20, -1, -1, -1, -1, -1, + 26, 27, -1, -1, 503, 134, 135, 136, -1, -1, + -1, -1, 511, 3, 4, -1, -1, 7, 8, 9, + -1, 47, -1, -1, 50, -1, 16, 17, 54, 19, + 20, 21, 22, 23, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 36, 37, 547, -1, + -1, -1, -1, 552, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 53, -1, -1, -1, -1, -1, -1, + 569, 570, -1, -1, -1, 574, -1, -1, 577, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, -1, 125, -1, 127, 128, 129, + -1, 3, 4, -1, -1, 7, 8, 9, -1, 139, + -1, 141, -1, -1, 16, 17, 146, 19, 20, 21, + 22, 23, -1, -1, -1, -1, -1, 7, 8, -1, + -1, -1, -1, -1, 36, 37, 16, 17, -1, 19, + 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 53, -1, -1, -1, -1, 36, 37, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, -1, -1, -1, -1, -1, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, -1, -1, -1, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, -1, 125, -1, 127, 128, 129, -1, -1, + -1, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 146, 125, -1, 127, 128, 129, + -1, -1, -1, -1, 3, 4, -1, -1, -1, 139, + 9, 141, -1, 143, -1, -1, 146, -1, 148, -1, + 150, -1, 21, 22, 23, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 36, 37, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 7, 8, 53, 10, 11, 12, 13, 14, + -1, 16, 17, -1, 19, 20, -1, -1, -1, -1, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, -1, -1, -1, + 45, -1, -1, -1, -1, -1, -1, 7, 8, -1, + 10, 11, 12, 13, 14, -1, 16, 17, -1, 19, + 20, -1, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 35, 125, -1, 127, 128, + 129, -1, -1, 7, 8, 45, 10, 11, 12, 13, + 14, -1, 16, 17, -1, 19, 20, 146, 7, 8, + -1, 10, 11, 12, 13, 14, -1, 16, 17, -1, + 19, 20, 117, -1, -1, -1, -1, -1, -1, -1, + -1, 45, -1, -1, -1, -1, 35, -1, -1, -1, + -1, -1, -1, -1, -1, 140, 45, -1, 143, -1, + -1, 146, -1, 148, 7, 8, -1, 10, 11, 12, + 13, 14, -1, 16, 17, -1, 19, 20, 7, 8, + -1, 10, 11, 12, 13, 14, -1, 16, 17, -1, + 19, 20, 35, -1, -1, -1, -1, -1, -1, -1, + 140, -1, 45, 143, -1, -1, 146, -1, 148, -1, + -1, -1, -1, -1, 7, 8, 45, 10, 11, 12, + 13, 14, -1, 16, 17, -1, 19, 20, -1, -1, + -1, -1, -1, -1, -1, -1, 140, -1, -1, 143, + -1, 145, 146, -1, 148, -1, -1, -1, -1, -1, + -1, 140, 45, -1, 143, -1, -1, 146, -1, 148, + 7, 8, -1, 10, 11, 12, 13, 14, -1, 16, + 17, -1, 19, 20, 7, 8, -1, 10, 11, 12, + 13, 14, -1, 16, 17, -1, 19, 20, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 140, 45, -1, + 143, -1, -1, 146, -1, 148, -1, -1, -1, -1, + -1, 140, 45, -1, 143, -1, -1, 146, -1, 148, + 7, 8, -1, 10, 11, 12, 13, 14, -1, 16, + 17, -1, 19, 20, -1, -1, 7, 8, -1, 10, + 11, 12, 13, 14, -1, 16, 17, 140, 19, 20, + 143, -1, -1, 146, -1, 148, -1, -1, 45, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 45, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 140, -1, -1, 143, -1, -1, 146, + -1, 148, -1, -1, -1, -1, -1, 140, -1, -1, + 143, -1, -1, 146, -1, 148, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, + -1, -1, -1, 140, -1, -1, 143, -1, -1, 146, + -1, 148, -1, -1, -1, -1, 51, 52, -1, 140, + -1, -1, 143, -1, -1, 146, -1, 148, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 106, 107, 108, -1, -1, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129 }; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/bison.simple" +/* This file comes from bison-1.28. */ -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -460, 426, 427, 428, 314, 315, -163, -460, 0, 27, - 469, 10, -460, -460, -460, -460, 236, -460, -460, -460, - -143, -306, -409, -460, -220, -460, -281, 58, -460, -297, - -460, -460, -25, 342, -113, -460, 462, 470, -29, -150, - -208, 198, 257, 335, -460, -460, 556, -460, -460, -460, - -460, -460, -460, -460, -460, -460, -460, -460, 491, -460, - -460, -460, -460, -460, -460, -459, -139, 96, -168, -460, - 524, -460, -460, -460, -460, -460, 100, 187, -460, -460, - -460, -460 -}; +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -189 -static const yytype_int16 yytable[] = -{ - 10, 77, 265, 254, 86, 323, 460, 229, 100, 156, - 12, 89, 264, 388, 255, 371, 10, 388, 157, 23, - 297, 138, 264, 266, 127, 426, 12, 390, 391, 25, - -188, 128, 139, 312, 313, 301, 302, 303, 304, 305, - 338, 340, 308, 428, 20, -63, 1, 2, 104, 3, - 4, 314, 315, 400, 113, 114, 5, 6, 21, 410, - 401, 62, 63, 427, 102, 65, 66, 67, 68, 309, - 1, 2, 130, 3, 4, 473, 104, 7, 411, 488, - 8, 427, 130, 138, 9, 26, 154, 145, 10, 129, - 1, 528, 563, 3, 223, 62, 63, 145, 24, 69, - -55, -55, -55, -55, 1, 2, 569, 3, 4, 220, - 221, 400, 226, 224, 535, 410, 459, 227, 536, 230, - 231, 360, 406, 360, 360, 553, 360, 62, 63, 404, - 102, 65, 66, 67, 68, 90, 1, 2, 260, 3, - 4, 400, 158, 385, 535, 400, 550, 400, 539, 420, - 405, 42, 101, 365, 464, 317, 564, 570, 453, 360, - 483, 295, 296, 260, 298, 69, 257, 360, 360, 60, - 106, 1, 107, 27, 3, 567, 320, 299, 260, 260, - 260, 260, 260, 306, 307, 260, 56, 312, 313, 509, - 44, 510, 45, 130, 70, 388, 383, 71, 312, 313, - 72, 2, 73, 145, 4, 314, 315, 432, 57, 434, - 435, 436, 312, 313, 86, 386, 314, 315, 387, 116, - 117, 118, 119, 120, 121, 58, 360, 360, 360, 386, - 314, 315, 387, 106, 360, 107, 485, 540, 48, 49, - 50, 145, 501, 51, 360, 360, 310, 311, 106, 388, - 107, 388, 366, 254, 312, 313, 321, 106, 93, 107, - 70, 373, 262, 71, 255, 263, 72, 94, 73, 367, - 97, 386, 314, 315, 387, 79, 80, 232, 233, 234, - 235, 81, 84, 82, 145, 384, 260, 360, 85, 360, - 368, 106, 360, 107, 370, 106, 95, 107, 360, 360, - 395, 396, 397, 398, 399, 511, 141, 142, 514, 515, - 516, 98, 403, 407, 408, 409, 555, 99, 106, 557, - 107, 527, 415, 36, 37, 38, 360, 360, 82, 360, - 360, 106, 110, 107, 111, 360, 108, 109, 134, 135, - 155, 216, 218, 219, 222, 360, -56, 225, 228, -57, - 260, 433, 260, 260, 260, 236, 258, 439, 362, 363, - 264, 364, 322, 329, 444, 445, 360, 443, 330, 331, - 551, 451, 332, 333, 360, 62, 63, 341, 102, 65, - 66, 67, 68, 342, 1, 2, 343, 3, 4, 565, - 344, 345, 374, 347, 372, 382, 375, 376, 377, 378, - 379, 392, 380, 381, 393, 394, 418, 421, 422, 431, - 360, 437, 452, 69, 438, 360, 442, 484, 489, 490, - 491, 492, 447, 448, 449, 494, 495, 450, 454, 455, - 456, 496, 360, 360, 457, 458, 500, 360, 461, 462, - 360, 463, 505, 465, 466, 467, 468, 469, 260, 471, - 473, 260, 260, 260, 474, 476, 505, 519, 520, 477, - 497, 423, 424, 425, 478, 278, 279, 482, 481, 430, - 28, 29, 30, 31, 32, 33, 34, 486, 35, 440, - 441, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 487, 543, 502, 544, 545, 427, 493, 513, 522, - 521, 523, 524, 531, 532, 547, 549, 525, 70, 561, - 554, 71, 526, 541, 72, 533, 73, 103, 537, 542, - 556, 558, 470, 559, 472, 560, 568, 475, 497, 571, - 572, 573, 576, 479, 480, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 577, - 579, 208, 209, 210, 327, 546, 328, 125, -187, 529, - 318, 503, 504, 326, 507, 508, 36, 37, 38, 140, - 512, 137, 43, -63, 1, 2, 124, 3, 4, 92, - 518, 517, 446, 0, 5, 6, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 534, 0, 0, 0, 7, 0, 0, 8, 538, - 348, 349, 9, 0, 62, 63, 350, 0, 0, 0, - 0, 0, 0, 1, 2, 0, 3, 4, 351, 352, - 353, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 354, 355, 562, 0, 0, 0, 0, - 566, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 356, 0, 0, 0, 0, 0, 0, 574, 575, 0, - 0, 0, 578, 0, 0, 580, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 240, 241, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 242, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 0, 243, 0, 244, 245, 246, 0, 348, 349, - 0, 0, 62, 63, 350, 0, 106, 0, 107, 0, - 0, 1, 2, 357, 3, 4, 351, 352, 353, 0, - 0, 0, 0, 0, 62, 63, 0, 0, 0, 0, - 0, 354, 355, 1, 2, 0, 3, 4, 237, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 356, 0, - 0, 0, 0, 238, 239, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 240, - 241, 0, 0, 0, 0, 0, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 240, 241, 0, 0, 0, 242, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 0, - 243, 0, 244, 245, 246, 0, 0, 0, 242, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 357, 243, 0, 244, 245, 246, 0, 0, 0, - 0, 348, 349, 0, 0, 0, 106, 350, 107, 0, - 247, 0, 0, 248, 0, 249, 0, 250, 0, 351, - 352, 353, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 354, 355, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, - 63, 356, 102, 65, 66, 67, 68, 0, 1, 2, - 0, 3, 4, 0, 0, 0, 0, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 240, 241, 0, 0, 0, 69, 0, 0, - 62, 63, 0, 102, 148, 149, 150, 68, 0, 1, - 2, 0, 3, 4, 0, 0, 0, 0, 0, 242, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 0, 243, 0, 244, 245, 246, 69, 62, - 63, 0, 102, 148, 149, 150, 68, 0, 1, 2, - 0, 3, 4, 0, 357, 62, 63, 0, 143, 65, - 66, 67, 68, 0, 1, 2, 0, 3, 4, 62, - 63, 0, 102, 148, 149, 150, 68, 69, 1, 2, - 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 70, 69, 0, 71, 0, 0, 72, 0, - 73, 136, 0, 0, 0, 0, 0, 69, 0, 62, - 63, 0, 102, 65, 66, 67, 68, 0, 1, 2, - 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 70, 0, 0, 71, 414, 0, 72, - 0, 73, 339, 0, 0, 62, 63, 69, 102, 65, - 66, 67, 68, 0, 1, 2, 0, 3, 4, 0, - 0, 0, 0, 0, 0, 144, 0, 0, 0, 0, - 0, 0, 70, 499, 0, 71, 0, 0, 72, 0, - 73, 402, 0, 69, 0, 0, 0, 0, 70, 0, - 0, 71, 0, 0, 72, 0, 73, 0, 0, 0, - 0, 0, 70, 0, 0, 71, 0, 334, 72, 0, - 73, 62, 63, 0, 64, 65, 66, 67, 68, 0, - 1, 2, 0, 3, 4, 62, 63, 0, 102, 148, - 149, 150, 68, 0, 1, 2, 0, 3, 4, 0, - 0, 0, 70, 0, 0, 71, 0, 0, 72, 69, - 73, 0, 62, 63, 0, 143, 65, 66, 67, 68, - 0, 1, 2, 69, 3, 4, 0, 62, 63, 0, - 102, 65, 66, 67, 68, 0, 1, 2, 70, 3, - 4, 71, 0, 0, 72, 0, 73, 0, 62, 63, - 69, 259, 65, 66, 67, 68, 0, 1, 2, 0, - 3, 4, 0, 62, 63, 69, 102, 148, 149, 150, - 68, 0, 1, 2, 0, 3, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 69, 0, 0, 70, 0, 0, 71, 0, 0, - 72, 0, 73, 0, 0, 0, 0, 0, 70, 0, - 0, 71, 0, 0, 72, 0, 73, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 70, 0, 0, 71, 0, - 0, 72, 0, 73, 0, 0, 0, 0, 0, 0, - 70, 0, 0, 71, 0, 0, 72, 0, 73, 0, - 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, - 0, 70, 0, 0, 71, 0, 0, 72, 0, 73, - 0, 0, 0, 161, 162, 0, 70, 0, 0, 71, - 0, 0, 72, 0, 337, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 186, 187, - 188, 0, 0, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207 -}; + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -static const yytype_int16 yycheck[] = -{ - 0, 26, 165, 153, 18, 225, 415, 146, 4, 122, - 0, 25, 11, 319, 153, 296, 16, 323, 24, 137, - 188, 138, 11, 166, 138, 11, 16, 324, 325, 137, - 0, 145, 149, 113, 114, 203, 204, 205, 206, 207, - 248, 249, 210, 11, 48, 15, 16, 17, 73, 19, - 20, 131, 132, 138, 28, 29, 26, 27, 62, 30, - 145, 7, 8, 49, 10, 11, 12, 13, 14, 212, - 16, 17, 97, 19, 20, 138, 101, 47, 49, 142, - 50, 49, 107, 138, 54, 15, 115, 112, 88, 35, - 16, 500, 551, 19, 149, 7, 8, 122, 53, 45, - 3, 4, 5, 6, 16, 17, 565, 19, 20, 134, - 135, 138, 141, 138, 138, 30, 413, 142, 142, 22, - 23, 260, 149, 262, 263, 534, 265, 7, 8, 337, - 10, 11, 12, 13, 14, 149, 16, 17, 163, 19, - 20, 138, 148, 311, 138, 138, 145, 138, 142, 357, - 147, 0, 148, 266, 147, 35, 145, 566, 149, 298, - 441, 186, 187, 188, 189, 45, 156, 306, 307, 19, - 139, 16, 141, 137, 19, 34, 145, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 137, 113, 114, 470, - 42, 472, 44, 218, 140, 501, 309, 143, 113, 114, - 146, 17, 148, 228, 20, 131, 132, 375, 137, 377, - 378, 379, 113, 114, 18, 130, 131, 132, 133, 56, - 57, 58, 59, 60, 61, 143, 365, 366, 367, 130, - 131, 132, 133, 139, 373, 141, 142, 518, 38, 39, - 40, 266, 462, 43, 383, 384, 109, 110, 139, 555, - 141, 557, 277, 403, 113, 114, 147, 139, 19, 141, - 140, 143, 11, 143, 403, 14, 146, 19, 148, 294, - 141, 130, 131, 132, 133, 39, 40, 3, 4, 5, - 6, 31, 46, 33, 309, 310, 311, 426, 52, 428, - 138, 139, 431, 141, 138, 139, 19, 141, 437, 438, - 329, 330, 331, 332, 333, 473, 108, 109, 476, 477, - 478, 4, 337, 342, 343, 344, 536, 4, 139, 539, - 141, 142, 347, 134, 135, 136, 465, 466, 33, 468, - 469, 139, 38, 141, 40, 474, 79, 80, 144, 144, - 4, 19, 138, 142, 147, 484, 9, 142, 141, 9, - 375, 376, 377, 378, 379, 9, 51, 382, 262, 263, - 11, 265, 147, 141, 393, 394, 505, 392, 141, 141, - 533, 400, 141, 141, 513, 7, 8, 19, 10, 11, - 12, 13, 14, 141, 16, 17, 141, 19, 20, 552, - 141, 138, 138, 141, 298, 34, 138, 138, 138, 138, - 138, 34, 306, 307, 141, 141, 55, 138, 138, 143, - 549, 138, 147, 45, 138, 554, 138, 442, 447, 448, - 449, 450, 138, 138, 138, 454, 455, 138, 138, 138, - 34, 456, 571, 572, 19, 4, 461, 576, 138, 142, - 579, 19, 467, 14, 14, 141, 138, 138, 473, 4, - 138, 476, 477, 478, 138, 138, 481, 486, 487, 138, - 460, 365, 366, 367, 138, 22, 23, 138, 141, 373, - 38, 39, 40, 41, 42, 43, 44, 138, 46, 383, - 384, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 138, 521, 138, 523, 524, 49, 147, 138, 142, - 138, 138, 138, 19, 138, 49, 14, 142, 140, 4, - 535, 143, 142, 142, 146, 143, 148, 149, 145, 142, - 145, 142, 426, 142, 428, 142, 138, 431, 528, 14, - 14, 138, 14, 437, 438, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 67, - 14, 125, 125, 125, 240, 528, 241, 88, 0, 501, - 218, 465, 466, 228, 468, 469, 134, 135, 136, 107, - 474, 101, 16, 15, 16, 17, 85, 19, 20, 55, - 484, 481, 395, -1, 26, 27, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 505, -1, -1, -1, 47, -1, -1, 50, 513, - 3, 4, 54, -1, 7, 8, 9, -1, -1, -1, - -1, -1, -1, 16, 17, -1, 19, 20, 21, 22, - 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 36, 37, 549, -1, -1, -1, -1, - 554, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 53, -1, -1, -1, -1, -1, -1, 571, 572, -1, - -1, -1, 576, -1, -1, 579, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, -1, 125, -1, 127, 128, 129, -1, 3, 4, - -1, -1, 7, 8, 9, -1, 139, -1, 141, -1, - -1, 16, 17, 146, 19, 20, 21, 22, 23, -1, - -1, -1, -1, -1, 7, 8, -1, -1, -1, -1, - -1, 36, 37, 16, 17, -1, 19, 20, 21, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, - -1, -1, -1, 36, 37, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, -1, -1, -1, -1, -1, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, -1, -1, -1, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, -1, - 125, -1, 127, 128, 129, -1, -1, -1, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 146, 125, -1, 127, 128, 129, -1, -1, -1, - -1, 3, 4, -1, -1, -1, 139, 9, 141, -1, - 143, -1, -1, 146, -1, 148, -1, 150, -1, 21, - 22, 23, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 36, 37, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 7, - 8, 53, 10, 11, 12, 13, 14, -1, 16, 17, - -1, 19, 20, -1, -1, -1, -1, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, -1, -1, -1, 45, -1, -1, - 7, 8, -1, 10, 11, 12, 13, 14, -1, 16, - 17, -1, 19, 20, -1, -1, -1, -1, -1, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, -1, 125, -1, 127, 128, 129, 45, 7, - 8, -1, 10, 11, 12, 13, 14, -1, 16, 17, - -1, 19, 20, -1, 146, 7, 8, -1, 10, 11, - 12, 13, 14, -1, 16, 17, -1, 19, 20, 7, - 8, -1, 10, 11, 12, 13, 14, 45, 16, 17, - -1, 19, 20, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 140, 45, -1, 143, -1, -1, 146, -1, - 148, 149, -1, -1, -1, -1, -1, 45, -1, 7, - 8, -1, 10, 11, 12, 13, 14, -1, 16, 17, - -1, 19, 20, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 140, -1, -1, 143, 35, -1, 146, - -1, 148, 149, -1, -1, 7, 8, 45, 10, 11, - 12, 13, 14, -1, 16, 17, -1, 19, 20, -1, - -1, -1, -1, -1, -1, 117, -1, -1, -1, -1, - -1, -1, 140, 35, -1, 143, -1, -1, 146, -1, - 148, 149, -1, 45, -1, -1, -1, -1, 140, -1, - -1, 143, -1, -1, 146, -1, 148, -1, -1, -1, - -1, -1, 140, -1, -1, 143, -1, 145, 146, -1, - 148, 7, 8, -1, 10, 11, 12, 13, 14, -1, - 16, 17, -1, 19, 20, 7, 8, -1, 10, 11, - 12, 13, 14, -1, 16, 17, -1, 19, 20, -1, - -1, -1, 140, -1, -1, 143, -1, -1, 146, 45, - 148, -1, 7, 8, -1, 10, 11, 12, 13, 14, - -1, 16, 17, 45, 19, 20, -1, 7, 8, -1, - 10, 11, 12, 13, 14, -1, 16, 17, 140, 19, - 20, 143, -1, -1, 146, -1, 148, -1, 7, 8, - 45, 10, 11, 12, 13, 14, -1, 16, 17, -1, - 19, 20, -1, 7, 8, 45, 10, 11, 12, 13, - 14, -1, 16, 17, -1, 19, 20, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 45, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 45, -1, -1, 140, -1, -1, 143, -1, -1, - 146, -1, 148, -1, -1, -1, -1, -1, 140, -1, - -1, 143, -1, -1, 146, -1, 148, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 140, -1, -1, 143, -1, - -1, 146, -1, 148, -1, -1, -1, -1, -1, -1, - 140, -1, -1, 143, -1, -1, 146, -1, 148, -1, - -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, - -1, 140, -1, -1, 143, -1, -1, 146, -1, 148, - -1, -1, -1, 51, 52, -1, 140, -1, -1, 143, - -1, -1, 146, -1, 148, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 106, 107, - 108, -1, -1, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129 -}; + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 16, 17, 19, 20, 26, 27, 47, 50, 54, - 159, 161, 162, 163, 164, 195, 196, 197, 199, 198, - 48, 62, 204, 137, 53, 137, 15, 137, 38, 39, - 40, 41, 42, 43, 44, 46, 134, 135, 136, 165, - 166, 167, 0, 197, 42, 44, 168, 214, 38, 39, - 40, 43, 169, 211, 213, 220, 137, 137, 143, 205, - 19, 203, 7, 8, 10, 11, 12, 13, 14, 45, - 140, 143, 146, 148, 159, 162, 182, 183, 217, 167, - 167, 31, 33, 193, 167, 167, 18, 221, 222, 25, - 149, 212, 221, 19, 19, 19, 206, 141, 4, 4, - 4, 148, 10, 149, 183, 188, 139, 141, 193, 193, - 38, 40, 170, 28, 29, 192, 56, 57, 58, 59, - 60, 61, 171, 209, 209, 161, 225, 138, 145, 35, - 183, 184, 186, 187, 144, 144, 149, 188, 138, 149, - 187, 192, 192, 10, 117, 183, 185, 194, 11, 12, - 13, 157, 158, 183, 189, 4, 185, 24, 148, 210, - 32, 51, 52, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 106, 107, 108, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 152, 153, - 154, 223, 229, 230, 231, 232, 19, 173, 138, 142, - 183, 183, 147, 149, 183, 142, 189, 183, 141, 217, - 22, 23, 3, 4, 5, 6, 9, 21, 36, 37, - 84, 85, 111, 125, 127, 128, 129, 143, 146, 148, - 150, 152, 153, 154, 190, 217, 200, 162, 51, 10, - 183, 219, 11, 14, 11, 157, 171, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 155, 22, 23, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 156, 183, 183, 219, 183, 183, - 226, 219, 219, 219, 219, 219, 183, 183, 219, 171, - 109, 110, 113, 114, 131, 132, 172, 35, 184, 175, - 145, 147, 147, 175, 201, 202, 194, 155, 156, 141, - 141, 141, 141, 141, 145, 189, 191, 148, 191, 149, - 191, 19, 141, 141, 141, 138, 180, 141, 3, 4, - 9, 21, 22, 23, 36, 37, 53, 146, 190, 216, - 217, 218, 218, 218, 218, 185, 183, 183, 138, 177, - 138, 177, 218, 143, 138, 138, 138, 138, 138, 138, - 218, 218, 34, 185, 183, 219, 130, 133, 172, 174, - 180, 180, 34, 141, 141, 189, 189, 189, 189, 189, - 138, 145, 149, 183, 191, 147, 149, 189, 189, 189, - 30, 49, 178, 181, 35, 183, 207, 208, 55, 215, - 191, 138, 138, 218, 218, 218, 11, 49, 11, 228, - 218, 143, 219, 183, 219, 219, 219, 138, 138, 183, - 218, 218, 138, 183, 189, 189, 228, 138, 138, 138, - 138, 189, 147, 149, 138, 138, 34, 19, 4, 180, - 173, 138, 142, 19, 147, 14, 14, 141, 138, 138, - 218, 4, 218, 138, 138, 218, 138, 138, 138, 218, - 218, 141, 138, 177, 183, 142, 138, 138, 142, 189, - 189, 189, 189, 147, 189, 189, 183, 159, 160, 35, - 183, 175, 138, 218, 218, 183, 227, 218, 218, 177, - 177, 219, 218, 138, 219, 219, 219, 227, 218, 189, - 189, 138, 142, 138, 138, 142, 142, 142, 173, 178, - 179, 19, 138, 143, 218, 138, 142, 145, 218, 142, - 177, 142, 142, 189, 189, 189, 160, 49, 176, 14, - 145, 157, 224, 173, 183, 175, 145, 175, 142, 142, - 142, 4, 218, 216, 145, 157, 218, 34, 138, 216, - 173, 14, 14, 138, 218, 218, 14, 67, 218, 14, - 218 -}; + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) +#define YYEMPTY -2 #define YYEOF 0 - #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ - #define YYFAIL goto yyerrlab - #define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ +#define YYBACKUP(token, value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ goto yybackup; \ } \ else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) #define YYTERROR 1 #define YYERRCODE 256 - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif +#ifndef YYPURE +#define YYLEX yylex() #endif - -/* YYLEX -- calling `yylex' with the right arguments. */ - +#ifdef YYPURE +#ifdef YYLSP_NEEDED #ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) #else -# define YYLEX yylex () +#define YYLEX yylex(&yylval, &yylloc) #endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) #else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; +#define YYLEX yylex(&yylval) #endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; +#endif /* not YYLSP_NEEDED */ #endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ +/* If nonreentrant, generate the variables here */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else -static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} +#ifndef YYPURE -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ #endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } -} -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ +/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -# define YYINITDEPTH 200 +#define YYINITDEPTH 200 #endif -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif #ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 +#define YYMAXDEPTH 10000 #endif - +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; { - char *yyd = yydest; - const char *yys = yysrc; + register char *f = from; + register char *t = to; + register int i = count; - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; + while (i-- > 0) + *t++ = *f++; } -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif +#else /* __cplusplus */ -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *to, char *from, unsigned int count) { - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; + register char *t = to; + register char *f = from; + register int i = count; - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } + while (i-- > 0) + *t++ = *f++; } -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; #endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} +#endif +#line 217 "/usr/share/bison.simple" -/* Prevent warnings from -Wmissing-prototypes. */ +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ #ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +#ifdef YYPARSE_PARAM +int yyparse (void *); #else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus int yyparse (void); -#else -int yyparse (); #endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ +#endif -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int -yyparse (void *YYPARSE_PARAM) +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; +#define YYPOPSTACK (yyvsp--, yyssp--) #endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; #endif #endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - YYSIZE_T yystacksize = YYINITDEPTH; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + int yylen; - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif yystate = 0; yyerrstatus = 0; @@ -3132,705 +2222,672 @@ so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; + yyssp = yyss - 1; yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: - yysetstate: - *yyssp = yystate; + *++yyssp = yystate; - if (yyss + yystacksize - 1 <= yyssp) + if (yyssp >= yyss + yystacksize - 1) { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + int size = yyssp - yyss + 1; #ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif - yyss = yyss1; - yyvs = yyvs1; - } + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif #else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) + if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif #endif /* no yyoverflow */ - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif - if (yyss + yystacksize - 1 <= yyssp) + if (yyssp >= yyss + yystacksize - 1) YYABORT; } - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif goto yybackup; + yybackup: -/*-----------. -| yybackup. | -`-----------*/ -yybackup: +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ + /* First try to decide what to do without reference to lookahead token. */ - /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yyn == YYFLAG) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif yychar = YYLEX; } - if (yychar <= YYEOF) + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif } else { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } + yychar1 = YYTRANSLATE(yychar); - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) + if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } + else if (yyn == 0) + goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; + /* Shift the lookahead token. */ - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif - /* Discard the shifted token unless it is eof. */ + /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; - yystate = yyn; *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif - goto yynewstate; + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + yystate = yyn; + goto yynewstate; -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ +/* Do the default action for the current state. */ yydefault: + yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; - goto yyreduce; - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ +/* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: - /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) +#if YYDEBUG != 0 + if (yydebug) { - case 29: -#line 1117 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} - break; - - case 30: -#line 1117 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} - break; - - case 31: -#line 1118 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} - break; - - case 32: -#line 1118 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} - break; - - case 33: -#line 1119 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} - break; - - case 34: -#line 1119 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} - break; - - case 35: -#line 1120 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} - break; - - case 36: -#line 1120 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} - break; - - case 37: -#line 1121 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} - break; - - case 38: -#line 1121 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} - break; - - case 39: -#line 1125 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} - break; - - case 40: -#line 1125 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} - break; - - case 41: -#line 1126 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} - break; - - case 42: -#line 1126 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} - break; - - case 43: -#line 1127 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} - break; - - case 44: -#line 1127 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} - break; - - case 45: -#line 1128 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} - break; - - case 46: -#line 1128 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} - break; - - case 47: -#line 1129 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} - break; - - case 48: -#line 1129 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} - break; - - case 49: -#line 1130 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} - break; + int i; - case 50: -#line 1130 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} - break; - - case 51: -#line 1131 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} - break; - - case 52: -#line 1131 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} - break; - - case 53: -#line 1132 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} - break; - - case 54: -#line 1133 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} - break; - - case 61: -#line 1142 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 62: -#line 1146 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + + switch (yyn) { + +case 28: +#line 1117 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_EQ; ; + break;} +case 29: +#line 1117 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_NE; ; + break;} +case 30: +#line 1118 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SLT; ; + break;} +case 31: +#line 1118 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SGT; ; + break;} +case 32: +#line 1119 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SLE; ; + break;} +case 33: +#line 1119 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SGE; ; + break;} +case 34: +#line 1120 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_ULT; ; + break;} +case 35: +#line 1120 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_UGT; ; + break;} +case 36: +#line 1121 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_ULE; ; + break;} +case 37: +#line 1121 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_UGE; ; + break;} +case 38: +#line 1125 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OEQ; ; + break;} +case 39: +#line 1125 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ONE; ; + break;} +case 40: +#line 1126 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OLT; ; + break;} +case 41: +#line 1126 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OGT; ; + break;} +case 42: +#line 1127 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OLE; ; + break;} +case 43: +#line 1127 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OGE; ; + break;} +case 44: +#line 1128 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ORD; ; + break;} +case 45: +#line 1128 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UNO; ; + break;} +case 46: +#line 1129 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UEQ; ; + break;} +case 47: +#line 1129 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UNE; ; + break;} +case 48: +#line 1130 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ULT; ; + break;} +case 49: +#line 1130 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UGT; ; + break;} +case 50: +#line 1131 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ULE; ; + break;} +case 51: +#line 1131 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UGE; ; + break;} +case 52: +#line 1132 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_TRUE; ; + break;} +case 53: +#line 1133 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_FALSE; ; + break;} +case 60: +#line 1142 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; ; + break;} +case 61: +#line 1146 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = yyvsp[-1].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 63: -#line 1150 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = 0; + ; + break;} +case 62: +#line 1150 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = 0; CHECK_FOR_ERROR - ;} - break; - - case 67: -#line 1158 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = 0; + ; + break;} +case 66: +#line 1158 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = 0; CHECK_FOR_ERROR - ;} - break; - - case 68: -#line 1163 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); + ; + break;} +case 67: +#line 1163 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = yyvsp[-1].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 69: -#line 1169 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 70: -#line 1170 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 71: -#line 1171 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} - break; - - case 72: -#line 1172 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} - break; - - case 73: -#line 1173 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} - break; - - case 74: -#line 1177 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} - break; - - case 75: -#line 1178 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} - break; - - case 76: -#line 1179 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 77: -#line 1183 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} - break; - - case 78: -#line 1184 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} - break; - - case 79: -#line 1185 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} - break; - - case 80: -#line 1186 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} - break; - - case 81: -#line 1190 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 82: -#line 1191 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} - break; - - case 83: -#line 1192 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} - break; - - case 84: -#line 1196 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 85: -#line 1197 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 86: -#line 1198 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} - break; - - case 87: -#line 1199 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 88: -#line 1200 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} - break; - - case 89: -#line 1204 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 90: -#line 1205 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 91: -#line 1206 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 92: -#line 1209 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::C; ;} - break; - - case 93: -#line 1210 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::C; ;} - break; - - case 94: -#line 1211 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Fast; ;} - break; - - case 95: -#line 1212 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Cold; ;} - break; - - case 96: -#line 1213 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} - break; - - case 97: -#line 1214 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} - break; - - case 98: -#line 1215 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) + ; + break;} +case 68: +#line 1169 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 69: +#line 1170 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 70: +#line 1171 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; + break;} +case 71: +#line 1172 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::AppendingLinkage; ; + break;} +case 72: +#line 1173 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; + break;} +case 73: +#line 1177 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; + break;} +case 74: +#line 1178 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; + break;} +case 75: +#line 1179 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 76: +#line 1183 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::DefaultVisibility; ; + break;} +case 77: +#line 1184 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::DefaultVisibility; ; + break;} +case 78: +#line 1185 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::HiddenVisibility; ; + break;} +case 79: +#line 1186 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::ProtectedVisibility; ; + break;} +case 80: +#line 1190 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 81: +#line 1191 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; + break;} +case 82: +#line 1192 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; + break;} +case 83: +#line 1196 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 84: +#line 1197 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 85: +#line 1198 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; + break;} +case 86: +#line 1199 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 87: +#line 1200 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; + break;} +case 88: +#line 1204 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 89: +#line 1205 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 90: +#line 1206 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 91: +#line 1209 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 92: +#line 1210 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 93: +#line 1211 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Fast; ; + break;} +case 94: +#line 1212 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Cold; ; + break;} +case 95: +#line 1213 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::X86_StdCall; ; + break;} +case 96: +#line 1214 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::X86_FastCall; ; + break;} +case 97: +#line 1215 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) GEN_ERROR("Calling conv too large"); - (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); + yyval.UIntVal = yyvsp[0].UInt64Val; CHECK_FOR_ERROR - ;} - break; - - case 99: -#line 1222 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} - break; - - case 100: -#line 1223 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::SExt; ;} - break; - - case 101: -#line 1224 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::InReg; ;} - break; - - case 102: -#line 1225 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} - break; - - case 103: -#line 1228 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::None; ;} - break; - - case 104: -#line 1229 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); - ;} - break; - - case 105: -#line 1234 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} - break; - - case 106: -#line 1235 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} - break; - - case 108: -#line 1239 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::None; ;} - break; - - case 109: -#line 1240 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); - ;} - break; - - case 110: -#line 1247 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 111: -#line 1248 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) + ; + break;} +case 98: +#line 1222 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::ZExt; ; + break;} +case 99: +#line 1223 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::SExt; ; + break;} +case 100: +#line 1224 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::InReg; ; + break;} +case 101: +#line 1225 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::StructRet; ; + break;} +case 102: +#line 1228 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::None; ; + break;} +case 103: +#line 1229 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs; + ; + break;} +case 104: +#line 1234 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::NoReturn; ; + break;} +case 105: +#line 1235 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::NoUnwind; ; + break;} +case 107: +#line 1239 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::None; ; + break;} +case 108: +#line 1240 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs; + ; + break;} +case 109: +#line 1247 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 110: +#line 1248 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.UIntVal = yyvsp[0].UInt64Val; + if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR -;} - break; - - case 112: -#line 1254 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 113: -#line 1255 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) +; + break;} +case 111: +#line 1254 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 112: +#line 1255 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.UIntVal = yyvsp[0].UInt64Val; + if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR -;} - break; - - case 114: -#line 1263 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - for (unsigned i = 0, e = strlen((yyvsp[(2) - (2)].StrVal)); i != e; ++i) - if ((yyvsp[(2) - (2)].StrVal)[i] == '"' || (yyvsp[(2) - (2)].StrVal)[i] == '\\') +; + break;} +case 113: +#line 1263 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + for (unsigned i = 0, e = strlen(yyvsp[0].StrVal); i != e; ++i) + if (yyvsp[0].StrVal[i] == '"' || yyvsp[0].StrVal[i] == '\\') GEN_ERROR("Invalid character in section name"); - (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); + yyval.StrVal = yyvsp[0].StrVal; CHECK_FOR_ERROR -;} - break; - - case 115: -#line 1271 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 116: -#line 1272 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} - break; - - case 117: -#line 1277 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - {;} - break; - - case 118: -#line 1278 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - {;} - break; - - case 119: -#line 1279 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - CurGV->setSection((yyvsp[(1) - (1)].StrVal)); - free((yyvsp[(1) - (1)].StrVal)); +; + break;} +case 114: +#line 1271 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; ; + break;} +case 115: +#line 1272 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = yyvsp[0].StrVal; ; + break;} +case 116: +#line 1277 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{; + break;} +case 117: +#line 1278 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{; + break;} +case 118: +#line 1279 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurGV->setSection(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); CHECK_FOR_ERROR - ;} - break; - - case 120: -#line 1284 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) + ; + break;} +case 119: +#line 1284 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val)) GEN_ERROR("Alignment must be a power of two"); - CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val)); + CurGV->setAlignment(yyvsp[0].UInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 125: -#line 1300 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); + ; + break;} +case 124: +#line 1300 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR - ;} - break; - - case 126: -#line 1304 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); + ; + break;} +case 125: +#line 1304 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); CHECK_FOR_ERROR - ;} - break; - - case 127: -#line 1308 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Pointer type? - if (*(yyvsp[(1) - (2)].TypeVal) == Type::LabelTy) + ; + break;} +case 126: +#line 1308 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Pointer type? + if (*yyvsp[-1].TypeVal == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (2)].TypeVal)))); - delete (yyvsp[(1) - (2)].TypeVal); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal))); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 128: -#line 1315 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Named types are also simple types... - const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); - CHECK_FOR_ERROR - (yyval.TypeVal) = new PATypeHolder(tmp); - ;} - break; - - case 129: -#line 1320 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Type UpReference - if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); + ; + break;} +case 127: +#line 1315 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Named types are also simple types... + const Type* tmp = getTypeVal(yyvsp[0].ValIDVal); + CHECK_FOR_ERROR + yyval.TypeVal = new PATypeHolder(tmp); + ; + break;} +case 128: +#line 1320 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Type UpReference + if (yyvsp[0].UInt64Val > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder - UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector... - (yyval.TypeVal) = new PATypeHolder(OT); + UpRefs.push_back(UpRefRecord((unsigned)yyvsp[0].UInt64Val, OT)); // Add to vector... + yyval.TypeVal = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); CHECK_FOR_ERROR - ;} - break; - - case 130: -#line 1328 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 129: +#line 1328 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ std::vector Params; ParamAttrsVector Attrs; - if ((yyvsp[(5) - (5)].ParamAttrs) != ParamAttr::None) { - ParamAttrsWithIndex X; X.index = 0; X.attrs = (yyvsp[(5) - (5)].ParamAttrs); + if (yyvsp[0].ParamAttrs != ParamAttr::None) { + ParamAttrsWithIndex X; X.index = 0; X.attrs = yyvsp[0].ParamAttrs; Attrs.push_back(X); } unsigned index = 1; - TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end(); + TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end(); for (; I != E; ++I, ++index) { const Type *Ty = I->Ty->get(); Params.push_back(Ty); @@ -3846,24 +2903,23 @@ ParamAttrsList *ActualAttrs = 0; if (!Attrs.empty()) ActualAttrs = ParamAttrsList::get(Attrs); - FunctionType *FT = FunctionType::get(*(yyvsp[(1) - (5)].TypeVal), Params, isVarArg, ActualAttrs); - delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list - delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ;} - break; - - case 131: -#line 1358 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + FunctionType *FT = FunctionType::get(*yyvsp[-4].TypeVal, Params, isVarArg, ActualAttrs); + delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list + delete yyvsp[-4].TypeVal; // Delete the return type handle + yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ; + break;} +case 130: +#line 1358 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ std::vector Params; ParamAttrsVector Attrs; - if ((yyvsp[(5) - (5)].ParamAttrs) != ParamAttr::None) { - ParamAttrsWithIndex X; X.index = 0; X.attrs = (yyvsp[(5) - (5)].ParamAttrs); + if (yyvsp[0].ParamAttrs != ParamAttr::None) { + ParamAttrsWithIndex X; X.index = 0; X.attrs = yyvsp[0].ParamAttrs; Attrs.push_back(X); } - TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end(); + TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end(); unsigned index = 1; for ( ; I != E; ++I, ++index) { const Type* Ty = I->Ty->get(); @@ -3881,305 +2937,284 @@ if (!Attrs.empty()) ActualAttrs = ParamAttrsList::get(Attrs); - FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg, ActualAttrs); - delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ;} - break; - - case 132: -#line 1389 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Sized array type? - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); - delete (yyvsp[(4) - (5)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 133: -#line 1394 "/home/asl/proj/llvm/src/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)) + FunctionType *FT = FunctionType::get(yyvsp[-4].PrimType, Params, isVarArg, ActualAttrs); + delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list + yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ; + break;} +case 131: +#line 1389 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Sized array type? + yyval.TypeVal = new PATypeHolder(HandleUpRefs(ArrayType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 132: +#line 1394 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Vector type? + const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get(); + if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) GEN_ERROR("Unsigned result not equal to signed result"); if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger()) GEN_ERROR("Element type of a VectorType must be primitive"); - if (!isPowerOf2_32((yyvsp[(2) - (5)].UInt64Val))) + if (!isPowerOf2_32(yyvsp[-3].UInt64Val)) GEN_ERROR("Vector length should be a power of 2"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); - delete (yyvsp[(4) - (5)].TypeVal); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(VectorType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 134: -#line 1406 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Structure type? + ; + break;} +case 133: +#line 1406 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Structure type? std::vector Elements; - for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), - E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = yyvsp[-1].TypeList->begin(), + E = yyvsp[-1].TypeList->end(); I != E; ++I) Elements.push_back(*I); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); - delete (yyvsp[(2) - (3)].TypeList); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); + delete yyvsp[-1].TypeList; CHECK_FOR_ERROR - ;} - break; - - case 135: -#line 1416 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Empty structure type? - (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); - CHECK_FOR_ERROR - ;} - break; - - case 136: -#line 1420 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 134: +#line 1416 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty structure type? + yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); + CHECK_FOR_ERROR + ; + break;} +case 135: +#line 1420 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ std::vector Elements; - for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), - E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = yyvsp[-2].TypeList->begin(), + E = yyvsp[-2].TypeList->end(); I != E; ++I) Elements.push_back(*I); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); - delete (yyvsp[(3) - (5)].TypeList); - CHECK_FOR_ERROR - ;} - break; - - case 137: -#line 1430 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Empty structure type? - (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); + delete yyvsp[-2].TypeList; CHECK_FOR_ERROR - ;} - break; - - case 138: -#line 1437 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal); - (yyval.TypeWithAttrs).Attrs = (yyvsp[(2) - (2)].ParamAttrs); - ;} - break; - - case 139: -#line 1444 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 136: +#line 1430 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty structure type? + yyval.TypeVal = new PATypeHolder(StructType::get(std::vector(), true)); + CHECK_FOR_ERROR + ; + break;} +case 137: +#line 1437 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrs.Ty = yyvsp[-1].TypeVal; + yyval.TypeWithAttrs.Attrs = yyvsp[0].ParamAttrs; + ; + break;} +case 138: +#line 1444 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); - if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + if (!(*yyvsp[0].TypeVal)->isFirstClassType()) GEN_ERROR("LLVM functions cannot return aggregate types"); - (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal); - ;} - break; - - case 140: -#line 1451 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); - ;} - break; - - case 141: -#line 1456 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); - (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); + yyval.TypeVal = yyvsp[0].TypeVal; + ; + break;} +case 139: +#line 1451 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(Type::VoidTy); + ; + break;} +case 140: +#line 1456 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList(); + yyval.TypeWithAttrsList->push_back(yyvsp[0].TypeWithAttrs); CHECK_FOR_ERROR - ;} - break; - - case 142: -#line 1461 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); + ; + break;} +case 141: +#line 1461 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList)->push_back(yyvsp[0].TypeWithAttrs); CHECK_FOR_ERROR - ;} - break; - - case 144: -#line 1469 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); + ; + break;} +case 143: +#line 1469 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); - (yyval.TypeWithAttrsList)->push_back(TWA); + yyval.TypeWithAttrsList->push_back(TWA); CHECK_FOR_ERROR - ;} - break; - - case 145: -#line 1476 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList; + ; + break;} +case 144: +#line 1476 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); - (yyval.TypeWithAttrsList)->push_back(TWA); - CHECK_FOR_ERROR - ;} - break; - - case 146: -#line 1483 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); + yyval.TypeWithAttrsList->push_back(TWA); CHECK_FOR_ERROR - ;} - break; - - case 147: -#line 1491 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeList) = new std::list(); - (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); - delete (yyvsp[(1) - (1)].TypeVal); + ; + break;} +case 145: +#line 1483 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList(); CHECK_FOR_ERROR - ;} - break; - - case 148: -#line 1497 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); - delete (yyvsp[(3) - (3)].TypeVal); + ; + break;} +case 146: +#line 1491 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeList = new std::list(); + yyval.TypeList->push_back(*yyvsp[0].TypeVal); + delete yyvsp[0].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 147: +#line 1497 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); + delete yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 149: -#line 1509 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized arr + ; + break;} +case 148: +#line 1509 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); + (*yyvsp[-3].TypeVal)->getDescription() + "'"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) GEN_ERROR("Type mismatch: constant sized array initialized with " + - utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + + utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()) + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'."); + (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector)); - delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); + yyval.ConstVal = ConstantArray::get(ATy, *yyvsp[-1].ConstVector); + delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 150: -#line 1537 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 149: +#line 1537 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); + (*yyvsp[-2].TypeVal)->getDescription() + "'"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +""); - (yyval.ConstVal) = ConstantArray::get(ATy, std::vector()); - delete (yyvsp[(1) - (3)].TypeVal); + yyval.ConstVal = ConstantArray::get(ATy, std::vector()); + delete yyvsp[-2].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 151: -#line 1553 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 150: +#line 1553 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); + (*yyvsp[-2].TypeVal)->getDescription() + "'"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); - char *EndStr = UnEscapeLexed((yyvsp[(3) - (3)].StrVal), true); - if (NumElements != -1 && NumElements != (EndStr-(yyvsp[(3) - (3)].StrVal))) + char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); + if (NumElements != -1 && NumElements != (EndStr-yyvsp[0].StrVal)) GEN_ERROR("Can't build string constant of size " + - itostr((int)(EndStr-(yyvsp[(3) - (3)].StrVal))) + + itostr((int)(EndStr-yyvsp[0].StrVal)) + " when array has size " + itostr(NumElements) + ""); std::vector Vals; if (ETy == Type::Int8Ty) { - for (unsigned char *C = (unsigned char *)(yyvsp[(3) - (3)].StrVal); + for (unsigned char *C = (unsigned char *)yyvsp[0].StrVal; C != (unsigned char*)EndStr; ++C) Vals.push_back(ConstantInt::get(ETy, *C)); } else { - free((yyvsp[(3) - (3)].StrVal)); + free(yyvsp[0].StrVal); GEN_ERROR("Cannot build string arrays of non byte sized elements"); } - free((yyvsp[(3) - (3)].StrVal)); - (yyval.ConstVal) = ConstantArray::get(ATy, Vals); - delete (yyvsp[(1) - (3)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 152: -#line 1582 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized arr + free(yyvsp[0].StrVal); + yyval.ConstVal = ConstantArray::get(ATy, Vals); + delete yyvsp[-2].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 151: +#line 1582 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); - const VectorType *PTy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + const VectorType *PTy = dyn_cast(yyvsp[-3].TypeVal->get()); if (PTy == 0) GEN_ERROR("Cannot make packed constant with type: '" + - (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); + (*yyvsp[-3].TypeVal)->getDescription() + "'"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) GEN_ERROR("Type mismatch: constant sized packed initialized with " + - utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + + utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()) + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'."); + (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector)); - delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); + yyval.ConstVal = ConstantVector::get(PTy, *yyvsp[-1].ConstVector); + delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 153: -#line 1610 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + ; + break;} +case 152: +#line 1610 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); + (*yyvsp[-3].TypeVal)->getDescription() + "'"); - if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes()) + if (yyvsp[-1].ConstVector->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = yyvsp[-1].ConstVector->size(); i != e; ++i) + if ((*yyvsp[-1].ConstVector)[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -4190,21 +3225,20 @@ GEN_ERROR("Unpacked Initializer to vector type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector)); - delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); + yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-1].ConstVector); + delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 154: -#line 1636 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 153: +#line 1636 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - const StructType *STy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const StructType *STy = dyn_cast(yyvsp[-2].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); + (*yyvsp[-2].TypeVal)->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -4214,26 +3248,25 @@ GEN_ERROR("Unpacked Initializer to vector type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[(1) - (3)].TypeVal); + yyval.ConstVal = ConstantStruct::get(STy, std::vector()); + delete yyvsp[-2].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 155: -#line 1656 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); + ; + break;} +case 154: +#line 1656 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const StructType *STy = dyn_cast(yyvsp[-5].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'"); + (*yyvsp[-5].TypeVal)->getDescription() + "'"); - if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes()) + if (yyvsp[-2].ConstVector->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = yyvsp[-2].ConstVector->size(); i != e; ++i) + if ((*yyvsp[-2].ConstVector)[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -4244,21 +3277,20 @@ GEN_ERROR("Vector initializer to non-vector type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector)); - delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector); + yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-2].ConstVector); + delete yyvsp[-5].TypeVal; delete yyvsp[-2].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 156: -#line 1682 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 155: +#line 1682 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); - const StructType *STy = dyn_cast((yyvsp[(1) - (5)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); + const StructType *STy = dyn_cast(yyvsp[-4].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'"); + (*yyvsp[-4].TypeVal)->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -4268,45 +3300,42 @@ GEN_ERROR("Vector initializer to non-vector type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[(1) - (5)].TypeVal); + yyval.ConstVal = ConstantStruct::get(STy, std::vector()); + delete yyvsp[-4].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 157: -#line 1702 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 156: +#line 1702 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - const PointerType *PTy = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal->get()); if (PTy == 0) GEN_ERROR("Cannot make null pointer constant with type: '" + - (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'"); + (*yyvsp[-1].TypeVal)->getDescription() + "'"); - (yyval.ConstVal) = ConstantPointerNull::get(PTy); - delete (yyvsp[(1) - (2)].TypeVal); + yyval.ConstVal = ConstantPointerNull::get(PTy); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 158: -#line 1714 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 157: +#line 1714 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get()); - delete (yyvsp[(1) - (2)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 159: -#line 1721 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.ConstVal = UndefValue::get(yyvsp[-1].TypeVal->get()); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 158: +#line 1721 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - const PointerType *Ty = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal->get()); if (Ty == 0) GEN_ERROR("Global const reference must be a pointer type"); @@ -4320,7 +3349,7 @@ Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal)); + Value *V = getExistingVal(Ty, yyvsp[0].ValIDVal); CHECK_FOR_ERROR CurFun.CurrentFunction = SavedCurFn; @@ -4335,16 +3364,16 @@ // First check to see if the forward references value is already created! PerModuleInfo::GlobalRefsType::iterator I = - CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal))); + CurModule.GlobalRefs.find(std::make_pair(PT, yyvsp[0].ValIDVal)); if (I != CurModule.GlobalRefs.end()) { V = I->second; // Placeholder already exists, use it... - (yyvsp[(2) - (2)].ValIDVal).destroy(); + yyvsp[0].ValIDVal.destroy(); } else { std::string Name; - if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName) - Name = (yyvsp[(2) - (2)].ValIDVal).Name; - else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID) + if (yyvsp[0].ValIDVal.Type == ValID::GlobalName) + Name = yyvsp[0].ValIDVal.Name; + else if (yyvsp[0].ValIDVal.Type != ValID::GlobalID) GEN_ERROR("Invalid reference to global"); // Create the forward referenced global. @@ -4360,371 +3389,336 @@ } // Keep track of the fact that we have a forward ref to recycle it - CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV)); + CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, yyvsp[0].ValIDVal), GV)); V = GV; } } - (yyval.ConstVal) = cast(V); - delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle + yyval.ConstVal = cast(V); + delete yyvsp[-1].TypeVal; // Free the type handle CHECK_FOR_ERROR - ;} - break; - - case 160: -#line 1787 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 159: +#line 1787 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + if (yyvsp[-1].TypeVal->get() != yyvsp[0].ConstVal->getType()) GEN_ERROR("Mismatched types for constant expression: " + - (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription()); - (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal); - delete (yyvsp[(1) - (2)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 161: -#line 1797 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + (*yyvsp[-1].TypeVal)->getDescription() + " and " + yyvsp[0].ConstVal->getType()->getDescription()); + yyval.ConstVal = yyvsp[0].ConstVal; + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 160: +#line 1797 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get(); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const Type *Ty = yyvsp[-1].TypeVal->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) GEN_ERROR("Cannot create a null initialized value of this type"); - (yyval.ConstVal) = Constant::getNullValue(Ty); - delete (yyvsp[(1) - (2)].TypeVal); + yyval.ConstVal = Constant::getNullValue(Ty); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 162: -#line 1807 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) + ; + break;} +case 161: +#line 1807 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // integral constants + if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val)) GEN_ERROR("Constant value doesn't fit in type"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true); + yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].SInt64Val, true); CHECK_FOR_ERROR - ;} - break; - - case 163: -#line 1813 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // arbitrary precision integer constants - uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); - if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { + ; + break;} +case 162: +#line 1813 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // arbitrary precision integer constants + uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); + if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth); - (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal)); - delete (yyvsp[(2) - (2)].APIntVal); - CHECK_FOR_ERROR - ;} - break; - - case 164: -#line 1823 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) + yyvsp[0].APIntVal->sextOrTrunc(BitWidth); + yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal); + delete yyvsp[0].APIntVal; + CHECK_FOR_ERROR + ; + break;} +case 163: +#line 1823 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // integral constants + if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val)) GEN_ERROR("Constant value doesn't fit in type"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false); + yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].UInt64Val, false); CHECK_FOR_ERROR - ;} - break; - - case 165: -#line 1829 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // arbitrary precision integer constants - uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); - if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { + ; + break;} +case 164: +#line 1829 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // arbitrary precision integer constants + uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); + if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth); - (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal)); - delete (yyvsp[(2) - (2)].APIntVal); - CHECK_FOR_ERROR - ;} - break; - - case 166: -#line 1839 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Boolean constants - assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); - (yyval.ConstVal) = ConstantInt::getTrue(); - CHECK_FOR_ERROR - ;} - break; - - case 167: -#line 1844 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Boolean constants - assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); - (yyval.ConstVal) = ConstantInt::getFalse(); - CHECK_FOR_ERROR - ;} - break; - - case 168: -#line 1849 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Float & Double constants - if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal))) + yyvsp[0].APIntVal->zextOrTrunc(BitWidth); + yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal); + delete yyvsp[0].APIntVal; + CHECK_FOR_ERROR + ; + break;} +case 165: +#line 1839 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Boolean constants + assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); + yyval.ConstVal = ConstantInt::getTrue(); + CHECK_FOR_ERROR + ; + break;} +case 166: +#line 1844 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Boolean constants + assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); + yyval.ConstVal = ConstantInt::getFalse(); + CHECK_FOR_ERROR + ; + break;} +case 167: +#line 1849 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Float & Double constants + if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].FPVal)) GEN_ERROR("Floating point constant invalid for type"); - (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal)); + yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, yyvsp[0].FPVal); CHECK_FOR_ERROR - ;} - break; - - case 169: -#line 1857 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 168: +#line 1857 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); - Constant *Val = (yyvsp[(3) - (6)].ConstVal); - const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); - if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + Constant *Val = yyvsp[-3].ConstVal; + const Type *DestTy = yyvsp[-1].TypeVal->get(); + if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy); - delete (yyvsp[(5) - (6)].TypeVal); - ;} - break; - - case 170: -#line 1869 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) + yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy); + delete yyvsp[-1].TypeVal; + ; + break;} +case 169: +#line 1869 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[-2].ConstVal->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); const Type *IdxTy = - GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), &(*(yyvsp[(4) - (5)].ValueList))[0], (yyvsp[(4) - (5)].ValueList)->size(), + GetElementPtrInst::getIndexedType(yyvsp[-2].ConstVal->getType(), &(*yyvsp[-1].ValueList)[0], yyvsp[-1].ValueList->size(), true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr"); SmallVector IdxVec; - for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i) - if (Constant *C = dyn_cast((*(yyvsp[(4) - (5)].ValueList))[i])) + for (unsigned i = 0, e = yyvsp[-1].ValueList->size(); i != e; ++i) + if (Constant *C = dyn_cast((*yyvsp[-1].ValueList)[i])) IdxVec.push_back(C); else GEN_ERROR("Indices to constant getelementptr must be constants"); - delete (yyvsp[(4) - (5)].ValueList); + delete yyvsp[-1].ValueList; - (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size()); + yyval.ConstVal = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal, &IdxVec[0], IdxVec.size()); CHECK_FOR_ERROR - ;} - break; - - case 171: -#line 1891 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) + ; + break;} +case 170: +#line 1891 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-5].ConstVal->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); - if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType()) + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Select operand types must match"); - (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); + yyval.ConstVal = ConstantExpr::getSelect(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 172: -#line 1899 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) + ; + break;} +case 171: +#line 1899 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Binary operator types must match"); CHECK_FOR_ERROR; - (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); - ;} - break; - - case 173: -#line 1905 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) + yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + ; + break;} +case 172: +#line 1905 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Logical operator types must match"); - if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) { - if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa((yyvsp[(3) - (6)].ConstVal)->getType()) || - !cast((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger()) + if (!yyvsp[-3].ConstVal->getType()->isInteger()) { + if (Instruction::isShift(yyvsp[-5].BinaryOpVal) || !isa(yyvsp[-3].ConstVal->getType()) || + !cast(yyvsp[-3].ConstVal->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } - (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); + yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 174: -#line 1916 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) + ; + break;} +case 173: +#line 1916 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("icmp operand types must match"); - (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); - ;} - break; - - case 175: -#line 1921 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) + yyval.ConstVal = ConstantExpr::getICmp(yyvsp[-5].IPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + ; + break;} +case 174: +#line 1921 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("fcmp operand types must match"); - (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); - ;} - break; - - case 176: -#line 1926 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) + yyval.ConstVal = ConstantExpr::getFCmp(yyvsp[-5].FPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + ; + break;} +case 175: +#line 1926 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ExtractElementInst::isValidOperands(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid extractelement operands"); - (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); + yyval.ConstVal = ConstantExpr::getExtractElement(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 177: -#line 1932 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) + ; + break;} +case 176: +#line 1932 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid insertelement operands"); - (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); + yyval.ConstVal = ConstantExpr::getInsertElement(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 178: -#line 1938 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) + ; + break;} +case 177: +#line 1938 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid shufflevector operands"); - (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); - CHECK_FOR_ERROR - ;} - break; - - case 179: -#line 1947 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); + yyval.ConstVal = ConstantExpr::getShuffleVector(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 180: -#line 1951 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ConstVector) = new std::vector(); - (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); + ; + break;} +case 178: +#line 1947 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 181: -#line 1959 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = false; ;} - break; - - case 182: -#line 1959 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = true; ;} - break; - - case 183: -#line 1962 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = true; ;} - break; - - case 184: -#line 1962 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = false; ;} - break; - - case 185: -#line 1965 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); - Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); + ; + break;} +case 179: +#line 1951 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ConstVector = new std::vector(); + yyval.ConstVector->push_back(yyvsp[0].ConstVal); + CHECK_FOR_ERROR + ; + break;} +case 180: +#line 1959 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = false; ; + break;} +case 181: +#line 1959 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = true; ; + break;} +case 182: +#line 1962 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = true; ; + break;} +case 183: +#line 1962 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = false; ; + break;} +case 184: +#line 1965 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const Type* VTy = yyvsp[-1].TypeVal->get(); + Value *V = getVal(VTy, yyvsp[0].ValIDVal); GlobalValue* Aliasee = dyn_cast(V); if (!Aliasee) GEN_ERROR("Aliases can be created only to global values"); - (yyval.ConstVal) = Aliasee; + yyval.ConstVal = Aliasee; CHECK_FOR_ERROR - delete (yyvsp[(1) - (2)].TypeVal); - ;} - break; - - case 186: -#line 1976 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - Constant *Val = (yyvsp[(3) - (6)].ConstVal); - const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); - if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy)) + delete yyvsp[-1].TypeVal; + ; + break;} +case 185: +#line 1976 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + Constant *Val = yyvsp[-3].ConstVal; + const Type *DestTy = yyvsp[-1].TypeVal->get(); + if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy); + yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy); CHECK_FOR_ERROR - delete (yyvsp[(5) - (6)].TypeVal); - ;} - break; - - case 187: -#line 1997 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; + delete yyvsp[-1].TypeVal; + ; + break;} +case 186: +#line 1997 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ModuleVal = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ;} - break; - - case 188: -#line 2002 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; + ; + break;} +case 187: +#line 2002 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ModuleVal = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ;} - break; - - case 191: -#line 2015 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { CurFun.isDeclare = false; ;} - break; - - case 192: -#line 2015 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 190: +#line 2015 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.isDeclare = false; ; + break;} +case 191: +#line 2015 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.FunctionDone(); CHECK_FOR_ERROR - ;} - break; - - case 193: -#line 2019 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { CurFun.isDeclare = true; ;} - break; - - case 194: -#line 2019 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 192: +#line 2019 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.isDeclare = true; ; + break;} +case 193: +#line 2019 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 195: -#line 2022 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 194: +#line 2022 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 196: -#line 2025 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 195: +#line 2025 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: // @@ -4734,271 +3728,248 @@ // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal)); + ResolveTypeTo(yyvsp[-2].StrVal, *yyvsp[0].TypeVal); - if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) { + if (!setTypeName(*yyvsp[0].TypeVal, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal)); + CurModule.Types.push_back(*yyvsp[0].TypeVal); } - delete (yyvsp[(3) - (3)].TypeVal); + delete yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 197: -#line 2049 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); + ; + break;} +case 196: +#line 2049 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + ResolveTypeTo(yyvsp[-2].StrVal, yyvsp[0].PrimType); - if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) { + if (!setTypeName(yyvsp[0].PrimType, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType)); + CurModule.Types.push_back(yyvsp[0].PrimType); } CHECK_FOR_ERROR - ;} - break; - - case 198: -#line 2060 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 197: +#line 2060 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ /* "Externally Visible" Linkage */ - if ((yyvsp[(5) - (5)].ConstVal) == 0) + if (yyvsp[0].ConstVal == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable((yyvsp[(1) - (5)].StrVal), GlobalValue::ExternalLinkage, - (yyvsp[(2) - (5)].Visibility), (yyvsp[(4) - (5)].BoolVal), (yyvsp[(5) - (5)].ConstVal)->getType(), (yyvsp[(5) - (5)].ConstVal), (yyvsp[(3) - (5)].BoolVal)); + CurGV = ParseGlobalVariable(yyvsp[-4].StrVal, GlobalValue::ExternalLinkage, + yyvsp[-3].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal, yyvsp[-2].BoolVal); CHECK_FOR_ERROR - ;} - break; - - case 199: -#line 2067 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 198: +#line 2067 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; - ;} - break; - - case 200: -#line 2071 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(6) - (6)].ConstVal) == 0) + ; + break;} +case 199: +#line 2071 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[0].ConstVal == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), (yyvsp[(2) - (6)].Linkage), (yyvsp[(3) - (6)].Visibility), (yyvsp[(5) - (6)].BoolVal), (yyvsp[(6) - (6)].ConstVal)->getType(), (yyvsp[(6) - (6)].ConstVal), (yyvsp[(4) - (6)].BoolVal)); + CurGV = ParseGlobalVariable(yyvsp[-5].StrVal, yyvsp[-4].Linkage, yyvsp[-3].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal, yyvsp[-2].BoolVal); CHECK_FOR_ERROR - ;} - break; - - case 201: -#line 2076 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 200: +#line 2076 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; - ;} - break; - - case 202: -#line 2080 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 201: +#line 2080 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (6)].TypeVal))->getDescription()); - CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), (yyvsp[(2) - (6)].Linkage), (yyvsp[(3) - (6)].Visibility), (yyvsp[(5) - (6)].BoolVal), *(yyvsp[(6) - (6)].TypeVal), 0, (yyvsp[(4) - (6)].BoolVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + CurGV = ParseGlobalVariable(yyvsp[-5].StrVal, yyvsp[-4].Linkage, yyvsp[-3].Visibility, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0, yyvsp[-2].BoolVal); CHECK_FOR_ERROR - delete (yyvsp[(6) - (6)].TypeVal); - ;} - break; - - case 203: -#line 2086 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[0].TypeVal; + ; + break;} +case 202: +#line 2086 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; CHECK_FOR_ERROR - ;} - break; - - case 204: -#line 2090 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - std::string Name((yyvsp[(1) - (5)].StrVal)); + ; + break;} +case 203: +#line 2090 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + std::string Name(yyvsp[-4].StrVal); if (Name.empty()) GEN_ERROR("Alias name cannot be empty"); - Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal); + Constant* Aliasee = yyvsp[0].ConstVal; if (Aliasee == 0) - GEN_ERROR(std::string("Invalid aliasee for alias: ") + (yyvsp[(1) - (5)].StrVal)); + GEN_ERROR(std::string("Invalid aliasee for alias: ") + yyvsp[-4].StrVal); - GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee, + GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), yyvsp[-1].Linkage, Name, Aliasee, CurModule.CurrentModule); - GA->setVisibility((yyvsp[(2) - (5)].Visibility)); + GA->setVisibility(yyvsp[-3].Visibility); InsertValue(GA, CurModule.Values); CHECK_FOR_ERROR - ;} - break; - - case 205: -#line 2105 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - CHECK_FOR_ERROR - ;} - break; - - case 206: -#line 2108 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 204: +#line 2105 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CHECK_FOR_ERROR + ; + break;} +case 205: +#line 2108 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 207: -#line 2114 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 206: +#line 2114 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); - char *EndStr = UnEscapeLexed((yyvsp[(1) - (1)].StrVal), true); - std::string NewAsm((yyvsp[(1) - (1)].StrVal), EndStr); - free((yyvsp[(1) - (1)].StrVal)); + char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); + std::string NewAsm(yyvsp[0].StrVal, EndStr); + free(yyvsp[0].StrVal); if (AsmSoFar.empty()) CurModule.CurrentModule->setModuleInlineAsm(NewAsm); else CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+NewAsm); CHECK_FOR_ERROR -;} - break; - - case 208: -#line 2127 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->setTargetTriple((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); - ;} - break; - - case 209: -#line 2131 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->setDataLayout((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); - ;} - break; - - case 211: -#line 2138 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->addLibrary((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); +; + break;} +case 207: +#line 2127 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->setTargetTriple(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 208: +#line 2131 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->setDataLayout(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 210: +#line 2138 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); CHECK_FOR_ERROR - ;} - break; - - case 212: -#line 2143 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->addLibrary((yyvsp[(1) - (1)].StrVal)); - free((yyvsp[(1) - (1)].StrVal)); + ; + break;} +case 211: +#line 2143 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); CHECK_FOR_ERROR - ;} - break; - - case 213: -#line 2148 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 212: +#line 2148 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 214: -#line 2157 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 213: +#line 2157 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - if (*(yyvsp[(3) - (5)].TypeVal) == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (*yyvsp[-2].TypeVal == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal); - (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList); - (yyvsp[(1) - (5)].ArgList)->push_back(E); - CHECK_FOR_ERROR - ;} - break; - - case 215: -#line 2167 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; + yyval.ArgList = yyvsp[-4].ArgList; + yyvsp[-4].ArgList->push_back(E); + CHECK_FOR_ERROR + ; + break;} +case 214: +#line 2167 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - if (*(yyvsp[(1) - (3)].TypeVal) == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (*yyvsp[-2].TypeVal == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal); - (yyval.ArgList) = new ArgListType; - (yyval.ArgList)->push_back(E); - CHECK_FOR_ERROR - ;} - break; - - case 216: -#line 2178 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); + ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; + yyval.ArgList = new ArgListType; + yyval.ArgList->push_back(E); + CHECK_FOR_ERROR + ; + break;} +case 215: +#line 2178 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = yyvsp[0].ArgList; CHECK_FOR_ERROR - ;} - break; - - case 217: -#line 2182 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); + ; + break;} +case 216: +#line 2182 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = yyvsp[-2].ArgList; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = ParamAttr::None; - (yyval.ArgList)->push_back(E); + yyval.ArgList->push_back(E); CHECK_FOR_ERROR - ;} - break; - - case 218: -#line 2191 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = new ArgListType; + ; + break;} +case 217: +#line 2191 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = new ArgListType; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = ParamAttr::None; - (yyval.ArgList)->push_back(E); + yyval.ArgList->push_back(E); CHECK_FOR_ERROR - ;} - break; - - case 219: -#line 2200 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = 0; + ; + break;} +case 218: +#line 2200 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = 0; CHECK_FOR_ERROR - ;} - break; - - case 220: -#line 2206 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - UnEscapeLexed((yyvsp[(3) - (9)].StrVal)); - std::string FunctionName((yyvsp[(3) - (9)].StrVal)); - free((yyvsp[(3) - (9)].StrVal)); // Free strdup'd memory! + ; + break;} +case 219: +#line 2206 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + UnEscapeLexed(yyvsp[-6].StrVal); + std::string FunctionName(yyvsp[-6].StrVal); + free(yyvsp[-6].StrVal); // Free strdup'd memory! // Check the function result for abstractness if this is a define. We should // have no abstract types at this point - if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (9)].TypeVal))) - GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (9)].TypeVal)->get()->getDescription()); + if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(yyvsp[-7].TypeVal)) + GEN_ERROR("Reference to abstract result: "+ yyvsp[-7].TypeVal->get()->getDescription()); std::vector ParamTypeList; ParamAttrsVector Attrs; - if ((yyvsp[(7) - (9)].ParamAttrs) != ParamAttr::None) { - ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = (yyvsp[(7) - (9)].ParamAttrs); + if (yyvsp[-2].ParamAttrs != ParamAttr::None) { + ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = yyvsp[-2].ParamAttrs; Attrs.push_back(PAWI); } - if ((yyvsp[(5) - (9)].ArgList)) { // If there are arguments... + if (yyvsp[-4].ArgList) { // If there are arguments... unsigned index = 1; - for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); I != (yyvsp[(5) - (9)].ArgList)->end(); ++I, ++index) { + for (ArgListType::iterator I = yyvsp[-4].ArgList->begin(); I != yyvsp[-4].ArgList->end(); ++I, ++index) { const Type* Ty = I->Ty->get(); if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty)) GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); @@ -5018,9 +3989,9 @@ if (!Attrs.empty()) PAL = ParamAttrsList::get(Attrs); - FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (9)].TypeVal), ParamTypeList, isVarArg, PAL); + FunctionType *FT = FunctionType::get(*yyvsp[-7].TypeVal, ParamTypeList, isVarArg, PAL); const PointerType *PFT = PointerType::get(FT); - delete (yyvsp[(2) - (9)].TypeVal); + delete yyvsp[-7].TypeVal; ValID ID; if (!FunctionName.empty()) { @@ -5069,26 +4040,26 @@ Fn->setLinkage(CurFun.Linkage); Fn->setVisibility(CurFun.Visibility); } - Fn->setCallingConv((yyvsp[(1) - (9)].UIntVal)); - Fn->setAlignment((yyvsp[(9) - (9)].UIntVal)); - if ((yyvsp[(8) - (9)].StrVal)) { - Fn->setSection((yyvsp[(8) - (9)].StrVal)); - free((yyvsp[(8) - (9)].StrVal)); + Fn->setCallingConv(yyvsp[-8].UIntVal); + Fn->setAlignment(yyvsp[0].UIntVal); + if (yyvsp[-1].StrVal) { + Fn->setSection(yyvsp[-1].StrVal); + free(yyvsp[-1].StrVal); } // Add all of the arguments we parsed to the function... - if ((yyvsp[(5) - (9)].ArgList)) { // Is null if empty... + if (yyvsp[-4].ArgList) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert((yyvsp[(5) - (9)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (9)].ArgList)->back().Name == 0 && + assert(yyvsp[-4].ArgList->back().Ty->get() == Type::VoidTy && yyvsp[-4].ArgList->back().Name == 0 && "Not a varargs marker!"); - delete (yyvsp[(5) - (9)].ArgList)->back().Ty; - (yyvsp[(5) - (9)].ArgList)->pop_back(); // Delete the last entry + delete yyvsp[-4].ArgList->back().Ty; + yyvsp[-4].ArgList->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); Function::arg_iterator ArgEnd = Fn->arg_end(); unsigned Idx = 1; - for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); - I != (yyvsp[(5) - (9)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { + for (ArgListType::iterator I = yyvsp[-4].ArgList->begin(); + I != yyvsp[-4].ArgList->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { delete I->Ty; // Delete the typeholder... setValueName(ArgIt, I->Name); // Insert arg into symtab... CHECK_FOR_ERROR @@ -5096,366 +4067,332 @@ Idx++; } - delete (yyvsp[(5) - (9)].ArgList); // We're now done with the argument list + delete yyvsp[-4].ArgList; // We're now done with the argument list } CHECK_FOR_ERROR -;} - break; - - case 223: -#line 2329 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = CurFun.CurrentFunction; +; + break;} +case 222: +#line 2329 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = CurFun.CurrentFunction; // Make sure that we keep track of the linkage type even if there was a // previous "declare". - (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage)); - (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility)); -;} - break; - - case 226: -#line 2340 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + yyval.FunctionVal->setLinkage(yyvsp[-3].Linkage); + yyval.FunctionVal->setVisibility(yyvsp[-2].Visibility); +; + break;} +case 225: +#line 2340 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = yyvsp[-1].FunctionVal; CHECK_FOR_ERROR -;} - break; - - case 227: -#line 2345 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); - CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); - (yyval.FunctionVal) = CurFun.CurrentFunction; +; + break;} +case 226: +#line 2345 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurFun.CurrentFunction->setLinkage(yyvsp[-2].Linkage); + CurFun.CurrentFunction->setVisibility(yyvsp[-1].Visibility); + yyval.FunctionVal = CurFun.CurrentFunction; CurFun.FunctionDone(); CHECK_FOR_ERROR - ;} - break; - - case 228: -#line 2357 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; - CHECK_FOR_ERROR - ;} - break; - - case 229: -#line 2361 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; - CHECK_FOR_ERROR - ;} - break; - - case 230: -#line 2366 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // A reference to a direct constant - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); - CHECK_FOR_ERROR - ;} - break; - - case 231: -#line 2370 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); + ; + break;} +case 227: +#line 2357 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 232: -#line 2374 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Perhaps it's an FP constant? - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); + ; + break;} +case 228: +#line 2361 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 233: -#line 2378 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); + ; + break;} +case 229: +#line 2366 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // A reference to a direct constant + yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); + CHECK_FOR_ERROR + ; + break;} +case 230: +#line 2370 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 234: -#line 2382 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); + ; + break;} +case 231: +#line 2374 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Perhaps it's an FP constant? + yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); + CHECK_FOR_ERROR + ; + break;} +case 232: +#line 2378 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR - ;} - break; - - case 235: -#line 2386 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createNull(); + ; + break;} +case 233: +#line 2382 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR - ;} - break; - - case 236: -#line 2390 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createUndef(); + ; + break;} +case 234: +#line 2386 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createNull(); CHECK_FOR_ERROR - ;} - break; - - case 237: -#line 2394 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // A vector zero constant. - (yyval.ValIDVal) = ValID::createZeroInit(); + ; + break;} +case 235: +#line 2390 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createUndef(); CHECK_FOR_ERROR - ;} - break; - - case 238: -#line 2398 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized packed vector - const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); - int NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); + ; + break;} +case 236: +#line 2394 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // A vector zero constant. + yyval.ValIDVal = ValID::createZeroInit(); + CHECK_FOR_ERROR + ; + break;} +case 237: +#line 2398 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized packed vector + const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType(); + int NumElements = yyvsp[-1].ConstVector->size(); VectorType* pt = VectorType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( - HandleUpRefs( - VectorType::get( - ETy, - NumElements) - ) - ); - - // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()) - GEN_ERROR("Element #" + utostr(i) + " is not of type '" + - ETy->getDescription() +"' as required!\nIt is of type '" + - (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'."); - } - - (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector))); - delete PTy; delete (yyvsp[(2) - (3)].ConstVector); - CHECK_FOR_ERROR - ;} - break; - - case 239: -#line 2423 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); - CHECK_FOR_ERROR - ;} - break; - - case 240: -#line 2427 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - char *End = UnEscapeLexed((yyvsp[(3) - (5)].StrVal), true); - std::string AsmStr = std::string((yyvsp[(3) - (5)].StrVal), End); - End = UnEscapeLexed((yyvsp[(5) - (5)].StrVal), true); - std::string Constraints = std::string((yyvsp[(5) - (5)].StrVal), End); - (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[(2) - (5)].BoolVal)); - free((yyvsp[(3) - (5)].StrVal)); - free((yyvsp[(5) - (5)].StrVal)); - CHECK_FOR_ERROR - ;} - break; - - case 241: -#line 2441 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Is it an integer reference...? - (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); - CHECK_FOR_ERROR - ;} - break; - - case 242: -#line 2445 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); - CHECK_FOR_ERROR - ;} - break; - - case 243: -#line 2449 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createLocalName((yyvsp[(1) - (1)].StrVal)); - CHECK_FOR_ERROR - ;} - break; - - case 244: -#line 2453 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createGlobalName((yyvsp[(1) - (1)].StrVal)); - CHECK_FOR_ERROR - ;} - break; - - case 247: -#line 2465 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal)); - delete (yyvsp[(1) - (2)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 248: -#line 2474 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); - CHECK_FOR_ERROR - ;} - break; - - case 249: -#line 2478 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Do not allow functions with 0 basic blocks - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); - CHECK_FOR_ERROR - ;} - break; - - case 250: -#line 2487 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); - CHECK_FOR_ERROR - InsertValue((yyvsp[(3) - (3)].TermInstVal)); - (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal)); - (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal); - CHECK_FOR_ERROR - ;} - break; - - case 251: -#line 2496 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) - if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) - if (CI2->getParent() == 0) - (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2); - (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal)); - (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal); - CHECK_FOR_ERROR - ;} - break; - - case 252: -#line 2505 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Empty space between instruction lists - (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); - CHECK_FOR_ERROR - ;} - break; - - case 253: -#line 2509 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Labelled (named) basic block - (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName((yyvsp[(1) - (1)].StrVal))); - CHECK_FOR_ERROR - ;} - break; - - case 254: -#line 2514 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Return with a result... - (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueVal)); - CHECK_FOR_ERROR - ;} - break; + HandleUpRefs( + VectorType::get( + ETy, + NumElements) + ) + ); + + // Verify all elements are correct type! + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) + GEN_ERROR("Element #" + utostr(i) + " is not of type '" + + ETy->getDescription() +"' as required!\nIt is of type '" + + (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); + } - case 255: -#line 2518 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Return with no result... - (yyval.TermInstVal) = new ReturnInst(); + yyval.ValIDVal = ValID::create(ConstantVector::get(pt, *yyvsp[-1].ConstVector)); + delete PTy; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 256: -#line 2522 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Unconditional Branch... - BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); + ; + break;} +case 238: +#line 2423 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal); CHECK_FOR_ERROR - (yyval.TermInstVal) = new BranchInst(tmpBB); - ;} - break; - - case 257: -#line 2527 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?"); - BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); + ; + break;} +case 239: +#line 2427 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + char *End = UnEscapeLexed(yyvsp[-2].StrVal, true); + std::string AsmStr = std::string(yyvsp[-2].StrVal, End); + End = UnEscapeLexed(yyvsp[0].StrVal, true); + std::string Constraints = std::string(yyvsp[0].StrVal, End); + yyval.ValIDVal = ValID::createInlineAsm(AsmStr, Constraints, yyvsp[-3].BoolVal); + free(yyvsp[-2].StrVal); + free(yyvsp[0].StrVal); + CHECK_FOR_ERROR + ; + break;} +case 240: +#line 2441 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it an integer reference...? + yyval.ValIDVal = ValID::createLocalID(yyvsp[0].UIntVal); + CHECK_FOR_ERROR + ; + break;} +case 241: +#line 2445 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createGlobalID(yyvsp[0].UIntVal); CHECK_FOR_ERROR - BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal)); + ; + break;} +case 242: +#line 2449 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it a named reference...? + yyval.ValIDVal = ValID::createLocalName(yyvsp[0].StrVal); + CHECK_FOR_ERROR + ; + break;} +case 243: +#line 2453 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it a named reference...? + yyval.ValIDVal = ValID::createGlobalName(yyvsp[0].StrVal); + CHECK_FOR_ERROR + ; + break;} +case 246: +#line 2465 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!UpRefs.empty()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.ValueVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 247: +#line 2474 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = yyvsp[-1].FunctionVal; CHECK_FOR_ERROR - Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal)); + ; + break;} +case 248: +#line 2478 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Do not allow functions with 0 basic blocks + yyval.FunctionVal = yyvsp[-1].FunctionVal; + CHECK_FOR_ERROR + ; + break;} +case 249: +#line 2487 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); CHECK_FOR_ERROR - (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal); - ;} - break; - - case 258: -#line 2537 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); + InsertValue(yyvsp[0].TermInstVal); + yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal); + yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal; + CHECK_FOR_ERROR + ; + break;} +case 250: +#line 2496 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (CastInst *CI1 = dyn_cast(yyvsp[0].InstVal)) + if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) + if (CI2->getParent() == 0) + yyvsp[-1].BasicBlockVal->getInstList().push_back(CI2); + yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal); + yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal; + CHECK_FOR_ERROR + ; + break;} +case 251: +#line 2505 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty space between instruction lists + yyval.BasicBlockVal = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); + CHECK_FOR_ERROR + ; + break;} +case 252: +#line 2509 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Labelled (named) basic block + yyval.BasicBlockVal = defineBBVal(ValID::createLocalName(yyvsp[0].StrVal)); + CHECK_FOR_ERROR + ; + break;} +case 253: +#line 2514 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Return with a result... + yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal); + CHECK_FOR_ERROR + ; + break;} +case 254: +#line 2518 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Return with no result... + yyval.TermInstVal = new ReturnInst(); + CHECK_FOR_ERROR + ; + break;} +case 255: +#line 2522 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Unconditional Branch... + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); + CHECK_FOR_ERROR + yyval.TermInstVal = new BranchInst(tmpBB); + ; + break;} +case 256: +#line 2527 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + assert(cast(yyvsp[-7].PrimType)->getBitWidth() == 1 && "Not Bool?"); + BasicBlock* tmpBBA = getBBVal(yyvsp[-3].ValIDVal); + CHECK_FOR_ERROR + BasicBlock* tmpBBB = getBBVal(yyvsp[0].ValIDVal); + CHECK_FOR_ERROR + Value* tmpVal = getVal(Type::Int1Ty, yyvsp[-6].ValIDVal); + CHECK_FOR_ERROR + yyval.TermInstVal = new BranchInst(tmpBBA, tmpBBB, tmpVal); + ; + break;} +case 257: +#line 2537 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + Value* tmpVal = getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[-3].ValIDVal); CHECK_FOR_ERROR - SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size()); - (yyval.TermInstVal) = S; + SwitchInst *S = new SwitchInst(tmpVal, tmpBB, yyvsp[-1].JumpTable->size()); + yyval.TermInstVal = S; - std::vector >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(), - E = (yyvsp[(8) - (9)].JumpTable)->end(); + std::vector >::iterator I = yyvsp[-1].JumpTable->begin(), + E = yyvsp[-1].JumpTable->end(); for (; I != E; ++I) { if (ConstantInt *CI = dyn_cast(I->first)) S->addCase(CI, I->second); else GEN_ERROR("Switch case is constant, but not a simple integer"); } - delete (yyvsp[(8) - (9)].JumpTable); + delete yyvsp[-1].JumpTable; CHECK_FOR_ERROR - ;} - break; - - case 259: -#line 2556 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); + ; + break;} +case 258: +#line 2556 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + Value* tmpVal = getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[-2].ValIDVal); CHECK_FOR_ERROR SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0); - (yyval.TermInstVal) = S; + yyval.TermInstVal = S; CHECK_FOR_ERROR - ;} - break; - - case 260: -#line 2566 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 259: +#line 2566 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast((yyvsp[(3) - (14)].TypeVal)->get())) || + if (!(PFTy = dyn_cast(yyvsp[-11].TypeVal->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; ParamAttrsVector Attrs; - if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None) { - ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = 8; + if (yyvsp[-6].ParamAttrs != ParamAttr::None) { + ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = yyvsp[-6].ParamAttrs; Attrs.push_back(PAWI); } - ValueRefList::iterator I = (yyvsp[(6) - (14)].ValueRefList)->begin(), E = (yyvsp[(6) - (14)].ValueRefList)->end(); + ValueRefList::iterator I = yyvsp[-8].ValueRefList->begin(), E = yyvsp[-8].ValueRefList->end(); unsigned index = 1; for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); @@ -5471,22 +4408,22 @@ ParamAttrsList *PAL = 0; if (!Attrs.empty()) PAL = ParamAttrsList::get(Attrs); - Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false, PAL); + Ty = FunctionType::get(yyvsp[-11].TypeVal->get(), ParamTypes, false, PAL); PFTy = PointerType::get(Ty); } - delete (yyvsp[(3) - (14)].TypeVal); + delete yyvsp[-11].TypeVal; - Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling... + Value *V = getVal(PFTy, yyvsp[-10].ValIDVal); // Get the function we're calling... CHECK_FOR_ERROR - BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal)); + BasicBlock *Normal = getBBVal(yyvsp[-3].ValIDVal); CHECK_FOR_ERROR - BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal)); + BasicBlock *Except = getBBVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR // Check the arguments ValueList Args; - if ((yyvsp[(6) - (14)].ValueRefList)->empty()) { // Has no arguments? + if (yyvsp[-8].ValueRefList->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -5496,7 +4433,7 @@ // correctly! FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[(6) - (14)].ValueRefList)->begin(), ArgE = (yyvsp[(6) - (14)].ValueRefList)->end(); + ValueRefList::iterator ArgI = yyvsp[-8].ValueRefList->begin(), ArgE = yyvsp[-8].ValueRefList->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5515,348 +4452,322 @@ // Create the InvokeInst InvokeInst *II = new InvokeInst(V, Normal, Except, &Args[0], Args.size()); - II->setCallingConv((yyvsp[(2) - (14)].UIntVal)); - (yyval.TermInstVal) = II; - delete (yyvsp[(6) - (14)].ValueRefList); - CHECK_FOR_ERROR - ;} - break; - - case 261: -#line 2645 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TermInstVal) = new UnwindInst(); + II->setCallingConv(yyvsp[-12].UIntVal); + yyval.TermInstVal = II; + delete yyvsp[-8].ValueRefList; + CHECK_FOR_ERROR + ; + break;} +case 260: +#line 2645 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TermInstVal = new UnwindInst(); CHECK_FOR_ERROR - ;} - break; - - case 262: -#line 2649 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TermInstVal) = new UnreachableInst(); + ; + break;} +case 261: +#line 2649 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TermInstVal = new UnreachableInst(); CHECK_FOR_ERROR - ;} - break; - - case 263: -#line 2656 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); - Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); + ; + break;} +case 262: +#line 2656 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.JumpTable = yyvsp[-5].JumpTable; + Constant *V = cast(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); - ;} - break; - - case 264: -#line 2667 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.JumpTable) = new std::vector >(); - Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); + yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); + ; + break;} +case 263: +#line 2667 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.JumpTable = new std::vector >(); + Constant *V = cast(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); - ;} - break; - - case 265: -#line 2680 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); + ; + break;} +case 264: +#line 2680 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is this definition named?? if so, assign the name... - setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); + setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal); CHECK_FOR_ERROR - InsertValue((yyvsp[(2) - (2)].InstVal)); - (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal); + InsertValue(yyvsp[0].InstVal); + yyval.InstVal = yyvsp[0].InstVal; CHECK_FOR_ERROR - ;} - break; - - case 266: -#line 2690 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { // Used for PHI nodes + ; + break;} +case 265: +#line 2690 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Used for PHI nodes if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); - (yyval.PHIList) = new std::list >(); - Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal)); - CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal)); - CHECK_FOR_ERROR - (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); - delete (yyvsp[(1) - (6)].TypeVal); - ;} - break; - - case 267: -#line 2701 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); - Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-5].TypeVal)->getDescription()); + yyval.PHIList = new std::list >(); + Value* tmpVal = getVal(*yyvsp[-5].TypeVal, yyvsp[-3].ValIDVal); + CHECK_FOR_ERROR + BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); + CHECK_FOR_ERROR + yyval.PHIList->push_back(std::make_pair(tmpVal, tmpBB)); + delete yyvsp[-5].TypeVal; + ; + break;} +case 266: +#line 2701 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.PHIList = yyvsp[-6].PHIList; + Value* tmpVal = getVal(yyvsp[-6].PHIList->front().first->getType(), yyvsp[-3].ValIDVal); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); - ;} - break; - - case 268: -#line 2711 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + yyvsp[-6].PHIList->push_back(std::make_pair(tmpVal, tmpBB)); + ; + break;} +case 267: +#line 2711 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); // Used for call and invoke instructions - (yyval.ValueRefList) = new ValueRefList(); - ValueRefListEntry E; E.Attrs = (yyvsp[(3) - (3)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (3)].TypeVal)->get(), (yyvsp[(2) - (3)].ValIDVal)); - (yyval.ValueRefList)->push_back(E); - delete (yyvsp[(1) - (3)].TypeVal); - ;} - break; - - case 269: -#line 2720 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + yyval.ValueRefList = new ValueRefList(); + ValueRefListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal); + yyval.ValueRefList->push_back(E); + delete yyvsp[-2].TypeVal; + ; + break;} +case 268: +#line 2720 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - (yyval.ValueRefList) = (yyvsp[(1) - (5)].ValueRefList); - ValueRefListEntry E; E.Attrs = (yyvsp[(5) - (5)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (5)].TypeVal)->get(), (yyvsp[(4) - (5)].ValIDVal)); - (yyval.ValueRefList)->push_back(E); - delete (yyvsp[(3) - (5)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 270: -#line 2729 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.ValueRefList) = new ValueRefList(); ;} - break; - - case 271: -#line 2732 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { (yyval.ValueList) = new std::vector(); ;} - break; - - case 272: -#line 2733 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); - (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + yyval.ValueRefList = yyvsp[-4].ValueRefList; + ValueRefListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal); + yyval.ValueRefList->push_back(E); + delete yyvsp[-2].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 269: +#line 2729 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueRefList = new ValueRefList(); ; + break;} +case 270: +#line 2732 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueList = new std::vector(); ; + break;} +case 271: +#line 2733 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValueList = yyvsp[-2].ValueList; + yyval.ValueList->push_back(yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 273: -#line 2740 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; + ; + break;} +case 272: +#line 2740 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 274: -#line 2744 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; + ; + break;} +case 273: +#line 2744 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 275: -#line 2749 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 274: +#line 2749 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); - if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() && - !isa((*(yyvsp[(2) - (5)].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (!(*yyvsp[-3].TypeVal)->isInteger() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() && + !isa((*yyvsp[-3].TypeVal).get())) GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands"); - if (isa((*(yyvsp[(2) - (5)].TypeVal)).get()) && - ((yyvsp[(1) - (5)].BinaryOpVal) == Instruction::URem || - (yyvsp[(1) - (5)].BinaryOpVal) == Instruction::SRem || - (yyvsp[(1) - (5)].BinaryOpVal) == Instruction::FRem)) + if (isa((*yyvsp[-3].TypeVal).get()) && + (yyvsp[-4].BinaryOpVal == Instruction::URem || + yyvsp[-4].BinaryOpVal == Instruction::SRem || + yyvsp[-4].BinaryOpVal == Instruction::FRem)) GEN_ERROR("Remainder not supported on vector types"); - Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal)); + Value* val1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal)); + Value* val2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2); - if ((yyval.InstVal) == 0) + yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, val1, val2); + if (yyval.InstVal == 0) GEN_ERROR("binary operator returned null"); - delete (yyvsp[(2) - (5)].TypeVal); - ;} - break; - - case 276: -#line 2770 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 275: +#line 2770 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); - if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) { - if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa((yyvsp[(2) - (5)].TypeVal)->get()) || - !cast((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (!(*yyvsp[-3].TypeVal)->isInteger()) { + if (Instruction::isShift(yyvsp[-4].BinaryOpVal) || !isa(yyvsp[-3].TypeVal->get()) || + !cast(yyvsp[-3].TypeVal->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } - Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal)); + Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal)); + Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2); - if ((yyval.InstVal) == 0) + yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, tmpVal1, tmpVal2); + if (yyval.InstVal == 0) GEN_ERROR("binary operator returned null"); - delete (yyvsp[(2) - (5)].TypeVal); - ;} - break; - - case 277: -#line 2787 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 276: +#line 2787 "/Users/sabre/cvs/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("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (isa((*yyvsp[-3].TypeVal).get())) GEN_ERROR("Vector types not supported by icmp instruction"); - Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); + Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); + Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2); - if ((yyval.InstVal) == 0) + yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].IPredicate, tmpVal1, tmpVal2); + if (yyval.InstVal == 0) GEN_ERROR("icmp operator returned null"); - delete (yyvsp[(3) - (6)].TypeVal); - ;} - break; - - case 278: -#line 2801 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 277: +#line 2801 "/Users/sabre/cvs/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("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (isa((*yyvsp[-3].TypeVal).get())) GEN_ERROR("Vector types not supported by fcmp instruction"); - Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); + Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); + Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2); - if ((yyval.InstVal) == 0) + yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].FPredicate, tmpVal1, tmpVal2); + if (yyval.InstVal == 0) GEN_ERROR("fcmp operator returned null"); - delete (yyvsp[(3) - (6)].TypeVal); - ;} - break; - - case 279: -#line 2815 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 278: +#line 2815 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); - Value* Val = (yyvsp[(2) - (4)].ValueVal); - const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get(); - if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + Value* Val = yyvsp[-2].ValueVal; + const Type* DestTy = yyvsp[0].TypeVal->get(); + if (!CastInst::castIsValid(yyvsp[-3].CastOpVal, Val, DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - (yyval.InstVal) = CastInst::create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy); - delete (yyvsp[(4) - (4)].TypeVal); - ;} - break; - - case 280: -#line 2827 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) + yyval.InstVal = CastInst::create(yyvsp[-3].CastOpVal, Val, DestTy); + delete yyvsp[0].TypeVal; + ; + break;} +case 279: +#line 2827 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-4].ValueVal->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean"); - if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType()) + if (yyvsp[-2].ValueVal->getType() != yyvsp[0].ValueVal->getType()) GEN_ERROR("select value types should match"); - (yyval.InstVal) = new SelectInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); + yyval.InstVal = new SelectInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 281: -#line 2835 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 280: +#line 2835 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); - (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal)); - delete (yyvsp[(4) - (4)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 282: -#line 2842 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + yyval.InstVal = new VAArgInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal); + delete yyvsp[0].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 281: +#line 2842 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ExtractElementInst::isValidOperands(yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid extractelement operands"); - (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)); + yyval.InstVal = new ExtractElementInst(yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 283: -#line 2848 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) + ; + break;} +case 282: +#line 2848 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!InsertElementInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid insertelement operands"); - (yyval.InstVal) = new InsertElementInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); + yyval.InstVal = new InsertElementInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 284: -#line 2854 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) + ; + break;} +case 283: +#line 2854 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ShuffleVectorInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid shufflevector operands"); - (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); + yyval.InstVal = new ShuffleVectorInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 285: -#line 2860 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); + ; + break;} +case 284: +#line 2860 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const Type *Ty = yyvsp[0].PHIList->front().first->getType(); if (!Ty->isFirstClassType()) GEN_ERROR("PHI node operands must be of first class type"); - (yyval.InstVal) = new PHINode(Ty); - ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size()); - while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) { - if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty) + yyval.InstVal = new PHINode(Ty); + ((PHINode*)yyval.InstVal)->reserveOperandSpace(yyvsp[0].PHIList->size()); + while (yyvsp[0].PHIList->begin() != yyvsp[0].PHIList->end()) { + if (yyvsp[0].PHIList->front().first->getType() != Ty) GEN_ERROR("All elements of a PHI node must be of the same type"); - cast((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second); - (yyvsp[(2) - (2)].PHIList)->pop_front(); + cast(yyval.InstVal)->addIncoming(yyvsp[0].PHIList->front().first, yyvsp[0].PHIList->front().second); + yyvsp[0].PHIList->pop_front(); } - delete (yyvsp[(2) - (2)].PHIList); // Free the list... + delete yyvsp[0].PHIList; // Free the list... CHECK_FOR_ERROR - ;} - break; - - case 286: -#line 2876 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 285: +#line 2876 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast((yyvsp[(3) - (8)].TypeVal)->get())) || + if (!(PFTy = dyn_cast(yyvsp[-5].TypeVal->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; ParamAttrsVector Attrs; - if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None) { - ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = (yyvsp[(8) - (8)].ParamAttrs); + if (yyvsp[0].ParamAttrs != ParamAttr::None) { + ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = yyvsp[0].ParamAttrs; Attrs.push_back(PAWI); } unsigned index = 1; - ValueRefList::iterator I = (yyvsp[(6) - (8)].ValueRefList)->begin(), E = (yyvsp[(6) - (8)].ValueRefList)->end(); + ValueRefList::iterator I = yyvsp[-2].ValueRefList->begin(), E = yyvsp[-2].ValueRefList->end(); for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) @@ -5872,11 +4783,11 @@ if (!Attrs.empty()) PAL = ParamAttrsList::get(Attrs); - Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false, PAL); + Ty = FunctionType::get(yyvsp[-5].TypeVal->get(), ParamTypes, false, PAL); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling... + Value *V = getVal(PFTy, yyvsp[-4].ValIDVal); // Get the function we're calling... CHECK_FOR_ERROR // Check for call to invalid intrinsic to avoid crashing later. @@ -5890,7 +4801,7 @@ // Check the arguments ValueList Args; - if ((yyvsp[(6) - (8)].ValueRefList)->empty()) { // Has no arguments? + if (yyvsp[-2].ValueRefList->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -5901,7 +4812,7 @@ // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[(6) - (8)].ValueRefList)->begin(), ArgE = (yyvsp[(6) - (8)].ValueRefList)->end(); + ValueRefList::iterator ArgI = yyvsp[-2].ValueRefList->begin(), ArgE = yyvsp[-2].ValueRefList->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5918,371 +4829,365 @@ } // Create the call node CallInst *CI = new CallInst(V, &Args[0], Args.size()); - CI->setTailCall((yyvsp[(1) - (8)].BoolVal)); - CI->setCallingConv((yyvsp[(2) - (8)].UIntVal)); - (yyval.InstVal) = CI; - delete (yyvsp[(6) - (8)].ValueRefList); - delete (yyvsp[(3) - (8)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 287: -#line 2960 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); + CI->setTailCall(yyvsp[-7].BoolVal); + CI->setCallingConv(yyvsp[-6].UIntVal); + yyval.InstVal = CI; + delete yyvsp[-2].ValueRefList; + delete yyvsp[-5].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 286: +#line 2960 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.InstVal = yyvsp[0].InstVal; CHECK_FOR_ERROR - ;} - break; - - case 288: -#line 2965 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; + ; + break;} +case 287: +#line 2965 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 289: -#line 2969 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; + ; + break;} +case 288: +#line 2969 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 290: -#line 2976 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 289: +#line 2976 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); - (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal)); - delete (yyvsp[(2) - (3)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 291: -#line 2983 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.InstVal = new MallocInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 290: +#line 2983 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); - Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); + Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); - delete (yyvsp[(2) - (6)].TypeVal); - ;} - break; - - case 292: -#line 2991 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new MallocInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal); + delete yyvsp[-4].TypeVal; + ; + break;} +case 291: +#line 2991 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); - (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal)); - delete (yyvsp[(2) - (3)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 293: -#line 2998 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.InstVal = new AllocaInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 292: +#line 2998 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); - Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); + Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); - delete (yyvsp[(2) - (6)].TypeVal); - ;} - break; - - case 294: -#line 3006 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { - if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) + yyval.InstVal = new AllocaInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal); + delete yyvsp[-4].TypeVal; + ; + break;} +case 293: +#line 3006 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[0].ValueVal->getType())) GEN_ERROR("Trying to free nonpointer type " + - (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + ""); - (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal)); + yyvsp[0].ValueVal->getType()->getDescription() + ""); + yyval.InstVal = new FreeInst(yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 295: -#line 3014 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 294: +#line 3014 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - if (!isa((yyvsp[(3) - (5)].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (!isa(yyvsp[-2].TypeVal->get())) GEN_ERROR("Can't load from nonpointer type: " + - (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - if (!cast((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType()) + (*yyvsp[-2].TypeVal)->getDescription()); + if (!cast(yyvsp[-2].TypeVal->get())->getElementType()->isFirstClassType()) GEN_ERROR("Can't load from pointer of non-first-class type: " + - (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal)); + (*yyvsp[-2].TypeVal)->getDescription()); + Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal)); - delete (yyvsp[(3) - (5)].TypeVal); - ;} - break; - - case 296: -#line 3028 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new LoadInst(tmpVal, "", yyvsp[-4].BoolVal, yyvsp[0].UIntVal); + delete yyvsp[-2].TypeVal; + ; + break;} +case 295: +#line 3028 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); - const PointerType *PT = dyn_cast((yyvsp[(5) - (7)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const PointerType *PT = dyn_cast(yyvsp[-2].TypeVal->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + - (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); + (*yyvsp[-2].TypeVal)->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType()) - GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() + + if (ElTy != yyvsp[-4].ValueVal->getType()) + GEN_ERROR("Can't store '" + yyvsp[-4].ValueVal->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'"); - Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal)); + Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal)); - delete (yyvsp[(5) - (7)].TypeVal); - ;} - break; - - case 297: -#line 3045 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new StoreInst(yyvsp[-4].ValueVal, tmpVal, yyvsp[-6].BoolVal, yyvsp[0].UIntVal); + delete yyvsp[-2].TypeVal; + ; + break;} +case 296: +#line 3045 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); - if (!isa((yyvsp[(2) - (4)].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (!isa(yyvsp[-2].TypeVal->get())) GEN_ERROR("getelementptr insn requires pointer operand"); - if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), &(*(yyvsp[(4) - (4)].ValueList))[0], (yyvsp[(4) - (4)].ValueList)->size(), true)) + if (!GetElementPtrInst::getIndexedType(*yyvsp[-2].TypeVal, &(*yyvsp[0].ValueList)[0], yyvsp[0].ValueList->size(), true)) GEN_ERROR("Invalid getelementptr indices for type '" + - (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'"); - Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal)); + (*yyvsp[-2].TypeVal)->getDescription()+ "'"); + Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new GetElementPtrInst(tmpVal, &(*(yyvsp[(4) - (4)].ValueList))[0], (yyvsp[(4) - (4)].ValueList)->size()); - delete (yyvsp[(2) - (4)].TypeVal); - delete (yyvsp[(4) - (4)].ValueList); - ;} - break; - + yyval.InstVal = new GetElementPtrInst(tmpVal, &(*yyvsp[0].ValueList)[0], yyvsp[0].ValueList->size()); + delete yyvsp[-2].TypeVal; + delete yyvsp[0].ValueList; + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif -/* Line 1267 of yacc.c. */ -#line 6072 "llvmAsmParser.tab.c" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif *++yyvsp = yyval; +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else - yystate = yydefgoto[yyn - YYNTOKENS]; + yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; +yyerrlab: /* here on detecting error */ -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ { ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) + if (yyn > YYFLAG && yyn < YYLAST) { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); } - /* Else will try to reuse look-ahead token after shifting the error - token. */ goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + goto yyerrhandle; -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ +yyerrdefault: /* current state does not do anything special for the error token. */ - for (;;) +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; } + else if (yyn == 0) + goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; - *++yyvsp = yylval; - +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif yystate = yyn; goto yynewstate; + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + } + return 1; } - - -#line 3062 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" +#line 3062 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions @@ -6363,4 +5268,3 @@ GenerateError(errMsg); return 0; } - Index: llvm/lib/AsmParser/llvmAsmParser.h.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.75 llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.76 --- llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.75 Sun Apr 29 13:38:24 2007 +++ llvm/lib/AsmParser/llvmAsmParser.h.cvs Thu May 3 23:01:37 2007 @@ -1,323 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - ESAPINTVAL = 260, - EUAPINTVAL = 261, - LOCALVAL_ID = 262, - GLOBALVAL_ID = 263, - FPVAL = 264, - VOID = 265, - INTTYPE = 266, - FLOAT = 267, - DOUBLE = 268, - LABEL = 269, - TYPE = 270, - LOCALVAR = 271, - GLOBALVAR = 272, - LABELSTR = 273, - STRINGCONSTANT = 274, - ATSTRINGCONSTANT = 275, - ZEROINITIALIZER = 276, - TRUETOK = 277, - FALSETOK = 278, - BEGINTOK = 279, - ENDTOK = 280, - DECLARE = 281, - DEFINE = 282, - GLOBAL = 283, - CONSTANT = 284, - SECTION = 285, - ALIAS = 286, - VOLATILE = 287, - THREAD_LOCAL = 288, - TO = 289, - DOTDOTDOT = 290, - NULL_TOK = 291, - UNDEF = 292, - INTERNAL = 293, - LINKONCE = 294, - WEAK = 295, - APPENDING = 296, - DLLIMPORT = 297, - DLLEXPORT = 298, - EXTERN_WEAK = 299, - OPAQUE = 300, - EXTERNAL = 301, - TARGET = 302, - TRIPLE = 303, - ALIGN = 304, - DEPLIBS = 305, - CALL = 306, - TAIL = 307, - ASM_TOK = 308, - MODULE = 309, - SIDEEFFECT = 310, - CC_TOK = 311, - CCC_TOK = 312, - FASTCC_TOK = 313, - COLDCC_TOK = 314, - X86_STDCALLCC_TOK = 315, - X86_FASTCALLCC_TOK = 316, - DATALAYOUT = 317, - RET = 318, - BR = 319, - SWITCH = 320, - INVOKE = 321, - UNWIND = 322, - UNREACHABLE = 323, - ADD = 324, - SUB = 325, - MUL = 326, - UDIV = 327, - SDIV = 328, - FDIV = 329, - UREM = 330, - SREM = 331, - FREM = 332, - AND = 333, - OR = 334, - XOR = 335, - SHL = 336, - LSHR = 337, - ASHR = 338, - ICMP = 339, - FCMP = 340, - EQ = 341, - NE = 342, - SLT = 343, - SGT = 344, - SLE = 345, - SGE = 346, - ULT = 347, - UGT = 348, - ULE = 349, - UGE = 350, - OEQ = 351, - ONE = 352, - OLT = 353, - OGT = 354, - OLE = 355, - OGE = 356, - ORD = 357, - UNO = 358, - UEQ = 359, - UNE = 360, - MALLOC = 361, - ALLOCA = 362, - FREE = 363, - LOAD = 364, - STORE = 365, - GETELEMENTPTR = 366, - TRUNC = 367, - ZEXT = 368, - SEXT = 369, - FPTRUNC = 370, - FPEXT = 371, - BITCAST = 372, - UITOFP = 373, - SITOFP = 374, - FPTOUI = 375, - FPTOSI = 376, - INTTOPTR = 377, - PTRTOINT = 378, - PHI_TOK = 379, - SELECT = 380, - VAARG = 381, - EXTRACTELEMENT = 382, - INSERTELEMENT = 383, - SHUFFLEVECTOR = 384, - NORETURN = 385, - INREG = 386, - SRET = 387, - NOUNWIND = 388, - DEFAULT = 389, - HIDDEN = 390, - PROTECTED = 391 - }; -#endif -/* Tokens. */ -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define ESAPINTVAL 260 -#define EUAPINTVAL 261 -#define LOCALVAL_ID 262 -#define GLOBALVAL_ID 263 -#define FPVAL 264 -#define VOID 265 -#define INTTYPE 266 -#define FLOAT 267 -#define DOUBLE 268 -#define LABEL 269 -#define TYPE 270 -#define LOCALVAR 271 -#define GLOBALVAR 272 -#define LABELSTR 273 -#define STRINGCONSTANT 274 -#define ATSTRINGCONSTANT 275 -#define ZEROINITIALIZER 276 -#define TRUETOK 277 -#define FALSETOK 278 -#define BEGINTOK 279 -#define ENDTOK 280 -#define DECLARE 281 -#define DEFINE 282 -#define GLOBAL 283 -#define CONSTANT 284 -#define SECTION 285 -#define ALIAS 286 -#define VOLATILE 287 -#define THREAD_LOCAL 288 -#define TO 289 -#define DOTDOTDOT 290 -#define NULL_TOK 291 -#define UNDEF 292 -#define INTERNAL 293 -#define LINKONCE 294 -#define WEAK 295 -#define APPENDING 296 -#define DLLIMPORT 297 -#define DLLEXPORT 298 -#define EXTERN_WEAK 299 -#define OPAQUE 300 -#define EXTERNAL 301 -#define TARGET 302 -#define TRIPLE 303 -#define ALIGN 304 -#define DEPLIBS 305 -#define CALL 306 -#define TAIL 307 -#define ASM_TOK 308 -#define MODULE 309 -#define SIDEEFFECT 310 -#define CC_TOK 311 -#define CCC_TOK 312 -#define FASTCC_TOK 313 -#define COLDCC_TOK 314 -#define X86_STDCALLCC_TOK 315 -#define X86_FASTCALLCC_TOK 316 -#define DATALAYOUT 317 -#define RET 318 -#define BR 319 -#define SWITCH 320 -#define INVOKE 321 -#define UNWIND 322 -#define UNREACHABLE 323 -#define ADD 324 -#define SUB 325 -#define MUL 326 -#define UDIV 327 -#define SDIV 328 -#define FDIV 329 -#define UREM 330 -#define SREM 331 -#define FREM 332 -#define AND 333 -#define OR 334 -#define XOR 335 -#define SHL 336 -#define LSHR 337 -#define ASHR 338 -#define ICMP 339 -#define FCMP 340 -#define EQ 341 -#define NE 342 -#define SLT 343 -#define SGT 344 -#define SLE 345 -#define SGE 346 -#define ULT 347 -#define UGT 348 -#define ULE 349 -#define UGE 350 -#define OEQ 351 -#define ONE 352 -#define OLT 353 -#define OGT 354 -#define OLE 355 -#define OGE 356 -#define ORD 357 -#define UNO 358 -#define UEQ 359 -#define UNE 360 -#define MALLOC 361 -#define ALLOCA 362 -#define FREE 363 -#define LOAD 364 -#define STORE 365 -#define GETELEMENTPTR 366 -#define TRUNC 367 -#define ZEXT 368 -#define SEXT 369 -#define FPTRUNC 370 -#define FPEXT 371 -#define BITCAST 372 -#define UITOFP 373 -#define SITOFP 374 -#define FPTOUI 375 -#define FPTOSI 376 -#define INTTOPTR 377 -#define PTRTOINT 378 -#define PHI_TOK 379 -#define SELECT 380 -#define VAARG 381 -#define EXTRACTELEMENT 382 -#define INSERTELEMENT 383 -#define SHUFFLEVECTOR 384 -#define NORETURN 385 -#define INREG 386 -#define SRET 387 -#define NOUNWIND 388 -#define DEFAULT 389 -#define HIDDEN 390 -#define PROTECTED 391 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 955 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y" -{ +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -362,14 +43,141 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} -/* Line 1489 of yacc.c. */ -#line 368 "llvmAsmParser.tab.h" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif +} YYSTYPE; +#define ESINT64VAL 257 +#define EUINT64VAL 258 +#define ESAPINTVAL 259 +#define EUAPINTVAL 260 +#define LOCALVAL_ID 261 +#define GLOBALVAL_ID 262 +#define FPVAL 263 +#define VOID 264 +#define INTTYPE 265 +#define FLOAT 266 +#define DOUBLE 267 +#define LABEL 268 +#define TYPE 269 +#define LOCALVAR 270 +#define GLOBALVAR 271 +#define LABELSTR 272 +#define STRINGCONSTANT 273 +#define ATSTRINGCONSTANT 274 +#define ZEROINITIALIZER 275 +#define TRUETOK 276 +#define FALSETOK 277 +#define BEGINTOK 278 +#define ENDTOK 279 +#define DECLARE 280 +#define DEFINE 281 +#define GLOBAL 282 +#define CONSTANT 283 +#define SECTION 284 +#define ALIAS 285 +#define VOLATILE 286 +#define THREAD_LOCAL 287 +#define TO 288 +#define DOTDOTDOT 289 +#define NULL_TOK 290 +#define UNDEF 291 +#define INTERNAL 292 +#define LINKONCE 293 +#define WEAK 294 +#define APPENDING 295 +#define DLLIMPORT 296 +#define DLLEXPORT 297 +#define EXTERN_WEAK 298 +#define OPAQUE 299 +#define EXTERNAL 300 +#define TARGET 301 +#define TRIPLE 302 +#define ALIGN 303 +#define DEPLIBS 304 +#define CALL 305 +#define TAIL 306 +#define ASM_TOK 307 +#define MODULE 308 +#define SIDEEFFECT 309 +#define CC_TOK 310 +#define CCC_TOK 311 +#define FASTCC_TOK 312 +#define COLDCC_TOK 313 +#define X86_STDCALLCC_TOK 314 +#define X86_FASTCALLCC_TOK 315 +#define DATALAYOUT 316 +#define RET 317 +#define BR 318 +#define SWITCH 319 +#define INVOKE 320 +#define UNWIND 321 +#define UNREACHABLE 322 +#define ADD 323 +#define SUB 324 +#define MUL 325 +#define UDIV 326 +#define SDIV 327 +#define FDIV 328 +#define UREM 329 +#define SREM 330 +#define FREM 331 +#define AND 332 +#define OR 333 +#define XOR 334 +#define SHL 335 +#define LSHR 336 +#define ASHR 337 +#define ICMP 338 +#define FCMP 339 +#define EQ 340 +#define NE 341 +#define SLT 342 +#define SGT 343 +#define SLE 344 +#define SGE 345 +#define ULT 346 +#define UGT 347 +#define ULE 348 +#define UGE 349 +#define OEQ 350 +#define ONE 351 +#define OLT 352 +#define OGT 353 +#define OLE 354 +#define OGE 355 +#define ORD 356 +#define UNO 357 +#define UEQ 358 +#define UNE 359 +#define MALLOC 360 +#define ALLOCA 361 +#define FREE 362 +#define LOAD 363 +#define STORE 364 +#define GETELEMENTPTR 365 +#define TRUNC 366 +#define ZEXT 367 +#define SEXT 368 +#define FPTRUNC 369 +#define FPEXT 370 +#define BITCAST 371 +#define UITOFP 372 +#define SITOFP 373 +#define FPTOUI 374 +#define FPTOSI 375 +#define INTTOPTR 376 +#define PTRTOINT 377 +#define PHI_TOK 378 +#define SELECT 379 +#define VAARG 380 +#define EXTRACTELEMENT 381 +#define INSERTELEMENT 382 +#define SHUFFLEVECTOR 383 +#define NORETURN 384 +#define INREG 385 +#define SRET 386 +#define NOUNWIND 387 +#define DEFAULT 388 +#define HIDDEN 389 +#define PROTECTED 390 -extern YYSTYPE llvmAsmlval; +extern YYSTYPE llvmAsmlval; Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.97 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.98 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.97 Sun Apr 29 13:35:00 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Thu May 3 23:01:37 2007 @@ -2574,7 +2574,7 @@ std::vector ParamTypes; ParamAttrsVector Attrs; if ($8 != ParamAttr::None) { - ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = 8; + ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = $8; Attrs.push_back(PAWI); } ValueRefList::iterator I = $6->begin(), E = $6->end(); From sabre at nondot.org Fri May 4 00:06:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 00:06:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/ValueEnumerator.cpp Message-ID: <200705040506.l44567kZ016091@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: ValueEnumerator.cpp updated: 1.9 -> 1.10 --- Log message: simple optimization for the type table --- Diffs of the changes: (+29 -5) ValueEnumerator.cpp | 34 +++++++++++++++++++++++++++++----- 1 files changed, 29 insertions(+), 5 deletions(-) Index: llvm/lib/Bitcode/Writer/ValueEnumerator.cpp diff -u llvm/lib/Bitcode/Writer/ValueEnumerator.cpp:1.9 llvm/lib/Bitcode/Writer/ValueEnumerator.cpp:1.10 --- llvm/lib/Bitcode/Writer/ValueEnumerator.cpp:1.9 Thu May 3 17:46:43 2007 +++ llvm/lib/Bitcode/Writer/ValueEnumerator.cpp Fri May 4 00:05:48 2007 @@ -16,8 +16,21 @@ #include "llvm/Module.h" #include "llvm/TypeSymbolTable.h" #include "llvm/ValueSymbolTable.h" +#include using namespace llvm; +static bool isFirstClassType(const std::pair &P) { + return P.first->isFirstClassType(); +} + +static bool CompareByFrequency(const std::pair &P1, + const std::pair &P2) { + return P1.second > P2.second; +} + /// ValueEnumerator - Enumerate module-level information. ValueEnumerator::ValueEnumerator(const Module *M) { // Enumerate the global variables. @@ -69,13 +82,24 @@ EnumerateType(I->getType()); } } - - // FIXME: std::partition the type and value tables so that first-class types - // come earlier than aggregates. FIXME: Emit a marker into the module - // indicating which aggregates types AND values can be dropped form the table. + // Sort the type table by frequency so that most commonly used types are early + // in the table (have low bit-width). + std::stable_sort(Types.begin(), Types.end(), CompareByFrequency); + + // Partition the Type ID's so that the first-class types occur before the + // aggregate types. This allows the aggregate types to be dropped from the + // type table after parsing the global variable initializers. + std::partition(Types.begin(), Types.end(), isFirstClassType); + + // Now that we rearranged the type table, rebuild TypeMap. + for (unsigned i = 0, e = Types.size(); i != e; ++i) + TypeMap[Types[i].first] = i+1; + + // FIXME: Emit a marker into the module indicating which aggregates types can + // be dropped form the table. - // FIXME: Sort type/value tables by frequency. + // FIXME: Sort value tables by frequency. // FIXME: Sort constants by type to reduce size. } From sabre at nondot.org Fri May 4 00:22:05 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 00:22:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/ValueEnumerator.cpp ValueEnumerator.h Message-ID: <200705040522.l445M5Uc016472@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: ValueEnumerator.cpp updated: 1.10 -> 1.11 ValueEnumerator.h updated: 1.9 -> 1.10 --- Log message: optimize constant layout. This fixes encoding of 181.mcf (by ensuring integer structure idx's are emitted before constant expr geps) and shrinks files slightly. For example kc++ shrinks from 4326188 to 4240128 bytes. --- Diffs of the changes: (+48 -5) ValueEnumerator.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++++----- ValueEnumerator.h | 2 ++ 2 files changed, 48 insertions(+), 5 deletions(-) Index: llvm/lib/Bitcode/Writer/ValueEnumerator.cpp diff -u llvm/lib/Bitcode/Writer/ValueEnumerator.cpp:1.10 llvm/lib/Bitcode/Writer/ValueEnumerator.cpp:1.11 --- llvm/lib/Bitcode/Writer/ValueEnumerator.cpp:1.10 Fri May 4 00:05:48 2007 +++ llvm/lib/Bitcode/Writer/ValueEnumerator.cpp Fri May 4 00:21:47 2007 @@ -24,6 +24,10 @@ return P.first->isFirstClassType(); } +static bool isIntegerValue(const std::pair &V) { + return isa(V.first->getType()); +} + static bool CompareByFrequency(const std::pair &P1, const std::pairglobal_begin(), E = M->global_end(); I != E; ++I) @@ -83,6 +90,9 @@ } } + // Optimize constant ordering. + OptimizeConstants(FirstConstant, Values.size()); + // Sort the type table by frequency so that most commonly used types are early // in the table (have low bit-width). std::stable_sort(Types.begin(), Types.end(), CompareByFrequency); @@ -95,15 +105,43 @@ // Now that we rearranged the type table, rebuild TypeMap. for (unsigned i = 0, e = Types.size(); i != e; ++i) TypeMap[Types[i].first] = i+1; - - // FIXME: Emit a marker into the module indicating which aggregates types can - // be dropped form the table. // FIXME: Sort value tables by frequency. - - // FIXME: Sort constants by type to reduce size. } +// Optimize constant ordering. +struct CstSortPredicate { + ValueEnumerator &VE; + CstSortPredicate(ValueEnumerator &ve) : VE(ve) {} + bool operator()(const std::pair &LHS, + const std::pair &RHS) { + // Sort by plane. + if (LHS.first->getType() != RHS.first->getType()) + return VE.getTypeID(LHS.first->getType()) < + VE.getTypeID(RHS.first->getType()); + // Then by frequency. + return LHS.second > RHS.second; + } +}; + +/// OptimizeConstants - Reorder constant pool for denser encoding. +void ValueEnumerator::OptimizeConstants(unsigned CstStart, unsigned CstEnd) { + if (CstStart == CstEnd || CstStart+1 == CstEnd) return; + + CstSortPredicate P(*this); + std::stable_sort(Values.begin()+CstStart, Values.begin()+CstEnd, P); + + // Ensure that integer constants are at the start of the constant pool. This + // is important so that GEP structure indices come before gep constant exprs. + std::partition(Values.begin()+CstStart, Values.begin()+CstEnd, + isIntegerValue); + + // Rebuild the modified portion of ValueMap. + for (; CstStart != CstEnd; ++CstStart) + ValueMap[Values[CstStart].first] = CstStart+1; +} + + /// EnumerateTypeSymbolTable - Insert all of the types in the specified symbol /// table. void ValueEnumerator::EnumerateTypeSymbolTable(const TypeSymbolTable &TST) { @@ -225,6 +263,9 @@ ValueMap[BB] = BasicBlocks.size(); } + // Optimize the constant layout. + OptimizeConstants(FirstFuncConstantID, Values.size()); + FirstInstID = Values.size(); // Add all of the instructions. Index: llvm/lib/Bitcode/Writer/ValueEnumerator.h diff -u llvm/lib/Bitcode/Writer/ValueEnumerator.h:1.9 llvm/lib/Bitcode/Writer/ValueEnumerator.h:1.10 --- llvm/lib/Bitcode/Writer/ValueEnumerator.h:1.9 Thu May 3 19:45:24 2007 +++ llvm/lib/Bitcode/Writer/ValueEnumerator.h Fri May 4 00:21:47 2007 @@ -110,6 +110,8 @@ void purgeFunction(); private: + void OptimizeConstants(unsigned CstStart, unsigned CstEnd); + void EnumerateValue(const Value *V); void EnumerateType(const Type *T); void EnumerateParamAttrs(const ParamAttrsList *PAL); From djg at cray.com Fri May 4 09:59:27 2007 From: djg at cray.com (Dan Gohman) Date: Fri, 4 May 2007 09:59:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <200705041459.l44ExRsT003234@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopStrengthReduce.cpp updated: 1.135 -> 1.136 --- Log message: Use IntrinsicInst to test for prefetch instructions, which is ever so slightly nicer than using CallInst with an extra check; thanks Chris. --- Diffs of the changes: (+5 -6) LoopStrengthReduce.cpp | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.135 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.136 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.135 Thu May 3 18:20:33 2007 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Fri May 4 09:59:09 2007 @@ -19,7 +19,7 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Constants.h" #include "llvm/Instructions.h" -#include "llvm/Intrinsics.h" +#include "llvm/IntrinsicInst.h" #include "llvm/Type.h" #include "llvm/DerivedTypes.h" #include "llvm/Analysis/Dominators.h" @@ -1043,12 +1043,11 @@ if (StoreInst *SI = dyn_cast(UsersToProcess[i].Inst)) { if (SI->getOperand(1) == UsersToProcess[i].OperandValToReplace) isAddress = true; - } else if (CallInst *CI = dyn_cast(UsersToProcess[i].Inst)) { + } else if (IntrinsicInst *II = + dyn_cast(UsersToProcess[i].Inst)) { // Addressing modes can also be folded into prefetches. - Function *CalledFunc = CI->getCalledFunction(); - if (CalledFunc != NULL && - CalledFunc->getIntrinsicID() == Intrinsic::prefetch && - CI->getOperand(1) == UsersToProcess[i].OperandValToReplace) + if (II->getIntrinsicID() == Intrinsic::prefetch && + II->getOperand(1) == UsersToProcess[i].OperandValToReplace) isAddress = true; } From evan.cheng at apple.com Fri May 4 11:42:47 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 4 May 2007 11:42:47 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Applications/kimwitu++/k.h Message-ID: <200705041642.l44GglVr011586@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Applications/kimwitu++: k.h updated: 1.1 -> 1.2 --- Log message: Fix test. --- Diffs of the changes: (+2 -2) k.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-test/MultiSource/Applications/kimwitu++/k.h diff -u llvm-test/MultiSource/Applications/kimwitu++/k.h:1.1 llvm-test/MultiSource/Applications/kimwitu++/k.h:1.2 --- llvm-test/MultiSource/Applications/kimwitu++/k.h:1.1 Tue Apr 6 15:25:12 2004 +++ llvm-test/MultiSource/Applications/kimwitu++/k.h Fri May 4 11:42:29 2007 @@ -11,7 +11,7 @@ "pat.k" */ /* generated by: - * @(#)$Author: criswell $ + * @(#)$Author: evancheng $ */ #ifndef KC_TYPES_HEADER #define KC_TYPES_HEADER @@ -37,10 +37,10 @@ typedef unsigned short kc_wchar_t; typedef std::string kc_cstring_t; -typedef std::wstring kc_wstring_t; #ifdef KC_UNICODE #define kc_t(TEXT) L ## TEXT +typedef std::wstring kc_wstring_t; typedef kc_wchar_t kc_char; typedef kc_wstring_t kc_string_t; From baldrick at free.fr Fri May 4 12:12:53 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 4 May 2007 12:12:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200705041712.l44HCrLo013702@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.446 -> 1.447 --- Log message: A bitcast of a global variable may have been constant folded to a GEP - handle this case too. --- Diffs of the changes: (+30 -26) SelectionDAGISel.cpp | 56 +++++++++++++++++++++++++++------------------------ 1 files changed, 30 insertions(+), 26 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.446 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.447 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.446 Wed May 2 20:11:53 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri May 4 12:12:26 2007 @@ -2457,6 +2457,24 @@ } } +/// ExtractGlobalVariable - If C is a global variable, or a bitcast of one +/// (possibly constant folded), return it. Otherwise return NULL. +static GlobalVariable *ExtractGlobalVariable (Constant *C) { + if (GlobalVariable *GV = dyn_cast(C)) + return GV; + else if (ConstantExpr *CE = dyn_cast(C)) { + if (CE->getOpcode() == Instruction::BitCast) + return dyn_cast(CE->getOperand(0)); + else if (CE->getOpcode() == Instruction::GetElementPtr) { + for (unsigned i = 1, e = CE->getNumOperands(); i != e; ++i) + if (!CE->getOperand(i)->isNullValue()) + return NULL; + return dyn_cast(CE->getOperand(0)); + } + } + return NULL; +} + /// visitIntrinsicCall - Lower the call to the specified intrinsic function. If /// we want to emit this as a call to a named external function, return the name /// otherwise lower it and return null. @@ -2610,20 +2628,12 @@ // MachineModuleInfo. std::vector TyInfo; for (unsigned i = 3, N = I.getNumOperands(); i < N; ++i) { - Constant *C = cast(I.getOperand(i)); - if (GlobalVariable *GV = dyn_cast(C)) { - TyInfo.push_back(GV); - } else if (ConstantExpr *CE = dyn_cast(C)) { - assert(CE->getOpcode() == Instruction::BitCast && - isa(CE->getOperand(0)) - && "TypeInfo must be a global variable or NULL"); - TyInfo.push_back(cast(CE->getOperand(0))); - } else { - ConstantInt *CI = dyn_cast(C); - assert(CI && CI->isNullValue() && - "TypeInfo must be a global variable or NULL"); - TyInfo.push_back(NULL); - } + Constant *C = cast(I.getOperand(i)); + GlobalVariable *GV = ExtractGlobalVariable(C); + assert (GV || (isa(C) && + cast(C)->isNullValue()) && + "TypeInfo must be a global variable or NULL"); + TyInfo.push_back(GV); } MMI->addCatchTypeInfo(CurMBB, TyInfo); @@ -2651,18 +2661,12 @@ if (MMI) { // Find the type id for the given typeinfo. - GlobalVariable *GV = NULL; - ConstantExpr *CE = dyn_cast(I.getOperand(1)); - if (CE && CE->getOpcode() == Instruction::BitCast && - isa(CE->getOperand(0))) { - GV = cast(CE->getOperand(0)); - } else { - ConstantInt *CI = dyn_cast(I.getOperand(1)); - assert(CI && CI->getZExtValue() == 0 && - "TypeInfo must be a global variable typeinfo or NULL"); - GV = NULL; - } - + Constant *C = cast(I.getOperand(1)); + GlobalVariable *GV = ExtractGlobalVariable(C); + assert (GV || (isa(C) && + cast(C)->isNullValue()) && + "TypeInfo must be a global variable or NULL"); + unsigned TypeID = MMI->getTypeIDFor(GV); setValue(&I, DAG.getConstant(TypeID, MVT::i32)); } else { From baldrick at free.fr Fri May 4 12:15:00 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 4 May 2007 12:15:00 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/2007-05-03-EHTypeInfo.ll Message-ID: <200705041715.l44HF0rs013857@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: 2007-05-03-EHTypeInfo.ll added (r1.1) --- Log message: Test that the eh lowering code can handle constant folded bitcasts. --- Diffs of the changes: (+12 -0) 2007-05-03-EHTypeInfo.ll | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/test/CodeGen/Generic/2007-05-03-EHTypeInfo.ll diff -c /dev/null llvm/test/CodeGen/Generic/2007-05-03-EHTypeInfo.ll:1.1 *** /dev/null Fri May 4 12:14:52 2007 --- llvm/test/CodeGen/Generic/2007-05-03-EHTypeInfo.ll Fri May 4 12:14:42 2007 *************** *** 0 **** --- 1,12 ---- + ; RUN: llvm-as < %s | llc -enable-eh + + %struct.exception = type { i8, i8, i32, i8*, i8*, i32, i8* } + @program_error = external global %struct.exception ; <%struct.exception*> [#uses=1] + + define void @typeinfo() { + entry: + %eh_typeid = tail call i32 @llvm.eh.typeid.for( i8* getelementptr (%struct.exception* @program_error, i32 0, i32 0) ) ; [#uses=0] + ret void + } + + declare i32 @llvm.eh.typeid.for(i8*) From sabre at nondot.org Fri May 4 12:35:37 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 12:35:37 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/BitCodes.h BitstreamReader.h BitstreamWriter.h Message-ID: <200705041735.l44HZb65015105@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: BitCodes.h updated: 1.2 -> 1.3 BitstreamReader.h updated: 1.11 -> 1.12 BitstreamWriter.h updated: 1.6 -> 1.7 --- Log message: refcount BitCodeAbbrev objects --- Diffs of the changes: (+13 -7) BitCodes.h | 12 +++++++++--- BitstreamReader.h | 6 +++--- BitstreamWriter.h | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) Index: llvm/include/llvm/Bitcode/BitCodes.h diff -u llvm/include/llvm/Bitcode/BitCodes.h:1.2 llvm/include/llvm/Bitcode/BitCodes.h:1.3 --- llvm/include/llvm/Bitcode/BitCodes.h:1.2 Mon Apr 23 11:04:05 2007 +++ llvm/include/llvm/Bitcode/BitCodes.h Fri May 4 12:35:19 2007 @@ -58,9 +58,9 @@ /// 2. It could be an encoding specification ("this operand encoded like so"). /// class BitCodeAbbrevOp { - uint64_t Val; // A literal value or data for an encoding. - bool IsLiteral : 1; // Indicate whether this is a literal value or not. - unsigned Enc : 3; // The encoding to use. + uint64_t Val; // A literal value or data for an encoding. + bool IsLiteral : 1; // Indicate whether this is a literal value or not. + unsigned Enc : 3; // The encoding to use. public: enum Encoding { FixedWidth = 1, // A fixed with field, Val specifies number of bits. @@ -89,8 +89,14 @@ class BitCodeAbbrev { SmallVector OperandList; + unsigned char RefCount; // Number of things using this. + ~BitCodeAbbrev() {} public: + BitCodeAbbrev() : RefCount(1) {} + void addRef() { ++RefCount; } + void dropRef() { if (--RefCount == 0) delete this; } + unsigned getNumOperandInfos() const { return OperandList.size(); } const BitCodeAbbrevOp &getOperandInfo(unsigned N) const { return OperandList[N]; Index: llvm/include/llvm/Bitcode/BitstreamReader.h diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.11 llvm/include/llvm/Bitcode/BitstreamReader.h:1.12 --- llvm/include/llvm/Bitcode/BitstreamReader.h:1.11 Tue May 1 00:51:32 2007 +++ llvm/include/llvm/Bitcode/BitstreamReader.h Fri May 4 12:35:19 2007 @@ -75,12 +75,12 @@ // Abbrevs could still exist if the stream was broken. If so, don't leak // them. for (unsigned i = 0, e = CurAbbrevs.size(); i != e; ++i) - delete CurAbbrevs[i]; + CurAbbrevs[i]->dropRef(); for (unsigned S = 0, e = BlockScope.size(); S != e; ++S) { std::vector &Abbrevs = BlockScope[S].PrevAbbrevs; for (unsigned i = 0, e = Abbrevs.size(); i != e; ++i) - delete Abbrevs[i]; + Abbrevs[i]->dropRef(); } } @@ -263,7 +263,7 @@ // Delete abbrevs from popped scope. for (unsigned i = 0, e = CurAbbrevs.size(); i != e; ++i) - delete CurAbbrevs[i]; + CurAbbrevs[i]->dropRef(); BlockScope.back().PrevAbbrevs.swap(CurAbbrevs); BlockScope.pop_back(); Index: llvm/include/llvm/Bitcode/BitstreamWriter.h diff -u llvm/include/llvm/Bitcode/BitstreamWriter.h:1.6 llvm/include/llvm/Bitcode/BitstreamWriter.h:1.7 --- llvm/include/llvm/Bitcode/BitstreamWriter.h:1.6 Mon Apr 23 15:34:46 2007 +++ llvm/include/llvm/Bitcode/BitstreamWriter.h Fri May 4 12:35:19 2007 @@ -160,7 +160,7 @@ // Delete all abbrevs. for (unsigned i = 0, e = CurAbbrevs.size(); i != e; ++i) - delete CurAbbrevs[i]; + CurAbbrevs[i]->dropRef(); const Block &B = BlockScope.back(); From sabre at nondot.org Fri May 4 13:26:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 13:26:07 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/BitCodes.h BitstreamReader.h BitstreamWriter.h LLVMBitCodes.h Message-ID: <200705041826.l44IQ7dk018463@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: BitCodes.h updated: 1.3 -> 1.4 BitstreamReader.h updated: 1.12 -> 1.13 BitstreamWriter.h updated: 1.7 -> 1.8 LLVMBitCodes.h updated: 1.14 -> 1.15 --- Log message: minor cleanups. Add provisions for a new standard BLOCKINFO_BLOCK block type. --- Diffs of the changes: (+41 -17) BitCodes.h | 32 ++++++++++++++++++++++++++++---- BitstreamReader.h | 2 +- BitstreamWriter.h | 6 +++--- LLVMBitCodes.h | 18 +++++++++--------- 4 files changed, 41 insertions(+), 17 deletions(-) Index: llvm/include/llvm/Bitcode/BitCodes.h diff -u llvm/include/llvm/Bitcode/BitCodes.h:1.3 llvm/include/llvm/Bitcode/BitCodes.h:1.4 --- llvm/include/llvm/Bitcode/BitCodes.h:1.3 Fri May 4 12:35:19 2007 +++ llvm/include/llvm/Bitcode/BitCodes.h Fri May 4 13:25:49 2007 @@ -30,9 +30,9 @@ BlockSizeWidth = 32 // BlockSize up to 2^32 32-bit words = 32GB per block. }; - // The standard code namespace always has a way to exit a block, enter a + // The standard abbrev namespace always has a way to exit a block, enter a // nested block, define abbrevs, and define an unabbreviated record. - enum FixedCodes { + enum FixedAbbrevIDs { END_BLOCK = 0, // Must be zero to guarantee termination for broken bitcode. ENTER_SUBBLOCK = 1, @@ -48,8 +48,29 @@ UNABBREV_RECORD = 3, // This is not a code, this is a marker for the first abbrev assignment. - FIRST_ABBREV = 4 + FIRST_APPLICATION_ABBREV = 4 }; + + /// StandardBlockIDs - All bitcode files can optionally include a BLOCKINFO + /// block, which contains metadata about other blocks in the file. + enum StandardBlockIDs { + /// BLOCKINFO_BLOCK is used to define metadata about blocks, for example, + /// standard abbrevs that should be available to all blocks of a specified + /// ID. + BLOCKINFO_BLOCK_ID = 0, + + // Block IDs 1-7 are reserved for future expansion. + FIRST_APPLICATION_BLOCKID = 8 + }; + + /// BlockInfoCodes - The blockinfo block contains metadata about user-defined + /// blocks. + enum BlockInfoCodes { + BLOCKINFO_CODE_SETBID = 1, // SETBID: [blockid#] + BLOCKINFO_CODE_ABBREV = 2 // ABBREV: [standard abbrev encoding] + // BLOCKNAME: give string name to block, if desired. + }; + } // End bitc namespace /// BitCodeAbbrevOp - This describes one or more operands in an abbreviation. @@ -63,7 +84,7 @@ unsigned Enc : 3; // The encoding to use. public: enum Encoding { - FixedWidth = 1, // A fixed with field, Val specifies number of bits. + FixedWidth = 1, // A fixed with field, Val specifies number of bits. VBR = 2 // A VBR field where Val specifies the width of each chunk. }; @@ -87,6 +108,9 @@ } }; +/// BitCodeAbbrev - This class represents an abbreviation record. An +/// abbreviation allows a complex record that has redundancy to be stored in a +/// specialized format instead of the fully-general, fully-vbr, format. class BitCodeAbbrev { SmallVector OperandList; unsigned char RefCount; // Number of things using this. Index: llvm/include/llvm/Bitcode/BitstreamReader.h diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.12 llvm/include/llvm/Bitcode/BitstreamReader.h:1.13 --- llvm/include/llvm/Bitcode/BitstreamReader.h:1.12 Fri May 4 12:35:19 2007 +++ llvm/include/llvm/Bitcode/BitstreamReader.h Fri May 4 13:25:49 2007 @@ -283,7 +283,7 @@ return Code; } - unsigned AbbrevNo = AbbrevID-bitc::FIRST_ABBREV; + unsigned AbbrevNo = AbbrevID-bitc::FIRST_APPLICATION_ABBREV; assert(AbbrevNo < CurAbbrevs.size() && "Invalid abbrev #!"); BitCodeAbbrev *Abbv = CurAbbrevs[AbbrevNo]; Index: llvm/include/llvm/Bitcode/BitstreamWriter.h diff -u llvm/include/llvm/Bitcode/BitstreamWriter.h:1.7 llvm/include/llvm/Bitcode/BitstreamWriter.h:1.8 --- llvm/include/llvm/Bitcode/BitstreamWriter.h:1.7 Fri May 4 12:35:19 2007 +++ llvm/include/llvm/Bitcode/BitstreamWriter.h Fri May 4 13:25:49 2007 @@ -194,7 +194,7 @@ void EmitRecord(unsigned Code, SmallVectorImpl &Vals, unsigned Abbrev = 0) { if (Abbrev) { - unsigned AbbrevNo = Abbrev-bitc::FIRST_ABBREV; + unsigned AbbrevNo = Abbrev-bitc::FIRST_APPLICATION_ABBREV; assert(AbbrevNo < CurAbbrevs.size() && "Invalid abbrev #!"); BitCodeAbbrev *Abbv = CurAbbrevs[AbbrevNo]; @@ -247,7 +247,7 @@ void EmitRecord(unsigned Code, SmallVectorImpl &Vals, unsigned Abbrev = 0) { if (Abbrev) { - unsigned AbbrevNo = Abbrev-bitc::FIRST_ABBREV; + unsigned AbbrevNo = Abbrev-bitc::FIRST_APPLICATION_ABBREV; assert(AbbrevNo < CurAbbrevs.size() && "Invalid abbrev #!"); BitCodeAbbrev *Abbv = CurAbbrevs[AbbrevNo]; @@ -318,7 +318,7 @@ } CurAbbrevs.push_back(Abbv); - return CurAbbrevs.size()-1+bitc::FIRST_ABBREV; + return CurAbbrevs.size()-1+bitc::FIRST_APPLICATION_ABBREV; } }; Index: llvm/include/llvm/Bitcode/LLVMBitCodes.h diff -u llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.14 llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.15 --- llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.14 Thu May 3 22:01:46 2007 +++ llvm/include/llvm/Bitcode/LLVMBitCodes.h Fri May 4 13:25:49 2007 @@ -25,15 +25,15 @@ // The only top-level block type defined is for a module. enum BlockIDs { // Blocks - MODULE_BLOCK_ID = 0, + MODULE_BLOCK_ID = FIRST_APPLICATION_BLOCKID, - // Module sub-block id's - PARAMATTR_BLOCK_ID = 1, - TYPE_BLOCK_ID = 2, - CONSTANTS_BLOCK_ID = 3, - FUNCTION_BLOCK_ID = 4, - TYPE_SYMTAB_BLOCK_ID = 5, - VALUE_SYMTAB_BLOCK_ID = 6 + // Module sub-block id's. + PARAMATTR_BLOCK_ID, + TYPE_BLOCK_ID, + CONSTANTS_BLOCK_ID, + FUNCTION_BLOCK_ID, + TYPE_SYMTAB_BLOCK_ID, + VALUE_SYMTAB_BLOCK_ID }; @@ -68,7 +68,7 @@ /// TYPE blocks have codes for each type primitive they use. enum TypeCodes { - TYPE_CODE_NUMENTRY = 1, // TYPE_CODE_NUMENTRY: [numentries] + TYPE_CODE_NUMENTRY = 1, // NUMENTRY: [numentries] // Type Codes TYPE_CODE_VOID = 2, // VOID From sabre at nondot.org Fri May 4 13:26:45 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 13:26:45 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705041826.l44IQjhq018554@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.29 -> 1.30 --- Log message: stub out creation of BLOCKINFO_BLOCK --- Diffs of the changes: (+25 -0) BitcodeWriter.cpp | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.29 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.30 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.29 Thu May 3 22:52:24 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Fri May 4 13:26:27 2007 @@ -858,6 +858,28 @@ Stream.ExitBlock(); } +// Emit blockinfo, which defines the standard abbreviations etc. +static void WriteBlockInfo(BitstreamWriter &Stream) { + // We only want to emit block info records for blocks that have multiple + // instances: CONSTANTS_BLOCK, FUNCTION_BLOCK and VALUE_SYMTAB_BLOCK. Other + // blocks can defined their abbrevs inline. + Stream.EnterSubblock(bitc::BLOCKINFO_BLOCK_ID, 2); + +#if 0 + // Configure TYPE_SYMTAB_BLOCK's. + + // Add an abbrev for VST_ENTRY where the characters each fit in 7 bits. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8); // Value ID + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::FixedWidth, 3)); // Linkage. + + xxx = Stream.EmitAbbrev(Abbv); +#endif + Stream.ExitBlock(); +} + + /// WriteBitcodeToFile - Write the specified module to the specified output /// stream. void llvm::WriteBitcodeToFile(const Module *M, std::ostream &Out) { @@ -874,6 +896,9 @@ Stream.Emit(0xE, 4); Stream.Emit(0xD, 4); + // Emit blockinfo, which defines the standard abbreviations etc. + WriteBlockInfo(Stream); + // Emit the module. WriteModule(M, Stream); From dpatel at apple.com Fri May 4 13:42:00 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Fri, 4 May 2007 11:42:00 -0700 (PDT) Subject: [llvm-commits] [126896] Fix PR 1250. Message-ID: <20070504184200.9931B102CFA7@src> Revision: 126896 Author: dpatel Date: 2007-05-04 11:42:00 -0700 (Fri, 04 May 2007) Log Message: ----------- Fix PR 1250. Apply Duncan's patch. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-types.cpp Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-05-04 16:16:23 UTC (rev 126895) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-05-04 18:42:00 UTC (rev 126896) @@ -473,16 +473,17 @@ } case ENUMERAL_TYPE: // Use of an enum that is implicitly declared? - if (TYPE_SIZE(type) == 0) { + if (TYPE_SIZE(orig_type) == 0) { // If we already compiled this type, use the old type. - if (const Type *Ty = GET_TYPE_LLVM(type)) + if (const Type *Ty = GET_TYPE_LLVM(orig_type)) return Ty; const Type *Ty = OpaqueType::get(); TheModule->addTypeName(GetTypeName("enum.", orig_type), Ty); - return TypeDB.setType(type, Ty); + return TypeDB.setType(orig_type, Ty); } // FALL THROUGH. + type = orig_type; case INTEGER_TYPE: if (const Type *Ty = GET_TYPE_LLVM(type)) return Ty; From evan.cheng at apple.com Fri May 4 13:43:54 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 4 May 2007 13:43:54 -0500 Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2000/253.perlbmk/Makefile Message-ID: <200705041843.l44IhsBY019219@zion.cs.uiuc.edu> Changes in directory llvm-test/External/SPEC/CINT2000/253.perlbmk: Makefile updated: 1.12 -> 1.13 --- Log message: Fix Makefile. --- Diffs of the changes: (+12 -0) Makefile | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm-test/External/SPEC/CINT2000/253.perlbmk/Makefile diff -u llvm-test/External/SPEC/CINT2000/253.perlbmk/Makefile:1.12 llvm-test/External/SPEC/CINT2000/253.perlbmk/Makefile:1.13 --- llvm-test/External/SPEC/CINT2000/253.perlbmk/Makefile:1.12 Tue Nov 28 18:47:17 2006 +++ llvm-test/External/SPEC/CINT2000/253.perlbmk/Makefile Fri May 4 13:43:35 2007 @@ -8,8 +8,20 @@ CPPFLAGS += -DSPEC_CPU2000_LINUX_I386 -DSPEC_CPU2000_NEED_BOOL +# Not sure why this is needed. +ifdef SMALL_PROBLEM_SIZE +RUN_TYPE=test +else +ifdef LARGE_PROBLEM_SIZE +RUN_TYPE=ref +else +RUN_TYPE=train +endif +endif + ifeq ($(RUN_TYPE),test) RUN_OPTIONS = test.pl +STDIN_FILENAME := test.in STDOUT_FILENAME := test.out else RUN_OPTIONS = scrabbl.pl From sabre at nondot.org Fri May 4 14:11:06 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 14:11:06 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/LLVMBitCodes.h Message-ID: <200705041911.l44JB65f019857@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: LLVMBitCodes.h updated: 1.15 -> 1.16 --- Log message: eliminate lengths from record bodies --- Diffs of the changes: (+16 -16) LLVMBitCodes.h | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) Index: llvm/include/llvm/Bitcode/LLVMBitCodes.h diff -u llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.15 llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.16 --- llvm/include/llvm/Bitcode/LLVMBitCodes.h:1.15 Fri May 4 13:25:49 2007 +++ llvm/include/llvm/Bitcode/LLVMBitCodes.h Fri May 4 14:10:48 2007 @@ -40,11 +40,11 @@ /// MODULE blocks have a number of optional fields and subblocks. enum ModuleCodes { MODULE_CODE_VERSION = 1, // VERSION: [version#] - MODULE_CODE_TRIPLE = 2, // TRIPLE: [strlen, strchr x N] - MODULE_CODE_DATALAYOUT = 3, // DATALAYOUT: [strlen, strchr x N] - MODULE_CODE_ASM = 4, // ASM: [strlen, strchr x N] - MODULE_CODE_SECTIONNAME = 5, // SECTIONNAME: [strlen, strchr x N] - MODULE_CODE_DEPLIB = 6, // DEPLIB: [strlen, strchr x N] + MODULE_CODE_TRIPLE = 2, // TRIPLE: [strchr x N] + MODULE_CODE_DATALAYOUT = 3, // DATALAYOUT: [strchr x N] + MODULE_CODE_ASM = 4, // ASM: [strchr x N] + MODULE_CODE_SECTIONNAME = 5, // SECTIONNAME: [strchr x N] + MODULE_CODE_DEPLIB = 6, // DEPLIB: [strchr x N] // GLOBALVAR: [type, isconst, initid, // linkage, alignment, section, visibility, threadlocal] @@ -78,8 +78,8 @@ TYPE_CODE_OPAQUE = 6, // OPAQUE TYPE_CODE_INTEGER = 7, // INTEGER: [width] TYPE_CODE_POINTER = 8, // POINTER: [pointee type] - TYPE_CODE_FUNCTION = 9, // FUNCTION: [vararg, retty, #pararms, paramty N] - TYPE_CODE_STRUCT = 10, // STRUCT: [ispacked, #elts, eltty x N] + TYPE_CODE_FUNCTION = 9, // FUNCTION: [vararg, retty, paramty x N] + TYPE_CODE_STRUCT = 10, // STRUCT: [ispacked, eltty x N] TYPE_CODE_ARRAY = 11, // ARRAY: [numelts, eltty] TYPE_CODE_VECTOR = 12 // VECTOR: [numelts, eltty] // Any other type code is assumed to be an unknown type. @@ -87,13 +87,13 @@ // The type symbol table only has one code (TST_ENTRY_CODE). enum TypeSymtabCodes { - TST_CODE_ENTRY = 1 // TST_ENTRY: [typeid, namelen, namechar x N] + TST_CODE_ENTRY = 1 // TST_ENTRY: [typeid, namechar x N] }; // The value symbol table only has one code (VST_ENTRY_CODE). enum ValueSymtabCodes { - VST_CODE_ENTRY = 1, // VST_ENTRY: [valid, namelen, namechar x N] - VST_CODE_BBENTRY = 2 // VST_BBENTRY: [bbid, namelen, namechar x N] + VST_CODE_ENTRY = 1, // VST_ENTRY: [valid, namechar x N] + VST_CODE_BBENTRY = 2 // VST_BBENTRY: [bbid, namechar x N] }; // The constants block (CONSTANTS_BLOCK_ID) describes emission for each @@ -103,12 +103,12 @@ CST_CODE_NULL = 2, // NULL CST_CODE_UNDEF = 3, // UNDEF CST_CODE_INTEGER = 4, // INTEGER: [intval] - CST_CODE_WIDE_INTEGER = 5, // WIDE_INTEGER: [n, n x intval] + CST_CODE_WIDE_INTEGER = 5, // WIDE_INTEGER: [n x intval] CST_CODE_FLOAT = 6, // FLOAT: [fpval] - CST_CODE_AGGREGATE = 7, // AGGREGATE: [n, n x value number] + CST_CODE_AGGREGATE = 7, // AGGREGATE: [n x value number] CST_CODE_CE_BINOP = 8, // CE_BINOP: [opcode, opval, opval] CST_CODE_CE_CAST = 9, // CE_CAST: [opcode, opty, opval] - CST_CODE_CE_GEP = 10, // CE_GEP: [n, n x operands] + CST_CODE_CE_GEP = 10, // CE_GEP: [n x operands] CST_CODE_CE_SELECT = 11, // CE_SELECT: [opval, opval, opval] CST_CODE_CE_EXTRACTELT = 12, // CE_EXTRACTELT: [opty, opval, opval] CST_CODE_CE_INSERTELT = 13, // CE_INSERTELT: [opval, opval, opval] @@ -163,21 +163,21 @@ FUNC_CODE_INST_BINOP = 2, // BINOP: [opcode, ty, opval, opval] FUNC_CODE_INST_CAST = 3, // CAST: [opcode, ty, opty, opval] - FUNC_CODE_INST_GEP = 4, // GEP: [n, n x operands] + FUNC_CODE_INST_GEP = 4, // GEP: [n x operands] FUNC_CODE_INST_SELECT = 5, // SELECT: [ty, opval, opval, opval] FUNC_CODE_INST_EXTRACTELT = 6, // EXTRACTELT: [opty, opval, opval] FUNC_CODE_INST_INSERTELT = 7, // INSERTELT: [ty, opval, opval, opval] FUNC_CODE_INST_SHUFFLEVEC = 8, // SHUFFLEVEC: [ty, opval, opval, opval] FUNC_CODE_INST_CMP = 9, // CMP: [opty, opval, opval, pred] - FUNC_CODE_INST_RET = 10, // RET: [opty,opval] + FUNC_CODE_INST_RET = 10, // RET: [opty,opval] FUNC_CODE_INST_BR = 11, // BR: [bb#, bb#, cond] or [bb#] FUNC_CODE_INST_SWITCH = 12, // SWITCH: [opty, opval, n, n x ops] FUNC_CODE_INST_INVOKE = 13, // INVOKE: [fnty, op0,op1,op2, ...] FUNC_CODE_INST_UNWIND = 14, // UNWIND FUNC_CODE_INST_UNREACHABLE = 15, // UNREACHABLE - FUNC_CODE_INST_PHI = 16, // PHI: [ty, #ops, val0,bb0, ...] + FUNC_CODE_INST_PHI = 16, // PHI: [ty, val0,bb0, ...] FUNC_CODE_INST_MALLOC = 17, // MALLOC: [instty, op, align] FUNC_CODE_INST_FREE = 18, // FREE: [opty, op] FUNC_CODE_INST_ALLOCA = 19, // ALLOCA: [instty, op, align] From sabre at nondot.org Fri May 4 14:12:04 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 14:12:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705041912.l44JC4Zs019908@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.30 -> 1.31 --- Log message: eliminate internal length fields from record. Records already know their total length --- Diffs of the changes: (+12 -11) BitcodeWriter.cpp | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.30 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.31 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.30 Fri May 4 13:26:27 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Fri May 4 14:11:41 2007 @@ -72,8 +72,7 @@ unsigned AbbrevToUse, BitstreamWriter &Stream) { SmallVector Vals; - // Code: [strlen, strchar x N] - Vals.push_back(Str.size()); + // Code: [strchar x N] for (unsigned i = 0, e = Str.size(); i != e; ++i) Vals.push_back(Str[i]); @@ -150,7 +149,6 @@ TypeVals.push_back(FT->isVarArg()); TypeVals.push_back(VE.getParamAttrID(FT->getParamAttrs())); TypeVals.push_back(VE.getTypeID(FT->getReturnType())); - TypeVals.push_back(FT->getNumParams()); for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i) TypeVals.push_back(VE.getTypeID(FT->getParamType(i))); break; @@ -160,8 +158,7 @@ // STRUCT: [ispacked, #elts, eltty x N] Code = bitc::TYPE_CODE_STRUCT; TypeVals.push_back(ST->isPacked()); - TypeVals.push_back(ST->getNumElements()); - // Output all of the element types... + // Output all of the element types. for (StructType::element_iterator I = ST->element_begin(), E = ST->element_end(); I != E; ++I) TypeVals.push_back(VE.getTypeID(*I)); @@ -399,7 +396,6 @@ // So, we only write the number of active words. unsigned NWords = IV->getValue().getActiveWords(); const uint64_t *RawWords = IV->getValue().getRawData(); - Record.push_back(NWords); for (unsigned i = 0; i != NWords; ++i) { int64_t V = RawWords[i]; if (V >= 0) @@ -420,7 +416,6 @@ } else if (isa(C) || isa(V) || isa(V)) { Code = bitc::CST_CODE_AGGREGATE; - Record.push_back(C->getNumOperands()); for (unsigned i = 0, e = C->getNumOperands(); i != e; ++i) Record.push_back(VE.getValueID(C->getOperand(i))); } else if (const ConstantExpr *CE = dyn_cast(C)) { @@ -441,7 +436,6 @@ break; case Instruction::GetElementPtr: Code = bitc::CST_CODE_CE_GEP; - Record.push_back(CE->getNumOperands()); for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) { Record.push_back(VE.getTypeID(C->getOperand(i)->getType())); Record.push_back(VE.getValueID(C->getOperand(i))); @@ -627,7 +621,6 @@ case Instruction::PHI: Code = bitc::FUNC_CODE_INST_PHI; Vals.push_back(VE.getTypeID(I.getType())); - Vals.push_back(I.getNumOperands()); for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) Vals.push_back(VE.getValueID(I.getOperand(i))); break; @@ -710,6 +703,16 @@ if (VST.empty()) return; Stream.EnterSubblock(bitc::VALUE_SYMTAB_BLOCK_ID, 3); +#if 0 + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::VST_ENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::FixedWidth, + Log2_32_Ceil(MaxGlobalType+1))); + // Don't bother emitting vis + thread local. + SimpleGVarAbbrev = Stream.EmitAbbrev(Abbv); +#endif + + // FIXME: Set up the abbrev, we know how many values there are! // FIXME: We know if the type names can use 7-bit ascii. SmallVector NameVals; @@ -728,7 +731,6 @@ } NameVals.push_back(VE.getValueID(SI->getValue())); - NameVals.push_back(SI->getKeyLength()); for (const char *P = SI->getKeyData(), *E = SI->getKeyData()+SI->getKeyLength(); P != E; ++P) NameVals.push_back((unsigned char)*P); @@ -794,7 +796,6 @@ NameVals.push_back(VE.getTypeID(TI->second)); const std::string &Str = TI->first; - NameVals.push_back(Str.size()); for (unsigned i = 0, e = Str.size(); i != e; ++i) NameVals.push_back(Str[i]); From sabre at nondot.org Fri May 4 14:12:04 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 14:12:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705041912.l44JC4hO019905@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.36 -> 1.37 --- Log message: eliminate internal length fields from record. Records already know their total length --- Diffs of the changes: (+36 -37) BitcodeReader.cpp | 73 ++++++++++++++++++++++++++---------------------------- 1 files changed, 36 insertions(+), 37 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.36 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.37 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.36 Thu May 3 22:57:30 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Fri May 4 14:11:41 2007 @@ -36,11 +36,11 @@ template static bool ConvertToString(SmallVector &Record, unsigned Idx, StrTy &Result) { - if (Record.size() < Idx+1 || Record.size() < Record[Idx]+Idx+1) + if (Idx > Record.size()) return true; - for (unsigned i = 0, e = Record[Idx]; i != e; ++i) - Result += (char)Record[Idx+i+1]; + for (unsigned i = Idx, e = Record.size(); i != e; ++i) + Result += (char)Record[i]; return false; } @@ -313,23 +313,23 @@ ResultTy = PointerType::get(getTypeByID(Record[0], true)); break; case bitc::TYPE_CODE_FUNCTION: { - // FUNCTION: [vararg, attrid, retty, #pararms, paramty N] - if (Record.size() < 4 || Record.size() < Record[3]+4) + // FUNCTION: [vararg, attrid, retty, paramty x N] + if (Record.size() < 3) return Error("Invalid FUNCTION type record"); std::vector ArgTys; - for (unsigned i = 0, e = Record[3]; i != e; ++i) - ArgTys.push_back(getTypeByID(Record[4+i], true)); + for (unsigned i = 3, e = Record.size(); i != e; ++i) + ArgTys.push_back(getTypeByID(Record[i], true)); ResultTy = FunctionType::get(getTypeByID(Record[2], true), ArgTys, Record[0], getParamAttrs(Record[1])); break; } - case bitc::TYPE_CODE_STRUCT: { // STRUCT: [ispacked, #elts, eltty x N] - if (Record.size() < 2 || Record.size() < Record[1]+2) + case bitc::TYPE_CODE_STRUCT: { // STRUCT: [ispacked, eltty x N] + if (Record.size() < 2) return Error("Invalid STRUCT type record"); std::vector EltTys; - for (unsigned i = 0, e = Record[1]; i != e; ++i) - EltTys.push_back(getTypeByID(Record[2+i], true)); + for (unsigned i = 1, e = Record.size(); i != e; ++i) + EltTys.push_back(getTypeByID(Record[i], true)); ResultTy = StructType::get(EltTys, Record[0]); break; } @@ -411,7 +411,7 @@ switch (Stream.ReadRecord(Code, Record)) { default: // Default behavior: unknown type. break; - case bitc::TST_CODE_ENTRY: // TST_ENTRY: [typeid, namelen, namechar x N] + case bitc::TST_CODE_ENTRY: // TST_ENTRY: [typeid, namechar x N] if (ConvertToString(Record, 1, TypeName)) return Error("Invalid TST_ENTRY record"); unsigned TypeID = Record[0]; @@ -458,7 +458,7 @@ switch (Stream.ReadRecord(Code, Record)) { default: // Default behavior: unknown type. break; - case bitc::VST_CODE_ENTRY: { // VST_ENTRY: [valueid, namelen, namechar x N] + case bitc::VST_CODE_ENTRY: { // VST_ENTRY: [valueid, namechar x N] if (ConvertToString(Record, 1, ValueName)) return Error("Invalid TST_ENTRY record"); unsigned ValueID = Record[0]; @@ -591,16 +591,15 @@ return Error("Invalid CST_INTEGER record"); V = ConstantInt::get(CurTy, DecodeSignRotatedValue(Record[0])); break; - case bitc::CST_CODE_WIDE_INTEGER: {// WIDE_INTEGER: [n, n x intval] - if (!isa(CurTy) || Record.empty() || - Record.size() < Record[0]+1) + case bitc::CST_CODE_WIDE_INTEGER: {// WIDE_INTEGER: [n x intval] + if (!isa(CurTy) || Record.empty()) return Error("Invalid WIDE_INTEGER record"); - unsigned NumWords = Record[0]; + unsigned NumWords = Record.size(); SmallVector Words; Words.resize(NumWords); for (unsigned i = 0; i != NumWords; ++i) - Words[i] = DecodeSignRotatedValue(Record[i+1]); + Words[i] = DecodeSignRotatedValue(Record[i]); V = ConstantInt::get(APInt(cast(CurTy)->getBitWidth(), NumWords, &Words[0])); break; @@ -616,27 +615,27 @@ V = UndefValue::get(CurTy); break; - case bitc::CST_CODE_AGGREGATE: {// AGGREGATE: [n, n x value number] - if (Record.empty() || Record.size() < Record[0]+1) + case bitc::CST_CODE_AGGREGATE: {// AGGREGATE: [n x value number] + if (Record.empty()) return Error("Invalid CST_AGGREGATE record"); - unsigned Size = Record[0]; + unsigned Size = Record.size(); std::vector Elts; if (const StructType *STy = dyn_cast(CurTy)) { for (unsigned i = 0; i != Size; ++i) - Elts.push_back(ValueList.getConstantFwdRef(Record[i+1], + Elts.push_back(ValueList.getConstantFwdRef(Record[i], STy->getElementType(i))); V = ConstantStruct::get(STy, Elts); } else if (const ArrayType *ATy = dyn_cast(CurTy)) { const Type *EltTy = ATy->getElementType(); for (unsigned i = 0; i != Size; ++i) - Elts.push_back(ValueList.getConstantFwdRef(Record[i+1], EltTy)); + Elts.push_back(ValueList.getConstantFwdRef(Record[i], EltTy)); V = ConstantArray::get(ATy, Elts); } else if (const VectorType *VTy = dyn_cast(CurTy)) { const Type *EltTy = VTy->getElementType(); for (unsigned i = 0; i != Size; ++i) - Elts.push_back(ValueList.getConstantFwdRef(Record[i+1], EltTy)); + Elts.push_back(ValueList.getConstantFwdRef(Record[i], EltTy)); V = ConstantVector::get(Elts); } else { V = UndefValue::get(CurTy); @@ -669,9 +668,9 @@ break; } case bitc::CST_CODE_CE_GEP: { // CE_GEP: [n x operands] - if ((Record.size() & 1) == 0) return Error("Invalid CE_GEP record"); + if (Record.size() & 1) return Error("Invalid CE_GEP record"); SmallVector Elts; - for (unsigned i = 1, e = Record.size(); i != e; i += 2) { + for (unsigned i = 0, e = Record.size(); i != e; i += 2) { const Type *ElTy = getTypeByID(Record[i]); if (!ElTy) return Error("Invalid CE_GEP record"); Elts.push_back(ValueList.getConstantFwdRef(Record[i+1], ElTy)); @@ -856,35 +855,35 @@ if (Record[0] != 0) return Error("Unknown bitstream version!"); break; - case bitc::MODULE_CODE_TRIPLE: { // TRIPLE: [strlen, strchr x N] + case bitc::MODULE_CODE_TRIPLE: { // TRIPLE: [strchr x N] std::string S; if (ConvertToString(Record, 0, S)) return Error("Invalid MODULE_CODE_TRIPLE record"); TheModule->setTargetTriple(S); break; } - case bitc::MODULE_CODE_DATALAYOUT: { // DATALAYOUT: [strlen, strchr x N] + case bitc::MODULE_CODE_DATALAYOUT: { // DATALAYOUT: [strchr x N] std::string S; if (ConvertToString(Record, 0, S)) return Error("Invalid MODULE_CODE_DATALAYOUT record"); TheModule->setDataLayout(S); break; } - case bitc::MODULE_CODE_ASM: { // ASM: [strlen, strchr x N] + case bitc::MODULE_CODE_ASM: { // ASM: [strchr x N] std::string S; if (ConvertToString(Record, 0, S)) return Error("Invalid MODULE_CODE_ASM record"); TheModule->setModuleInlineAsm(S); break; } - case bitc::MODULE_CODE_DEPLIB: { // DEPLIB: [strlen, strchr x N] + case bitc::MODULE_CODE_DEPLIB: { // DEPLIB: [strchr x N] std::string S; if (ConvertToString(Record, 0, S)) return Error("Invalid MODULE_CODE_DEPLIB record"); TheModule->addLibrary(S); break; } - case bitc::MODULE_CODE_SECTIONNAME: { // SECTIONNAME: [strlen, strchr x N] + case bitc::MODULE_CODE_SECTIONNAME: { // SECTIONNAME: [strchr x N] std::string S; if (ConvertToString(Record, 0, S)) return Error("Invalid MODULE_CODE_SECTIONNAME record"); @@ -1156,7 +1155,7 @@ I = CastInst::create((Instruction::CastOps)Opc, Op, ResTy); break; } - case bitc::FUNC_CODE_INST_GEP: { // GEP: [n, n x operands] + case bitc::FUNC_CODE_INST_GEP: { // GEP: [n x operands] if (Record.size() < 2 || (Record.size() & 1)) return Error("Invalid GEP record"); const Type *OpTy = getTypeByID(Record[0]); @@ -1354,17 +1353,17 @@ I = new UnreachableInst(); break; case bitc::FUNC_CODE_INST_PHI: { // PHI: [ty, #ops, val0,bb0, ...] - if (Record.size() < 2 || Record.size() < 2+Record[1] || (Record[1]&1)) + if (Record.size() < 1 || ((Record.size()-1)&1)) return Error("Invalid PHI record"); const Type *Ty = getTypeByID(Record[0]); if (!Ty) return Error("Invalid PHI record"); PHINode *PN = new PHINode(Ty); - PN->reserveOperandSpace(Record[1]); + PN->reserveOperandSpace(Record.size()-1); - for (unsigned i = 0, e = Record[1]; i != e; i += 2) { - Value *V = getFnValueByID(Record[2+i], Ty); - BasicBlock *BB = getBasicBlock(Record[3+i]); + for (unsigned i = 0, e = Record.size()-1; i != e; i += 2) { + Value *V = getFnValueByID(Record[1+i], Ty); + BasicBlock *BB = getBasicBlock(Record[2+i]); if (!V || !BB) return Error("Invalid PHI record"); PN->addIncoming(V, BB); } From evan.cheng at apple.com Fri May 4 14:57:45 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 4 May 2007 14:57:45 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/Olden/mst/hash.c Message-ID: <200705041957.l44Jvjpn020787@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/Olden/mst: hash.c updated: 1.5 -> 1.6 --- Log message: Fix test so gcc/llvm comparison is valid. --- Diffs of the changes: (+0 -4) hash.c | 4 ---- 1 files changed, 4 deletions(-) Index: llvm-test/MultiSource/Benchmarks/Olden/mst/hash.c diff -u llvm-test/MultiSource/Benchmarks/Olden/mst/hash.c:1.5 llvm-test/MultiSource/Benchmarks/Olden/mst/hash.c:1.6 --- llvm-test/MultiSource/Benchmarks/Olden/mst/hash.c:1.5 Thu Feb 14 13:00:56 2002 +++ llvm-test/MultiSource/Benchmarks/Olden/mst/hash.c Fri May 4 14:57:26 2007 @@ -5,9 +5,6 @@ #define assert(num,a) if (!(a)) {printf("Assertion failure:%d in hash\n",num); exit(-1);} -#ifdef __llvm__ -#define localmalloc malloc -#else static int remaining = 0; static char *temp; @@ -26,7 +23,6 @@ remaining -= size; return blah; } -#endif #define localfree(sz) From sabre at nondot.org Fri May 4 15:34:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 15:34:07 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/BitCodes.h BitstreamReader.h BitstreamWriter.h Message-ID: <200705042034.l44KY76K021767@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: BitCodes.h updated: 1.4 -> 1.5 BitstreamReader.h updated: 1.13 -> 1.14 BitstreamWriter.h updated: 1.8 -> 1.9 --- Log message: add support for array abbreviations. --- Diffs of the changes: (+101 -59) BitCodes.h | 22 ++++++++++--- BitstreamReader.h | 52 +++++++++++++++++++++----------- BitstreamWriter.h | 86 ++++++++++++++++++++++++++++++------------------------ 3 files changed, 101 insertions(+), 59 deletions(-) Index: llvm/include/llvm/Bitcode/BitCodes.h diff -u llvm/include/llvm/Bitcode/BitCodes.h:1.4 llvm/include/llvm/Bitcode/BitCodes.h:1.5 --- llvm/include/llvm/Bitcode/BitCodes.h:1.4 Fri May 4 13:25:49 2007 +++ llvm/include/llvm/Bitcode/BitCodes.h Fri May 4 15:33:47 2007 @@ -84,13 +84,15 @@ unsigned Enc : 3; // The encoding to use. public: enum Encoding { - FixedWidth = 1, // A fixed with field, Val specifies number of bits. - VBR = 2 // A VBR field where Val specifies the width of each chunk. + Fixed = 1, // A fixed with field, Val specifies number of bits. + VBR = 2, // A VBR field where Val specifies the width of each chunk. + Array = 3 // A sequence of fields, next field species elt encoding. }; BitCodeAbbrevOp(uint64_t V) : Val(V), IsLiteral(true) {} - BitCodeAbbrevOp(Encoding E, uint64_t Data) + BitCodeAbbrevOp(Encoding E, uint64_t Data = 0) : Val(Data), IsLiteral(false), Enc(E) {} + bool isLiteral() const { return IsLiteral; } bool isEncoding() const { return !IsLiteral; } @@ -100,11 +102,21 @@ // Accessors for encoding info. Encoding getEncoding() const { assert(isEncoding()); return (Encoding)Enc; } - uint64_t getEncodingData() const { assert(isEncoding()); return Val; } + uint64_t getEncodingData() const { + assert(isEncoding() && hasEncodingData()); + return Val; + } bool hasEncodingData() const { return hasEncodingData(getEncoding()); } static bool hasEncodingData(Encoding E) { - return true; + switch (E) { + default: assert(0 && "Unknown encoding"); + case Fixed: + case VBR: + return true; + case Array: + return false; + } } }; Index: llvm/include/llvm/Bitcode/BitstreamReader.h diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.13 llvm/include/llvm/Bitcode/BitstreamReader.h:1.14 --- llvm/include/llvm/Bitcode/BitstreamReader.h:1.13 Fri May 4 13:25:49 2007 +++ llvm/include/llvm/Bitcode/BitstreamReader.h Fri May 4 15:33:47 2007 @@ -274,6 +274,26 @@ // Record Processing //===--------------------------------------------------------------------===// +private: + void ReadAbbreviatedField(const BitCodeAbbrevOp &Op, + SmallVectorImpl &Vals) { + if (Op.isLiteral()) { + // If the abbrev specifies the literal value to use, use it. + Vals.push_back(Op.getLiteralValue()); + } else { + // Decode the value as we are commanded. + switch (Op.getEncoding()) { + default: assert(0 && "Unknown encoding!"); + case BitCodeAbbrevOp::Fixed: + Vals.push_back(Read(Op.getEncodingData())); + break; + case BitCodeAbbrevOp::VBR: + Vals.push_back(ReadVBR64(Op.getEncodingData())); + break; + } + } + } +public: unsigned ReadRecord(unsigned AbbrevID, SmallVectorImpl &Vals) { if (AbbrevID == bitc::UNABBREV_RECORD) { unsigned Code = ReadVBR(6); @@ -289,20 +309,19 @@ for (unsigned i = 0, e = Abbv->getNumOperandInfos(); i != e; ++i) { const BitCodeAbbrevOp &Op = Abbv->getOperandInfo(i); - if (Op.isLiteral()) { - // If the abbrev specifies the literal value to use, use it. - Vals.push_back(Op.getLiteralValue()); + if (Op.isLiteral() || Op.getEncoding() != BitCodeAbbrevOp::Array) { + ReadAbbreviatedField(Op, Vals); } else { - // Decode the value as we are commanded. - switch (Op.getEncoding()) { - default: assert(0 && "Unknown encoding!"); - case BitCodeAbbrevOp::FixedWidth: - Vals.push_back(Read(Op.getEncodingData())); - break; - case BitCodeAbbrevOp::VBR: - Vals.push_back(ReadVBR64(Op.getEncodingData())); - break; - } + // Array case. Read the number of elements as a vbr6. + unsigned NumElts = ReadVBR(6); + + // Get the element encoding. + assert(i+2 == e && "array op not second to last?"); + const BitCodeAbbrevOp &EltEnc = Abbv->getOperandInfo(++i); + + // Read all the elements. + for (; NumElts; --NumElts) + ReadAbbreviatedField(EltEnc, Vals); } } @@ -326,11 +345,10 @@ } BitCodeAbbrevOp::Encoding E = (BitCodeAbbrevOp::Encoding)Read(3); - if (BitCodeAbbrevOp::hasEncodingData(E)) { + if (BitCodeAbbrevOp::hasEncodingData(E)) Abbv->Add(BitCodeAbbrevOp(E, ReadVBR64(5))); - } else { - assert(0 && "unimp"); - } + else + Abbv->Add(BitCodeAbbrevOp(E)); } CurAbbrevs.push_back(Abbv); } Index: llvm/include/llvm/Bitcode/BitstreamWriter.h diff -u llvm/include/llvm/Bitcode/BitstreamWriter.h:1.8 llvm/include/llvm/Bitcode/BitstreamWriter.h:1.9 --- llvm/include/llvm/Bitcode/BitstreamWriter.h:1.8 Fri May 4 13:25:49 2007 +++ llvm/include/llvm/Bitcode/BitstreamWriter.h Fri May 4 15:33:47 2007 @@ -189,6 +189,32 @@ // Record Emission //===--------------------------------------------------------------------===// +private: + /// EmitAbbreviatedField - Emit a single scalar field value with the specified + /// encoding. + template + void EmitAbbreviatedField(const BitCodeAbbrevOp &Op, uintty V) { + if (Op.isLiteral()) { + // If the abbrev specifies the literal value to use, don't emit + // anything. + assert(V == Op.getLiteralValue() && + "Invalid abbrev for record!"); + return; + } + + // Encode the value as we are commanded. + switch (Op.getEncoding()) { + default: assert(0 && "Unknown encoding!"); + case BitCodeAbbrevOp::Fixed: + Emit(V, Op.getEncodingData()); + break; + case BitCodeAbbrevOp::VBR: + EmitVBR(V, Op.getEncodingData()); + break; + } + } +public: + /// EmitRecord - Emit the specified record to the stream, using an abbrev if /// we have one to compress the output. void EmitRecord(unsigned Code, SmallVectorImpl &Vals, @@ -207,27 +233,20 @@ for (unsigned i = 0, e = Abbv->getNumOperandInfos(); i != e; ++i) { assert(RecordIdx < Vals.size() && "Invalid abbrev/record"); const BitCodeAbbrevOp &Op = Abbv->getOperandInfo(i); - uint64_t RecordVal = Vals[RecordIdx]; - - if (Op.isLiteral()) { - // If the abbrev specifies the literal value to use, don't emit - // anything. - assert(RecordVal == Op.getLiteralValue() && - "Invalid abbrev for record!"); + if (Op.isLiteral() || Op.getEncoding() != BitCodeAbbrevOp::Array) { + EmitAbbreviatedField(Op, Vals[RecordIdx]); ++RecordIdx; } else { - // Encode the value as we are commanded. - switch (Op.getEncoding()) { - default: assert(0 && "Unknown encoding!"); - case BitCodeAbbrevOp::FixedWidth: - Emit64(RecordVal, Op.getEncodingData()); - ++RecordIdx; - break; - case BitCodeAbbrevOp::VBR: - EmitVBR64(RecordVal, Op.getEncodingData()); - ++RecordIdx; - break; - } + // Array case. + assert(i+2 == e && "array op not second to last?"); + const BitCodeAbbrevOp &EltEnc = Abbv->getOperandInfo(++i); + + // Emit a vbr6 to indicate the number of elements present. + EmitVBR(Vals.size()-RecordIdx, 6); + + // Emit each field. + for (; RecordIdx != Vals.size(); ++RecordIdx) + EmitAbbreviatedField(EltEnc, Vals[RecordIdx]); } } assert(RecordIdx == Vals.size() && "Not all record operands emitted!"); @@ -260,27 +279,20 @@ for (unsigned i = 0, e = Abbv->getNumOperandInfos(); i != e; ++i) { assert(RecordIdx < Vals.size() && "Invalid abbrev/record"); const BitCodeAbbrevOp &Op = Abbv->getOperandInfo(i); - unsigned RecordVal = Vals[RecordIdx]; - if (Op.isLiteral()) { - // If the abbrev specifies the literal value to use, don't emit - // anything. - assert(RecordVal == Op.getLiteralValue() && - "Invalid abbrev for record!"); + if (Op.isLiteral() || Op.getEncoding() != BitCodeAbbrevOp::Array) { + EmitAbbreviatedField(Op, Vals[RecordIdx]); ++RecordIdx; } else { - // Encode the value as we are commanded. - switch (Op.getEncoding()) { - default: assert(0 && "Unknown encoding!"); - case BitCodeAbbrevOp::FixedWidth: - Emit(RecordVal, Op.getEncodingData()); - ++RecordIdx; - break; - case BitCodeAbbrevOp::VBR: - EmitVBR(RecordVal, Op.getEncodingData()); - ++RecordIdx; - break; - } + assert(i+2 == e && "array op not second to last?"); + const BitCodeAbbrevOp &EltEnc = Abbv->getOperandInfo(++i); + + // Emit a vbr6 to indicate the number of elements present. + EmitVBR(Vals.size()-RecordIdx, 6); + + // Emit each field. + for (; RecordIdx != Vals.size(); ++RecordIdx) + EmitAbbreviatedField(EltEnc, Vals[RecordIdx]); } } assert(RecordIdx == Vals.size() && "Not all record operands emitted!"); From sabre at nondot.org Fri May 4 15:35:08 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 15:35:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705042035.l44KZ8Bi021803@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.31 -> 1.32 --- Log message: Encode all value symtab strings as arrays of 8-bit fixed width integers, instead of the default inefficient encoding. This shrinks kc++ from 4134K to 3629K --- Diffs of the changes: (+15 -15) BitcodeWriter.cpp | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.31 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.32 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.31 Fri May 4 14:11:41 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Fri May 4 15:34:50 2007 @@ -267,22 +267,22 @@ // Add an abbrev for common globals with no visibility or thread localness. BitCodeAbbrev *Abbv = new BitCodeAbbrev(); Abbv->Add(BitCodeAbbrevOp(bitc::MODULE_CODE_GLOBALVAR)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::FixedWidth, + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, Log2_32_Ceil(MaxGlobalType+1))); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::FixedWidth, 1)); // Constant. + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Constant. Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Initializer. - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::FixedWidth, 3)); // Linkage. - if (MaxAlignment == 0) // Alignment. + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // Linkage. + if (MaxAlignment == 0) // Alignment. Abbv->Add(BitCodeAbbrevOp(0)); else { unsigned MaxEncAlignment = Log2_32(MaxAlignment)+1; - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::FixedWidth, + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, Log2_32_Ceil(MaxEncAlignment+1))); } if (SectionMap.empty()) // Section. Abbv->Add(BitCodeAbbrevOp(0)); else - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::FixedWidth, + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, Log2_32_Ceil(SectionMap.size()+1))); // Don't bother emitting vis + thread local. SimpleGVarAbbrev = Stream.EmitAbbrev(Abbv); @@ -702,15 +702,14 @@ BitstreamWriter &Stream) { if (VST.empty()) return; Stream.EnterSubblock(bitc::VALUE_SYMTAB_BLOCK_ID, 3); - -#if 0 + + // 8-bit fixed width VST_ENTRY strings. BitCodeAbbrev *Abbv = new BitCodeAbbrev(); - Abbv->Add(BitCodeAbbrevOp(bitc::VST_ENTRY)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::FixedWidth, - Log2_32_Ceil(MaxGlobalType+1))); - // Don't bother emitting vis + thread local. - SimpleGVarAbbrev = Stream.EmitAbbrev(Abbv); -#endif + Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8)); + unsigned AbbrevID = Stream.EmitAbbrev(Abbv); // FIXME: Set up the abbrev, we know how many values there are! @@ -728,6 +727,7 @@ Code = bitc::VST_CODE_BBENTRY; } else { Code = bitc::VST_CODE_ENTRY; + AbbrevToUse = AbbrevID; } NameVals.push_back(VE.getValueID(SI->getValue())); @@ -873,7 +873,7 @@ BitCodeAbbrev *Abbv = new BitCodeAbbrev(); Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8); // Value ID - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::FixedWidth, 3)); // Linkage. + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // Linkage. xxx = Stream.EmitAbbrev(Abbv); #endif From isanbard at gmail.com Fri May 4 15:39:03 2007 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 4 May 2007 15:39:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86.td Message-ID: <200705042039.l44Kd3IJ021901@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86.td updated: 1.31 -> 1.32 --- Log message: Add an "implies" field to features. This indicates that, if the current feature is set, then the features in the implied list should be set also. The opposite is also enforced: if a feature in the implied list isn't set, then the feature that owns that implies list shouldn't be set either. --- Diffs of the changes: (+21 -17) X86.td | 38 +++++++++++++++++++++----------------- 1 files changed, 21 insertions(+), 17 deletions(-) Index: llvm/lib/Target/X86/X86.td diff -u llvm/lib/Target/X86/X86.td:1.31 llvm/lib/Target/X86/X86.td:1.32 --- llvm/lib/Target/X86/X86.td:1.31 Wed Apr 25 16:31:48 2007 +++ llvm/lib/Target/X86/X86.td Fri May 4 15:38:40 2007 @@ -18,24 +18,28 @@ //===----------------------------------------------------------------------===// // X86 Subtarget features. -// +//===----------------------------------------------------------------------===// -def Feature64Bit : SubtargetFeature<"64bit", "HasX86_64", "true", - "Support 64-bit instructions">; -def FeatureMMX : SubtargetFeature<"mmx","X86SSELevel", "MMX", - "Enable MMX instructions">; -def FeatureSSE1 : SubtargetFeature<"sse", "X86SSELevel", "SSE1", - "Enable SSE instructions">; -def FeatureSSE2 : SubtargetFeature<"sse2", "X86SSELevel", "SSE2", - "Enable SSE2 instructions">; -def FeatureSSE3 : SubtargetFeature<"sse3", "X86SSELevel", "SSE3", - "Enable SSE3 instructions">; -def FeatureSSSE3 : SubtargetFeature<"ssse3", "X86SSELevel", "SSSE3", - "Enable SSSE3 instructions">; -def Feature3DNow : SubtargetFeature<"3dnow", "X863DNowLevel", "ThreeDNow", - "Enable 3DNow! instructions">; -def Feature3DNowA : SubtargetFeature<"3dnowa", "X863DNowLevel", "ThreeDNowA", - "Enable 3DNow! Athlon instructions">; +def Feature64Bit : SubtargetFeature<"64bit", "HasX86_64", "true", + "Support 64-bit instructions">; +def FeatureMMX : SubtargetFeature<"mmx","X86SSELevel", "MMX", + "Enable MMX instructions">; +def FeatureSSE1 : SubtargetFeature<"sse", "X86SSELevel", "SSE1", + "Enable SSE instructions", + [FeatureMMX]>; +def FeatureSSE2 : SubtargetFeature<"sse2", "X86SSELevel", "SSE2", + "Enable SSE2 instructions", + [FeatureSSE1]>; +def FeatureSSE3 : SubtargetFeature<"sse3", "X86SSELevel", "SSE3", + "Enable SSE3 instructions", + [FeatureSSE2]>; +def FeatureSSSE3 : SubtargetFeature<"ssse3", "X86SSELevel", "SSSE3", + "Enable SSSE3 instructions", + [FeatureSSE3]>; +def Feature3DNow : SubtargetFeature<"3dnow", "X863DNowLevel", "ThreeDNow", + "Enable 3DNow! instructions">; +def Feature3DNowA : SubtargetFeature<"3dnowa", "X863DNowLevel", "ThreeDNowA", + "Enable 3DNow! Athlon instructions">; //===----------------------------------------------------------------------===// // X86 processors supported. From isanbard at gmail.com Fri May 4 15:39:08 2007 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 4 May 2007 15:39:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/SubtargetFeature.cpp Target.td Message-ID: <200705042039.l44Kd8Pt021909@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: SubtargetFeature.cpp updated: 1.12 -> 1.13 Target.td updated: 1.98 -> 1.99 --- Log message: Add an "implies" field to features. This indicates that, if the current feature is set, then the features in the implied list should be set also. The opposite is also enforced: if a feature in the implied list isn't set, then the feature that owns that implies list shouldn't be set either. --- Diffs of the changes: (+56 -3) SubtargetFeature.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- Target.td | 8 +++++++- 2 files changed, 56 insertions(+), 3 deletions(-) Index: llvm/lib/Target/SubtargetFeature.cpp diff -u llvm/lib/Target/SubtargetFeature.cpp:1.12 llvm/lib/Target/SubtargetFeature.cpp:1.13 --- llvm/lib/Target/SubtargetFeature.cpp:1.12 Thu Dec 7 17:41:45 2006 +++ llvm/lib/Target/SubtargetFeature.cpp Fri May 4 15:38:40 2007 @@ -199,6 +199,43 @@ if (Features[0].empty()) setCPU(String); } +/// SetImpliedBits - For each feature that is (transitively) implied by this +/// feature, set it. +/// +static +void SetImpliedBits(uint32_t &Bits, const SubtargetFeatureKV *FeatureEntry, + const SubtargetFeatureKV *FeatureTable, + size_t FeatureTableSize) { + for (size_t i = 0; i < FeatureTableSize; ++i) { + const SubtargetFeatureKV &FE = FeatureTable[i]; + + if (FeatureEntry->Value == FE.Value) continue; + + if (FeatureEntry->Implies & FE.Value) { + Bits |= FE.Value; + SetImpliedBits(Bits, &FE, FeatureTable, FeatureTableSize); + } + } +} + +/// ClearImpliedBits - For each feature that (transitively) implies this +/// feature, clear it. +/// +static +void ClearImpliedBits(uint32_t &Bits, const SubtargetFeatureKV *FeatureEntry, + const SubtargetFeatureKV *FeatureTable, + size_t FeatureTableSize) { + for (size_t i = 0; i < FeatureTableSize; ++i) { + const SubtargetFeatureKV &FE = FeatureTable[i]; + + if (FeatureEntry->Value == FE.Value) continue; + + if (FE.Implies & FeatureEntry->Value) { + Bits &= ~FE.Value; + ClearImpliedBits(Bits, &FE, FeatureTable, FeatureTableSize); + } + } +} /// getBits - Get feature bits. /// @@ -251,8 +288,17 @@ // If there is a match if (FeatureEntry) { // Enable/disable feature in bits - if (isEnabled(Feature)) Bits |= FeatureEntry->Value; - else Bits &= ~FeatureEntry->Value; + if (isEnabled(Feature)) { + Bits |= FeatureEntry->Value; + + // For each feature that this implies, set it. + SetImpliedBits(Bits, FeatureEntry, FeatureTable, FeatureTableSize); + } else { + Bits &= ~FeatureEntry->Value; + + // For each feature that implies this, clear it. + ClearImpliedBits(Bits, FeatureEntry, FeatureTable, FeatureTableSize); + } } else { cerr << "'" << Feature << "' is not a recognized feature for this target" @@ -260,6 +306,7 @@ << "\n"; } } + return Bits; } Index: llvm/lib/Target/Target.td diff -u llvm/lib/Target/Target.td:1.98 llvm/lib/Target/Target.td:1.99 --- llvm/lib/Target/Target.td:1.98 Wed May 2 19:27:11 2007 +++ llvm/lib/Target/Target.td Fri May 4 15:38:40 2007 @@ -338,7 +338,8 @@ //===----------------------------------------------------------------------===// // SubtargetFeature - A characteristic of the chip set. // -class SubtargetFeature { +class SubtargetFeature i = []> { // Name - Feature name. Used by command line (-mattr=) to determine the // appropriate target chip. // @@ -356,6 +357,11 @@ // information. // string Desc = d; + + // Implies - Features that this feature implies are present. If one of those + // features isn't set, then this one shouldn't be set either. + // + list Implies = i; } //===----------------------------------------------------------------------===// From isanbard at gmail.com Fri May 4 15:39:09 2007 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 4 May 2007 15:39:09 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/SubtargetEmitter.cpp Message-ID: <200705042039.l44Kd9TP021920@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: SubtargetEmitter.cpp updated: 1.25 -> 1.26 --- Log message: Add an "implies" field to features. This indicates that, if the current feature is set, then the features in the implied list should be set also. The opposite is also enforced: if a feature in the implied list isn't set, then the feature that owns that implies list shouldn't be set either. --- Diffs of the changes: (+54 -46) SubtargetEmitter.cpp | 100 +++++++++++++++++++++++++++------------------------ 1 files changed, 54 insertions(+), 46 deletions(-) Index: llvm/utils/TableGen/SubtargetEmitter.cpp diff -u llvm/utils/TableGen/SubtargetEmitter.cpp:1.25 llvm/utils/TableGen/SubtargetEmitter.cpp:1.26 --- llvm/utils/TableGen/SubtargetEmitter.cpp:1.25 Sun Apr 22 04:04:24 2007 +++ llvm/utils/TableGen/SubtargetEmitter.cpp Fri May 4 15:38:40 2007 @@ -56,8 +56,7 @@ Record *Def = DefList[i]; // Get and emit name - std::string Name = Def->getName(); - OS << " " << Name; + OS << " " << Def->getName(); // If bit flags then emit expression (1 << i) if (isBits) OS << " = " << " 1 << " << i; @@ -73,8 +72,8 @@ } // -// FeatureKeyValues - Emit data of all the subtarget features. Used by command -// line. +// FeatureKeyValues - Emit data of all the subtarget features. Used by the +// command line. // void SubtargetEmitter::FeatureKeyValues(std::ostream &OS) { // Gather and sort all the features @@ -91,18 +90,31 @@ // Next feature Record *Feature = FeatureList[i]; - std::string Name = Feature->getName(); - std::string CommandLineName = Feature->getValueAsString("Name"); - std::string Desc = Feature->getValueAsString("Desc"); + const std::string &Name = Feature->getName(); + const std::string &CommandLineName = Feature->getValueAsString("Name"); + const std::string &Desc = Feature->getValueAsString("Desc"); if (CommandLineName.empty()) continue; - // Emit as { "feature", "decription", feactureEnum } + // Emit as { "feature", "decription", feactureEnum, i1 | i2 | ... | in } OS << " { " << "\"" << CommandLineName << "\", " << "\"" << Desc << "\", " - << Name - << " }"; + << Name << ", "; + + const std::vector &ImpliesList = + Feature->getValueAsListOfDefs("Implies"); + + if (ImpliesList.empty()) { + OS << "0"; + } else { + for (unsigned j = 0, M = ImpliesList.size(); j < M;) { + OS << ImpliesList[j]->getName(); + if (++j < M) OS << " | "; + } + } + + OS << " }"; // Depending on 'if more in the list' emit comma if ((i + 1) < N) OS << ","; @@ -138,8 +150,8 @@ // Next processor Record *Processor = ProcessorList[i]; - std::string Name = Processor->getValueAsString("Name"); - std::vector FeatureList = + const std::string &Name = Processor->getValueAsString("Name"); + const std::vector &FeatureList = Processor->getValueAsListOfDefs("Features"); // Emit as { "cpu", "description", f1 | f2 | ... fn }, @@ -151,14 +163,13 @@ OS << "0"; } else { for (unsigned j = 0, M = FeatureList.size(); j < M;) { - Record *Feature = FeatureList[j]; - std::string Name = Feature->getName(); - OS << Name; + OS << FeatureList[j]->getName(); if (++j < M) OS << " | "; } } - OS << " }"; + // The "0" is for the "implies" section of this data structure. + OS << ", 0 }"; // Depending on 'if more in the list' emit comma if (++i < N) OS << ","; @@ -190,11 +201,10 @@ unsigned N = ItinClassList.size(); for (unsigned i = 0; i < N; i++) { // Next itinerary class - Record *ItinClass = ItinClassList[i]; + const Record *ItinClass = ItinClassList[i]; // Get name of itinerary class - std::string Name = ItinClass->getName(); // Assign itinerary class a unique number - ItinClassesMap[Name] = i; + ItinClassesMap[ItinClass->getName()] = i; } // Emit size of table @@ -214,28 +224,26 @@ std::string &ItinString, unsigned &NStages) { // Get states list - std::vector StageList = ItinData->getValueAsListOfDefs("Stages"); + const std::vector &StageList = + ItinData->getValueAsListOfDefs("Stages"); // For each stage unsigned N = NStages = StageList.size(); for (unsigned i = 0; i < N;) { // Next stage - Record *Stage = StageList[i]; + const Record *Stage = StageList[i]; // Form string as ,{ cycles, u1 | u2 | ... | un } int Cycles = Stage->getValueAsInt("Cycles"); ItinString += " { " + itostr(Cycles) + ", "; // Get unit list - std::vector UnitList = Stage->getValueAsListOfDefs("Units"); + const std::vector &UnitList = Stage->getValueAsListOfDefs("Units"); // For each unit for (unsigned j = 0, M = UnitList.size(); j < M;) { - // Next unit - Record *Unit = UnitList[j]; - // Add name and bitwise or - ItinString += Unit->getName(); + ItinString += UnitList[j]->getName(); if (++j < M) ItinString += " | "; } @@ -271,7 +279,7 @@ Record *Proc = ProcItinList[i]; // Get processor itinerary name - std::string Name = Proc->getName(); + const std::string &Name = Proc->getName(); // Skip default if (Name == "NoItineraries") continue; @@ -308,7 +316,7 @@ InstrItinerary Intinerary = { Find, Find + NStages }; // Locate where to inject into processor itinerary table - std::string Name = ItinData->getValueAsDef("TheClass")->getName(); + const std::string &Name = ItinData->getValueAsDef("TheClass")->getName(); Find = ItinClassesMap[Name]; // Inject - empty slots will be 0, 0 @@ -347,7 +355,7 @@ Record *Itin = Itins[i]; // Get processor itinerary name - std::string Name = Itin->getName(); + const std::string &Name = Itin->getName(); // Skip default if (Name == "NoItineraries") continue; @@ -398,8 +406,9 @@ // Next processor Record *Processor = ProcessorList[i]; - std::string Name = Processor->getValueAsString("Name"); - std::string ProcItin = Processor->getValueAsDef("ProcItin")->getName(); + const std::string &Name = Processor->getValueAsString("Name"); + const std::string &ProcItin = + Processor->getValueAsDef("ProcItin")->getName(); // Emit as { "cpu", procinit }, OS << " { " @@ -456,33 +465,32 @@ std::sort(Features.begin(), Features.end(), LessRecord()); OS << "// ParseSubtargetFeatures - Parses features string setting specified\n" - "// subtarget options.\n" - "void llvm::"; + << "// subtarget options.\n" + << "void llvm::"; OS << Target; OS << "Subtarget::ParseSubtargetFeatures(const std::string &FS,\n" - " const std::string &CPU) {\n" - " SubtargetFeatures Features(FS);\n" - " Features.setCPUIfNone(CPU);\n" - " uint32_t Bits = Features.getBits(SubTypeKV, SubTypeKVSize,\n" - " FeatureKV, FeatureKVSize);\n"; - + << " const std::string &CPU) {\n" + << " SubtargetFeatures Features(FS);\n" + << " Features.setCPUIfNone(CPU);\n" + << " uint32_t Bits = Features.getBits(SubTypeKV, SubTypeKVSize,\n" + << " FeatureKV, FeatureKVSize);\n"; + for (unsigned i = 0; i < Features.size(); i++) { // Next record Record *R = Features[i]; - std::string Instance = R->getName(); - std::string Name = R->getValueAsString("Name"); - std::string Value = R->getValueAsString("Value"); - std::string Attribute = R->getValueAsString("Attribute"); + const std::string &Instance = R->getName(); + const std::string &Value = R->getValueAsString("Value"); + const std::string &Attribute = R->getValueAsString("Attribute"); OS << " if ((Bits & " << Instance << ") != 0) " << Attribute << " = " << Value << ";\n"; } - + if (HasItineraries) { OS << "\n" << " InstrItinerary *Itinerary = (InstrItinerary *)" - "Features.getInfo(ProcItinKV, ProcItinKVSize);\n" - " InstrItins = InstrItineraryData(Stages, Itinerary);\n"; + << "Features.getInfo(ProcItinKV, ProcItinKVSize);\n" + << " InstrItins = InstrItineraryData(Stages, Itinerary);\n"; } OS << "}\n"; From isanbard at gmail.com Fri May 4 15:39:09 2007 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 4 May 2007 15:39:09 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/SubtargetFeature.h Message-ID: <200705042039.l44Kd9eb021911@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: SubtargetFeature.h updated: 1.10 -> 1.11 --- Log message: Add an "implies" field to features. This indicates that, if the current feature is set, then the features in the implied list should be set also. The opposite is also enforced: if a feature in the implied list isn't set, then the feature that owns that implies list shouldn't be set either. --- Diffs of the changes: (+1 -0) SubtargetFeature.h | 1 + 1 files changed, 1 insertion(+) Index: llvm/include/llvm/Target/SubtargetFeature.h diff -u llvm/include/llvm/Target/SubtargetFeature.h:1.10 llvm/include/llvm/Target/SubtargetFeature.h:1.11 --- llvm/include/llvm/Target/SubtargetFeature.h:1.10 Sat Dec 16 23:15:12 2006 +++ llvm/include/llvm/Target/SubtargetFeature.h Fri May 4 15:38:40 2007 @@ -34,6 +34,7 @@ const char *Key; // K-V key string const char *Desc; // Help descriptor uint32_t Value; // K-V integer value + uint32_t Implies; // K-V bit mask // Compare routine for std binary search bool operator<(const SubtargetFeatureKV &S) const { From sabre at nondot.org Fri May 4 15:41:09 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 15:41:09 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/BitstreamWriter.h Message-ID: <200705042041.l44Kf9Fn022014@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: BitstreamWriter.h updated: 1.9 -> 1.10 --- Log message: use a template to eliminate manual code duplication --- Diffs of the changes: (+2 -47) BitstreamWriter.h | 49 ++----------------------------------------------- 1 files changed, 2 insertions(+), 47 deletions(-) Index: llvm/include/llvm/Bitcode/BitstreamWriter.h diff -u llvm/include/llvm/Bitcode/BitstreamWriter.h:1.9 llvm/include/llvm/Bitcode/BitstreamWriter.h:1.10 --- llvm/include/llvm/Bitcode/BitstreamWriter.h:1.9 Fri May 4 15:33:47 2007 +++ llvm/include/llvm/Bitcode/BitstreamWriter.h Fri May 4 15:40:50 2007 @@ -217,7 +217,8 @@ /// EmitRecord - Emit the specified record to the stream, using an abbrev if /// we have one to compress the output. - void EmitRecord(unsigned Code, SmallVectorImpl &Vals, + template + void EmitRecord(unsigned Code, SmallVectorImpl &Vals, unsigned Abbrev = 0) { if (Abbrev) { unsigned AbbrevNo = Abbrev-bitc::FIRST_APPLICATION_ABBREV; @@ -261,52 +262,6 @@ } } - /// EmitRecord - Emit the specified record to the stream, using an abbrev if - /// we have one to compress the output. - void EmitRecord(unsigned Code, SmallVectorImpl &Vals, - unsigned Abbrev = 0) { - if (Abbrev) { - unsigned AbbrevNo = Abbrev-bitc::FIRST_APPLICATION_ABBREV; - assert(AbbrevNo < CurAbbrevs.size() && "Invalid abbrev #!"); - BitCodeAbbrev *Abbv = CurAbbrevs[AbbrevNo]; - - EmitCode(Abbrev); - - // Insert the code into Vals to treat it uniformly. - Vals.insert(Vals.begin(), Code); - - unsigned RecordIdx = 0; - for (unsigned i = 0, e = Abbv->getNumOperandInfos(); i != e; ++i) { - assert(RecordIdx < Vals.size() && "Invalid abbrev/record"); - const BitCodeAbbrevOp &Op = Abbv->getOperandInfo(i); - - if (Op.isLiteral() || Op.getEncoding() != BitCodeAbbrevOp::Array) { - EmitAbbreviatedField(Op, Vals[RecordIdx]); - ++RecordIdx; - } else { - assert(i+2 == e && "array op not second to last?"); - const BitCodeAbbrevOp &EltEnc = Abbv->getOperandInfo(++i); - - // Emit a vbr6 to indicate the number of elements present. - EmitVBR(Vals.size()-RecordIdx, 6); - - // Emit each field. - for (; RecordIdx != Vals.size(); ++RecordIdx) - EmitAbbreviatedField(EltEnc, Vals[RecordIdx]); - } - } - assert(RecordIdx == Vals.size() && "Not all record operands emitted!"); - } else { - // If we don't have an abbrev to use, emit this in its fully unabbreviated - // form. - EmitCode(bitc::UNABBREV_RECORD); - EmitVBR(Code, 6); - EmitVBR(Vals.size(), 6); - for (unsigned i = 0, e = Vals.size(); i != e; ++i) - EmitVBR(Vals[i], 6); - } - } - //===--------------------------------------------------------------------===// // Abbrev Emission //===--------------------------------------------------------------------===// From sabre at nondot.org Fri May 4 15:52:20 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 15:52:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705042052.l44KqKDW022218@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.32 -> 1.33 --- Log message: where possible, encode symtab names with 7 bits per char instead of 8. This shaves 110K off kc++ to 3514K. Before: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.50425e+07b/1.88031e+06B/470077W Average Size: 6414.69b/801.837B/200.459W % of file: 51.8057 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 2345/1 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 85.1791 after: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.41229e+07b/1.76536e+06B/441341W Average Size: 6022.56b/752.82B/188.205W % of file: 50.2295 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 4690/2 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 85.1791 --- Diffs of the changes: (+45 -11) BitcodeWriter.cpp | 56 +++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 45 insertions(+), 11 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.32 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.33 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.32 Fri May 4 15:34:50 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Fri May 4 15:52:02 2007 @@ -25,7 +25,17 @@ #include "llvm/Support/MathExtras.h" using namespace llvm; -static const unsigned CurVersion = 0; +/// These are manifest constants used by the bitcode writer. They do not need to +/// be kept in sync with the reader, but need to be consistent within this file. +enum { + CurVersion = 0, + + // VALUE_SYMTAB_BLOCK abbrev id's. + VST_ENTRY_8_ABBREV = bitc::FIRST_APPLICATION_ABBREV, + VST_ENTRY_7_ABBREV + +}; + static unsigned GetEncodedCastOpcode(unsigned Opcode) { switch (Opcode) { @@ -703,13 +713,25 @@ if (VST.empty()) return; Stream.EnterSubblock(bitc::VALUE_SYMTAB_BLOCK_ID, 3); - // 8-bit fixed width VST_ENTRY strings. - BitCodeAbbrev *Abbv = new BitCodeAbbrev(); - Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8)); - unsigned AbbrevID = Stream.EmitAbbrev(Abbv); + { // 8-bit fixed width VST_ENTRY strings. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8)); + if (Stream.EmitAbbrev(Abbv) != VST_ENTRY_8_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } + + { // 7-bit fixed width VST_ENTRY strings. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7)); + if (Stream.EmitAbbrev(Abbv) != VST_ENTRY_7_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } // FIXME: Set up the abbrev, we know how many values there are! @@ -718,6 +740,18 @@ for (ValueSymbolTable::const_iterator SI = VST.begin(), SE = VST.end(); SI != SE; ++SI) { + + const ValueName &Name = *SI; + + // Figure out the encoding to use for the name. + bool is7Bit = true; + for (unsigned i = 0, e = Name.getKeyLength(); i != e; ++i) + if ((unsigned char)Name.getKeyData()[i] & 128) { + is7Bit = false; + break; + } + + unsigned AbbrevToUse = 0; // VST_ENTRY: [valueid, namelen, namechar x N] @@ -727,12 +761,12 @@ Code = bitc::VST_CODE_BBENTRY; } else { Code = bitc::VST_CODE_ENTRY; - AbbrevToUse = AbbrevID; + AbbrevToUse = is7Bit ? VST_ENTRY_7_ABBREV : VST_ENTRY_8_ABBREV; } NameVals.push_back(VE.getValueID(SI->getValue())); - for (const char *P = SI->getKeyData(), - *E = SI->getKeyData()+SI->getKeyLength(); P != E; ++P) + for (const char *P = Name.getKeyData(), + *E = Name.getKeyData()+Name.getKeyLength(); P != E; ++P) NameVals.push_back((unsigned char)*P); // Emit the finished record. From sabre at nondot.org Fri May 4 15:58:52 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 15:58:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705042058.l44KwqoF022368@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.33 -> 1.34 --- Log message: shave another 150K off of kc++, by using a 7-bit encoding for BB names where we can. This shrinks kc++'s down to 3368K, with a VST record of: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.29508e+07b/1.61885e+06B/404713W Average Size: 5522.73b/690.342B/172.585W % of file: 48.0645 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 7035/3 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 Isn't it nice to be able to optimizer bc size without touching the reader? :) --- Diffs of the changes: (+12 -1) BitcodeWriter.cpp | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletion(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.33 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.34 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.33 Fri May 4 15:52:02 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Fri May 4 15:58:35 2007 @@ -32,7 +32,8 @@ // VALUE_SYMTAB_BLOCK abbrev id's. VST_ENTRY_8_ABBREV = bitc::FIRST_APPLICATION_ABBREV, - VST_ENTRY_7_ABBREV + VST_ENTRY_7_ABBREV, + VST_BBENTRY_7_ABBREV }; @@ -732,6 +733,15 @@ if (Stream.EmitAbbrev(Abbv) != VST_ENTRY_7_ABBREV) assert(0 && "Unexpected abbrev ordering!"); } + { // 7-bit fixed width VST_BBENTRY strings. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_BBENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7)); + if (Stream.EmitAbbrev(Abbv) != VST_BBENTRY_7_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } // FIXME: Set up the abbrev, we know how many values there are! @@ -759,6 +769,7 @@ unsigned Code; if (isa(SI->getValue())) { Code = bitc::VST_CODE_BBENTRY; + if (is7Bit) AbbrevToUse = VST_BBENTRY_7_ABBREV; } else { Code = bitc::VST_CODE_ENTRY; AbbrevToUse = is7Bit ? VST_ENTRY_7_ABBREV : VST_ENTRY_8_ABBREV; From lauro.venancio at gmail.com Fri May 4 16:25:00 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 4 May 2007 16:25:00 -0500 Subject: [llvm-commits] CVS: llvm-test/RunSafely.sh Message-ID: <200705042125.l44LP0vg022772@zion.cs.uiuc.edu> Changes in directory llvm-test: RunSafely.sh updated: 1.28 -> 1.29 --- Log message: bugfix: wrong return value on remote test. bugfix: RUNTIMELIMIT doesn't work on remote test. --- Diffs of the changes: (+9 -8) RunSafely.sh | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) Index: llvm-test/RunSafely.sh diff -u llvm-test/RunSafely.sh:1.28 llvm-test/RunSafely.sh:1.29 --- llvm-test/RunSafely.sh:1.28 Thu May 3 16:32:39 2007 +++ llvm-test/RunSafely.sh Fri May 4 16:24:42 2007 @@ -62,24 +62,25 @@ shift 5 SYSTEM=`uname -s` +ULIMITCMD="" case $SYSTEM in CYGWIN*) ;; Darwin*) # Disable core file emission, the script doesn't find it anyway because it is put # into /cores. - ulimit -c 0 - ulimit -t $ULIMIT + ULIMITCMD="$ULIMITCMD ulimit -c 0;" + ULIMITCMD="$ULIMITCMD ulimit -t $ULIMIT;" # To prevent infinite loops which fill up the disk, specify a limit on size of # files being output by the tests. 10 MB should be enough for anybody. ;) - ulimit -f 10485760 + ULIMITCMD="$ULIMITCMD ulimit -f 10485760;" ;; *) - ulimit -t $ULIMIT - ulimit -c unlimited + ULIMITCMD="$ULIMITCMD ulimit -t $ULIMIT;" + ULIMITCMD="$ULIMITCMD ulimit -c unlimited;" # To prevent infinite loops which fill up the disk, specify a limit on size of # files being output by the tests. 10 MB should be enough for anybody. ;) - ulimit -f 10485760 + ULIMITCMD="$ULIMITCMD ulimit -f 10485760;" esac rm -f core core.* @@ -101,7 +102,7 @@ fi if [ "x$RHOST" = x ] ; then - ( time -p sh -c "$COMMAND >$OUTFILE 2>&1 < $INFILE" ; echo exit $? ) 2>&1 \ + ( time -p sh -c "$ULIMITCMD $COMMAND >$OUTFILE 2>&1 < $INFILE" ; echo exit $? ) 2>&1 \ | awk -- '\ BEGIN { cpu = 0.0; } /^user/ { cpu += $2; print; } @@ -109,7 +110,7 @@ !/^user/ && !/^sys/ { print; } END { printf("program %f\n", cpu); }' > $OUTFILE.time else - ( rsh -l $RUSER $RHOST "cd $PWD; time -p $COMMAND >$OUTFILE.remote 2>&1 < $INFILE" ; echo exit $? ) 2>&1 \ + ( rsh -l $RUSER $RHOST "$ULIMITCMD cd $PWD; time -p $COMMAND >$OUTFILE.remote 2>&1 < $INFILE; echo exit \$?" ) 2>&1 \ | awk -- '\ BEGIN { cpu = 0.0; } /^user/ { cpu += $2; print; } From sabre at nondot.org Fri May 4 16:31:31 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 16:31:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705042131.l44LVVCq023116@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.34 -> 1.35 --- Log message: allow the 8-bit abbrev to be used for either bb or other values --- Diffs of the changes: (+6 -6) BitcodeWriter.cpp | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.34 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.35 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.34 Fri May 4 15:58:35 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Fri May 4 16:31:13 2007 @@ -714,9 +714,9 @@ if (VST.empty()) return; Stream.EnterSubblock(bitc::VALUE_SYMTAB_BLOCK_ID, 3); - { // 8-bit fixed width VST_ENTRY strings. + { // 8-bit fixed-width VST_ENTRY/VST_BBENTRY strings. BitCodeAbbrev *Abbv = new BitCodeAbbrev(); - Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8)); @@ -762,17 +762,17 @@ } - unsigned AbbrevToUse = 0; + unsigned AbbrevToUse = VST_ENTRY_8_ABBREV; - // VST_ENTRY: [valueid, namelen, namechar x N] - // VST_BBENTRY: [bbid, namelen, namechar x N] + // VST_ENTRY: [valueid, namechar x N] + // VST_BBENTRY: [bbid, namechar x N] unsigned Code; if (isa(SI->getValue())) { Code = bitc::VST_CODE_BBENTRY; if (is7Bit) AbbrevToUse = VST_BBENTRY_7_ABBREV; } else { Code = bitc::VST_CODE_ENTRY; - AbbrevToUse = is7Bit ? VST_ENTRY_7_ABBREV : VST_ENTRY_8_ABBREV; + if (is7Bit) AbbrevToUse = VST_ENTRY_7_ABBREV; } NameVals.push_back(VE.getValueID(SI->getValue())); From lauro.venancio at gmail.com Fri May 4 16:32:00 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 4 May 2007 16:32:00 -0500 Subject: [llvm-commits] CVS: llvm-test/RunSafely.sh Message-ID: <200705042132.l44LW0Rl023153@zion.cs.uiuc.edu> Changes in directory llvm-test: RunSafely.sh updated: 1.29 -> 1.30 --- Log message: Fix the previous patch: we don't want to count the time needed to run ULIMITCMD. --- Diffs of the changes: (+1 -1) RunSafely.sh | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/RunSafely.sh diff -u llvm-test/RunSafely.sh:1.29 llvm-test/RunSafely.sh:1.30 --- llvm-test/RunSafely.sh:1.29 Fri May 4 16:24:42 2007 +++ llvm-test/RunSafely.sh Fri May 4 16:31:42 2007 @@ -102,7 +102,7 @@ fi if [ "x$RHOST" = x ] ; then - ( time -p sh -c "$ULIMITCMD $COMMAND >$OUTFILE 2>&1 < $INFILE" ; echo exit $? ) 2>&1 \ + ( sh -c "$ULIMITCMD"; time -p sh -c "$COMMAND >$OUTFILE 2>&1 < $INFILE" ; echo exit $? ) 2>&1 \ | awk -- '\ BEGIN { cpu = 0.0; } /^user/ { cpu += $2; print; } From lauro.venancio at gmail.com Fri May 4 16:43:37 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 4 May 2007 16:43:37 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Vector/build2.c Message-ID: <200705042143.l44Lhbww023827@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Vector: build2.c updated: 1.1 -> 1.2 --- Log message: Implement SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+7 -1) build2.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm-test/SingleSource/UnitTests/Vector/build2.c diff -u llvm-test/SingleSource/UnitTests/Vector/build2.c:1.1 llvm-test/SingleSource/UnitTests/Vector/build2.c:1.2 --- llvm-test/SingleSource/UnitTests/Vector/build2.c:1.1 Fri Apr 21 18:22:23 2006 +++ llvm-test/SingleSource/UnitTests/Vector/build2.c Fri May 4 16:43:19 2007 @@ -62,7 +62,13 @@ v4f32 y = {0.0f, 0.0f, 0.0f, 0.0f}; v4f32 z = {0.0f, 0.0f, 0.0f, 0.0f}; - for (j = 0; j < 100; ++j) { +#ifdef SMALL_PROBLEM_SIZE +#define LENGTH 2 +#else +#define LENGTH 100 +#endif + + for (j = 0; j < LENGTH; ++j) { x = (v4f32){0.0f, 0.0f, 0.0f, 0.0f}; y = (v4f32){0.0f, 0.0f, 0.0f, 0.0f}; z = (v4f32){0.0f, 0.0f, 0.0f, 0.0f}; From dpatel at apple.com Fri May 4 16:44:40 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Fri, 4 May 2007 14:44:40 -0700 (PDT) Subject: [llvm-commits] [126898] Use one i32 instead of four i8 while emitting Message-ID: <20070504214440.41CF310CE5F8@src> Revision: 126898 Author: dpatel Date: 2007-05-04 14:44:39 -0700 (Fri, 04 May 2007) Log Message: ----------- Use one i32 instead of four i8 while emitting tail padding. This addresses first part of PR1278. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-types.cpp Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-05-04 21:04:24 UTC (rev 126897) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-05-04 21:44:39 UTC (rev 126898) @@ -1452,10 +1452,22 @@ "LLVM type size doesn't match GCC type size!"); uint64_t LLVMLastElementEnd = Info.getNewElementByteOffset(1); const Type *PadTy = Type::Int8Ty; - if (GCCTypeSize-LLVMLastElementEnd != 1) - PadTy = ArrayType::get(PadTy, GCCTypeSize-LLVMStructSize); - Info.addElement(PadTy, GCCTypeSize-LLVMLastElementEnd, - GCCTypeSize-LLVMLastElementEnd); + if (GCCTypeSize-LLVMLastElementEnd != 1) { + unsigned Int32ArraySize = (GCCTypeSize-LLVMStructSize)/4; + unsigned Int8ArraySize = (GCCTypeSize-LLVMStructSize) % 4; + if (Int32ArraySize != 0) { + PadTy = ArrayType::get(Type::Int32Ty, Int32ArraySize); + Info.addElement(PadTy, GCCTypeSize - LLVMLastElementEnd, + Int32ArraySize); + } + if (Int8ArraySize != 0) { + PadTy = ArrayType::get(Type::Int8Ty, Int8ArraySize); + Info.addElement(PadTy, GCCTypeSize - Info.getNewElementByteOffset(1), + Int8ArraySize); + } + } else + Info.addElement(PadTy, GCCTypeSize - LLVMLastElementEnd, + GCCTypeSize - LLVMLastElementEnd); } } From lauro.venancio at gmail.com Fri May 4 16:51:04 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 4 May 2007 16:51:04 -0500 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs Makefile.config.in Message-ID: <200705042151.l44Lp4Gw024284@zion.cs.uiuc.edu> Changes in directory llvm-test: Makefile.programs updated: 1.265 -> 1.266 Makefile.config.in updated: 1.25 -> 1.26 --- Log message: Merge Evan's remote test implementation with mine: Allow to define the crosscompilers (cross gcc and cross llvm-gcc). --- Diffs of the changes: (+33 -1) Makefile.config.in | 28 ++++++++++++++++++++++++++++ Makefile.programs | 6 +++++- 2 files changed, 33 insertions(+), 1 deletion(-) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.265 llvm-test/Makefile.programs:1.266 --- llvm-test/Makefile.programs:1.265 Thu May 3 16:32:39 2007 +++ llvm-test/Makefile.programs Fri May 4 16:50:39 2007 @@ -170,6 +170,10 @@ profile:: $(PROFOUTPUT) print-profile:: $(PRINTPROFOUTPUT) +# JIT remote tests are not supported yet. +ifdef REMOTE_HOST + DISABLE_JIT := 1 +endif ifdef RUN_GCC_ONLY DISABLE_DIFFS = 1 @@ -237,7 +241,7 @@ ifeq ($(ARCH),Sparc) LLCBETAOPTION := -enable-sparc-v9-insts endif -ifeq ($(TARGET_ARCH),ARM) +ifeq ($(ARCH),ARM) LLCBETAOPTION := -march=thumb endif Index: llvm-test/Makefile.config.in diff -u llvm-test/Makefile.config.in:1.25 llvm-test/Makefile.config.in:1.26 --- llvm-test/Makefile.config.in:1.25 Fri Feb 16 12:23:33 2007 +++ llvm-test/Makefile.config.in Fri May 4 16:50:39 2007 @@ -28,6 +28,34 @@ SourceDir=$(PROJ_SRC_DIR) endif +ifdef TARGET_ARCH +ARCH := $(TARGET_ARCH) +endif + +ifdef TARGET_CC +CC := $(TARGET_CC) +endif + +ifdef TARGET_CXX +CXX := $(TARGET_CXX) +endif + +ifdef TARGET_LLVMGCC +LLVMGCC := $(TARGET_LLVMGCC) +endif + +ifdef TARGET_LLVMGXX +LLVMGXX := $(TARGET_LLVMGXX) +endif + +ifdef TARGET_LLVMGCCDIR +LLVMGCCDIR := $(TARGET_LLVMGCCDIR) +endif + +ifdef TARGET_LLVMGCCLIBDIR +LLVMGCCLIBDIR := $(TARGET_LLVMGCCLIBDIR) +endif + # # Provide variables specific to llvm-test # From lauro.venancio at gmail.com Fri May 4 16:51:04 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 4 May 2007 16:51:04 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Makefile Message-ID: <200705042151.l44Lp4is024287@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource: Makefile updated: 1.12 -> 1.13 --- Log message: Merge Evan's remote test implementation with mine: Allow to define the crosscompilers (cross gcc and cross llvm-gcc). --- Diffs of the changes: (+7 -1) Makefile | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm-test/SingleSource/Makefile diff -u llvm-test/SingleSource/Makefile:1.12 llvm-test/SingleSource/Makefile:1.13 --- llvm-test/SingleSource/Makefile:1.12 Wed Sep 1 09:33:26 2004 +++ llvm-test/SingleSource/Makefile Fri May 4 16:50:39 2007 @@ -1,5 +1,11 @@ LEVEL = .. -PARALLEL_DIRS = UnitTests Regression Benchmarks CustomChecked + +PARALLEL_DIRS = UnitTests Regression Benchmarks + +ifndef REMOTE_HOST +PARALLEL_DIRS += CustomChecked +endif + LDFLAGS += -lm include Makefile.singlesrc From lauro.venancio at gmail.com Fri May 4 17:08:06 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 4 May 2007 19:08:06 -0300 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp In-Reply-To: <401819E6-C1E7-411D-AB05-79EFCDD8D79A@apple.com> References: <200705040027.l440RHSu010755@zion.cs.uiuc.edu> <419C73E0-2540-4E30-97FF-F7DA1CB49448@apple.com> <401819E6-C1E7-411D-AB05-79EFCDD8D79A@apple.com> Message-ID: <9c10c9f0705041508x29df2150m6b52611f7bffc01@mail.gmail.com> Nowadays we have two functions for the GV lowering: one for ELF and one for Darwin. So, the ELF and Darwin GV lowering implementations are completely different and ELF doesn't use the auxiliary function GVIsIndirectSymbol. Lauro 2007/5/3, Evan Cheng : > > No idea. Lauro? > > Evan > On May 3, 2007, at 5:33 PM, Chris Lattner wrote: > > > > > On May 3, 2007, at 5:27 PM, Evan Cheng wrote: > > > >> > >> > >> Changes in directory llvm/lib/Target/ARM: > >> > >> ARMISelLowering.cpp updated: 1.49 -> 1.50 > >> --- > >> Log message: > >> > >> On Mac OS X, GV requires an extra load only when relocation-model > >> is non-static. > > > > Does ELF do something similar? If not, this should probably be > > method on ARMSubTarget, like the X86 backend does. > > > > -Chris > > > >> --- > >> Diffs of the changes: (+6 -5) > >> > >> ARMISelLowering.cpp | 11 ++++++----- > >> 1 files changed, 6 insertions(+), 5 deletions(-) > >> > >> > >> Index: llvm/lib/Target/ARM/ARMISelLowering.cpp > >> diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.49 llvm/lib/ > >> Target/ARM/ARMISelLowering.cpp:1.50 > >> --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.49 Thu May 3 > >> 15:28:35 2007 > >> +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Thu May 3 19:26:58 2007 > >> @@ -812,10 +812,11 @@ > >> } > >> > >> /// GVIsIndirectSymbol - true if the GV will be accessed via an > >> indirect symbol > >> -/// even in dynamic-no-pic mode. > >> -static bool GVIsIndirectSymbol(GlobalValue *GV) { > >> - return (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || > >> - (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode > >> ())); > >> +/// even in non-static mode. > >> +static bool GVIsIndirectSymbol(GlobalValue *GV, Reloc::Model > >> RelocM) { > >> + return RelocM != Reloc::Static && > >> + (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || > >> + (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode())); > >> } > >> > >> SDOperand ARMTargetLowering::LowerGlobalAddressDarwin(SDOperand Op, > >> @@ -823,7 +824,7 @@ > >> MVT::ValueType PtrVT = getPointerTy(); > >> GlobalValue *GV = cast(Op)->getGlobal(); > >> Reloc::Model RelocM = getTargetMachine().getRelocationModel(); > >> - bool IsIndirect = GVIsIndirectSymbol(GV); > >> + bool IsIndirect = GVIsIndirectSymbol(GV, RelocM); > >> SDOperand CPAddr; > >> if (RelocM == Reloc::Static) > >> CPAddr = DAG.getTargetConstantPool(GV, PtrVT, 2); > >> > >> > >> > >> _______________________________________________ > >> 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 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070504/c4e43228/attachment.html From clattner at apple.com Fri May 4 17:12:11 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 4 May 2007 15:12:11 -0700 Subject: [llvm-commits] [126898] Use one i32 instead of four i8 while emitting In-Reply-To: <20070504214440.41CF310CE5F8@src> References: <20070504214440.41CF310CE5F8@src> Message-ID: <2956D97C-9144-4B3D-972A-377128BC6D20@apple.com> On May 4, 2007, at 2:44 PM, dpatel at apple.com wrote: > ----------- > Use one i32 instead of four i8 while emitting > tail padding. > > This addresses first part of PR1278. Cool. Does this do the right thing if the end of a struct is not 4- byte aligned? If the struct requires 7 bytes of tail padding, for example, it would often be wrong to emit an i32 then [3 x i8], because there will be padding before the i32. -Chris From clattner at apple.com Fri May 4 17:13:13 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 4 May 2007 15:13:13 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp In-Reply-To: <9c10c9f0705041508x29df2150m6b52611f7bffc01@mail.gmail.com> References: <200705040027.l440RHSu010755@zion.cs.uiuc.edu> <419C73E0-2540-4E30-97FF-F7DA1CB49448@apple.com> <401819E6-C1E7-411D-AB05-79EFCDD8D79A@apple.com> <9c10c9f0705041508x29df2150m6b52611f7bffc01@mail.gmail.com> Message-ID: <97DDC472-68BF-4256-ACB3-97A05DAB51C3@apple.com> On May 4, 2007, at 3:08 PM, Lauro Ramos Venancio wrote: > Nowadays we have two functions for the GV lowering: one for ELF and > one for Darwin. So, the ELF and Darwin GV lowering implementations > are completely different and ELF doesn't use the auxiliary function > GVIsIndirectSymbol. Great point. Thanks Lauro, -Chris From lauro.venancio at gmail.com Fri May 4 17:16:47 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 4 May 2007 17:16:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARM.td Message-ID: <200705042216.l44MGlXN025917@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARM.td updated: 1.4 -> 1.5 --- Log message: Add a processor. --- Diffs of the changes: (+1 -0) ARM.td | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Target/ARM/ARM.td diff -u llvm/lib/Target/ARM/ARM.td:1.4 llvm/lib/Target/ARM/ARM.td:1.5 --- llvm/lib/Target/ARM/ARM.td:1.4 Fri Jan 19 01:51:42 2007 +++ llvm/lib/Target/ARM/ARM.td Fri May 4 17:16:30 2007 @@ -67,6 +67,7 @@ // V5TE Processors. def : Proc<"arm9e", [ArchV5TE]>; +def : Proc<"arm926ej-s", [ArchV5TE]>; def : Proc<"arm946e-s", [ArchV5TE]>; def : Proc<"arm966e-s", [ArchV5TE]>; def : Proc<"arm968e-s", [ArchV5TE]>; From dpatel at apple.com Fri May 4 17:17:22 2007 From: dpatel at apple.com (Devang Patel) Date: Fri, 4 May 2007 15:17:22 -0700 Subject: [llvm-commits] [126898] Use one i32 instead of four i8 while emitting In-Reply-To: <2956D97C-9144-4B3D-972A-377128BC6D20@apple.com> References: <20070504214440.41CF310CE5F8@src> <2956D97C-9144-4B3D-972A-377128BC6D20@apple.com> Message-ID: <743A01A9-C604-4F8C-83E5-C6513F4CD928@apple.com> On May 4, 2007, at 3:12 PM, Chris Lattner wrote: > > On May 4, 2007, at 2:44 PM, dpatel at apple.com wrote: > >> ----------- >> Use one i32 instead of four i8 while emitting >> tail padding. >> >> This addresses first part of PR1278. > > Cool. Does this do the right thing if the end of a struct is not 4- > byte aligned? If the struct requires 7 bytes of tail padding, for > example, it would often be wrong to emit an i32 then [3 x i8], > because there will be padding before the i32. I think, it does right thing. But I'll double check. - Devang From clattner at apple.com Fri May 4 17:20:56 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 4 May 2007 15:20:56 -0700 Subject: [llvm-commits] [126898] Use one i32 instead of four i8 while emitting In-Reply-To: <743A01A9-C604-4F8C-83E5-C6513F4CD928@apple.com> References: <20070504214440.41CF310CE5F8@src> <2956D97C-9144-4B3D-972A-377128BC6D20@apple.com> <743A01A9-C604-4F8C-83E5-C6513F4CD928@apple.com> Message-ID: On May 4, 2007, at 3:17 PM, Devang Patel wrote: > > On May 4, 2007, at 3:12 PM, Chris Lattner wrote: > >> >> On May 4, 2007, at 2:44 PM, dpatel at apple.com wrote: >> >>> ----------- >>> Use one i32 instead of four i8 while emitting >>> tail padding. >>> >>> This addresses first part of PR1278. >> >> Cool. Does this do the right thing if the end of a struct is not 4- >> byte aligned? If the struct requires 7 bytes of tail padding, for >> example, it would often be wrong to emit an i32 then [3 x i8], >> because there will be padding before the i32. > > I think, it does right thing. But I'll double check. Thanks! -Chris From dpatel at apple.com Fri May 4 18:10:13 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Fri, 4 May 2007 16:10:13 -0700 (PDT) Subject: [llvm-commits] [126899] Revert previous patch. Message-ID: <20070504231013.DF2591149BDB@src> Revision: 126899 Author: dpatel Date: 2007-05-04 16:10:12 -0700 (Fri, 04 May 2007) Log Message: ----------- Revert previous patch. It does not handle all cases properly. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-types.cpp Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-05-04 21:44:39 UTC (rev 126898) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-05-04 23:10:12 UTC (rev 126899) @@ -1452,22 +1452,10 @@ "LLVM type size doesn't match GCC type size!"); uint64_t LLVMLastElementEnd = Info.getNewElementByteOffset(1); const Type *PadTy = Type::Int8Ty; - if (GCCTypeSize-LLVMLastElementEnd != 1) { - unsigned Int32ArraySize = (GCCTypeSize-LLVMStructSize)/4; - unsigned Int8ArraySize = (GCCTypeSize-LLVMStructSize) % 4; - if (Int32ArraySize != 0) { - PadTy = ArrayType::get(Type::Int32Ty, Int32ArraySize); - Info.addElement(PadTy, GCCTypeSize - LLVMLastElementEnd, - Int32ArraySize); - } - if (Int8ArraySize != 0) { - PadTy = ArrayType::get(Type::Int8Ty, Int8ArraySize); - Info.addElement(PadTy, GCCTypeSize - Info.getNewElementByteOffset(1), - Int8ArraySize); - } - } else - Info.addElement(PadTy, GCCTypeSize - LLVMLastElementEnd, - GCCTypeSize - LLVMLastElementEnd); + if (GCCTypeSize-LLVMLastElementEnd != 1) + PadTy = ArrayType::get(PadTy, GCCTypeSize-LLVMStructSize); + Info.addElement(PadTy, GCCTypeSize-LLVMLastElementEnd, + GCCTypeSize-LLVMLastElementEnd); } } From dpatel at apple.com Fri May 4 18:11:03 2007 From: dpatel at apple.com (Devang Patel) Date: Fri, 4 May 2007 16:11:03 -0700 Subject: [llvm-commits] [126898] Use one i32 instead of four i8 while emitting In-Reply-To: <2956D97C-9144-4B3D-972A-377128BC6D20@apple.com> References: <20070504214440.41CF310CE5F8@src> <2956D97C-9144-4B3D-972A-377128BC6D20@apple.com> Message-ID: On May 4, 2007, at 3:12 PM, Chris Lattner wrote: > > On May 4, 2007, at 2:44 PM, dpatel at apple.com wrote: > >> ----------- >> Use one i32 instead of four i8 while emitting >> tail padding. >> >> This addresses first part of PR1278. > > Cool. Does this do the right thing if the end of a struct is not 4- > byte aligned? It does not. I reverted this patch for now. Thanks for caching this. - Devang > If the struct requires 7 bytes of tail padding, for > example, it would often be wrong to emit an i32 then [3 x i8], > because there will be padding before the i32. From clattner at apple.com Fri May 4 18:14:21 2007 From: clattner at apple.com (Chris Lattner) Date: Fri, 4 May 2007 16:14:21 -0700 Subject: [llvm-commits] [126898] Use one i32 instead of four i8 while emitting In-Reply-To: References: <20070504214440.41CF310CE5F8@src> <2956D97C-9144-4B3D-972A-377128BC6D20@apple.com> Message-ID: <03FAF8E1-C68F-41DC-9F4E-DA7FD5DDF445@apple.com> On May 4, 2007, at 4:11 PM, Devang Patel wrote: > > On May 4, 2007, at 3:12 PM, Chris Lattner wrote: > >> >> On May 4, 2007, at 2:44 PM, dpatel at apple.com wrote: >> >>> ----------- >>> Use one i32 instead of four i8 while emitting >>> tail padding. >>> >>> This addresses first part of PR1278. >> >> Cool. Does this do the right thing if the end of a struct is not 4- >> byte aligned? > > It does not. I reverted this patch for now. Thanks for caching this. Thanks! -Chris From lauro.venancio at gmail.com Fri May 4 18:41:28 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 4 May 2007 20:41:28 -0300 Subject: [llvm-commits] [llvm-gcc patch] when -mthumb is used, we must emit the triple thumb-linux-gnueabi or thumb-apple-darwin Message-ID: <9c10c9f0705041641n4d4e370bg664a74a7d3982877@mail.gmail.com> Please, someone commit this patch. This is a bugfix and it is important for thumb remote tests. Lauro -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070504/910c36be/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: llvm-gcc-thumb.patch Type: text/x-patch Size: 316 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070504/910c36be/attachment.bin From echeng at apple.com Fri May 4 18:57:27 2007 From: echeng at apple.com (echeng at apple.com) Date: Fri, 4 May 2007 16:57:27 -0700 (PDT) Subject: [llvm-commits] [126900] When -mthumb is used, we must emit the triple thumb-linux-gnueabi or thumb-apple-darwin ( committed for Lauro). Message-ID: <20070504235727.CC9D31155247@src> Revision: 126900 Author: echeng Date: 2007-05-04 16:57:27 -0700 (Fri, 04 May 2007) Log Message: ----------- When -mthumb is used, we must emit the triple thumb-linux-gnueabi or thumb-apple-darwin (committed for Lauro). Modified Paths: -------------- apple-local/branches/llvm/gcc/config/arm/arm.h Modified: apple-local/branches/llvm/gcc/config/arm/arm.h =================================================================== --- apple-local/branches/llvm/gcc/config/arm/arm.h 2007-05-04 23:10:12 UTC (rev 126899) +++ apple-local/branches/llvm/gcc/config/arm/arm.h 2007-05-04 23:57:27 UTC (rev 126900) @@ -2920,4 +2920,7 @@ } \ } +#define LLVM_OVERRIDE_TARGET_ARCH() \ + (TARGET_THUMB ? "thumb" : "arm") + #endif /* ! GCC_ARM_H */ From echeng at apple.com Fri May 4 18:59:58 2007 From: echeng at apple.com (echeng at apple.com) Date: Fri, 4 May 2007 16:59:58 -0700 (PDT) Subject: [llvm-commits] [126901] LLVM_OVERRIDE_TARGET_ARCH should return empty string if it doesn' t override the default target. Message-ID: <20070504235958.AF8AF11552CB@src> Revision: 126901 Author: echeng Date: 2007-05-04 16:59:58 -0700 (Fri, 04 May 2007) Log Message: ----------- LLVM_OVERRIDE_TARGET_ARCH should return empty string if it doesn't override the default target. Modified Paths: -------------- apple-local/branches/llvm/gcc/config/arm/arm.h Modified: apple-local/branches/llvm/gcc/config/arm/arm.h =================================================================== --- apple-local/branches/llvm/gcc/config/arm/arm.h 2007-05-04 23:57:27 UTC (rev 126900) +++ apple-local/branches/llvm/gcc/config/arm/arm.h 2007-05-04 23:59:58 UTC (rev 126901) @@ -2921,6 +2921,6 @@ } #define LLVM_OVERRIDE_TARGET_ARCH() \ - (TARGET_THUMB ? "thumb" : "arm") + (TARGET_THUMB ? "thumb" : "") #endif /* ! GCC_ARM_H */ From evan.cheng at apple.com Fri May 4 19:00:44 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 4 May 2007 17:00:44 -0700 Subject: [llvm-commits] [llvm-gcc patch] when -mthumb is used, we must emit the triple thumb-linux-gnueabi or thumb-apple-darwin In-Reply-To: <9c10c9f0705041641n4d4e370bg664a74a7d3982877@mail.gmail.com> References: <9c10c9f0705041641n4d4e370bg664a74a7d3982877@mail.gmail.com> Message-ID: <736EEEDE-B3A4-41AE-B8D6-F131A12359AD@apple.com> Actually LLVM_OVERRIDE_TARGET_ARCH should return "" if the default should not be overridden. Committed. Thanks, Evan On May 4, 2007, at 4:41 PM, Lauro Ramos Venancio wrote: > Please, someone commit this patch. This is a bugfix and it is > important for thumb remote tests. > > Lauro > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From lauro.venancio at gmail.com Fri May 4 19:00:54 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Fri, 4 May 2007 19:00:54 -0500 Subject: [llvm-commits] CVS: llvm-test/Makefile.config.in Message-ID: <200705050000.l4500sIV028064@zion.cs.uiuc.edu> Changes in directory llvm-test: Makefile.config.in updated: 1.26 -> 1.27 --- Log message: Enable thumb tests. --- Diffs of the changes: (+4 -0) Makefile.config.in | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm-test/Makefile.config.in diff -u llvm-test/Makefile.config.in:1.26 llvm-test/Makefile.config.in:1.27 --- llvm-test/Makefile.config.in:1.26 Fri May 4 16:50:39 2007 +++ llvm-test/Makefile.config.in Fri May 4 19:00:36 2007 @@ -56,6 +56,10 @@ LLVMGCCLIBDIR := $(TARGET_LLVMGCCLIBDIR) endif +ifeq ($(ARCH),THUMB) +TARGET_FLAGS += -mthumb +endif + # # Provide variables specific to llvm-test # From sabre at nondot.org Fri May 4 19:16:49 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 19:16:49 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/BitCodes.h BitstreamReader.h BitstreamWriter.h Message-ID: <200705050016.l450Gnsc028434@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: BitCodes.h updated: 1.5 -> 1.6 BitstreamReader.h updated: 1.14 -> 1.15 BitstreamWriter.h updated: 1.10 -> 1.11 --- Log message: Implement support for globally associating abbrevs with block IDs, which relieves us from having to emit the abbrevs into each instance of the block. This shrinks kc.bit from 3368K to 3333K, but will be a more significant win once instructions are abbreviated. The VST went from: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.29508e+07b/1.61885e+06B/404713W Average Size: 5522.73b/690.342B/172.585W % of file: 48.0645 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 7035/3 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 to: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.26713e+07b/1.58391e+06B/395978W Average Size: 5403.53b/675.442B/168.86W % of file: 47.5198 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 0/0 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 because we didn't emit the same 3 abbrevs 2345 times :) --- Diffs of the changes: (+213 -12) BitCodes.h | 5 +- BitstreamReader.h | 102 ++++++++++++++++++++++++++++++++++++++++++++++ BitstreamWriter.h | 118 +++++++++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 213 insertions(+), 12 deletions(-) Index: llvm/include/llvm/Bitcode/BitCodes.h diff -u llvm/include/llvm/Bitcode/BitCodes.h:1.5 llvm/include/llvm/Bitcode/BitCodes.h:1.6 --- llvm/include/llvm/Bitcode/BitCodes.h:1.5 Fri May 4 15:33:47 2007 +++ llvm/include/llvm/Bitcode/BitCodes.h Fri May 4 19:16:30 2007 @@ -66,8 +66,9 @@ /// BlockInfoCodes - The blockinfo block contains metadata about user-defined /// blocks. enum BlockInfoCodes { - BLOCKINFO_CODE_SETBID = 1, // SETBID: [blockid#] - BLOCKINFO_CODE_ABBREV = 2 // ABBREV: [standard abbrev encoding] + BLOCKINFO_CODE_SETBID = 1 // SETBID: [blockid#] + // DEFINE_ABBREV has magic semantics here, applying to the current SETBID'd + // block, instead of the BlockInfo block. // BLOCKNAME: give string name to block, if desired. }; Index: llvm/include/llvm/Bitcode/BitstreamReader.h diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.14 llvm/include/llvm/Bitcode/BitstreamReader.h:1.15 --- llvm/include/llvm/Bitcode/BitstreamReader.h:1.14 Fri May 4 15:33:47 2007 +++ llvm/include/llvm/Bitcode/BitstreamReader.h Fri May 4 19:16:30 2007 @@ -48,6 +48,14 @@ /// BlockScope - This tracks the codesize of parent blocks. SmallVector BlockScope; + /// BlockInfo - This contains information emitted to BLOCKINFO_BLOCK blocks. + /// These describe abbreviations that all blocks of the specified ID inherit. + struct BlockInfo { + unsigned BlockID; + std::vector Abbrevs; + }; + std::vector BlockInfoRecords; + /// FirstChar - This remembers the first byte of the stream. const unsigned char *FirstChar; public: @@ -82,6 +90,15 @@ for (unsigned i = 0, e = Abbrevs.size(); i != e; ++i) Abbrevs[i]->dropRef(); } + + // Free the BlockInfoRecords. + while (!BlockInfoRecords.empty()) { + BlockInfo &Info = BlockInfoRecords.back(); + // Free blockinfo abbrev info. + for (unsigned i = 0, e = Info.Abbrevs.size(); i != e; ++i) + Info.Abbrevs[i]->dropRef(); + BlockInfoRecords.pop_back(); + } } bool AtEndOfStream() const { return NextChar == LastChar; } @@ -206,6 +223,22 @@ // Block Manipulation //===--------------------------------------------------------------------===// +private: + /// getBlockInfo - If there is block info for the specified ID, return it, + /// otherwise return null. + BlockInfo *getBlockInfo(unsigned BlockID) { + // Common case, the most recent entry matches BlockID. + if (!BlockInfoRecords.empty() && BlockInfoRecords.back().BlockID == BlockID) + return &BlockInfoRecords.back(); + + for (unsigned i = 0, e = BlockInfoRecords.size(); i != e; ++i) + if (BlockInfoRecords[i].BlockID == BlockID) + return &BlockInfoRecords[i]; + return 0; + } +public: + + // Block header: // [ENTER_SUBBLOCK, blockid, newcodelen, , blocklen] @@ -236,10 +269,19 @@ /// EnterSubBlock - Having read the ENTER_SUBBLOCK abbrevid, read and enter /// the block, returning the BlockID of the block we just entered. - bool EnterSubBlock(unsigned *NumWordsP = 0) { + bool EnterSubBlock(unsigned BlockID, unsigned *NumWordsP = 0) { + // Save the current block's state on BlockScope. BlockScope.push_back(Block(CurCodeSize)); BlockScope.back().PrevAbbrevs.swap(CurAbbrevs); + // Add the abbrevs specific to this block to the CurAbbrevs list. + if (BlockInfo *Info = getBlockInfo(BlockID)) { + for (unsigned i = 0, e = Info->Abbrevs.size(); i != e; ++i) { + CurAbbrevs.push_back(Info->Abbrevs[i]); + CurAbbrevs.back()->addRef(); + } + } + // Get the codesize of this block. CurCodeSize = ReadVBR(bitc::CodeLenWidth); SkipToWord(); @@ -352,6 +394,64 @@ } CurAbbrevs.push_back(Abbv); } + + //===--------------------------------------------------------------------===// + // BlockInfo Block Reading + //===--------------------------------------------------------------------===// + +private: + BlockInfo &getOrCreateBlockInfo(unsigned BlockID) { + if (BlockInfo *BI = getBlockInfo(BlockID)) + return *BI; + + // Otherwise, add a new record. + BlockInfoRecords.push_back(BlockInfo()); + BlockInfoRecords.back().BlockID = BlockID; + return BlockInfoRecords.back(); + } + +public: + + bool ReadBlockInfoBlock() { + if (EnterSubBlock(bitc::BLOCKINFO_BLOCK_ID)) return true; + + SmallVector Record; + BlockInfo *CurBlockInfo = 0; + + // Read all the records for this module. + while (1) { + unsigned Code = ReadCode(); + if (Code == bitc::END_BLOCK) + return ReadBlockEnd(); + if (Code == bitc::ENTER_SUBBLOCK) { + ReadSubBlockID(); + if (SkipBlock()) return true; + continue; + } + + // Read abbrev records, associate them with CurBID. + if (Code == bitc::DEFINE_ABBREV) { + if (!CurBlockInfo) return true; + ReadAbbrevRecord(); + + // ReadAbbrevRecord installs the abbrev in CurAbbrevs. Move it to the + // appropriate BlockInfo. + BitCodeAbbrev *Abbv = CurAbbrevs.back(); + CurAbbrevs.pop_back(); + CurBlockInfo->Abbrevs.push_back(Abbv); + continue; + } + + // Read a record. + switch (ReadRecord(Code, Record)) { + default: break; // Default behavior, ignore unknown content. + case bitc::BLOCKINFO_CODE_SETBID: + if (Record.size() < 1) return true; + CurBlockInfo = &getOrCreateBlockInfo(Record[0]); + break; + } + } + } }; } // End llvm namespace Index: llvm/include/llvm/Bitcode/BitstreamWriter.h diff -u llvm/include/llvm/Bitcode/BitstreamWriter.h:1.10 llvm/include/llvm/Bitcode/BitstreamWriter.h:1.11 --- llvm/include/llvm/Bitcode/BitstreamWriter.h:1.10 Fri May 4 15:40:50 2007 +++ llvm/include/llvm/Bitcode/BitstreamWriter.h Fri May 4 19:16:30 2007 @@ -29,10 +29,14 @@ /// CurValue - The current value. Only bits < CurBit are valid. uint32_t CurValue; - // CurCodeSize - This is the declared size of code values used for the current - // block, in bits. + /// CurCodeSize - This is the declared size of code values used for the + /// current block, in bits. unsigned CurCodeSize; + /// BlockInfoCurBID - When emitting a BLOCKINFO_BLOCK, this is the currently + /// selected BLOCK ID. + unsigned BlockInfoCurBID; + /// CurAbbrevs - Abbrevs installed at in this block. std::vector CurAbbrevs; @@ -46,6 +50,14 @@ /// BlockScope - This tracks the current blocks that we have entered. std::vector BlockScope; + /// BlockInfo - This contains information emitted to BLOCKINFO_BLOCK blocks. + /// These describe abbreviations that all blocks of the specified ID inherit. + struct BlockInfo { + unsigned BlockID; + std::vector Abbrevs; + }; + std::vector BlockInfoRecords; + public: BitstreamWriter(std::vector &O) : Out(O), CurBit(0), CurValue(0), CurCodeSize(2) {} @@ -53,6 +65,15 @@ ~BitstreamWriter() { assert(CurBit == 0 && "Unflused data remaining"); assert(BlockScope.empty() && CurAbbrevs.empty() && "Block imbalance"); + + // Free the BlockInfoRecords. + while (!BlockInfoRecords.empty()) { + BlockInfo &Info = BlockInfoRecords.back(); + // Free blockinfo abbrev info. + for (unsigned i = 0, e = Info.Abbrevs.size(); i != e; ++i) + Info.Abbrevs[i]->dropRef(); + BlockInfoRecords.pop_back(); + } } //===--------------------------------------------------------------------===// // Basic Primitives for emitting bits to the stream. @@ -139,6 +160,19 @@ // Block Manipulation //===--------------------------------------------------------------------===// + /// getBlockInfo - If there is block info for the specified ID, return it, + /// otherwise return null. + BlockInfo *getBlockInfo(unsigned BlockID) { + // Common case, the most recent entry matches BlockID. + if (!BlockInfoRecords.empty() && BlockInfoRecords.back().BlockID == BlockID) + return &BlockInfoRecords.back(); + + for (unsigned i = 0, e = BlockInfoRecords.size(); i != e; ++i) + if (BlockInfoRecords[i].BlockID == BlockID) + return &BlockInfoRecords[i]; + return 0; + } + void EnterSubblock(unsigned BlockID, unsigned CodeLen) { // Block header: // [ENTER_SUBBLOCK, blockid, newcodelen, , blocklen] @@ -146,13 +180,28 @@ EmitVBR(BlockID, bitc::BlockIDWidth); EmitVBR(CodeLen, bitc::CodeLenWidth); FlushToWord(); - BlockScope.push_back(Block(CurCodeSize, Out.size()/4)); - BlockScope.back().PrevAbbrevs.swap(CurAbbrevs); + + unsigned BlockSizeWordLoc = Out.size(); + unsigned OldCodeSize = CurCodeSize; // Emit a placeholder, which will be replaced when the block is popped. Emit(0, bitc::BlockSizeWidth); CurCodeSize = CodeLen; + + // Push the outer block's abbrev set onto the stack, start out with an + // empty abbrev set. + BlockScope.push_back(Block(OldCodeSize, BlockSizeWordLoc/4)); + BlockScope.back().PrevAbbrevs.swap(CurAbbrevs); + + // If there is a blockinfo for this BlockID, add all the predefined abbrevs + // to the abbrev list. + if (BlockInfo *Info = getBlockInfo(BlockID)) { + for (unsigned i = 0, e = Info->Abbrevs.size(); i != e; ++i) { + CurAbbrevs.push_back(Info->Abbrevs[i]); + Info->Abbrevs[i]->addRef(); + } + } } void ExitBlock() { @@ -261,15 +310,14 @@ EmitVBR64(Vals[i], 6); } } - + //===--------------------------------------------------------------------===// // Abbrev Emission //===--------------------------------------------------------------------===// - /// EmitAbbrev - This emits an abbreviation to the stream. Note that this - /// method takes ownership of the specified abbrev. - unsigned EmitAbbrev(BitCodeAbbrev *Abbv) { - // Emit the abbreviation as a record. +private: + // Emit the abbreviation as a DEFINE_ABBREV record. + void EncodeAbbrev(BitCodeAbbrev *Abbv) { EmitCode(bitc::DEFINE_ABBREV); EmitVBR(Abbv->getNumOperandInfos(), 5); for (unsigned i = 0, e = Abbv->getNumOperandInfos(); i != e; ++i) { @@ -283,10 +331,62 @@ EmitVBR64(Op.getEncodingData(), 5); } } + } +public: + /// EmitAbbrev - This emits an abbreviation to the stream. Note that this + /// method takes ownership of the specified abbrev. + unsigned EmitAbbrev(BitCodeAbbrev *Abbv) { + // Emit the abbreviation as a record. + EncodeAbbrev(Abbv); CurAbbrevs.push_back(Abbv); return CurAbbrevs.size()-1+bitc::FIRST_APPLICATION_ABBREV; } + + //===--------------------------------------------------------------------===// + // BlockInfo Block Emission + //===--------------------------------------------------------------------===// + + /// EnterBlockInfoBlock - Start emitting the BLOCKINFO_BLOCK. + void EnterBlockInfoBlock(unsigned CodeWidth) { + EnterSubblock(bitc::BLOCKINFO_BLOCK_ID, CodeWidth); + BlockInfoCurBID = -1U; + } +private: + /// SwitchToBlockID - If we aren't already talking about the specified block + /// ID, emit a BLOCKINFO_CODE_SETBID record. + void SwitchToBlockID(unsigned BlockID) { + if (BlockInfoCurBID == BlockID) return; + SmallVector V; + V.push_back(BlockID); + EmitRecord(bitc::BLOCKINFO_CODE_SETBID, V); + BlockInfoCurBID = BlockID; + } + + BlockInfo &getOrCreateBlockInfo(unsigned BlockID) { + if (BlockInfo *BI = getBlockInfo(BlockID)) + return *BI; + + // Otherwise, add a new record. + BlockInfoRecords.push_back(BlockInfo()); + BlockInfoRecords.back().BlockID = BlockID; + return BlockInfoRecords.back(); + } + +public: + + /// EmitBlockInfoAbbrev - Emit a DEFINE_ABBREV record for the specified + /// BlockID. + unsigned EmitBlockInfoAbbrev(unsigned BlockID, BitCodeAbbrev *Abbv) { + SwitchToBlockID(BlockID); + EncodeAbbrev(Abbv); + + // Add the abbrev to the specified block record. + BlockInfo &Info = getOrCreateBlockInfo(BlockID); + Info.Abbrevs.push_back(Abbv); + + return Info.Abbrevs.size()-1+bitc::FIRST_APPLICATION_ABBREV; + } }; From sabre at nondot.org Fri May 4 19:17:24 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 19:17:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp Message-ID: <200705050017.l450HOgh028478@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.37 -> 1.38 --- Log message: Implement support for globally associating abbrevs with block IDs, which relieves us from having to emit the abbrevs into each instance of the block. This shrinks kc.bit from 3368K to 3333K, but will be a more significant win once instructions are abbreviated. The VST went from: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.29508e+07b/1.61885e+06B/404713W Average Size: 5522.73b/690.342B/172.585W % of file: 48.0645 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 7035/3 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 to: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.26713e+07b/1.58391e+06B/395978W Average Size: 5403.53b/675.442B/168.86W % of file: 47.5198 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 0/0 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 because we didn't emit the same 3 abbrevs 2345 times :) --- Diffs of the changes: (+18 -10) BitcodeReader.cpp | 28 ++++++++++++++++++---------- 1 files changed, 18 insertions(+), 10 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.37 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.38 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.37 Fri May 4 14:11:41 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Fri May 4 19:17:00 2007 @@ -182,7 +182,7 @@ //===----------------------------------------------------------------------===// bool BitcodeReader::ParseParamAttrBlock() { - if (Stream.EnterSubBlock()) + if (Stream.EnterSubBlock(bitc::PARAMATTR_BLOCK_ID)) return Error("Malformed block record"); if (!ParamAttrs.empty()) @@ -239,7 +239,7 @@ bool BitcodeReader::ParseTypeTable() { - if (Stream.EnterSubBlock()) + if (Stream.EnterSubBlock(bitc::TYPE_BLOCK_ID)) return Error("Malformed block record"); if (!TypeList.empty()) @@ -378,7 +378,7 @@ bool BitcodeReader::ParseTypeSymbolTable() { - if (Stream.EnterSubBlock()) + if (Stream.EnterSubBlock(bitc::TYPE_SYMTAB_BLOCK_ID)) return Error("Malformed block record"); SmallVector Record; @@ -426,7 +426,7 @@ } bool BitcodeReader::ParseValueSymbolTable() { - if (Stream.EnterSubBlock()) + if (Stream.EnterSubBlock(bitc::VALUE_SYMTAB_BLOCK_ID)) return Error("Malformed block record"); SmallVector Record; @@ -536,7 +536,7 @@ bool BitcodeReader::ParseConstants() { - if (Stream.EnterSubBlock()) + if (Stream.EnterSubBlock(bitc::CONSTANTS_BLOCK_ID)) return Error("Malformed block record"); SmallVector Record; @@ -768,7 +768,7 @@ if (TheModule) return Error("Multiple MODULE_BLOCKs in same stream"); - if (Stream.EnterSubBlock()) + if (Stream.EnterSubBlock(bitc::MODULE_BLOCK_ID)) return Error("Malformed block record"); // Otherwise, create the module. @@ -1022,11 +1022,19 @@ unsigned BlockID = Stream.ReadSubBlockID(); // We only know the MODULE subblock ID. - if (BlockID == bitc::MODULE_BLOCK_ID) { + switch (BlockID) { + case bitc::BLOCKINFO_BLOCK_ID: + if (Stream.ReadBlockInfoBlock()) + return Error("Malformed BlockInfoBlock"); + break; + case bitc::MODULE_BLOCK_ID: if (ParseModule(Buffer->getBufferIdentifier())) return true; - } else if (Stream.SkipBlock()) { - return Error("Malformed block record"); + break; + default: + if (Stream.SkipBlock()) + return Error("Malformed block record"); + break; } } @@ -1072,7 +1080,7 @@ /// ParseFunctionBody - Lazily parse the specified function body block. bool BitcodeReader::ParseFunctionBody(Function *F) { - if (Stream.EnterSubBlock()) + if (Stream.EnterSubBlock(bitc::FUNCTION_BLOCK_ID)) return Error("Malformed block record"); unsigned ModuleValueListSize = ValueList.size(); From sabre at nondot.org Fri May 4 19:17:24 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 19:17:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705050017.l450HOuw028480@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.35 -> 1.36 --- Log message: Implement support for globally associating abbrevs with block IDs, which relieves us from having to emit the abbrevs into each instance of the block. This shrinks kc.bit from 3368K to 3333K, but will be a more significant win once instructions are abbreviated. The VST went from: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.29508e+07b/1.61885e+06B/404713W Average Size: 5522.73b/690.342B/172.585W % of file: 48.0645 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 7035/3 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 to: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.26713e+07b/1.58391e+06B/395978W Average Size: 5403.53b/675.442B/168.86W % of file: 47.5198 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 0/0 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 because we didn't emit the same 3 abbrevs 2345 times :) --- Diffs of the changes: (+33 -42) BitcodeWriter.cpp | 75 +++++++++++++++++++++++------------------------------- 1 files changed, 33 insertions(+), 42 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.35 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.36 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.35 Fri May 4 16:31:13 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Fri May 4 19:17:00 2007 @@ -714,36 +714,6 @@ if (VST.empty()) return; Stream.EnterSubblock(bitc::VALUE_SYMTAB_BLOCK_ID, 3); - { // 8-bit fixed-width VST_ENTRY/VST_BBENTRY strings. - BitCodeAbbrev *Abbv = new BitCodeAbbrev(); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8)); - if (Stream.EmitAbbrev(Abbv) != VST_ENTRY_8_ABBREV) - assert(0 && "Unexpected abbrev ordering!"); - } - - { // 7-bit fixed width VST_ENTRY strings. - BitCodeAbbrev *Abbv = new BitCodeAbbrev(); - Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7)); - if (Stream.EmitAbbrev(Abbv) != VST_ENTRY_7_ABBREV) - assert(0 && "Unexpected abbrev ordering!"); - } - { // 7-bit fixed width VST_BBENTRY strings. - BitCodeAbbrev *Abbv = new BitCodeAbbrev(); - Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_BBENTRY)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7)); - if (Stream.EmitAbbrev(Abbv) != VST_BBENTRY_7_ABBREV) - assert(0 && "Unexpected abbrev ordering!"); - } - - // FIXME: Set up the abbrev, we know how many values there are! // FIXME: We know if the type names can use 7-bit ascii. SmallVector NameVals; @@ -909,19 +879,40 @@ // We only want to emit block info records for blocks that have multiple // instances: CONSTANTS_BLOCK, FUNCTION_BLOCK and VALUE_SYMTAB_BLOCK. Other // blocks can defined their abbrevs inline. - Stream.EnterSubblock(bitc::BLOCKINFO_BLOCK_ID, 2); - -#if 0 - // Configure TYPE_SYMTAB_BLOCK's. - - // Add an abbrev for VST_ENTRY where the characters each fit in 7 bits. - BitCodeAbbrev *Abbv = new BitCodeAbbrev(); - Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8); // Value ID - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // Linkage. + Stream.EnterBlockInfoBlock(2); + + { // 8-bit fixed-width VST_ENTRY/VST_BBENTRY strings. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8)); + if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, + Abbv) != VST_ENTRY_8_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } + + { // 7-bit fixed width VST_ENTRY strings. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7)); + if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, + Abbv) != VST_ENTRY_7_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } + { // 7-bit fixed width VST_BBENTRY strings. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_BBENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7)); + if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, + Abbv) != VST_BBENTRY_7_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } - xxx = Stream.EmitAbbrev(Abbv); -#endif Stream.ExitBlock(); } From sabre at nondot.org Fri May 4 19:18:00 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 19:18:00 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Message-ID: <200705050018.l450I0qM028522@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-bcanalyzer: llvm-bcanalyzer.cpp updated: 1.17 -> 1.18 --- Log message: update to new APIs, make output a bit (haha) nicer --- Diffs of the changes: (+35 -5) llvm-bcanalyzer.cpp | 40 +++++++++++++++++++++++++++++++++++----- 1 files changed, 35 insertions(+), 5 deletions(-) Index: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp diff -u llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.17 llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.18 --- llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.17 Thu May 3 22:01:41 2007 +++ llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Fri May 4 19:17:42 2007 @@ -75,6 +75,13 @@ /// GetBlockName - Return a symbolic block name if known, otherwise return /// null. static const char *GetBlockName(unsigned BlockID) { + // Standard blocks for all bitcode files. + if (BlockID < bitc::FIRST_APPLICATION_BLOCKID) { + if (BlockID == bitc::BLOCKINFO_BLOCK_ID) + return "BLOCKINFO_BLOCK"; + return 0; + } + if (CurStreamType != LLVMIRBitstream) return 0; switch (BlockID) { @@ -92,6 +99,18 @@ /// GetCodeName - Return a symbolic code name if known, otherwise return /// null. static const char *GetCodeName(unsigned CodeID, unsigned BlockID) { + // Standard blocks for all bitcode files. + if (BlockID < bitc::FIRST_APPLICATION_BLOCKID) { + if (BlockID == bitc::BLOCKINFO_BLOCK_ID) { + switch (CodeID) { + default: return 0; + case bitc::MODULE_CODE_VERSION: return "VERSION"; + } + } + return 0; + } + + if (CurStreamType != LLVMIRBitstream) return 0; switch (BlockID) { @@ -231,6 +250,7 @@ /// ParseBlock - Read a block, updating statistics, etc. static bool ParseBlock(BitstreamReader &Stream, unsigned IndentLevel) { + std::string Indent(IndentLevel*2, ' '); uint64_t BlockBitStart = Stream.GetCurrentBitNo(); unsigned BlockID = Stream.ReadSubBlockID(); @@ -239,11 +259,20 @@ BlockStats.NumInstances++; + // BLOCKINFO is a special part of the stream. + if (BlockID == bitc::BLOCKINFO_BLOCK_ID) { + if (Dump) std::cerr << Indent << "\n"; + if (Stream.ReadBlockInfoBlock()) + return Error("Malformed BlockInfoBlock"); + uint64_t BlockBitEnd = Stream.GetCurrentBitNo(); + BlockStats.NumBits += BlockBitEnd-BlockBitStart; + return false; + } + unsigned NumWords = 0; - if (Stream.EnterSubBlock(&NumWords)) + if (Stream.EnterSubBlock(BlockID, &NumWords)) return Error("Malformed block record"); - std::string Indent(IndentLevel*2, ' '); const char *BlockName = 0; if (Dump) { std::cerr << Indent << "<"; @@ -315,7 +344,7 @@ for (unsigned i = 0, e = Record.size(); i != e; ++i) std::cerr << " op" << i << "=" << (int64_t)Record[i]; - std::cerr << ">\n"; + std::cerr << "/>\n"; } break; @@ -418,8 +447,9 @@ << Stats.NumAbbrevs/(double)Stats.NumInstances << "\n"; std::cerr << " Tot/Avg Records: " << Stats.NumRecords << "/" << Stats.NumRecords/(double)Stats.NumInstances << "\n"; - std::cerr << " % Abbrev Recs: " << (Stats.NumAbbreviatedRecords/ - (double)Stats.NumRecords)*100 << "\n"; + if (Stats.NumRecords) + std::cerr << " % Abbrev Recs: " << (Stats.NumAbbreviatedRecords/ + (double)Stats.NumRecords)*100 << "\n"; std::cerr << "\n"; } return 0; From sabre at nondot.org Fri May 4 19:47:38 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 19:47:38 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705050047.l450lceU029117@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.36 -> 1.37 --- Log message: add an abbreviation for the type symtab, this shrinks the TST from 175197 bits to 103165 bits: Old: Block ID #13 (TYPE_SYMTAB): Num Instances: 1 Total Size: 175197b/21899.6B/5474.91W Average Size: 175197b/21899.6B/5474.91W % of file: 0.657023 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 0/0 Tot/Avg Records: 255/255 % Abbrev Recs: 0 New: Block ID #13 (TYPE_SYMTAB): Num Instances: 1 Total Size: 103165b/12895.6B/3223.91W Average Size: 103165b/12895.6B/3223.91W % of file: 0.387937 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 1/1 Tot/Avg Records: 255/255 % Abbrev Recs: 100 --- Diffs of the changes: (+16 -8) BitcodeWriter.cpp | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.36 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.37 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.36 Fri May 4 19:17:00 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Fri May 4 19:47:19 2007 @@ -798,24 +798,32 @@ Stream.EnterSubblock(bitc::TYPE_SYMTAB_BLOCK_ID, 3); - // FIXME: Set up the abbrev, we know how many types there are! - // FIXME: We know if the type names can use 7-bit ascii. + // 7-bit fixed width VST_CODE_ENTRY strings. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, + Log2_32_Ceil(VE.getTypes().size()+1))); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7)); + unsigned V7Abbrev = Stream.EmitAbbrev(Abbv); SmallVector NameVals; for (TypeSymbolTable::const_iterator TI = TST.begin(), TE = TST.end(); TI != TE; ++TI) { - unsigned AbbrevToUse = 0; - - // TST_ENTRY: [typeid, namelen, namechar x N] + // TST_ENTRY: [typeid, namechar x N] NameVals.push_back(VE.getTypeID(TI->second)); const std::string &Str = TI->first; - for (unsigned i = 0, e = Str.size(); i != e; ++i) - NameVals.push_back(Str[i]); + bool is7Bit = true; + for (unsigned i = 0, e = Str.size(); i != e; ++i) { + NameVals.push_back((unsigned char)Str[i]); + if (Str[i] & 128) + is7Bit = false; + } // Emit the finished record. - Stream.EmitRecord(bitc::VST_CODE_ENTRY, NameVals, AbbrevToUse); + Stream.EmitRecord(bitc::VST_CODE_ENTRY, NameVals, is7Bit ? V7Abbrev : 0); NameVals.clear(); } From sabre at nondot.org Fri May 4 20:16:00 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 20:16:00 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/BitCodes.h BitstreamReader.h BitstreamWriter.h Message-ID: <200705050116.l451G0EO029605@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: BitCodes.h updated: 1.6 -> 1.7 BitstreamReader.h updated: 1.15 -> 1.16 BitstreamWriter.h updated: 1.11 -> 1.12 --- Log message: add a 6-bit encoding type for strings. --- Diffs of the changes: (+38 -3) BitCodes.h | 35 ++++++++++++++++++++++++++++++++--- BitstreamReader.h | 3 +++ BitstreamWriter.h | 3 +++ 3 files changed, 38 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Bitcode/BitCodes.h diff -u llvm/include/llvm/Bitcode/BitCodes.h:1.6 llvm/include/llvm/Bitcode/BitCodes.h:1.7 --- llvm/include/llvm/Bitcode/BitCodes.h:1.6 Fri May 4 19:16:30 2007 +++ llvm/include/llvm/Bitcode/BitCodes.h Fri May 4 20:15:42 2007 @@ -85,15 +85,15 @@ unsigned Enc : 3; // The encoding to use. public: enum Encoding { - Fixed = 1, // A fixed with field, Val specifies number of bits. + Fixed = 1, // A fixed width field, Val specifies number of bits. VBR = 2, // A VBR field where Val specifies the width of each chunk. - Array = 3 // A sequence of fields, next field species elt encoding. + Array = 3, // A sequence of fields, next field species elt encoding. + Char6 = 4 // A 6-bit fixed field which maps to [a-zA-Z0-9._]. }; BitCodeAbbrevOp(uint64_t V) : Val(V), IsLiteral(true) {} BitCodeAbbrevOp(Encoding E, uint64_t Data = 0) : Val(Data), IsLiteral(false), Enc(E) {} - bool isLiteral() const { return IsLiteral; } bool isEncoding() const { return !IsLiteral; } @@ -116,9 +116,38 @@ case VBR: return true; case Array: + case Char6: return false; } } + + /// isChar6 - Return true if this character is legal in the Char6 encoding. + static bool isChar6(char C) { + if (C >= 'a' && C <= 'z') return true; + if (C >= 'A' && C <= 'Z') return true; + if (C >= '0' && C <= '9') return true; + if (C == '.' || C == '_') return true; + return false; + } + static unsigned EncodeChar6(char C) { + if (C >= 'a' && C <= 'z') return C-'a'; + if (C >= 'A' && C <= 'Z') return C-'A'+26; + if (C >= '0' && C <= '9') return C-'0'+26+26; + if (C == '.') return 62; + if (C == '_') return 63; + assert(0 && "Not a value Char6 character!"); + } + + static char DecodeChar6(unsigned V) { + assert((V & ~63) == 0 && "Not a Char6 encoded character!"); + if (V < 26) return V+'a'; + if (V < 26+26) return V-26+'A'; + if (V < 26+26+10) return V-26-26+'0'; + if (V == 62) return '.'; + if (V == 63) return '_'; + assert(0 && "Not a value Char6 character!"); + } + }; /// BitCodeAbbrev - This class represents an abbreviation record. An Index: llvm/include/llvm/Bitcode/BitstreamReader.h diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.15 llvm/include/llvm/Bitcode/BitstreamReader.h:1.16 --- llvm/include/llvm/Bitcode/BitstreamReader.h:1.15 Fri May 4 19:16:30 2007 +++ llvm/include/llvm/Bitcode/BitstreamReader.h Fri May 4 20:15:42 2007 @@ -332,6 +332,9 @@ case BitCodeAbbrevOp::VBR: Vals.push_back(ReadVBR64(Op.getEncodingData())); break; + case BitCodeAbbrevOp::Char6: + Vals.push_back(BitCodeAbbrevOp::DecodeChar6(Read(6))); + break; } } } Index: llvm/include/llvm/Bitcode/BitstreamWriter.h diff -u llvm/include/llvm/Bitcode/BitstreamWriter.h:1.11 llvm/include/llvm/Bitcode/BitstreamWriter.h:1.12 --- llvm/include/llvm/Bitcode/BitstreamWriter.h:1.11 Fri May 4 19:16:30 2007 +++ llvm/include/llvm/Bitcode/BitstreamWriter.h Fri May 4 20:15:42 2007 @@ -260,6 +260,9 @@ case BitCodeAbbrevOp::VBR: EmitVBR(V, Op.getEncodingData()); break; + case BitCodeAbbrevOp::Char6: + Emit(BitCodeAbbrevOp::EncodeChar6((char)V), 6); + break; } } public: From sabre at nondot.org Fri May 4 20:27:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 20:27:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705050127.l451R7wI029813@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.37 -> 1.38 --- Log message: add a char6 abbrev for bbnames and value names. This represents each character with 6 bits where possible. This shrinks kc++ from 3324164B to 3183584B. The old VST was: Block ID #14 (VALUE_SYMTAB): Total Size: 1.26713e+07b/1.58391e+06B/395978W Average Size: 5403.53b/675.442B/168.86W % of file: 47.6484 The new one is: Block ID #14 (VALUE_SYMTAB): Total Size: 1.15467e+07b/1.44334e+06B/360834W Average Size: 4923.96b/615.495B/153.874W % of file: 45.3368 This is 11% smaller than the VST in the bytecode format. --- Diffs of the changes: (+30 -12) BitcodeWriter.cpp | 42 ++++++++++++++++++++++++++++++------------ 1 files changed, 30 insertions(+), 12 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.37 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.38 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.37 Fri May 4 19:47:19 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Fri May 4 20:26:50 2007 @@ -33,8 +33,8 @@ // VALUE_SYMTAB_BLOCK abbrev id's. VST_ENTRY_8_ABBREV = bitc::FIRST_APPLICATION_ABBREV, VST_ENTRY_7_ABBREV, - VST_BBENTRY_7_ABBREV - + VST_ENTRY_6_ABBREV, + VST_BBENTRY_6_ABBREV }; @@ -712,7 +712,7 @@ const ValueEnumerator &VE, BitstreamWriter &Stream) { if (VST.empty()) return; - Stream.EnterSubblock(bitc::VALUE_SYMTAB_BLOCK_ID, 3); + Stream.EnterSubblock(bitc::VALUE_SYMTAB_BLOCK_ID, 4); // FIXME: Set up the abbrev, we know how many values there are! // FIXME: We know if the type names can use 7-bit ascii. @@ -725,12 +725,16 @@ // Figure out the encoding to use for the name. bool is7Bit = true; - for (unsigned i = 0, e = Name.getKeyLength(); i != e; ++i) - if ((unsigned char)Name.getKeyData()[i] & 128) { + bool isChar6 = true; + for (const char *C = Name.getKeyData(), *E = C+Name.getKeyLength(); + C != E; ++C) { + if (isChar6) + isChar6 = BitCodeAbbrevOp::isChar6(*C); + if ((unsigned char)*C & 128) { is7Bit = false; - break; + break; // don't bother scanning the rest. } - + } unsigned AbbrevToUse = VST_ENTRY_8_ABBREV; @@ -739,10 +743,14 @@ unsigned Code; if (isa(SI->getValue())) { Code = bitc::VST_CODE_BBENTRY; - if (is7Bit) AbbrevToUse = VST_BBENTRY_7_ABBREV; + if (isChar6) + AbbrevToUse = VST_BBENTRY_6_ABBREV; } else { Code = bitc::VST_CODE_ENTRY; - if (is7Bit) AbbrevToUse = VST_ENTRY_7_ABBREV; + if (isChar6) + AbbrevToUse = VST_ENTRY_6_ABBREV; + else if (is7Bit) + AbbrevToUse = VST_ENTRY_7_ABBREV; } NameVals.push_back(VE.getValueID(SI->getValue())); @@ -910,14 +918,24 @@ Abbv) != VST_ENTRY_7_ABBREV) assert(0 && "Unexpected abbrev ordering!"); } - { // 7-bit fixed width VST_BBENTRY strings. + { // 6-bit char6 VST_ENTRY strings. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Char6)); + if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, + Abbv) != VST_ENTRY_6_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } + { // 6-bit char6 VST_BBENTRY strings. BitCodeAbbrev *Abbv = new BitCodeAbbrev(); Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_BBENTRY)); Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Char6)); if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, - Abbv) != VST_BBENTRY_7_ABBREV) + Abbv) != VST_BBENTRY_6_ABBREV) assert(0 && "Unexpected abbrev ordering!"); } From sabre at nondot.org Fri May 4 20:29:48 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 20:29:48 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Message-ID: <200705050129.l451TmAB029921@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-bcanalyzer: llvm-bcanalyzer.cpp updated: 1.18 -> 1.19 --- Log message: do not charge subblock sizes to the parent block. --- Diffs of the changes: (+7 -1) llvm-bcanalyzer.cpp | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp diff -u llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.18 llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.19 --- llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.18 Fri May 4 19:17:42 2007 +++ llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Fri May 4 20:29:31 2007 @@ -312,11 +312,17 @@ } return false; } - case bitc::ENTER_SUBBLOCK: + case bitc::ENTER_SUBBLOCK: { + uint64_t SubBlockBitStart = Stream.GetCurrentBitNo(); if (ParseBlock(Stream, IndentLevel+1)) return true; ++BlockStats.NumSubBlocks; + uint64_t SubBlockBitEnd = Stream.GetCurrentBitNo(); + + // Don't include subblock sizes in the size of this block. + BlockBitStart += SubBlockBitEnd-SubBlockBitStart; break; + } case bitc::DEFINE_ABBREV: Stream.ReadAbbrevRecord(); ++BlockStats.NumAbbrevs; From sabre at nondot.org Fri May 4 20:47:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 20:47:07 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Message-ID: <200705050147.l451l74t030234@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-bcanalyzer: llvm-bcanalyzer.cpp updated: 1.19 -> 1.20 --- Log message: emit spiffy little histograms of codes, if enabled. Don't print averages if there is only one item. --- Diffs of the changes: (+47 -11) llvm-bcanalyzer.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 47 insertions(+), 11 deletions(-) Index: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp diff -u llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.19 llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.20 --- llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.19 Fri May 4 20:29:31 2007 +++ llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Fri May 4 20:46:49 2007 @@ -41,6 +41,7 @@ #include "llvm/System/Signals.h" #include #include +#include using namespace llvm; static cl::opt @@ -58,6 +59,8 @@ //===----------------------------------------------------------------------===// static cl::opt Bitcode("bitcode", cl::desc("Read a bitcode file")); +static cl::opt NoHistogram("disable-histogram", + cl::desc("Do not print per-code histogram")); static cl::opt NonSymbolic("non-symbolic", @@ -110,7 +113,6 @@ return 0; } - if (CurStreamType != LLVMIRBitstream) return 0; switch (BlockID) { @@ -232,6 +234,9 @@ /// number that are abbreviated. unsigned NumRecords, NumAbbreviatedRecords; + /// CodeFreq - Keep track of the number of times we see each code. + std::vector CodeFreq; + PerBlockIDStats() : NumInstances(0), NumBits(0), NumSubBlocks(0), NumAbbrevs(0), NumRecords(0), NumAbbreviatedRecords(0) {} @@ -334,7 +339,11 @@ Record.clear(); unsigned Code = Stream.ReadRecord(AbbrevID, Record); - // TODO: Compute per-blockid/code stats. + + // Increment the # occurrences of this code. + if (BlockStats.CodeFreq.size() <= Code) + BlockStats.CodeFreq.resize(Code+1); + BlockStats.CodeFreq[Code]++; if (Dump) { std::cerr << Indent << " <"; @@ -442,21 +451,48 @@ std::cerr << " Total Size: "; PrintSize(Stats.NumBits); std::cerr << "\n"; - std::cerr << " Average Size: "; - PrintSize(Stats.NumBits/(double)Stats.NumInstances); - std::cerr << "\n"; std::cerr << " % of file: " << Stats.NumBits/(double)BufferSizeBits*100 << "\n"; - std::cerr << " Tot/Avg SubBlocks: " << Stats.NumSubBlocks << "/" - << Stats.NumSubBlocks/(double)Stats.NumInstances << "\n"; - std::cerr << " Tot/Avg Abbrevs: " << Stats.NumAbbrevs << "/" - << Stats.NumAbbrevs/(double)Stats.NumInstances << "\n"; - std::cerr << " Tot/Avg Records: " << Stats.NumRecords << "/" - << Stats.NumRecords/(double)Stats.NumInstances << "\n"; + if (Stats.NumInstances > 1) { + std::cerr << " Average Size: "; + PrintSize(Stats.NumBits/(double)Stats.NumInstances); + std::cerr << "\n"; + std::cerr << " Tot/Avg SubBlocks: " << Stats.NumSubBlocks << "/" + << Stats.NumSubBlocks/(double)Stats.NumInstances << "\n"; + std::cerr << " Tot/Avg Abbrevs: " << Stats.NumAbbrevs << "/" + << Stats.NumAbbrevs/(double)Stats.NumInstances << "\n"; + std::cerr << " Tot/Avg Records: " << Stats.NumRecords << "/" + << Stats.NumRecords/(double)Stats.NumInstances << "\n"; + } else { + std::cerr << " Num SubBlocks: " << Stats.NumSubBlocks << "\n"; + std::cerr << " Num Abbrevs: " << Stats.NumAbbrevs << "\n"; + std::cerr << " Num Records: " << Stats.NumRecords << "\n"; + } if (Stats.NumRecords) std::cerr << " % Abbrev Recs: " << (Stats.NumAbbreviatedRecords/ (double)Stats.NumRecords)*100 << "\n"; std::cerr << "\n"; + + // Print a histogram of the codes we see. + if (!NoHistogram && !Stats.CodeFreq.empty()) { + std::vector > FreqPairs; // + for (unsigned i = 0, e = Stats.CodeFreq.size(); i != e; ++i) + if (unsigned Freq = Stats.CodeFreq[i]) + FreqPairs.push_back(std::make_pair(Freq, i)); + std::stable_sort(FreqPairs.begin(), FreqPairs.end()); + std::reverse(FreqPairs.begin(), FreqPairs.end()); + + std::cerr << "\tCode Histogram:\n"; + for (unsigned i = 0, e = FreqPairs.size(); i != e; ++i) { + std::cerr << "\t\t" << FreqPairs[i].first << "\t"; + if (const char *CodeName = GetCodeName(FreqPairs[i].second, I->first)) + std::cerr << CodeName << "\n"; + else + std::cerr << "UnknownCode" << FreqPairs[i].second << "\n"; + } + std::cerr << "\n"; + + } } return 0; } From sabre at nondot.org Fri May 4 20:59:24 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 20:59:24 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/2007-05-04-Crash.ll Message-ID: <200705050159.l451xO64030482@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: 2007-05-04-Crash.ll added (r1.1) --- Log message: new testacse for PR1384: http://llvm.org/PR1384 --- Diffs of the changes: (+30 -0) 2007-05-04-Crash.ll | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+) Index: llvm/test/Transforms/InstCombine/2007-05-04-Crash.ll diff -c /dev/null llvm/test/Transforms/InstCombine/2007-05-04-Crash.ll:1.1 *** /dev/null Fri May 4 20:59:15 2007 --- llvm/test/Transforms/InstCombine/2007-05-04-Crash.ll Fri May 4 20:59:05 2007 *************** *** 0 **** --- 1,30 ---- + ; RUN: llvm-as < %s | opt -instcombine -disable-output + ; PR1384 + + 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 = "i686-apple-darwin8" + %struct.CFRuntimeBase = type { i32, [4 x i8] } + %struct.CGColor = type opaque + %struct.CGColorSpace = type { %struct.CFRuntimeBase, i8, i8, i8, i32, i32, i32, %struct.CGColor*, float*, %struct.CGMD5Signature, %struct.CGMD5Signature*, [0 x %struct.CGColorSpaceDescriptor] } + %struct.CGColorSpaceCalibratedRGBData = type { [3 x float], [3 x float], [3 x float], [9 x float] } + %struct.CGColorSpaceDescriptor = type { %struct.CGColorSpaceCalibratedRGBData } + %struct.CGColorSpaceLabData = type { [3 x float], [3 x float], [4 x float] } + %struct.CGMD5Signature = type { [16 x i8], i8 } + + declare fastcc %struct.CGColorSpace* @CGColorSpaceCreate(i32, i32) + + declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) + + define %struct.CGColorSpace* @CGColorSpaceCreateLab(float* %whitePoint, float* %blackPoint, float* %range) { + entry: + %tmp17 = call fastcc %struct.CGColorSpace* @CGColorSpaceCreate( i32 5, i32 3 ) ; <%struct.CGColorSpace*> [#uses=2] + %tmp28 = getelementptr %struct.CGColorSpace* %tmp17, i32 0, i32 11 ; <[0 x %struct.CGColorSpaceDescriptor]*> [#uses=1] + %tmp29 = getelementptr [0 x %struct.CGColorSpaceDescriptor]* %tmp28, i32 0, i32 0 ; <%struct.CGColorSpaceDescriptor*> [#uses=1] + %tmp30 = getelementptr %struct.CGColorSpaceDescriptor* %tmp29, i32 0, i32 0 ; <%struct.CGColorSpaceCalibratedRGBData*> [#uses=1] + %tmp3031 = bitcast %struct.CGColorSpaceCalibratedRGBData* %tmp30 to %struct.CGColorSpaceLabData* ; <%struct.CGColorSpaceLabData*> [#uses=1] + %tmp45 = getelementptr %struct.CGColorSpaceLabData* %tmp3031, i32 0, i32 2 ; <[4 x float]*> [#uses=1] + %tmp46 = getelementptr [4 x float]* %tmp45, i32 0, i32 0 ; [#uses=1] + %tmp4648 = bitcast float* %tmp46 to i8* ; [#uses=1] + call void @llvm.memcpy.i32( i8* %tmp4648, i8* null, i32 16, i32 4 ) + ret %struct.CGColorSpace* %tmp17 + } From sabre at nondot.org Fri May 4 20:59:49 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 4 May 2007 20:59:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200705050159.l451xnPG030499@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.757 -> 1.758 --- Log message: Fix InstCombine/2007-05-04-Crash.ll and PR1384: http://llvm.org/PR1384 --- Diffs of the changes: (+14 -10) InstructionCombining.cpp | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.757 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.758 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.757 Wed May 2 20:11:54 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri May 4 20:59:31 2007 @@ -6404,21 +6404,25 @@ if (GEPIdxTy->isSized()) { SmallVector NewIndices; - // Start with the index over the outer type. + // Start with the index over the outer type. Note that the type size + // might be zero (even if the offset isn't zero) if the indexed type + // is something like [0 x {int, int}] const Type *IntPtrTy = TD->getIntPtrType(); - int64_t TySize = TD->getTypeSize(GEPIdxTy); - int64_t FirstIdx = Offset/TySize; - Offset %= TySize; + int64_t FirstIdx = 0; + if (int64_t TySize = TD->getTypeSize(GEPIdxTy)) { + FirstIdx = Offset/TySize; + Offset %= TySize; - // Handle silly modulus not returning values values [0..TySize). - if (Offset < 0) { - --FirstIdx; - Offset += TySize; - assert(Offset >= 0); + // Handle silly modulus not returning values values [0..TySize). + if (Offset < 0) { + --FirstIdx; + Offset += TySize; + assert(Offset >= 0); + } + assert((uint64_t)Offset < (uint64_t)TySize && "Out of range offset"); } NewIndices.push_back(ConstantInt::get(IntPtrTy, FirstIdx)); - assert((uint64_t)Offset < (uint64_t)TySize && "Out of range offset"); // Index into the types. If we fail, set OrigBase to null. while (Offset) { From sabre at nondot.org Sat May 5 01:30:30 2007 From: sabre at nondot.org (Chris Lattner) Date: Sat, 5 May 2007 01:30:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705050630.l456UUe5002038@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.38 -> 1.39 --- Log message: Add abbreviations to the TYPE_BLOCK for pointers, functions, structs and arrays. This shrinks the type_block of kc++ from 139901 bits to 99389 bits (0.55% to 0.39% of the file), a 40% reduction. This shrink the record from: Block ID #10 (TYPE_BLOCK): Num Instances: 1 Total Size: 139901b/17487.6B/4371.91W % of file: 0.549306 Num Abbrevs: 0 Num Records: 3203 % Abbrev Recs: 0 to: Block ID #10 (TYPE_BLOCK): Num Instances: 1 Total Size: 99389b/12423.6B/3105.91W % of file: 0.390862 Num Abbrevs: 4 Num Records: 3203 % Abbrev Recs: 99.6566 With a common histogram of: Code Histogram: 1613 POINTER 1100 FUNCTION 255 STRUCT 224 ARRAY 5 INTEGER 2 OPAQUE 1 LABEL 1 DOUBLE 1 VOID 1 NUMENTRY --- Diffs of the changes: (+40 -3) BitcodeWriter.cpp | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 40 insertions(+), 3 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.38 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.39 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.38 Fri May 4 20:26:50 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Sat May 5 01:30:12 2007 @@ -121,7 +121,40 @@ Stream.EnterSubblock(bitc::TYPE_BLOCK_ID, 4 /*count from # abbrevs */); SmallVector TypeVals; - // FIXME: Set up abbrevs now that we know the width of the type fields, etc. + // Abbrev for TYPE_CODE_POINTER. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_POINTER)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, + Log2_32_Ceil(VE.getTypes().size()+1))); + unsigned PtrAbbrev = Stream.EmitAbbrev(Abbv); + + // Abbrev for TYPE_CODE_FUNCTION. + Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_FUNCTION)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isvararg + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, + Log2_32_Ceil(VE.getParamAttrs().size()+1))); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, + Log2_32_Ceil(VE.getTypes().size()+1))); + unsigned FunctionAbbrev = Stream.EmitAbbrev(Abbv); + + // Abbrev for TYPE_CODE_STRUCT. + Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_STRUCT)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // ispacked + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, + Log2_32_Ceil(VE.getTypes().size()+1))); + unsigned StructAbbrev = Stream.EmitAbbrev(Abbv); + + // Abbrev for TYPE_CODE_ARRAY. + Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_ARRAY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // size + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, + Log2_32_Ceil(VE.getTypes().size()+1))); + unsigned ArrayAbbrev = Stream.EmitAbbrev(Abbv); // Emit an entry count so the reader can reserve space. TypeVals.push_back(TypeList.size()); @@ -151,28 +184,31 @@ // POINTER: [pointee type] Code = bitc::TYPE_CODE_POINTER; TypeVals.push_back(VE.getTypeID(cast(T)->getElementType())); + AbbrevToUse = PtrAbbrev; break; case Type::FunctionTyID: { const FunctionType *FT = cast(T); - // FUNCTION: [isvararg, attrid, #pararms, paramty x N] + // FUNCTION: [isvararg, attrid, retty, paramty x N] Code = bitc::TYPE_CODE_FUNCTION; TypeVals.push_back(FT->isVarArg()); TypeVals.push_back(VE.getParamAttrID(FT->getParamAttrs())); TypeVals.push_back(VE.getTypeID(FT->getReturnType())); for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i) TypeVals.push_back(VE.getTypeID(FT->getParamType(i))); + AbbrevToUse = FunctionAbbrev; break; } case Type::StructTyID: { const StructType *ST = cast(T); - // STRUCT: [ispacked, #elts, eltty x N] + // STRUCT: [ispacked, eltty x N] Code = bitc::TYPE_CODE_STRUCT; TypeVals.push_back(ST->isPacked()); // Output all of the element types. for (StructType::element_iterator I = ST->element_begin(), E = ST->element_end(); I != E; ++I) TypeVals.push_back(VE.getTypeID(*I)); + AbbrevToUse = StructAbbrev; break; } case Type::ArrayTyID: { @@ -181,6 +217,7 @@ Code = bitc::TYPE_CODE_ARRAY; TypeVals.push_back(AT->getNumElements()); TypeVals.push_back(VE.getTypeID(AT->getElementType())); + AbbrevToUse = ArrayAbbrev; break; } case Type::VectorTyID: { From sabre at nondot.org Sat May 5 02:20:58 2007 From: sabre at nondot.org (Chris Lattner) Date: Sat, 5 May 2007 02:20:58 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bitcode/BitstreamReader.h Message-ID: <200705050720.l457KwAO011510@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bitcode: BitstreamReader.h updated: 1.16 -> 1.17 --- Log message: minor bugfix --- Diffs of the changes: (+1 -0) BitstreamReader.h | 1 + 1 files changed, 1 insertion(+) Index: llvm/include/llvm/Bitcode/BitstreamReader.h diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.16 llvm/include/llvm/Bitcode/BitstreamReader.h:1.17 --- llvm/include/llvm/Bitcode/BitstreamReader.h:1.16 Fri May 4 20:15:42 2007 +++ llvm/include/llvm/Bitcode/BitstreamReader.h Sat May 5 02:20:34 2007 @@ -446,6 +446,7 @@ } // Read a record. + Record.clear(); switch (ReadRecord(Code, Record)) { default: break; // Default behavior, ignore unknown content. case bitc::BLOCKINFO_CODE_SETBID: From sabre at nondot.org Sat May 5 02:36:43 2007 From: sabre at nondot.org (Chris Lattner) Date: Sat, 5 May 2007 02:36:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705050736.l457ahBJ012390@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.39 -> 1.40 --- Log message: add abbrevs for the constants tables. This shrinks it from 4.49755e6 bits to 3.85972e6 bits in kc++ --- Diffs of the changes: (+123 -61) BitcodeWriter.cpp | 184 ++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 123 insertions(+), 61 deletions(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.39 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.40 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.39 Sat May 5 01:30:12 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Sat May 5 02:36:14 2007 @@ -34,7 +34,13 @@ VST_ENTRY_8_ABBREV = bitc::FIRST_APPLICATION_ABBREV, VST_ENTRY_7_ABBREV, VST_ENTRY_6_ABBREV, - VST_BBENTRY_6_ABBREV + VST_BBENTRY_6_ABBREV, + + // CONSTANTS_BLOCK abbrev id's. + CONSTANTS_SETTYPE_ABBREV = bitc::FIRST_APPLICATION_ABBREV, + CONSTANTS_INTEGER_ABBREV, + CONSTANTS_CE_CAST_Abbrev, + CONSTANTS_NULL_Abbrev }; @@ -396,11 +402,23 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal, const ValueEnumerator &VE, - BitstreamWriter &Stream) { + BitstreamWriter &Stream, bool isGlobal) { if (FirstVal == LastVal) return; - Stream.EnterSubblock(bitc::CONSTANTS_BLOCK_ID, 2); + Stream.EnterSubblock(bitc::CONSTANTS_BLOCK_ID, 4); + unsigned AggregateAbbrev = 0; + unsigned GEPAbbrev = 0; + // If this is a constant pool for the module, emit module-specific abbrevs. + if (isGlobal) { + // Abbrev for CST_CODE_AGGREGATE. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_AGGREGATE)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, Log2_32_Ceil(LastVal+1))); + AggregateAbbrev = Stream.EmitAbbrev(Abbv); + } + // FIXME: Install and use abbrevs to reduce size. Install them globally so // they don't need to be reemitted for each function body. @@ -414,7 +432,8 @@ if (V->getType() != LastTy) { LastTy = V->getType(); Record.push_back(VE.getTypeID(LastTy)); - Stream.EmitRecord(bitc::CST_CODE_SETTYPE, Record); + Stream.EmitRecord(bitc::CST_CODE_SETTYPE, Record, + CONSTANTS_SETTYPE_ABBREV); Record.clear(); } @@ -437,6 +456,7 @@ else Record.push_back((-V << 1) | 1); Code = bitc::CST_CODE_INTEGER; + AbbrevToUse = CONSTANTS_INTEGER_ABBREV; } else { // Wide integers, > 64 bits in size. // We have an arbitrary precision integer value to write whose // bit width is > 64. However, in canonical unsigned integer @@ -466,6 +486,7 @@ Code = bitc::CST_CODE_AGGREGATE; for (unsigned i = 0, e = C->getNumOperands(); i != e; ++i) Record.push_back(VE.getValueID(C->getOperand(i))); + AbbrevToUse = AggregateAbbrev; } else if (const ConstantExpr *CE = dyn_cast(C)) { switch (CE->getOpcode()) { default: @@ -474,6 +495,7 @@ Record.push_back(GetEncodedCastOpcode(CE->getOpcode())); Record.push_back(VE.getTypeID(C->getOperand(0)->getType())); Record.push_back(VE.getValueID(C->getOperand(0))); + AbbrevToUse = CONSTANTS_CE_CAST_Abbrev; } else { assert(CE->getNumOperands() == 2 && "Unknown constant expr!"); Code = bitc::CST_CODE_CE_BINOP; @@ -488,6 +510,7 @@ Record.push_back(VE.getTypeID(C->getOperand(i)->getType())); Record.push_back(VE.getValueID(C->getOperand(i))); } + AbbrevToUse = GEPAbbrev; break; case Instruction::Select: Code = bitc::CST_CODE_CE_SELECT; @@ -540,7 +563,7 @@ // We know globalvalues have been emitted by WriteModuleInfo. for (unsigned i = 0, e = Vals.size(); i != e; ++i) { if (!isa(Vals[i].first)) { - WriteConstants(i, Vals.size(), VE, Stream); + WriteConstants(i, Vals.size(), VE, Stream, true); return; } } @@ -821,7 +844,7 @@ // If there are function-local constants, emit them now. unsigned CstStart, CstEnd; VE.getFunctionConstantRange(CstStart, CstEnd); - WriteConstants(CstStart, CstEnd, VE, Stream); + WriteConstants(CstStart, CstEnd, VE, Stream, false); // Finally, emit all the instructions, in order. for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB) @@ -875,6 +898,97 @@ Stream.ExitBlock(); } +// Emit blockinfo, which defines the standard abbreviations etc. +static void WriteBlockInfo(const ValueEnumerator &VE, BitstreamWriter &Stream) { + // We only want to emit block info records for blocks that have multiple + // instances: CONSTANTS_BLOCK, FUNCTION_BLOCK and VALUE_SYMTAB_BLOCK. Other + // blocks can defined their abbrevs inline. + Stream.EnterBlockInfoBlock(2); + + { // 8-bit fixed-width VST_ENTRY/VST_BBENTRY strings. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8)); + if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, + Abbv) != VST_ENTRY_8_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } + + { // 7-bit fixed width VST_ENTRY strings. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7)); + if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, + Abbv) != VST_ENTRY_7_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } + { // 6-bit char6 VST_ENTRY strings. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Char6)); + if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, + Abbv) != VST_ENTRY_6_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } + { // 6-bit char6 VST_BBENTRY strings. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_BBENTRY)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Char6)); + if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, + Abbv) != VST_BBENTRY_6_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } + + { // SETTYPE abbrev for CONSTANTS_BLOCK. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_SETTYPE)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, + Log2_32_Ceil(VE.getTypes().size()+1))); + if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID, + Abbv) != CONSTANTS_SETTYPE_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } + + { // INTEGER abbrev for CONSTANTS_BLOCK. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_INTEGER)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); + if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID, + Abbv) != CONSTANTS_INTEGER_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } + + { // CE_CAST abbrev for CONSTANTS_BLOCK. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_CE_CAST)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 4)); // cast opc + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, // typeid + Log2_32_Ceil(VE.getTypes().size()+1))); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // value id + + if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID, + Abbv) != CONSTANTS_CE_CAST_Abbrev) + assert(0 && "Unexpected abbrev ordering!"); + } + { // NULL abbrev for CONSTANTS_BLOCK. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_NULL)); + if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID, + Abbv) != CONSTANTS_NULL_Abbrev) + assert(0 && "Unexpected abbrev ordering!"); + } + + Stream.ExitBlock(); +} + /// WriteModule - Emit the specified module to the bitstream. static void WriteModule(const Module *M, BitstreamWriter &Stream) { @@ -889,6 +1003,9 @@ // Analyze the module, enumerating globals, functions, etc. ValueEnumerator VE(M); + + // Emit blockinfo, which defines the standard abbreviations etc. + WriteBlockInfo(VE, Stream); // Emit information about parameter attributes. WriteParamAttrTable(VE, Stream); @@ -927,58 +1044,6 @@ Stream.ExitBlock(); } -// Emit blockinfo, which defines the standard abbreviations etc. -static void WriteBlockInfo(BitstreamWriter &Stream) { - // We only want to emit block info records for blocks that have multiple - // instances: CONSTANTS_BLOCK, FUNCTION_BLOCK and VALUE_SYMTAB_BLOCK. Other - // blocks can defined their abbrevs inline. - Stream.EnterBlockInfoBlock(2); - - { // 8-bit fixed-width VST_ENTRY/VST_BBENTRY strings. - BitCodeAbbrev *Abbv = new BitCodeAbbrev(); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8)); - if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, - Abbv) != VST_ENTRY_8_ABBREV) - assert(0 && "Unexpected abbrev ordering!"); - } - - { // 7-bit fixed width VST_ENTRY strings. - BitCodeAbbrev *Abbv = new BitCodeAbbrev(); - Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7)); - if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, - Abbv) != VST_ENTRY_7_ABBREV) - assert(0 && "Unexpected abbrev ordering!"); - } - { // 6-bit char6 VST_ENTRY strings. - BitCodeAbbrev *Abbv = new BitCodeAbbrev(); - Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_ENTRY)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Char6)); - if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, - Abbv) != VST_ENTRY_6_ABBREV) - assert(0 && "Unexpected abbrev ordering!"); - } - { // 6-bit char6 VST_BBENTRY strings. - BitCodeAbbrev *Abbv = new BitCodeAbbrev(); - Abbv->Add(BitCodeAbbrevOp(bitc::VST_CODE_BBENTRY)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array)); - Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Char6)); - if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID, - Abbv) != VST_BBENTRY_6_ABBREV) - assert(0 && "Unexpected abbrev ordering!"); - } - - Stream.ExitBlock(); -} - /// WriteBitcodeToFile - Write the specified module to the specified output /// stream. @@ -996,9 +1061,6 @@ Stream.Emit(0xE, 4); Stream.Emit(0xD, 4); - // Emit blockinfo, which defines the standard abbreviations etc. - WriteBlockInfo(Stream); - // Emit the module. WriteModule(M, Stream); From sabre at nondot.org Sat May 5 02:45:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Sat, 5 May 2007 02:45:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Message-ID: <200705050745.l457j74H012580@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bitcode/Writer: BitcodeWriter.cpp updated: 1.40 -> 1.41 --- Log message: add an abbrev for loads. This shrinks the function block about 50K, from: Block ID #12 (FUNCTION_BLOCK): Num Instances: 2344 Total Size: 8.8434e+06b/1.10542e+06B/276356W % of file: 35.6726 Average Size: 3772.78b/471.598B/117.899W Tot/Avg SubBlocks: 4065/1.73422 Tot/Avg Abbrevs: 0/0 Tot/Avg Records: 128487/54.8153 % Abbrev Recs: 0 to: Block ID #12 (FUNCTION_BLOCK): Num Instances: 2344 Total Size: 8.44518e+06b/1.05565e+06B/263912W % of file: 34.6203 Average Size: 3602.89b/450.362B/112.59W Tot/Avg SubBlocks: 4065/1.73422 Tot/Avg Abbrevs: 0/0 Tot/Avg Records: 128487/54.8153 % Abbrev Recs: 22.2077 --- Diffs of the changes: (+22 -1) BitcodeWriter.cpp | 23 ++++++++++++++++++++++- 1 files changed, 22 insertions(+), 1 deletion(-) Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.40 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.41 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.40 Sat May 5 02:36:14 2007 +++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Sat May 5 02:44:49 2007 @@ -40,7 +40,10 @@ CONSTANTS_SETTYPE_ABBREV = bitc::FIRST_APPLICATION_ABBREV, CONSTANTS_INTEGER_ABBREV, CONSTANTS_CE_CAST_Abbrev, - CONSTANTS_NULL_Abbrev + CONSTANTS_NULL_Abbrev, + + // FUNCTION_BLOCK abbrev id's. + FUNCTION_INST_LOAD_ABBREV = bitc::FIRST_APPLICATION_ABBREV }; @@ -722,6 +725,7 @@ Vals.push_back(VE.getValueID(I.getOperand(0))); // ptr. Vals.push_back(Log2_32(cast(I).getAlignment())+1); Vals.push_back(cast(I).isVolatile()); + AbbrevToUse = FUNCTION_INST_LOAD_ABBREV; break; case Instruction::Store: Code = bitc::FUNC_CODE_INST_STORE; @@ -947,6 +951,8 @@ assert(0 && "Unexpected abbrev ordering!"); } + + { // SETTYPE abbrev for CONSTANTS_BLOCK. BitCodeAbbrev *Abbv = new BitCodeAbbrev(); Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_SETTYPE)); @@ -986,6 +992,21 @@ assert(0 && "Unexpected abbrev ordering!"); } + // FIXME: This should only use space for first class types! + + { // INST_LOAD abbrev for FUNCTION_BLOCK. + BitCodeAbbrev *Abbv = new BitCodeAbbrev(); + Abbv->Add(BitCodeAbbrevOp(bitc::FUNC_CODE_INST_LOAD)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, // typeid + Log2_32_Ceil(VE.getTypes().size()+1))); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Ptr + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 4)); // Align + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // volatile + if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID, + Abbv) != FUNCTION_INST_LOAD_ABBREV) + assert(0 && "Unexpected abbrev ordering!"); + } + Stream.ExitBlock(); } From asl at math.spbu.ru Sat May 5 04:05:22 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 5 May 2007 04:05:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp X86TargetAsmInfo.cpp Message-ID: <200705050905.l4595Meg014541@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.104 -> 1.105 X86AsmPrinter.cpp updated: 1.241 -> 1.242 X86TargetAsmInfo.cpp updated: 1.40 -> 1.41 --- Log message: Emit sections/directives in the proper order. This fixes PR1376: http://llvm.org/PR1376 . Also, some small cleanup was made. --- Diffs of the changes: (+20 -34) X86ATTAsmPrinter.cpp | 21 ++++++--------------- X86AsmPrinter.cpp | 4 +--- X86TargetAsmInfo.cpp | 29 +++++++++++++---------------- 3 files changed, 20 insertions(+), 34 deletions(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.104 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.105 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.104 Sun Apr 29 13:35:00 2007 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Sat May 5 04:04:50 2007 @@ -71,9 +71,7 @@ /// method to print assembly for each instruction. /// bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) { - if (Subtarget->isTargetDarwin() || - Subtarget->isTargetELF() || - Subtarget->isTargetCygMing()) { + if (TAI->doesSupportDebugInformation()) { // Let PassManager know we need debug information and relay // the MachineModuleInfo address on to DwarfWriter. DW.SetModuleInfo(&getAnalysis()); @@ -150,9 +148,7 @@ F->getLinkage() == Function::WeakLinkage)) O << "Lllvm$workaround$fake$stub$" << CurrentFnName << ":\n"; - if (Subtarget->isTargetDarwin() || - Subtarget->isTargetELF() || - Subtarget->isTargetCygMing()) { + if (TAI->doesSupportDebugInformation()) { // Emit pre-function debug information. DW.BeginFunction(&MF); } @@ -173,22 +169,17 @@ } } - // Print out jump tables referenced by the function. - - // Mac OS X requires that the jump table follow the function, so that the jump - // table is part of the same atom that the function is in. - EmitJumpTableInfo(MF.getJumpTableInfo(), MF); - if (TAI->hasDotTypeDotSizeDirective()) O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n"; - if (Subtarget->isTargetDarwin() || - Subtarget->isTargetELF() || - Subtarget->isTargetCygMing()) { + if (TAI->doesSupportDebugInformation()) { // Emit post-function debug information. DW.EndFunction(); } + // Print out jump tables referenced by the function. + EmitJumpTableInfo(MF.getJumpTableInfo(), MF); + // We didn't modify anything. return false; } Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.241 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.242 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.241 Sun Apr 29 13:35:00 2007 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Sat May 5 04:04:50 2007 @@ -115,9 +115,7 @@ /// doInitialization bool X86SharedAsmPrinter::doInitialization(Module &M) { - if (Subtarget->isTargetELF() || - Subtarget->isTargetCygMing() || - Subtarget->isTargetDarwin()) { + if (TAI->doesSupportDebugInformation()) { // Emit initial debug information. DW.BeginModule(&M); } Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.40 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.41 --- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.40 Thu May 3 11:38:57 2007 +++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp Sat May 5 04:04:50 2007 @@ -81,7 +81,8 @@ // Emit a local label that is preserved until the linker runs. JumpTableSpecialLabelPrefix = "l"; } - + + SupportsDebugInformation = true; NeedsSet = true; DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug"; DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug"; @@ -97,26 +98,21 @@ break; case X86Subtarget::isELF: - // Set up DWARF directives - HasLEB128 = true; // Target asm supports leb128 directives (little-endian) - AbsoluteDebugSectionOffsets = true; - AbsoluteEHSectionOffsets = false; - // bool HasLEB128; // Defaults to false. - // hasDotLoc - True if target asm supports .loc directives. - // bool HasDotLoc; // Defaults to false. - // HasDotFile - True if target asm supports .file directives. - // bool HasDotFile; // Defaults to false. ReadOnlySection = "\t.section\t.rodata\n"; FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\", at progbits,4"; EightByteConstantSection = "\t.section\t.rodata.cst8,\"aM\", at progbits,8"; - SixteenByteConstantSection = - "\t.section\t.rodata.cst16,\"aM\", at progbits,16"; + SixteenByteConstantSection = "\t.section\t.rodata.cst16,\"aM\", at progbits,16"; CStringSection = "\t.section\t.rodata.str1.1,\"aMS\", at progbits,1"; PrivateGlobalPrefix = ".L"; WeakRefDirective = "\t.weak\t"; SetDirective = "\t.set\t"; PCSymbol = "."; - + + // Set up DWARF directives + HasLEB128 = true; // Target asm supports leb128 directives (little-endian) + AbsoluteDebugSectionOffsets = true; + AbsoluteEHSectionOffsets = false; + SupportsDebugInformation = true; DwarfRequiresFrameSection = false; DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\", at progbits"; DwarfInfoSection = "\t.section\t.debug_info,\"\", at progbits"; @@ -144,14 +140,15 @@ StaticCtorsSection = "\t.section .ctors,\"aw\""; StaticDtorsSection = "\t.section .dtors,\"aw\""; HiddenDirective = NULL; + PrivateGlobalPrefix = "L"; // Prefix for private global symbols + WeakRefDirective = "\t.weak\t"; + SetDirective = "\t.set\t"; // Set up DWARF directives HasLEB128 = true; // Target asm supports leb128 directives (little-endian) AbsoluteDebugSectionOffsets = true; AbsoluteEHSectionOffsets = false; - PrivateGlobalPrefix = "L"; // Prefix for private global symbols - WeakRefDirective = "\t.weak\t"; - SetDirective = "\t.set\t"; + SupportsDebugInformation = true; DwarfRequiresFrameSection = false; DwarfSectionOffsetDirective = "\t.secrel32\t"; DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"dr\""; From asl at math.spbu.ru Sat May 5 04:05:22 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 5 May 2007 04:05:22 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetAsmInfo.h Message-ID: <200705050905.l4595MdC014546@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetAsmInfo.h updated: 1.32 -> 1.33 --- Log message: Emit sections/directives in the proper order. This fixes PR1376: http://llvm.org/PR1376 . Also, some small cleanup was made. --- Diffs of the changes: (+12 -4) TargetAsmInfo.h | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) Index: llvm/include/llvm/Target/TargetAsmInfo.h diff -u llvm/include/llvm/Target/TargetAsmInfo.h:1.32 llvm/include/llvm/Target/TargetAsmInfo.h:1.33 --- llvm/include/llvm/Target/TargetAsmInfo.h:1.32 Tue May 1 17:23:12 2007 +++ llvm/include/llvm/Target/TargetAsmInfo.h Sat May 5 04:04:50 2007 @@ -282,8 +282,13 @@ /// HasDotFile - True if target asm supports .file directives. /// bool HasDotFile; // Defaults to false. - - /// SupportsExceptionHandling - True if target supports exception handling. + + /// SupportsDebugInformation - True if target supports emission of debugging + /// information. + bool SupportsDebugInformation; + + /// SupportsExceptionHandling - True if target supports + /// exception handling. /// bool SupportsExceptionHandling; // Defaults to false. @@ -549,10 +554,13 @@ bool hasDotFile() const { return HasDotFile; } - bool getSupportsExceptionHandling() const { + bool doesSupportDebugInformation() const { + return SupportsDebugInformation; + } + bool doesSupportExceptionHandling() const { return SupportsExceptionHandling; } - bool getDwarfRequiresFrameSection() const { + bool doesDwarfRequireFrameSection() const { return DwarfRequiresFrameSection; } const char *getDwarfSectionOffsetDirective() const { From asl at math.spbu.ru Sat May 5 04:05:20 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 5 May 2007 04:05:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetAsmInfo.cpp Message-ID: <200705050905.l4595KnG014532@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetAsmInfo.cpp updated: 1.26 -> 1.27 --- Log message: Emit sections/directives in the proper order. This fixes PR1376: http://llvm.org/PR1376 . Also, some small cleanup was made. --- Diffs of the changes: (+1 -0) TargetAsmInfo.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Target/TargetAsmInfo.cpp diff -u llvm/lib/Target/TargetAsmInfo.cpp:1.26 llvm/lib/Target/TargetAsmInfo.cpp:1.27 --- llvm/lib/Target/TargetAsmInfo.cpp:1.26 Thu May 3 13:46:30 2007 +++ llvm/lib/Target/TargetAsmInfo.cpp Sat May 5 04:04:50 2007 @@ -80,6 +80,7 @@ HasLEB128(false), HasDotLoc(false), HasDotFile(false), + SupportsDebugInformation(false), SupportsExceptionHandling(false), DwarfRequiresFrameSection(true), DwarfSectionOffsetDirective(0), From asl at math.spbu.ru Sat May 5 04:05:16 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 5 May 2007 04:05:16 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp Message-ID: <200705050905.l4595GKj014527@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.133 -> 1.134 --- Log message: Emit sections/directives in the proper order. This fixes PR1376: http://llvm.org/PR1376 . Also, some small cleanup was made. --- Diffs of the changes: (+4 -4) DwarfWriter.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.133 llvm/lib/CodeGen/DwarfWriter.cpp:1.134 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.133 Tue May 1 17:23:12 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Sat May 5 04:04:50 2007 @@ -1955,7 +1955,7 @@ didInitial = true; // Dwarf sections base addresses. - if (TAI->getDwarfRequiresFrameSection()) { + if (TAI->doesDwarfRequireFrameSection()) { Asm->SwitchToDataSection(TAI->getDwarfFrameSection()); EmitLabel("section_frame", 0); } @@ -2324,7 +2324,7 @@ /// EmitInitialDebugFrame - Emit common frame info into a debug frame section. /// void EmitInitialDebugFrame() { - if (!TAI->getDwarfRequiresFrameSection()) + if (!TAI->doesDwarfRequireFrameSection()) return; int stackGrowth = @@ -2367,7 +2367,7 @@ /// EmitFunctionDebugFrame - Emit per function frame info into a debug frame /// section. void EmitFunctionDebugFrame() { - if (!TAI->getDwarfRequiresFrameSection()) + if (!TAI->doesDwarfRequireFrameSection()) return; // Start the dwarf frame section. @@ -3124,7 +3124,7 @@ if (MMI && ExceptionHandling && - TAI->getSupportsExceptionHandling()) { + TAI->doesSupportExceptionHandling()) { shouldEmit = true; // Assumes in correct section after the entry point. EmitLabel("eh_func_begin", ++SubprogramCount); From baldrick at free.fr Sat May 5 11:33:15 2007 From: baldrick at free.fr (Duncan Sands) Date: Sat, 5 May 2007 11:33:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp Message-ID: <200705051633.l45GXFsc021840@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.134 -> 1.135 --- Log message: Spelling fix. --- Diffs of the changes: (+1 -1) DwarfWriter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.134 llvm/lib/CodeGen/DwarfWriter.cpp:1.135 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.134 Sat May 5 04:04:50 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Sat May 5 11:32:57 2007 @@ -2725,7 +2725,7 @@ /// bool shouldEmit; - /// FuncCPPPersonality - C++ persoanlity function. + /// FuncCPPPersonality - C++ personality function. /// Function *FuncCPPPersonality; From clattner at apple.com Sat May 5 12:56:56 2007 From: clattner at apple.com (Chris Lattner) Date: Sat, 5 May 2007 10:56:56 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86.td In-Reply-To: <200705042039.l44Kd3IJ021901@zion.cs.uiuc.edu> References: <200705042039.l44Kd3IJ021901@zion.cs.uiuc.edu> Message-ID: On May 4, 2007, at 1:39 PM, Bill Wendling wrote: > Add an "implies" field to features. This indicates that, if the > current > feature is set, then the features in the implied list should be set > also. > The opposite is also enforced: if a feature in the implied list > isn't set, > then the feature that owns that implies list shouldn't be set either. Looks good. Does 3dnowa imply 3dnow? Does 64-bit imply sse2 or sse3? -Chris > > --- > Diffs of the changes: (+21 -17) > > X86.td | 38 +++++++++++++++++++++----------------- > 1 files changed, 21 insertions(+), 17 deletions(-) > > > Index: llvm/lib/Target/X86/X86.td > diff -u llvm/lib/Target/X86/X86.td:1.31 llvm/lib/Target/X86/X86.td: > 1.32 > --- llvm/lib/Target/X86/X86.td:1.31 Wed Apr 25 16:31:48 2007 > +++ llvm/lib/Target/X86/X86.td Fri May 4 15:38:40 2007 > @@ -18,24 +18,28 @@ > > // > ===------------------------------------------------------------------- > ---===// > // X86 Subtarget features. > -// > +// > ===------------------------------------------------------------------- > ---===// > > -def Feature64Bit : SubtargetFeature<"64bit", "HasX86_64", "true", > - "Support 64-bit > instructions">; > -def FeatureMMX : SubtargetFeature<"mmx","X86SSELevel", "MMX", > - "Enable MMX instructions">; > -def FeatureSSE1 : SubtargetFeature<"sse", "X86SSELevel", "SSE1", > - "Enable SSE instructions">; > -def FeatureSSE2 : SubtargetFeature<"sse2", "X86SSELevel", > "SSE2", > - "Enable SSE2 instructions">; > -def FeatureSSE3 : SubtargetFeature<"sse3", "X86SSELevel", > "SSE3", > - "Enable SSE3 instructions">; > -def FeatureSSSE3 : SubtargetFeature<"ssse3", "X86SSELevel", > "SSSE3", > - "Enable SSSE3 instructions">; > -def Feature3DNow : SubtargetFeature<"3dnow", "X863DNowLevel", > "ThreeDNow", > - "Enable 3DNow! > instructions">; > -def Feature3DNowA : SubtargetFeature<"3dnowa", "X863DNowLevel", > "ThreeDNowA", > - "Enable 3DNow! Athlon > instructions">; > +def Feature64Bit : SubtargetFeature<"64bit", "HasX86_64", "true", > + "Support 64-bit instructions">; > +def FeatureMMX : SubtargetFeature<"mmx","X86SSELevel", "MMX", > + "Enable MMX instructions">; > +def FeatureSSE1 : SubtargetFeature<"sse", "X86SSELevel", "SSE1", > + "Enable SSE instructions", > + [FeatureMMX]>; > +def FeatureSSE2 : SubtargetFeature<"sse2", "X86SSELevel", "SSE2", > + "Enable SSE2 instructions", > + [FeatureSSE1]>; > +def FeatureSSE3 : SubtargetFeature<"sse3", "X86SSELevel", "SSE3", > + "Enable SSE3 instructions", > + [FeatureSSE2]>; > +def FeatureSSSE3 : SubtargetFeature<"ssse3", "X86SSELevel", > "SSSE3", > + "Enable SSSE3 instructions", > + [FeatureSSE3]>; > +def Feature3DNow : SubtargetFeature<"3dnow", "X863DNowLevel", > "ThreeDNow", > + "Enable 3DNow! instructions">; > +def Feature3DNowA : SubtargetFeature<"3dnowa", "X863DNowLevel", > "ThreeDNowA", > + "Enable 3DNow! Athlon > instructions">; > > // > ===------------------------------------------------------------------- > ---===// > // X86 processors supported. > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at
Unconfirmed Attendees
NameOrganization