From evan.cheng at apple.com Mon Jun 21 01:10:31 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 20 Jun 2010 23:10:31 -0700 Subject: [llvm-commits] [llvm] r106299 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/call-tc.ll test/CodeGen/ARM/ifcvt6-tc.ll test/CodeGen/ARM/insn-sched1-tc.ll test/CodeGen/ARM/ldm-tc.ll test/CodeGen/Thumb2/thumb2-call-tc.ll test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll In-Reply-To: <8A376E83-1AA0-460A-A51B-A63A2C357E55@apple.com> References: <20100618190018.9B0C12A6C12C@llvm.org> <8474B36F-7A51-4680-9899-5418BA177E99@apple.com> <8A376E83-1AA0-460A-A51B-A63A2C357E55@apple.com> Message-ID: <0D0D4A79-1DCC-4F0B-9B80-1AE7B72124C4@apple.com> On Jun 20, 2010, at 1:25 PM, Dale Johannesen wrote: > > On Jun 18, 2010, at 5:44 PM, Evan Cheng wrote: > >> >> On Jun 18, 2010, at 12:00 PM, Dale Johannesen wrote: >>> >>> >>> Added: llvm/trunk/test/CodeGen/ARM/call-tc.ll >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/call-tc.ll?rev=106299&view=auto >>> ============================================================================== >>> --- llvm/trunk/test/CodeGen/ARM/call-tc.ll (added) >>> +++ llvm/trunk/test/CodeGen/ARM/call-tc.ll Fri Jun 18 14:00:18 2010 >>> @@ -0,0 +1,36 @@ >>> +; RUN: llc < %s -march=arm | FileCheck %s -check-prefix=CHECKV4 >>> +; RUN: llc < %s -march=arm -mattr=+v5t | FileCheck %s -check-prefix=CHECKV5 >>> +; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi\ >>> +; RUN: -relocation-model=pic | FileCheck %s -check-prefix=CHECKELF >>> + >>> + at t = weak global i32 ()* null ; [#uses=1] >>> + >>> +declare void @g(i32, i32, i32, i32) >>> + >>> +define void @f() { >>> +; CHECKELF: PLT >>> + call void @g( i32 1, i32 2, i32 3, i32 4 ) >> >> Why are you testing a non-tail call here? > > Originally we had call.ll whose behavior changed (correctly) when tail calls were added. Now call.ll has the "tail" removed in the source, so its ouput is unchanged, while tail-tc.ll is the original tail.ll, modified to check for what should come out with tail calls on. It is useful to test that things don't change as well as that they do, IMO, but I can remove the stuff that doesn't directly test tail calls if you prefer. If you feel the tests are useful please leave them in. But please do add a comment. I thought you forgot "tail" and was afraid it was checking for the wrong patterns. Evan > >>> + ret void >>> +} >>> + >>> +define void @g.upgrd.1() { >>> +; CHECKV4: bx r0 @ TAILCALL >>> +; CHECKV5: bx r0 @ TAILCALL >>> + %tmp = load i32 ()** @t ; [#uses=1] >>> + %tmp.upgrd.2 = tail call i32 %tmp( ) ; [#uses=0] >>> + ret void >>> +} >>> + >>> +define i32* @m_231b(i32, i32, i32*, i32*, i32*) nounwind { >>> +; CHECKV4: m_231b >>> +; CHECKV4: bx r{{.*}} >>> +BB0: >>> + %5 = inttoptr i32 %0 to i32* ; [#uses=1] >>> + %t35 = volatile load i32* %5 ; [#uses=1] >>> + %6 = inttoptr i32 %t35 to i32** ; [#uses=1] >>> + %7 = getelementptr i32** %6, i32 86 ; [#uses=1] >>> + %8 = load i32** %7 ; [#uses=1] >>> + %9 = bitcast i32* %8 to i32* (i32, i32*, i32, i32*, i32*, i32*)* ; [#uses=1] >>> + %10 = call i32* %9(i32 %0, i32* null, i32 %1, i32* %2, i32* %3, i32* %4) ; [#uses=1] >> >> Same here. >> >> Evan >> >>> + ret i32* %10 >>> +} >>> >>> Added: llvm/trunk/test/CodeGen/ARM/ifcvt6-tc.ll >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ifcvt6-tc.ll?rev=106299&view=auto >>> ============================================================================== >>> --- llvm/trunk/test/CodeGen/ARM/ifcvt6-tc.ll (added) >>> +++ llvm/trunk/test/CodeGen/ARM/ifcvt6-tc.ll Fri Jun 18 14:00:18 2010 >>> @@ -0,0 +1,23 @@ >>> +; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \ >>> +; RUN: grep cmpne | count 1 >>> +; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \ >>> +; RUN: grep bhi | count 1 >>> +; Here, tail call wins over eliminating branches. It is 1 fewer instruction >>> +; and removes all stack accesses, so seems like a win. >>> + >>> +define void @foo(i32 %X, i32 %Y) { >>> +entry: >>> + %tmp1 = icmp ult i32 %X, 4 ; [#uses=1] >>> + %tmp4 = icmp eq i32 %Y, 0 ; [#uses=1] >>> + %tmp7 = or i1 %tmp4, %tmp1 ; [#uses=1] >>> + br i1 %tmp7, label %cond_true, label %UnifiedReturnBlock >>> + >>> +cond_true: ; preds = %entry >>> + %tmp10 = tail call i32 (...)* @bar( ) ; [#uses=0] >>> + ret void >>> + >>> +UnifiedReturnBlock: ; preds = %entry >>> + ret void >>> +} >>> + >>> +declare i32 @bar(...) >>> >>> Added: llvm/trunk/test/CodeGen/ARM/insn-sched1-tc.ll >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/insn-sched1-tc.ll?rev=106299&view=auto >>> ============================================================================== >>> --- llvm/trunk/test/CodeGen/ARM/insn-sched1-tc.ll (added) >>> +++ llvm/trunk/test/CodeGen/ARM/insn-sched1-tc.ll Fri Jun 18 14:00:18 2010 >>> @@ -0,0 +1,11 @@ >>> +; RUN: llc < %s -march=arm -mattr=+v6 >>> +; RUN: llc < %s -mtriple=arm-apple-darwin -mattr=+v6 |\ >>> +; RUN: grep mov | count 2 >>> + >>> +define i32 @test(i32 %x) { >>> + %tmp = trunc i32 %x to i16 ; [#uses=1] >>> + %tmp2 = tail call i32 @f( i32 1, i16 %tmp ) ; [#uses=1] >>> + ret i32 %tmp2 >>> +} >>> + >>> +declare i32 @f(i32, i16) >>> >>> Added: llvm/trunk/test/CodeGen/ARM/ldm-tc.ll >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ldm-tc.ll?rev=106299&view=auto >>> ============================================================================== >>> --- llvm/trunk/test/CodeGen/ARM/ldm-tc.ll (added) >>> +++ llvm/trunk/test/CodeGen/ARM/ldm-tc.ll Fri Jun 18 14:00:18 2010 >>> @@ -0,0 +1,37 @@ >>> +; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s >>> + >>> + at X = external global [0 x i32] ; <[0 x i32]*> [#uses=5] >>> + >>> +define i32 @t1() { >>> +; CHECK: t1: >>> +; CHECK: ldmia >>> + %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 0) ; [#uses=1] >>> + %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; [#uses=1] >>> + %tmp4 = tail call i32 @f1( i32 %tmp, i32 %tmp3 ) ; [#uses=1] >>> + ret i32 %tmp4 >>> +} >>> + >>> +define i32 @t2() { >>> +; CHECK: t2: >>> +; CHECK: ldmia >>> + %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; [#uses=1] >>> + %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; [#uses=1] >>> + %tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 4) ; [#uses=1] >>> + %tmp6 = tail call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; [#uses=1] >>> + ret i32 %tmp6 >>> +} >>> + >>> +define i32 @t3() { >>> +; CHECK: t3: >>> +; CHECK: ldmib >>> +; CHECK: b.w _f2 @ TAILCALL >>> + %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; [#uses=1] >>> + %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; [#uses=1] >>> + %tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; [#uses=1] >>> + %tmp6 = tail call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; [#uses=1] >>> + ret i32 %tmp6 >>> +} >>> + >>> +declare i32 @f1(i32, i32) >>> + >>> +declare i32 @f2(i32, i32, i32) >>> >>> Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll?rev=106299&view=auto >>> ============================================================================== >>> --- llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll (added) >>> +++ llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll Fri Jun 18 14:00:18 2010 >>> @@ -0,0 +1,27 @@ >>> +; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mattr=+thumb2 | FileCheck %s -check-prefix=DARWIN >>> +; RUN: llc < %s -mtriple=thumbv7-linux -mattr=+thumb2 | FileCheck %s -check-prefix=LINUX >>> + >>> + at t = weak global i32 ()* null ; [#uses=1] >>> + >>> +declare void @g(i32, i32, i32, i32) >>> + >>> +define void @f() { >>> +; DARWIN: f: >>> +; DARWIN: blx _g >>> + >>> +; LINUX: f: >>> +; LINUX: bl g >>> + call void @g( i32 1, i32 2, i32 3, i32 4 ) >>> + ret void >>> +} >>> + >>> +define void @h() { >>> +; DARWIN: h: >>> +; DARWIN: bx r0 @ TAILCALL >>> + >>> +; LINUX: h: >>> +; LINUX: bx r0 @ TAILCALL >>> + %tmp = load i32 ()** @t ; [#uses=1] >>> + %tmp.upgrd.2 = tail call i32 %tmp( ) ; [#uses=0] >>> + ret void >>> +} >>> >>> Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll?rev=106299&view=auto >>> ============================================================================== >>> --- llvm/trunk/test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll (added) >>> +++ llvm/trunk/test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll Fri Jun 18 14:00:18 2010 >>> @@ -0,0 +1,86 @@ >>> +; RUN: llc < %s -mtriple=thumbv7-apple-darwin | FileCheck %s >>> + >>> +define i32 @t1(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { >>> +; CHECK: t1: >>> +; CHECK: it ne >>> +; CHECK: cmpne >>> + switch i32 %c, label %cond_next [ >>> + i32 1, label %cond_true >>> + i32 7, label %cond_true >>> + ] >>> + >>> +cond_true: >>> + %tmp12 = add i32 %a, 1 >>> + %tmp1518 = add i32 %tmp12, %b >>> + ret i32 %tmp1518 >>> + >>> +cond_next: >>> + %tmp15 = add i32 %b, %a >>> + ret i32 %tmp15 >>> +} >>> + >>> +; FIXME: Check for # of unconditional branch after adding branch folding post ifcvt. >>> +define i32 @t2(i32 %a, i32 %b) nounwind { >>> +entry: >>> +; CHECK: t2: >>> +; CHECK: ite gt >>> +; CHECK: subgt >>> +; CHECK: suble >>> + %tmp1434 = icmp eq i32 %a, %b ; [#uses=1] >>> + br i1 %tmp1434, label %bb17, label %bb.outer >>> + >>> +bb.outer: ; preds = %cond_false, %entry >>> + %b_addr.021.0.ph = phi i32 [ %b, %entry ], [ %tmp10, %cond_false ] ; [#uses=5] >>> + %a_addr.026.0.ph = phi i32 [ %a, %entry ], [ %a_addr.026.0, %cond_false ] ; [#uses=1] >>> + br label %bb >>> + >>> +bb: ; preds = %cond_true, %bb.outer >>> + %indvar = phi i32 [ 0, %bb.outer ], [ %indvar.next, %cond_true ] ; [#uses=2] >>> + %tmp. = sub i32 0, %b_addr.021.0.ph ; [#uses=1] >>> + %tmp.40 = mul i32 %indvar, %tmp. ; [#uses=1] >>> + %a_addr.026.0 = add i32 %tmp.40, %a_addr.026.0.ph ; [#uses=6] >>> + %tmp3 = icmp sgt i32 %a_addr.026.0, %b_addr.021.0.ph ; [#uses=1] >>> + br i1 %tmp3, label %cond_true, label %cond_false >>> + >>> +cond_true: ; preds = %bb >>> + %tmp7 = sub i32 %a_addr.026.0, %b_addr.021.0.ph ; [#uses=2] >>> + %tmp1437 = icmp eq i32 %tmp7, %b_addr.021.0.ph ; [#uses=1] >>> + %indvar.next = add i32 %indvar, 1 ; [#uses=1] >>> + br i1 %tmp1437, label %bb17, label %bb >>> + >>> +cond_false: ; preds = %bb >>> + %tmp10 = sub i32 %b_addr.021.0.ph, %a_addr.026.0 ; [#uses=2] >>> + %tmp14 = icmp eq i32 %a_addr.026.0, %tmp10 ; [#uses=1] >>> + br i1 %tmp14, label %bb17, label %bb.outer >>> + >>> +bb17: ; preds = %cond_false, %cond_true, %entry >>> + %a_addr.026.1 = phi i32 [ %a, %entry ], [ %tmp7, %cond_true ], [ %a_addr.026.0, %cond_false ] ; [#uses=1] >>> + ret i32 %a_addr.026.1 >>> +} >>> + >>> + at x = external global i32* ; [#uses=1] >>> + >>> +define void @foo(i32 %a) nounwind { >>> +entry: >>> + %tmp = load i32** @x ; [#uses=1] >>> + store i32 %a, i32* %tmp >>> + ret void >>> +} >>> + >>> +; Tail call prevents use of ifcvt in this one. Seems like a win though. >>> +define void @t3(i32 %a, i32 %b) nounwind { >>> +entry: >>> +; CHECK: t3: >>> +; CHECK-NOT: it lt >>> +; CHECK-NOT: poplt >>> +; CHECK: b.w _foo @ TAILCALL >>> + %tmp1 = icmp sgt i32 %a, 10 ; [#uses=1] >>> + br i1 %tmp1, label %cond_true, label %UnifiedReturnBlock >>> + >>> +cond_true: ; preds = %entry >>> + tail call void @foo( i32 %b ) >>> + ret void >>> + >>> +UnifiedReturnBlock: ; preds = %entry >>> + ret void >>> +} >>> >>> >>> _______________________________________________ >>> 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/20100620/1e08c9ca/attachment.html From evan.cheng at apple.com Mon Jun 21 01:12:20 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Sun, 20 Jun 2010 23:12:20 -0700 Subject: [llvm-commits] [llvm] r106299 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/call-tc.ll test/CodeGen/ARM/ifcvt6-tc.ll test/CodeGen/ARM/insn-sched1-tc.ll test/CodeGen/ARM/ldm-tc.ll test/CodeGen/Thumb2/thumb2-call-tc.ll test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll In-Reply-To: References: <20100618190018.9B0C12A6C12C@llvm.org> <8474B36F-7A51-4680-9899-5418BA177E99@apple.com> <336E92AF-5556-45D3-BB56-971CEFCEF691@apple.com> Message-ID: <9377C01A-D7ED-4EFC-B48B-8DCD7C621132@apple.com> On Jun 20, 2010, at 1:29 PM, Dale Johannesen wrote: > > On Jun 18, 2010, at 5:51 PM, Evan Cheng wrote: > >> A few more comments: >> >> Please add a test case of an immediate call to a local function: >> >> define void @f() { >> ret void >> } >> >> define void @t4() { >> tail call void @f() >> ret void >> } >> >> On Darwin ARM, this will generate b.w. That's wrong. The .w suffix is for Thumb mode. > > Anton was claiming that too, but I don't believe it. A8.2 says .w "has no effect" when targeting ARM, and the Darwin assembler duly ignores it, correctly IMO. Even if the Darwin assembler ignores it, it's still weird. The ".w" suffix only makes sense in Thumb mode, can you fix it? Also, I suspect the llvm integrated assembler won't like it. > >> Also, please make sure this is disabled for Thumb1 mode since b.w is not available. > > Sorry about Thumb1, no matter how much testing, it's not enough... You are not the first one to break stuff. :-) Evan > >> Evan >> >> On Jun 18, 2010, at 5:44 PM, Evan Cheng wrote: >> >>> >>> On Jun 18, 2010, at 12:00 PM, Dale Johannesen wrote: >>>> >>>> >>>> Added: llvm/trunk/test/CodeGen/ARM/call-tc.ll >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/call-tc.ll?rev=106299&view=auto >>>> ============================================================================== >>>> --- llvm/trunk/test/CodeGen/ARM/call-tc.ll (added) >>>> +++ llvm/trunk/test/CodeGen/ARM/call-tc.ll Fri Jun 18 14:00:18 2010 >>>> @@ -0,0 +1,36 @@ >>>> +; RUN: llc < %s -march=arm | FileCheck %s -check-prefix=CHECKV4 >>>> +; RUN: llc < %s -march=arm -mattr=+v5t | FileCheck %s -check-prefix=CHECKV5 >>>> +; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi\ >>>> +; RUN: -relocation-model=pic | FileCheck %s -check-prefix=CHECKELF >>>> + >>>> + at t = weak global i32 ()* null ; [#uses=1] >>>> + >>>> +declare void @g(i32, i32, i32, i32) >>>> + >>>> +define void @f() { >>>> +; CHECKELF: PLT >>>> + call void @g( i32 1, i32 2, i32 3, i32 4 ) >>> >>> Why are you testing a non-tail call here? >>> >>>> + ret void >>>> +} >>>> + >>>> +define void @g.upgrd.1() { >>>> +; CHECKV4: bx r0 @ TAILCALL >>>> +; CHECKV5: bx r0 @ TAILCALL >>>> + %tmp = load i32 ()** @t ; [#uses=1] >>>> + %tmp.upgrd.2 = tail call i32 %tmp( ) ; [#uses=0] >>>> + ret void >>>> +} >>>> + >>>> +define i32* @m_231b(i32, i32, i32*, i32*, i32*) nounwind { >>>> +; CHECKV4: m_231b >>>> +; CHECKV4: bx r{{.*}} >>>> +BB0: >>>> + %5 = inttoptr i32 %0 to i32* ; [#uses=1] >>>> + %t35 = volatile load i32* %5 ; [#uses=1] >>>> + %6 = inttoptr i32 %t35 to i32** ; [#uses=1] >>>> + %7 = getelementptr i32** %6, i32 86 ; [#uses=1] >>>> + %8 = load i32** %7 ; [#uses=1] >>>> + %9 = bitcast i32* %8 to i32* (i32, i32*, i32, i32*, i32*, i32*)* ; [#uses=1] >>>> + %10 = call i32* %9(i32 %0, i32* null, i32 %1, i32* %2, i32* %3, i32* %4) ; [#uses=1] >>> >>> Same here. >>> >>> Evan >>> >>>> + ret i32* %10 >>>> +} >>>> >>>> Added: llvm/trunk/test/CodeGen/ARM/ifcvt6-tc.ll >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ifcvt6-tc.ll?rev=106299&view=auto >>>> ============================================================================== >>>> --- llvm/trunk/test/CodeGen/ARM/ifcvt6-tc.ll (added) >>>> +++ llvm/trunk/test/CodeGen/ARM/ifcvt6-tc.ll Fri Jun 18 14:00:18 2010 >>>> @@ -0,0 +1,23 @@ >>>> +; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \ >>>> +; RUN: grep cmpne | count 1 >>>> +; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \ >>>> +; RUN: grep bhi | count 1 >>>> +; Here, tail call wins over eliminating branches. It is 1 fewer instruction >>>> +; and removes all stack accesses, so seems like a win. >>>> + >>>> +define void @foo(i32 %X, i32 %Y) { >>>> +entry: >>>> + %tmp1 = icmp ult i32 %X, 4 ; [#uses=1] >>>> + %tmp4 = icmp eq i32 %Y, 0 ; [#uses=1] >>>> + %tmp7 = or i1 %tmp4, %tmp1 ; [#uses=1] >>>> + br i1 %tmp7, label %cond_true, label %UnifiedReturnBlock >>>> + >>>> +cond_true: ; preds = %entry >>>> + %tmp10 = tail call i32 (...)* @bar( ) ; [#uses=0] >>>> + ret void >>>> + >>>> +UnifiedReturnBlock: ; preds = %entry >>>> + ret void >>>> +} >>>> + >>>> +declare i32 @bar(...) >>>> >>>> Added: llvm/trunk/test/CodeGen/ARM/insn-sched1-tc.ll >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/insn-sched1-tc.ll?rev=106299&view=auto >>>> ============================================================================== >>>> --- llvm/trunk/test/CodeGen/ARM/insn-sched1-tc.ll (added) >>>> +++ llvm/trunk/test/CodeGen/ARM/insn-sched1-tc.ll Fri Jun 18 14:00:18 2010 >>>> @@ -0,0 +1,11 @@ >>>> +; RUN: llc < %s -march=arm -mattr=+v6 >>>> +; RUN: llc < %s -mtriple=arm-apple-darwin -mattr=+v6 |\ >>>> +; RUN: grep mov | count 2 >>>> + >>>> +define i32 @test(i32 %x) { >>>> + %tmp = trunc i32 %x to i16 ; [#uses=1] >>>> + %tmp2 = tail call i32 @f( i32 1, i16 %tmp ) ; [#uses=1] >>>> + ret i32 %tmp2 >>>> +} >>>> + >>>> +declare i32 @f(i32, i16) >>>> >>>> Added: llvm/trunk/test/CodeGen/ARM/ldm-tc.ll >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ldm-tc.ll?rev=106299&view=auto >>>> ============================================================================== >>>> --- llvm/trunk/test/CodeGen/ARM/ldm-tc.ll (added) >>>> +++ llvm/trunk/test/CodeGen/ARM/ldm-tc.ll Fri Jun 18 14:00:18 2010 >>>> @@ -0,0 +1,37 @@ >>>> +; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s >>>> + >>>> + at X = external global [0 x i32] ; <[0 x i32]*> [#uses=5] >>>> + >>>> +define i32 @t1() { >>>> +; CHECK: t1: >>>> +; CHECK: ldmia >>>> + %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 0) ; [#uses=1] >>>> + %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; [#uses=1] >>>> + %tmp4 = tail call i32 @f1( i32 %tmp, i32 %tmp3 ) ; [#uses=1] >>>> + ret i32 %tmp4 >>>> +} >>>> + >>>> +define i32 @t2() { >>>> +; CHECK: t2: >>>> +; CHECK: ldmia >>>> + %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; [#uses=1] >>>> + %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; [#uses=1] >>>> + %tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 4) ; [#uses=1] >>>> + %tmp6 = tail call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; [#uses=1] >>>> + ret i32 %tmp6 >>>> +} >>>> + >>>> +define i32 @t3() { >>>> +; CHECK: t3: >>>> +; CHECK: ldmib >>>> +; CHECK: b.w _f2 @ TAILCALL >>>> + %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; [#uses=1] >>>> + %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; [#uses=1] >>>> + %tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; [#uses=1] >>>> + %tmp6 = tail call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; [#uses=1] >>>> + ret i32 %tmp6 >>>> +} >>>> + >>>> +declare i32 @f1(i32, i32) >>>> + >>>> +declare i32 @f2(i32, i32, i32) >>>> >>>> Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll?rev=106299&view=auto >>>> ============================================================================== >>>> --- llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll (added) >>>> +++ llvm/trunk/test/CodeGen/Thumb2/thumb2-call-tc.ll Fri Jun 18 14:00:18 2010 >>>> @@ -0,0 +1,27 @@ >>>> +; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mattr=+thumb2 | FileCheck %s -check-prefix=DARWIN >>>> +; RUN: llc < %s -mtriple=thumbv7-linux -mattr=+thumb2 | FileCheck %s -check-prefix=LINUX >>>> + >>>> + at t = weak global i32 ()* null ; [#uses=1] >>>> + >>>> +declare void @g(i32, i32, i32, i32) >>>> + >>>> +define void @f() { >>>> +; DARWIN: f: >>>> +; DARWIN: blx _g >>>> + >>>> +; LINUX: f: >>>> +; LINUX: bl g >>>> + call void @g( i32 1, i32 2, i32 3, i32 4 ) >>>> + ret void >>>> +} >>>> + >>>> +define void @h() { >>>> +; DARWIN: h: >>>> +; DARWIN: bx r0 @ TAILCALL >>>> + >>>> +; LINUX: h: >>>> +; LINUX: bx r0 @ TAILCALL >>>> + %tmp = load i32 ()** @t ; [#uses=1] >>>> + %tmp.upgrd.2 = tail call i32 %tmp( ) ; [#uses=0] >>>> + ret void >>>> +} >>>> >>>> Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll?rev=106299&view=auto >>>> ============================================================================== >>>> --- llvm/trunk/test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll (added) >>>> +++ llvm/trunk/test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll Fri Jun 18 14:00:18 2010 >>>> @@ -0,0 +1,86 @@ >>>> +; RUN: llc < %s -mtriple=thumbv7-apple-darwin | FileCheck %s >>>> + >>>> +define i32 @t1(i32 %a, i32 %b, i32 %c, i32 %d) nounwind { >>>> +; CHECK: t1: >>>> +; CHECK: it ne >>>> +; CHECK: cmpne >>>> + switch i32 %c, label %cond_next [ >>>> + i32 1, label %cond_true >>>> + i32 7, label %cond_true >>>> + ] >>>> + >>>> +cond_true: >>>> + %tmp12 = add i32 %a, 1 >>>> + %tmp1518 = add i32 %tmp12, %b >>>> + ret i32 %tmp1518 >>>> + >>>> +cond_next: >>>> + %tmp15 = add i32 %b, %a >>>> + ret i32 %tmp15 >>>> +} >>>> + >>>> +; FIXME: Check for # of unconditional branch after adding branch folding post ifcvt. >>>> +define i32 @t2(i32 %a, i32 %b) nounwind { >>>> +entry: >>>> +; CHECK: t2: >>>> +; CHECK: ite gt >>>> +; CHECK: subgt >>>> +; CHECK: suble >>>> + %tmp1434 = icmp eq i32 %a, %b ; [#uses=1] >>>> + br i1 %tmp1434, label %bb17, label %bb.outer >>>> + >>>> +bb.outer: ; preds = %cond_false, %entry >>>> + %b_addr.021.0.ph = phi i32 [ %b, %entry ], [ %tmp10, %cond_false ] ; [#uses=5] >>>> + %a_addr.026.0.ph = phi i32 [ %a, %entry ], [ %a_addr.026.0, %cond_false ] ; [#uses=1] >>>> + br label %bb >>>> + >>>> +bb: ; preds = %cond_true, %bb.outer >>>> + %indvar = phi i32 [ 0, %bb.outer ], [ %indvar.next, %cond_true ] ; [#uses=2] >>>> + %tmp. = sub i32 0, %b_addr.021.0.ph ; [#uses=1] >>>> + %tmp.40 = mul i32 %indvar, %tmp. ; [#uses=1] >>>> + %a_addr.026.0 = add i32 %tmp.40, %a_addr.026.0.ph ; [#uses=6] >>>> + %tmp3 = icmp sgt i32 %a_addr.026.0, %b_addr.021.0.ph ; [#uses=1] >>>> + br i1 %tmp3, label %cond_true, label %cond_false >>>> + >>>> +cond_true: ; preds = %bb >>>> + %tmp7 = sub i32 %a_addr.026.0, %b_addr.021.0.ph ; [#uses=2] >>>> + %tmp1437 = icmp eq i32 %tmp7, %b_addr.021.0.ph ; [#uses=1] >>>> + %indvar.next = add i32 %indvar, 1 ; [#uses=1] >>>> + br i1 %tmp1437, label %bb17, label %bb >>>> + >>>> +cond_false: ; preds = %bb >>>> + %tmp10 = sub i32 %b_addr.021.0.ph, %a_addr.026.0 ; [#uses=2] >>>> + %tmp14 = icmp eq i32 %a_addr.026.0, %tmp10 ; [#uses=1] >>>> + br i1 %tmp14, label %bb17, label %bb.outer >>>> + >>>> +bb17: ; preds = %cond_false, %cond_true, %entry >>>> + %a_addr.026.1 = phi i32 [ %a, %entry ], [ %tmp7, %cond_true ], [ %a_addr.026.0, %cond_false ] ; [#uses=1] >>>> + ret i32 %a_addr.026.1 >>>> +} >>>> + >>>> + at x = external global i32* ; [#uses=1] >>>> + >>>> +define void @foo(i32 %a) nounwind { >>>> +entry: >>>> + %tmp = load i32** @x ; [#uses=1] >>>> + store i32 %a, i32* %tmp >>>> + ret void >>>> +} >>>> + >>>> +; Tail call prevents use of ifcvt in this one. Seems like a win though. >>>> +define void @t3(i32 %a, i32 %b) nounwind { >>>> +entry: >>>> +; CHECK: t3: >>>> +; CHECK-NOT: it lt >>>> +; CHECK-NOT: poplt >>>> +; CHECK: b.w _foo @ TAILCALL >>>> + %tmp1 = icmp sgt i32 %a, 10 ; [#uses=1] >>>> + br i1 %tmp1, label %cond_true, label %UnifiedReturnBlock >>>> + >>>> +cond_true: ; preds = %entry >>>> + tail call void @foo( i32 %b ) >>>> + ret void >>>> + >>>> +UnifiedReturnBlock: ; preds = %entry >>>> + ret void >>>> +} >>>> >>>> >>>> _______________________________________________ >>>> 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/20100620/48a803cd/attachment.html From kalle.raiskila at nokia.com Mon Jun 21 05:17:36 2010 From: kalle.raiskila at nokia.com (Kalle Raiskila) Date: Mon, 21 Jun 2010 10:17:36 -0000 Subject: [llvm-commits] [llvm] r106411 - in /llvm/trunk: lib/Target/CellSPU/SPUISelLowering.cpp test/CodeGen/CellSPU/shuffles.ll Message-ID: <20100621101736.986982A6C12C@llvm.org> Author: kraiskil Date: Mon Jun 21 05:17:36 2010 New Revision: 106411 URL: http://llvm.org/viewvc/llvm-project?rev=106411&view=rev Log: Fix lowering of VECTOR_SHUFFLE on SPU. Old algorithm used to choke llc with the attached test. Added: llvm/trunk/test/CodeGen/CellSPU/shuffles.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=106411&r1=106410&r2=106411&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Jun 21 05:17:36 2010 @@ -1746,15 +1746,20 @@ unsigned V0Elt = 0; bool monotonic = true; bool rotate = true; + EVT maskVT; // which of the c?d instructions to use if (EltVT == MVT::i8) { V2EltIdx0 = 16; + maskVT = MVT::v16i8; } else if (EltVT == MVT::i16) { V2EltIdx0 = 8; + maskVT = MVT::v8i16; } else if (EltVT == MVT::i32 || EltVT == MVT::f32) { V2EltIdx0 = 4; + maskVT = MVT::v4i32; } else if (EltVT == MVT::i64 || EltVT == MVT::f64) { V2EltIdx0 = 2; + maskVT = MVT::v2i64; } else llvm_unreachable("Unhandled vector type in LowerVECTOR_SHUFFLE"); @@ -1800,16 +1805,16 @@ // Compute mask and shuffle MachineFunction &MF = DAG.getMachineFunction(); MachineRegisterInfo &RegInfo = MF.getRegInfo(); - unsigned VReg = RegInfo.createVirtualRegister(&SPU::R32CRegClass); EVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); - // Initialize temporary register to 0 - SDValue InitTempReg = - DAG.getCopyToReg(DAG.getEntryNode(), dl, VReg, DAG.getConstant(0, PtrVT)); - // Copy register's contents as index in SHUFFLE_MASK: - SDValue ShufMaskOp = - DAG.getNode(SPUISD::SHUFFLE_MASK, dl, MVT::v4i32, - DAG.getTargetConstant(V2Elt, MVT::i32), - DAG.getCopyFromReg(InitTempReg, dl, VReg, PtrVT)); + + // As SHUFFLE_MASK becomes a c?d instruction, feed it an address + // R1 ($sp) is used here only as it is guaranteed to have last bits zero + SDValue Pointer = DAG.getNode(SPUISD::IndirectAddr, dl, PtrVT, + DAG.getRegister(SPU::R1, PtrVT), + DAG.getConstant(V2Elt, MVT::i32)); + SDValue ShufMaskOp = DAG.getNode(SPUISD::SHUFFLE_MASK, dl, + maskVT, Pointer); + // Use shuffle mask in SHUFB synthetic instruction: return DAG.getNode(SPUISD::SHUFB, dl, V1.getValueType(), V2, V1, ShufMaskOp); Added: llvm/trunk/test/CodeGen/CellSPU/shuffles.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/shuffles.ll?rev=106411&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/shuffles.ll (added) +++ llvm/trunk/test/CodeGen/CellSPU/shuffles.ll Mon Jun 21 05:17:36 2010 @@ -0,0 +1,10 @@ +; RUN: llc --march=cellspu < %s | FileCheck %s + +define <4 x float> @shuffle(<4 x float> %param1, <4 x float> %param2) { + ; CHECK: cwd {{\$.}}, 0($sp) + ; CHECK: shufb {{\$., \$4, \$3, \$.}} + %val= shufflevector <4 x float> %param1, <4 x float> %param2, <4 x i32> + ret <4 x float> %val + +} + From rafael.espindola at gmail.com Mon Jun 21 08:31:32 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 21 Jun 2010 13:31:32 -0000 Subject: [llvm-commits] [llvm] r106413 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Message-ID: <20100621133132.878A92A6C12C@llvm.org> Author: rafael Date: Mon Jun 21 08:31:32 2010 New Revision: 106413 URL: http://llvm.org/viewvc/llvm-project?rev=106413&view=rev Log: Fix an unintentional commit. I think I typed "git svn dcommit" in the wrong branch. I was trying to do some refactoring on the copyRegToReg, but this is realyl a work in progress and not generally useful yet. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=106413&r1=106412&r2=106413&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Jun 21 08:31:32 2010 @@ -1890,26 +1890,6 @@ return X86::GR8_ABCD_HRegClass.contains(Reg); } - -static const TargetRegisterClass *findCommonRC(const TargetRegisterClass *a, - const TargetRegisterClass *b) { - if (a == b) - return a; - if (a->hasSuperClass(b)) - return b; - if (b->hasSuperClass(a)) - return a; - for (TargetRegisterClass::sc_iterator i = a->superclasses_begin(), - e = a->superclasses_end(); - i != e; - ++i) { - const TargetRegisterClass *s = *i; - if (b->hasSuperClass(s)) - return s; - } - return NULL; -} - bool X86InstrInfo::copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, unsigned SrcReg, @@ -1918,7 +1898,24 @@ DebugLoc DL) const { // Determine if DstRC and SrcRC have a common superclass in common. - const TargetRegisterClass *CommonRC = findCommonRC(SrcRC, DestRC); + const TargetRegisterClass *CommonRC = DestRC; + if (DestRC == SrcRC) + /* Source and destination have the same register class. */; + else if (CommonRC->hasSuperClass(SrcRC)) + CommonRC = SrcRC; + else if (!DestRC->hasSubClass(SrcRC)) { + // Neither of GR64_NOREX or GR64_NOSP is a superclass of the other, + // but we want to copy them as GR64. Similarly, for GR32_NOREX and + // GR32_NOSP, copy as GR32. + if (SrcRC->hasSuperClass(&X86::GR64RegClass) && + DestRC->hasSuperClass(&X86::GR64RegClass)) + CommonRC = &X86::GR64RegClass; + else if (SrcRC->hasSuperClass(&X86::GR32RegClass) && + DestRC->hasSuperClass(&X86::GR32RegClass)) + CommonRC = &X86::GR32RegClass; + else + CommonRC = 0; + } if (CommonRC) { unsigned Opc; @@ -1984,41 +1981,29 @@ return true; } - if (X86::RSTRegClass.contains(SrcReg)) - CommonRC = DestRC; - else if (X86::RSTRegClass.contains(DestReg)) - CommonRC = SrcRC; - else if (X86::CCRRegClass.contains(SrcReg)) - CommonRC = DestRC; - else if (X86::CCRRegClass.contains(DestReg)) - CommonRC = SrcRC; - - if (!CommonRC) - return false; - // Moving EFLAGS to / from another register requires a push and a pop. - if (X86::CCRRegClass.contains(SrcReg)) { + if (SrcRC == &X86::CCRRegClass) { if (SrcReg != X86::EFLAGS) return false; - if (CommonRC == &X86::GR64RegClass || CommonRC == &X86::GR64_NOSPRegClass) { + if (DestRC == &X86::GR64RegClass || DestRC == &X86::GR64_NOSPRegClass) { BuildMI(MBB, MI, DL, get(X86::PUSHF64)); BuildMI(MBB, MI, DL, get(X86::POP64r), DestReg); return true; - } else if (CommonRC == &X86::GR32RegClass || - CommonRC == &X86::GR32_NOSPRegClass) { + } else if (DestRC == &X86::GR32RegClass || + DestRC == &X86::GR32_NOSPRegClass) { BuildMI(MBB, MI, DL, get(X86::PUSHF32)); BuildMI(MBB, MI, DL, get(X86::POP32r), DestReg); return true; } - } else if (X86::CCRRegClass.contains(DestReg)) { + } else if (DestRC == &X86::CCRRegClass) { if (DestReg != X86::EFLAGS) return false; - if (CommonRC == &X86::GR64RegClass || CommonRC == &X86::GR64_NOSPRegClass) { + if (SrcRC == &X86::GR64RegClass || DestRC == &X86::GR64_NOSPRegClass) { BuildMI(MBB, MI, DL, get(X86::PUSH64r)).addReg(SrcReg); BuildMI(MBB, MI, DL, get(X86::POPF64)); return true; - } else if (CommonRC == &X86::GR32RegClass || - CommonRC == &X86::GR32_NOSPRegClass) { + } else if (SrcRC == &X86::GR32RegClass || + DestRC == &X86::GR32_NOSPRegClass) { BuildMI(MBB, MI, DL, get(X86::PUSH32r)).addReg(SrcReg); BuildMI(MBB, MI, DL, get(X86::POPF32)); return true; @@ -2026,19 +2011,19 @@ } // Moving from ST(0) turns into FpGET_ST0_32 etc. - if (X86::RSTRegClass.contains(SrcReg)) { + if (SrcRC == &X86::RSTRegClass) { // Copying from ST(0)/ST(1). if (SrcReg != X86::ST0 && SrcReg != X86::ST1) // Can only copy from ST(0)/ST(1) right now return false; bool isST0 = SrcReg == X86::ST0; unsigned Opc; - if (CommonRC == &X86::RFP32RegClass) + if (DestRC == &X86::RFP32RegClass) Opc = isST0 ? X86::FpGET_ST0_32 : X86::FpGET_ST1_32; - else if (CommonRC == &X86::RFP64RegClass) + else if (DestRC == &X86::RFP64RegClass) Opc = isST0 ? X86::FpGET_ST0_64 : X86::FpGET_ST1_64; else { - if (CommonRC != &X86::RFP80RegClass) + if (DestRC != &X86::RFP80RegClass) return false; Opc = isST0 ? X86::FpGET_ST0_80 : X86::FpGET_ST1_80; } @@ -2047,19 +2032,19 @@ } // Moving to ST(0) turns into FpSET_ST0_32 etc. - if (X86::RSTRegClass.contains(DestReg)) { + if (DestRC == &X86::RSTRegClass) { // Copying to ST(0) / ST(1). if (DestReg != X86::ST0 && DestReg != X86::ST1) // Can only copy to TOS right now return false; bool isST0 = DestReg == X86::ST0; unsigned Opc; - if (CommonRC == &X86::RFP32RegClass) + if (SrcRC == &X86::RFP32RegClass) Opc = isST0 ? X86::FpSET_ST0_32 : X86::FpSET_ST1_32; - else if (CommonRC == &X86::RFP64RegClass) + else if (SrcRC == &X86::RFP64RegClass) Opc = isST0 ? X86::FpSET_ST0_64 : X86::FpSET_ST1_64; else { - if (CommonRC != &X86::RFP80RegClass) + if (SrcRC != &X86::RFP80RegClass) return false; Opc = isST0 ? X86::FpSET_ST0_80 : X86::FpSET_ST1_80; } From gohman at apple.com Mon Jun 21 09:17:46 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 21 Jun 2010 14:17:46 -0000 Subject: [llvm-commits] [llvm] r106414 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Message-ID: <20100621141746.B587D2A6C12C@llvm.org> Author: djg Date: Mon Jun 21 09:17:46 2010 New Revision: 106414 URL: http://llvm.org/viewvc/llvm-project?rev=106414&view=rev Log: Generalize this to look in the regular ValueMap in addition to the LocalValueMap, to make it more flexible when fast-isel isn't proceding straight top-down. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=106414&r1=106413&r2=106414&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Mon Jun 21 09:17:46 2010 @@ -162,7 +162,7 @@ } } else if (const Operator *Op = dyn_cast(V)) { if (!SelectOperator(Op, Op->getOpcode())) return 0; - Reg = LocalValueMap[Op]; + Reg = lookUpRegForValue(Op); } else if (isa(V)) { Reg = createResultReg(TLI.getRegClassFor(VT)); BuildMI(MBB, DL, TII.get(TargetOpcode::IMPLICIT_DEF), Reg); From gohman at apple.com Mon Jun 21 09:21:47 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 21 Jun 2010 14:21:47 -0000 Subject: [llvm-commits] [llvm] r106415 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Message-ID: <20100621142147.A6F272A6C12C@llvm.org> Author: djg Date: Mon Jun 21 09:21:47 2010 New Revision: 106415 URL: http://llvm.org/viewvc/llvm-project?rev=106415&view=rev Log: Do one lookup instead of two. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=106415&r1=106414&r2=106415&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Mon Jun 21 09:21:47 2010 @@ -185,8 +185,9 @@ // cache values defined by Instructions across blocks, and other values // only locally. This is because Instructions already have the SSA // def-dominates-use requirement enforced. - if (ValueMap.count(V)) - return ValueMap[V]; + DenseMap::iterator I = ValueMap.find(V); + if (I != ValueMap.end()) + return I->second; return LocalValueMap[V]; } From kalle.raiskila at nokia.com Mon Jun 21 09:42:19 2010 From: kalle.raiskila at nokia.com (Kalle Raiskila) Date: Mon, 21 Jun 2010 14:42:19 -0000 Subject: [llvm-commits] [llvm] r106419 - in /llvm/trunk: lib/Target/CellSPU/SPUISelLowering.cpp test/CodeGen/CellSPU/shuffles.ll Message-ID: <20100621144220.0AE102A6C12C@llvm.org> Author: kraiskil Date: Mon Jun 21 09:42:19 2010 New Revision: 106419 URL: http://llvm.org/viewvc/llvm-project?rev=106419&view=rev Log: Fix the lowering of VECTOR_SHUFFLE on SPU to handle splats. Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/test/CodeGen/CellSPU/shuffles.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=106419&r1=106418&r2=106419&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Jun 21 09:42:19 2010 @@ -1791,7 +1791,7 @@ } else { rotate = false; } - } else if (PrevElt == 0) { + } else if (i == 0) { // First time through, need to keep track of previous element PrevElt = SrcElt; } else { Modified: llvm/trunk/test/CodeGen/CellSPU/shuffles.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/shuffles.ll?rev=106419&r1=106418&r2=106419&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/shuffles.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/shuffles.ll Mon Jun 21 09:42:19 2010 @@ -5,6 +5,11 @@ ; CHECK: shufb {{\$., \$4, \$3, \$.}} %val= shufflevector <4 x float> %param1, <4 x float> %param2, <4 x i32> ret <4 x float> %val - } +define <4 x float> @splat(float %param1) { + %vec = insertelement <1 x float> undef, float %param1, i32 0 + %val= shufflevector <1 x float> %vec, <1 x float> undef, <4 x i32> + ret <4 x float> %val +} + From criswell at cs.uiuc.edu Mon Jun 21 09:54:46 2010 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 21 Jun 2010 09:54:46 -0500 Subject: [llvm-commits] CVS: llvm-www/safecode/menagerie/memsafety.html Message-ID: <201006211454.o5LEskx9024126@maute.cs.uiuc.edu> Changes in directory llvm-www/safecode/menagerie: memsafety.html updated: 1.5 -> 1.6 --- Log message: Added the Yutaka Oiwa paper on the memory safe ANSI C compiler. --- Diffs of the changes: (+14 -0) memsafety.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) Index: llvm-www/safecode/menagerie/memsafety.html diff -u llvm-www/safecode/menagerie/memsafety.html:1.5 llvm-www/safecode/menagerie/memsafety.html:1.6 --- llvm-www/safecode/menagerie/memsafety.html:1.5 Fri Jun 18 10:16:41 2010 +++ llvm-www/safecode/menagerie/memsafety.html Mon Jun 21 09:54:12 2010 @@ -114,6 +114,20 @@
  • + + + Implementation of the Memory-Safe Full ANSI-C Compiler + +
    + Yutaka Oiwa +
    + ACM SIGPLAN Conference on Programming Language Design and + Implementation (PLDI), 2009 +
  • + +
    + +
  • Securing Software by Enforcing Data-Flow Integrity From kalle.raiskila at nokia.com Mon Jun 21 10:08:16 2010 From: kalle.raiskila at nokia.com (Kalle Raiskila) Date: Mon, 21 Jun 2010 15:08:16 -0000 Subject: [llvm-commits] [llvm] r106420 - in /llvm/trunk: lib/Target/CellSPU/SPUInstrInfo.cpp test/CodeGen/CellSPU/call.ll test/CodeGen/CellSPU/call_indirect.ll test/CodeGen/CellSPU/jumptable.ll test/CodeGen/CellSPU/loads.ll Message-ID: <20100621150816.A9BF52A6C12C@llvm.org> Author: kraiskil Date: Mon Jun 21 10:08:16 2010 New Revision: 106420 URL: http://llvm.org/viewvc/llvm-project?rev=106420&view=rev Log: Mark the SPU 'lr' instruction to never have side effects. This allows the fast regiser allocator to remove redundant register moves. Update a set of tests that depend on the register allocator to be linear scan. Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.cpp llvm/trunk/test/CodeGen/CellSPU/call.ll llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll llvm/trunk/test/CodeGen/CellSPU/jumptable.ll llvm/trunk/test/CodeGen/CellSPU/loads.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.cpp?rev=106420&r1=106419&r2=106420&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.cpp Mon Jun 21 10:08:16 2010 @@ -164,11 +164,9 @@ MI.getOperand(0).isReg() && MI.getOperand(1).isReg() && "invalid SPU OR_ or LR instruction!"); - if (MI.getOperand(0).getReg() == MI.getOperand(1).getReg()) { sourceReg = MI.getOperand(1).getReg(); destReg = MI.getOperand(0).getReg(); return true; - } break; } case SPU::ORv16i8: Modified: llvm/trunk/test/CodeGen/CellSPU/call.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/call.ll?rev=106420&r1=106419&r2=106420&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/call.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/call.ll Mon Jun 21 10:08:16 2010 @@ -1,7 +1,8 @@ -; RUN: llc < %s -march=cellspu > %t1.s +; RUN: llc < %s -march=cellspu -regalloc=linearscan > %t1.s ; RUN: grep brsl %t1.s | count 1 ; RUN: grep brasl %t1.s | count 1 ; RUN: grep stqd %t1.s | count 80 +; RUN: llc < %s -march=cellspu | FileCheck %s target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" target triple = "spu" @@ -16,6 +17,8 @@ declare void @extern_stub_1(i32, i32) define i32 @stub_1(i32 %x, float %y) { + ; CHECK: il $3, 0 + ; CHECK: bi $lr entry: ret i32 0 } Modified: llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll?rev=106420&r1=106419&r2=106420&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll Mon Jun 21 10:08:16 2010 @@ -1,5 +1,5 @@ -; RUN: llc < %s -march=cellspu -asm-verbose=0 > %t1.s -; RUN: llc < %s -march=cellspu -mattr=large_mem -asm-verbose=0 > %t2.s +; RUN: llc < %s -march=cellspu -asm-verbose=0 -regalloc=linearscan > %t1.s +; RUN: llc < %s -march=cellspu -mattr=large_mem -asm-verbose=0 -regalloc=linearscan > %t2.s ; RUN: grep bisl %t1.s | count 7 ; RUN: grep ila %t1.s | count 1 ; RUN: grep rotqby %t1.s | count 5 Modified: llvm/trunk/test/CodeGen/CellSPU/jumptable.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/jumptable.ll?rev=106420&r1=106419&r2=106420&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/jumptable.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/jumptable.ll Mon Jun 21 10:08:16 2010 @@ -2,9 +2,9 @@ ; This is to check that emitting jumptables doesn't crash llc define i32 @test(i32 %param) { entry: -;CHECK: ai $4, $3, -1 -;CHECK: clgti $5, $4, 3 -;CHECK: brnz $5,.LBB0_2 +;CHECK: ai {{\$.}}, $3, -1 +;CHECK: clgti {{\$., \$.}}, 3 +;CHECK: brnz {{\$.}},.LBB0_2 switch i32 %param, label %bb1 [ i32 1, label %bb3 i32 2, label %bb2 Modified: llvm/trunk/test/CodeGen/CellSPU/loads.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/loads.ll?rev=106420&r1=106419&r2=106420&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/loads.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/loads.ll Mon Jun 21 10:08:16 2010 @@ -22,13 +22,15 @@ declare <4 x i32>* @getv4f32ptr() define <4 x i32> @func() { - ;CHECK: brasl - ;CHECK: lr {{\$[0-9]*, \$3}} - ;CHECK: brasl - %rv1 = call <4 x i32>* @getv4f32ptr() - %rv2 = call <4 x i32>* @getv4f32ptr() - %rv3 = load <4 x i32>* %rv1 - ret <4 x i32> %rv3 + ;CHECK: brasl + ; we need to have some instruction to move the result to safety. + ; which instruction (lr, stqd...) depends on the regalloc + ;CHECK: {{.*}} + ;CHECK: brasl + %rv1 = call <4 x i32>* @getv4f32ptr() + %rv2 = call <4 x i32>* @getv4f32ptr() + %rv3 = load <4 x i32>* %rv1 + ret <4 x i32> %rv3 } define <4 x float> @load_undef(){ From kalle.raiskila at nokia.com Mon Jun 21 10:11:51 2010 From: kalle.raiskila at nokia.com (Kalle Raiskila) Date: Mon, 21 Jun 2010 15:11:51 -0000 Subject: [llvm-commits] [llvm] r106421 - /llvm/trunk/test/CodeGen/CellSPU/shuffles.ll Message-ID: <20100621151151.2D3602A6C12C@llvm.org> Author: kraiskil Date: Mon Jun 21 10:11:51 2010 New Revision: 106421 URL: http://llvm.org/viewvc/llvm-project?rev=106421&view=rev Log: Add the check to the testcase of r106419. Modified: llvm/trunk/test/CodeGen/CellSPU/shuffles.ll Modified: llvm/trunk/test/CodeGen/CellSPU/shuffles.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/shuffles.ll?rev=106421&r1=106420&r2=106421&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/shuffles.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/shuffles.ll Mon Jun 21 10:11:51 2010 @@ -8,6 +8,9 @@ } define <4 x float> @splat(float %param1) { + ; CHECK: lqa + ; CHECK: shufb $3 + ; CHECK: bi %vec = insertelement <1 x float> undef, float %param1, i32 0 %val= shufflevector <1 x float> %vec, <1 x float> undef, <4 x i32> ret <4 x float> %val From gohman at apple.com Mon Jun 21 10:13:54 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 21 Jun 2010 15:13:54 -0000 Subject: [llvm-commits] [llvm] r106422 - in /llvm/trunk/lib/CodeGen/SelectionDAG: SelectionDAGBuilder.cpp SelectionDAGBuilder.h Message-ID: <20100621151354.F3D822A6C12C@llvm.org> Author: djg Date: Mon Jun 21 10:13:54 2010 New Revision: 106422 URL: http://llvm.org/viewvc/llvm-project?rev=106422&view=rev Log: More changes for non-top-down fast-isel. Split the code for materializing a value out of SelectionDAGBuilder::getValue into a helper function, so that it can be used in other ways. Add a new getNonRegisterValue function which uses it, for use in code which doesn't want a CopyFromReg even when FuncMap.ValueMap already has an entry for it. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=106422&r1=106421&r2=106422&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Mon Jun 21 10:13:54 2010 @@ -805,27 +805,59 @@ } } +/// getValue - Return an SDValue for the given Value. SDValue SelectionDAGBuilder::getValue(const Value *V) { + // If we already have an SDValue for this value, use it. It's important + // to do this first, so that we don't create a CopyFromReg if we already + // have a regular SDValue. SDValue &N = NodeMap[V]; if (N.getNode()) return N; + // If there's a virtual register allocated and initialized for this + // value, use it. + DenseMap::iterator It = FuncInfo.ValueMap.find(V); + if (It != FuncInfo.ValueMap.end()) { + unsigned InReg = It->second; + RegsForValue RFV(*DAG.getContext(), TLI, InReg, V->getType()); + SDValue Chain = DAG.getEntryNode(); + return N = RFV.getCopyFromRegs(DAG, FuncInfo, getCurDebugLoc(), Chain, NULL); + } + + // Otherwise create a new SDValue and remember it. + return N = getValueImpl(V); +} + +/// getNonRegisterValue - Return an SDValue for the given Value, but +/// don't look in FuncInfo.ValueMap for a virtual register. +SDValue SelectionDAGBuilder::getNonRegisterValue(const Value *V) { + // If we already have an SDValue for this value, use it. + SDValue &N = NodeMap[V]; + if (N.getNode()) return N; + + // Otherwise create a new SDValue and remember it. + return N = getValueImpl(V); +} + +/// getValueImpl - Helper function for getValue and getMaterializedValue. +/// Create an SDValue for the given value. +SDValue SelectionDAGBuilder::getValueImpl(const Value *V) { if (const Constant *C = dyn_cast(V)) { EVT VT = TLI.getValueType(V->getType(), true); if (const ConstantInt *CI = dyn_cast(C)) - return N = DAG.getConstant(*CI, VT); + return DAG.getConstant(*CI, VT); if (const GlobalValue *GV = dyn_cast(C)) - return N = DAG.getGlobalAddress(GV, VT); + return DAG.getGlobalAddress(GV, VT); if (isa(C)) - return N = DAG.getConstant(0, TLI.getPointerTy()); + return DAG.getConstant(0, TLI.getPointerTy()); if (const ConstantFP *CFP = dyn_cast(C)) - return N = DAG.getConstantFP(*CFP, VT); + return DAG.getConstantFP(*CFP, VT); if (isa(C) && !V->getType()->isAggregateType()) - return N = DAG.getUNDEF(VT); + return DAG.getUNDEF(VT); if (const ConstantExpr *CE = dyn_cast(C)) { visit(CE->getOpcode(), *CE); @@ -913,12 +945,18 @@ return DAG.getFrameIndex(SI->second, TLI.getPointerTy()); } - unsigned InReg = FuncInfo.ValueMap[V]; - assert(InReg && "Value not in map!"); + // If this is an instruction which fast-isel has deferred, select it now. + if (const Instruction *Inst = dyn_cast(V)) { + assert(Inst->isSafeToSpeculativelyExecute() && + "Instruction with side effects deferred!"); + visit(*Inst); + DenseMap::iterator NIt = NodeMap.find(Inst); + if (NIt != NodeMap.end() && NIt->second.getNode()) + return NIt->second; + } - RegsForValue RFV(*DAG.getContext(), TLI, InReg, V->getType()); - SDValue Chain = DAG.getEntryNode(); - return RFV.getCopyFromRegs(DAG, FuncInfo, getCurDebugLoc(), Chain, NULL); + llvm_unreachable("Can't get register for value!"); + return SDValue(); } /// Get the EVTs and ArgFlags collections that represent the legalized return @@ -5880,7 +5918,7 @@ void SelectionDAGBuilder::CopyValueToVirtualRegister(const Value *V, unsigned Reg) { - SDValue Op = getValue(V); + SDValue Op = getNonRegisterValue(V); assert((Op.getOpcode() != ISD::CopyFromReg || cast(Op.getOperand(1))->getReg() != Reg) && "Copy from a reg to the same reg!"); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h?rev=106422&r1=106421&r2=106422&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h Mon Jun 21 10:13:54 2010 @@ -346,6 +346,8 @@ void visit(unsigned Opcode, const User &I); SDValue getValue(const Value *V); + SDValue getNonRegisterValue(const Value *V); + SDValue getValueImpl(const Value *V); void setValue(const Value *V, SDValue NewN) { SDValue &N = NodeMap[V]; From criswell at cs.uiuc.edu Mon Jun 21 10:54:41 2010 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 21 Jun 2010 10:54:41 -0500 Subject: [llvm-commits] CVS: llvm-www/safecode/menagerie/attacks.html Message-ID: <201006211554.o5LFsfDi026587@maute.cs.uiuc.edu> Changes in directory llvm-www/safecode/menagerie: attacks.html updated: 1.5 -> 1.6 --- Log message: Added what I believe is the first paper on return-oriented programming. --- Diffs of the changes: (+15 -0) attacks.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) Index: llvm-www/safecode/menagerie/attacks.html diff -u llvm-www/safecode/menagerie/attacks.html:1.5 llvm-www/safecode/menagerie/attacks.html:1.6 --- llvm-www/safecode/menagerie/attacks.html:1.5 Fri Jun 18 11:26:36 2010 +++ llvm-www/safecode/menagerie/attacks.html Mon Jun 21 10:54:29 2010 @@ -96,6 +96,21 @@
  • + + + The Geometry of Innocent Flesh on the Bone: Return-into-libc without + Function Calls (on the x86) +
    + Hovav Shacham +
    + Proceedings of the Fourteenth ACM Conference on Computer and + Communications Security, October 2007. +
    +
  • + +
    + +
  • Dangling Pointer: Smashing the Pointer for Fun and Profit From criswell at cs.uiuc.edu Mon Jun 21 10:59:21 2010 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 21 Jun 2010 10:59:21 -0500 Subject: [llvm-commits] CVS: llvm-www/safecode/downloads.html Message-ID: <201006211559.o5LFxLAx026747@maute.cs.uiuc.edu> Changes in directory llvm-www/safecode: downloads.html updated: 1.7 -> 1.8 --- Log message: Added directions for getting the version of SAFECode that works with LLVM 2.7. --- Diffs of the changes: (+17 -3) downloads.html | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) Index: llvm-www/safecode/downloads.html diff -u llvm-www/safecode/downloads.html:1.7 llvm-www/safecode/downloads.html:1.8 --- llvm-www/safecode/downloads.html:1.7 Thu Jun 17 15:14:17 2010 +++ llvm-www/safecode/downloads.html Mon Jun 21 10:59:08 2010 @@ -4,7 +4,7 @@ - + @@ -48,8 +48,13 @@

    - SAFECode is available from the LLVM SVN repository. You can download - it using the following command: + SAFECode is available from the LLVM SVN repository. It currently works + with LLVM 2.6 and LLVM 2.7. +

    + +

    + To get the version of SAFECode that works with LLVM 2.6, use the + following SVN command to check out the release_26 branch:

    @@ -57,6 +62,15 @@

    + To get the version of SAFECode that works with LLVM 2.7, use the + following SVN command to check out mainline: +

    + +

    + svn co http://llvm.org/svn/llvm-project/safecode/trunk safecode +

    + +

    Directions on compiling and using SAFECode can be found in the safecode/docs directory in the source code. From gohman at apple.com Mon Jun 21 11:02:28 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 21 Jun 2010 16:02:28 -0000 Subject: [llvm-commits] [llvm] r106423 - in /llvm/trunk/lib/CodeGen/SelectionDAG: SelectionDAGBuilder.cpp SelectionDAGBuilder.h Message-ID: <20100621160228.49E002A6C12C@llvm.org> Author: djg Date: Mon Jun 21 11:02:28 2010 New Revision: 106423 URL: http://llvm.org/viewvc/llvm-project?rev=106423&view=rev Log: Revert r106422, which is breaking the non-fast-isel path. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=106423&r1=106422&r2=106423&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Mon Jun 21 11:02:28 2010 @@ -805,59 +805,27 @@ } } -/// getValue - Return an SDValue for the given Value. SDValue SelectionDAGBuilder::getValue(const Value *V) { - // If we already have an SDValue for this value, use it. It's important - // to do this first, so that we don't create a CopyFromReg if we already - // have a regular SDValue. SDValue &N = NodeMap[V]; if (N.getNode()) return N; - // If there's a virtual register allocated and initialized for this - // value, use it. - DenseMap::iterator It = FuncInfo.ValueMap.find(V); - if (It != FuncInfo.ValueMap.end()) { - unsigned InReg = It->second; - RegsForValue RFV(*DAG.getContext(), TLI, InReg, V->getType()); - SDValue Chain = DAG.getEntryNode(); - return N = RFV.getCopyFromRegs(DAG, FuncInfo, getCurDebugLoc(), Chain, NULL); - } - - // Otherwise create a new SDValue and remember it. - return N = getValueImpl(V); -} - -/// getNonRegisterValue - Return an SDValue for the given Value, but -/// don't look in FuncInfo.ValueMap for a virtual register. -SDValue SelectionDAGBuilder::getNonRegisterValue(const Value *V) { - // If we already have an SDValue for this value, use it. - SDValue &N = NodeMap[V]; - if (N.getNode()) return N; - - // Otherwise create a new SDValue and remember it. - return N = getValueImpl(V); -} - -/// getValueImpl - Helper function for getValue and getMaterializedValue. -/// Create an SDValue for the given value. -SDValue SelectionDAGBuilder::getValueImpl(const Value *V) { if (const Constant *C = dyn_cast(V)) { EVT VT = TLI.getValueType(V->getType(), true); if (const ConstantInt *CI = dyn_cast(C)) - return DAG.getConstant(*CI, VT); + return N = DAG.getConstant(*CI, VT); if (const GlobalValue *GV = dyn_cast(C)) - return DAG.getGlobalAddress(GV, VT); + return N = DAG.getGlobalAddress(GV, VT); if (isa(C)) - return DAG.getConstant(0, TLI.getPointerTy()); + return N = DAG.getConstant(0, TLI.getPointerTy()); if (const ConstantFP *CFP = dyn_cast(C)) - return DAG.getConstantFP(*CFP, VT); + return N = DAG.getConstantFP(*CFP, VT); if (isa(C) && !V->getType()->isAggregateType()) - return DAG.getUNDEF(VT); + return N = DAG.getUNDEF(VT); if (const ConstantExpr *CE = dyn_cast(C)) { visit(CE->getOpcode(), *CE); @@ -945,18 +913,12 @@ return DAG.getFrameIndex(SI->second, TLI.getPointerTy()); } - // If this is an instruction which fast-isel has deferred, select it now. - if (const Instruction *Inst = dyn_cast(V)) { - assert(Inst->isSafeToSpeculativelyExecute() && - "Instruction with side effects deferred!"); - visit(*Inst); - DenseMap::iterator NIt = NodeMap.find(Inst); - if (NIt != NodeMap.end() && NIt->second.getNode()) - return NIt->second; - } + unsigned InReg = FuncInfo.ValueMap[V]; + assert(InReg && "Value not in map!"); - llvm_unreachable("Can't get register for value!"); - return SDValue(); + RegsForValue RFV(*DAG.getContext(), TLI, InReg, V->getType()); + SDValue Chain = DAG.getEntryNode(); + return RFV.getCopyFromRegs(DAG, FuncInfo, getCurDebugLoc(), Chain, NULL); } /// Get the EVTs and ArgFlags collections that represent the legalized return @@ -5918,7 +5880,7 @@ void SelectionDAGBuilder::CopyValueToVirtualRegister(const Value *V, unsigned Reg) { - SDValue Op = getNonRegisterValue(V); + SDValue Op = getValue(V); assert((Op.getOpcode() != ISD::CopyFromReg || cast(Op.getOperand(1))->getReg() != Reg) && "Copy from a reg to the same reg!"); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h?rev=106423&r1=106422&r2=106423&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h Mon Jun 21 11:02:28 2010 @@ -346,8 +346,6 @@ void visit(unsigned Opcode, const User &I); SDValue getValue(const Value *V); - SDValue getNonRegisterValue(const Value *V); - SDValue getValueImpl(const Value *V); void setValue(const Value *V, SDValue NewN) { SDValue &N = NodeMap[V]; From stoklund at 2pi.dk Mon Jun 21 11:09:28 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 21 Jun 2010 16:09:28 -0000 Subject: [llvm-commits] [test-suite] r106425 - /test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/stepanov_abstraction.cpp Message-ID: <20100621160928.0B6AB2A6C12C@llvm.org> Author: stoklund Date: Mon Jun 21 11:09:27 2010 New Revision: 106425 URL: http://llvm.org/viewvc/llvm-project?rev=106425&view=rev Log: Speed up stepanov_abstraction benchmark for SMALL_PROBLEM_SIZE. This benchmark is really slow for -O0 tests. Modified: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/stepanov_abstraction.cpp Modified: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/stepanov_abstraction.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Adobe-C%2B%2B/stepanov_abstraction.cpp?rev=106425&r1=106424&r2=106425&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/stepanov_abstraction.cpp (original) +++ test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/stepanov_abstraction.cpp Mon Jun 21 11:09:27 2010 @@ -165,7 +165,11 @@ // this constant may need to be adjusted to give reasonable minimum times // For best results, times should be about 1.0 seconds for the minimum test run +#ifdef SMALL_PROBLEM_SIZE +int iterations = 10000; +#else int iterations = 200000; +#endif // 2000 items, or about 16k of data // this is intended to remain within the L2 cache of most common CPUs From stoklund at 2pi.dk Mon Jun 21 11:23:58 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 21 Jun 2010 16:23:58 -0000 Subject: [llvm-commits] [test-suite] r106426 - /test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/bison/mybison.reference_output Message-ID: <20100621162358.DC8D82A6C12C@llvm.org> Author: stoklund Date: Mon Jun 21 11:23:58 2010 New Revision: 106426 URL: http://llvm.org/viewvc/llvm-project?rev=106426&view=rev Log: Fix seemingly mangled reference output for bison test Modified: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/bison/mybison.reference_output Modified: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/bison/mybison.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/bison/mybison.reference_output?rev=106426&r1=106425&r2=106426&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/bison/mybison.reference_output (original) +++ test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/bison/mybison.reference_output Mon Jun 21 11:23:58 2010 @@ -1,48 +1,24 @@ -.endnum = -1; }; +#include -%% +#ifndef __STDC__ +#define const +#endif -void -yyerror(char* s) { - fprintf(stderr,"%s\n",s); - } -int -main() { - printf("1\t"); - yyparse(); - return 1; - } -#line 751 "parse.y.in" +#define YYFINAL 152 +#define YYFLAG -32768 +#define YYNTBASE 48 -void -yyerror(char* s) { - fprintf(stderr,"%s\n",s); - } - -int -main() { - printf("1\t"); - yyparse(); - return 1; - } - { }; +#define YYTRANSLATE(x) ((unsigned)(x) <= 291 ? yytranslate[x] : 84) -writestmt: WRITELN '(' exp ')' - { if (( ')' - { ID - { /* Same as above up until where 'stype' is */ - symTabEntry find; - if (lookup(mt; - -procdcls : procdcls procdcl | /* empty */ ; - -procdcl : PROC ID - { - symTabEntry find; - - if (lookup( 2, 2, 2, 2, 2, 2, 42, 41, 2, +static const char 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, 43, + 44, 38, 35, 45, 36, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 42, 41, 2, 29, 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, @@ -211,56 +187,56 @@ }; #define YYPURE 1 -%{ -#include -#include -#include "attr.h" -int yylex(); -void yyerror(char* s); -#include "symtab.h" -/* Global variables */ -scopeEntry current = NULL; /* Points to current scope */ -scopeEntry temp = NULL; /* Used temporarily for adding and/or - removing scopes */ -%} - -%union { int number; - tokentype token; - BaseType basetype; - typeinfo totaltype; - namelist names; - expnode exps; - explist elist;} - -%token PROG PERIOD PROC FUNC VAR ARRAY RANGE OF -%token INT CHAR BOOL WRITELN THEN ELSE IF DO WHILE -%token BEG END ASG NOT TRUE_TOK FALSE_TOK -%token ID CCONST ICONST - -%type stype -%type type exp constant lhs var -%type idlist vardcl vardcls parmlist parms parm variables -%type explist optexplist - -%start program -%nonassoc '=' NEQ LT LEQ GEQ GT -%left '+' '-' OR -%left '*' AND DIV -%right NOT - -%% -program : PROG ID - { enterblock(); } - ';' block PERIOD - {leaveblock();}; - -block : variables - { - /* Seen all the variables so declare them in the current scope */ - symTabEntry s; - namenode tmpnode; +#line 751 "parse.y.in" + + +void +yyerror(char* s) { + fprintf(stderr,"%s\n",s); + } - tmpnode = +int +main() { + printf("1\t"); + yyparse(); + return 1; + } +ck the parameters */ + int check; + check = checkparams( s -> formals , yyp->yyvsp[0].elist ); + } + } + ; + break;} +case 44: +#line 302 "parse.y.in" +{ /* only booleans */ + if (yyp->yyvsp[0].totaltype.basetype != BOOLTYPE) + printf("\n***Error: exp in if stmt must be boolean\n"); + ; + break;} +case 46: +#line 310 "parse.y.in" +{ /* only booleans */ + if (yyp->yyvsp[0].totaltype.basetype != BOOLTYPE) + printf("\n***Error: exp in while stmt must be boolean\n"); + ; + break;} +case 48: +#line 318 "parse.y.in" +{ /* Make sure the assignment types match */ + if (!(match(yyp->yyvsp[-1].totaltype,yyp->yyvsp[0].totaltype))) + printf("\n***Error: assignment types do not match\n"); + ; + break;} +case 49: +#line 324 "parse.y.in" +{ yyval.totaltype = yyp->yyvsp[-1].totaltype; ; + break;} +case 50: +#line 327 "parse.y.in" +{ yyval.elist.firstexp = NULL; /* No optexplist = NULL list */ + yyval.elist.lastexp = NULL; ; break;} case 51: #line 330 "parse.y.in" From sabre at nondot.org Mon Jun 21 11:46:37 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 21 Jun 2010 16:46:37 -0000 Subject: [llvm-commits] [llvm] r106427 - /llvm/trunk/include/llvm/Value.h Message-ID: <20100621164637.EAE8A2A6C12C@llvm.org> Author: lattner Date: Mon Jun 21 11:46:37 2010 New Revision: 106427 URL: http://llvm.org/viewvc/llvm-project?rev=106427&view=rev Log: make the Value constructor protected. Modified: llvm/trunk/include/llvm/Value.h Modified: llvm/trunk/include/llvm/Value.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=106427&r1=106426&r2=106427&view=diff ============================================================================== --- llvm/trunk/include/llvm/Value.h (original) +++ llvm/trunk/include/llvm/Value.h Mon Jun 21 11:46:37 2010 @@ -93,8 +93,8 @@ /// printing behavior. virtual void printCustom(raw_ostream &O) const; -public: Value(const Type *Ty, unsigned scid); +public: virtual ~Value(); /// dump - Support for debugging, callable in GDB: V->dump() From sabre at nondot.org Mon Jun 21 12:20:18 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 21 Jun 2010 17:20:18 -0000 Subject: [llvm-commits] [llvm] r106428 - /llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Message-ID: <20100621172018.8CE032A6C12E@llvm.org> Author: lattner Date: Mon Jun 21 12:20:18 2010 New Revision: 106428 URL: http://llvm.org/viewvc/llvm-project?rev=106428&view=rev Log: remove some dead variables reported by clang++ Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=106428&r1=106427&r2=106428&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Jun 21 12:20:18 2010 @@ -1803,8 +1803,6 @@ if (EltsFromV2 == 1 && monotonic) { // Compute mask and shuffle - MachineFunction &MF = DAG.getMachineFunction(); - MachineRegisterInfo &RegInfo = MF.getRegInfo(); EVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); // As SHUFFLE_MASK becomes a c?d instruction, feed it an address From stoklund at 2pi.dk Mon Jun 21 12:31:43 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 21 Jun 2010 17:31:43 -0000 Subject: [llvm-commits] [test-suite] r106429 - /test-suite/trunk/External/Nurbs/nurbs.reference_output Message-ID: <20100621173143.C1F762A6C12C@llvm.org> Author: stoklund Date: Mon Jun 21 12:31:43 2010 New Revision: 106429 URL: http://llvm.org/viewvc/llvm-project?rev=106429&view=rev Log: Add nurbs reference output Modified: test-suite/trunk/External/Nurbs/nurbs.reference_output Modified: test-suite/trunk/External/Nurbs/nurbs.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/Nurbs/nurbs.reference_output?rev=106429&r1=106428&r2=106429&view=diff ============================================================================== --- test-suite/trunk/External/Nurbs/nurbs.reference_output (original) +++ test-suite/trunk/External/Nurbs/nurbs.reference_output Mon Jun 21 12:31:43 2010 @@ -1,4 +1,146 @@ -/Users/ddunbar/llvm-test-suite/TimedExec.sh: line 28: /Volumes/Data/Users/ddunbar/llvm-test-suite/External/Nurbs/Output/nurbs.native: No such file or directory -/Users/ddunbar/llvm-test-suite/TimedExec.sh: line 28: exec: /Volumes/Data/Users/ddunbar/llvm-test-suite/External/Nurbs/Output/nurbs.native: cannot execute: No such file or directory -exit 126 -RunSafely.sh detected a failure with these command-line arguments: 500 0 /dev/null Output/nurbs.out-nat Output/nurbs.native /k all timed /t 500 /vsteps 192 /usteps 192 /vcp 20 /ucp 20 +Note: Profiling kernel "c" +Note: Initializing... +Note: Running... +Note: timing kernel +Note: Validating... +Note: Reporting... +Rprt: surface point count = 36864 +Rprt: cycles/surf point = 116508 +Rprt: max valid error = 0.010000 +Rprt: u steps = 192 +Rprt: v steps = 192 +Rprt: u cntrl pts = 20 +Rprt: v cntrl pts = 20 +Rprt: u knot count = 24 +Rprt: v knot count = 24 +Rprt: u degree = 3 +Rprt: v degree = 3 +Rprt: - +Rprt: kernel name = c +Rprt: src filename = +Rprt: exe name = +Rprt: cache state = not specified +Rprt: avg cycle/iteration = 0 +Rprt: min cycle/itertaion = -1 +Rprt: test iterations = 500 +Rprt: run type = timed +Note: Resetting... +Note: Done profiling "c" +---------------------------------------------------------------------------- +Note: Profiling kernel "SSE" +Note: Initializing... +Note: Running... +Note: timing kernel +Note: Validating... +Note: Reporting... +Rprt: surface point count = 36864 +Rprt: cycles/surf point = 116508 +Rprt: max valid error = 0.010000 +Rprt: u steps = 192 +Rprt: v steps = 192 +Rprt: u cntrl pts = 20 +Rprt: v cntrl pts = 20 +Rprt: u knot count = 24 +Rprt: v knot count = 24 +Rprt: u degree = 3 +Rprt: v degree = 3 +Rprt: - +Rprt: kernel name = SSE +Rprt: src filename = +Rprt: exe name = +Rprt: cache state = not specified +Rprt: avg cycle/iteration = 0 +Rprt: min cycle/itertaion = -1 +Rprt: test iterations = 500 +Rprt: run type = timed +Note: Resetting... +Note: Done profiling "SSE" +---------------------------------------------------------------------------- +Note: Profiling kernel "c_cubic" +Note: Initializing... +Note: Running... +Note: timing kernel +Note: Validating... +Note: Reporting... +Rprt: surface point count = 36864 +Rprt: cycles/surf point = 116508 +Rprt: max valid error = 0.010000 +Rprt: u steps = 192 +Rprt: v steps = 192 +Rprt: u cntrl pts = 20 +Rprt: v cntrl pts = 20 +Rprt: u knot count = 24 +Rprt: v knot count = 24 +Rprt: u degree = 3 +Rprt: v degree = 3 +Rprt: - +Rprt: kernel name = c_cubic +Rprt: src filename = +Rprt: exe name = +Rprt: cache state = not specified +Rprt: avg cycle/iteration = 0 +Rprt: min cycle/itertaion = -1 +Rprt: test iterations = 500 +Rprt: run type = timed +Note: Resetting... +Note: Done profiling "c_cubic" +---------------------------------------------------------------------------- +Note: Profiling kernel "SSE_cubic" +Note: Initializing... +Note: Running... +Note: timing kernel +Note: Validating... +Note: Reporting... +Rprt: surface point count = 36864 +Rprt: cycles/surf point = 116508 +Rprt: max valid error = 0.010000 +Rprt: u steps = 192 +Rprt: v steps = 192 +Rprt: u cntrl pts = 20 +Rprt: v cntrl pts = 20 +Rprt: u knot count = 24 +Rprt: v knot count = 24 +Rprt: u degree = 3 +Rprt: v degree = 3 +Rprt: - +Rprt: kernel name = SSE_cubic +Rprt: src filename = +Rprt: exe name = +Rprt: cache state = not specified +Rprt: avg cycle/iteration = 0 +Rprt: min cycle/itertaion = -1 +Rprt: test iterations = 500 +Rprt: run type = timed +Note: Resetting... +Note: Done profiling "SSE_cubic" +---------------------------------------------------------------------------- +Note: Profiling kernel "c_cubic_unrolled" +Note: Initializing... +Note: Running... +Note: timing kernel +Note: Validating... +Note: Reporting... +Rprt: surface point count = 36864 +Rprt: cycles/surf point = 116508 +Rprt: max valid error = 0.010000 +Rprt: u steps = 192 +Rprt: v steps = 192 +Rprt: u cntrl pts = 20 +Rprt: v cntrl pts = 20 +Rprt: u knot count = 24 +Rprt: v knot count = 24 +Rprt: u degree = 3 +Rprt: v degree = 3 +Rprt: - +Rprt: kernel name = c_cubic_unrolled +Rprt: src filename = +Rprt: exe name = +Rprt: cache state = not specified +Rprt: avg cycle/iteration = 0 +Rprt: min cycle/itertaion = -1 +Rprt: test iterations = 500 +Rprt: run type = timed +Note: Resetting... +Note: Done profiling "c_cubic_unrolled" +---------------------------------------------------------------------------- +exit 0 From dalej at apple.com Mon Jun 21 12:32:33 2010 From: dalej at apple.com (Dale Johannesen) Date: Mon, 21 Jun 2010 10:32:33 -0700 Subject: [llvm-commits] [llvm] r106299 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/call-tc.ll test/CodeGen/ARM/ifcvt6-tc.ll test/CodeGen/ARM/insn-sched1-tc.ll test/CodeGen/ARM/ldm-tc.ll test/CodeGen/Thumb2/thumb2-call-tc.ll test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll In-Reply-To: <9377C01A-D7ED-4EFC-B48B-8DCD7C621132@apple.com> References: <20100618190018.9B0C12A6C12C@llvm.org> <8474B36F-7A51-4680-9899-5418BA177E99@apple.com> <336E92AF-5556-45D3-BB56-971CEFCEF691@apple.com> <9377C01A-D7ED-4EFC-B48B-8DCD7C621132@apple.com> Message-ID: <4BA8D5DF-050A-42B0-BAFA-BB0FDDCD6024@apple.com> On Jun 20, 2010, at 11:12 PMPDT, Evan Cheng wrote: >> >>> A few more comments: >>> >>> Please add a test case of an immediate call to a local function: >>> >>> define void @f() { >>> ret void >>> } >>> >>> define void @t4() { >>> tail call void @f() >>> ret void >>> } >>> >>> On Darwin ARM, this will generate b.w. That's wrong. The .w suffix >>> is for Thumb mode. >> >> Anton was claiming that too, but I don't believe it. A8.2 says .w >> "has no effect" when targeting ARM, and the Darwin assembler duly >> ignores it, correctly IMO. > > Even if the Darwin assembler ignores it, it's still weird. The ".w" > suffix only makes sense in Thumb mode, can you fix it? I am not saying this is OK because the Darwin assembler ignores it, I am saying it is conformant with the spec. Did you look at A8.2? > Also, I suspect the llvm integrated assembler won't like it. Then it should be fixed. From evan.cheng at apple.com Mon Jun 21 12:45:00 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 21 Jun 2010 10:45:00 -0700 Subject: [llvm-commits] [llvm] r106299 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/call-tc.ll test/CodeGen/ARM/ifcvt6-tc.ll test/CodeGen/ARM/insn-sched1-tc.ll test/CodeGen/ARM/ldm-tc.ll test/CodeGen/Thumb2/thumb2-call-tc.ll test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll In-Reply-To: <4BA8D5DF-050A-42B0-BAFA-BB0FDDCD6024@apple.com> References: <20100618190018.9B0C12A6C12C@llvm.org> <8474B36F-7A51-4680-9899-5418BA177E99@apple.com> <336E92AF-5556-45D3-BB56-971CEFCEF691@apple.com> <9377C01A-D7ED-4EFC-B48B-8DCD7C621132@apple.com> <4BA8D5DF-050A-42B0-BAFA-BB0FDDCD6024@apple.com> Message-ID: <0008EB54-9469-428C-9E94-ACAB3AEEDD8B@apple.com> On Jun 21, 2010, at 10:32 AM, Dale Johannesen wrote: > > On Jun 20, 2010, at 11:12 PMPDT, Evan Cheng wrote: >>> >>>> A few more comments: >>>> >>>> Please add a test case of an immediate call to a local function: >>>> >>>> define void @f() { >>>> ret void >>>> } >>>> >>>> define void @t4() { >>>> tail call void @f() >>>> ret void >>>> } >>>> >>>> On Darwin ARM, this will generate b.w. That's wrong. The .w suffix is for Thumb mode. >>> >>> Anton was claiming that too, but I don't believe it. A8.2 says .w "has no effect" when targeting ARM, and the Darwin assembler duly ignores it, correctly IMO. >> >> Even if the Darwin assembler ignores it, it's still weird. The ".w" suffix only makes sense in Thumb mode, can you fix it? > > I am not saying this is OK because the Darwin assembler ignores it, I am saying it is conformant with the spec. Did you look at A8.2? I am saying regardless of what the spec allows, it's still inconsistent. llvm only uses .w and .n suffices for Thumb instructions. Consistency is good, no? Evan > >> Also, I suspect the llvm integrated assembler won't like it. > > Then it should be fixed. > From grosbach at apple.com Mon Jun 21 12:49:24 2010 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 21 Jun 2010 17:49:24 -0000 Subject: [llvm-commits] [llvm] r106430 - /llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <20100621174924.1895C2A6C12C@llvm.org> Author: grosbach Date: Mon Jun 21 12:49:23 2010 New Revision: 106430 URL: http://llvm.org/viewvc/llvm-project?rev=106430&view=rev Log: early exit for dbg_value instructions Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=106430&r1=106429&r2=106430&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Mon Jun 21 12:49:23 2010 @@ -492,6 +492,8 @@ unsigned MBBSize = 0; for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I) { + if (I->isDebugValue()) + continue; // Add instruction size to MBBSize. MBBSize += TII->GetInstSizeInBytes(I); From dalej at apple.com Mon Jun 21 12:51:41 2010 From: dalej at apple.com (Dale Johannesen) Date: Mon, 21 Jun 2010 10:51:41 -0700 Subject: [llvm-commits] [llvm] r106299 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/call-tc.ll test/CodeGen/ARM/ifcvt6-tc.ll test/CodeGen/ARM/insn-sched1-tc.ll test/CodeGen/ARM/ldm-tc.ll test/CodeGen/Thumb2/thumb2-call-tc.ll test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll In-Reply-To: <0008EB54-9469-428C-9E94-ACAB3AEEDD8B@apple.com> References: <20100618190018.9B0C12A6C12C@llvm.org> <8474B36F-7A51-4680-9899-5418BA177E99@apple.com> <336E92AF-5556-45D3-BB56-971CEFCEF691@apple.com> <9377C01A-D7ED-4EFC-B48B-8DCD7C621132@apple.com> <4BA8D5DF-050A-42B0-BAFA-BB0FDDCD6024@apple.com> <0008EB54-9469-428C-9E94-ACAB3AEEDD8B@apple.com> Message-ID: <3BECF313-044C-4620-9766-46C378462A6C@apple.com> On Jun 21, 2010, at 10:45 AMPDT, Evan Cheng wrote: >>>>> >>>>> On Darwin ARM, this will generate b.w. That's wrong. The .w >>>>> suffix is for Thumb mode. >>>> >>>> Anton was claiming that too, but I don't believe it. A8.2 >>>> says .w "has no effect" when targeting ARM, and the Darwin >>>> assembler duly ignores it, correctly IMO. >>> >>> Even if the Darwin assembler ignores it, it's still weird. The >>> ".w" suffix only makes sense in Thumb mode, can you fix it? >> >> I am not saying this is OK because the Darwin assembler ignores it, >> I am saying it is conformant with the spec. Did you look at A8.2? > > I am saying regardless of what the spec allows, it's still > inconsistent. llvm only uses .w and .n suffices for Thumb > instructions. Consistency is good, no? Allowing source that can be assembled in both ARM and Thumb modes is also good. So is having less bloat in the compiler. From evan.cheng at apple.com Mon Jun 21 13:00:33 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 21 Jun 2010 11:00:33 -0700 Subject: [llvm-commits] [llvm] r106299 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/call-tc.ll test/CodeGen/ARM/ifcvt6-tc.ll test/CodeGen/ARM/insn-sched1-tc.ll test/CodeGen/ARM/ldm-tc.ll test/CodeGen/Thumb2/thumb2-call-tc.ll test/CodeGen/Thumb2/thumb2-ifcvt1-tc.ll In-Reply-To: <3BECF313-044C-4620-9766-46C378462A6C@apple.com> References: <20100618190018.9B0C12A6C12C@llvm.org> <8474B36F-7A51-4680-9899-5418BA177E99@apple.com> <336E92AF-5556-45D3-BB56-971CEFCEF691@apple.com> <9377C01A-D7ED-4EFC-B48B-8DCD7C621132@apple.com> <4BA8D5DF-050A-42B0-BAFA-BB0FDDCD6024@apple.com> <0008EB54-9469-428C-9E94-ACAB3AEEDD8B@apple.com> <3BECF313-044C-4620-9766-46C378462A6C@apple.com> Message-ID: <72F79B29-4810-4B19-B43E-744C7B07AD91@apple.com> On Jun 21, 2010, at 10:51 AM, Dale Johannesen wrote: > > On Jun 21, 2010, at 10:45 AMPDT, Evan Cheng wrote: >>>>>> >>>>>> On Darwin ARM, this will generate b.w. That's wrong. The .w suffix is for Thumb mode. >>>>> >>>>> Anton was claiming that too, but I don't believe it. A8.2 says .w "has no effect" when targeting ARM, and the Darwin assembler duly ignores it, correctly IMO. >>>> >>>> Even if the Darwin assembler ignores it, it's still weird. The ".w" suffix only makes sense in Thumb mode, can you fix it? >>> >>> I am not saying this is OK because the Darwin assembler ignores it, I am saying it is conformant with the spec. Did you look at A8.2? >> >> I am saying regardless of what the spec allows, it's still inconsistent. llvm only uses .w and .n suffices for Thumb instructions. Consistency is good, no? > > Allowing source that can be assembled in both ARM and Thumb modes is also good. Huh? The generated assembly function is either in ARM or Thumb mode. > So is having less bloat in the compiler. It's one instruction. Clearly using .w suffix is already generating confusion among engineers. It's the only ARM instruction that uses any size suffix (which makes absolutely no sense since all ARM instructions are 32-bit). Please change it. Evan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100621/7576c078/attachment.html From echristo at apple.com Mon Jun 21 13:21:27 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 21 Jun 2010 18:21:27 -0000 Subject: [llvm-commits] [llvm] r106433 - in /llvm/trunk: lib/Target/X86/X86Instr64bit.td test/CodeGen/X86/x86-64-tls-1.ll Message-ID: <20100621182127.DE0632A6C12C@llvm.org> Author: echristo Date: Mon Jun 21 13:21:27 2010 New Revision: 106433 URL: http://llvm.org/viewvc/llvm-project?rev=106433&view=rev Log: Add some codegen patterns for x86_64-linux-gnu tls codegen matching. Based on a patch by Patrick Marlier! Added: llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=106433&r1=106432&r2=106433&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Mon Jun 21 13:21:27 2010 @@ -1891,6 +1891,8 @@ (MOV64ri tjumptable :$dst)>, Requires<[FarData]>; def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)), (MOV64ri tglobaladdr :$dst)>, Requires<[FarData]>; +def : Pat<(i64 (X86Wrapper tglobaltlsaddr :$dst)), + (MOV64ri tglobaltlsaddr :$dst)>, Requires<[FarData]>; def : Pat<(i64 (X86Wrapper texternalsym:$dst)), (MOV64ri texternalsym:$dst)>, Requires<[FarData]>; def : Pat<(i64 (X86Wrapper tblockaddress:$dst)), @@ -1905,6 +1907,8 @@ (MOV64ri64i32 tjumptable :$dst)>, Requires<[SmallCode]>; def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)), (MOV64ri64i32 tglobaladdr :$dst)>, Requires<[SmallCode]>; +def : Pat<(i64 (X86Wrapper tglobaltlsaddr :$dst)), + (MOV64ri64i32 tglobaltlsaddr :$dst)>, Requires<[SmallCode]>; def : Pat<(i64 (X86Wrapper texternalsym:$dst)), (MOV64ri64i32 texternalsym:$dst)>, Requires<[SmallCode]>; def : Pat<(i64 (X86Wrapper tblockaddress:$dst)), @@ -1919,6 +1923,8 @@ (MOV64ri32 tjumptable :$dst)>, Requires<[KernelCode]>; def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)), (MOV64ri32 tglobaladdr :$dst)>, Requires<[KernelCode]>; +def : Pat<(i64 (X86Wrapper tglobaltlsaddr :$dst)), + (MOV64ri32 tglobaltlsaddr :$dst)>, Requires<[KernelCode]>; def : Pat<(i64 (X86Wrapper texternalsym:$dst)), (MOV64ri32 texternalsym:$dst)>, Requires<[KernelCode]>; def : Pat<(i64 (X86Wrapper tblockaddress:$dst)), @@ -1936,6 +1942,9 @@ def : Pat<(store (i64 (X86Wrapper tglobaladdr:$src)), addr:$dst), (MOV64mi32 addr:$dst, tglobaladdr:$src)>, Requires<[NearData, IsStatic]>; +def : Pat<(store (i64 (X86Wrapper tglobaltlsaddr:$src)), addr:$dst), + (MOV64mi32 addr:$dst, tglobaltlsaddr:$src)>, + Requires<[NearData, IsStatic]>; def : Pat<(store (i64 (X86Wrapper texternalsym:$src)), addr:$dst), (MOV64mi32 addr:$dst, texternalsym:$src)>, Requires<[NearData, IsStatic]>; Added: llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll?rev=106433&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll (added) +++ llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll Mon Jun 21 13:21:27 2010 @@ -0,0 +1,6 @@ +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s + at tm_nest_level = internal thread_local global i32 0 +define i64 @z() nounwind { +; CHECK: movl $tm_nest_level at TPOFF, %ecx + ret i64 and (i64 ptrtoint (i32* @tm_nest_level to i64), i64 100) +} From dalej at apple.com Mon Jun 21 13:21:49 2010 From: dalej at apple.com (Dale Johannesen) Date: Mon, 21 Jun 2010 18:21:49 -0000 Subject: [llvm-commits] [llvm] r106434 - in /llvm/trunk: lib/Target/ARM/ARMInstrInfo.td lib/Target/ARM/ARMRegisterInfo.td test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll Message-ID: <20100621182149.CFB4E2A6C12C@llvm.org> Author: johannes Date: Mon Jun 21 13:21:49 2010 New Revision: 106434 URL: http://llvm.org/viewvc/llvm-project?rev=106434&view=rev Log: Fix PR 7433. Silly typo in non-Darwin ARM tail call handling, plus correct R9 handling in that mode. Added: llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll (with props) Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=106434&r1=106433&r2=106434&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Jun 21 13:21:49 2010 @@ -1072,7 +1072,7 @@ Pseudo, IIC_Br, "@TC_RETURN","\t$dst", []>, Requires<[IsNotDarwin]>; - def TCRETURNriND : AInoP<(outs), (ins tGPR:$dst, variable_ops), + def TCRETURNriND : AInoP<(outs), (ins tcGPR:$dst, variable_ops), Pseudo, IIC_Br, "@TC_RETURN","\t$dst", []>, Requires<[IsNotDarwin]>; @@ -1084,7 +1084,7 @@ IIC_Br, "b.w\t$dst @ TAILCALL", []>, Requires<[IsThumb, IsNotDarwin]>; - def TAILJMPrND : AXI<(outs), (ins tGPR:$dst, variable_ops), + def TAILJMPrND : AXI<(outs), (ins tcGPR:$dst, variable_ops), BrMiscFrm, IIC_Br, "bx\t$dst @ TAILCALL", []>, Requires<[IsNotDarwin]> { let Inst{7-4} = 0b0001; Modified: llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td?rev=106434&r1=106433&r2=106434&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td Mon Jun 21 13:21:49 2010 @@ -386,14 +386,9 @@ return ARM_GPR_NOR9_TC; else return ARM_GPR_R9_TC; - } else { - if (Subtarget.isR9Reserved()) - return ARM_GPR_NOR9_TC; - else if (Subtarget.isThumb()) - return ARM_GPR_R9_TC; - else - return ARM_GPR_R9_TC; - } + } else + // R9 is either callee-saved or reserved; can't use it. + return ARM_GPR_NOR9_TC; } tcGPRClass::iterator @@ -412,14 +407,9 @@ I = ARM_GPR_NOR9_TC + (sizeof(ARM_GPR_NOR9_TC)/sizeof(unsigned)); else I = ARM_GPR_R9_TC + (sizeof(ARM_GPR_R9_TC)/sizeof(unsigned)); - } else { - if (Subtarget.isR9Reserved()) - I = ARM_GPR_NOR9_TC + (sizeof(ARM_GPR_NOR9_TC)/sizeof(unsigned)); - else if (Subtarget.isThumb()) - I = ARM_GPR_R9_TC + (sizeof(ARM_GPR_R9_TC)/sizeof(unsigned)); - else - I = ARM_GPR_R9_TC + (sizeof(ARM_GPR_R9_TC)/sizeof(unsigned)); - } + } else + // R9 is either callee-saved or reserved; can't use it. + I = ARM_GPR_NOR9_TC + (sizeof(ARM_GPR_NOR9_TC)/sizeof(unsigned)); return I; } }]; Added: llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll?rev=106434&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll (added) +++ llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll Mon Jun 21 13:21:49 2010 @@ -0,0 +1,145 @@ +; RUN: llc < %s -march=arm -mtriple=armv4t-unknown-linux-gnueabi +; PR 7433 + +%0 = type { i8*, i8* } +%1 = type { i8*, i8*, i8* } +%"class.llvm::Record" = type { i32, %"class.std::basic_string", %"class.llvm::SMLoc", %"class.std::vector", %"class.std::vector", %"class.std::vector" } +%"class.llvm::RecordVal" = type { %"class.std::basic_string", %"struct.llvm::Init"*, i32, %"struct.llvm::Init"* } +%"class.llvm::SMLoc" = type { i8* } +%"class.llvm::StringInit" = type { [8 x i8], %"class.std::basic_string" } +%"class.std::basic_string" = type { %"class.llvm::SMLoc" } +%"class.std::vector" = type { [12 x i8] } +%"struct.llvm::Init" = type { i32 (...)** } + + at _ZTIN4llvm5RecTyE = external constant %0 ; <%0*> [#uses=1] + at _ZTIN4llvm4InitE = external constant %0 ; <%0*> [#uses=1] + at _ZTIN4llvm11RecordRecTyE = external constant %1 ; <%1*> [#uses=1] + at .str8 = external constant [47 x i8] ; <[47 x i8]*> [#uses=1] + at _ZTIN4llvm9UnsetInitE = external constant %1 ; <%1*> [#uses=1] + at .str51 = external constant [45 x i8] ; <[45 x i8]*> [#uses=1] + at __PRETTY_FUNCTION__._ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs = external constant [116 x i8] ; <[116 x i8]*> [#uses=1] + + at _ZN4llvm9RecordValC1ERKSsPNS_5RecTyEj = alias void (%"class.llvm::RecordVal"*, %"class.std::basic_string"*, %"struct.llvm::Init"*, i32)* @_ZN4llvm9RecordValC2ERKSsPNS_5RecTyEj ; [#uses=0] + +declare i8* @__dynamic_cast(i8*, i8*, i8*, i32) + +declare void @__assert_fail(i8*, i8*, i32, i8*) noreturn + +declare void @_ZN4llvm9RecordValC2ERKSsPNS_5RecTyEj(%"class.llvm::RecordVal"*, %"class.std::basic_string"*, %"struct.llvm::Init"*, i32) align 2 + +define %"struct.llvm::Init"* @_ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs(%"class.llvm::StringInit"* %this, %"class.llvm::Record"* %R, %"class.llvm::RecordVal"* %RV, %"class.std::basic_string"* %FieldName) align 2 { +;CHECK: ldmia sp!, {r4, r5, r6, r7, r8, lr} +;CHECK: bx r12 @ TAILCALL +entry: + %.loc = alloca i32 ; [#uses=2] + %tmp.i = getelementptr inbounds %"class.llvm::StringInit"* %this, i32 0, i32 0, i32 4 ; [#uses=1] + %0 = bitcast i8* %tmp.i to %"struct.llvm::Init"** ; <%"struct.llvm::Init"**> [#uses=1] + %tmp2.i = load %"struct.llvm::Init"** %0 ; <%"struct.llvm::Init"*> [#uses=2] + %1 = icmp eq %"struct.llvm::Init"* %tmp2.i, null ; [#uses=1] + br i1 %1, label %entry.return_crit_edge, label %tmpbb + +entry.return_crit_edge: ; preds = %entry + br label %return + +tmpbb: ; preds = %entry + %2 = bitcast %"struct.llvm::Init"* %tmp2.i to i8* ; [#uses=1] + %3 = tail call i8* @__dynamic_cast(i8* %2, i8* bitcast (%0* @_ZTIN4llvm5RecTyE to i8*), i8* bitcast (%1* @_ZTIN4llvm11RecordRecTyE to i8*), i32 -1) ; [#uses=1] + %phitmp = icmp eq i8* %3, null ; [#uses=1] + br i1 %phitmp, label %.return_crit_edge, label %if.then + +.return_crit_edge: ; preds = %tmpbb + br label %return + +if.then: ; preds = %tmpbb + %tmp2.i.i.i.i = getelementptr inbounds %"class.llvm::StringInit"* %this, i32 0, i32 1, i32 0, i32 0 ; [#uses=1] + %tmp3.i.i.i.i = load i8** %tmp2.i.i.i.i ; [#uses=2] + %arrayidx.i.i.i.i = getelementptr inbounds i8* %tmp3.i.i.i.i, i32 -12 ; [#uses=1] + %tmp.i.i.i = bitcast i8* %arrayidx.i.i.i.i to i32* ; [#uses=1] + %tmp2.i.i.i = load i32* %tmp.i.i.i ; [#uses=1] + %tmp.i5 = getelementptr inbounds %"class.llvm::Record"* %R, i32 0, i32 4 ; <%"class.std::vector"*> [#uses=1] + %tmp2.i.i = getelementptr inbounds %"class.llvm::Record"* %R, i32 0, i32 4, i32 0, i32 4 ; [#uses=1] + %4 = bitcast i8* %tmp2.i.i to %"class.llvm::RecordVal"** ; <%"class.llvm::RecordVal"**> [#uses=1] + %tmp3.i.i6 = load %"class.llvm::RecordVal"** %4 ; <%"class.llvm::RecordVal"*> [#uses=1] + %tmp5.i.i = bitcast %"class.std::vector"* %tmp.i5 to %"class.llvm::RecordVal"** ; <%"class.llvm::RecordVal"**> [#uses=1] + %tmp6.i.i = load %"class.llvm::RecordVal"** %tmp5.i.i ; <%"class.llvm::RecordVal"*> [#uses=5] + %sub.ptr.lhs.cast.i.i = ptrtoint %"class.llvm::RecordVal"* %tmp3.i.i6 to i32 ; [#uses=1] + %sub.ptr.rhs.cast.i.i = ptrtoint %"class.llvm::RecordVal"* %tmp6.i.i to i32 ; [#uses=1] + %sub.ptr.sub.i.i = sub i32 %sub.ptr.lhs.cast.i.i, %sub.ptr.rhs.cast.i.i ; [#uses=1] + %sub.ptr.div.i.i = ashr i32 %sub.ptr.sub.i.i, 4 ; [#uses=1] + br label %codeRepl + +codeRepl: ; preds = %if.then + %targetBlock = call i1 @_ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs_for.cond.i(i32 %sub.ptr.div.i.i, %"class.llvm::RecordVal"* %tmp6.i.i, i32 %tmp2.i.i.i, i8* %tmp3.i.i.i.i, i32* %.loc) ; [#uses=1] + %.reload = load i32* %.loc ; [#uses=3] + br i1 %targetBlock, label %for.cond.i.return_crit_edge, label %_ZN4llvm6Record8getValueENS_9StringRefE.exit + +for.cond.i.return_crit_edge: ; preds = %codeRepl + br label %return + +_ZN4llvm6Record8getValueENS_9StringRefE.exit: ; preds = %codeRepl + %add.ptr.i.i = getelementptr inbounds %"class.llvm::RecordVal"* %tmp6.i.i, i32 %.reload ; <%"class.llvm::RecordVal"*> [#uses=2] + %tobool5 = icmp eq %"class.llvm::RecordVal"* %add.ptr.i.i, null ; [#uses=1] + br i1 %tobool5, label %_ZN4llvm6Record8getValueENS_9StringRefE.exit.return_crit_edge, label %if.then6 + +_ZN4llvm6Record8getValueENS_9StringRefE.exit.return_crit_edge: ; preds = %_ZN4llvm6Record8getValueENS_9StringRefE.exit + br label %return + +if.then6: ; preds = %_ZN4llvm6Record8getValueENS_9StringRefE.exit + %cmp = icmp eq %"class.llvm::RecordVal"* %add.ptr.i.i, %RV ; [#uses=1] + br i1 %cmp, label %if.then6.if.end_crit_edge, label %land.lhs.true + +if.then6.if.end_crit_edge: ; preds = %if.then6 + br label %if.end + +land.lhs.true: ; preds = %if.then6 + %tobool10 = icmp eq %"class.llvm::RecordVal"* %RV, null ; [#uses=1] + br i1 %tobool10, label %lor.lhs.false, label %land.lhs.true.return_crit_edge + +land.lhs.true.return_crit_edge: ; preds = %land.lhs.true + br label %return + +lor.lhs.false: ; preds = %land.lhs.true + %tmp.i3 = getelementptr inbounds %"class.llvm::RecordVal"* %tmp6.i.i, i32 %.reload, i32 3 ; <%"struct.llvm::Init"**> [#uses=1] + %tmp2.i4 = load %"struct.llvm::Init"** %tmp.i3 ; <%"struct.llvm::Init"*> [#uses=2] + %5 = icmp eq %"struct.llvm::Init"* %tmp2.i4, null ; [#uses=1] + br i1 %5, label %lor.lhs.false.if.end_crit_edge, label %tmpbb1 + +lor.lhs.false.if.end_crit_edge: ; preds = %lor.lhs.false + br label %if.end + +tmpbb1: ; preds = %lor.lhs.false + %6 = bitcast %"struct.llvm::Init"* %tmp2.i4 to i8* ; [#uses=1] + %7 = tail call i8* @__dynamic_cast(i8* %6, i8* bitcast (%0* @_ZTIN4llvm4InitE to i8*), i8* bitcast (%1* @_ZTIN4llvm9UnsetInitE to i8*), i32 -1) ; [#uses=1] + %phitmp32 = icmp eq i8* %7, null ; [#uses=1] + br i1 %phitmp32, label %.if.end_crit_edge, label %.return_crit_edge1 + +.return_crit_edge1: ; preds = %tmpbb1 + br label %return + +.if.end_crit_edge: ; preds = %tmpbb1 + br label %if.end + +if.end: ; preds = %.if.end_crit_edge, %lor.lhs.false.if.end_crit_edge, %if.then6.if.end_crit_edge + %tmp.i1 = getelementptr inbounds %"class.llvm::RecordVal"* %tmp6.i.i, i32 %.reload, i32 3 ; <%"struct.llvm::Init"**> [#uses=1] + %tmp2.i2 = load %"struct.llvm::Init"** %tmp.i1 ; <%"struct.llvm::Init"*> [#uses=3] + %8 = bitcast %"class.llvm::StringInit"* %this to %"struct.llvm::Init"* ; <%"struct.llvm::Init"*> [#uses=1] + %cmp19 = icmp eq %"struct.llvm::Init"* %tmp2.i2, %8 ; [#uses=1] + br i1 %cmp19, label %cond.false, label %cond.end + +cond.false: ; preds = %if.end + tail call void @__assert_fail(i8* getelementptr inbounds ([45 x i8]* @.str51, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8]* @.str8, i32 0, i32 0), i32 1141, i8* getelementptr inbounds ([116 x i8]* @__PRETTY_FUNCTION__._ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs, i32 0, i32 0)) noreturn + unreachable + +cond.end: ; preds = %if.end + %9 = bitcast %"struct.llvm::Init"* %tmp2.i2 to %"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)*** ; <%"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)***> [#uses=1] + %10 = load %"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)*** %9 ; <%"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)**> [#uses=1] + %vfn = getelementptr inbounds %"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)** %10, i32 8 ; <%"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)**> [#uses=1] + %11 = load %"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)** %vfn ; <%"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)*> [#uses=1] + %call25 = tail call %"struct.llvm::Init"* %11(%"struct.llvm::Init"* %tmp2.i2, %"class.llvm::Record"* %R, %"class.llvm::RecordVal"* %RV, %"class.std::basic_string"* %FieldName) ; <%"struct.llvm::Init"*> [#uses=1] + ret %"struct.llvm::Init"* %call25 + +return: ; preds = %.return_crit_edge1, %land.lhs.true.return_crit_edge, %_ZN4llvm6Record8getValueENS_9StringRefE.exit.return_crit_edge, %for.cond.i.return_crit_edge, %.return_crit_edge, %entry.return_crit_edge + ret %"struct.llvm::Init"* null +} + +declare i1 @_ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs_for.cond.i(i32, %"class.llvm::RecordVal"*, i32, i8*, i32*) Propchange: llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll ------------------------------------------------------------------------------ svn:executable = * From stoklund at 2pi.dk Mon Jun 21 13:22:05 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 21 Jun 2010 18:22:05 -0000 Subject: [llvm-commits] [test-suite] r106435 - /test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.c Message-ID: <20100621182205.8B5372A6C12D@llvm.org> Author: stoklund Date: Mon Jun 21 13:22:05 2010 New Revision: 106435 URL: http://llvm.org/viewvc/llvm-project?rev=106435&view=rev Log: Don't print excluded .svn directories in the output Modified: test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.c Modified: test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.c?rev=106435&r1=106434&r2=106435&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.c (original) +++ test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.c Mon Jun 21 13:22:05 2010 @@ -979,8 +979,10 @@ argument = opt_firstarg(opt, "exclude", &optnode); while(argument) { if(match_regex(filename, argument) == 1) { +#if 0 if(!printinfected) logg("%s: Excluded\n", filename); +#endif return 0; } argument = opt_nextarg(&optnode, "exclude"); From bruno.cardoso at gmail.com Mon Jun 21 13:22:54 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Mon, 21 Jun 2010 18:22:54 -0000 Subject: [llvm-commits] [llvm] r106436 - /llvm/trunk/lib/Target/X86/X86InstrSSE.td Message-ID: <20100621182254.A89C72A6C12C@llvm.org> Author: bruno Date: Mon Jun 21 13:22:54 2010 New Revision: 106436 URL: http://llvm.org/viewvc/llvm-project?rev=106436&view=rev Log: Add AVX regular (non-aliased ones) and,or,xor,andn packed instructions. They are already tested in the MC framework, no test needed Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106436&r1=106435&r2=106436&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon Jun 21 13:22:54 2010 @@ -1056,6 +1056,30 @@ multiclass sse12_fp_packed_logical opc, string OpcodeStr, SDNode OpNode, int HasPat = 0, list> Pattern = []> { + let isAsmParserOnly = 1 in { + defm V#NAME#PS : sse12_fp_packed_logical_rm, + VEX_4V; + + defm V#NAME#PD : sse12_fp_packed_logical_rm, + OpSize, VEX_4V; + } let Constraints = "$src1 = $dst" in { defm PS : sse12_fp_packed_logical_rm Author: bruno Date: Mon Jun 21 13:36:04 2010 New Revision: 106437 URL: http://llvm.org/viewvc/llvm-project?rev=106437&view=rev Log: Move part of SSE 1 & 2 compare, shuffle and unpack instructions closely. Preparing them for refactoring and to the addition of their AVX forms Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106437&r1=106436&r2=106437&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon Jun 21 13:36:04 2010 @@ -1135,6 +1135,16 @@ "cmp${cc}ps\t{$src, $dst|$dst, $src}", [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1, (memop addr:$src), imm:$cc))]>; + def CMPPDrri : PDIi8<0xC2, MRMSrcReg, + (outs VR128:$dst), (ins VR128:$src1, VR128:$src, SSECC:$cc), + "cmp${cc}pd\t{$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, + VR128:$src, imm:$cc))]>; + def CMPPDrmi : PDIi8<0xC2, MRMSrcMem, + (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, SSECC:$cc), + "cmp${cc}pd\t{$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, + (memop addr:$src), imm:$cc))]>; // Accept explicit immediate argument form instead of comparison code. let isAsmParserOnly = 1 in { @@ -1144,12 +1154,22 @@ def CMPPSrmi_alt : PSIi8<0xC2, MRMSrcMem, (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, i8imm:$src2), "cmpps\t{$src2, $src, $dst|$dst, $src, $src}", []>; + def CMPPDrri_alt : PDIi8<0xC2, MRMSrcReg, + (outs VR128:$dst), (ins VR128:$src1, VR128:$src, i8imm:$src2), + "cmppd\t{$src2, $src, $dst|$dst, $src, $src2}", []>; + def CMPPDrmi_alt : PDIi8<0xC2, MRMSrcMem, + (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, i8imm:$src2), + "cmppd\t{$src2, $src, $dst|$dst, $src, $src2}", []>; } } def : Pat<(v4i32 (X86cmpps (v4f32 VR128:$src1), VR128:$src2, imm:$cc)), (CMPPSrri (v4f32 VR128:$src1), (v4f32 VR128:$src2), imm:$cc)>; def : Pat<(v4i32 (X86cmpps (v4f32 VR128:$src1), (memop addr:$src2), imm:$cc)), (CMPPSrmi (v4f32 VR128:$src1), addr:$src2, imm:$cc)>; +def : Pat<(v2i64 (X86cmppd (v2f64 VR128:$src1), VR128:$src2, imm:$cc)), + (CMPPDrri VR128:$src1, VR128:$src2, imm:$cc)>; +def : Pat<(v2i64 (X86cmppd (v2f64 VR128:$src1), (memop addr:$src2), imm:$cc)), + (CMPPDrmi VR128:$src1, addr:$src2, imm:$cc)>; // Shuffle and unpack instructions let Constraints = "$src1 = $dst" in { @@ -1167,6 +1187,18 @@ [(set VR128:$dst, (v4f32 (shufp:$src3 VR128:$src1, (memopv4f32 addr:$src2))))]>; + def SHUFPDrri : PDIi8<0xC6, MRMSrcReg, + (outs VR128:$dst), (ins VR128:$src1, VR128:$src2, i8imm:$src3), + "shufpd\t{$src3, $src2, $dst|$dst, $src2, $src3}", + [(set VR128:$dst, + (v2f64 (shufp:$src3 VR128:$src1, VR128:$src2)))]>; + def SHUFPDrmi : PDIi8<0xC6, MRMSrcMem, + (outs VR128:$dst), (ins VR128:$src1, + f128mem:$src2, i8imm:$src3), + "shufpd\t{$src3, $src2, $dst|$dst, $src2, $src3}", + [(set VR128:$dst, + (v2f64 (shufp:$src3 + VR128:$src1, (memopv2f64 addr:$src2))))]>; let AddedComplexity = 10 in { def UNPCKHPSrr : PSI<0x15, MRMSrcReg, @@ -1191,6 +1223,28 @@ "unpcklps\t{$src2, $dst|$dst, $src2}", [(set VR128:$dst, (unpckl VR128:$src1, (memopv4f32 addr:$src2)))]>; + def UNPCKHPDrr : PDI<0x15, MRMSrcReg, + (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), + "unpckhpd\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2f64 (unpckh VR128:$src1, VR128:$src2)))]>; + def UNPCKHPDrm : PDI<0x15, MRMSrcMem, + (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), + "unpckhpd\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2f64 (unpckh VR128:$src1, + (memopv2f64 addr:$src2))))]>; + + def UNPCKLPDrr : PDI<0x14, MRMSrcReg, + (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), + "unpcklpd\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2f64 (unpckl VR128:$src1, VR128:$src2)))]>; + def UNPCKLPDrm : PDI<0x14, MRMSrcMem, + (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), + "unpcklpd\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (unpckl VR128:$src1, (memopv2f64 addr:$src2)))]>; } // AddedComplexity } // Constraints = "$src1 = $dst" @@ -1786,75 +1840,6 @@ // There is no f64 version of the reciprocal approximation instructions. -let Constraints = "$src1 = $dst" in { - def CMPPDrri : PDIi8<0xC2, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src, SSECC:$cc), - "cmp${cc}pd\t{$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, - VR128:$src, imm:$cc))]>; - def CMPPDrmi : PDIi8<0xC2, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, SSECC:$cc), - "cmp${cc}pd\t{$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, - (memop addr:$src), imm:$cc))]>; - - // Accept explicit immediate argument form instead of comparison code. -let isAsmParserOnly = 1 in { - def CMPPDrri_alt : PDIi8<0xC2, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src, i8imm:$src2), - "cmppd\t{$src2, $src, $dst|$dst, $src, $src2}", []>; - def CMPPDrmi_alt : PDIi8<0xC2, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, i8imm:$src2), - "cmppd\t{$src2, $src, $dst|$dst, $src, $src2}", []>; -} -} -def : Pat<(v2i64 (X86cmppd (v2f64 VR128:$src1), VR128:$src2, imm:$cc)), - (CMPPDrri VR128:$src1, VR128:$src2, imm:$cc)>; -def : Pat<(v2i64 (X86cmppd (v2f64 VR128:$src1), (memop addr:$src2), imm:$cc)), - (CMPPDrmi VR128:$src1, addr:$src2, imm:$cc)>; - -// Shuffle and unpack instructions -let Constraints = "$src1 = $dst" in { - def SHUFPDrri : PDIi8<0xC6, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src2, i8imm:$src3), - "shufpd\t{$src3, $src2, $dst|$dst, $src2, $src3}", - [(set VR128:$dst, - (v2f64 (shufp:$src3 VR128:$src1, VR128:$src2)))]>; - def SHUFPDrmi : PDIi8<0xC6, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, - f128mem:$src2, i8imm:$src3), - "shufpd\t{$src3, $src2, $dst|$dst, $src2, $src3}", - [(set VR128:$dst, - (v2f64 (shufp:$src3 - VR128:$src1, (memopv2f64 addr:$src2))))]>; - - let AddedComplexity = 10 in { - def UNPCKHPDrr : PDI<0x15, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), - "unpckhpd\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2f64 (unpckh VR128:$src1, VR128:$src2)))]>; - def UNPCKHPDrm : PDI<0x15, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), - "unpckhpd\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2f64 (unpckh VR128:$src1, - (memopv2f64 addr:$src2))))]>; - - def UNPCKLPDrr : PDI<0x14, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), - "unpcklpd\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2f64 (unpckl VR128:$src1, VR128:$src2)))]>; - def UNPCKLPDrm : PDI<0x14, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), - "unpcklpd\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (unpckl VR128:$src1, (memopv2f64 addr:$src2)))]>; - } // AddedComplexity -} // Constraints = "$src1 = $dst" - - //===---------------------------------------------------------------------===// // SSE integer instructions let ExeDomain = SSEPackedInt in { From dpatel at apple.com Mon Jun 21 13:36:58 2010 From: dpatel at apple.com (Devang Patel) Date: Mon, 21 Jun 2010 18:36:58 -0000 Subject: [llvm-commits] [llvm] r106438 - /llvm/trunk/lib/Analysis/DebugInfo.cpp Message-ID: <20100621183658.7E63C2A6C12D@llvm.org> Author: dpatel Date: Mon Jun 21 13:36:58 2010 New Revision: 106438 URL: http://llvm.org/viewvc/llvm-project?rev=106438&view=rev Log: Do not directly use function names to construct new name for named metadata. "llvm.dbg.lv.~A" is not a valid name. Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=106438&r1=106437&r2=106438&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DebugInfo.cpp (original) +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Mon Jun 21 13:36:58 2010 @@ -1056,7 +1056,14 @@ // to preserve variable info in such situation then stash it in a // named mdnode. DISubprogram Fn(getDISubprogram(Context)); - const Twine FnLVName = Twine("llvm.dbg.lv.", Fn.getName()); + StringRef FName = "fn"; + if (Fn.getFunction()) + FName = Fn.getFunction()->getName(); + const Twine FnLVName = Twine("llvm.dbg.lv.", FName); + char One = '\1'; + if (FName.startswith(StringRef(&One, 1))) + FName = FName.substr(1); + NamedMDNode *FnLocals = M.getNamedMetadataUsingTwine(FnLVName); if (!FnLocals) FnLocals = NamedMDNode::Create(VMContext, FnLVName, NULL, 0, &M); From dpatel at apple.com Mon Jun 21 13:37:23 2010 From: dpatel at apple.com (Devang Patel) Date: Mon, 21 Jun 2010 18:37:23 -0000 Subject: [llvm-commits] [llvm] r106439 - /llvm/trunk/test/FrontendC++/2010-06-21-LocalVarDbg.cpp Message-ID: <20100621183723.EB1262A6C12D@llvm.org> Author: dpatel Date: Mon Jun 21 13:37:23 2010 New Revision: 106439 URL: http://llvm.org/viewvc/llvm-project?rev=106439&view=rev Log: test case for r106438. Added: llvm/trunk/test/FrontendC++/2010-06-21-LocalVarDbg.cpp Added: llvm/trunk/test/FrontendC++/2010-06-21-LocalVarDbg.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2010-06-21-LocalVarDbg.cpp?rev=106439&view=auto ============================================================================== --- llvm/trunk/test/FrontendC++/2010-06-21-LocalVarDbg.cpp (added) +++ llvm/trunk/test/FrontendC++/2010-06-21-LocalVarDbg.cpp Mon Jun 21 13:37:23 2010 @@ -0,0 +1,13 @@ +// RUN: %llvmgxx -g -Os -S %s -o - | llvm-as -disable-output +// Do not use function name to create named metadata used to hold +// local variable info. For example. llvm.dbg.lv.~A is an invalid name. +class A { +public: + ~A() { int i = 0; i++; } +}; + +int foo(int i) { + A a; + return 0; +} + From espindola at google.com Mon Jun 21 13:38:46 2010 From: espindola at google.com (Rafael Espindola) Date: Mon, 21 Jun 2010 14:38:46 -0400 Subject: [llvm-commits] [llvm] r106434 - in /llvm/trunk: lib/Target/ARM/ARMInstrInfo.td lib/Target/ARM/ARMRegisterInfo.td test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll In-Reply-To: <20100621182149.CFB4E2A6C12C@llvm.org> References: <20100621182149.CFB4E2A6C12C@llvm.org> Message-ID: Thanks! I don't think the test is ultra useful as is, since the code generator was not crashing, just producing invalid output and the test is not checking for it. On 21 June 2010 14:21, Dale Johannesen wrote: > Author: johannes > Date: Mon Jun 21 13:21:49 2010 > New Revision: 106434 > > URL: http://llvm.org/viewvc/llvm-project?rev=106434&view=rev > Log: > Fix PR 7433. ?Silly typo in non-Darwin ARM tail call > handling, plus correct R9 handling in that mode. > > > Added: > ? ?llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll ? (with props) > Modified: > ? ?llvm/trunk/lib/Target/ARM/ARMInstrInfo.td > ? ?llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td > > Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=106434&r1=106433&r2=106434&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) > +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Jun 21 13:21:49 2010 > @@ -1072,7 +1072,7 @@ > ? ? ? ? ? ? ? ? ? ? ? ?Pseudo, IIC_Br, > ? ? ? ? ? ? ? ? ? ? ? ?"@TC_RETURN","\t$dst", []>, Requires<[IsNotDarwin]>; > > - ? ?def TCRETURNriND : AInoP<(outs), (ins tGPR:$dst, variable_ops), > + ? ?def TCRETURNriND : AInoP<(outs), (ins tcGPR:$dst, variable_ops), > ? ? ? ? ? ? ? ? ? ? ? ?Pseudo, IIC_Br, > ? ? ? ? ? ? ? ? ? ? ? ?"@TC_RETURN","\t$dst", []>, Requires<[IsNotDarwin]>; > > @@ -1084,7 +1084,7 @@ > ? ? ? ? ? ? ? ? ? ?IIC_Br, "b.w\t$dst ?@ TAILCALL", > ? ? ? ? ? ? ? ? ? ?[]>, Requires<[IsThumb, IsNotDarwin]>; > > - ? ?def TAILJMPrND : AXI<(outs), (ins tGPR:$dst, variable_ops), > + ? ?def TAILJMPrND : AXI<(outs), (ins tcGPR:$dst, variable_ops), > ? ? ? ? ? ? ? ? ? ? ?BrMiscFrm, IIC_Br, "bx\t$dst ?@ TAILCALL", > ? ? ? ? ? ? ? ? ? ?[]>, Requires<[IsNotDarwin]> { > ? ? ? ? ? ? ? ? ? ?let Inst{7-4} ? = 0b0001; > > Modified: llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td?rev=106434&r1=106433&r2=106434&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td (original) > +++ llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td Mon Jun 21 13:21:49 2010 > @@ -386,14 +386,9 @@ > ? ? ? ? ? return ARM_GPR_NOR9_TC; > ? ? ? ? else > ? ? ? ? ? return ARM_GPR_R9_TC; > - ? ? ?} else { > - ? ? ? ?if (Subtarget.isR9Reserved()) > - ? ? ? ? ?return ARM_GPR_NOR9_TC; > - ? ? ? ?else if (Subtarget.isThumb()) > - ? ? ? ? ?return ARM_GPR_R9_TC; > - ? ? ? ?else > - ? ? ? ? ?return ARM_GPR_R9_TC; > - ? ? ?} > + ? ? ?} else > + ? ? ? ?// R9 is either callee-saved or reserved; can't use it. > + ? ? ? ?return ARM_GPR_NOR9_TC; > ? ? } > > ? ? tcGPRClass::iterator > @@ -412,14 +407,9 @@ > ? ? ? ? ? I = ARM_GPR_NOR9_TC + (sizeof(ARM_GPR_NOR9_TC)/sizeof(unsigned)); > ? ? ? ? else > ? ? ? ? ? I = ARM_GPR_R9_TC + (sizeof(ARM_GPR_R9_TC)/sizeof(unsigned)); > - ? ? ?} else { > - ? ? ? ?if (Subtarget.isR9Reserved()) > - ? ? ? ? ?I = ARM_GPR_NOR9_TC + (sizeof(ARM_GPR_NOR9_TC)/sizeof(unsigned)); > - ? ? ? ?else if (Subtarget.isThumb()) > - ? ? ? ? ?I = ARM_GPR_R9_TC + (sizeof(ARM_GPR_R9_TC)/sizeof(unsigned)); > - ? ? ? ?else > - ? ? ? ? ?I = ARM_GPR_R9_TC + (sizeof(ARM_GPR_R9_TC)/sizeof(unsigned)); > - ? ? ?} > + ? ? ?} else > + ? ? ? ?// R9 is either callee-saved or reserved; can't use it. > + ? ? ? ?I = ARM_GPR_NOR9_TC + (sizeof(ARM_GPR_NOR9_TC)/sizeof(unsigned)); > ? ? ? return I; > ? ? } > ? }]; > > Added: llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll?rev=106434&view=auto > ============================================================================== > --- llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll (added) > +++ llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll Mon Jun 21 13:21:49 2010 > @@ -0,0 +1,145 @@ > +; RUN: llc < %s -march=arm -mtriple=armv4t-unknown-linux-gnueabi > +; PR 7433 > + > +%0 = type { i8*, i8* } > +%1 = type { i8*, i8*, i8* } > +%"class.llvm::Record" = type { i32, %"class.std::basic_string", %"class.llvm::SMLoc", %"class.std::vector", %"class.std::vector", %"class.std::vector" } > +%"class.llvm::RecordVal" = type { %"class.std::basic_string", %"struct.llvm::Init"*, i32, %"struct.llvm::Init"* } > +%"class.llvm::SMLoc" = type { i8* } > +%"class.llvm::StringInit" = type { [8 x i8], %"class.std::basic_string" } > +%"class.std::basic_string" = type { %"class.llvm::SMLoc" } > +%"class.std::vector" = type { [12 x i8] } > +%"struct.llvm::Init" = type { i32 (...)** } > + > + at _ZTIN4llvm5RecTyE = external constant %0 ? ? ? ? ; <%0*> [#uses=1] > + at _ZTIN4llvm4InitE = external constant %0 ? ? ? ? ?; <%0*> [#uses=1] > + at _ZTIN4llvm11RecordRecTyE = external constant %1 ?; <%1*> [#uses=1] > + at .str8 = external constant [47 x i8] ? ? ? ? ? ? ?; <[47 x i8]*> [#uses=1] > + at _ZTIN4llvm9UnsetInitE = external constant %1 ? ? ; <%1*> [#uses=1] > + at .str51 = external constant [45 x i8] ? ? ? ? ? ? ; <[45 x i8]*> [#uses=1] > + at __PRETTY_FUNCTION__._ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs = external constant [116 x i8] ; <[116 x i8]*> [#uses=1] > + > + at _ZN4llvm9RecordValC1ERKSsPNS_5RecTyEj = alias void (%"class.llvm::RecordVal"*, %"class.std::basic_string"*, %"struct.llvm::Init"*, i32)* @_ZN4llvm9RecordValC2ERKSsPNS_5RecTyEj ; [#uses=0] > + > +declare i8* @__dynamic_cast(i8*, i8*, i8*, i32) > + > +declare void @__assert_fail(i8*, i8*, i32, i8*) noreturn > + > +declare void @_ZN4llvm9RecordValC2ERKSsPNS_5RecTyEj(%"class.llvm::RecordVal"*, %"class.std::basic_string"*, %"struct.llvm::Init"*, i32) align 2 > + > +define %"struct.llvm::Init"* @_ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs(%"class.llvm::StringInit"* %this, %"class.llvm::Record"* %R, %"class.llvm::RecordVal"* %RV, %"class.std::basic_string"* %FieldName) align 2 { > +;CHECK: ?ldmia sp!, {r4, r5, r6, r7, r8, lr} > +;CHECK: ?bx ?r12 ?@ TAILCALL > +entry: > + ?%.loc = alloca i32 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; [#uses=2] > + ?%tmp.i = getelementptr inbounds %"class.llvm::StringInit"* %this, i32 0, i32 0, i32 4 ; [#uses=1] > + ?%0 = bitcast i8* %tmp.i to %"struct.llvm::Init"** ; <%"struct.llvm::Init"**> [#uses=1] > + ?%tmp2.i = load %"struct.llvm::Init"** %0 ? ? ? ?; <%"struct.llvm::Init"*> [#uses=2] > + ?%1 = icmp eq %"struct.llvm::Init"* %tmp2.i, null ; [#uses=1] > + ?br i1 %1, label %entry.return_crit_edge, label %tmpbb > + > +entry.return_crit_edge: ? ? ? ? ? ? ? ? ? ? ? ? ? ; preds = %entry > + ?br label %return > + > +tmpbb: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %entry > + ?%2 = bitcast %"struct.llvm::Init"* %tmp2.i to i8* ; [#uses=1] > + ?%3 = tail call i8* @__dynamic_cast(i8* %2, i8* bitcast (%0* @_ZTIN4llvm5RecTyE to i8*), i8* bitcast (%1* @_ZTIN4llvm11RecordRecTyE to i8*), i32 -1) ; [#uses=1] > + ?%phitmp = icmp eq i8* %3, null ? ? ? ? ? ? ? ? ?; [#uses=1] > + ?br i1 %phitmp, label %.return_crit_edge, label %if.then > + > +.return_crit_edge: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %tmpbb > + ?br label %return > + > +if.then: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %tmpbb > + ?%tmp2.i.i.i.i = getelementptr inbounds %"class.llvm::StringInit"* %this, i32 0, i32 1, i32 0, i32 0 ; [#uses=1] > + ?%tmp3.i.i.i.i = load i8** %tmp2.i.i.i.i ? ? ? ? ; [#uses=2] > + ?%arrayidx.i.i.i.i = getelementptr inbounds i8* %tmp3.i.i.i.i, i32 -12 ; [#uses=1] > + ?%tmp.i.i.i = bitcast i8* %arrayidx.i.i.i.i to i32* ; [#uses=1] > + ?%tmp2.i.i.i = load i32* %tmp.i.i.i ? ? ? ? ? ? ?; [#uses=1] > + ?%tmp.i5 = getelementptr inbounds %"class.llvm::Record"* %R, i32 0, i32 4 ; <%"class.std::vector"*> [#uses=1] > + ?%tmp2.i.i = getelementptr inbounds %"class.llvm::Record"* %R, i32 0, i32 4, i32 0, i32 4 ; [#uses=1] > + ?%4 = bitcast i8* %tmp2.i.i to %"class.llvm::RecordVal"** ; <%"class.llvm::RecordVal"**> [#uses=1] > + ?%tmp3.i.i6 = load %"class.llvm::RecordVal"** %4 ; <%"class.llvm::RecordVal"*> [#uses=1] > + ?%tmp5.i.i = bitcast %"class.std::vector"* %tmp.i5 to %"class.llvm::RecordVal"** ; <%"class.llvm::RecordVal"**> [#uses=1] > + ?%tmp6.i.i = load %"class.llvm::RecordVal"** %tmp5.i.i ; <%"class.llvm::RecordVal"*> [#uses=5] > + ?%sub.ptr.lhs.cast.i.i = ptrtoint %"class.llvm::RecordVal"* %tmp3.i.i6 to i32 ; [#uses=1] > + ?%sub.ptr.rhs.cast.i.i = ptrtoint %"class.llvm::RecordVal"* %tmp6.i.i to i32 ; [#uses=1] > + ?%sub.ptr.sub.i.i = sub i32 %sub.ptr.lhs.cast.i.i, %sub.ptr.rhs.cast.i.i ; [#uses=1] > + ?%sub.ptr.div.i.i = ashr i32 %sub.ptr.sub.i.i, 4 ; [#uses=1] > + ?br label %codeRepl > + > +codeRepl: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; preds = %if.then > + ?%targetBlock = call i1 @_ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs_for.cond.i(i32 %sub.ptr.div.i.i, %"class.llvm::RecordVal"* %tmp6.i.i, i32 %tmp2.i.i.i, i8* %tmp3.i.i.i.i, i32* %.loc) ; [#uses=1] > + ?%.reload = load i32* %.loc ? ? ? ? ? ? ? ? ? ? ?; [#uses=3] > + ?br i1 %targetBlock, label %for.cond.i.return_crit_edge, label %_ZN4llvm6Record8getValueENS_9StringRefE.exit > + > +for.cond.i.return_crit_edge: ? ? ? ? ? ? ? ? ? ? ?; preds = %codeRepl > + ?br label %return > + > +_ZN4llvm6Record8getValueENS_9StringRefE.exit: ? ? ; preds = %codeRepl > + ?%add.ptr.i.i = getelementptr inbounds %"class.llvm::RecordVal"* %tmp6.i.i, i32 %.reload ; <%"class.llvm::RecordVal"*> [#uses=2] > + ?%tobool5 = icmp eq %"class.llvm::RecordVal"* %add.ptr.i.i, null ; [#uses=1] > + ?br i1 %tobool5, label %_ZN4llvm6Record8getValueENS_9StringRefE.exit.return_crit_edge, label %if.then6 > + > +_ZN4llvm6Record8getValueENS_9StringRefE.exit.return_crit_edge: ; preds = %_ZN4llvm6Record8getValueENS_9StringRefE.exit > + ?br label %return > + > +if.then6: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; preds = %_ZN4llvm6Record8getValueENS_9StringRefE.exit > + ?%cmp = icmp eq %"class.llvm::RecordVal"* %add.ptr.i.i, %RV ; [#uses=1] > + ?br i1 %cmp, label %if.then6.if.end_crit_edge, label %land.lhs.true > + > +if.then6.if.end_crit_edge: ? ? ? ? ? ? ? ? ? ? ? ?; preds = %if.then6 > + ?br label %if.end > + > +land.lhs.true: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %if.then6 > + ?%tobool10 = icmp eq %"class.llvm::RecordVal"* %RV, null ; [#uses=1] > + ?br i1 %tobool10, label %lor.lhs.false, label %land.lhs.true.return_crit_edge > + > +land.lhs.true.return_crit_edge: ? ? ? ? ? ? ? ? ? ; preds = %land.lhs.true > + ?br label %return > + > +lor.lhs.false: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %land.lhs.true > + ?%tmp.i3 = getelementptr inbounds %"class.llvm::RecordVal"* %tmp6.i.i, i32 %.reload, i32 3 ; <%"struct.llvm::Init"**> [#uses=1] > + ?%tmp2.i4 = load %"struct.llvm::Init"** %tmp.i3 ?; <%"struct.llvm::Init"*> [#uses=2] > + ?%5 = icmp eq %"struct.llvm::Init"* %tmp2.i4, null ; [#uses=1] > + ?br i1 %5, label %lor.lhs.false.if.end_crit_edge, label %tmpbb1 > + > +lor.lhs.false.if.end_crit_edge: ? ? ? ? ? ? ? ? ? ; preds = %lor.lhs.false > + ?br label %if.end > + > +tmpbb1: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; preds = %lor.lhs.false > + ?%6 = bitcast %"struct.llvm::Init"* %tmp2.i4 to i8* ; [#uses=1] > + ?%7 = tail call i8* @__dynamic_cast(i8* %6, i8* bitcast (%0* @_ZTIN4llvm4InitE to i8*), i8* bitcast (%1* @_ZTIN4llvm9UnsetInitE to i8*), i32 -1) ; [#uses=1] > + ?%phitmp32 = icmp eq i8* %7, null ? ? ? ? ? ? ? ?; [#uses=1] > + ?br i1 %phitmp32, label %.if.end_crit_edge, label %.return_crit_edge1 > + > +.return_crit_edge1: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; preds = %tmpbb1 > + ?br label %return > + > +.if.end_crit_edge: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?; preds = %tmpbb1 > + ?br label %if.end > + > +if.end: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; preds = %.if.end_crit_edge, %lor.lhs.false.if.end_crit_edge, %if.then6.if.end_crit_edge > + ?%tmp.i1 = getelementptr inbounds %"class.llvm::RecordVal"* %tmp6.i.i, i32 %.reload, i32 3 ; <%"struct.llvm::Init"**> [#uses=1] > + ?%tmp2.i2 = load %"struct.llvm::Init"** %tmp.i1 ?; <%"struct.llvm::Init"*> [#uses=3] > + ?%8 = bitcast %"class.llvm::StringInit"* %this to %"struct.llvm::Init"* ; <%"struct.llvm::Init"*> [#uses=1] > + ?%cmp19 = icmp eq %"struct.llvm::Init"* %tmp2.i2, %8 ; [#uses=1] > + ?br i1 %cmp19, label %cond.false, label %cond.end > + > +cond.false: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; preds = %if.end > + ?tail call void @__assert_fail(i8* getelementptr inbounds ([45 x i8]* @.str51, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8]* @.str8, i32 0, i32 0), i32 1141, i8* getelementptr inbounds ([116 x i8]* @__PRETTY_FUNCTION__._ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs, i32 0, i32 0)) noreturn > + ?unreachable > + > +cond.end: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; preds = %if.end > + ?%9 = bitcast %"struct.llvm::Init"* %tmp2.i2 to %"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)*** ; <%"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)***> [#uses=1] > + ?%10 = load %"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)*** %9 ; <%"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)**> [#uses=1] > + ?%vfn = getelementptr inbounds %"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)** %10, i32 8 ; <%"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)**> [#uses=1] > + ?%11 = load %"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)** %vfn ; <%"struct.llvm::Init"* (%"struct.llvm::Init"*, %"class.llvm::Record"*, %"class.llvm::RecordVal"*, %"class.std::basic_string"*)*> [#uses=1] > + ?%call25 = tail call %"struct.llvm::Init"* %11(%"struct.llvm::Init"* %tmp2.i2, %"class.llvm::Record"* %R, %"class.llvm::RecordVal"* %RV, %"class.std::basic_string"* %FieldName) ; <%"struct.llvm::Init"*> [#uses=1] > + ?ret %"struct.llvm::Init"* %call25 > + > +return: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ; preds = %.return_crit_edge1, %land.lhs.true.return_crit_edge, %_ZN4llvm6Record8getValueENS_9StringRefE.exit.return_crit_edge, %for.cond.i.return_crit_edge, %.return_crit_edge, %entry.return_crit_edge > + ?ret %"struct.llvm::Init"* null > +} > + > +declare i1 @_ZNK4llvm7VarInit12getFieldInitERNS_6RecordEPKNS_9RecordValERKSs_for.cond.i(i32, %"class.llvm::RecordVal"*, i32, i8*, i32*) > > Propchange: llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll > ------------------------------------------------------------------------------ > ? ?svn:executable = * > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -- Rafael ?vila de Esp?ndola From fjahanian at apple.com Mon Jun 21 13:45:47 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Mon, 21 Jun 2010 18:45:47 -0000 Subject: [llvm-commits] [test-suite] r106442 - /test-suite/trunk/SingleSource/UnitTests/initp1.cpp Message-ID: <20100621184547.2DF5E2A6C12C@llvm.org> Author: fjahanian Date: Mon Jun 21 13:45:47 2010 New Revision: 106442 URL: http://llvm.org/viewvc/llvm-project?rev=106442&view=rev Log: Test case for clang's radar 8076356. Added: test-suite/trunk/SingleSource/UnitTests/initp1.cpp Added: test-suite/trunk/SingleSource/UnitTests/initp1.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/initp1.cpp?rev=106442&view=auto ============================================================================== --- test-suite/trunk/SingleSource/UnitTests/initp1.cpp (added) +++ test-suite/trunk/SingleSource/UnitTests/initp1.cpp Mon Jun 21 13:45:47 2010 @@ -0,0 +1,91 @@ +/* This doesn't work on solaris2 for reasons described in PR 6482. */ +/* { dg-do run { xfail *-*-solaris2* } } */ +#include + +class Two { +private: + int i, j, k; +public: + static int count; + Two( int ii, int jj ) { i = ii; j = jj; k = count++; }; + Two( void ) { i = 0; j = 0; k = count++; }; + int eye( void ) { return i; }; + int jay( void ) { return j; }; + int kay( void ) { return k; }; +}; + +extern Two foo; +extern Two goo; +extern Two coo[]; +extern Two koo[]; + +Two foo __attribute__((init_priority(1005))) ( 5, 6 ); + +Two goo __attribute__((init_priority(1007))) = Two( 7, 8 ); + +Two doo[ 3 ]; + +Two hoo[ 3 ] = { + Two( 11, 12 ), + Two( 13, 14 ), + Two( 15, 16 ) +}; + +Two coo[ 3 ] __attribute__((init_priority(1000))); + +Two koo[ 3 ] __attribute__((init_priority(1000))) = { + Two( 21, 22 ), + Two( 23, 24 ), + Two( 25, 26 ) +}; + +Two xoo[ 3 ] __attribute__((init_priority(1100))); + +Two zoo[ 3 ] __attribute__((init_priority(1100))) = { + Two( 31, 32 ), + Two( 33, 34 ), + Two( 35, 36 ) +}; + +int Two::count; + +long x = 0; + +#define X( n ) \ + do { if ( x & (1L << (n)) ) return 1; else x |= (1L << (n)); } while (0) + +int main() +{ + + X( coo[0].kay() ); + X( coo[1].kay() ); + X( coo[2].kay() ); + X( koo[0].kay() ); + X( koo[1].kay() ); + X( koo[2].kay() ); + if ( 0x3f != x ) abort (); + + X( foo.kay() ); + if ( 0x7f != x ) abort (); + + X( goo.kay() ); + if ( 0xff != x ) abort (); + + X( xoo[0].kay() ); + X( xoo[1].kay() ); + X( xoo[2].kay() ); + X( zoo[0].kay() ); + X( zoo[1].kay() ); + X( zoo[2].kay() ); + if ( 0x3fff != x ) abort (); + + X( doo[0].kay() ); + X( doo[1].kay() ); + X( doo[2].kay() ); + X( hoo[0].kay() ); + X( hoo[1].kay() ); + X( hoo[2].kay() ); + if ( 0xfffff != x ) abort (); + + exit (0); +} From dalej at apple.com Mon Jun 21 13:46:09 2010 From: dalej at apple.com (Dale Johannesen) Date: Mon, 21 Jun 2010 18:46:09 -0000 Subject: [llvm-commits] [llvm] r106443 - /llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll Message-ID: <20100621184609.26FEF2A6C12C@llvm.org> Author: johannes Date: Mon Jun 21 13:46:08 2010 New Revision: 106443 URL: http://llvm.org/viewvc/llvm-project?rev=106443&view=rev Log: Add missing FileCheck call. Modified: llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll Modified: llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll?rev=106443&r1=106442&r2=106443&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll (original) +++ llvm/trunk/test/CodeGen/ARM/2010-06-21-nondarwin-tc.ll Mon Jun 21 13:46:08 2010 @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=arm -mtriple=armv4t-unknown-linux-gnueabi +; RUN: llc < %s -march=arm -mtriple=armv4t-unknown-linux-gnueabi | FileCheck %s ; PR 7433 %0 = type { i8*, i8* } From gohman at apple.com Mon Jun 21 13:46:46 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 21 Jun 2010 18:46:46 -0000 Subject: [llvm-commits] [llvm] r106444 - in /llvm/trunk: include/llvm/Pass.h include/llvm/PassAnalysisSupport.h include/llvm/PassManagers.h include/llvm/PassSupport.h lib/VMCore/Pass.cpp lib/VMCore/PassManager.cpp Message-ID: <20100621184646.1F9B82A6C12C@llvm.org> Author: djg Date: Mon Jun 21 13:46:45 2010 New Revision: 106444 URL: http://llvm.org/viewvc/llvm-project?rev=106444&view=rev Log: Move several non-performance-critical member functinos out of line. Modified: llvm/trunk/include/llvm/Pass.h llvm/trunk/include/llvm/PassAnalysisSupport.h llvm/trunk/include/llvm/PassManagers.h llvm/trunk/include/llvm/PassSupport.h llvm/trunk/lib/VMCore/Pass.cpp llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/include/llvm/Pass.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Pass.h?rev=106444&r1=106443&r2=106444&view=diff ============================================================================== --- llvm/trunk/include/llvm/Pass.h (original) +++ llvm/trunk/include/llvm/Pass.h Mon Jun 21 13:46:45 2010 @@ -31,7 +31,6 @@ #include "llvm/System/DataTypes.h" -#include #include #include #include @@ -89,13 +88,8 @@ Pass(const Pass &); // DO NOT IMPLEMENT public: - explicit Pass(PassKind K, intptr_t pid) : Resolver(0), PassID(pid), Kind(K) { - assert(pid && "pid cannot be 0"); - } - explicit Pass(PassKind K, const void *pid) - : Resolver(0), PassID((intptr_t)pid), Kind(K) { - assert(pid && "pid cannot be 0"); - } + explicit Pass(PassKind K, intptr_t pid); + explicit Pass(PassKind K, const void *pid); virtual ~Pass(); @@ -138,13 +132,8 @@ virtual PassManagerType getPotentialPassManagerType() const; // Access AnalysisResolver - inline void setResolver(AnalysisResolver *AR) { - assert(!Resolver && "Resolver is already set"); - Resolver = AR; - } - inline AnalysisResolver *getResolver() { - return Resolver; - } + void setResolver(AnalysisResolver *AR); + AnalysisResolver *getResolver() const { return Resolver; } /// getAnalysisUsage - This function should be overriden by passes that need /// analysis information to do their job. If a pass specifies that it uses a @@ -170,11 +159,9 @@ /// an analysis interface through multiple inheritance. If needed, it should /// override this to adjust the this pointer as needed for the specified pass /// info. - virtual void *getAdjustedAnalysisPointer(const PassInfo *) { - return this; - } - virtual ImmutablePass *getAsImmutablePass() { return 0; } - virtual PMDataManager *getAsPMDataManager() { return 0; } + virtual void *getAdjustedAnalysisPointer(const PassInfo *); + virtual ImmutablePass *getAsImmutablePass(); + virtual PMDataManager *getAsPMDataManager(); /// verifyAnalysis() - This member can be implemented by a analysis pass to /// check state of analysis information. Modified: llvm/trunk/include/llvm/PassAnalysisSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassAnalysisSupport.h?rev=106444&r1=106443&r2=106444&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassAnalysisSupport.h (original) +++ llvm/trunk/include/llvm/PassAnalysisSupport.h Mon Jun 21 13:46:45 2010 @@ -49,22 +49,13 @@ // addRequired - Add the specified ID to the required set of the usage info // for a pass. // - AnalysisUsage &addRequiredID(AnalysisID ID) { - assert(ID && "Pass class not registered!"); - Required.push_back(ID); - return *this; - } + AnalysisUsage &addRequiredID(AnalysisID ID); template AnalysisUsage &addRequired() { return addRequiredID(Pass::getClassPassInfo()); } - AnalysisUsage &addRequiredTransitiveID(AnalysisID ID) { - assert(ID && "Pass class not registered!"); - Required.push_back(ID); - RequiredTransitive.push_back(ID); - return *this; - } + AnalysisUsage &addRequiredTransitiveID(AnalysisID ID); template AnalysisUsage &addRequiredTransitive() { AnalysisID ID = Pass::getClassPassInfo(); Modified: llvm/trunk/include/llvm/PassManagers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=106444&r1=106443&r2=106444&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassManagers.h (original) +++ llvm/trunk/include/llvm/PassManagers.h Mon Jun 21 13:46:45 2010 @@ -302,10 +302,7 @@ /// through getAnalysis interface. virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass); - virtual Pass * getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F) { - assert (0 && "Unable to find on the fly pass"); - return NULL; - } + virtual Pass *getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F); /// Initialize available analysis information. void initializeAnalysisInfo() { Modified: llvm/trunk/include/llvm/PassSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=106444&r1=106443&r2=106444&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassSupport.h (original) +++ llvm/trunk/include/llvm/PassSupport.h Mon Jun 21 13:46:45 2010 @@ -109,13 +109,7 @@ } /// createPass() - Use this method to create an instance of this pass. - Pass *createPass() const { - assert((!isAnalysisGroup() || NormalCtor) && - "No default implementation found for analysis group!"); - assert(NormalCtor && - "Cannot call createPass on PassInfo without default ctor!"); - return NormalCtor(); - } + Pass *createPass() const; /// addInterfaceImplemented - This method is called when this pass is /// registered as a member of an analysis group with the RegisterAnalysisGroup Modified: llvm/trunk/lib/VMCore/Pass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Pass.cpp?rev=106444&r1=106443&r2=106444&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Pass.cpp (original) +++ llvm/trunk/lib/VMCore/Pass.cpp Mon Jun 21 13:46:45 2010 @@ -35,6 +35,15 @@ // Pass Implementation // +Pass::Pass(PassKind K, intptr_t pid) : Resolver(0), PassID(pid), Kind(K) { + assert(pid && "pid cannot be 0"); +} + +Pass::Pass(PassKind K, const void *pid) + : Resolver(0), PassID((intptr_t)pid), Kind(K) { + assert(pid && "pid cannot be 0"); +} + // Force out-of-line virtual method. Pass::~Pass() { delete Resolver; @@ -92,6 +101,23 @@ // By default, don't do anything. } +void *Pass::getAdjustedAnalysisPointer(const PassInfo *) { + return this; +} + +ImmutablePass *Pass::getAsImmutablePass() { + return 0; +} + +PMDataManager *Pass::getAsPMDataManager() { + return 0; +} + +void Pass::setResolver(AnalysisResolver *AR) { + assert(!Resolver && "Resolver is already set"); + Resolver = AR; +} + // print - Print out the internal state of the pass. This is called by Analyze // to print out the contents of an analysis. Otherwise it is not necessary to // implement this method. @@ -364,6 +390,14 @@ getPassRegistrar()->UnregisterPass(*this); } +Pass *PassInfo::createPass() const { + assert((!isAnalysisGroup() || NormalCtor) && + "No default implementation found for analysis group!"); + assert(NormalCtor && + "Cannot call createPass on PassInfo without default ctor!"); + return NormalCtor(); +} + //===----------------------------------------------------------------------===// // Analysis Group Implementation Code //===----------------------------------------------------------------------===// @@ -467,4 +501,15 @@ GetCFGOnlyPasses(Preserved).enumeratePasses(); } +AnalysisUsage &AnalysisUsage::addRequiredID(AnalysisID ID) { + assert(ID && "Pass class not registered!"); + Required.push_back(ID); + return *this; +} +AnalysisUsage &AnalysisUsage::addRequiredTransitiveID(AnalysisID ID) { + assert(ID && "Pass class not registered!"); + Required.push_back(ID); + RequiredTransitive.push_back(ID); + return *this; +} Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=106444&r1=106443&r2=106444&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Mon Jun 21 13:46:45 2010 @@ -1147,6 +1147,11 @@ llvm_unreachable("Unable to schedule pass"); } +Pass *PMDataManager::getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F) { + assert(0 && "Unable to find on the fly pass"); + return NULL; +} + // Destructor PMDataManager::~PMDataManager() { for (SmallVector::iterator I = PassVector.begin(), From echristo at apple.com Mon Jun 21 13:48:55 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 21 Jun 2010 18:48:55 -0000 Subject: [llvm-commits] [llvm] r106445 - in /llvm/trunk/lib/Target/Alpha: AlphaInstrFormats.td AlphaInstrInfo.td Message-ID: <20100621184855.2E9032A6C12C@llvm.org> Author: echristo Date: Mon Jun 21 13:48:55 2010 New Revision: 106445 URL: http://llvm.org/viewvc/llvm-project?rev=106445&view=rev Log: Remove isTwoAddress from Alpha. Modified: llvm/trunk/lib/Target/Alpha/AlphaInstrFormats.td llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td Modified: llvm/trunk/lib/Target/Alpha/AlphaInstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaInstrFormats.td?rev=106445&r1=106444&r2=106445&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaInstrFormats.td (original) +++ llvm/trunk/lib/Target/Alpha/AlphaInstrFormats.td Mon Jun 21 13:48:55 2010 @@ -182,7 +182,7 @@ bits<5> Rb; bits<7> Function = fun; -// let isTwoAddress = 1; +// let Constraints = "$RFALSE = $RDEST"; let Inst{25-21} = Ra; let Inst{20-16} = Rb; let Inst{15-13} = 0; @@ -223,7 +223,7 @@ bits<8> LIT; bits<7> Function = fun; -// let isTwoAddress = 1; +// let Constraints = "$RFALSE = $RDEST"; let Inst{25-21} = Ra; let Inst{20-13} = LIT; let Inst{12} = 1; Modified: llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td?rev=106445&r1=106444&r2=106445&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td (original) +++ llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td Mon Jun 21 13:48:55 2010 @@ -680,18 +680,32 @@ } //conditional moves, floats -let OutOperandList = (outs F4RC:$RDEST), InOperandList = (ins F4RC:$RFALSE, F4RC:$RTRUE, F8RC:$RCOND), - isTwoAddress = 1 in { -def FCMOVEQS : FPForm<0x17, 0x02A, "fcmoveq $RCOND,$RTRUE,$RDEST",[], s_fcmov>; //FCMOVE if = zero -def FCMOVGES : FPForm<0x17, 0x02D, "fcmovge $RCOND,$RTRUE,$RDEST",[], s_fcmov>; //FCMOVE if >= zero -def FCMOVGTS : FPForm<0x17, 0x02F, "fcmovgt $RCOND,$RTRUE,$RDEST",[], s_fcmov>; //FCMOVE if > zero -def FCMOVLES : FPForm<0x17, 0x02E, "fcmovle $RCOND,$RTRUE,$RDEST",[], s_fcmov>; //FCMOVE if <= zero -def FCMOVLTS : FPForm<0x17, 0x02C, "fcmovlt $RCOND,$RTRUE,$RDEST",[], s_fcmov>; // FCMOVE if < zero -def FCMOVNES : FPForm<0x17, 0x02B, "fcmovne $RCOND,$RTRUE,$RDEST",[], s_fcmov>; //FCMOVE if != zero +let OutOperandList = (outs F4RC:$RDEST), + InOperandList = (ins F4RC:$RFALSE, F4RC:$RTRUE, F8RC:$RCOND), + Constraints = "$RTRUE = $RDEST" in { +def FCMOVEQS : FPForm<0x17, 0x02A, + "fcmoveq $RCOND,$RTRUE,$RDEST", + [], s_fcmov>; //FCMOVE if = zero +def FCMOVGES : FPForm<0x17, 0x02D, + "fcmovge $RCOND,$RTRUE,$RDEST", + [], s_fcmov>; //FCMOVE if >= zero +def FCMOVGTS : FPForm<0x17, 0x02F, + "fcmovgt $RCOND,$RTRUE,$RDEST", + [], s_fcmov>; //FCMOVE if > zero +def FCMOVLES : FPForm<0x17, 0x02E, + "fcmovle $RCOND,$RTRUE,$RDEST", + [], s_fcmov>; //FCMOVE if <= zero +def FCMOVLTS : FPForm<0x17, 0x02C, + "fcmovlt $RCOND,$RTRUE,$RDEST", + [], s_fcmov>; // FCMOVE if < zero +def FCMOVNES : FPForm<0x17, 0x02B, + "fcmovne $RCOND,$RTRUE,$RDEST", + [], s_fcmov>; //FCMOVE if != zero } //conditional moves, doubles -let OutOperandList = (outs F8RC:$RDEST), InOperandList = (ins F8RC:$RFALSE, F8RC:$RTRUE, F8RC:$RCOND), - isTwoAddress = 1 in { +let OutOperandList = (outs F8RC:$RDEST), + InOperandList = (ins F8RC:$RFALSE, F8RC:$RTRUE, F8RC:$RCOND), + Constraints = "$RTRUE = $RDEST" in { def FCMOVEQT : FPForm<0x17, 0x02A, "fcmoveq $RCOND,$RTRUE,$RDEST", [], s_fcmov>; def FCMOVGET : FPForm<0x17, 0x02D, "fcmovge $RCOND,$RTRUE,$RDEST", [], s_fcmov>; def FCMOVGTT : FPForm<0x17, 0x02F, "fcmovgt $RCOND,$RTRUE,$RDEST", [], s_fcmov>; From echristo at apple.com Mon Jun 21 13:51:38 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 21 Jun 2010 18:51:38 -0000 Subject: [llvm-commits] [llvm] r106446 - /llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td Message-ID: <20100621185138.D6B1B2A6C12C@llvm.org> Author: echristo Date: Mon Jun 21 13:51:38 2010 New Revision: 106446 URL: http://llvm.org/viewvc/llvm-project?rev=106446&view=rev Log: Remove isTwoAddress from XCore. Modified: llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td Modified: llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td?rev=106446&r1=106445&r2=106446&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td (original) +++ llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td Mon Jun 21 13:51:38 2010 @@ -733,7 +733,7 @@ // TODO setd, eet, eef, getts, setpt, outct, inct, chkct, outt, intt, out, // in, outshr, inshr, testct, testwct, tinitpc, tinitdp, tinitsp, tinitcp, // tsetmr, sext (reg), zext (reg) -let isTwoAddress = 1 in { +let Constraints = "$src1 = $dst" in { let neverHasSideEffects = 1 in def SEXT_rus : _FRUS<(outs GRRegs:$dst), (ins GRRegs:$src1, i32imm:$src2), "sext $dst, $src2", From echristo at apple.com Mon Jun 21 13:55:01 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 21 Jun 2010 18:55:01 -0000 Subject: [llvm-commits] [llvm] r106447 - /llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td Message-ID: <20100621185501.509FB2A6C12C@llvm.org> Author: echristo Date: Mon Jun 21 13:55:01 2010 New Revision: 106447 URL: http://llvm.org/viewvc/llvm-project?rev=106447&view=rev Log: Remove isTwoAddress from PIC16. Modified: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td Modified: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td?rev=106447&r1=106446&r2=106447&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td (original) +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td Mon Jun 21 13:55:01 2010 @@ -134,7 +134,7 @@ //===----------------------------------------------------------------------===// // W = W Op F : Load the value from F and do Op to W. -let isTwoAddress = 1, mayLoad = 1 in +let Constraints = "$src = $dst", mayLoad = 1 in class BinOpFW OpCode, string OpcStr, SDNode OpNode>: ByteFormat; // W = W Op L : Do Op of L with W and place result in W. -let isTwoAddress = 1 in +let Constraints = "$src = $dst" in class BinOpWL opcode, string OpcStr, SDNode OpNode> : LiteralFormat; -let isTwoAddress = 1 in +let Constraints = "$src = $dst" in def set_fsrhi: ByteFormat<0, (outs FSR16:$dst), (ins FSR16:$src, GPR:$val), @@ -362,7 +362,7 @@ } // W -= [F] ; load from F and sub the value from W. -let isTwoAddress = 1, mayLoad = 1 in +let Constraints = "$src = $dst", mayLoad = 1 in class SUBFW OpCode, string OpcStr, SDNode OpNode>: ByteFormat opcode, string OpcStr, SDNode OpNode> : LiteralFormat; // subwl // W = W - C ; sub literal from W (Without borrow). -let isTwoAddress = 1 in +let Constraints = "$src = $dst" in class SUBWL opcode, string OpcStr, SDNode OpNode> : LiteralFormat Author: echristo Date: Mon Jun 21 13:56:55 2010 New Revision: 106448 URL: http://llvm.org/viewvc/llvm-project?rev=106448&view=rev Log: Make 80-column. Modified: llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td Modified: llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td?rev=106448&r1=106447&r2=106448&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td (original) +++ llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td Mon Jun 21 13:56:55 2010 @@ -25,13 +25,16 @@ def SDT_MSP430Call : SDTypeProfile<0, -1, [SDTCisVT<0, iPTR>]>; def SDT_MSP430CallSeqStart : SDCallSeqStart<[SDTCisVT<0, i16>]>; def SDT_MSP430CallSeqEnd : SDCallSeqEnd<[SDTCisVT<0, i16>, SDTCisVT<1, i16>]>; -def SDT_MSP430Wrapper : SDTypeProfile<1, 1, [SDTCisSameAs<0, 1>, SDTCisPtrTy<0>]>; +def SDT_MSP430Wrapper : SDTypeProfile<1, 1, [SDTCisSameAs<0, 1>, + SDTCisPtrTy<0>]>; def SDT_MSP430Cmp : SDTypeProfile<0, 2, [SDTCisSameAs<0, 1>]>; def SDT_MSP430BrCC : SDTypeProfile<0, 2, [SDTCisVT<0, OtherVT>, SDTCisVT<1, i8>]>; -def SDT_MSP430SelectCC : SDTypeProfile<1, 3, [SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>, +def SDT_MSP430SelectCC : SDTypeProfile<1, 3, [SDTCisSameAs<0, 1>, + SDTCisSameAs<1, 2>, SDTCisVT<3, i8>]>; -def SDT_MSP430Shift : SDTypeProfile<1, 2, [SDTCisSameAs<0, 1>, SDTCisI8<2>]>; +def SDT_MSP430Shift : SDTypeProfile<1, 2, [SDTCisSameAs<0, 1>, + SDTCisI8<2>]>; //===----------------------------------------------------------------------===// // MSP430 Specific Node Definitions. @@ -55,8 +58,10 @@ [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>; def MSP430Wrapper : SDNode<"MSP430ISD::Wrapper", SDT_MSP430Wrapper>; def MSP430cmp : SDNode<"MSP430ISD::CMP", SDT_MSP430Cmp, [SDNPOutFlag]>; -def MSP430brcc : SDNode<"MSP430ISD::BR_CC", SDT_MSP430BrCC, [SDNPHasChain, SDNPInFlag]>; -def MSP430selectcc: SDNode<"MSP430ISD::SELECT_CC", SDT_MSP430SelectCC, [SDNPInFlag]>; +def MSP430brcc : SDNode<"MSP430ISD::BR_CC", SDT_MSP430BrCC, + [SDNPHasChain, SDNPInFlag]>; +def MSP430selectcc: SDNode<"MSP430ISD::SELECT_CC", SDT_MSP430SelectCC, + [SDNPInFlag]>; def MSP430shl : SDNode<"MSP430ISD::SHL", SDT_MSP430Shift, []>; def MSP430sra : SDNode<"MSP430ISD::SRA", SDT_MSP430Shift, []>; def MSP430srl : SDNode<"MSP430ISD::SRL", SDT_MSP430Shift, []>; From gohman at apple.com Mon Jun 21 14:47:52 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 21 Jun 2010 19:47:52 -0000 Subject: [llvm-commits] [llvm] r106452 - in /llvm/trunk/lib: Analysis/ScalarEvolution.cpp Analysis/ScalarEvolutionExpander.cpp CodeGen/SelectionDAG/LegalizeTypes.cpp CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp CodeGen/SelectionDAG/SelectionDAG.cpp Transforms/Scalar/LoopStrengthReduce.cpp Transforms/Utils/PromoteMemoryToRegister.cpp VMCore/ConstantFold.cpp VMCore/Instructions.cpp Message-ID: <20100621194752.CA6702A6C12C@llvm.org> Author: djg Date: Mon Jun 21 14:47:52 2010 New Revision: 106452 URL: http://llvm.org/viewvc/llvm-project?rev=106452&view=rev Log: Use A.append(...) instead of A.insert(A.end(), ...) when A is a SmallVector, and other SmallVector simplifications. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp llvm/trunk/lib/VMCore/ConstantFold.cpp llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=106452&r1=106451&r2=106452&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Jun 21 14:47:52 2010 @@ -1406,8 +1406,8 @@ while (const SCEVAddExpr *Add = dyn_cast(Ops[Idx])) { // If we have an add, expand the add operands onto the end of the operands // list. - Ops.insert(Ops.end(), Add->op_begin(), Add->op_end()); Ops.erase(Ops.begin()+Idx); + Ops.append(Add->op_begin(), Add->op_end()); DeletedAdd = true; } @@ -1584,7 +1584,7 @@ AddRec->op_end()); for (unsigned i = 0, e = OtherAddRec->getNumOperands(); i != e; ++i) { if (i >= NewOps.size()) { - NewOps.insert(NewOps.end(), OtherAddRec->op_begin()+i, + NewOps.append(OtherAddRec->op_begin()+i, OtherAddRec->op_end()); break; } @@ -1717,8 +1717,8 @@ while (const SCEVMulExpr *Mul = dyn_cast(Ops[Idx])) { // If we have an mul, expand the mul operands onto the end of the operands // list. - Ops.insert(Ops.end(), Mul->op_begin(), Mul->op_end()); Ops.erase(Ops.begin()+Idx); + Ops.append(Mul->op_begin(), Mul->op_end()); DeletedMul = true; } @@ -1940,8 +1940,7 @@ Operands.push_back(Start); if (const SCEVAddRecExpr *StepChrec = dyn_cast(Step)) if (StepChrec->getLoop() == L) { - Operands.insert(Operands.end(), StepChrec->op_begin(), - StepChrec->op_end()); + Operands.append(StepChrec->op_begin(), StepChrec->op_end()); return getAddRecExpr(Operands, L); } @@ -2104,8 +2103,8 @@ if (Idx < Ops.size()) { bool DeletedSMax = false; while (const SCEVSMaxExpr *SMax = dyn_cast(Ops[Idx])) { - Ops.insert(Ops.end(), SMax->op_begin(), SMax->op_end()); Ops.erase(Ops.begin()+Idx); + Ops.append(SMax->op_begin(), SMax->op_end()); DeletedSMax = true; } @@ -2209,8 +2208,8 @@ if (Idx < Ops.size()) { bool DeletedUMax = false; while (const SCEVUMaxExpr *UMax = dyn_cast(Ops[Idx])) { - Ops.insert(Ops.end(), UMax->op_begin(), UMax->op_end()); Ops.erase(Ops.begin()+Idx); + Ops.append(UMax->op_begin(), UMax->op_end()); DeletedUMax = true; } Modified: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp?rev=106452&r1=106451&r2=106452&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp Mon Jun 21 14:47:52 2010 @@ -288,11 +288,11 @@ // the sum into a single value, so just use that. Ops.clear(); if (const SCEVAddExpr *Add = dyn_cast(Sum)) - Ops.insert(Ops.end(), Add->op_begin(), Add->op_end()); + Ops.append(Add->op_begin(), Add->op_end()); else if (!Sum->isZero()) Ops.push_back(Sum); // Then append the addrecs. - Ops.insert(Ops.end(), AddRecs.begin(), AddRecs.end()); + Ops.append(AddRecs.begin(), AddRecs.end()); } /// SplitAddRecs - Flatten a list of add operands, moving addrec start values @@ -315,7 +315,7 @@ A->getLoop())); if (const SCEVAddExpr *Add = dyn_cast(Start)) { Ops[i] = Zero; - Ops.insert(Ops.end(), Add->op_begin(), Add->op_end()); + Ops.append(Add->op_begin(), Add->op_end()); e += Add->getNumOperands(); } else { Ops[i] = Start; @@ -323,7 +323,7 @@ } if (!AddRecs.empty()) { // Add the addrecs onto the end of the list. - Ops.insert(Ops.end(), AddRecs.begin(), AddRecs.end()); + Ops.append(AddRecs.begin(), AddRecs.end()); // Resort the operand list, moving any constants to the front. SimplifyAddOperands(Ops, Ty, SE); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=106452&r1=106451&r2=106452&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Mon Jun 21 14:47:52 2010 @@ -485,7 +485,7 @@ NewOps.push_back(Op); } else if (Op != OrigOp) { // This is the first operand to change - add all operands so far. - NewOps.insert(NewOps.end(), N->op_begin(), N->op_begin() + i); + NewOps.append(N->op_begin(), N->op_begin() + i); NewOps.push_back(Op); } } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp?rev=106452&r1=106451&r2=106452&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Mon Jun 21 14:47:52 2010 @@ -540,7 +540,7 @@ for (; PDI != PDE; ++PDI) { MachineInstr *DbgMI= Emitter.EmitDbgValue(*PDI, VRBaseMap); if (DbgMI) - BB->insert(BB->end(), DbgMI); + BB->push_back(DbgMI); } } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=106452&r1=106451&r2=106452&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Jun 21 14:47:52 2010 @@ -2626,7 +2626,7 @@ if (N1.getOpcode() == ISD::BUILD_VECTOR && N2.getOpcode() == ISD::BUILD_VECTOR) { SmallVector Elts(N1.getNode()->op_begin(), N1.getNode()->op_end()); - Elts.insert(Elts.end(), N2.getNode()->op_begin(), N2.getNode()->op_end()); + Elts.append(N2.getNode()->op_begin(), N2.getNode()->op_end()); return getNode(ISD::BUILD_VECTOR, DL, VT, &Elts[0], Elts.size()); } break; @@ -3024,8 +3024,8 @@ N2.getOpcode() == ISD::BUILD_VECTOR && N3.getOpcode() == ISD::BUILD_VECTOR) { SmallVector Elts(N1.getNode()->op_begin(), N1.getNode()->op_end()); - Elts.insert(Elts.end(), N2.getNode()->op_begin(), N2.getNode()->op_end()); - Elts.insert(Elts.end(), N3.getNode()->op_begin(), N3.getNode()->op_end()); + Elts.append(N2.getNode()->op_begin(), N2.getNode()->op_end()); + Elts.append(N3.getNode()->op_begin(), N3.getNode()->op_end()); return getNode(ISD::BUILD_VECTOR, DL, VT, &Elts[0], Elts.size()); } break; Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=106452&r1=106451&r2=106452&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Jun 21 14:47:52 2010 @@ -1951,7 +1951,7 @@ Strides.insert(AR->getStepRecurrence(SE)); Worklist.push_back(AR->getStart()); } else if (const SCEVAddExpr *Add = dyn_cast(S)) { - Worklist.insert(Worklist.end(), Add->op_begin(), Add->op_end()); + Worklist.append(Add->op_begin(), Add->op_end()); } } while (!Worklist.empty()); } @@ -2118,7 +2118,7 @@ const SCEV *S = Worklist.pop_back_val(); if (const SCEVNAryExpr *N = dyn_cast(S)) - Worklist.insert(Worklist.end(), N->op_begin(), N->op_end()); + Worklist.append(N->op_begin(), N->op_end()); else if (const SCEVCastExpr *C = dyn_cast(S)) Worklist.push_back(C->getOperand()); else if (const SCEVUDivExpr *D = dyn_cast(S)) { @@ -2248,11 +2248,10 @@ continue; // Collect all operands except *J. - SmallVector InnerAddOps; - for (SmallVectorImpl::const_iterator K = AddOps.begin(), - KE = AddOps.end(); K != KE; ++K) - if (K != J) - InnerAddOps.push_back(*K); + SmallVector InnerAddOps + ( ((const SmallVector &)AddOps).begin(), J); + InnerAddOps.append + (next(J), ((const SmallVector &)AddOps).end()); // Don't leave just a constant behind in a register if the constant could // be folded into an immediate field. Modified: llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp?rev=106452&r1=106451&r2=106452&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Mon Jun 21 14:47:52 2010 @@ -603,9 +603,8 @@ // To determine liveness, we must iterate through the predecessors of blocks // where the def is live. Blocks are added to the worklist if we need to // check their predecessors. Start with all the using blocks. - SmallVector LiveInBlockWorklist; - LiveInBlockWorklist.insert(LiveInBlockWorklist.end(), - Info.UsingBlocks.begin(), Info.UsingBlocks.end()); + SmallVector LiveInBlockWorklist(Info.UsingBlocks.begin(), + Info.UsingBlocks.end()); // If any of the using blocks is also a definition block, check to see if the // definition occurs before or after the use. If it happens before the use, Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=106452&r1=106451&r2=106452&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ConstantFold.cpp (original) +++ llvm/trunk/lib/VMCore/ConstantFold.cpp Mon Jun 21 14:47:52 2010 @@ -2194,7 +2194,7 @@ } NewIndices.push_back(Combined); - NewIndices.insert(NewIndices.end(), Idxs+1, Idxs+NumIdx); + NewIndices.append(Idxs+1, Idxs+NumIdx); return (inBounds && cast(CE)->isInBounds()) ? ConstantExpr::getInBoundsGetElementPtr(CE->getOperand(0), &NewIndices[0], Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=106452&r1=106451&r2=106452&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Mon Jun 21 14:47:52 2010 @@ -1456,7 +1456,7 @@ Op<0>() = Agg; Op<1>() = Val; - Indices.insert(Indices.end(), Idx, Idx + NumIdx); + Indices.append(Idx, Idx + NumIdx); setName(Name); } @@ -1509,7 +1509,7 @@ const Twine &Name) { assert(NumOperands == 1 && "NumOperands not initialized?"); - Indices.insert(Indices.end(), Idx, Idx + NumIdx); + Indices.append(Idx, Idx + NumIdx); setName(Name); } From gohman at apple.com Mon Jun 21 14:56:28 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 21 Jun 2010 19:56:28 -0000 Subject: [llvm-commits] [llvm] r106454 - /llvm/trunk/test/CodeGen/X86/vec_shuffle-6.ll Message-ID: <20100621195628.172CA2A6C12C@llvm.org> Author: djg Date: Mon Jun 21 14:56:27 2010 New Revision: 106454 URL: http://llvm.org/viewvc/llvm-project?rev=106454&view=rev Log: Make this test more robust in case LLVM ever decides to align the global variable differently. Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-6.ll Modified: llvm/trunk/test/CodeGen/X86/vec_shuffle-6.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_shuffle-6.ll?rev=106454&r1=106453&r2=106454&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_shuffle-6.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_shuffle-6.ll Mon Jun 21 14:56:27 2010 @@ -4,7 +4,7 @@ ; RUN: grep movups %t | count 2 target triple = "i686-apple-darwin" - at x = global [4 x i32] [ i32 1, i32 2, i32 3, i32 4 ] ; <[4 x i32]*> [#uses=4] + at x = external global [4 x i32] define <2 x i64> @test1() { %tmp = load i32* getelementptr ([4 x i32]* @x, i32 0, i32 0) ; [#uses=1] From echristo at apple.com Mon Jun 21 15:07:30 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 21 Jun 2010 20:07:30 -0000 Subject: [llvm-commits] [llvm] r106455 - /llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td Message-ID: <20100621200730.AEF1C2A6C12C@llvm.org> Author: echristo Date: Mon Jun 21 15:07:30 2010 New Revision: 106455 URL: http://llvm.org/viewvc/llvm-project?rev=106455&view=rev Log: Remove isTwoAddress from MSP430. Modified: llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td Modified: llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td?rev=106455&r1=106454&r2=106455&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td (original) +++ llvm/trunk/lib/Target/MSP430/MSP430InstrInfo.td Mon Jun 21 15:07:30 2010 @@ -122,14 +122,14 @@ } let usesCustomInserter = 1 in { - def Select8 : Pseudo<(outs GR8:$dst), (ins GR8:$src1, GR8:$src2, i8imm:$cc), + def Select8 : Pseudo<(outs GR8:$dst), (ins GR8:$src, GR8:$src2, i8imm:$cc), "# Select8 PSEUDO", [(set GR8:$dst, - (MSP430selectcc GR8:$src1, GR8:$src2, imm:$cc))]>; - def Select16 : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2, i8imm:$cc), + (MSP430selectcc GR8:$src, GR8:$src2, imm:$cc))]>; + def Select16 : Pseudo<(outs GR16:$dst), (ins GR16:$src, GR16:$src2, i8imm:$cc), "# Select16 PSEUDO", [(set GR16:$dst, - (MSP430selectcc GR16:$src1, GR16:$src2, imm:$cc))]>; + (MSP430selectcc GR16:$src, GR16:$src2, imm:$cc))]>; let Defs = [SRW] in { def Shl8 : Pseudo<(outs GR8:$dst), (ins GR8:$src, GR8:$cnt), "# Shl8 PSEUDO", @@ -335,60 +335,60 @@ //===----------------------------------------------------------------------===// // Arithmetic Instructions -let isTwoAddress = 1 in { +let Constraints = "$src = $dst" in { let Defs = [SRW] in { let isCommutable = 1 in { // X = ADD Y, Z == X = ADD Z, Y def ADD8rr : I8rr<0x0, - (outs GR8:$dst), (ins GR8:$src1, GR8:$src2), + (outs GR8:$dst), (ins GR8:$src, GR8:$src2), "add.b\t{$src2, $dst}", - [(set GR8:$dst, (add GR8:$src1, GR8:$src2)), + [(set GR8:$dst, (add GR8:$src, GR8:$src2)), (implicit SRW)]>; def ADD16rr : I16rr<0x0, - (outs GR16:$dst), (ins GR16:$src1, GR16:$src2), + (outs GR16:$dst), (ins GR16:$src, GR16:$src2), "add.w\t{$src2, $dst}", - [(set GR16:$dst, (add GR16:$src1, GR16:$src2)), + [(set GR16:$dst, (add GR16:$src, GR16:$src2)), (implicit SRW)]>; } def ADD8rm : I8rm<0x0, - (outs GR8:$dst), (ins GR8:$src1, memsrc:$src2), + (outs GR8:$dst), (ins GR8:$src, memsrc:$src2), "add.b\t{$src2, $dst}", - [(set GR8:$dst, (add GR8:$src1, (load addr:$src2))), + [(set GR8:$dst, (add GR8:$src, (load addr:$src2))), (implicit SRW)]>; def ADD16rm : I16rm<0x0, - (outs GR16:$dst), (ins GR16:$src1, memsrc:$src2), + (outs GR16:$dst), (ins GR16:$src, memsrc:$src2), "add.w\t{$src2, $dst}", - [(set GR16:$dst, (add GR16:$src1, (load addr:$src2))), + [(set GR16:$dst, (add GR16:$src, (load addr:$src2))), (implicit SRW)]>; let mayLoad = 1, hasExtraDefRegAllocReq = 1, -Constraints = "$base = $base_wb, $src1 = $dst" in { +Constraints = "$base = $base_wb, $src = $dst" in { def ADD8rm_POST : IForm8<0x0, DstReg, SrcPostInc, Size2Bytes, (outs GR8:$dst, GR16:$base_wb), - (ins GR8:$src1, GR16:$base), + (ins GR8:$src, GR16:$base), "add.b\t{@$base+, $dst}", []>; def ADD16rm_POST : IForm16<0x0, DstReg, SrcPostInc, Size2Bytes, (outs GR16:$dst, GR16:$base_wb), - (ins GR16:$src1, GR16:$base), + (ins GR16:$src, GR16:$base), "add.w\t{@$base+, $dst}", []>; } def ADD8ri : I8ri<0x0, - (outs GR8:$dst), (ins GR8:$src1, i8imm:$src2), + (outs GR8:$dst), (ins GR8:$src, i8imm:$src2), "add.b\t{$src2, $dst}", - [(set GR8:$dst, (add GR8:$src1, imm:$src2)), + [(set GR8:$dst, (add GR8:$src, imm:$src2)), (implicit SRW)]>; def ADD16ri : I16ri<0x0, - (outs GR16:$dst), (ins GR16:$src1, i16imm:$src2), + (outs GR16:$dst), (ins GR16:$src, i16imm:$src2), "add.w\t{$src2, $dst}", - [(set GR16:$dst, (add GR16:$src1, imm:$src2)), + [(set GR16:$dst, (add GR16:$src, imm:$src2)), (implicit SRW)]>; -let isTwoAddress = 0 in { +let Constraints = "" in { def ADD8mr : I8mr<0x0, (outs), (ins memdst:$dst, GR8:$src), "add.b\t{$src, $dst}", @@ -429,40 +429,40 @@ let isCommutable = 1 in { // X = ADDC Y, Z == X = ADDC Z, Y def ADC8rr : I8rr<0x0, - (outs GR8:$dst), (ins GR8:$src1, GR8:$src2), + (outs GR8:$dst), (ins GR8:$src, GR8:$src2), "addc.b\t{$src2, $dst}", - [(set GR8:$dst, (adde GR8:$src1, GR8:$src2)), + [(set GR8:$dst, (adde GR8:$src, GR8:$src2)), (implicit SRW)]>; def ADC16rr : I16rr<0x0, - (outs GR16:$dst), (ins GR16:$src1, GR16:$src2), + (outs GR16:$dst), (ins GR16:$src, GR16:$src2), "addc.w\t{$src2, $dst}", - [(set GR16:$dst, (adde GR16:$src1, GR16:$src2)), + [(set GR16:$dst, (adde GR16:$src, GR16:$src2)), (implicit SRW)]>; } // isCommutable def ADC8ri : I8ri<0x0, - (outs GR8:$dst), (ins GR8:$src1, i8imm:$src2), + (outs GR8:$dst), (ins GR8:$src, i8imm:$src2), "addc.b\t{$src2, $dst}", - [(set GR8:$dst, (adde GR8:$src1, imm:$src2)), + [(set GR8:$dst, (adde GR8:$src, imm:$src2)), (implicit SRW)]>; def ADC16ri : I16ri<0x0, - (outs GR16:$dst), (ins GR16:$src1, i16imm:$src2), + (outs GR16:$dst), (ins GR16:$src, i16imm:$src2), "addc.w\t{$src2, $dst}", - [(set GR16:$dst, (adde GR16:$src1, imm:$src2)), + [(set GR16:$dst, (adde GR16:$src, imm:$src2)), (implicit SRW)]>; def ADC8rm : I8rm<0x0, - (outs GR8:$dst), (ins GR8:$src1, memsrc:$src2), + (outs GR8:$dst), (ins GR8:$src, memsrc:$src2), "addc.b\t{$src2, $dst}", - [(set GR8:$dst, (adde GR8:$src1, (load addr:$src2))), + [(set GR8:$dst, (adde GR8:$src, (load addr:$src2))), (implicit SRW)]>; def ADC16rm : I16rm<0x0, - (outs GR16:$dst), (ins GR16:$src1, memsrc:$src2), + (outs GR16:$dst), (ins GR16:$src, memsrc:$src2), "addc.w\t{$src2, $dst}", - [(set GR16:$dst, (adde GR16:$src1, (load addr:$src2))), + [(set GR16:$dst, (adde GR16:$src, (load addr:$src2))), (implicit SRW)]>; -let isTwoAddress = 0 in { +let Constraints = "" in { def ADC8mr : I8mr<0x0, (outs), (ins memdst:$dst, GR8:$src), "addc.b\t{$src, $dst}", @@ -503,52 +503,52 @@ let isCommutable = 1 in { // X = AND Y, Z == X = AND Z, Y def AND8rr : I8rr<0x0, - (outs GR8:$dst), (ins GR8:$src1, GR8:$src2), + (outs GR8:$dst), (ins GR8:$src, GR8:$src2), "and.b\t{$src2, $dst}", - [(set GR8:$dst, (and GR8:$src1, GR8:$src2)), + [(set GR8:$dst, (and GR8:$src, GR8:$src2)), (implicit SRW)]>; def AND16rr : I16rr<0x0, - (outs GR16:$dst), (ins GR16:$src1, GR16:$src2), + (outs GR16:$dst), (ins GR16:$src, GR16:$src2), "and.w\t{$src2, $dst}", - [(set GR16:$dst, (and GR16:$src1, GR16:$src2)), + [(set GR16:$dst, (and GR16:$src, GR16:$src2)), (implicit SRW)]>; } def AND8ri : I8ri<0x0, - (outs GR8:$dst), (ins GR8:$src1, i8imm:$src2), + (outs GR8:$dst), (ins GR8:$src, i8imm:$src2), "and.b\t{$src2, $dst}", - [(set GR8:$dst, (and GR8:$src1, imm:$src2)), + [(set GR8:$dst, (and GR8:$src, imm:$src2)), (implicit SRW)]>; def AND16ri : I16ri<0x0, - (outs GR16:$dst), (ins GR16:$src1, i16imm:$src2), + (outs GR16:$dst), (ins GR16:$src, i16imm:$src2), "and.w\t{$src2, $dst}", - [(set GR16:$dst, (and GR16:$src1, imm:$src2)), + [(set GR16:$dst, (and GR16:$src, imm:$src2)), (implicit SRW)]>; def AND8rm : I8rm<0x0, - (outs GR8:$dst), (ins GR8:$src1, memsrc:$src2), + (outs GR8:$dst), (ins GR8:$src, memsrc:$src2), "and.b\t{$src2, $dst}", - [(set GR8:$dst, (and GR8:$src1, (load addr:$src2))), + [(set GR8:$dst, (and GR8:$src, (load addr:$src2))), (implicit SRW)]>; def AND16rm : I16rm<0x0, - (outs GR16:$dst), (ins GR16:$src1, memsrc:$src2), + (outs GR16:$dst), (ins GR16:$src, memsrc:$src2), "and.w\t{$src2, $dst}", - [(set GR16:$dst, (and GR16:$src1, (load addr:$src2))), + [(set GR16:$dst, (and GR16:$src, (load addr:$src2))), (implicit SRW)]>; let mayLoad = 1, hasExtraDefRegAllocReq = 1, -Constraints = "$base = $base_wb, $src1 = $dst" in { +Constraints = "$base = $base_wb, $src = $dst" in { def AND8rm_POST : IForm8<0x0, DstReg, SrcPostInc, Size2Bytes, (outs GR8:$dst, GR16:$base_wb), - (ins GR8:$src1, GR16:$base), + (ins GR8:$src, GR16:$base), "and.b\t{@$base+, $dst}", []>; def AND16rm_POST : IForm16<0x0, DstReg, SrcPostInc, Size2Bytes, (outs GR16:$dst, GR16:$base_wb), - (ins GR16:$src1, GR16:$base), + (ins GR16:$src, GR16:$base), "and.w\t{@$base+, $dst}", []>; } -let isTwoAddress = 0 in { +let Constraints = "" in { def AND8mr : I8mr<0x0, (outs), (ins memdst:$dst, GR8:$src), "and.b\t{$src, $dst}", @@ -587,46 +587,46 @@ let isCommutable = 1 in { // X = OR Y, Z == X = OR Z, Y def OR8rr : I8rr<0x0, - (outs GR8:$dst), (ins GR8:$src1, GR8:$src2), + (outs GR8:$dst), (ins GR8:$src, GR8:$src2), "bis.b\t{$src2, $dst}", - [(set GR8:$dst, (or GR8:$src1, GR8:$src2))]>; + [(set GR8:$dst, (or GR8:$src, GR8:$src2))]>; def OR16rr : I16rr<0x0, - (outs GR16:$dst), (ins GR16:$src1, GR16:$src2), + (outs GR16:$dst), (ins GR16:$src, GR16:$src2), "bis.w\t{$src2, $dst}", - [(set GR16:$dst, (or GR16:$src1, GR16:$src2))]>; + [(set GR16:$dst, (or GR16:$src, GR16:$src2))]>; } def OR8ri : I8ri<0x0, - (outs GR8:$dst), (ins GR8:$src1, i8imm:$src2), + (outs GR8:$dst), (ins GR8:$src, i8imm:$src2), "bis.b\t{$src2, $dst}", - [(set GR8:$dst, (or GR8:$src1, imm:$src2))]>; + [(set GR8:$dst, (or GR8:$src, imm:$src2))]>; def OR16ri : I16ri<0x0, - (outs GR16:$dst), (ins GR16:$src1, i16imm:$src2), + (outs GR16:$dst), (ins GR16:$src, i16imm:$src2), "bis.w\t{$src2, $dst}", - [(set GR16:$dst, (or GR16:$src1, imm:$src2))]>; + [(set GR16:$dst, (or GR16:$src, imm:$src2))]>; def OR8rm : I8rm<0x0, - (outs GR8:$dst), (ins GR8:$src1, memsrc:$src2), + (outs GR8:$dst), (ins GR8:$src, memsrc:$src2), "bis.b\t{$src2, $dst}", - [(set GR8:$dst, (or GR8:$src1, (load addr:$src2)))]>; + [(set GR8:$dst, (or GR8:$src, (load addr:$src2)))]>; def OR16rm : I16rm<0x0, - (outs GR16:$dst), (ins GR16:$src1, memsrc:$src2), + (outs GR16:$dst), (ins GR16:$src, memsrc:$src2), "bis.w\t{$src2, $dst}", - [(set GR16:$dst, (or GR16:$src1, (load addr:$src2)))]>; + [(set GR16:$dst, (or GR16:$src, (load addr:$src2)))]>; let mayLoad = 1, hasExtraDefRegAllocReq = 1, -Constraints = "$base = $base_wb, $src1 = $dst" in { +Constraints = "$base = $base_wb, $src = $dst" in { def OR8rm_POST : IForm8<0x0, DstReg, SrcPostInc, Size2Bytes, (outs GR8:$dst, GR16:$base_wb), - (ins GR8:$src1, GR16:$base), + (ins GR8:$src, GR16:$base), "bis.b\t{@$base+, $dst}", []>; def OR16rm_POST : IForm16<0x0, DstReg, SrcPostInc, Size2Bytes, (outs GR16:$dst, GR16:$base_wb), - (ins GR16:$src1, GR16:$base), + (ins GR16:$src, GR16:$base), "bis.w\t{@$base+, $dst}", []>; } -let isTwoAddress = 0 in { +let Constraints = "" in { def OR8mr : I8mr<0x0, (outs), (ins memdst:$dst, GR8:$src), "bis.b\t{$src, $dst}", @@ -659,24 +659,24 @@ // bic does not modify condition codes def BIC8rr : I8rr<0x0, - (outs GR8:$dst), (ins GR8:$src1, GR8:$src2), + (outs GR8:$dst), (ins GR8:$src, GR8:$src2), "bic.b\t{$src2, $dst}", - [(set GR8:$dst, (and GR8:$src1, (not GR8:$src2)))]>; + [(set GR8:$dst, (and GR8:$src, (not GR8:$src2)))]>; def BIC16rr : I16rr<0x0, - (outs GR16:$dst), (ins GR16:$src1, GR16:$src2), + (outs GR16:$dst), (ins GR16:$src, GR16:$src2), "bic.w\t{$src2, $dst}", - [(set GR16:$dst, (and GR16:$src1, (not GR16:$src2)))]>; + [(set GR16:$dst, (and GR16:$src, (not GR16:$src2)))]>; def BIC8rm : I8rm<0x0, - (outs GR8:$dst), (ins GR8:$src1, memsrc:$src2), + (outs GR8:$dst), (ins GR8:$src, memsrc:$src2), "bic.b\t{$src2, $dst}", - [(set GR8:$dst, (and GR8:$src1, (not (i8 (load addr:$src2)))))]>; + [(set GR8:$dst, (and GR8:$src, (not (i8 (load addr:$src2)))))]>; def BIC16rm : I16rm<0x0, - (outs GR16:$dst), (ins GR16:$src1, memsrc:$src2), + (outs GR16:$dst), (ins GR16:$src, memsrc:$src2), "bic.w\t{$src2, $dst}", - [(set GR16:$dst, (and GR16:$src1, (not (i16 (load addr:$src2)))))]>; + [(set GR16:$dst, (and GR16:$src, (not (i16 (load addr:$src2)))))]>; -let isTwoAddress = 0 in { +let Constraints = "" in { def BIC8mr : I8mr<0x0, (outs), (ins memdst:$dst, GR8:$src), "bic.b\t{$src, $dst}", @@ -700,52 +700,52 @@ let isCommutable = 1 in { // X = XOR Y, Z == X = XOR Z, Y def XOR8rr : I8rr<0x0, - (outs GR8:$dst), (ins GR8:$src1, GR8:$src2), + (outs GR8:$dst), (ins GR8:$src, GR8:$src2), "xor.b\t{$src2, $dst}", - [(set GR8:$dst, (xor GR8:$src1, GR8:$src2)), + [(set GR8:$dst, (xor GR8:$src, GR8:$src2)), (implicit SRW)]>; def XOR16rr : I16rr<0x0, - (outs GR16:$dst), (ins GR16:$src1, GR16:$src2), + (outs GR16:$dst), (ins GR16:$src, GR16:$src2), "xor.w\t{$src2, $dst}", - [(set GR16:$dst, (xor GR16:$src1, GR16:$src2)), + [(set GR16:$dst, (xor GR16:$src, GR16:$src2)), (implicit SRW)]>; } def XOR8ri : I8ri<0x0, - (outs GR8:$dst), (ins GR8:$src1, i8imm:$src2), + (outs GR8:$dst), (ins GR8:$src, i8imm:$src2), "xor.b\t{$src2, $dst}", - [(set GR8:$dst, (xor GR8:$src1, imm:$src2)), + [(set GR8:$dst, (xor GR8:$src, imm:$src2)), (implicit SRW)]>; def XOR16ri : I16ri<0x0, - (outs GR16:$dst), (ins GR16:$src1, i16imm:$src2), + (outs GR16:$dst), (ins GR16:$src, i16imm:$src2), "xor.w\t{$src2, $dst}", - [(set GR16:$dst, (xor GR16:$src1, imm:$src2)), + [(set GR16:$dst, (xor GR16:$src, imm:$src2)), (implicit SRW)]>; def XOR8rm : I8rm<0x0, - (outs GR8:$dst), (ins GR8:$src1, memsrc:$src2), + (outs GR8:$dst), (ins GR8:$src, memsrc:$src2), "xor.b\t{$src2, $dst}", - [(set GR8:$dst, (xor GR8:$src1, (load addr:$src2))), + [(set GR8:$dst, (xor GR8:$src, (load addr:$src2))), (implicit SRW)]>; def XOR16rm : I16rm<0x0, - (outs GR16:$dst), (ins GR16:$src1, memsrc:$src2), + (outs GR16:$dst), (ins GR16:$src, memsrc:$src2), "xor.w\t{$src2, $dst}", - [(set GR16:$dst, (xor GR16:$src1, (load addr:$src2))), + [(set GR16:$dst, (xor GR16:$src, (load addr:$src2))), (implicit SRW)]>; let mayLoad = 1, hasExtraDefRegAllocReq = 1, -Constraints = "$base = $base_wb, $src1 = $dst" in { +Constraints = "$base = $base_wb, $src = $dst" in { def XOR8rm_POST : IForm8<0x0, DstReg, SrcPostInc, Size2Bytes, (outs GR8:$dst, GR16:$base_wb), - (ins GR8:$src1, GR16:$base), + (ins GR8:$src, GR16:$base), "xor.b\t{@$base+, $dst}", []>; def XOR16rm_POST : IForm16<0x0, DstReg, SrcPostInc, Size2Bytes, (outs GR16:$dst, GR16:$base_wb), - (ins GR16:$src1, GR16:$base), + (ins GR16:$src, GR16:$base), "xor.w\t{@$base+, $dst}", []>; } -let isTwoAddress = 0 in { +let Constraints = "" in { def XOR8mr : I8mr<0x0, (outs), (ins memdst:$dst, GR8:$src), "xor.b\t{$src, $dst}", @@ -782,51 +782,51 @@ def SUB8rr : I8rr<0x0, - (outs GR8:$dst), (ins GR8:$src1, GR8:$src2), + (outs GR8:$dst), (ins GR8:$src, GR8:$src2), "sub.b\t{$src2, $dst}", - [(set GR8:$dst, (sub GR8:$src1, GR8:$src2)), + [(set GR8:$dst, (sub GR8:$src, GR8:$src2)), (implicit SRW)]>; def SUB16rr : I16rr<0x0, - (outs GR16:$dst), (ins GR16:$src1, GR16:$src2), + (outs GR16:$dst), (ins GR16:$src, GR16:$src2), "sub.w\t{$src2, $dst}", - [(set GR16:$dst, (sub GR16:$src1, GR16:$src2)), + [(set GR16:$dst, (sub GR16:$src, GR16:$src2)), (implicit SRW)]>; def SUB8ri : I8ri<0x0, - (outs GR8:$dst), (ins GR8:$src1, i8imm:$src2), + (outs GR8:$dst), (ins GR8:$src, i8imm:$src2), "sub.b\t{$src2, $dst}", - [(set GR8:$dst, (sub GR8:$src1, imm:$src2)), + [(set GR8:$dst, (sub GR8:$src, imm:$src2)), (implicit SRW)]>; def SUB16ri : I16ri<0x0, - (outs GR16:$dst), (ins GR16:$src1, i16imm:$src2), + (outs GR16:$dst), (ins GR16:$src, i16imm:$src2), "sub.w\t{$src2, $dst}", - [(set GR16:$dst, (sub GR16:$src1, imm:$src2)), + [(set GR16:$dst, (sub GR16:$src, imm:$src2)), (implicit SRW)]>; def SUB8rm : I8rm<0x0, - (outs GR8:$dst), (ins GR8:$src1, memsrc:$src2), + (outs GR8:$dst), (ins GR8:$src, memsrc:$src2), "sub.b\t{$src2, $dst}", - [(set GR8:$dst, (sub GR8:$src1, (load addr:$src2))), + [(set GR8:$dst, (sub GR8:$src, (load addr:$src2))), (implicit SRW)]>; def SUB16rm : I16rm<0x0, - (outs GR16:$dst), (ins GR16:$src1, memsrc:$src2), + (outs GR16:$dst), (ins GR16:$src, memsrc:$src2), "sub.w\t{$src2, $dst}", - [(set GR16:$dst, (sub GR16:$src1, (load addr:$src2))), + [(set GR16:$dst, (sub GR16:$src, (load addr:$src2))), (implicit SRW)]>; let mayLoad = 1, hasExtraDefRegAllocReq = 1, -Constraints = "$base = $base_wb, $src1 = $dst" in { +Constraints = "$base = $base_wb, $src = $dst" in { def SUB8rm_POST : IForm8<0x0, DstReg, SrcPostInc, Size2Bytes, (outs GR8:$dst, GR16:$base_wb), - (ins GR8:$src1, GR16:$base), + (ins GR8:$src, GR16:$base), "sub.b\t{@$base+, $dst}", []>; def SUB16rm_POST : IForm16<0x0, DstReg, SrcPostInc, Size2Bytes, (outs GR16:$dst, GR16:$base_wb), - (ins GR16:$src1, GR16:$base), + (ins GR16:$src, GR16:$base), "sub.w\t{@$base+, $dst}", []>; } -let isTwoAddress = 0 in { +let Constraints = "" in { def SUB8mr : I8mr<0x0, (outs), (ins memdst:$dst, GR8:$src), "sub.b\t{$src, $dst}", @@ -865,39 +865,39 @@ let Uses = [SRW] in { def SBC8rr : I8rr<0x0, - (outs GR8:$dst), (ins GR8:$src1, GR8:$src2), + (outs GR8:$dst), (ins GR8:$src, GR8:$src2), "subc.b\t{$src2, $dst}", - [(set GR8:$dst, (sube GR8:$src1, GR8:$src2)), + [(set GR8:$dst, (sube GR8:$src, GR8:$src2)), (implicit SRW)]>; def SBC16rr : I16rr<0x0, - (outs GR16:$dst), (ins GR16:$src1, GR16:$src2), + (outs GR16:$dst), (ins GR16:$src, GR16:$src2), "subc.w\t{$src2, $dst}", - [(set GR16:$dst, (sube GR16:$src1, GR16:$src2)), + [(set GR16:$dst, (sube GR16:$src, GR16:$src2)), (implicit SRW)]>; def SBC8ri : I8ri<0x0, - (outs GR8:$dst), (ins GR8:$src1, i8imm:$src2), + (outs GR8:$dst), (ins GR8:$src, i8imm:$src2), "subc.b\t{$src2, $dst}", - [(set GR8:$dst, (sube GR8:$src1, imm:$src2)), + [(set GR8:$dst, (sube GR8:$src, imm:$src2)), (implicit SRW)]>; def SBC16ri : I16ri<0x0, - (outs GR16:$dst), (ins GR16:$src1, i16imm:$src2), + (outs GR16:$dst), (ins GR16:$src, i16imm:$src2), "subc.w\t{$src2, $dst}", - [(set GR16:$dst, (sube GR16:$src1, imm:$src2)), + [(set GR16:$dst, (sube GR16:$src, imm:$src2)), (implicit SRW)]>; def SBC8rm : I8rm<0x0, - (outs GR8:$dst), (ins GR8:$src1, memsrc:$src2), + (outs GR8:$dst), (ins GR8:$src, memsrc:$src2), "subc.b\t{$src2, $dst}", - [(set GR8:$dst, (sube GR8:$src1, (load addr:$src2))), + [(set GR8:$dst, (sube GR8:$src, (load addr:$src2))), (implicit SRW)]>; def SBC16rm : I16rm<0x0, - (outs GR16:$dst), (ins GR16:$src1, memsrc:$src2), + (outs GR16:$dst), (ins GR16:$src, memsrc:$src2), "subc.w\t{$src2, $dst}", - [(set GR16:$dst, (sube GR16:$src1, (load addr:$src2))), + [(set GR16:$dst, (sube GR16:$src, (load addr:$src2))), (implicit SRW)]>; -let isTwoAddress = 0 in { +let Constraints = "" in { def SBC8mr : I8mr<0x0, (outs), (ins memdst:$dst, GR8:$src), "subc.b\t{$src, $dst}", @@ -990,59 +990,59 @@ "swpb\t$dst", [(set GR16:$dst, (bswap GR16:$src))]>; -} // isTwoAddress = 1 +} // Constraints = "$src = $dst" // Integer comparisons let Defs = [SRW] in { def CMP8rr : I8rr<0x0, - (outs), (ins GR8:$src1, GR8:$src2), - "cmp.b\t{$src2, $src1}", - [(MSP430cmp GR8:$src1, GR8:$src2), (implicit SRW)]>; + (outs), (ins GR8:$src, GR8:$src2), + "cmp.b\t{$src2, $src}", + [(MSP430cmp GR8:$src, GR8:$src2), (implicit SRW)]>; def CMP16rr : I16rr<0x0, - (outs), (ins GR16:$src1, GR16:$src2), - "cmp.w\t{$src2, $src1}", - [(MSP430cmp GR16:$src1, GR16:$src2), (implicit SRW)]>; + (outs), (ins GR16:$src, GR16:$src2), + "cmp.w\t{$src2, $src}", + [(MSP430cmp GR16:$src, GR16:$src2), (implicit SRW)]>; def CMP8ri : I8ri<0x0, - (outs), (ins GR8:$src1, i8imm:$src2), - "cmp.b\t{$src2, $src1}", - [(MSP430cmp GR8:$src1, imm:$src2), (implicit SRW)]>; + (outs), (ins GR8:$src, i8imm:$src2), + "cmp.b\t{$src2, $src}", + [(MSP430cmp GR8:$src, imm:$src2), (implicit SRW)]>; def CMP16ri : I16ri<0x0, - (outs), (ins GR16:$src1, i16imm:$src2), - "cmp.w\t{$src2, $src1}", - [(MSP430cmp GR16:$src1, imm:$src2), (implicit SRW)]>; + (outs), (ins GR16:$src, i16imm:$src2), + "cmp.w\t{$src2, $src}", + [(MSP430cmp GR16:$src, imm:$src2), (implicit SRW)]>; def CMP8mi : I8mi<0x0, - (outs), (ins memsrc:$src1, i8imm:$src2), - "cmp.b\t{$src2, $src1}", - [(MSP430cmp (load addr:$src1), + (outs), (ins memsrc:$src, i8imm:$src2), + "cmp.b\t{$src2, $src}", + [(MSP430cmp (load addr:$src), (i8 imm:$src2)), (implicit SRW)]>; def CMP16mi : I16mi<0x0, - (outs), (ins memsrc:$src1, i16imm:$src2), - "cmp.w\t{$src2, $src1}", - [(MSP430cmp (load addr:$src1), + (outs), (ins memsrc:$src, i16imm:$src2), + "cmp.w\t{$src2, $src}", + [(MSP430cmp (load addr:$src), (i16 imm:$src2)), (implicit SRW)]>; def CMP8rm : I8rm<0x0, - (outs), (ins GR8:$src1, memsrc:$src2), - "cmp.b\t{$src2, $src1}", - [(MSP430cmp GR8:$src1, (load addr:$src2)), + (outs), (ins GR8:$src, memsrc:$src2), + "cmp.b\t{$src2, $src}", + [(MSP430cmp GR8:$src, (load addr:$src2)), (implicit SRW)]>; def CMP16rm : I16rm<0x0, - (outs), (ins GR16:$src1, memsrc:$src2), - "cmp.w\t{$src2, $src1}", - [(MSP430cmp GR16:$src1, (load addr:$src2)), + (outs), (ins GR16:$src, memsrc:$src2), + "cmp.w\t{$src2, $src}", + [(MSP430cmp GR16:$src, (load addr:$src2)), (implicit SRW)]>; def CMP8mr : I8mr<0x0, - (outs), (ins memsrc:$src1, GR8:$src2), - "cmp.b\t{$src2, $src1}", - [(MSP430cmp (load addr:$src1), GR8:$src2), + (outs), (ins memsrc:$src, GR8:$src2), + "cmp.b\t{$src2, $src}", + [(MSP430cmp (load addr:$src), GR8:$src2), (implicit SRW)]>; def CMP16mr : I16mr<0x0, - (outs), (ins memsrc:$src1, GR16:$src2), - "cmp.w\t{$src2, $src1}", - [(MSP430cmp (load addr:$src1), GR16:$src2), + (outs), (ins memsrc:$src, GR16:$src2), + "cmp.w\t{$src2, $src}", + [(MSP430cmp (load addr:$src), GR16:$src2), (implicit SRW)]>; @@ -1050,71 +1050,71 @@ // Note that the C condition is set differently than when using CMP. let isCommutable = 1 in { def BIT8rr : I8rr<0x0, - (outs), (ins GR8:$src1, GR8:$src2), - "bit.b\t{$src2, $src1}", - [(MSP430cmp (and_su GR8:$src1, GR8:$src2), 0), + (outs), (ins GR8:$src, GR8:$src2), + "bit.b\t{$src2, $src}", + [(MSP430cmp (and_su GR8:$src, GR8:$src2), 0), (implicit SRW)]>; def BIT16rr : I16rr<0x0, - (outs), (ins GR16:$src1, GR16:$src2), - "bit.w\t{$src2, $src1}", - [(MSP430cmp (and_su GR16:$src1, GR16:$src2), 0), + (outs), (ins GR16:$src, GR16:$src2), + "bit.w\t{$src2, $src}", + [(MSP430cmp (and_su GR16:$src, GR16:$src2), 0), (implicit SRW)]>; } def BIT8ri : I8ri<0x0, - (outs), (ins GR8:$src1, i8imm:$src2), - "bit.b\t{$src2, $src1}", - [(MSP430cmp (and_su GR8:$src1, imm:$src2), 0), + (outs), (ins GR8:$src, i8imm:$src2), + "bit.b\t{$src2, $src}", + [(MSP430cmp (and_su GR8:$src, imm:$src2), 0), (implicit SRW)]>; def BIT16ri : I16ri<0x0, - (outs), (ins GR16:$src1, i16imm:$src2), - "bit.w\t{$src2, $src1}", - [(MSP430cmp (and_su GR16:$src1, imm:$src2), 0), + (outs), (ins GR16:$src, i16imm:$src2), + "bit.w\t{$src2, $src}", + [(MSP430cmp (and_su GR16:$src, imm:$src2), 0), (implicit SRW)]>; def BIT8rm : I8rm<0x0, - (outs), (ins GR8:$src1, memdst:$src2), - "bit.b\t{$src2, $src1}", - [(MSP430cmp (and_su GR8:$src1, (load addr:$src2)), 0), + (outs), (ins GR8:$src, memdst:$src2), + "bit.b\t{$src2, $src}", + [(MSP430cmp (and_su GR8:$src, (load addr:$src2)), 0), (implicit SRW)]>; def BIT16rm : I16rm<0x0, - (outs), (ins GR16:$src1, memdst:$src2), - "bit.w\t{$src2, $src1}", - [(MSP430cmp (and_su GR16:$src1, (load addr:$src2)), 0), + (outs), (ins GR16:$src, memdst:$src2), + "bit.w\t{$src2, $src}", + [(MSP430cmp (and_su GR16:$src, (load addr:$src2)), 0), (implicit SRW)]>; def BIT8mr : I8mr<0x0, - (outs), (ins memsrc:$src1, GR8:$src2), - "bit.b\t{$src2, $src1}", - [(MSP430cmp (and_su (load addr:$src1), GR8:$src2), 0), + (outs), (ins memsrc:$src, GR8:$src2), + "bit.b\t{$src2, $src}", + [(MSP430cmp (and_su (load addr:$src), GR8:$src2), 0), (implicit SRW)]>; def BIT16mr : I16mr<0x0, - (outs), (ins memsrc:$src1, GR16:$src2), - "bit.w\t{$src2, $src1}", - [(MSP430cmp (and_su (load addr:$src1), GR16:$src2), 0), + (outs), (ins memsrc:$src, GR16:$src2), + "bit.w\t{$src2, $src}", + [(MSP430cmp (and_su (load addr:$src), GR16:$src2), 0), (implicit SRW)]>; def BIT8mi : I8mi<0x0, - (outs), (ins memsrc:$src1, i8imm:$src2), - "bit.b\t{$src2, $src1}", - [(MSP430cmp (and_su (load addr:$src1), (i8 imm:$src2)), 0), + (outs), (ins memsrc:$src, i8imm:$src2), + "bit.b\t{$src2, $src}", + [(MSP430cmp (and_su (load addr:$src), (i8 imm:$src2)), 0), (implicit SRW)]>; def BIT16mi : I16mi<0x0, - (outs), (ins memsrc:$src1, i16imm:$src2), - "bit.w\t{$src2, $src1}", - [(MSP430cmp (and_su (load addr:$src1), (i16 imm:$src2)), 0), + (outs), (ins memsrc:$src, i16imm:$src2), + "bit.w\t{$src2, $src}", + [(MSP430cmp (and_su (load addr:$src), (i16 imm:$src2)), 0), (implicit SRW)]>; def BIT8mm : I8mm<0x0, - (outs), (ins memsrc:$src1, memsrc:$src2), - "bit.b\t{$src2, $src1}", - [(MSP430cmp (and_su (i8 (load addr:$src1)), + (outs), (ins memsrc:$src, memsrc:$src2), + "bit.b\t{$src2, $src}", + [(MSP430cmp (and_su (i8 (load addr:$src)), (load addr:$src2)), 0), (implicit SRW)]>; def BIT16mm : I16mm<0x0, - (outs), (ins memsrc:$src1, memsrc:$src2), - "bit.w\t{$src2, $src1}", - [(MSP430cmp (and_su (i16 (load addr:$src1)), + (outs), (ins memsrc:$src, memsrc:$src2), + "bit.w\t{$src2, $src}", + [(MSP430cmp (and_su (i16 (load addr:$src)), (load addr:$src2)), 0), (implicit SRW)]>; @@ -1139,12 +1139,12 @@ def : Pat<(i16 (MSP430Wrapper texternalsym:$dst)), (MOV16ri texternalsym:$dst)>; def : Pat<(i16 (MSP430Wrapper tblockaddress:$dst)), (MOV16ri tblockaddress:$dst)>; -def : Pat<(add GR16:$src1, (MSP430Wrapper tglobaladdr :$src2)), - (ADD16ri GR16:$src1, tglobaladdr:$src2)>; -def : Pat<(add GR16:$src1, (MSP430Wrapper texternalsym:$src2)), - (ADD16ri GR16:$src1, texternalsym:$src2)>; -def : Pat<(add GR16:$src1, (MSP430Wrapper tblockaddress:$src2)), - (ADD16ri GR16:$src1, tblockaddress:$src2)>; +def : Pat<(add GR16:$src, (MSP430Wrapper tglobaladdr :$src2)), + (ADD16ri GR16:$src, tglobaladdr:$src2)>; +def : Pat<(add GR16:$src, (MSP430Wrapper texternalsym:$src2)), + (ADD16ri GR16:$src, texternalsym:$src2)>; +def : Pat<(add GR16:$src, (MSP430Wrapper tblockaddress:$src2)), + (ADD16ri GR16:$src, tblockaddress:$src2)>; def : Pat<(store (i16 (MSP430Wrapper tglobaladdr:$src)), addr:$dst), (MOV16mi addr:$dst, tglobaladdr:$src)>; @@ -1160,45 +1160,45 @@ (CALLi texternalsym:$dst)>; // add and sub always produce carry -def : Pat<(addc GR16:$src1, GR16:$src2), - (ADD16rr GR16:$src1, GR16:$src2)>; -def : Pat<(addc GR16:$src1, (load addr:$src2)), - (ADD16rm GR16:$src1, addr:$src2)>; -def : Pat<(addc GR16:$src1, imm:$src2), - (ADD16ri GR16:$src1, imm:$src2)>; +def : Pat<(addc GR16:$src, GR16:$src2), + (ADD16rr GR16:$src, GR16:$src2)>; +def : Pat<(addc GR16:$src, (load addr:$src2)), + (ADD16rm GR16:$src, addr:$src2)>; +def : Pat<(addc GR16:$src, imm:$src2), + (ADD16ri GR16:$src, imm:$src2)>; def : Pat<(store (addc (load addr:$dst), GR16:$src), addr:$dst), (ADD16mr addr:$dst, GR16:$src)>; def : Pat<(store (addc (load addr:$dst), (i16 (load addr:$src))), addr:$dst), (ADD16mm addr:$dst, addr:$src)>; -def : Pat<(addc GR8:$src1, GR8:$src2), - (ADD8rr GR8:$src1, GR8:$src2)>; -def : Pat<(addc GR8:$src1, (load addr:$src2)), - (ADD8rm GR8:$src1, addr:$src2)>; -def : Pat<(addc GR8:$src1, imm:$src2), - (ADD8ri GR8:$src1, imm:$src2)>; +def : Pat<(addc GR8:$src, GR8:$src2), + (ADD8rr GR8:$src, GR8:$src2)>; +def : Pat<(addc GR8:$src, (load addr:$src2)), + (ADD8rm GR8:$src, addr:$src2)>; +def : Pat<(addc GR8:$src, imm:$src2), + (ADD8ri GR8:$src, imm:$src2)>; def : Pat<(store (addc (load addr:$dst), GR8:$src), addr:$dst), (ADD8mr addr:$dst, GR8:$src)>; def : Pat<(store (addc (load addr:$dst), (i8 (load addr:$src))), addr:$dst), (ADD8mm addr:$dst, addr:$src)>; -def : Pat<(subc GR16:$src1, GR16:$src2), - (SUB16rr GR16:$src1, GR16:$src2)>; -def : Pat<(subc GR16:$src1, (load addr:$src2)), - (SUB16rm GR16:$src1, addr:$src2)>; -def : Pat<(subc GR16:$src1, imm:$src2), - (SUB16ri GR16:$src1, imm:$src2)>; +def : Pat<(subc GR16:$src, GR16:$src2), + (SUB16rr GR16:$src, GR16:$src2)>; +def : Pat<(subc GR16:$src, (load addr:$src2)), + (SUB16rm GR16:$src, addr:$src2)>; +def : Pat<(subc GR16:$src, imm:$src2), + (SUB16ri GR16:$src, imm:$src2)>; def : Pat<(store (subc (load addr:$dst), GR16:$src), addr:$dst), (SUB16mr addr:$dst, GR16:$src)>; def : Pat<(store (subc (load addr:$dst), (i16 (load addr:$src))), addr:$dst), (SUB16mm addr:$dst, addr:$src)>; -def : Pat<(subc GR8:$src1, GR8:$src2), - (SUB8rr GR8:$src1, GR8:$src2)>; -def : Pat<(subc GR8:$src1, (load addr:$src2)), - (SUB8rm GR8:$src1, addr:$src2)>; -def : Pat<(subc GR8:$src1, imm:$src2), - (SUB8ri GR8:$src1, imm:$src2)>; +def : Pat<(subc GR8:$src, GR8:$src2), + (SUB8rr GR8:$src, GR8:$src2)>; +def : Pat<(subc GR8:$src, (load addr:$src2)), + (SUB8rm GR8:$src, addr:$src2)>; +def : Pat<(subc GR8:$src, imm:$src2), + (SUB8ri GR8:$src, imm:$src2)>; def : Pat<(store (subc (load addr:$dst), GR8:$src), addr:$dst), (SUB8mr addr:$dst, GR8:$src)>; def : Pat<(store (subc (load addr:$dst), (i8 (load addr:$src))), addr:$dst), @@ -1206,6 +1206,6 @@ // peephole patterns def : Pat<(and GR16:$src, 255), (ZEXT16r GR16:$src)>; -def : Pat<(MSP430cmp (trunc (and_su GR16:$src1, GR16:$src2)), 0), - (BIT8rr (EXTRACT_SUBREG GR16:$src1, subreg_8bit), +def : Pat<(MSP430cmp (trunc (and_su GR16:$src, GR16:$src2)), 0), + (BIT8rr (EXTRACT_SUBREG GR16:$src, subreg_8bit), (EXTRACT_SUBREG GR16:$src2, subreg_8bit))>; From echristo at apple.com Mon Jun 21 15:13:37 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 21 Jun 2010 20:13:37 -0000 Subject: [llvm-commits] [llvm] r106457 - /llvm/trunk/lib/Target/Blackfin/BlackfinInstrInfo.td Message-ID: <20100621201337.2CE3D2A6C12C@llvm.org> Author: echristo Date: Mon Jun 21 15:13:37 2010 New Revision: 106457 URL: http://llvm.org/viewvc/llvm-project?rev=106457&view=rev Log: Remove isTwoAddress from Blackfin. Modified: llvm/trunk/lib/Target/Blackfin/BlackfinInstrInfo.td Modified: llvm/trunk/lib/Target/Blackfin/BlackfinInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/BlackfinInstrInfo.td?rev=106457&r1=106456&r2=106457&view=diff ============================================================================== --- llvm/trunk/lib/Target/Blackfin/BlackfinInstrInfo.td (original) +++ llvm/trunk/lib/Target/Blackfin/BlackfinInstrInfo.td Mon Jun 21 15:13:37 2010 @@ -488,7 +488,7 @@ "$dst = $src;", []>; -let isTwoAddress = 1 in +let Constraints = "$src1 = $dst" in def MOVEcc: F1<(outs DP:$dst), (ins DP:$src1, DP:$src2, AnyCC:$cc), "if $cc $dst = $src2;", [(set DP:$dst, (select AnyCC:$cc, DP:$src2, DP:$src1))]>; @@ -645,7 +645,7 @@ // Table C-15. Bit Operations Instructions //===----------------------------------------------------------------------===// -let isTwoAddress = 1 in { +let Constraints = "$src1 = $dst" in { def BITCLR: F1<(outs D:$dst), (ins D:$src1, uimm5imask:$src2), "bitclr($dst, $src2);", [(set D:$dst, (and D:$src1, uimm5imask:$src2))]>; @@ -691,7 +691,7 @@ } let Defs = [AZ, AN, V, VS], - isTwoAddress = 1 in { + Constraints = "$src = $dst" in { defm SRA : SHIFT32>>">; defm SRL : SHIFT32>">; defm SLL : SHIFT32; @@ -748,7 +748,7 @@ "$dst = $src1 + $src2;", [(set D16:$dst, (add D16:$src1, D16:$src2))]>; -let isTwoAddress = 1 in +let Constraints = "$src1 = $dst" in def ADDimm7: F1<(outs D:$dst), (ins D:$src1, i32imm:$src2), "$dst += $src2;", [(set D:$dst, (add D:$src1, imm7:$src2))]>; @@ -775,7 +775,7 @@ def ADDpp: F1<(outs P:$dst), (ins P:$src1, P:$src2), "$dst = $src1 + $src2;", []>; -let isTwoAddress = 1 in +let Constraints = "$src1 = $dst" in def ADDpp_imm7: F1<(outs P:$dst), (ins P:$src1, i32imm:$src2), "$dst += $src2;", []>; @@ -802,7 +802,7 @@ } -let isTwoAddress = 1 in +let Constraints = "$src1 = $dst" in def MUL32: F1<(outs D:$dst), (ins D:$src1, D:$src2), "$dst *= $src2;", [(set D:$dst, (mul D:$src1, D:$src2))]>; From echristo at apple.com Mon Jun 21 15:19:21 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 21 Jun 2010 20:19:21 -0000 Subject: [llvm-commits] [llvm] r106465 - /llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Message-ID: <20100621201922.04EB12A6C12C@llvm.org> Author: echristo Date: Mon Jun 21 15:19:21 2010 New Revision: 106465 URL: http://llvm.org/viewvc/llvm-project?rev=106465&view=rev Log: Remove isTwoAddress from Mips. Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=106465&r1=106464&r2=106465&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Mon Jun 21 15:19:21 2010 @@ -541,7 +541,7 @@ def MIPS_CMOV_ZERO : PatLeaf<(i32 0)>; def MIPS_CMOV_NZERO : PatLeaf<(i32 1)>; -let Predicates = [HasCondMov], isTwoAddress = 1 in { +let Predicates = [HasCondMov], Constraints = "$F = $dst" in { def MOVN : CondMov<0x0a, "movn", MIPS_CMOV_NZERO>; def MOVZ : CondMov<0x0b, "movz", MIPS_CMOV_ZERO>; } From echristo at apple.com Mon Jun 21 15:22:36 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 21 Jun 2010 20:22:36 -0000 Subject: [llvm-commits] [llvm] r106466 - /llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td Message-ID: <20100621202236.22F8D2A6C12C@llvm.org> Author: echristo Date: Mon Jun 21 15:22:35 2010 New Revision: 106466 URL: http://llvm.org/viewvc/llvm-project?rev=106466&view=rev Log: Remove isTwoAddress from Sparc. Modified: llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td Modified: llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td?rev=106466&r1=106465&r2=106466&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td (original) +++ llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td Mon Jun 21 15:22:35 2010 @@ -665,7 +665,7 @@ //===----------------------------------------------------------------------===// // V9 Conditional Moves. -let Predicates = [HasV9], isTwoAddress = 1 in { +let Predicates = [HasV9], Constraints = "$T = $dst" in { // Move Integer Register on Condition (MOVcc) p. 194 of the V9 manual. // FIXME: Add instruction encodings for the JIT some day. def MOVICCrr From echristo at apple.com Mon Jun 21 15:25:57 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 21 Jun 2010 20:25:57 -0000 Subject: [llvm-commits] [llvm] r106467 - in /llvm/trunk/lib/Target/SystemZ: SystemZInstrFP.td SystemZInstrInfo.td Message-ID: <20100621202557.A4F002A6C12C@llvm.org> Author: echristo Date: Mon Jun 21 15:25:57 2010 New Revision: 106467 URL: http://llvm.org/viewvc/llvm-project?rev=106467&view=rev Log: Remove isTwoAddress from SystemZ. Modified: llvm/trunk/lib/Target/SystemZ/SystemZInstrFP.td llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td Modified: llvm/trunk/lib/Target/SystemZ/SystemZInstrFP.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZInstrFP.td?rev=106467&r1=106466&r2=106467&view=diff ============================================================================== --- llvm/trunk/lib/Target/SystemZ/SystemZInstrFP.td (original) +++ llvm/trunk/lib/Target/SystemZ/SystemZInstrFP.td Mon Jun 21 15:25:57 2010 @@ -126,7 +126,7 @@ (implicit PSW)]>; } -let isTwoAddress = 1 in { +let Constraints = "$src1 = $dst" in { let Defs = [PSW] in { let isCommutable = 1 in { // X = ADD Y, Z == X = ADD Z, Y def FADD32rr : Pseudo<(outs FP32:$dst), (ins FP32:$src1, FP32:$src2), @@ -237,7 +237,7 @@ "ddb\t{$dst, $src2}", [(set FP64:$dst, (fdiv FP64:$src1, (load rriaddr12:$src2)))]>; -} // isTwoAddress = 1 +} // Constraints = "$src1 = $dst" def FSQRT32rr : Pseudo<(outs FP32:$dst), (ins FP32:$src), "sqebr\t{$dst, $src}", Modified: llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td?rev=106467&r1=106466&r2=106467&view=diff ============================================================================== --- llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td (original) +++ llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td Mon Jun 21 15:25:57 2010 @@ -478,7 +478,8 @@ "lmg\t{$from, $to, $dst}", []>; -let isReMaterializable = 1, isAsCheapAsAMove = 1, isTwoAddress = 1 in { +let isReMaterializable = 1, isAsCheapAsAMove = 1, + Constraints = "$src = $dst" in { def MOV64Pr0_even : Pseudo<(outs GR64P:$dst), (ins GR64P:$src), "lhi\t${dst:subreg_even}, 0", []>; @@ -537,7 +538,7 @@ (implicit PSW)]>; } -let isTwoAddress = 1 in { +let Constraints = "$src1 = $dst" in { let Defs = [PSW] in { @@ -924,12 +925,12 @@ "dlg\t{$dst, $src2}", []>; } // mayLoad -} // isTwoAddress = 1 +} // Constraints = "$src1 = $dst" //===----------------------------------------------------------------------===// // Shifts -let isTwoAddress = 1 in +let Constraints = "$src = $dst" in def SRL32rri : RSI<0x88, (outs GR32:$dst), (ins GR32:$src, riaddr32:$amt), "srl\t{$src, $amt}", @@ -939,7 +940,7 @@ "srlg\t{$dst, $src, $amt}", [(set GR64:$dst, (srl GR64:$src, riaddr:$amt))]>; -let isTwoAddress = 1 in +let Constraints = "$src = $dst" in def SHL32rri : RSI<0x89, (outs GR32:$dst), (ins GR32:$src, riaddr32:$amt), "sll\t{$src, $amt}", @@ -950,7 +951,7 @@ [(set GR64:$dst, (shl GR64:$src, riaddr:$amt))]>; let Defs = [PSW] in { -let isTwoAddress = 1 in +let Constraints = "$src = $dst" in def SRA32rri : RSI<0x8A, (outs GR32:$dst), (ins GR32:$src, riaddr32:$amt), "sra\t{$src, $amt}", From sabre at nondot.org Mon Jun 21 15:31:30 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 21 Jun 2010 20:31:30 -0000 Subject: [llvm-commits] [llvm] r106468 - in /llvm/trunk/docs/tutorial: LangImpl6.html OCamlLangImpl6.html Message-ID: <20100621203130.95F552A6C12C@llvm.org> Author: lattner Date: Mon Jun 21 15:31:30 2010 New Revision: 106468 URL: http://llvm.org/viewvc/llvm-project?rev=106468&view=rev Log: fix typos reported by Adam Warner! Modified: llvm/trunk/docs/tutorial/LangImpl6.html llvm/trunk/docs/tutorial/OCamlLangImpl6.html Modified: llvm/trunk/docs/tutorial/LangImpl6.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl6.html?rev=106468&r1=106467&r2=106468&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl6.html (original) +++ llvm/trunk/docs/tutorial/LangImpl6.html Mon Jun 21 15:31:30 2010 @@ -531,7 +531,7 @@ def unary-(v) 0-v; -# Define > with the same precedence as >. +# Define > with the same precedence as <. def binary> 10 (LHS RHS) RHS < LHS; Modified: llvm/trunk/docs/tutorial/OCamlLangImpl6.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl6.html?rev=106468&r1=106467&r2=106468&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl6.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl6.html Mon Jun 21 15:31:30 2010 @@ -512,7 +512,7 @@ def unary-(v) 0-v; -# Define > with the same precedence as >. +# Define > with the same precedence as <. def binary> 10 (LHS RHS) RHS < LHS; From sabre at nondot.org Mon Jun 21 15:35:01 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 21 Jun 2010 20:35:01 -0000 Subject: [llvm-commits] [llvm] r106469 - /llvm/trunk/lib/MC/MCAsmStreamer.cpp Message-ID: <20100621203501.E2C8C2A6C12C@llvm.org> Author: lattner Date: Mon Jun 21 15:35:01 2010 New Revision: 106469 URL: http://llvm.org/viewvc/llvm-project?rev=106469&view=rev Log: "This is just a cosmetic change in MCAsmStreamer.cpp/EmitSymbolAttribute: all attributes have now a \t before and after, as done for '.type'. This makes the output look consistent, as well as help some third party assemblers expecting the attributes to be in the second column." Patch by Arnaud de Grandmaison! Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=106469&r1=106468&r2=106469&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Mon Jun 21 15:35:01 2010 @@ -275,17 +275,17 @@ case MCSA_Global: // .globl/.global OS << MAI.getGlobalDirective(); break; - case MCSA_Hidden: OS << ".hidden "; break; - case MCSA_IndirectSymbol: OS << ".indirect_symbol "; break; - case MCSA_Internal: OS << ".internal "; break; - case MCSA_LazyReference: OS << ".lazy_reference "; break; - case MCSA_Local: OS << ".local "; break; - case MCSA_NoDeadStrip: OS << ".no_dead_strip "; break; - case MCSA_PrivateExtern: OS << ".private_extern "; break; - case MCSA_Protected: OS << ".protected "; break; - case MCSA_Reference: OS << ".reference "; break; - case MCSA_Weak: OS << ".weak "; break; - case MCSA_WeakDefinition: OS << ".weak_definition "; break; + case MCSA_Hidden: OS << "\t.hidden\t"; break; + case MCSA_IndirectSymbol: OS << "\t.indirect_symbol\t"; break; + case MCSA_Internal: OS << "\t.internal\t"; break; + case MCSA_LazyReference: OS << "\t.lazy_reference\t"; break; + case MCSA_Local: OS << "\t.local\t"; break; + case MCSA_NoDeadStrip: OS << "\t.no_dead_strip\t"; break; + case MCSA_PrivateExtern: OS << "\t.private_extern\t"; break; + case MCSA_Protected: OS << "\t.protected\t"; break; + case MCSA_Reference: OS << "\t.reference\t"; break; + case MCSA_Weak: OS << "\t.weak\t"; break; + case MCSA_WeakDefinition: OS << "\t.weak_definition\t"; break; // .weak_reference case MCSA_WeakReference: OS << MAI.getWeakRefDirective(); break; } From echristo at apple.com Mon Jun 21 15:35:09 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 21 Jun 2010 20:35:09 -0000 Subject: [llvm-commits] [llvm] r106470 - in /llvm/trunk: docs/TableGenFundamentals.html include/llvm/Target/Target.td utils/TableGen/CodeGenInstruction.cpp Message-ID: <20100621203509.B85652A6C12C@llvm.org> Author: echristo Date: Mon Jun 21 15:35:09 2010 New Revision: 106470 URL: http://llvm.org/viewvc/llvm-project?rev=106470&view=rev Log: Remove isTwoAddress from llvm. Modified: llvm/trunk/docs/TableGenFundamentals.html llvm/trunk/include/llvm/Target/Target.td llvm/trunk/utils/TableGen/CodeGenInstruction.cpp Modified: llvm/trunk/docs/TableGenFundamentals.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/TableGenFundamentals.html?rev=106470&r1=106469&r2=106470&view=diff ============================================================================== --- llvm/trunk/docs/TableGenFundamentals.html (original) +++ llvm/trunk/docs/TableGenFundamentals.html Mon Jun 21 15:35:09 2010 @@ -144,7 +144,6 @@ bit mayLoad = 0; bit mayStore = 0; bit isImplicitDef = 0; - bit isTwoAddress = 1; bit isConvertibleToThreeAddress = 1; bit isCommutable = 1; bit isTerminator = 0; Modified: llvm/trunk/include/llvm/Target/Target.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/Target.td?rev=106470&r1=106469&r2=106470&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/Target.td (original) +++ llvm/trunk/include/llvm/Target/Target.td Mon Jun 21 15:35:09 2010 @@ -203,7 +203,6 @@ bit canFoldAsLoad = 0; // Can this be folded as a simple memory operand? bit mayLoad = 0; // Is it possible for this inst to read memory? bit mayStore = 0; // Is it possible for this inst to write memory? - bit isTwoAddress = 0; // Is this a two address instruction? bit isConvertibleToThreeAddress = 0; // Can this 2-addr instruction promote? bit isCommutable = 0; // Is this 3 operand instruction commutable? bit isTerminator = 0; // Is this part of the terminator for a basic block? Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.cpp?rev=106470&r1=106469&r2=106470&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenInstruction.cpp (original) +++ llvm/trunk/utils/TableGen/CodeGenInstruction.cpp Mon Jun 21 15:35:09 2010 @@ -107,7 +107,6 @@ canFoldAsLoad = R->getValueAsBit("canFoldAsLoad"); mayLoad = R->getValueAsBit("mayLoad"); mayStore = R->getValueAsBit("mayStore"); - bool isTwoAddress = R->getValueAsBit("isTwoAddress"); isPredicable = R->getValueAsBit("isPredicable"); isConvertibleToThreeAddress = R->getValueAsBit("isConvertibleToThreeAddress"); isCommutable = R->getValueAsBit("isCommutable"); @@ -212,16 +211,6 @@ // Parse Constraints. ParseConstraints(R->getValueAsString("Constraints"), this); - // For backward compatibility: isTwoAddress means operand 1 is tied to - // operand 0. - if (isTwoAddress) { - if (!OperandList[1].Constraints[0].isNone()) - throw R->getName() + ": cannot use isTwoAddress property: instruction " - "already has constraint set!"; - OperandList[1].Constraints[0] = - CodeGenInstruction::ConstraintInfo::getTied(0); - } - // Parse the DisableEncoding field. std::string DisableEncoding = R->getValueAsString("DisableEncoding"); while (1) { From sabre at nondot.org Mon Jun 21 15:36:09 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 21 Jun 2010 20:36:09 -0000 Subject: [llvm-commits] [llvm] r106471 - /llvm/trunk/docs/WritingAnLLVMPass.html Message-ID: <20100621203609.782CC2A6C12C@llvm.org> Author: lattner Date: Mon Jun 21 15:36:09 2010 New Revision: 106471 URL: http://llvm.org/viewvc/llvm-project?rev=106471&view=rev Log: This makes example Makefile a lot more like actual lib/Transforms/Hello/Makefile, and prevents a lot of errors like "Assertion `Inserted && "Pass registered multiple times!"' failed" Patch by Gregory Petrosyan! Modified: llvm/trunk/docs/WritingAnLLVMPass.html Modified: llvm/trunk/docs/WritingAnLLVMPass.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMPass.html?rev=106471&r1=106470&r2=106471&view=diff ============================================================================== --- llvm/trunk/docs/WritingAnLLVMPass.html (original) +++ llvm/trunk/docs/WritingAnLLVMPass.html Mon Jun 21 15:36:09 2010 @@ -189,11 +189,6 @@ # dlopen/dlsym on the resulting library. LOADABLE_MODULE = 1 -# Tell the build system which LLVM libraries your pass needs. You'll probably -# need at least LLVMSystem.a, LLVMSupport.a, LLVMCore.a but possibly several -# others too. -LLVMLIBS = LLVMCore.a LLVMSupport.a LLVMSystem.a - # Include the makefile implementation stuff include $(LEVEL)/Makefile.common From wdietz2 at illinois.edu Mon Jun 21 15:52:30 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Mon, 21 Jun 2010 20:52:30 -0000 Subject: [llvm-commits] [poolalloc] r106474 - in /poolalloc/trunk: include/dsa/DSGraph.h include/dsa/DSNode.h include/dsa/DSSupport.h lib/DSA/BottomUpClosure.cpp lib/DSA/DSGraph.cpp lib/DSA/DataStructure.cpp lib/DSA/Local.cpp lib/DSA/Makefile lib/DSA/Printer.cpp lib/DSA/TopDownClosure.cpp Message-ID: <20100621205230.7DE6A2A6C12C@llvm.org> Author: wdietz2 Date: Mon Jun 21 15:52:30 2010 New Revision: 106474 URL: http://llvm.org/viewvc/llvm-project?rev=106474&view=rev Log: Improve var-arg support in DSA Modified: poolalloc/trunk/include/dsa/DSGraph.h poolalloc/trunk/include/dsa/DSNode.h poolalloc/trunk/include/dsa/DSSupport.h poolalloc/trunk/lib/DSA/BottomUpClosure.cpp poolalloc/trunk/lib/DSA/DSGraph.cpp poolalloc/trunk/lib/DSA/DataStructure.cpp poolalloc/trunk/lib/DSA/Local.cpp poolalloc/trunk/lib/DSA/Makefile poolalloc/trunk/lib/DSA/Printer.cpp poolalloc/trunk/lib/DSA/TopDownClosure.cpp Modified: poolalloc/trunk/include/dsa/DSGraph.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DSGraph.h?rev=106474&r1=106473&r2=106474&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DSGraph.h (original) +++ poolalloc/trunk/include/dsa/DSGraph.h Mon Jun 21 15:52:30 2010 @@ -18,6 +18,7 @@ #include "dsa/DSNode.h" #include "dsa/DSCallGraph.h" #include "llvm/ADT/EquivalenceClasses.h" +#include "llvm/Function.h" #include #include @@ -195,6 +196,7 @@ // Public data-type declarations... typedef DSScalarMap ScalarMapTy; typedef std::map ReturnNodesTy; + typedef std::map VANodesTy; typedef ilist NodeListTy; /// NodeMapTy - This data type is used when cloning one graph into another to @@ -218,6 +220,10 @@ // ReturnNodesTy ReturnNodes; + // VANodes - Special "Variable Argument" Node for each function + // + VANodesTy VANodes; + // FunctionCalls - This list maintains a single entry for each call // instruction in the current graph. The first entry in the vector is the // scalar that holds the return value for the call, the second is the function @@ -377,6 +383,10 @@ typedef ReturnNodesTy::const_iterator retnodes_iterator; retnodes_iterator retnodes_begin() const { return ReturnNodes.begin(); } retnodes_iterator retnodes_end() const { return ReturnNodes.end(); } + + typedef VANodesTy::const_iterator vanodes_iterator; + vanodes_iterator vanodes_begin() const { return VANodes.begin(); } + vanodes_iterator vanodes_end() const { return VANodes.end(); } /// getReturnNodes - Return the mapping of functions to their return nodes for @@ -399,10 +409,28 @@ return I->second; } + /// getVANodeFor - Return the var-arg node for the specified function. + /// + DSNodeHandle &getVANodeFor(const Function &F) { + VANodesTy::iterator I = VANodes.find(&F); + assert(I != VANodes.end() && "Var-arg info for F not in this graph!"); + return I->second; + } + + const DSNodeHandle &getVANodeFor(const Function &F) const { + VANodesTy::const_iterator I = VANodes.find(&F); + assert(I != VANodes.end() && "Var-arg info for F not in this graph!"); + return I->second; + } + DSNodeHandle& getOrCreateReturnNodeFor(const Function& F) { return ReturnNodes[&F]; } + DSNodeHandle& getOrCreateVANodeFor(const Function& F) { + return VANodes[&F]; + } + /// containsFunction - Return true if this DSGraph contains information for /// the specified function. bool containsFunction(const Function *F) const { Modified: poolalloc/trunk/include/dsa/DSNode.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DSNode.h?rev=106474&r1=106473&r2=106474&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DSNode.h (original) +++ poolalloc/trunk/include/dsa/DSNode.h Mon Jun 21 15:52:30 2010 @@ -103,7 +103,7 @@ ExternalNode = 1 << 11, // This node comes from an external source IntToPtrNode = 1 << 12, // This node comes from an int cast PtrToIntNode = 1 << 13, // This node excapes to an int cast - VAStartNode = 1 << 14, // This node excapes to an int cast + VAStartNode = 1 << 14, // This node is from a vastart call //#ifndef NDEBUG DeadNode = 1 << 15, // This node is dead and should not be pointed to Modified: poolalloc/trunk/include/dsa/DSSupport.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DSSupport.h?rev=106474&r1=106473&r2=106474&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DSSupport.h (original) +++ poolalloc/trunk/include/dsa/DSSupport.h Mon Jun 21 15:52:30 2010 @@ -25,6 +25,7 @@ namespace llvm { class Function; +class FunctionType; class CallInst; class Value; class GlobalValue; @@ -158,6 +159,7 @@ const Function *CalleeF; // The function called (direct call) DSNodeHandle CalleeN; // The function node called (indirect call) DSNodeHandle RetVal; // Returned value + DSNodeHandle VarArgVal; // Merged var-arg val std::vector CallArgs; // The pointer arguments static void InitNH(DSNodeHandle &NH, const DSNodeHandle &Src, @@ -189,22 +191,23 @@ /// Constructor. Note - This ctor destroys the argument vector passed in. On /// exit, the argument vector is empty. /// - DSCallSite(CallSite CS, const DSNodeHandle &rv, DSNode *Callee, - std::vector &Args) - : Site(CS), CalleeF(0), CalleeN(Callee), RetVal(rv) { + DSCallSite(CallSite CS, const DSNodeHandle &rv, const DSNodeHandle &va, + DSNode *Callee, std::vector &Args) + : Site(CS), CalleeF(0), CalleeN(Callee), RetVal(rv), VarArgVal(va) { assert(Callee && "Null callee node specified for call site!"); Args.swap(CallArgs); } - DSCallSite(CallSite CS, const DSNodeHandle &rv, const Function *Callee, - std::vector &Args) - : Site(CS), CalleeF(Callee), RetVal(rv) { + DSCallSite(CallSite CS, const DSNodeHandle &rv, const DSNodeHandle &va, + const Function *Callee, std::vector &Args) + : Site(CS), CalleeF(Callee), RetVal(rv), VarArgVal(va) { assert(Callee && "Null callee function specified for call site!"); Args.swap(CallArgs); } DSCallSite(const DSCallSite &DSCS) // Simple copy ctor : Site(DSCS.Site), CalleeF(DSCS.CalleeF), CalleeN(DSCS.CalleeN), - RetVal(DSCS.RetVal), CallArgs(DSCS.CallArgs) {} + RetVal(DSCS.RetVal), VarArgVal(DSCS.VarArgVal), + CallArgs(DSCS.CallArgs) {} /// Mapping copy constructor - This constructor takes a preexisting call site /// to copy plus a map that specifies how the links should be transformed. @@ -215,6 +218,7 @@ Site = FromCall.Site; InitNH(RetVal, FromCall.RetVal, NodeMap); InitNH(CalleeN, FromCall.CalleeN, NodeMap); + InitNH(VarArgVal, FromCall.VarArgVal, NodeMap); CalleeF = FromCall.CalleeF; CallArgs.resize(FromCall.CallArgs.size()); @@ -227,6 +231,7 @@ CalleeF = RHS.CalleeF; CalleeN = RHS.CalleeN; RetVal = RHS.RetVal; + VarArgVal = RHS.VarArgVal; CallArgs = RHS.CallArgs; return *this; } @@ -244,6 +249,8 @@ CallSite getCallSite() const { return Site; } DSNodeHandle &getRetVal() { return RetVal; } const DSNodeHandle &getRetVal() const { return RetVal; } + DSNodeHandle &getVAVal() { return VarArgVal; } + const DSNodeHandle &getVAVal() const { return VarArgVal; } DSNode *getCalleeNode() const { assert(!CalleeF && CalleeN.getNode()); return CalleeN.getNode(); @@ -271,6 +278,7 @@ if (this != &CS) { std::swap(Site, CS.Site); std::swap(RetVal, CS.RetVal); + std::swap(VarArgVal, CS.VarArgVal); std::swap(CalleeN, CS.CalleeN); std::swap(CalleeF, CS.CalleeF); std::swap(CallArgs, CS.CallArgs); @@ -282,6 +290,7 @@ /// void mergeWith(DSCallSite &CS) { getRetVal().mergeWith(CS.getRetVal()); + getVAVal().mergeWith(CS.getVAVal()); unsigned MinArgs = getNumPtrArgs(); if (CS.getNumPtrArgs() < MinArgs) MinArgs = CS.getNumPtrArgs(); @@ -310,13 +319,26 @@ } if (RetVal < CS.RetVal) return true; if (RetVal > CS.RetVal) return false; + if (VarArgVal < CS.VarArgVal) return true; + if (VarArgVal > CS.VarArgVal) return false; return CallArgs < CS.CallArgs; } bool operator==(const DSCallSite &CS) const { return CalleeF == CS.CalleeF && CalleeN == CS.CalleeN && - RetVal == CS.RetVal && CallArgs == CS.CallArgs; + RetVal == CS.RetVal && CallArgs == CS.CallArgs && + VarArgVal == CS.VarArgVal; } + + /// FunctionTypeOfCallSite - Helper method to extract the signature of a function + /// that is called a given CallSite + /// + static const FunctionType *FunctionTypeOfCallSite(const CallSite & Site); + + /// isVarArg - Determines if the call this represents is to a variable argument + /// function + /// + bool isVarArg() const; }; } // End llvm namespace Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=106474&r1=106473&r2=106474&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original) +++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Mon Jun 21 15:52:30 2010 @@ -58,8 +58,10 @@ // entry-points correctly. As a bonus, we can be more aggressive at propagating // information upwards, as long as we don't remove unresolved call sites. bool BUDataStructures::runOnModuleInternal(Module& M) { +#if 0 llvm::errs() << "BU is currently being worked in in very invasive ways.\n" << "It is probably broken right now\n"; +#endif //Find SCCs and make SCC call graph callgraph.buildSCCs(); @@ -248,6 +250,7 @@ for (std::set::iterator ii = BadCalls.begin(), ee = BadCalls.end(); ii != ee; ++ii) { ii->getRetVal().getNode()->markReachableNodes(reachable); + ii->getVAVal().getNode()->markReachableNodes(reachable); for (unsigned x = 0; x < ii->getNumPtrArgs(); ++x) ii->getPtrArg(x).getNode()->markReachableNodes(reachable); } @@ -339,7 +342,7 @@ // Fast path for noop calls. Note that we don't care about merging globals // in the callee with nodes in the caller here. - if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0) { + if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0 && !CS.isVarArg()) { TempFCs.erase(TempFCs.begin()); continue; } Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=106474&r1=106473&r2=106474&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSGraph.cpp (original) +++ poolalloc/trunk/lib/DSA/DSGraph.cpp Mon Jun 21 15:52:30 2010 @@ -84,6 +84,7 @@ AuxFunctionCalls.clear(); ScalarMap.clear(); ReturnNodes.clear(); + VANodes.clear(); // Drop all intra-node references, so that assertions don't fail... for (node_iterator NI = node_begin(), E = node_end(); NI != E; ++NI) @@ -137,8 +138,8 @@ /// cloneInto - Clone the specified DSGraph into the current graph. The /// translated ScalarMap for the old function is filled into the ScalarMap -/// for the graph, and the translated ReturnNodes map is returned into -/// ReturnNodes. +/// for the graph, the translated ReturnNodes map is returned into +/// ReturnNodes, and the translated VANodes map is return into VANodes. /// /// The CloneFlags member controls various aspects of the cloning process. /// @@ -208,6 +209,17 @@ DSNodeHandle(MappedRetN, MappedRet.getOffset()+Ret.getOffset()))); } + + // Map the VA node pointers over... + for (vanodes_iterator I = G->vanodes_begin(), + E = G->vanodes_end(); I != E; ++I) { + const DSNodeHandle &VarArg = I->second; + DSNodeHandle &MappedVarArg = OldNodeMap[VarArg.getNode()]; + DSNode *MappedVarArgN = MappedVarArg.getNode(); + VANodes.insert(std::make_pair(I->first, + DSNodeHandle(MappedVarArgN, + MappedVarArg.getOffset()+VarArg.getOffset()))); + } } /// spliceFrom - Logically perform the operation of cloning the RHS graph into @@ -235,6 +247,14 @@ RHS->ReturnNodes.clear(); } + // Same for the VA nodes + if (VANodes.empty()) { + VANodes.swap(RHS->VANodes); + } else { + VANodes.insert(RHS->VANodes.begin(), RHS->VANodes.end()); + RHS->VANodes.clear(); + } + // Merge the scalar map in. ScalarMap.spliceFrom(RHS->ScalarMap); } @@ -242,11 +262,12 @@ /// getFunctionArgumentsForCall - Given a function that is currently in this /// graph, return the DSNodeHandles that correspond to the pointer-compatible /// function arguments. The vector is filled in with the return value (or -/// null if it is not pointer compatible), followed by all of the -/// pointer-compatible arguments. +/// null if it is not pointer compatible), a vararg node (null if not +/// applicable) followed by all of the pointer-compatible arguments. void DSGraph::getFunctionArgumentsForCall(const Function *F, std::vector &Args) const { Args.push_back(getReturnNodeFor(*F)); + Args.push_back(getVANodeFor(*F)); for (Function::const_arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; ++AI) if (isa(AI->getType())) { @@ -287,6 +308,8 @@ for (unsigned i = 0, e = CS.getNumPtrArgs(); i != e; ++i) if (PathExistsToClonedNode(CS.getPtrArg(i).getNode())) return true; + if (PathExistsToClonedNode(CS.getVAVal().getNode())) + return true; return false; } }; @@ -378,13 +401,16 @@ // Merge the return value with the return value of the context. Args[0].mergeWith(CS.getRetVal()); + // Merge var-arg node + Args[1].mergeWith(CS.getVAVal()); + // Resolve all of the function arguments. for (unsigned i = 0, e = CS.getNumPtrArgs(); i != e; ++i) { - if (i == Args.size()-1) + if (i == Args.size()-2) break; // Add the link from the argument scalar to the provided value. - Args[i+1].mergeWith(CS.getPtrArg(i)); + Args[i+2].mergeWith(CS.getPtrArg(i)); } return; } @@ -398,13 +424,17 @@ if (!CS.getRetVal().isNull()) RC.merge(CS.getRetVal(), Args[0]); + // Map the variable arguments + if (!CS.getVAVal().isNull()) + RC.merge(CS.getVAVal(), Args[1]); + // Map over all of the arguments. for (unsigned i = 0, e = CS.getNumPtrArgs(); i != e; ++i) { - if (i == Args.size()-1) + if (i == Args.size()-2) break; // Add the link from the argument scalar to the provided value. - RC.merge(CS.getPtrArg(i), Args[i+1]); + RC.merge(CS.getPtrArg(i), Args[i+2]); } // We generally don't want to copy global nodes or aux calls from the callee @@ -479,34 +509,42 @@ if (isa(I->getType())) Args.push_back(getNodeForValue(I)); - return DSCallSite(CallSite(), getReturnNodeFor(F), &F, Args); + return DSCallSite(CallSite(), getReturnNodeFor(F), getVANodeFor(F), &F, Args); } /// getDSCallSiteForCallSite - Given an LLVM CallSite object that is live in /// the context of this graph, return the DSCallSite for it. DSCallSite DSGraph::getDSCallSiteForCallSite(CallSite CS) const { - DSNodeHandle RetVal; + DSNodeHandle RetVal, VarArg; Instruction *I = CS.getInstruction(); if (isa(I->getType())) RetVal = getNodeForValue(I); + //FIXME: Here we trust the signature of the callsite to determine which arguments + //are var-arg and which are fixed. Apparently we can't assume this, but I'm not sure + //of a better way. For now, this assumption is known limitation. + const FunctionType *CalleeFuncType = DSCallSite::FunctionTypeOfCallSite(CS); + unsigned NumFixedArgs = CalleeFuncType->getNumParams(); + std::vector Args; Args.reserve(CS.arg_end()-CS.arg_begin()); // Calculate the arguments vector... for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I) if (isa((*I)->getType())) { - if (isa(*I)) - Args.push_back(DSNodeHandle()); - else - Args.push_back(getNodeForValue(*I)); + const DSNodeHandle ArgNode = getNodeForValue(*I); + if (I - CS.arg_begin() < NumFixedArgs) { + Args.push_back(ArgNode); + } else { + VarArg.mergeWith(ArgNode); + } } // Add a new function call entry... if (Function *F = CS.getCalledFunction()) - return DSCallSite(CS, RetVal, F, Args); + return DSCallSite(CS, RetVal, VarArg, F, Args); else - return DSCallSite(CS, RetVal, + return DSCallSite(CS, RetVal, VarArg, getNodeForValue(CS.getCalledValue()).getNode(), Args); } @@ -535,6 +573,8 @@ // Then the return value is certainly incomplete! markIncompleteNode(Call.getRetVal().getNode()); + markIncompleteNode(Call.getVAVal().getNode()); + // All objects pointed to by function arguments are incomplete! for (unsigned i = 0, e = Call.getNumPtrArgs(); i != e; ++i) markIncompleteNode(Call.getPtrArg(i).getNode()); @@ -552,7 +592,7 @@ // void DSGraph::markIncompleteNodes(unsigned Flags) { // Mark any incoming arguments as incomplete. - if (Flags & DSGraph::MarkFormalArgs) + if (Flags & DSGraph::MarkFormalArgs) { for (ReturnNodesTy::iterator FI = ReturnNodes.begin(), E =ReturnNodes.end(); FI != E; ++FI) { const Function &F = *FI->first; @@ -562,6 +602,11 @@ markIncompleteNode(getNodeForValue(I).getNode()); markIncompleteNode(FI->second.getNode()); } + // Mark all vanodes as incomplete (they are also arguments) + for (vanodes_iterator I = vanodes_begin(), E = vanodes_end(); + I != E; ++I) + markIncompleteNode(I->second.getNode()); + } // Mark stuff passed into functions calls as being incomplete. if (!shouldPrintAuxCalls()) @@ -667,6 +712,7 @@ // to it, remove the edge to the node (killing the node). // killIfUselessEdge(CS.getRetVal()); + killIfUselessEdge(CS.getVAVal()); for (unsigned a = 0, e = CS.getNumPtrArgs(); a != e; ++a) killIfUselessEdge(CS.getPtrArg(a)); @@ -883,6 +929,8 @@ if (CanReachAliveNodes(CS.getRetVal().getNode(), Alive, Visited, IgnoreGlobals)) return true; + if (CanReachAliveNodes(CS.getVAVal().getNode(), Alive, Visited, IgnoreGlobals)) + return true; if (CS.isIndirectCall() && CanReachAliveNodes(CS.getCalleeNode(), Alive, Visited, IgnoreGlobals)) return true; @@ -1059,6 +1107,7 @@ #endif } AssertNodeInGraph(CS.getRetVal().getNode()); + AssertNodeInGraph(CS.getVAVal().getNode()); for (unsigned j = 0, e = CS.getNumPtrArgs(); j != e; ++j) AssertNodeInGraph(CS.getPtrArg(j).getNode()); } @@ -1099,6 +1148,9 @@ if (isa(AI->getType())) assert(!getNodeForValue(AI).isNull() && "Pointer argument must be in the scalar map!"); + if (F.isVarArg()) + assert(VANodes.find(&F) != VANodes.end() && + "VarArg function missing VANode!"); } } @@ -1186,6 +1238,7 @@ CalleeGraph.getCallSiteForArguments(const_cast(Callee)); computeNodeMapping(CalleeArgs.getRetVal(), CS.getRetVal(), NodeMap); + computeNodeMapping(CalleeArgs.getVAVal(), CS.getVAVal(), NodeMap); unsigned NumArgs = CS.getNumPtrArgs(); if (NumArgs > CalleeArgs.getNumPtrArgs()) Modified: poolalloc/trunk/lib/DSA/DataStructure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructure.cpp?rev=106474&r1=106473&r2=106474&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DataStructure.cpp (original) +++ poolalloc/trunk/lib/DSA/DataStructure.cpp Mon Jun 21 15:52:30 2010 @@ -813,6 +813,7 @@ void ReachabilityCloner::mergeCallSite(DSCallSite &DestCS, const DSCallSite &SrcCS) { merge(DestCS.getRetVal(), SrcCS.getRetVal()); + merge(DestCS.getVAVal(), SrcCS.getVAVal()); unsigned MinArgs = DestCS.getNumPtrArgs(); if (SrcCS.getNumPtrArgs() < MinArgs) MinArgs = SrcCS.getNumPtrArgs(); @@ -830,11 +831,13 @@ if (SrcCS.isDirectCall()) return DSCallSite(SrcCS.getCallSite(), getClonedNH(SrcCS.getRetVal()), + getClonedNH(SrcCS.getVAVal()), SrcCS.getCalleeFunc(), Args); else return DSCallSite(SrcCS.getCallSite(), getClonedNH(SrcCS.getRetVal()), + getClonedNH(SrcCS.getVAVal()), getClonedNH(SrcCS.getCalleeNode()).getNode(), Args); } @@ -853,6 +856,39 @@ NH = RC.getClonedNH(Src); } +/// FunctionTypeOfCallSite - Helper method to extract the signature of a function +/// that is called a given CallSite +/// +const FunctionType *DSCallSite::FunctionTypeOfCallSite(const CallSite & Site) { + Value *Callee = Site.getCalledValue(); + + // Direct call, simple + if (Function *F = dyn_cast(Callee)) + return F->getFunctionType(); + + // Indirect call, extract the type + const FunctionType *CalleeFuncType = NULL; + + const PointerType *CalleeType = dyn_cast(Callee->getType()); + if (!CalleeType) { + assert(0 && "Call through a non-pointer type?"); + } else { + CalleeFuncType = dyn_cast(CalleeType->getElementType()); + assert(CalleeFuncType && + "Call through pointer to non-function?"); + } + + return CalleeFuncType; +} + +/// isVarArg - Determines if the call this represents is to a variable argument +/// function +/// +bool DSCallSite::isVarArg() const { + const FunctionType *FT = FunctionTypeOfCallSite(Site); + return FT->isVarArg(); +} + /// remapLinks - Change all of the Links in the current node according to the /// specified mapping. /// @@ -897,6 +933,8 @@ return true; if (CS.isDirectCall() || PathExistsToClonedNode(CS.getCalleeNode())) return true; + if (PathExistsToClonedNode(CS.getVAVal().getNode())) + return true; for (unsigned i = 0, e = CS.getNumPtrArgs(); i != e; ++i) if (PathExistsToClonedNode(CS.getPtrArg(i).getNode())) return true; @@ -990,6 +1028,7 @@ void DSCallSite::markReachableNodes(DenseSet &Nodes) const { getRetVal().getNode()->markReachableNodes(Nodes); + getVAVal().getNode()->markReachableNodes(Nodes); if (isIndirectCall()) getCalleeNode()->markReachableNodes(Nodes); for (unsigned i = 0, e = getNumPtrArgs(); i != e; ++i) Modified: poolalloc/trunk/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=106474&r1=106473&r2=106474&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Local.cpp (original) +++ poolalloc/trunk/lib/DSA/Local.cpp Mon Jun 21 15:52:30 2010 @@ -29,6 +29,7 @@ #include "llvm/Support/Timer.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/Triple.h" #include @@ -148,6 +149,8 @@ bool visitIntrinsic(CallSite CS, Function* F); void visitCallSite(CallSite CS); + void visitVAStartInst(CallSite CS); + void visitVAStartNode(DSNode* N); public: GraphBuilder(Function &f, DSGraph &g, DataStructures& DSi) @@ -168,6 +171,9 @@ // the graph g.getOrCreateReturnNodeFor(f); + // Create a node to handle information about variable arguments + g.getOrCreateVANodeFor(f); + visit(f); // Single pass over the function // If there are any constant globals referenced in this function, merge @@ -391,6 +397,7 @@ } void GraphBuilder::visitVAArgInst(VAArgInst &I) { + assert(0 && "What frontend generates this?"); //FIXME: also updates the argument DSNodeHandle Ptr = getValueDest(I.getOperand(0)); if (Ptr.isNull()) return; @@ -604,45 +611,105 @@ visitCallSite(&II); } +void GraphBuilder::visitVAStartInst(CallSite CS) { + // Build out DSNodes for the va_list depending on the target arch + // And assosiate the right node with the VANode for this function + // so it can be merged with the right arguments from callsites + + DSNodeHandle RetNH = getValueDest(*CS.arg_begin()); + + if (DSNode *N = RetNH.getNode()) + visitVAStartNode(N); + else + { + // + // Sometimes the argument to the vastart is casted and has no DSNode. + // Peer past the cast. + // + Value * Operand = CS.getInstruction()->getOperand(1); + if (CastInst * CI = dyn_cast(Operand)) + Operand = CI->getOperand (0); + const DSNodeHandle & CastNH = getValueDest(Operand); + visitVAStartNode(CastNH.getNode()); + //We assert out here because it's not clear when this happens + assert(0 && "When does this happen?"); + } +} + +void GraphBuilder::visitVAStartNode(DSNode* N) { + assert(FB && "No function for this graph?"); + Module *M = FB->getParent(); + assert(M && "No module for function"); + Triple TargetTriple(M->getTargetTriple()); + Triple::ArchType Arch = TargetTriple.getArch(); + + // Fetch the VANode associated with the func containing the call to va_start + DSNodeHandle & VANH = G.getVANodeFor(*FB); + // Make sure this NodeHandle has a node to go with it + if (VANH.isNull()) VANH.mergeWith(createNode()); + + // Create a dsnode for an array of pointers to the VAInfo for this func + DSNode * VAArray = createNode(); + VAArray->setArrayMarker(); + VAArray->foldNodeCompletely(); + VAArray->setLink(0,VANH); + + //VAStart modifies its argument + N->setModifiedMarker(); + + // For the architectures we support, build dsnodes that match + // how we know va_list is used. + switch (Arch) { + case Triple::x86: + // On x86, we have: + // va_list as a pointer to an array of pointers to the variable arguments + N->growSize(1); + N->setLink(0, VAArray); + break; + case Triple::x86_64: + // On x86_64, we have va_list as a struct {i32, i32, i8*, i8* } + // The first i8* is where arguments generally go, but the second i8* can be used + // also to pass arguments by register. + // We model this by having both the i8*'s point to an array of pointers to the arguments. + N->growSize(24); //sizeof the va_list struct mentioned above + N->setLink(8,VAArray); //first i8* + N->setLink(16,VAArray); //second i8* + break; + default: + // FIXME: For now we abort if we don't know how to handle this arch + // Either add support for other architectures, or at least mark the + // nodes unknown/incomplete or whichever results in the correct + // conservative behavior in the general case + assert(0 && "VAstart not supported on this architecture!"); + //XXX: This might be good enough in those cases that we don't know + //what the arch does + N->setIncompleteMarker()->setUnknownMarker()->foldNodeCompletely(); + } + + //XXX: We used to set the alloca marker for the DSNode passed to va_start. + //Seems to me that you could allocate the va_list on the heap, so ignoring for now. + N->setModifiedMarker()->setVAStartMarker(); +} + /// returns true if the intrinsic is handled bool GraphBuilder::visitIntrinsic(CallSite CS, Function *F) { ++NumIntrinsicCall; switch (F->getIntrinsicID()) { case Intrinsic::vastart: { - // Mark the memory written by the vastart intrinsic as incomplete - DSNodeHandle RetNH = getValueDest(*CS.arg_begin()); - if (DSNode *N = RetNH.getNode()) { - N->setModifiedMarker()->setAllocaMarker()->setIncompleteMarker() - ->setVAStartMarker()->setUnknownMarker()->foldNodeCompletely(); - } - - if (RetNH.hasLink(0)) { - DSNodeHandle Link = RetNH.getLink(0); - if (DSNode *N = Link.getNode()) { - N->setModifiedMarker()->setAllocaMarker()->setIncompleteMarker() - ->setVAStartMarker()->setUnknownMarker()->foldNodeCompletely(); - } - } else { - // - // Sometimes the argument to the vastart is casted and has no DSNode. - // Peer past the cast. - // - Value * Operand = CS.getInstruction()->getOperand(1); - if (CastInst * CI = dyn_cast(Operand)) - Operand = CI->getOperand (0); - RetNH = getValueDest(Operand); - if (DSNode *N = RetNH.getNode()) { - N->setModifiedMarker()->setAllocaMarker()->setIncompleteMarker() - ->setVAStartMarker()->setUnknownMarker()->foldNodeCompletely(); - } - } - + visitVAStartInst(CS); return true; } - case Intrinsic::vacopy: - getValueDest(CS.getInstruction()). - mergeWith(getValueDest(*(CS.arg_begin()))); + case Intrinsic::vacopy: { + // Simply merge the two arguments to va_copy. + // This results in loss of precision on the temporaries used to manipulate + // the va_list, and so isn't a big deal. In theory we would build a + // separate graph for this (like the one created in visitVAStartNode) + // and only merge the node containing the variable arguments themselves. + DSNodeHandle destNH = getValueDest(CS.getArgument(0)); + DSNodeHandle srcNH = getValueDest(CS.getArgument(1)); + destNH.mergeWith(srcNH); return true; + } case Intrinsic::stacksave: { DSNode * Node = createNode(); Node->setAllocaMarker()->setIncompleteMarker()->setUnknownMarker(); @@ -813,23 +880,64 @@ } } + //NOTE: This code is identical to 'DSGraph::getDSCallSiteForCallSite', + //the reason it's duplicated apparently is so we can increment the + //stats 'NumIndirectCall' and 'NumDirectCall'. + //FIXME: refactor so we don't have this duplication + + //Get the FunctionType for the called function + const FunctionType *CalleeFuncType = DSCallSite::FunctionTypeOfCallSite(CS); + unsigned NumFixedArgs = CalleeFuncType->getNumParams(); + + // Sanity check--this really, really shouldn't happen + if (!CalleeFuncType->isVarArg()) + assert(CS.arg_size() == NumFixedArgs && + "Too many arguments/incorrect function signature!"); + std::vector Args; Args.reserve(CS.arg_end()-CS.arg_begin()); + DSNodeHandle VarArgNH; // Calculate the arguments vector... - for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I) - if (isa((*I)->getType())) - Args.push_back(getValueDest(*I)); + if (!CalleeFuncType->isVarArg()) { + // Add all pointer arguments + for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); + I != E; ++I) { + if (isa((*I)->getType())) + Args.push_back(getValueDest(*I)); + if (I - CS.arg_begin() >= NumFixedArgs) { + errs() << "WARNING: Call contains too many arguments:\n"; + CS.getInstruction()->dump(); + assert(0 && "Failing for now"); + } + } + } else { + // Add all fixed pointer arguments, then merge the rest together + for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); + I != E; ++I) + if (isa((*I)->getType())) { + DSNodeHandle ArgNode = getValueDest(*I); + if (I - CS.arg_begin() < NumFixedArgs) { + Args.push_back(ArgNode); + } else { + VarArgNH.mergeWith(ArgNode); + } + } + } // Add a new function call entry... if (CalleeNode) { ++NumIndirectCall; - G.getFunctionCalls().push_back(DSCallSite(CS, RetVal, CalleeNode, Args)); + G.getFunctionCalls().push_back(DSCallSite(CS, RetVal, VarArgNH, CalleeNode, + Args)); } else { ++NumDirectCall; - G.getFunctionCalls().push_back(DSCallSite(CS, RetVal, cast(Callee), + G.getFunctionCalls().push_back(DSCallSite(CS, RetVal, VarArgNH, + cast(Callee), Args)); } + + } // visitInstruction - For all other instruction types, if we have any arguments Modified: poolalloc/trunk/lib/DSA/Makefile URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Makefile?rev=106474&r1=106473&r2=106474&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Makefile (original) +++ poolalloc/trunk/lib/DSA/Makefile Mon Jun 21 15:52:30 2010 @@ -17,6 +17,13 @@ endif endif +#Bah. Confirmed on llvm-dev, there's no good way for us to do this. +#Essentially we're tasked with linking in the pieces that our plugin +#makes use of--but /not/ the tool we're using does /not/ make use of. +#It's dirty, but apparently what we're stuck with since we're a plugin +LDFLAGS = $(LLVM_OBJ_ROOT)/lib/Support/$(BuildMode)/Triple.o + include $(LEVEL)/Makefile.common CFlags += -Wno-deprecated + Modified: poolalloc/trunk/lib/DSA/Printer.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Printer.cpp?rev=106474&r1=106473&r2=106474&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Printer.cpp (original) +++ poolalloc/trunk/lib/DSA/Printer.cpp Mon Jun 21 15:52:30 2010 @@ -91,6 +91,7 @@ if (NodeType & DSNode::ExternalNode ) OS << "E"; if (NodeType & DSNode::IntToPtrNode ) OS << "P"; if (NodeType & DSNode::PtrToIntNode ) OS << "2"; + if (NodeType & DSNode::VAStartNode ) OS << "V"; #ifndef NDEBUG if (NodeType & DSNode::DeadNode ) OS << ""; @@ -98,6 +99,15 @@ OS << "\n"; } + //Indicate if this is a VANode for some function + for (DSGraph::vanodes_iterator I = G->vanodes_begin(), E = G->vanodes_end(); + I != E; ++I) { + DSNodeHandle VANode = I->second; + if (N == VANode.getNode()) { + OS << "(VANode for " << I->first->getNameStr() << ")\n"; + } + } + EquivalenceClasses *GlobalECs = 0; if (G) GlobalECs = &G->getGlobalECs(); @@ -257,6 +267,8 @@ GW.emitEdge(&Call, 0, N, EdgeDest, "color=gray63,tailclip=false"); } + // FIXME: visualize the VANode? + // Print out the callee... if (Call.isIndirectCall()) { DSNode *N = Call.getCalleeNode(); Modified: poolalloc/trunk/lib/DSA/TopDownClosure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/TopDownClosure.cpp?rev=106474&r1=106473&r2=106474&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/TopDownClosure.cpp (original) +++ poolalloc/trunk/lib/DSA/TopDownClosure.cpp Mon Jun 21 15:52:30 2010 @@ -355,8 +355,8 @@ // merged into it. The actual callee function doesn't matter here, so we // just pass it something to keep the ctor happy. std::vector ArgDummyVec; - DSCallSite DummyCS(CI->getCallSite(), DSNodeHandle(), Callees[0]/*dummy*/, - ArgDummyVec); + DSCallSite DummyCS(CI->getCallSite(), DSNodeHandle(), DSNodeHandle(), + Callees[0]/*dummy*/, ArgDummyVec); IndCallGraph->getFunctionCalls().push_back(DummyCS); IndCallRecI = IndCallMap.insert(IndCallRecI, From wdietz2 at illinois.edu Mon Jun 21 15:54:15 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Mon, 21 Jun 2010 20:54:15 -0000 Subject: [llvm-commits] [poolalloc] r106475 - /poolalloc/trunk/test/Makefile Message-ID: <20100621205415.95CFF2A6C12C@llvm.org> Author: wdietz2 Date: Mon Jun 21 15:54:15 2010 New Revision: 106475 URL: http://llvm.org/viewvc/llvm-project?rev=106475&view=rev Log: switch from dejagnu to lit, also makes invocation significantly cleaner Modified: poolalloc/trunk/test/Makefile Modified: poolalloc/trunk/test/Makefile URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/Makefile?rev=106475&r1=106474&r2=106475&view=diff ============================================================================== --- poolalloc/trunk/test/Makefile (original) +++ poolalloc/trunk/test/Makefile Mon Jun 21 15:54:15 2010 @@ -324,16 +324,10 @@ # Unit tests ##===----------------------------------------------------------------------===## -#DISCLAIMER -#I would prefer being able to do something like above, by setting -#some "PROJECT_DIR" variable, but alas I don't see that for the dejagnu -#test framework. So for now we hijack the existing framework as much as -#possible--feel free to replace this if you know a cleaner way. +.PHONY: unit -.PHONY: check_runtest unit - -#Path to dejagnu's runtest binary. -RUNTEST=runtest +#Path to 'lit' +LIT=$(LLVM_SRC_ROOT)/utils/lit/lit.py #Figure out what our configuration is #Better way? @@ -352,26 +346,6 @@ TOOLS= $(DSAOPT) -#Check that our RUNTEST variable points to a runtest we can use -check_runtest: - @which runtest; \ - if [ $$? -ne 0 ]; then \ - echo \"$(RUNTEST)\" is not valid. Please put runtest on your PATH; \ - echo or set the RUNTEST variable correctly.; \ - exit 1; \ - fi - -#Grab site.exp per normal llvm testing, but modify it to run in this project -site.exp: - @echo "Generating site.exp..." - @make -C $(LLVM_OBJ_ROOT)/test site.exp - @cp $(LLVM_OBJ_ROOT)/test/site.exp site.tmp - @echo "set srcdir $(PROJ_SRC_DIR)" >> site.tmp - @echo "set srcroot $(PROJ_SRC_DIR)" >> site.tmp - @echo "set objdir $(PROJ_OBJ_DIR)" >> site.tmp - @echo "set objroot $(PROJ_OBJ_DIR)" >> site.tmp - @cp site.tmp $@ - #wrapper script for 'opt' so we can avoid manually loading the dsa lib $(DSAOPT): @mkdir -p `dirname $@` @@ -380,20 +354,23 @@ @chmod +x $@.tmp @mv $@.tmp $@ -#We need this locally, might be able to avoid this by modifying site.exp -llvm.exp: - cp $(LLVM_SRC_ROOT)/test/lib/llvm.exp $@ - -#Build up the runtest command by making sure useful tools are on its path -RUNTEST_CMD = \ - PATH=$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(LLVMGCCDIR)/bin:$(PATH):$(PROJ_OBJ_ROOT)/test/tools \ - $(RUNTEST) +lit.site.cfg: $(PROJ_SRC_ROOT)/test/lit.site.cfg.in + @echo "Making LLVM 'lit.site.cfg' file..." + @sed -e "s#@LLVM_SOURCE_DIR@#$(LLVM_SRC_ROOT)#g" \ + -e "s#@LLVM_BINARY_DIR@#$(LLVM_OBJ_ROOT)#g" \ + -e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \ + -e "s#@LLVMGCCDIR@#$(LLVMGCCDIR)#g" \ + -e "s#@PROJ_SRC_ROOT@#$(PROJ_SRC_ROOT)#g" \ + $(PROJ_SRC_ROOT)/test/lit.site.cfg.in > $@ + +SETPATH = \ + PATH=$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(LLVMGCCDIR)/bin:$(PATH):$(PROJ_OBJ_ROOT)/test/tools #Run the dejagnu tests for this project -unit: check_runtest site.exp llvm.exp $(TOOLS) - $(RUNTEST_CMD) +unit: lit.site.cfg $(TOOLS) + $(SETPATH) $(MAKE) -C $(LLVM_OBJ_ROOT)/test check-local-lit TESTSUITE=$(PROJ_OBJ_ROOT)/test clean:: -$(RM) -rf `find $(PROJ_OBJ_DIR) -name Output -type d -print` - -$(RM) $(PROJ_OBJ_ROOT)/test/site.exp $(PROJ_OBJ_ROOT)/test/llvm.exp + -$(RM) lit.site.cfg -$(RM) -rf tools From wdietz2 at illinois.edu Mon Jun 21 15:56:51 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Mon, 21 Jun 2010 20:56:51 -0000 Subject: [llvm-commits] [poolalloc] r106476 - in /poolalloc/trunk/test: lit.cfg lit.site.cfg.in Message-ID: <20100621205651.3BD0C2A6C12C@llvm.org> Author: wdietz2 Date: Mon Jun 21 15:56:51 2010 New Revision: 106476 URL: http://llvm.org/viewvc/llvm-project?rev=106476&view=rev Log: Added missing lit config files Added: poolalloc/trunk/test/lit.cfg poolalloc/trunk/test/lit.site.cfg.in Added: poolalloc/trunk/test/lit.cfg URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/lit.cfg?rev=106476&view=auto ============================================================================== --- poolalloc/trunk/test/lit.cfg (added) +++ poolalloc/trunk/test/lit.cfg Mon Jun 21 15:56:51 2010 @@ -0,0 +1,199 @@ +# -*- Python -*- + +# Configuration file for the 'lit' test runner. + +import os + +# name: The name of this test suite. +config.name = 'LLVM' + +# testFormat: The test format to use to interpret tests. +config.test_format = lit.formats.TclTest() + +# suffixes: A list of file extensions to treat as test files, this is actually +# set by on_clone(). +config.suffixes = [] + +# test_source_root: The root path where tests are located. +config.test_source_root = os.path.dirname(__file__) + +# test_exec_root: The root path where tests should be run. +llvm_obj_root = getattr(config, 'llvm_obj_root', None) +if llvm_obj_root is not None: + config.test_exec_root = os.path.join(llvm_obj_root, 'test') + +# Tweak the PATH to include the scripts dir, the tools dir, and the llvm-gcc bin +# dir (if available). +if llvm_obj_root is not None: + llvm_src_root = getattr(config, 'llvm_src_root', None) + if not llvm_src_root: + lit.fatal('No LLVM source root set!') + path = os.path.pathsep.join((os.path.join(llvm_src_root, 'test', + 'Scripts'), + config.environment['PATH'])) + config.environment['PATH'] = path + + llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) + if not llvm_tools_dir: + lit.fatal('No LLVM tools dir set!') + path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH'])) + config.environment['PATH'] = path + + llvmgcc_dir = getattr(config, 'llvmgcc_dir', None) + if llvmgcc_dir: + path = os.path.pathsep.join((os.path.join(llvmgcc_dir, 'bin'), + config.environment['PATH'])) + config.environment['PATH'] = path + +# Propogate 'HOME' through the environment. +config.environment['HOME'] = os.environ['HOME'] + +### + +import os + +# Check that the object root is known. +if config.test_exec_root is None: + # Otherwise, we haven't loaded the site specific configuration (the user is + # probably trying to run on a test file directly, and either the site + # configuration hasn't been created by the build system, or we are in an + # out-of-tree build situation). + + # Check for 'llvm_site_config' user parameter, and use that if available. + site_cfg = lit.params.get('llvm_site_config', None) + if site_cfg and os.path.exists(site_cfg): + lit.load_config(config, site_cfg) + raise SystemExit + + # Try to detect the situation where we are using an out-of-tree build by + # looking for 'llvm-config'. + # + # FIXME: I debated (i.e., wrote and threw away) adding logic to + # automagically generate the lit.site.cfg if we are in some kind of fresh + # build situation. This means knowing how to invoke the build system + # though, and I decided it was too much magic. + + llvm_config = lit.util.which('llvm-config', config.environment['PATH']) + if not llvm_config: + lit.fatal('No site specific configuration available!') + + # Get the source and object roots. + llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip() + llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip() + + # Validate that we got a tree which points to here. + this_src_root = os.path.dirname(config.test_source_root) + if os.path.realpath(llvm_src_root) != os.path.realpath(this_src_root): + lit.fatal('No site specific configuration available!') + + # Check that the site specific configuration exists. + site_cfg = os.path.join(llvm_obj_root, 'test', 'lit.site.cfg') + if not os.path.exists(site_cfg): + lit.fatal('No site specific configuration available!') + + # Okay, that worked. Notify the user of the automagic, and reconfigure. + lit.note('using out-of-tree build at %r' % llvm_obj_root) + lit.load_config(config, site_cfg) + raise SystemExit + +### + +# Load site data from DejaGNU's site.exp. +import re +site_exp = {} +# FIXME: Implement lit.site.cfg. +for line in open(os.path.join(config.llvm_obj_root, 'test', 'site.exp')): + m = re.match('set ([^ ]+) "([^"]*)"', line) + if m: + site_exp[m.group(1)] = m.group(2) + +# Add substitutions. +config.substitutions.append(('%llvmgcc_only', site_exp['llvmgcc'])) +for sub in ['llvmgcc', 'llvmgxx', 'compile_cxx', 'compile_c', + 'link', 'shlibext', 'ocamlopt', 'llvmdsymutil', 'llvmlibsdir', + 'bugpoint_topts']: + if sub in ('llvmgcc', 'llvmgxx'): + config.substitutions.append(('%' + sub, + site_exp[sub] + ' -emit-llvm -w')) + # FIXME: This is a hack to avoid LLVMC tests failing due to a clang driver + # warning when passing in "-fexceptions -fno-exceptions". + elif sub == 'compile_cxx': + config.substitutions.append(('%' + sub, + site_exp[sub].replace('-fno-exceptions', ''))) + else: + config.substitutions.append(('%' + sub, site_exp[sub])) + +excludes = [] + +# Provide target_triple for use in XFAIL and XTARGET. +config.target_triple = site_exp['target_triplet'] + +# Provide llvm_supports_target for use in local configs. +targets = set(site_exp["TARGETS_TO_BUILD"].split()) +def llvm_supports_target(name): + return name in targets + +def llvm_supports_darwin_and_target(name): + return 'darwin' in config.target_triple and llvm_supports_target(name) + +langs = set(site_exp['llvmgcc_langs'].split(',')) +def llvm_gcc_supports(name): + return name in langs + +bindings = set(site_exp['llvm_bindings'].split(',')) +def llvm_supports_binding(name): + return name in bindings + +config.conditions["TARGET"] = llvm_supports_target +config.conditions["BINDING"] = llvm_supports_binding + +# Provide on_clone hook for reading 'dg.exp'. +import os +simpleLibData = re.compile(r"""load_lib llvm.exp + +RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\]""", + re.MULTILINE) +conditionalLibData = re.compile(r"""load_lib llvm.exp + +if.*\[ ?(llvm[^ ]*) ([^ ]*) ?\].*{ + *RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\] +\}""", re.MULTILINE) +def on_clone(parent, cfg, for_path): + def addSuffixes(match): + if match[0] == '{' and match[-1] == '}': + cfg.suffixes = ['.' + s for s in match[1:-1].split(',')] + else: + cfg.suffixes = ['.' + match] + + libPath = os.path.join(os.path.dirname(for_path), + 'dg.exp') + if not os.path.exists(libPath): + cfg.unsupported = True + return + + # Reset unsupported, in case we inherited it. + cfg.unsupported = False + lib = open(libPath).read().strip() + + # Check for a simple library. + m = simpleLibData.match(lib) + if m: + addSuffixes(m.group(1)) + return + + # Check for a conditional test set. + m = conditionalLibData.match(lib) + if m: + funcname,arg,match = m.groups() + addSuffixes(match) + + func = globals().get(funcname) + if not func: + lit.error('unsupported predicate %r' % funcname) + elif not func(arg): + cfg.unsupported = True + return + # Otherwise, give up. + lit.error('unable to understand %r:\n%s' % (libPath, lib)) + +config.on_clone = on_clone Added: poolalloc/trunk/test/lit.site.cfg.in URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/lit.site.cfg.in?rev=106476&view=auto ============================================================================== --- poolalloc/trunk/test/lit.site.cfg.in (added) +++ poolalloc/trunk/test/lit.site.cfg.in Mon Jun 21 15:56:51 2010 @@ -0,0 +1,9 @@ +## Autogenerated by LLVM/Clang configuration. +# Do not edit! +config.llvm_src_root = "@LLVM_SOURCE_DIR@" +config.llvm_obj_root = "@LLVM_BINARY_DIR@" +config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" +config.llvmgcc_dir = "@LLVMGCCDIR@" + +# Let the main config do the real work. +lit.load_config(config, "@PROJ_SRC_ROOT@/test/lit.cfg") From wdietz2 at illinois.edu Mon Jun 21 16:01:58 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Mon, 21 Jun 2010 21:01:58 -0000 Subject: [llvm-commits] [poolalloc] r106479 - /poolalloc/trunk/test/Makefile Message-ID: <20100621210158.9E6042A6C12C@llvm.org> Author: wdietz2 Date: Mon Jun 21 16:01:58 2010 New Revision: 106479 URL: http://llvm.org/viewvc/llvm-project?rev=106479&view=rev Log: change wording to refer to 'lit tests' instead of the (incorrect) 'unit tests' Modified: poolalloc/trunk/test/Makefile Modified: poolalloc/trunk/test/Makefile URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/Makefile?rev=106479&r1=106478&r2=106479&view=diff ============================================================================== --- poolalloc/trunk/test/Makefile (original) +++ poolalloc/trunk/test/Makefile Mon Jun 21 16:01:58 2010 @@ -7,8 +7,8 @@ # The default target in this directory is the test:: target test:: -#Eventually we'll want to automatically run the dejagnu tests too -#test:: unit +#Eventually we'll want to automatically run the lit tests too +#test:: lit LEVEL = .. include $(LEVEL)/Makefile.common @@ -321,10 +321,10 @@ @printf "\a"; sleep 1; printf "\a"; sleep 1; printf "\a" ##===----------------------------------------------------------------------===## -# Unit tests +# Lit tests ##===----------------------------------------------------------------------===## -.PHONY: unit +.PHONY: lit #Path to 'lit' LIT=$(LLVM_SRC_ROOT)/utils/lit/lit.py @@ -366,8 +366,8 @@ SETPATH = \ PATH=$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(LLVMGCCDIR)/bin:$(PATH):$(PROJ_OBJ_ROOT)/test/tools -#Run the dejagnu tests for this project -unit: lit.site.cfg $(TOOLS) +#Run the lit tests for this project +lit: lit.site.cfg $(TOOLS) $(SETPATH) $(MAKE) -C $(LLVM_OBJ_ROOT)/test check-local-lit TESTSUITE=$(PROJ_OBJ_ROOT)/test clean:: From bruno.cardoso at gmail.com Mon Jun 21 16:21:48 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Mon, 21 Jun 2010 21:21:48 -0000 Subject: [llvm-commits] [llvm] r106482 - /llvm/trunk/lib/Target/X86/X86InstrSSE.td Message-ID: <20100621212148.9EA0E2A6C12D@llvm.org> Author: bruno Date: Mon Jun 21 16:21:48 2010 New Revision: 106482 URL: http://llvm.org/viewvc/llvm-project?rev=106482&view=rev Log: Add unpack and interleave AVX instructions, encoding tests cooming soon Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106482&r1=106481&r2=106482&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon Jun 21 16:21:48 2010 @@ -444,6 +444,22 @@ RC:$src1, (mem_frag addr:$src2)))], d>; } +/// sse12_unpack_interleave - SSE 1 & 2 unpack and interleave +multiclass sse12_unpack_interleave opc, PatFrag OpNode, ValueType vt, + PatFrag mem_frag, RegisterClass RC, + X86MemOperand x86memop, string asm, + Domain d> { + def rr : PI; + def rm : PI; +} + //===----------------------------------------------------------------------===// // SSE1 Instructions //===----------------------------------------------------------------------===// @@ -1201,50 +1217,32 @@ VR128:$src1, (memopv2f64 addr:$src2))))]>; let AddedComplexity = 10 in { - def UNPCKHPSrr : PSI<0x15, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), - "unpckhps\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4f32 (unpckh VR128:$src1, VR128:$src2)))]>; - def UNPCKHPSrm : PSI<0x15, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), - "unpckhps\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4f32 (unpckh VR128:$src1, - (memopv4f32 addr:$src2))))]>; - - def UNPCKLPSrr : PSI<0x14, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), - "unpcklps\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4f32 (unpckl VR128:$src1, VR128:$src2)))]>; - def UNPCKLPSrm : PSI<0x14, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), - "unpcklps\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (unpckl VR128:$src1, (memopv4f32 addr:$src2)))]>; - def UNPCKHPDrr : PDI<0x15, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), - "unpckhpd\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2f64 (unpckh VR128:$src1, VR128:$src2)))]>; - def UNPCKHPDrm : PDI<0x15, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), - "unpckhpd\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2f64 (unpckh VR128:$src1, - (memopv2f64 addr:$src2))))]>; - - def UNPCKLPDrr : PDI<0x14, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), - "unpcklpd\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2f64 (unpckl VR128:$src1, VR128:$src2)))]>; - def UNPCKLPDrm : PDI<0x14, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), - "unpcklpd\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (unpckl VR128:$src1, (memopv2f64 addr:$src2)))]>; + let Constraints = "", isAsmParserOnly = 1 in { + defm VUNPCKHPS: sse12_unpack_interleave<0x15, unpckh, v4f32, memopv4f32, + VR128, f128mem, "unpckhps\t{$src2, $src1, $dst|$dst, $src1, $src2}", + SSEPackedSingle>, VEX_4V; + defm VUNPCKHPD: sse12_unpack_interleave<0x15, unpckh, v2f64, memopv2f64, + VR128, f128mem, "unpckhpd\t{$src2, $src1, $dst|$dst, $src1, $src2}", + SSEPackedDouble>, OpSize, VEX_4V; + defm VUNPCKLPS: sse12_unpack_interleave<0x14, unpckl, v4f32, memopv4f32, + VR128, f128mem, "unpcklps\t{$src2, $src1, $dst|$dst, $src1, $src2}", + SSEPackedSingle>, VEX_4V; + defm VUNPCKLPD: sse12_unpack_interleave<0x14, unpckl, v2f64, memopv2f64, + VR128, f128mem, "unpcklpd\t{$src2, $src1, $dst|$dst, $src1, $src2}", + SSEPackedDouble>, OpSize, VEX_4V; + } + defm UNPCKHPS: sse12_unpack_interleave<0x15, unpckh, v4f32, memopv4f32, + VR128, f128mem, "unpckhps\t{$src2, $dst|$dst, $src2}", + SSEPackedSingle>, TB; + defm UNPCKHPD: sse12_unpack_interleave<0x15, unpckh, v2f64, memopv2f64, + VR128, f128mem, "unpckhpd\t{$src2, $dst|$dst, $src2}", + SSEPackedDouble>, TB, OpSize; + defm UNPCKLPS: sse12_unpack_interleave<0x14, unpckl, v4f32, memopv4f32, + VR128, f128mem, "unpcklps\t{$src2, $dst|$dst, $src2}", + SSEPackedSingle>, TB; + defm UNPCKLPD: sse12_unpack_interleave<0x14, unpckl, v2f64, memopv2f64, + VR128, f128mem, "unpcklpd\t{$src2, $dst|$dst, $src2}", + SSEPackedDouble>, TB, OpSize; } // AddedComplexity } // Constraints = "$src1 = $dst" From evan.cheng at apple.com Mon Jun 21 16:21:14 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 21 Jun 2010 21:21:14 -0000 Subject: [llvm-commits] [llvm] r106481 - in /llvm/trunk: lib/Target/ARM/ARMLoadStoreOptimizer.cpp test/CodeGen/ARM/2010-06-21-LdStMultipleBug.ll Message-ID: <20100621212114.D44372A6C12C@llvm.org> Author: evancheng Date: Mon Jun 21 16:21:14 2010 New Revision: 106481 URL: http://llvm.org/viewvc/llvm-project?rev=106481&view=rev Log: Fix PR7421: bug in kill transferring logic. It was ignoring loads / stores which have already been processed. Added: llvm/trunk/test/CodeGen/ARM/2010-06-21-LdStMultipleBug.ll Modified: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Modified: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp?rev=106481&r1=106480&r2=106481&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Mon Jun 21 16:21:14 2010 @@ -74,11 +74,14 @@ private: struct MemOpQueueEntry { int Offset; + unsigned Reg; + bool isKill; unsigned Position; MachineBasicBlock::iterator MBBI; bool Merged; - MemOpQueueEntry(int o, int p, MachineBasicBlock::iterator i) - : Offset(o), Position(p), MBBI(i), Merged(false) {} + MemOpQueueEntry(int o, unsigned r, bool k, unsigned p, + MachineBasicBlock::iterator i) + : Offset(o), Reg(r), isKill(k), Position(p), MBBI(i), Merged(false) {} }; typedef SmallVector MemOpQueue; typedef MemOpQueue::iterator MemOpQueueIter; @@ -264,39 +267,53 @@ // MergeOpsUpdate - call MergeOps and update MemOps and merges accordingly on // success. -void ARMLoadStoreOpt:: -MergeOpsUpdate(MachineBasicBlock &MBB, - MemOpQueue &memOps, - unsigned memOpsBegin, - unsigned memOpsEnd, - unsigned insertAfter, - int Offset, - unsigned Base, - bool BaseKill, - int Opcode, - ARMCC::CondCodes Pred, - unsigned PredReg, - unsigned Scratch, - DebugLoc dl, - SmallVector &Merges) { +void ARMLoadStoreOpt::MergeOpsUpdate(MachineBasicBlock &MBB, + MemOpQueue &memOps, + unsigned memOpsBegin, unsigned memOpsEnd, + unsigned insertAfter, int Offset, + unsigned Base, bool BaseKill, + int Opcode, + ARMCC::CondCodes Pred, unsigned PredReg, + unsigned Scratch, + DebugLoc dl, + SmallVector &Merges) { // First calculate which of the registers should be killed by the merged // instruction. - SmallVector, 8> Regs; const unsigned insertPos = memOps[insertAfter].Position; + + SmallSet UnavailRegs; + SmallSet KilledRegs; + DenseMap Killer; + for (unsigned i = 0; i < memOpsBegin; ++i) { + if (memOps[i].Position < insertPos && memOps[i].isKill) { + unsigned Reg = memOps[i].Reg; + if (memOps[i].Merged) + UnavailRegs.insert(Reg); + else { + KilledRegs.insert(Reg); + Killer[Reg] = i; + } + } + } + for (unsigned i = memOpsEnd, e = memOps.size(); i != e; ++i) { + if (memOps[i].Position < insertPos && memOps[i].isKill) { + unsigned Reg = memOps[i].Reg; + KilledRegs.insert(Reg); + Killer[Reg] = i; + } + } + + SmallVector, 8> Regs; for (unsigned i = memOpsBegin; i < memOpsEnd; ++i) { - const MachineOperand &MO = memOps[i].MBBI->getOperand(0); - unsigned Reg = MO.getReg(); - bool isKill = MO.isKill(); + unsigned Reg = memOps[i].Reg; + if (UnavailRegs.count(Reg)) + // Register is killed before and it's not easy / possible to update the + // kill marker on already merged instructions. Abort. + return; // If we are inserting the merged operation after an unmerged operation that // uses the same register, make sure to transfer any kill flag. - for (unsigned j = memOpsEnd, e = memOps.size(); !isKill && j != e; ++j) - if (memOps[j].PositiongetOperand(0); - if (MOJ.getReg() == Reg && MOJ.isKill()) - isKill = true; - } - + bool isKill = memOps[i].isKill || KilledRegs.count(Reg); Regs.push_back(std::make_pair(Reg, isKill)); } @@ -311,13 +328,13 @@ Merges.push_back(prior(Loc)); for (unsigned i = memOpsBegin; i < memOpsEnd; ++i) { // Remove kill flags from any unmerged memops that come before insertPos. - if (Regs[i-memOpsBegin].second) - for (unsigned j = memOpsEnd, e = memOps.size(); j != e; ++j) - if (memOps[j].PositiongetOperand(0); - if (MOJ.getReg() == Regs[i-memOpsBegin].first && MOJ.isKill()) - MOJ.setIsKill(false); - } + if (Regs[i-memOpsBegin].second) { + unsigned Reg = Regs[i-memOpsBegin].first; + if (KilledRegs.count(Reg)) { + unsigned j = Killer[Reg]; + memOps[j].MBBI->getOperand(0).setIsKill(false); + } + } MBB.erase(memOps[i].MBBI); memOps[i].Merged = true; } @@ -910,6 +927,7 @@ if ((EvenRegNum & 1) == 0 && (EvenRegNum + 1) == OddRegNum) return false; + MachineBasicBlock::iterator NewBBI = MBBI; bool isT2 = Opcode == ARM::t2LDRDi8 || Opcode == ARM::t2STRDi8; bool isLd = Opcode == ARM::LDRD || Opcode == ARM::t2LDRDi8; bool EvenDeadKill = isLd ? @@ -954,6 +972,7 @@ getKillRegState(OddDeadKill) | getUndefRegState(OddUndef)); ++NumSTRD2STM; } + NewBBI = llvm::prior(MBBI); } else { // Split into two instructions. assert((!isT2 || !OffReg) && @@ -974,6 +993,7 @@ OddReg, OddDeadKill, false, BaseReg, false, BaseUndef, OffReg, false, OffUndef, Pred, PredReg, TII, isT2); + NewBBI = llvm::prior(MBBI); InsertLDR_STR(MBB, MBBI, OffImm, isLd, dl, NewOpc, EvenReg, EvenDeadKill, false, BaseReg, BaseKill, BaseUndef, OffReg, OffKill, OffUndef, @@ -990,6 +1010,7 @@ EvenReg, EvenDeadKill, EvenUndef, BaseReg, false, BaseUndef, OffReg, false, OffUndef, Pred, PredReg, TII, isT2); + NewBBI = llvm::prior(MBBI); InsertLDR_STR(MBB, MBBI, OffImm+4, isLd, dl, NewOpc, OddReg, OddDeadKill, OddUndef, BaseReg, BaseKill, BaseUndef, OffReg, OffKill, OffUndef, @@ -1001,8 +1022,9 @@ ++NumSTRD2STR; } - MBBI = prior(MBBI); MBB.erase(MI); + MBBI = NewBBI; + return true; } return false; } @@ -1035,6 +1057,9 @@ if (isMemOp) { int Opcode = MBBI->getOpcode(); unsigned Size = getLSMultipleTransferSize(MBBI); + const MachineOperand &MO = MBBI->getOperand(0); + unsigned Reg = MO.getReg(); + bool isKill = MO.isDef() ? false : MO.isKill(); unsigned Base = MBBI->getOperand(1).getReg(); unsigned PredReg = 0; ARMCC::CondCodes Pred = llvm::getInstrPredicate(MBBI, PredReg); @@ -1056,7 +1081,7 @@ CurrSize = Size; CurrPred = Pred; CurrPredReg = PredReg; - MemOps.push_back(MemOpQueueEntry(Offset, Position, MBBI)); + MemOps.push_back(MemOpQueueEntry(Offset, Reg, isKill, Position, MBBI)); NumMemOps++; Advance = true; } else { @@ -1069,14 +1094,16 @@ // No need to match PredReg. // Continue adding to the queue. if (Offset > MemOps.back().Offset) { - MemOps.push_back(MemOpQueueEntry(Offset, Position, MBBI)); + MemOps.push_back(MemOpQueueEntry(Offset, Reg, isKill, + Position, MBBI)); NumMemOps++; Advance = true; } else { for (MemOpQueueIter I = MemOps.begin(), E = MemOps.end(); I != E; ++I) { if (Offset < I->Offset) { - MemOps.insert(I, MemOpQueueEntry(Offset, Position, MBBI)); + MemOps.insert(I, MemOpQueueEntry(Offset, Reg, isKill, + Position, MBBI)); NumMemOps++; Advance = true; break; Added: llvm/trunk/test/CodeGen/ARM/2010-06-21-LdStMultipleBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2010-06-21-LdStMultipleBug.ll?rev=106481&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2010-06-21-LdStMultipleBug.ll (added) +++ llvm/trunk/test/CodeGen/ARM/2010-06-21-LdStMultipleBug.ll Mon Jun 21 16:21:14 2010 @@ -0,0 +1,148 @@ +; RUN: llc < %s -mtriple=armv7-apple-darwin -O3 -mcpu=arm1136jf-s +; PR7421 + +%struct.CONTENTBOX = type { i32, i32, i32, i32, i32 } +%struct.FILE = type { i8* } +%struct.tilebox = type { %struct.tilebox*, double, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } +%struct.UNCOMBOX = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } +%struct.cellbox = type { i8*, i32, i32, i32, [9 x i32], i32, i32, i32, i32, i32, i32, i32, double, double, double, double, double, i32, i32, %struct.CONTENTBOX*, %struct.UNCOMBOX*, [8 x %struct.tilebox*] } +%struct.termbox = type { %struct.termbox*, i32, i32, i32, i32, i32 } + + at .str2708 = external constant [14 x i8], align 4 ; <[14 x i8]*> [#uses=1] + +define void @TW_oldinput(%struct.FILE* nocapture %fp) nounwind { +entry: + %xcenter = alloca i32, align 4 ; [#uses=2] + %0 = call i32 (%struct.FILE*, i8*, ...)* @fscanf(%struct.FILE* %fp, i8* getelementptr inbounds ([14 x i8]* @.str2708, i32 0, i32 0), i32* undef, i32* undef, i32* %xcenter, i32* null) nounwind ; [#uses=1] + %1 = icmp eq i32 %0, 4 ; [#uses=1] + br i1 %1, label %bb, label %return + +bb: ; preds = %bb445, %entry + %2 = load %struct.cellbox** undef, align 4 ; <%struct.cellbox*> [#uses=2] + %3 = getelementptr inbounds %struct.cellbox* %2, i32 0, i32 3 ; [#uses=1] + store i32 undef, i32* %3, align 4 + %4 = load i32* undef, align 4 ; [#uses=3] + %5 = icmp eq i32 undef, 1 ; [#uses=1] + br i1 %5, label %bb10, label %bb445 + +bb10: ; preds = %bb + br i1 undef, label %bb11, label %bb445 + +bb11: ; preds = %bb10 + %6 = load %struct.tilebox** undef, align 4 ; <%struct.tilebox*> [#uses=3] + %7 = load %struct.termbox** null, align 4 ; <%struct.termbox*> [#uses=1] + %8 = getelementptr inbounds %struct.tilebox* %6, i32 0, i32 13 ; [#uses=1] + %9 = load i32* %8, align 4 ; [#uses=3] + %10 = getelementptr inbounds %struct.tilebox* %6, i32 0, i32 15 ; [#uses=1] + %11 = load i32* %10, align 4 ; [#uses=1] + br i1 false, label %bb12, label %bb13 + +bb12: ; preds = %bb11 + unreachable + +bb13: ; preds = %bb11 + %iftmp.40.0.neg = sdiv i32 0, -2 ; [#uses=2] + %12 = sub nsw i32 0, %9 ; [#uses=1] + %13 = sitofp i32 %12 to double ; [#uses=1] + %14 = fdiv double %13, 0.000000e+00 ; [#uses=1] + %15 = fptosi double %14 to i32 ; [#uses=1] + %iftmp.41.0.in = add i32 0, %15 ; [#uses=1] + %iftmp.41.0.neg = sdiv i32 %iftmp.41.0.in, -2 ; [#uses=3] + br i1 undef, label %bb43.loopexit, label %bb21 + +bb21: ; preds = %bb13 + %16 = fptosi double undef to i32 ; [#uses=1] + %17 = fsub double undef, 0.000000e+00 ; [#uses=1] + %not.460 = fcmp oge double %17, 5.000000e-01 ; [#uses=1] + %18 = zext i1 %not.460 to i32 ; [#uses=1] + %iftmp.42.0 = add i32 %16, %iftmp.41.0.neg ; [#uses=1] + %19 = add i32 %iftmp.42.0, %18 ; [#uses=1] + store i32 %19, i32* undef, align 4 + %20 = sub nsw i32 0, %9 ; [#uses=1] + %21 = sitofp i32 %20 to double ; [#uses=1] + %22 = fdiv double %21, 0.000000e+00 ; [#uses=2] + %23 = fptosi double %22 to i32 ; [#uses=1] + %24 = fsub double %22, undef ; [#uses=1] + %not.461 = fcmp oge double %24, 5.000000e-01 ; [#uses=1] + %25 = zext i1 %not.461 to i32 ; [#uses=1] + %iftmp.43.0 = add i32 %23, %iftmp.41.0.neg ; [#uses=1] + %26 = add i32 %iftmp.43.0, %25 ; [#uses=1] + %27 = getelementptr inbounds %struct.tilebox* %6, i32 0, i32 10 ; [#uses=1] + store i32 %26, i32* %27, align 4 + %28 = fptosi double undef to i32 ; [#uses=1] + %iftmp.45.0 = add i32 %28, %iftmp.40.0.neg ; [#uses=1] + %29 = add i32 %iftmp.45.0, 0 ; [#uses=1] + store i32 %29, i32* undef, align 4 + br label %bb43.loopexit + +bb36: ; preds = %bb43.loopexit, %bb36 + %termptr.0478 = phi %struct.termbox* [ %42, %bb36 ], [ %7, %bb43.loopexit ] ; <%struct.termbox*> [#uses=1] + %30 = load i32* undef, align 4 ; [#uses=1] + %31 = sub nsw i32 %30, %9 ; [#uses=1] + %32 = sitofp i32 %31 to double ; [#uses=1] + %33 = fdiv double %32, 0.000000e+00 ; [#uses=1] + %34 = fptosi double %33 to i32 ; [#uses=1] + %iftmp.46.0 = add i32 %34, %iftmp.41.0.neg ; [#uses=1] + %35 = add i32 %iftmp.46.0, 0 ; [#uses=1] + store i32 %35, i32* undef, align 4 + %36 = sub nsw i32 0, %11 ; [#uses=1] + %37 = sitofp i32 %36 to double ; [#uses=1] + %38 = fmul double %37, 0.000000e+00 ; [#uses=1] + %39 = fptosi double %38 to i32 ; [#uses=1] + %iftmp.47.0 = add i32 %39, %iftmp.40.0.neg ; [#uses=1] + %40 = add i32 %iftmp.47.0, 0 ; [#uses=1] + store i32 %40, i32* undef, align 4 + %41 = getelementptr inbounds %struct.termbox* %termptr.0478, i32 0, i32 0 ; <%struct.termbox**> [#uses=1] + %42 = load %struct.termbox** %41, align 4 ; <%struct.termbox*> [#uses=2] + %43 = icmp eq %struct.termbox* %42, null ; [#uses=1] + br i1 %43, label %bb52.loopexit, label %bb36 + +bb43.loopexit: ; preds = %bb21, %bb13 + br i1 undef, label %bb52.loopexit, label %bb36 + +bb52.loopexit: ; preds = %bb43.loopexit, %bb36 + %44 = icmp eq i32 %4, 0 ; [#uses=1] + br i1 %44, label %bb.nph485, label %bb54 + +bb54: ; preds = %bb52.loopexit + switch i32 %4, label %bb62 [ + i32 2, label %bb56 + i32 3, label %bb57 + ] + +bb56: ; preds = %bb54 + br label %bb62 + +bb57: ; preds = %bb54 + br label %bb62 + +bb62: ; preds = %bb57, %bb56, %bb54 + unreachable + +bb.nph485: ; preds = %bb52.loopexit + br label %bb248 + +bb248: ; preds = %bb322, %bb.nph485 + %45 = icmp eq i32 undef, %4 ; [#uses=1] + br i1 %45, label %bb322, label %bb249 + +bb249: ; preds = %bb248 + %46 = getelementptr inbounds %struct.cellbox* %2, i32 0, i32 21, i32 undef ; <%struct.tilebox**> [#uses=1] + %47 = load %struct.tilebox** %46, align 4 ; <%struct.tilebox*> [#uses=1] + %48 = getelementptr inbounds %struct.tilebox* %47, i32 0, i32 11 ; [#uses=1] + store i32 undef, i32* %48, align 4 + unreachable + +bb322: ; preds = %bb248 + br i1 undef, label %bb248, label %bb445 + +bb445: ; preds = %bb322, %bb10, %bb + %49 = call i32 (%struct.FILE*, i8*, ...)* @fscanf(%struct.FILE* %fp, i8* getelementptr inbounds ([14 x i8]* @.str2708, i32 0, i32 0), i32* undef, i32* undef, i32* %xcenter, i32* null) nounwind ; [#uses=1] + %50 = icmp eq i32 %49, 4 ; [#uses=1] + br i1 %50, label %bb, label %return + +return: ; preds = %bb445, %entry + ret void +} + +declare i32 @fscanf(%struct.FILE* nocapture, i8* nocapture, ...) nounwind From grosbach at apple.com Mon Jun 21 16:27:27 2010 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 21 Jun 2010 21:27:27 -0000 Subject: [llvm-commits] [llvm] r106483 - in /llvm/trunk/lib/Target/ARM: ARMInstrInfo.td ARMInstrThumb.td ARMInstrThumb2.td Message-ID: <20100621212727.987412A6C12C@llvm.org> Author: grosbach Date: Mon Jun 21 16:27:27 2010 New Revision: 106483 URL: http://llvm.org/viewvc/llvm-project?rev=106483&view=rev Log: LEApcrelJT shouldn't be marked as neverHasSideEffects, as we don't want it being moved around away from the jump table it references. rdar://8104340 Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td llvm/trunk/lib/Target/ARM/ARMInstrThumb.td llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=106483&r1=106482&r2=106483&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Jun 21 16:27:27 2010 @@ -863,13 +863,13 @@ Pseudo, IIC_iALUi, "adr$p\t$dst, #$label", []>; +} // neverHasSideEffects def LEApcrelJT : AXI1<0x0, (outs GPR:$dst), (ins i32imm:$label, nohash_imm:$id, pred:$p), Pseudo, IIC_iALUi, "adr$p\t$dst, #${label}_${id}", []> { let Inst{25} = 1; } -} // neverHasSideEffects //===----------------------------------------------------------------------===// // Control Flow Instructions. Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb.td?rev=106483&r1=106482&r2=106483&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrThumb.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrThumb.td Mon Jun 21 16:27:27 2010 @@ -894,11 +894,11 @@ "adr$p\t$dst, #$label", []>, T1Encoding<{1,0,1,0,0,?}>; // A6.2 & A8.6.10 +} // neverHasSideEffects def tLEApcrelJT : T1I<(outs tGPR:$dst), (ins i32imm:$label, nohash_imm:$id, pred:$p), IIC_iALUi, "adr$p\t$dst, #${label}_${id}", []>, T1Encoding<{1,0,1,0,0,?}>; // A6.2 & A8.6.10 -} // neverHasSideEffects //===----------------------------------------------------------------------===// // TLS Instructions Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=106483&r1=106482&r2=106483&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Mon Jun 21 16:27:27 2010 @@ -787,6 +787,7 @@ let Inst{19-16} = 0b1111; // Rn let Inst{15} = 0; } +} // neverHasSideEffects def t2LEApcrelJT : T2XI<(outs GPR:$dst), (ins i32imm:$label, nohash_imm:$id, pred:$p), IIC_iALUi, "adr$p.w\t$dst, #${label}_${id}", []> { @@ -798,7 +799,6 @@ let Inst{19-16} = 0b1111; // Rn let Inst{15} = 0; } -} // neverHasSideEffects // ADD r, sp, {so_imm|i12} def t2ADDrSPi : T2sI<(outs GPR:$dst), (ins GPR:$sp, t2_so_imm:$imm), From bob.wilson at apple.com Mon Jun 21 16:27:34 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Mon, 21 Jun 2010 21:27:34 -0000 Subject: [llvm-commits] [llvm] r106484 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <20100621212735.0DA4D2A6C12C@llvm.org> Author: bwilson Date: Mon Jun 21 16:27:34 2010 New Revision: 106484 URL: http://llvm.org/viewvc/llvm-project?rev=106484&view=rev Log: sign_extend_inreg needs to be expanded for pre-v6 Thumb as well as ARM. Radar 8104310. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=106484&r1=106483&r2=106484&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Mon Jun 21 16:27:34 2010 @@ -455,7 +455,7 @@ // If the subtarget does not have extract instructions, sign_extend_inreg // needs to be expanded. Extract is available in ARM mode on v6 and up, // and on most Thumb2 implementations. - if ((!Subtarget->isThumb() && !Subtarget->hasV6Ops()) + if (!Subtarget->hasV6Ops() || (Subtarget->isThumb2() && !Subtarget->hasT2ExtractPack())) { setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i16, Expand); setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i8, Expand); From bruno.cardoso at gmail.com Mon Jun 21 16:28:07 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Mon, 21 Jun 2010 21:28:07 -0000 Subject: [llvm-commits] [llvm] r106486 - /llvm/trunk/lib/Target/X86/X86InstrSSE.td Message-ID: <20100621212807.CE7BE2A6C12C@llvm.org> Author: bruno Date: Mon Jun 21 16:28:07 2010 New Revision: 106486 URL: http://llvm.org/viewvc/llvm-project?rev=106486&view=rev Log: change parameter name to avoid confusion with global definition Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106486&r1=106485&r2=106486&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon Jun 21 16:28:07 2010 @@ -373,26 +373,26 @@ /// sse12_fp_scalar - SSE 1 & 2 scalar instructions class multiclass sse12_fp_scalar opc, string OpcodeStr, SDNode OpNode, - RegisterClass RC, X86MemOperand memop> { + RegisterClass RC, X86MemOperand x86memop> { let isCommutable = 1 in { def rr : SI; } - def rm : SI; } /// sse12_fp_scalar_int - SSE 1 & 2 scalar instructions intrinsics class multiclass sse12_fp_scalar_int opc, string OpcodeStr, RegisterClass RC, string asm, string SSEVer, string FPSizeStr, - Operand memop, ComplexPattern mem_cpat> { + Operand memopr, ComplexPattern mem_cpat> { def rr_Int : SI("int_x86_sse", !strconcat(SSEVer, !strconcat("_", !strconcat(OpcodeStr, FPSizeStr)))) RC:$src1, RC:$src2))]>; - def rm_Int : SI("int_x86_sse", !strconcat(SSEVer, !strconcat("_", @@ -428,7 +428,7 @@ /// sse12_fp_packed_int - SSE 1 & 2 packed instructions intrinsics class multiclass sse12_fp_packed_int opc, string OpcodeStr, RegisterClass RC, string asm, string SSEVer, string FPSizeStr, - X86MemOperand memop, PatFrag mem_frag, + X86MemOperand x86memop, PatFrag mem_frag, Domain d> { def rr_Int : PI; - def rm_Int : PI("int_x86_sse", !strconcat(SSEVer, !strconcat("_", From fjahanian at apple.com Mon Jun 21 16:47:42 2010 From: fjahanian at apple.com (Fariborz Jahanian) Date: Mon, 21 Jun 2010 21:47:42 -0000 Subject: [llvm-commits] [test-suite] r106490 - /test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference.mm Message-ID: <20100621214742.C6D232A6C12C@llvm.org> Author: fjahanian Date: Mon Jun 21 16:47:42 2010 New Revision: 106490 URL: http://llvm.org/viewvc/llvm-project?rev=106490&view=rev Log: Fix test case which Dale mentioned is failing. Part of code only works with clang; thus guarded with __clang__. Modified: test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference.mm Modified: test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference.mm URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/ObjC%2B%2B/property-reference.mm?rev=106490&r1=106489&r2=106490&view=diff ============================================================================== --- test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference.mm (original) +++ test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference.mm Mon Jun 21 16:47:42 2010 @@ -56,7 +56,9 @@ ValuePtr valuePtr(new Value(42)); ValueUser* valueUser = [[ValueUser alloc] initWithValue:valuePtr]; - printf("The value's amount is %d\n", (valueUser.value)->GetAmount()); +#ifdef __clang__ + volatile int GetAmountVal = (valueUser.value)->GetAmount(); +#endif printf("The value's amount is %d\n", [valueUser value]->GetAmount()); [valueUser release]; From dalej at apple.com Mon Jun 21 16:52:27 2010 From: dalej at apple.com (Dale Johannesen) Date: Mon, 21 Jun 2010 21:52:27 -0000 Subject: [llvm-commits] [test-suite] r106491 - /test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference.reference_output Message-ID: <20100621215227.57C6B2A6C12C@llvm.org> Author: johannes Date: Mon Jun 21 16:52:27 2010 New Revision: 106491 URL: http://llvm.org/viewvc/llvm-project?rev=106491&view=rev Log: Change reference output to match test change in 106490. Modified: test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference.reference_output Modified: test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/ObjC%2B%2B/property-reference.reference_output?rev=106491&r1=106490&r2=106491&view=diff ============================================================================== --- test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference.reference_output (original) +++ test-suite/trunk/SingleSource/UnitTests/ObjC++/property-reference.reference_output Mon Jun 21 16:52:27 2010 @@ -1,3 +1,2 @@ The value's amount is 42 -The value's amount is 42 exit 0 From gohman at apple.com Mon Jun 21 17:17:21 2010 From: gohman at apple.com (Dan Gohman) Date: Mon, 21 Jun 2010 22:17:21 -0000 Subject: [llvm-commits] [llvm] r106493 - in /llvm/trunk: lib/CodeGen/TwoAddressInstructionPass.cpp test/CodeGen/X86/2007-01-08-InstrSched.ll test/CodeGen/X86/lsr-reuse.ll test/CodeGen/X86/pic.ll test/CodeGen/X86/stack-align.ll test/CodeGen/X86/tailcallstack64.ll Message-ID: <20100621221721.377842A6C12C@llvm.org> Author: djg Date: Mon Jun 21 17:17:20 2010 New Revision: 106493 URL: http://llvm.org/viewvc/llvm-project?rev=106493&view=rev Log: Teach two-address lowering how to unfold a load to open up commuting opportunities. For example, this lets it emit this: movq (%rax), %rcx addq %rdx, %rcx instead of this: movq %rdx, %rcx addq (%rax), %rcx in the case where %rdx has subsequent uses. It's the same number of instructions, and usually the same encoding size on x86, but it appears faster, and in general, it may allow better scheduling for the load. Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp llvm/trunk/test/CodeGen/X86/2007-01-08-InstrSched.ll llvm/trunk/test/CodeGen/X86/lsr-reuse.ll llvm/trunk/test/CodeGen/X86/pic.ll llvm/trunk/test/CodeGen/X86/stack-align.ll llvm/trunk/test/CodeGen/X86/tailcallstack64.ll Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=106493&r1=106492&r2=106493&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Mon Jun 21 17:17:20 2010 @@ -898,6 +898,90 @@ } } } + + // If this is an instruction with a load folded into it, try unfolding + // the load, e.g. avoid this: + // movq %rdx, %rcx + // addq (%rax), %rcx + // in favor of this: + // movq (%rax), %rcx + // addq %rdx, %rcx + // because it's preferable to schedule a load than a register copy. + if (TID.mayLoad() && !regBKilled) { + // Determine if a load can be unfolded. + unsigned LoadRegIndex; + unsigned NewOpc = + TII->getOpcodeAfterMemoryUnfold(mi->getOpcode(), + /*UnfoldLoad=*/true, + /*UnfoldStore=*/false, + &LoadRegIndex); + if (NewOpc != 0) { + const TargetInstrDesc &UnfoldTID = TII->get(NewOpc); + if (UnfoldTID.getNumDefs() == 1) { + MachineFunction &MF = *mbbi->getParent(); + + // Unfold the load. + DEBUG(dbgs() << "2addr: UNFOLDING: " << *mi); + const TargetRegisterClass *RC = + UnfoldTID.OpInfo[LoadRegIndex].getRegClass(TRI); + unsigned Reg = MRI->createVirtualRegister(RC); + SmallVector NewMIs; + bool Success = + TII->unfoldMemoryOperand(MF, mi, Reg, + /*UnfoldLoad=*/true, /*UnfoldStore=*/false, + NewMIs); + (void)Success; + assert(Success && + "unfoldMemoryOperand failed when getOpcodeAfterMemoryUnfold " + "succeeded!"); + assert(NewMIs.size() == 2 && + "Unfolded a load into multiple instructions!"); + // The load was previously folded, so this is the only use. + NewMIs[1]->addRegisterKilled(Reg, TRI); + + // Tentatively insert the instructions into the block so that they + // look "normal" to the transformation logic. + mbbi->insert(mi, NewMIs[0]); + mbbi->insert(mi, NewMIs[1]); + + DEBUG(dbgs() << "2addr: NEW LOAD: " << *NewMIs[0] + << "2addr: NEW INST: " << *NewMIs[1]); + + // Transform the instruction, now that it no longer has a load. + unsigned NewDstIdx = NewMIs[1]->findRegisterDefOperandIdx(regA); + unsigned NewSrcIdx = NewMIs[1]->findRegisterUseOperandIdx(regB); + MachineBasicBlock::iterator NewMI = NewMIs[1]; + bool TransformSuccess = + TryInstructionTransform(NewMI, mi, mbbi, + NewSrcIdx, NewDstIdx, Dist); + if (TransformSuccess || + NewMIs[1]->getOperand(NewSrcIdx).isKill()) { + // Success, or at least we made an improvement. Keep the unfolded + // instructions and discard the original. + if (LV) { + for (unsigned i = 0, e = mi->getNumOperands(); i != e; ++i) { + MachineOperand &MO = mi->getOperand(i); + if (MO.isReg() && MO.isUse() && MO.isKill()) + LV->replaceKillInstruction(Reg, mi, NewMIs[0]); + } + LV->addVirtualRegisterKilled(Reg, NewMIs[1]); + } + mi->eraseFromParent(); + mi = NewMIs[1]; + if (TransformSuccess) + return true; + } else { + // Transforming didn't eliminate the tie and didn't lead to an + // improvement. Clean up the unfolded instructions and keep the + // original. + DEBUG(dbgs() << "2addr: ABANDONING UNFOLD\n"); + NewMIs[0]->eraseFromParent(); + NewMIs[1]->eraseFromParent(); + } + } + } + } + return false; } Modified: llvm/trunk/test/CodeGen/X86/2007-01-08-InstrSched.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-01-08-InstrSched.ll?rev=106493&r1=106492&r2=106493&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2007-01-08-InstrSched.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-01-08-InstrSched.ll Mon Jun 21 17:17:20 2010 @@ -11,12 +11,12 @@ %tmp14 = fadd float %tmp12, %tmp7 ret float %tmp14 -; CHECK: mulss LCPI0_0(%rip) -; CHECK: mulss LCPI0_1(%rip) +; CHECK: mulss +; CHECK: mulss ; CHECK: addss -; CHECK: mulss LCPI0_2(%rip) +; CHECK: mulss ; CHECK: addss -; CHECK: mulss LCPI0_3(%rip) +; CHECK: mulss ; CHECK: addss ; CHECK: ret } Modified: llvm/trunk/test/CodeGen/X86/lsr-reuse.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/lsr-reuse.ll?rev=106493&r1=106492&r2=106493&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/lsr-reuse.ll (original) +++ llvm/trunk/test/CodeGen/X86/lsr-reuse.ll Mon Jun 21 17:17:20 2010 @@ -465,14 +465,14 @@ ; And the one at %bb68, where we want to be sure to use superhero mode: ; CHECK: BB10_10: -; CHECK-NEXT: movaps %xmm{{.*}}, %xmm{{.*}} -; CHECK-NEXT: mulps 48(%r{{[^,]*}}), %xmm{{.*}} -; CHECK-NEXT: movaps %xmm{{.*}}, %xmm{{.*}} -; CHECK-NEXT: mulps 32(%r{{[^,]*}}), %xmm{{.*}} -; CHECK-NEXT: movaps %xmm{{.*}}, %xmm{{.*}} -; CHECK-NEXT: mulps 16(%r{{[^,]*}}), %xmm{{.*}} -; CHECK-NEXT: movaps %xmm{{.*}}, %xmm{{.*}} -; CHECK-NEXT: mulps (%r{{[^,]*}}), %xmm{{.*}} +; CHECK-NEXT: movaps 48(%r{{[^,]*}}), %xmm{{.*}} +; CHECK-NEXT: mulps %xmm{{.*}}, %xmm{{.*}} +; CHECK-NEXT: movaps 32(%r{{[^,]*}}), %xmm{{.*}} +; CHECK-NEXT: mulps %xmm{{.*}}, %xmm{{.*}} +; CHECK-NEXT: movaps 16(%r{{[^,]*}}), %xmm{{.*}} +; CHECK-NEXT: mulps %xmm{{.*}}, %xmm{{.*}} +; CHECK-NEXT: movaps (%r{{[^,]*}}), %xmm{{.*}} +; CHECK-NEXT: mulps %xmm{{.*}}, %xmm{{.*}} ; CHECK-NEXT: movaps %xmm{{.*}}, (%r{{[^,]*}}) ; CHECK-NEXT: movaps %xmm{{.*}}, 16(%r{{[^,]*}}) ; CHECK-NEXT: movaps %xmm{{.*}}, 32(%r{{[^,]*}}) Modified: llvm/trunk/test/CodeGen/X86/pic.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic.ll?rev=106493&r1=106492&r2=106493&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/pic.ll (original) +++ llvm/trunk/test/CodeGen/X86/pic.ll Mon Jun 21 17:17:20 2010 @@ -189,7 +189,7 @@ ; LINUX: call .L7$pb ; LINUX: .L7$pb: ; LINUX: addl $_GLOBAL_OFFSET_TABLE_+(.L{{.*}}-.L7$pb), -; LINUX: addl .LJTI7_0 at GOTOFF( +; LINUX: .LJTI7_0 at GOTOFF( ; LINUX: jmpl * ; LINUX: .LJTI7_0: Modified: llvm/trunk/test/CodeGen/X86/stack-align.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/stack-align.ll?rev=106493&r1=106492&r2=106493&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/stack-align.ll (original) +++ llvm/trunk/test/CodeGen/X86/stack-align.ll Mon Jun 21 17:17:20 2010 @@ -9,14 +9,15 @@ define void @test({ double, double }* byval %z, double* %P) { entry: + %tmp3 = load double* @G, align 16 ; [#uses=1] + %tmp4 = tail call double @fabs( double %tmp3 ) ; [#uses=1] + volatile store double %tmp4, double* %P %tmp = getelementptr { double, double }* %z, i32 0, i32 0 ; [#uses=1] - %tmp1 = load double* %tmp, align 8 ; [#uses=1] + %tmp1 = volatile load double* %tmp, align 8 ; [#uses=1] %tmp2 = tail call double @fabs( double %tmp1 ) ; [#uses=1] ; CHECK: andpd{{.*}}4(%esp), %xmm - %tmp3 = load double* @G, align 16 ; [#uses=1] - %tmp4 = tail call double @fabs( double %tmp3 ) ; [#uses=1] %tmp6 = fadd double %tmp4, %tmp2 ; [#uses=1] - store double %tmp6, double* %P, align 8 + volatile store double %tmp6, double* %P, align 8 ret void } Modified: llvm/trunk/test/CodeGen/X86/tailcallstack64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tailcallstack64.ll?rev=106493&r1=106492&r2=106493&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/tailcallstack64.ll (original) +++ llvm/trunk/test/CodeGen/X86/tailcallstack64.ll Mon Jun 21 17:17:20 2010 @@ -2,9 +2,11 @@ ; Check that lowered arguments on the stack do not overwrite each other. ; Add %in1 %p1 to a different temporary register (%eax). -; CHECK: movl %edi, %eax +; CHECK: movl 32(%rsp), %eax ; Move param %in1 to temp register (%r10d). ; CHECK: movl 40(%rsp), %r10d +; Add %in1 %p1 to a different temporary register (%eax). +; CHECK: addl %edi, %eax ; Move param %in2 to stack. ; CHECK: movl %r10d, 32(%rsp) ; Move result of addition to stack. From jan_sjodin at yahoo.com Mon Jun 21 17:37:29 2010 From: jan_sjodin at yahoo.com (Jan Sjodin) Date: Mon, 21 Jun 2010 15:37:29 -0700 (PDT) Subject: [llvm-commits] Issue with Win64 local area stack offset Message-ID: <273445.8686.qm@web55603.mail.re4.yahoo.com> I was looking into the Win64 code and the local area offset. I was getting confused because the LocalAreaOffset (LAO). This is how I understand it right now: The LAO is set to 40 (28h) for Win64. The intent was probably to allocate the shadow area. The problem is that the shadow area is part of the arguments and allocated before the return address is pushed on the stack (by the call). The LAO basically indicates that 32-bytes are allocated between the return address and the frame pointer. However, whenhen the prologue is emitted the size of the stack is adjusted, but the 32 bytes are really allocated after the frame pointer and not before. Below is a small example to show what happens. Imagine we want to alloca a 64 byte object that is 64 byte aligned. The calculated offset for the object is 128, and the offset from the FP is: 80h - (LAO + 8) = 50h. This is where the problem happens. The stack is calculated to be 70h bytes. Because the FP and local are are not in the right order there is an overlap of the "spill area" and the 64-byte object. The object is not aligned properly (32-byte instead of 64-byte), which is also a problem. Address ------------------ SP before call 0xC0: | return address | ------------------ SP after call 0xB8: | old FP | ------------------ New FP 0xB0: | | | 32-bytes | |XXXXXXXXXXXXXXXX| <- 16 byte overlap between Object ------------------ and "spill area" | | | | | Allocated | | Object | | 64 bytes | | | | | 0x60: | | ------------------ | | | | SP after alloc 0x40: | | ------------------ I hope this is clear because it is easy to get confused and it would be nice if someone can confirm this issue. Below is a simple patch that fixes the problem by not allocating the spill area and sets the LAO to 8. The shadow area is already handled by the function call lowering code. Index: lib/Target/X86/X86RegisterInfo.cpp =================================================================== --- lib/Target/X86/X86RegisterInfo.cpp (revision 106454) +++ lib/Target/X86/X86RegisterInfo.cpp (working copy) @@ -914,9 +914,6 @@ StackSize = std::max(MinSize, StackSize > 128 ? StackSize - 128 : 0); MFI->setStackSize(StackSize); } else if (Subtarget->isTargetWin64()) { - // We need to always allocate 32 bytes as register spill area. - // FIXME: We might reuse these 32 bytes for leaf functions. - StackSize += 32; MFI->setStackSize(StackSize); } Index: lib/Target/X86/X86TargetMachine.cpp =================================================================== --- lib/Target/X86/X86TargetMachine.cpp (revision 106454) +++ lib/Target/X86/X86TargetMachine.cpp (working copy) @@ -100,7 +100,7 @@ DataLayout(Subtarget.getDataLayout()), FrameInfo(TargetFrameInfo::StackGrowsDown, Subtarget.getStackAlignment(), - (Subtarget.isTargetWin64() ? -40 : + (Subtarget.isTargetWin64() ? -8 : (Subtarget.is64Bit() ? -8 : -4))), InstrInfo(*this), JITInfo(*this), TLInfo(*this), TSInfo(*this), ELFWriterInfo(*this) { From sabre at nondot.org Mon Jun 21 17:51:14 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 21 Jun 2010 22:51:14 -0000 Subject: [llvm-commits] [llvm] r106498 - in /llvm/trunk/examples/Kaleidoscope: Chapter3/toy.cpp Chapter5/toy.cpp Chapter6/toy.cpp Chapter7/toy.cpp Message-ID: <20100621225114.31CD52A6C12C@llvm.org> Author: lattner Date: Mon Jun 21 17:51:14 2010 New Revision: 106498 URL: http://llvm.org/viewvc/llvm-project?rev=106498&view=rev Log: fix several bugs in the tutorial, patch by Kevin Kelley! Modified: llvm/trunk/examples/Kaleidoscope/Chapter3/toy.cpp llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp Modified: llvm/trunk/examples/Kaleidoscope/Chapter3/toy.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter3/toy.cpp?rev=106498&r1=106497&r2=106498&view=diff ============================================================================== --- llvm/trunk/examples/Kaleidoscope/Chapter3/toy.cpp (original) +++ llvm/trunk/examples/Kaleidoscope/Chapter3/toy.cpp Mon Jun 21 17:51:14 2010 @@ -367,9 +367,9 @@ if (L == 0 || R == 0) return 0; switch (Op) { - case '+': return Builder.CreateAdd(L, R, "addtmp"); - case '-': return Builder.CreateSub(L, R, "subtmp"); - case '*': return Builder.CreateMul(L, R, "multmp"); + case '+': return Builder.CreateFAdd(L, R, "addtmp"); + case '-': return Builder.CreateFSub(L, R, "subtmp"); + case '*': return Builder.CreateFMul(L, R, "multmp"); case '<': L = Builder.CreateFCmpULT(L, R, "cmptmp"); // Convert bool 0/1 to double 0.0 or 1.0 Modified: llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp?rev=106498&r1=106497&r2=106498&view=diff ============================================================================== --- llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp (original) +++ llvm/trunk/examples/Kaleidoscope/Chapter5/toy.cpp Mon Jun 21 17:51:14 2010 @@ -615,7 +615,7 @@ StepVal = ConstantFP::get(getGlobalContext(), APFloat(1.0)); } - Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar"); + Value *NextVar = Builder.CreateFAdd(Variable, StepVal, "nextvar"); // Compute the end condition. Value *EndCond = End->Codegen(); Modified: llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp?rev=106498&r1=106497&r2=106498&view=diff ============================================================================== --- llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp (original) +++ llvm/trunk/examples/Kaleidoscope/Chapter6/toy.cpp Mon Jun 21 17:51:14 2010 @@ -719,7 +719,7 @@ StepVal = ConstantFP::get(getGlobalContext(), APFloat(1.0)); } - Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar"); + Value *NextVar = Builder.CreateFAdd(Variable, StepVal, "nextvar"); // Compute the end condition. Value *EndCond = End->Codegen(); Modified: llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp?rev=106498&r1=106497&r2=106498&view=diff ============================================================================== --- llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp (original) +++ llvm/trunk/examples/Kaleidoscope/Chapter7/toy.cpp Mon Jun 21 17:51:14 2010 @@ -828,7 +828,7 @@ // Reload, increment, and restore the alloca. This handles the case where // the body of the loop mutates the variable. Value *CurVar = Builder.CreateLoad(Alloca, VarName.c_str()); - Value *NextVar = Builder.CreateAdd(CurVar, StepVal, "nextvar"); + Value *NextVar = Builder.CreateFAdd(CurVar, StepVal, "nextvar"); Builder.CreateStore(NextVar, Alloca); // Convert condition to a bool by comparing equal to 0.0. From anton at korobeynikov.info Mon Jun 21 17:56:17 2010 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Tue, 22 Jun 2010 02:56:17 +0400 Subject: [llvm-commits] Issue with Win64 local area stack offset In-Reply-To: <273445.8686.qm@web55603.mail.re4.yahoo.com> References: <273445.8686.qm@web55603.mail.re4.yahoo.com> Message-ID: Hello, Jan > I hope this is clear because it is easy to get confused and it would be > nice if someone can confirm this issue. Below is a simple patch that fixes the > problem by not allocating the spill area and sets the LAO to 8. The shadow > area is already handled by the function call lowering code. I might be wrong, but it doesn't seem so. Call lowering code only puts the arguments assuming that there is a shadow space already allocated, but nothing inside prologue allocates it (this was what "StackSize +=32" used for). Please verify your observations on: 1. Function in case of eliminated FP 2. Function with just 2 arguments Thanks! -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From bruno.cardoso at gmail.com Mon Jun 21 17:59:03 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Mon, 21 Jun 2010 22:59:03 -0000 Subject: [llvm-commits] [llvm] r106499 - /llvm/trunk/lib/Target/X86/X86InstrSSE.td Message-ID: <20100621225903.71E3E2A6C12C@llvm.org> Author: bruno Date: Mon Jun 21 17:59:03 2010 New Revision: 106499 URL: http://llvm.org/viewvc/llvm-project?rev=106499&view=rev Log: revert r106482 Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106499&r1=106498&r2=106499&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon Jun 21 17:59:03 2010 @@ -444,22 +444,6 @@ RC:$src1, (mem_frag addr:$src2)))], d>; } -/// sse12_unpack_interleave - SSE 1 & 2 unpack and interleave -multiclass sse12_unpack_interleave opc, PatFrag OpNode, ValueType vt, - PatFrag mem_frag, RegisterClass RC, - X86MemOperand x86memop, string asm, - Domain d> { - def rr : PI; - def rm : PI; -} - //===----------------------------------------------------------------------===// // SSE1 Instructions //===----------------------------------------------------------------------===// @@ -1217,32 +1201,50 @@ VR128:$src1, (memopv2f64 addr:$src2))))]>; let AddedComplexity = 10 in { - let Constraints = "", isAsmParserOnly = 1 in { - defm VUNPCKHPS: sse12_unpack_interleave<0x15, unpckh, v4f32, memopv4f32, - VR128, f128mem, "unpckhps\t{$src2, $src1, $dst|$dst, $src1, $src2}", - SSEPackedSingle>, VEX_4V; - defm VUNPCKHPD: sse12_unpack_interleave<0x15, unpckh, v2f64, memopv2f64, - VR128, f128mem, "unpckhpd\t{$src2, $src1, $dst|$dst, $src1, $src2}", - SSEPackedDouble>, OpSize, VEX_4V; - defm VUNPCKLPS: sse12_unpack_interleave<0x14, unpckl, v4f32, memopv4f32, - VR128, f128mem, "unpcklps\t{$src2, $src1, $dst|$dst, $src1, $src2}", - SSEPackedSingle>, VEX_4V; - defm VUNPCKLPD: sse12_unpack_interleave<0x14, unpckl, v2f64, memopv2f64, - VR128, f128mem, "unpcklpd\t{$src2, $src1, $dst|$dst, $src1, $src2}", - SSEPackedDouble>, OpSize, VEX_4V; - } - defm UNPCKHPS: sse12_unpack_interleave<0x15, unpckh, v4f32, memopv4f32, - VR128, f128mem, "unpckhps\t{$src2, $dst|$dst, $src2}", - SSEPackedSingle>, TB; - defm UNPCKHPD: sse12_unpack_interleave<0x15, unpckh, v2f64, memopv2f64, - VR128, f128mem, "unpckhpd\t{$src2, $dst|$dst, $src2}", - SSEPackedDouble>, TB, OpSize; - defm UNPCKLPS: sse12_unpack_interleave<0x14, unpckl, v4f32, memopv4f32, - VR128, f128mem, "unpcklps\t{$src2, $dst|$dst, $src2}", - SSEPackedSingle>, TB; - defm UNPCKLPD: sse12_unpack_interleave<0x14, unpckl, v2f64, memopv2f64, - VR128, f128mem, "unpcklpd\t{$src2, $dst|$dst, $src2}", - SSEPackedDouble>, TB, OpSize; + def UNPCKHPSrr : PSI<0x15, MRMSrcReg, + (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), + "unpckhps\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4f32 (unpckh VR128:$src1, VR128:$src2)))]>; + def UNPCKHPSrm : PSI<0x15, MRMSrcMem, + (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), + "unpckhps\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4f32 (unpckh VR128:$src1, + (memopv4f32 addr:$src2))))]>; + + def UNPCKLPSrr : PSI<0x14, MRMSrcReg, + (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), + "unpcklps\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v4f32 (unpckl VR128:$src1, VR128:$src2)))]>; + def UNPCKLPSrm : PSI<0x14, MRMSrcMem, + (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), + "unpcklps\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (unpckl VR128:$src1, (memopv4f32 addr:$src2)))]>; + def UNPCKHPDrr : PDI<0x15, MRMSrcReg, + (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), + "unpckhpd\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2f64 (unpckh VR128:$src1, VR128:$src2)))]>; + def UNPCKHPDrm : PDI<0x15, MRMSrcMem, + (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), + "unpckhpd\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2f64 (unpckh VR128:$src1, + (memopv2f64 addr:$src2))))]>; + + def UNPCKLPDrr : PDI<0x14, MRMSrcReg, + (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), + "unpcklpd\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (v2f64 (unpckl VR128:$src1, VR128:$src2)))]>; + def UNPCKLPDrm : PDI<0x14, MRMSrcMem, + (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), + "unpcklpd\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, + (unpckl VR128:$src1, (memopv2f64 addr:$src2)))]>; } // AddedComplexity } // Constraints = "$src1 = $dst" From clattner at apple.com Mon Jun 21 18:03:07 2010 From: clattner at apple.com (Chris Lattner) Date: Mon, 21 Jun 2010 16:03:07 -0700 Subject: [llvm-commits] [llvm] r106470 - in /llvm/trunk: docs/TableGenFundamentals.html include/llvm/Target/Target.td utils/TableGen/CodeGenInstruction.cpp In-Reply-To: <20100621203509.B85652A6C12C@llvm.org> References: <20100621203509.B85652A6C12C@llvm.org> Message-ID: <8C3B25A6-B746-4A7C-8250-3710EB228A67@apple.com> On Jun 21, 2010, at 1:35 PM, Eric Christopher wrote: > Author: echristo > Date: Mon Jun 21 15:35:09 2010 > New Revision: 106470 > > URL: http://llvm.org/viewvc/llvm-project?rev=106470&view=rev > Log: > Remove isTwoAddress from llvm. Woot! Thanks Eric, -Chris > > Modified: > llvm/trunk/docs/TableGenFundamentals.html > llvm/trunk/include/llvm/Target/Target.td > llvm/trunk/utils/TableGen/CodeGenInstruction.cpp > > Modified: llvm/trunk/docs/TableGenFundamentals.html > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/TableGenFundamentals.html?rev=106470&r1=106469&r2=106470&view=diff > ============================================================================== > --- llvm/trunk/docs/TableGenFundamentals.html (original) > +++ llvm/trunk/docs/TableGenFundamentals.html Mon Jun 21 15:35:09 2010 > @@ -144,7 +144,6 @@ > bit mayLoad = 0; > bit mayStore = 0; > bit isImplicitDef = 0; > - bit isTwoAddress = 1; > bit isConvertibleToThreeAddress = 1; > bit isCommutable = 1; > bit isTerminator = 0; > > Modified: llvm/trunk/include/llvm/Target/Target.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/Target.td?rev=106470&r1=106469&r2=106470&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Target/Target.td (original) > +++ llvm/trunk/include/llvm/Target/Target.td Mon Jun 21 15:35:09 2010 > @@ -203,7 +203,6 @@ > bit canFoldAsLoad = 0; // Can this be folded as a simple memory operand? > bit mayLoad = 0; // Is it possible for this inst to read memory? > bit mayStore = 0; // Is it possible for this inst to write memory? > - bit isTwoAddress = 0; // Is this a two address instruction? > bit isConvertibleToThreeAddress = 0; // Can this 2-addr instruction promote? > bit isCommutable = 0; // Is this 3 operand instruction commutable? > bit isTerminator = 0; // Is this part of the terminator for a basic block? > > Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.cpp?rev=106470&r1=106469&r2=106470&view=diff > ============================================================================== > --- llvm/trunk/utils/TableGen/CodeGenInstruction.cpp (original) > +++ llvm/trunk/utils/TableGen/CodeGenInstruction.cpp Mon Jun 21 15:35:09 2010 > @@ -107,7 +107,6 @@ > canFoldAsLoad = R->getValueAsBit("canFoldAsLoad"); > mayLoad = R->getValueAsBit("mayLoad"); > mayStore = R->getValueAsBit("mayStore"); > - bool isTwoAddress = R->getValueAsBit("isTwoAddress"); > isPredicable = R->getValueAsBit("isPredicable"); > isConvertibleToThreeAddress = R->getValueAsBit("isConvertibleToThreeAddress"); > isCommutable = R->getValueAsBit("isCommutable"); > @@ -212,16 +211,6 @@ > // Parse Constraints. > ParseConstraints(R->getValueAsString("Constraints"), this); > > - // For backward compatibility: isTwoAddress means operand 1 is tied to > - // operand 0. > - if (isTwoAddress) { > - if (!OperandList[1].Constraints[0].isNone()) > - throw R->getName() + ": cannot use isTwoAddress property: instruction " > - "already has constraint set!"; > - OperandList[1].Constraints[0] = > - CodeGenInstruction::ConstraintInfo::getTied(0); > - } > - > // Parse the DisableEncoding field. > std::string DisableEncoding = R->getValueAsString("DisableEncoding"); > while (1) { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Mon Jun 21 18:12:56 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 21 Jun 2010 23:12:56 -0000 Subject: [llvm-commits] [llvm] r106500 - /llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Message-ID: <20100621231256.8F5F32A6C12C@llvm.org> Author: lattner Date: Mon Jun 21 18:12:56 2010 New Revision: 106500 URL: http://llvm.org/viewvc/llvm-project?rev=106500&view=rev Log: un-indent a huge amount of code out of an anonymous namespace. Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=106500&r1=106499&r2=106500&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Mon Jun 21 18:12:56 2010 @@ -153,1859 +153,1857 @@ void printModuleBody(); }; +} // end anonymous namespace. - static unsigned indent_level = 0; - inline formatted_raw_ostream& nl(formatted_raw_ostream& Out, int delta = 0) { - Out << "\n"; - if (delta >= 0 || indent_level >= unsigned(-delta)) - indent_level += delta; - for (unsigned i = 0; i < indent_level; ++i) - Out << " "; - return Out; - } - - inline void in() { indent_level++; } - inline void out() { if (indent_level >0) indent_level--; } - - inline void - sanitize(std::string& str) { - for (size_t i = 0; i < str.length(); ++i) - if (!isalnum(str[i]) && str[i] != '_') - str[i] = '_'; +// FIXME: Shouldn't be using globals for this. +static unsigned indent_level = 0; +static formatted_raw_ostream& nl(formatted_raw_ostream &Out, int delta = 0) { + Out << "\n"; + if (delta >= 0 || indent_level >= unsigned(-delta)) + indent_level += delta; + for (unsigned i = 0; i < indent_level; ++i) + Out << " "; + return Out; +} + +static inline void in() { indent_level++; } +static inline void out() { if (indent_level >0) indent_level--; } + +static inline void sanitize(std::string &str) { + for (size_t i = 0; i < str.length(); ++i) + if (!isalnum(str[i]) && str[i] != '_') + str[i] = '_'; +} + +static std::string getTypePrefix(const Type *Ty) { + switch (Ty->getTypeID()) { + case Type::VoidTyID: return "void_"; + case Type::IntegerTyID: + return "int" + utostr(cast(Ty)->getBitWidth()) + "_"; + case Type::FloatTyID: return "float_"; + case Type::DoubleTyID: return "double_"; + case Type::LabelTyID: return "label_"; + case Type::FunctionTyID: return "func_"; + case Type::StructTyID: return "struct_"; + case Type::ArrayTyID: return "array_"; + case Type::PointerTyID: return "ptr_"; + case Type::VectorTyID: return "packed_"; + case Type::OpaqueTyID: return "opaque_"; + default: return "other_"; } + return "unknown_"; +} - inline std::string - getTypePrefix(const Type* Ty ) { - switch (Ty->getTypeID()) { - case Type::VoidTyID: return "void_"; - case Type::IntegerTyID: - return std::string("int") + utostr(cast(Ty)->getBitWidth()) + - "_"; - case Type::FloatTyID: return "float_"; - case Type::DoubleTyID: return "double_"; - case Type::LabelTyID: return "label_"; - case Type::FunctionTyID: return "func_"; - case Type::StructTyID: return "struct_"; - case Type::ArrayTyID: return "array_"; - case Type::PointerTyID: return "ptr_"; - case Type::VectorTyID: return "packed_"; - case Type::OpaqueTyID: return "opaque_"; - default: return "other_"; - } - return "unknown_"; - } - - // Looks up the type in the symbol table and returns a pointer to its name or - // a null pointer if it wasn't found. Note that this isn't the same as the - // Mode::getTypeName function which will return an empty string, not a null - // pointer if the name is not found. - inline const std::string* - findTypeName(const TypeSymbolTable& ST, const Type* Ty) { - TypeSymbolTable::const_iterator TI = ST.begin(); - TypeSymbolTable::const_iterator TE = ST.end(); - for (;TI != TE; ++TI) - if (TI->second == Ty) - return &(TI->first); - return 0; - } - - void CppWriter::error(const std::string& msg) { - report_fatal_error(msg); - } - - // printCFP - Print a floating point constant .. very carefully :) - // This makes sure that conversion to/from floating yields the same binary - // result so that we don't lose precision. - void CppWriter::printCFP(const ConstantFP *CFP) { - bool ignored; - APFloat APF = APFloat(CFP->getValueAPF()); // copy - if (CFP->getType() == Type::getFloatTy(CFP->getContext())) - APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &ignored); - Out << "ConstantFP::get(mod->getContext(), "; - Out << "APFloat("; +// Looks up the type in the symbol table and returns a pointer to its name or +// a null pointer if it wasn't found. Note that this isn't the same as the +// Mode::getTypeName function which will return an empty string, not a null +// pointer if the name is not found. +static const std::string * +findTypeName(const TypeSymbolTable& ST, const Type* Ty) { + TypeSymbolTable::const_iterator TI = ST.begin(); + TypeSymbolTable::const_iterator TE = ST.end(); + for (;TI != TE; ++TI) + if (TI->second == Ty) + return &(TI->first); + return 0; +} + +void CppWriter::error(const std::string& msg) { + report_fatal_error(msg); +} + +// printCFP - Print a floating point constant .. very carefully :) +// This makes sure that conversion to/from floating yields the same binary +// result so that we don't lose precision. +void CppWriter::printCFP(const ConstantFP *CFP) { + bool ignored; + APFloat APF = APFloat(CFP->getValueAPF()); // copy + if (CFP->getType() == Type::getFloatTy(CFP->getContext())) + APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &ignored); + Out << "ConstantFP::get(mod->getContext(), "; + Out << "APFloat("; #if HAVE_PRINTF_A - char Buffer[100]; - sprintf(Buffer, "%A", APF.convertToDouble()); - if ((!strncmp(Buffer, "0x", 2) || - !strncmp(Buffer, "-0x", 3) || - !strncmp(Buffer, "+0x", 3)) && - APF.bitwiseIsEqual(APFloat(atof(Buffer)))) { - if (CFP->getType() == Type::getDoubleTy(CFP->getContext())) - Out << "BitsToDouble(" << Buffer << ")"; - else - Out << "BitsToFloat((float)" << Buffer << ")"; - Out << ")"; - } else { + char Buffer[100]; + sprintf(Buffer, "%A", APF.convertToDouble()); + if ((!strncmp(Buffer, "0x", 2) || + !strncmp(Buffer, "-0x", 3) || + !strncmp(Buffer, "+0x", 3)) && + APF.bitwiseIsEqual(APFloat(atof(Buffer)))) { + if (CFP->getType() == Type::getDoubleTy(CFP->getContext())) + Out << "BitsToDouble(" << Buffer << ")"; + else + Out << "BitsToFloat((float)" << Buffer << ")"; + Out << ")"; + } else { #endif - std::string StrVal = ftostr(CFP->getValueAPF()); + std::string StrVal = ftostr(CFP->getValueAPF()); - while (StrVal[0] == ' ') - StrVal.erase(StrVal.begin()); + while (StrVal[0] == ' ') + StrVal.erase(StrVal.begin()); - // Check to make sure that the stringized number is not some string like - // "Inf" or NaN. Check that the string matches the "[-+]?[0-9]" regex. - if (((StrVal[0] >= '0' && StrVal[0] <= '9') || - ((StrVal[0] == '-' || StrVal[0] == '+') && - (StrVal[1] >= '0' && StrVal[1] <= '9'))) && - (CFP->isExactlyValue(atof(StrVal.c_str())))) { - if (CFP->getType() == Type::getDoubleTy(CFP->getContext())) - Out << StrVal; - else - Out << StrVal << "f"; - } else if (CFP->getType() == Type::getDoubleTy(CFP->getContext())) - Out << "BitsToDouble(0x" - << utohexstr(CFP->getValueAPF().bitcastToAPInt().getZExtValue()) - << "ULL) /* " << StrVal << " */"; + // Check to make sure that the stringized number is not some string like + // "Inf" or NaN. Check that the string matches the "[-+]?[0-9]" regex. + if (((StrVal[0] >= '0' && StrVal[0] <= '9') || + ((StrVal[0] == '-' || StrVal[0] == '+') && + (StrVal[1] >= '0' && StrVal[1] <= '9'))) && + (CFP->isExactlyValue(atof(StrVal.c_str())))) { + if (CFP->getType() == Type::getDoubleTy(CFP->getContext())) + Out << StrVal; else - Out << "BitsToFloat(0x" - << utohexstr((uint32_t)CFP->getValueAPF(). - bitcastToAPInt().getZExtValue()) - << "U) /* " << StrVal << " */"; - Out << ")"; -#if HAVE_PRINTF_A - } -#endif + Out << StrVal << "f"; + } else if (CFP->getType() == Type::getDoubleTy(CFP->getContext())) + Out << "BitsToDouble(0x" + << utohexstr(CFP->getValueAPF().bitcastToAPInt().getZExtValue()) + << "ULL) /* " << StrVal << " */"; + else + Out << "BitsToFloat(0x" + << utohexstr((uint32_t)CFP->getValueAPF(). + bitcastToAPInt().getZExtValue()) + << "U) /* " << StrVal << " */"; Out << ")"; +#if HAVE_PRINTF_A } +#endif + Out << ")"; +} - void CppWriter::printCallingConv(CallingConv::ID cc){ - // Print the calling convention. - switch (cc) { - case CallingConv::C: Out << "CallingConv::C"; break; - case CallingConv::Fast: Out << "CallingConv::Fast"; break; - case CallingConv::Cold: Out << "CallingConv::Cold"; break; - case CallingConv::FirstTargetCC: Out << "CallingConv::FirstTargetCC"; break; - default: Out << cc; break; - } +void CppWriter::printCallingConv(CallingConv::ID cc){ + // Print the calling convention. + switch (cc) { + case CallingConv::C: Out << "CallingConv::C"; break; + case CallingConv::Fast: Out << "CallingConv::Fast"; break; + case CallingConv::Cold: Out << "CallingConv::Cold"; break; + case CallingConv::FirstTargetCC: Out << "CallingConv::FirstTargetCC"; break; + default: Out << cc; break; } +} - void CppWriter::printLinkageType(GlobalValue::LinkageTypes LT) { - switch (LT) { - case GlobalValue::InternalLinkage: - Out << "GlobalValue::InternalLinkage"; break; - case GlobalValue::PrivateLinkage: - Out << "GlobalValue::PrivateLinkage"; break; - case GlobalValue::LinkerPrivateLinkage: - Out << "GlobalValue::LinkerPrivateLinkage"; break; - case GlobalValue::AvailableExternallyLinkage: - Out << "GlobalValue::AvailableExternallyLinkage "; break; - case GlobalValue::LinkOnceAnyLinkage: - Out << "GlobalValue::LinkOnceAnyLinkage "; break; - case GlobalValue::LinkOnceODRLinkage: - Out << "GlobalValue::LinkOnceODRLinkage "; break; - case GlobalValue::WeakAnyLinkage: - Out << "GlobalValue::WeakAnyLinkage"; break; - case GlobalValue::WeakODRLinkage: - Out << "GlobalValue::WeakODRLinkage"; break; - case GlobalValue::AppendingLinkage: - Out << "GlobalValue::AppendingLinkage"; break; - case GlobalValue::ExternalLinkage: - Out << "GlobalValue::ExternalLinkage"; break; - case GlobalValue::DLLImportLinkage: - Out << "GlobalValue::DLLImportLinkage"; break; - case GlobalValue::DLLExportLinkage: - Out << "GlobalValue::DLLExportLinkage"; break; - case GlobalValue::ExternalWeakLinkage: - Out << "GlobalValue::ExternalWeakLinkage"; break; - case GlobalValue::CommonLinkage: - Out << "GlobalValue::CommonLinkage"; break; - } +void CppWriter::printLinkageType(GlobalValue::LinkageTypes LT) { + switch (LT) { + case GlobalValue::InternalLinkage: + Out << "GlobalValue::InternalLinkage"; break; + case GlobalValue::PrivateLinkage: + Out << "GlobalValue::PrivateLinkage"; break; + case GlobalValue::LinkerPrivateLinkage: + Out << "GlobalValue::LinkerPrivateLinkage"; break; + case GlobalValue::AvailableExternallyLinkage: + Out << "GlobalValue::AvailableExternallyLinkage "; break; + case GlobalValue::LinkOnceAnyLinkage: + Out << "GlobalValue::LinkOnceAnyLinkage "; break; + case GlobalValue::LinkOnceODRLinkage: + Out << "GlobalValue::LinkOnceODRLinkage "; break; + case GlobalValue::WeakAnyLinkage: + Out << "GlobalValue::WeakAnyLinkage"; break; + case GlobalValue::WeakODRLinkage: + Out << "GlobalValue::WeakODRLinkage"; break; + case GlobalValue::AppendingLinkage: + Out << "GlobalValue::AppendingLinkage"; break; + case GlobalValue::ExternalLinkage: + Out << "GlobalValue::ExternalLinkage"; break; + case GlobalValue::DLLImportLinkage: + Out << "GlobalValue::DLLImportLinkage"; break; + case GlobalValue::DLLExportLinkage: + Out << "GlobalValue::DLLExportLinkage"; break; + case GlobalValue::ExternalWeakLinkage: + Out << "GlobalValue::ExternalWeakLinkage"; break; + case GlobalValue::CommonLinkage: + Out << "GlobalValue::CommonLinkage"; break; } +} - void CppWriter::printVisibilityType(GlobalValue::VisibilityTypes VisType) { - switch (VisType) { - default: llvm_unreachable("Unknown GVar visibility"); - case GlobalValue::DefaultVisibility: - Out << "GlobalValue::DefaultVisibility"; - break; - case GlobalValue::HiddenVisibility: - Out << "GlobalValue::HiddenVisibility"; - break; - case GlobalValue::ProtectedVisibility: - Out << "GlobalValue::ProtectedVisibility"; - break; - } +void CppWriter::printVisibilityType(GlobalValue::VisibilityTypes VisType) { + switch (VisType) { + default: llvm_unreachable("Unknown GVar visibility"); + case GlobalValue::DefaultVisibility: + Out << "GlobalValue::DefaultVisibility"; + break; + case GlobalValue::HiddenVisibility: + Out << "GlobalValue::HiddenVisibility"; + break; + case GlobalValue::ProtectedVisibility: + Out << "GlobalValue::ProtectedVisibility"; + break; } +} - // printEscapedString - Print each character of the specified string, escaping - // it if it is not printable or if it is an escape char. - void CppWriter::printEscapedString(const std::string &Str) { - for (unsigned i = 0, e = Str.size(); i != e; ++i) { - unsigned char C = Str[i]; - if (isprint(C) && C != '"' && C != '\\') { - Out << C; - } else { - Out << "\\x" - << (char) ((C/16 < 10) ? ( C/16 +'0') : ( C/16 -10+'A')) - << (char)(((C&15) < 10) ? ((C&15)+'0') : ((C&15)-10+'A')); - } +// printEscapedString - Print each character of the specified string, escaping +// it if it is not printable or if it is an escape char. +void CppWriter::printEscapedString(const std::string &Str) { + for (unsigned i = 0, e = Str.size(); i != e; ++i) { + unsigned char C = Str[i]; + if (isprint(C) && C != '"' && C != '\\') { + Out << C; + } else { + Out << "\\x" + << (char) ((C/16 < 10) ? ( C/16 +'0') : ( C/16 -10+'A')) + << (char)(((C&15) < 10) ? ((C&15)+'0') : ((C&15)-10+'A')); } } +} - std::string CppWriter::getCppName(const Type* Ty) { - // First, handle the primitive types .. easy - if (Ty->isPrimitiveType() || Ty->isIntegerTy()) { - switch (Ty->getTypeID()) { - case Type::VoidTyID: return "Type::getVoidTy(mod->getContext())"; - case Type::IntegerTyID: { - unsigned BitWidth = cast(Ty)->getBitWidth(); - return "IntegerType::get(mod->getContext(), " + utostr(BitWidth) + ")"; - } - case Type::X86_FP80TyID: return "Type::getX86_FP80Ty(mod->getContext())"; - case Type::FloatTyID: return "Type::getFloatTy(mod->getContext())"; - case Type::DoubleTyID: return "Type::getDoubleTy(mod->getContext())"; - case Type::LabelTyID: return "Type::getLabelTy(mod->getContext())"; - default: - error("Invalid primitive type"); - break; - } - // shouldn't be returned, but make it sensible - return "Type::getVoidTy(mod->getContext())"; - } - - // Now, see if we've seen the type before and return that - TypeMap::iterator I = TypeNames.find(Ty); - if (I != TypeNames.end()) - return I->second; - - // Okay, let's build a new name for this type. Start with a prefix - const char* prefix = 0; +std::string CppWriter::getCppName(const Type* Ty) { + // First, handle the primitive types .. easy + if (Ty->isPrimitiveType() || Ty->isIntegerTy()) { switch (Ty->getTypeID()) { - case Type::FunctionTyID: prefix = "FuncTy_"; break; - case Type::StructTyID: prefix = "StructTy_"; break; - case Type::ArrayTyID: prefix = "ArrayTy_"; break; - case Type::PointerTyID: prefix = "PointerTy_"; break; - case Type::OpaqueTyID: prefix = "OpaqueTy_"; break; - case Type::VectorTyID: prefix = "VectorTy_"; break; - default: prefix = "OtherTy_"; break; // prevent breakage + case Type::VoidTyID: return "Type::getVoidTy(mod->getContext())"; + case Type::IntegerTyID: { + unsigned BitWidth = cast(Ty)->getBitWidth(); + return "IntegerType::get(mod->getContext(), " + utostr(BitWidth) + ")"; + } + case Type::X86_FP80TyID: return "Type::getX86_FP80Ty(mod->getContext())"; + case Type::FloatTyID: return "Type::getFloatTy(mod->getContext())"; + case Type::DoubleTyID: return "Type::getDoubleTy(mod->getContext())"; + case Type::LabelTyID: return "Type::getLabelTy(mod->getContext())"; + default: + error("Invalid primitive type"); + break; } + // shouldn't be returned, but make it sensible + return "Type::getVoidTy(mod->getContext())"; + } - // See if the type has a name in the symboltable and build accordingly - const std::string* tName = findTypeName(TheModule->getTypeSymbolTable(), Ty); - std::string name; - if (tName) - name = std::string(prefix) + *tName; - else - name = std::string(prefix) + utostr(uniqueNum++); - sanitize(name); + // Now, see if we've seen the type before and return that + TypeMap::iterator I = TypeNames.find(Ty); + if (I != TypeNames.end()) + return I->second; + + // Okay, let's build a new name for this type. Start with a prefix + const char* prefix = 0; + switch (Ty->getTypeID()) { + case Type::FunctionTyID: prefix = "FuncTy_"; break; + case Type::StructTyID: prefix = "StructTy_"; break; + case Type::ArrayTyID: prefix = "ArrayTy_"; break; + case Type::PointerTyID: prefix = "PointerTy_"; break; + case Type::OpaqueTyID: prefix = "OpaqueTy_"; break; + case Type::VectorTyID: prefix = "VectorTy_"; break; + default: prefix = "OtherTy_"; break; // prevent breakage + } + + // See if the type has a name in the symboltable and build accordingly + const std::string* tName = findTypeName(TheModule->getTypeSymbolTable(), Ty); + std::string name; + if (tName) + name = std::string(prefix) + *tName; + else + name = std::string(prefix) + utostr(uniqueNum++); + sanitize(name); - // Save the name - return TypeNames[Ty] = name; - } + // Save the name + return TypeNames[Ty] = name; +} - void CppWriter::printCppName(const Type* Ty) { - printEscapedString(getCppName(Ty)); - } - - std::string CppWriter::getCppName(const Value* val) { - std::string name; - ValueMap::iterator I = ValueNames.find(val); - if (I != ValueNames.end() && I->first == val) - return I->second; - - if (const GlobalVariable* GV = dyn_cast(val)) { - name = std::string("gvar_") + - getTypePrefix(GV->getType()->getElementType()); - } else if (isa(val)) { - name = std::string("func_"); - } else if (const Constant* C = dyn_cast(val)) { - name = std::string("const_") + getTypePrefix(C->getType()); - } else if (const Argument* Arg = dyn_cast(val)) { - if (is_inline) { - unsigned argNum = std::distance(Arg->getParent()->arg_begin(), - Function::const_arg_iterator(Arg)) + 1; - name = std::string("arg_") + utostr(argNum); - NameSet::iterator NI = UsedNames.find(name); - if (NI != UsedNames.end()) - name += std::string("_") + utostr(uniqueNum++); - UsedNames.insert(name); - return ValueNames[val] = name; - } else { - name = getTypePrefix(val->getType()); - } +void CppWriter::printCppName(const Type* Ty) { + printEscapedString(getCppName(Ty)); +} + +std::string CppWriter::getCppName(const Value* val) { + std::string name; + ValueMap::iterator I = ValueNames.find(val); + if (I != ValueNames.end() && I->first == val) + return I->second; + + if (const GlobalVariable* GV = dyn_cast(val)) { + name = std::string("gvar_") + + getTypePrefix(GV->getType()->getElementType()); + } else if (isa(val)) { + name = std::string("func_"); + } else if (const Constant* C = dyn_cast(val)) { + name = std::string("const_") + getTypePrefix(C->getType()); + } else if (const Argument* Arg = dyn_cast(val)) { + if (is_inline) { + unsigned argNum = std::distance(Arg->getParent()->arg_begin(), + Function::const_arg_iterator(Arg)) + 1; + name = std::string("arg_") + utostr(argNum); + NameSet::iterator NI = UsedNames.find(name); + if (NI != UsedNames.end()) + name += std::string("_") + utostr(uniqueNum++); + UsedNames.insert(name); + return ValueNames[val] = name; } else { name = getTypePrefix(val->getType()); } - if (val->hasName()) - name += val->getName(); - else - name += utostr(uniqueNum++); - sanitize(name); - NameSet::iterator NI = UsedNames.find(name); - if (NI != UsedNames.end()) - name += std::string("_") + utostr(uniqueNum++); - UsedNames.insert(name); - return ValueNames[val] = name; - } - - void CppWriter::printCppName(const Value* val) { - printEscapedString(getCppName(val)); - } - - void CppWriter::printAttributes(const AttrListPtr &PAL, - const std::string &name) { - Out << "AttrListPtr " << name << "_PAL;"; - nl(Out); - if (!PAL.isEmpty()) { - Out << '{'; in(); nl(Out); - Out << "SmallVector Attrs;"; nl(Out); - Out << "AttributeWithIndex PAWI;"; nl(Out); - for (unsigned i = 0; i < PAL.getNumSlots(); ++i) { - unsigned index = PAL.getSlot(i).Index; - Attributes attrs = PAL.getSlot(i).Attrs; - Out << "PAWI.Index = " << index << "U; PAWI.Attrs = 0 "; + } else { + name = getTypePrefix(val->getType()); + } + if (val->hasName()) + name += val->getName(); + else + name += utostr(uniqueNum++); + sanitize(name); + NameSet::iterator NI = UsedNames.find(name); + if (NI != UsedNames.end()) + name += std::string("_") + utostr(uniqueNum++); + UsedNames.insert(name); + return ValueNames[val] = name; +} + +void CppWriter::printCppName(const Value* val) { + printEscapedString(getCppName(val)); +} + +void CppWriter::printAttributes(const AttrListPtr &PAL, + const std::string &name) { + Out << "AttrListPtr " << name << "_PAL;"; + nl(Out); + if (!PAL.isEmpty()) { + Out << '{'; in(); nl(Out); + Out << "SmallVector Attrs;"; nl(Out); + Out << "AttributeWithIndex PAWI;"; nl(Out); + for (unsigned i = 0; i < PAL.getNumSlots(); ++i) { + unsigned index = PAL.getSlot(i).Index; + Attributes attrs = PAL.getSlot(i).Attrs; + Out << "PAWI.Index = " << index << "U; PAWI.Attrs = 0 "; #define HANDLE_ATTR(X) \ - if (attrs & Attribute::X) \ - Out << " | Attribute::" #X; \ - attrs &= ~Attribute::X; - - HANDLE_ATTR(SExt); - HANDLE_ATTR(ZExt); - HANDLE_ATTR(NoReturn); - HANDLE_ATTR(InReg); - HANDLE_ATTR(StructRet); - HANDLE_ATTR(NoUnwind); - HANDLE_ATTR(NoAlias); - HANDLE_ATTR(ByVal); - HANDLE_ATTR(Nest); - HANDLE_ATTR(ReadNone); - HANDLE_ATTR(ReadOnly); - HANDLE_ATTR(InlineHint); - HANDLE_ATTR(NoInline); - HANDLE_ATTR(AlwaysInline); - HANDLE_ATTR(OptimizeForSize); - HANDLE_ATTR(StackProtect); - HANDLE_ATTR(StackProtectReq); - HANDLE_ATTR(NoCapture); + if (attrs & Attribute::X) \ + Out << " | Attribute::" #X; \ + attrs &= ~Attribute::X; + + HANDLE_ATTR(SExt); + HANDLE_ATTR(ZExt); + HANDLE_ATTR(NoReturn); + HANDLE_ATTR(InReg); + HANDLE_ATTR(StructRet); + HANDLE_ATTR(NoUnwind); + HANDLE_ATTR(NoAlias); + HANDLE_ATTR(ByVal); + HANDLE_ATTR(Nest); + HANDLE_ATTR(ReadNone); + HANDLE_ATTR(ReadOnly); + HANDLE_ATTR(InlineHint); + HANDLE_ATTR(NoInline); + HANDLE_ATTR(AlwaysInline); + HANDLE_ATTR(OptimizeForSize); + HANDLE_ATTR(StackProtect); + HANDLE_ATTR(StackProtectReq); + HANDLE_ATTR(NoCapture); #undef HANDLE_ATTR - assert(attrs == 0 && "Unhandled attribute!"); - Out << ";"; - nl(Out); - Out << "Attrs.push_back(PAWI);"; - nl(Out); - } - Out << name << "_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());"; + assert(attrs == 0 && "Unhandled attribute!"); + Out << ";"; + nl(Out); + Out << "Attrs.push_back(PAWI);"; nl(Out); - out(); nl(Out); - Out << '}'; nl(Out); } + Out << name << "_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());"; + nl(Out); + out(); nl(Out); + Out << '}'; nl(Out); } +} - bool CppWriter::printTypeInternal(const Type* Ty) { - // We don't print definitions for primitive types - if (Ty->isPrimitiveType() || Ty->isIntegerTy()) - return false; - - // If we already defined this type, we don't need to define it again. - if (DefinedTypes.find(Ty) != DefinedTypes.end()) - return false; - - // Everything below needs the name for the type so get it now. - std::string typeName(getCppName(Ty)); - - // Search the type stack for recursion. If we find it, then generate this - // as an OpaqueType, but make sure not to do this multiple times because - // the type could appear in multiple places on the stack. Once the opaque - // definition is issued, it must not be re-issued. Consequently we have to - // check the UnresolvedTypes list as well. - TypeList::const_iterator TI = std::find(TypeStack.begin(), TypeStack.end(), - Ty); - if (TI != TypeStack.end()) { - TypeMap::const_iterator I = UnresolvedTypes.find(Ty); - if (I == UnresolvedTypes.end()) { - Out << "PATypeHolder " << typeName; - Out << "_fwd = OpaqueType::get(mod->getContext());"; - nl(Out); - UnresolvedTypes[Ty] = typeName; - } - return true; - } +bool CppWriter::printTypeInternal(const Type* Ty) { + // We don't print definitions for primitive types + if (Ty->isPrimitiveType() || Ty->isIntegerTy()) + return false; - // We're going to print a derived type which, by definition, contains other - // types. So, push this one we're printing onto the type stack to assist with - // recursive definitions. - TypeStack.push_back(Ty); + // If we already defined this type, we don't need to define it again. + if (DefinedTypes.find(Ty) != DefinedTypes.end()) + return false; - // Print the type definition - switch (Ty->getTypeID()) { - case Type::FunctionTyID: { - const FunctionType* FT = cast(Ty); - Out << "std::vector" << typeName << "_args;"; - nl(Out); - FunctionType::param_iterator PI = FT->param_begin(); - FunctionType::param_iterator PE = FT->param_end(); - for (; PI != PE; ++PI) { - const Type* argTy = static_cast(*PI); - bool isForward = printTypeInternal(argTy); - std::string argName(getCppName(argTy)); - Out << typeName << "_args.push_back(" << argName; - if (isForward) - Out << "_fwd"; - Out << ");"; - nl(Out); - } - bool isForward = printTypeInternal(FT->getReturnType()); - std::string retTypeName(getCppName(FT->getReturnType())); - Out << "FunctionType* " << typeName << " = FunctionType::get("; - in(); nl(Out) << "/*Result=*/" << retTypeName; + // Everything below needs the name for the type so get it now. + std::string typeName(getCppName(Ty)); + + // Search the type stack for recursion. If we find it, then generate this + // as an OpaqueType, but make sure not to do this multiple times because + // the type could appear in multiple places on the stack. Once the opaque + // definition is issued, it must not be re-issued. Consequently we have to + // check the UnresolvedTypes list as well. + TypeList::const_iterator TI = std::find(TypeStack.begin(), TypeStack.end(), + Ty); + if (TI != TypeStack.end()) { + TypeMap::const_iterator I = UnresolvedTypes.find(Ty); + if (I == UnresolvedTypes.end()) { + Out << "PATypeHolder " << typeName; + Out << "_fwd = OpaqueType::get(mod->getContext());"; + nl(Out); + UnresolvedTypes[Ty] = typeName; + } + return true; + } + + // We're going to print a derived type which, by definition, contains other + // types. So, push this one we're printing onto the type stack to assist with + // recursive definitions. + TypeStack.push_back(Ty); + + // Print the type definition + switch (Ty->getTypeID()) { + case Type::FunctionTyID: { + const FunctionType* FT = cast(Ty); + Out << "std::vector" << typeName << "_args;"; + nl(Out); + FunctionType::param_iterator PI = FT->param_begin(); + FunctionType::param_iterator PE = FT->param_end(); + for (; PI != PE; ++PI) { + const Type* argTy = static_cast(*PI); + bool isForward = printTypeInternal(argTy); + std::string argName(getCppName(argTy)); + Out << typeName << "_args.push_back(" << argName; if (isForward) Out << "_fwd"; - Out << ","; - nl(Out) << "/*Params=*/" << typeName << "_args,"; - nl(Out) << "/*isVarArg=*/" << (FT->isVarArg() ? "true" : "false") << ");"; - out(); - nl(Out); - break; - } - case Type::StructTyID: { - const StructType* ST = cast(Ty); - Out << "std::vector" << typeName << "_fields;"; - nl(Out); - StructType::element_iterator EI = ST->element_begin(); - StructType::element_iterator EE = ST->element_end(); - for (; EI != EE; ++EI) { - const Type* fieldTy = static_cast(*EI); - bool isForward = printTypeInternal(fieldTy); - std::string fieldName(getCppName(fieldTy)); - Out << typeName << "_fields.push_back(" << fieldName; - if (isForward) - Out << "_fwd"; - Out << ");"; - nl(Out); - } - Out << "StructType* " << typeName << " = StructType::get(" - << "mod->getContext(), " - << typeName << "_fields, /*isPacked=*/" - << (ST->isPacked() ? "true" : "false") << ");"; - nl(Out); - break; - } - case Type::ArrayTyID: { - const ArrayType* AT = cast(Ty); - const Type* ET = AT->getElementType(); - bool isForward = printTypeInternal(ET); - std::string elemName(getCppName(ET)); - Out << "ArrayType* " << typeName << " = ArrayType::get(" - << elemName << (isForward ? "_fwd" : "") - << ", " << utostr(AT->getNumElements()) << ");"; - nl(Out); - break; - } - case Type::PointerTyID: { - const PointerType* PT = cast(Ty); - const Type* ET = PT->getElementType(); - bool isForward = printTypeInternal(ET); - std::string elemName(getCppName(ET)); - Out << "PointerType* " << typeName << " = PointerType::get(" - << elemName << (isForward ? "_fwd" : "") - << ", " << utostr(PT->getAddressSpace()) << ");"; - nl(Out); - break; - } - case Type::VectorTyID: { - const VectorType* PT = cast(Ty); - const Type* ET = PT->getElementType(); - bool isForward = printTypeInternal(ET); - std::string elemName(getCppName(ET)); - Out << "VectorType* " << typeName << " = VectorType::get(" - << elemName << (isForward ? "_fwd" : "") - << ", " << utostr(PT->getNumElements()) << ");"; + Out << ");"; nl(Out); - break; } - case Type::OpaqueTyID: { - Out << "OpaqueType* " << typeName; - Out << " = OpaqueType::get(mod->getContext());"; + bool isForward = printTypeInternal(FT->getReturnType()); + std::string retTypeName(getCppName(FT->getReturnType())); + Out << "FunctionType* " << typeName << " = FunctionType::get("; + in(); nl(Out) << "/*Result=*/" << retTypeName; + if (isForward) + Out << "_fwd"; + Out << ","; + nl(Out) << "/*Params=*/" << typeName << "_args,"; + nl(Out) << "/*isVarArg=*/" << (FT->isVarArg() ? "true" : "false") << ");"; + out(); + nl(Out); + break; + } + case Type::StructTyID: { + const StructType* ST = cast(Ty); + Out << "std::vector" << typeName << "_fields;"; + nl(Out); + StructType::element_iterator EI = ST->element_begin(); + StructType::element_iterator EE = ST->element_end(); + for (; EI != EE; ++EI) { + const Type* fieldTy = static_cast(*EI); + bool isForward = printTypeInternal(fieldTy); + std::string fieldName(getCppName(fieldTy)); + Out << typeName << "_fields.push_back(" << fieldName; + if (isForward) + Out << "_fwd"; + Out << ");"; nl(Out); - break; - } - default: - error("Invalid TypeID"); } + Out << "StructType* " << typeName << " = StructType::get(" + << "mod->getContext(), " + << typeName << "_fields, /*isPacked=*/" + << (ST->isPacked() ? "true" : "false") << ");"; + nl(Out); + break; + } + case Type::ArrayTyID: { + const ArrayType* AT = cast(Ty); + const Type* ET = AT->getElementType(); + bool isForward = printTypeInternal(ET); + std::string elemName(getCppName(ET)); + Out << "ArrayType* " << typeName << " = ArrayType::get(" + << elemName << (isForward ? "_fwd" : "") + << ", " << utostr(AT->getNumElements()) << ");"; + nl(Out); + break; + } + case Type::PointerTyID: { + const PointerType* PT = cast(Ty); + const Type* ET = PT->getElementType(); + bool isForward = printTypeInternal(ET); + std::string elemName(getCppName(ET)); + Out << "PointerType* " << typeName << " = PointerType::get(" + << elemName << (isForward ? "_fwd" : "") + << ", " << utostr(PT->getAddressSpace()) << ");"; + nl(Out); + break; + } + case Type::VectorTyID: { + const VectorType* PT = cast(Ty); + const Type* ET = PT->getElementType(); + bool isForward = printTypeInternal(ET); + std::string elemName(getCppName(ET)); + Out << "VectorType* " << typeName << " = VectorType::get(" + << elemName << (isForward ? "_fwd" : "") + << ", " << utostr(PT->getNumElements()) << ");"; + nl(Out); + break; + } + case Type::OpaqueTyID: { + Out << "OpaqueType* " << typeName; + Out << " = OpaqueType::get(mod->getContext());"; + nl(Out); + break; + } + default: + error("Invalid TypeID"); + } - // If the type had a name, make sure we recreate it. - const std::string* progTypeName = - findTypeName(TheModule->getTypeSymbolTable(),Ty); - if (progTypeName) { - Out << "mod->addTypeName(\"" << *progTypeName << "\", " - << typeName << ");"; - nl(Out); - } + // If the type had a name, make sure we recreate it. + const std::string* progTypeName = + findTypeName(TheModule->getTypeSymbolTable(),Ty); + if (progTypeName) { + Out << "mod->addTypeName(\"" << *progTypeName << "\", " + << typeName << ");"; + nl(Out); + } - // Pop us off the type stack - TypeStack.pop_back(); - - // Indicate that this type is now defined. - DefinedTypes.insert(Ty); - - // Early resolve as many unresolved types as possible. Search the unresolved - // types map for the type we just printed. Now that its definition is complete - // we can resolve any previous references to it. This prevents a cascade of - // unresolved types. - TypeMap::iterator I = UnresolvedTypes.find(Ty); - if (I != UnresolvedTypes.end()) { - Out << "cast(" << I->second - << "_fwd.get())->refineAbstractTypeTo(" << I->second << ");"; - nl(Out); - Out << I->second << " = cast<"; - switch (Ty->getTypeID()) { - case Type::FunctionTyID: Out << "FunctionType"; break; - case Type::ArrayTyID: Out << "ArrayType"; break; - case Type::StructTyID: Out << "StructType"; break; - case Type::VectorTyID: Out << "VectorType"; break; - case Type::PointerTyID: Out << "PointerType"; break; - case Type::OpaqueTyID: Out << "OpaqueType"; break; - default: Out << "NoSuchDerivedType"; break; - } - Out << ">(" << I->second << "_fwd.get());"; - nl(Out); nl(Out); - UnresolvedTypes.erase(I); - } + // Pop us off the type stack + TypeStack.pop_back(); - // Finally, separate the type definition from other with a newline. - nl(Out); + // Indicate that this type is now defined. + DefinedTypes.insert(Ty); - // We weren't a recursive type - return false; + // Early resolve as many unresolved types as possible. Search the unresolved + // types map for the type we just printed. Now that its definition is complete + // we can resolve any previous references to it. This prevents a cascade of + // unresolved types. + TypeMap::iterator I = UnresolvedTypes.find(Ty); + if (I != UnresolvedTypes.end()) { + Out << "cast(" << I->second + << "_fwd.get())->refineAbstractTypeTo(" << I->second << ");"; + nl(Out); + Out << I->second << " = cast<"; + switch (Ty->getTypeID()) { + case Type::FunctionTyID: Out << "FunctionType"; break; + case Type::ArrayTyID: Out << "ArrayType"; break; + case Type::StructTyID: Out << "StructType"; break; + case Type::VectorTyID: Out << "VectorType"; break; + case Type::PointerTyID: Out << "PointerType"; break; + case Type::OpaqueTyID: Out << "OpaqueType"; break; + default: Out << "NoSuchDerivedType"; break; + } + Out << ">(" << I->second << "_fwd.get());"; + nl(Out); nl(Out); + UnresolvedTypes.erase(I); } - // Prints a type definition. Returns true if it could not resolve all the - // types in the definition but had to use a forward reference. - void CppWriter::printType(const Type* Ty) { - assert(TypeStack.empty()); - TypeStack.clear(); - printTypeInternal(Ty); - assert(TypeStack.empty()); - } - - void CppWriter::printTypes(const Module* M) { - // Walk the symbol table and print out all its types - const TypeSymbolTable& symtab = M->getTypeSymbolTable(); - for (TypeSymbolTable::const_iterator TI = symtab.begin(), TE = symtab.end(); - TI != TE; ++TI) { - - // For primitive types and types already defined, just add a name - TypeMap::const_iterator TNI = TypeNames.find(TI->second); - if (TI->second->isIntegerTy() || TI->second->isPrimitiveType() || - TNI != TypeNames.end()) { - Out << "mod->addTypeName(\""; - printEscapedString(TI->first); - Out << "\", " << getCppName(TI->second) << ");"; - nl(Out); - // For everything else, define the type - } else { - printType(TI->second); - } - } + // Finally, separate the type definition from other with a newline. + nl(Out); - // Add all of the global variables to the value table... - for (Module::const_global_iterator I = TheModule->global_begin(), - E = TheModule->global_end(); I != E; ++I) { - if (I->hasInitializer()) - printType(I->getInitializer()->getType()); - printType(I->getType()); - } + // We weren't a recursive type + return false; +} - // Add all the functions to the table - for (Module::const_iterator FI = TheModule->begin(), FE = TheModule->end(); - FI != FE; ++FI) { - printType(FI->getReturnType()); - printType(FI->getFunctionType()); - // Add all the function arguments - for (Function::const_arg_iterator AI = FI->arg_begin(), - AE = FI->arg_end(); AI != AE; ++AI) { - printType(AI->getType()); - } +// Prints a type definition. Returns true if it could not resolve all the +// types in the definition but had to use a forward reference. +void CppWriter::printType(const Type* Ty) { + assert(TypeStack.empty()); + TypeStack.clear(); + printTypeInternal(Ty); + assert(TypeStack.empty()); +} - // Add all of the basic blocks and instructions - for (Function::const_iterator BB = FI->begin(), - E = FI->end(); BB != E; ++BB) { - printType(BB->getType()); - for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; - ++I) { - printType(I->getType()); - for (unsigned i = 0; i < I->getNumOperands(); ++i) - printType(I->getOperand(i)->getType()); - } +void CppWriter::printTypes(const Module* M) { + // Walk the symbol table and print out all its types + const TypeSymbolTable& symtab = M->getTypeSymbolTable(); + for (TypeSymbolTable::const_iterator TI = symtab.begin(), TE = symtab.end(); + TI != TE; ++TI) { + + // For primitive types and types already defined, just add a name + TypeMap::const_iterator TNI = TypeNames.find(TI->second); + if (TI->second->isIntegerTy() || TI->second->isPrimitiveType() || + TNI != TypeNames.end()) { + Out << "mod->addTypeName(\""; + printEscapedString(TI->first); + Out << "\", " << getCppName(TI->second) << ");"; + nl(Out); + // For everything else, define the type + } else { + printType(TI->second); + } + } + + // Add all of the global variables to the value table... + for (Module::const_global_iterator I = TheModule->global_begin(), + E = TheModule->global_end(); I != E; ++I) { + if (I->hasInitializer()) + printType(I->getInitializer()->getType()); + printType(I->getType()); + } + + // Add all the functions to the table + for (Module::const_iterator FI = TheModule->begin(), FE = TheModule->end(); + FI != FE; ++FI) { + printType(FI->getReturnType()); + printType(FI->getFunctionType()); + // Add all the function arguments + for (Function::const_arg_iterator AI = FI->arg_begin(), + AE = FI->arg_end(); AI != AE; ++AI) { + printType(AI->getType()); + } + + // Add all of the basic blocks and instructions + for (Function::const_iterator BB = FI->begin(), + E = FI->end(); BB != E; ++BB) { + printType(BB->getType()); + for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; + ++I) { + printType(I->getType()); + for (unsigned i = 0; i < I->getNumOperands(); ++i) + printType(I->getOperand(i)->getType()); } } } +} - // printConstant - Print out a constant pool entry... - void CppWriter::printConstant(const Constant *CV) { - // First, if the constant is actually a GlobalValue (variable or function) - // or its already in the constant list then we've printed it already and we - // can just return. - if (isa(CV) || ValueNames.find(CV) != ValueNames.end()) - return; - - std::string constName(getCppName(CV)); - std::string typeName(getCppName(CV->getType())); - - if (isa(CV)) { - // Skip variables and functions, we emit them elsewhere - return; - } - - if (const ConstantInt *CI = dyn_cast(CV)) { - std::string constValue = CI->getValue().toString(10, true); - Out << "ConstantInt* " << constName - << " = ConstantInt::get(mod->getContext(), APInt(" - << cast(CI->getType())->getBitWidth() - << ", StringRef(\"" << constValue << "\"), 10));"; - } else if (isa(CV)) { - Out << "ConstantAggregateZero* " << constName - << " = ConstantAggregateZero::get(" << typeName << ");"; - } else if (isa(CV)) { - Out << "ConstantPointerNull* " << constName - << " = ConstantPointerNull::get(" << typeName << ");"; - } else if (const ConstantFP *CFP = dyn_cast(CV)) { - Out << "ConstantFP* " << constName << " = "; - printCFP(CFP); - Out << ";"; - } else if (const ConstantArray *CA = dyn_cast(CV)) { - if (CA->isString() && - CA->getType()->getElementType() == - Type::getInt8Ty(CA->getContext())) { - Out << "Constant* " << constName << - " = ConstantArray::get(mod->getContext(), \""; - std::string tmp = CA->getAsString(); - bool nullTerminate = false; - if (tmp[tmp.length()-1] == 0) { - tmp.erase(tmp.length()-1); - nullTerminate = true; - } - printEscapedString(tmp); - // Determine if we want null termination or not. - if (nullTerminate) - Out << "\", true"; // Indicate that the null terminator should be - // added. - else - Out << "\", false";// No null terminator - Out << ");"; - } else { - Out << "std::vector " << constName << "_elems;"; - nl(Out); - unsigned N = CA->getNumOperands(); - for (unsigned i = 0; i < N; ++i) { - printConstant(CA->getOperand(i)); // recurse to print operands - Out << constName << "_elems.push_back(" - << getCppName(CA->getOperand(i)) << ");"; - nl(Out); - } - Out << "Constant* " << constName << " = ConstantArray::get(" - << typeName << ", " << constName << "_elems);"; - } - } else if (const ConstantStruct *CS = dyn_cast(CV)) { - Out << "std::vector " << constName << "_fields;"; - nl(Out); - unsigned N = CS->getNumOperands(); - for (unsigned i = 0; i < N; i++) { - printConstant(CS->getOperand(i)); - Out << constName << "_fields.push_back(" - << getCppName(CS->getOperand(i)) << ");"; - nl(Out); - } - Out << "Constant* " << constName << " = ConstantStruct::get(" - << typeName << ", " << constName << "_fields);"; - } else if (const ConstantVector *CP = dyn_cast(CV)) { +// printConstant - Print out a constant pool entry... +void CppWriter::printConstant(const Constant *CV) { + // First, if the constant is actually a GlobalValue (variable or function) + // or its already in the constant list then we've printed it already and we + // can just return. + if (isa(CV) || ValueNames.find(CV) != ValueNames.end()) + return; + + std::string constName(getCppName(CV)); + std::string typeName(getCppName(CV->getType())); + + if (isa(CV)) { + // Skip variables and functions, we emit them elsewhere + return; + } + + if (const ConstantInt *CI = dyn_cast(CV)) { + std::string constValue = CI->getValue().toString(10, true); + Out << "ConstantInt* " << constName + << " = ConstantInt::get(mod->getContext(), APInt(" + << cast(CI->getType())->getBitWidth() + << ", StringRef(\"" << constValue << "\"), 10));"; + } else if (isa(CV)) { + Out << "ConstantAggregateZero* " << constName + << " = ConstantAggregateZero::get(" << typeName << ");"; + } else if (isa(CV)) { + Out << "ConstantPointerNull* " << constName + << " = ConstantPointerNull::get(" << typeName << ");"; + } else if (const ConstantFP *CFP = dyn_cast(CV)) { + Out << "ConstantFP* " << constName << " = "; + printCFP(CFP); + Out << ";"; + } else if (const ConstantArray *CA = dyn_cast(CV)) { + if (CA->isString() && + CA->getType()->getElementType() == + Type::getInt8Ty(CA->getContext())) { + Out << "Constant* " << constName << + " = ConstantArray::get(mod->getContext(), \""; + std::string tmp = CA->getAsString(); + bool nullTerminate = false; + if (tmp[tmp.length()-1] == 0) { + tmp.erase(tmp.length()-1); + nullTerminate = true; + } + printEscapedString(tmp); + // Determine if we want null termination or not. + if (nullTerminate) + Out << "\", true"; // Indicate that the null terminator should be + // added. + else + Out << "\", false";// No null terminator + Out << ");"; + } else { Out << "std::vector " << constName << "_elems;"; nl(Out); - unsigned N = CP->getNumOperands(); + unsigned N = CA->getNumOperands(); for (unsigned i = 0; i < N; ++i) { - printConstant(CP->getOperand(i)); + printConstant(CA->getOperand(i)); // recurse to print operands Out << constName << "_elems.push_back(" - << getCppName(CP->getOperand(i)) << ");"; + << getCppName(CA->getOperand(i)) << ");"; nl(Out); } - Out << "Constant* " << constName << " = ConstantVector::get(" + Out << "Constant* " << constName << " = ConstantArray::get(" << typeName << ", " << constName << "_elems);"; - } else if (isa(CV)) { - Out << "UndefValue* " << constName << " = UndefValue::get(" - << typeName << ");"; - } else if (const ConstantExpr *CE = dyn_cast(CV)) { - if (CE->getOpcode() == Instruction::GetElementPtr) { - Out << "std::vector " << constName << "_indices;"; - nl(Out); - printConstant(CE->getOperand(0)); - for (unsigned i = 1; i < CE->getNumOperands(); ++i ) { - printConstant(CE->getOperand(i)); - Out << constName << "_indices.push_back(" - << getCppName(CE->getOperand(i)) << ");"; - nl(Out); - } - Out << "Constant* " << constName - << " = ConstantExpr::getGetElementPtr(" - << getCppName(CE->getOperand(0)) << ", " - << "&" << constName << "_indices[0], " - << constName << "_indices.size()" - << ");"; - } else if (CE->isCast()) { - printConstant(CE->getOperand(0)); - Out << "Constant* " << constName << " = ConstantExpr::getCast("; - switch (CE->getOpcode()) { - default: llvm_unreachable("Invalid cast opcode"); - case Instruction::Trunc: Out << "Instruction::Trunc"; break; - case Instruction::ZExt: Out << "Instruction::ZExt"; break; - case Instruction::SExt: Out << "Instruction::SExt"; break; - case Instruction::FPTrunc: Out << "Instruction::FPTrunc"; break; - case Instruction::FPExt: Out << "Instruction::FPExt"; break; - case Instruction::FPToUI: Out << "Instruction::FPToUI"; break; - case Instruction::FPToSI: Out << "Instruction::FPToSI"; break; - case Instruction::UIToFP: Out << "Instruction::UIToFP"; break; - case Instruction::SIToFP: Out << "Instruction::SIToFP"; break; - case Instruction::PtrToInt: Out << "Instruction::PtrToInt"; break; - case Instruction::IntToPtr: Out << "Instruction::IntToPtr"; break; - case Instruction::BitCast: Out << "Instruction::BitCast"; break; - } - Out << ", " << getCppName(CE->getOperand(0)) << ", " - << getCppName(CE->getType()) << ");"; - } else { - unsigned N = CE->getNumOperands(); - for (unsigned i = 0; i < N; ++i ) { - printConstant(CE->getOperand(i)); + } + } else if (const ConstantStruct *CS = dyn_cast(CV)) { + Out << "std::vector " << constName << "_fields;"; + nl(Out); + unsigned N = CS->getNumOperands(); + for (unsigned i = 0; i < N; i++) { + printConstant(CS->getOperand(i)); + Out << constName << "_fields.push_back(" + << getCppName(CS->getOperand(i)) << ");"; + nl(Out); + } + Out << "Constant* " << constName << " = ConstantStruct::get(" + << typeName << ", " << constName << "_fields);"; + } else if (const ConstantVector *CP = dyn_cast(CV)) { + Out << "std::vector " << constName << "_elems;"; + nl(Out); + unsigned N = CP->getNumOperands(); + for (unsigned i = 0; i < N; ++i) { + printConstant(CP->getOperand(i)); + Out << constName << "_elems.push_back(" + << getCppName(CP->getOperand(i)) << ");"; + nl(Out); + } + Out << "Constant* " << constName << " = ConstantVector::get(" + << typeName << ", " << constName << "_elems);"; + } else if (isa(CV)) { + Out << "UndefValue* " << constName << " = UndefValue::get(" + << typeName << ");"; + } else if (const ConstantExpr *CE = dyn_cast(CV)) { + if (CE->getOpcode() == Instruction::GetElementPtr) { + Out << "std::vector " << constName << "_indices;"; + nl(Out); + printConstant(CE->getOperand(0)); + for (unsigned i = 1; i < CE->getNumOperands(); ++i ) { + printConstant(CE->getOperand(i)); + Out << constName << "_indices.push_back(" + << getCppName(CE->getOperand(i)) << ");"; + nl(Out); + } + Out << "Constant* " << constName + << " = ConstantExpr::getGetElementPtr(" + << getCppName(CE->getOperand(0)) << ", " + << "&" << constName << "_indices[0], " + << constName << "_indices.size()" + << ");"; + } else if (CE->isCast()) { + printConstant(CE->getOperand(0)); + Out << "Constant* " << constName << " = ConstantExpr::getCast("; + switch (CE->getOpcode()) { + default: llvm_unreachable("Invalid cast opcode"); + case Instruction::Trunc: Out << "Instruction::Trunc"; break; + case Instruction::ZExt: Out << "Instruction::ZExt"; break; + case Instruction::SExt: Out << "Instruction::SExt"; break; + case Instruction::FPTrunc: Out << "Instruction::FPTrunc"; break; + case Instruction::FPExt: Out << "Instruction::FPExt"; break; + case Instruction::FPToUI: Out << "Instruction::FPToUI"; break; + case Instruction::FPToSI: Out << "Instruction::FPToSI"; break; + case Instruction::UIToFP: Out << "Instruction::UIToFP"; break; + case Instruction::SIToFP: Out << "Instruction::SIToFP"; break; + case Instruction::PtrToInt: Out << "Instruction::PtrToInt"; break; + case Instruction::IntToPtr: Out << "Instruction::IntToPtr"; break; + case Instruction::BitCast: Out << "Instruction::BitCast"; break; + } + Out << ", " << getCppName(CE->getOperand(0)) << ", " + << getCppName(CE->getType()) << ");"; + } else { + unsigned N = CE->getNumOperands(); + for (unsigned i = 0; i < N; ++i ) { + printConstant(CE->getOperand(i)); + } + Out << "Constant* " << constName << " = ConstantExpr::"; + switch (CE->getOpcode()) { + case Instruction::Add: Out << "getAdd("; break; + case Instruction::FAdd: Out << "getFAdd("; break; + case Instruction::Sub: Out << "getSub("; break; + case Instruction::FSub: Out << "getFSub("; break; + case Instruction::Mul: Out << "getMul("; break; + case Instruction::FMul: Out << "getFMul("; break; + case Instruction::UDiv: Out << "getUDiv("; break; + case Instruction::SDiv: Out << "getSDiv("; break; + case Instruction::FDiv: Out << "getFDiv("; break; + case Instruction::URem: Out << "getURem("; break; + case Instruction::SRem: Out << "getSRem("; break; + case Instruction::FRem: Out << "getFRem("; break; + case Instruction::And: Out << "getAnd("; break; + case Instruction::Or: Out << "getOr("; break; + case Instruction::Xor: Out << "getXor("; break; + case Instruction::ICmp: + Out << "getICmp(ICmpInst::ICMP_"; + switch (CE->getPredicate()) { + case ICmpInst::ICMP_EQ: Out << "EQ"; break; + case ICmpInst::ICMP_NE: Out << "NE"; break; + case ICmpInst::ICMP_SLT: Out << "SLT"; break; + case ICmpInst::ICMP_ULT: Out << "ULT"; break; + case ICmpInst::ICMP_SGT: Out << "SGT"; break; + case ICmpInst::ICMP_UGT: Out << "UGT"; break; + case ICmpInst::ICMP_SLE: Out << "SLE"; break; + case ICmpInst::ICMP_ULE: Out << "ULE"; break; + case ICmpInst::ICMP_SGE: Out << "SGE"; break; + case ICmpInst::ICMP_UGE: Out << "UGE"; break; + default: error("Invalid ICmp Predicate"); } - Out << "Constant* " << constName << " = ConstantExpr::"; - switch (CE->getOpcode()) { - case Instruction::Add: Out << "getAdd("; break; - case Instruction::FAdd: Out << "getFAdd("; break; - case Instruction::Sub: Out << "getSub("; break; - case Instruction::FSub: Out << "getFSub("; break; - case Instruction::Mul: Out << "getMul("; break; - case Instruction::FMul: Out << "getFMul("; break; - case Instruction::UDiv: Out << "getUDiv("; break; - case Instruction::SDiv: Out << "getSDiv("; break; - case Instruction::FDiv: Out << "getFDiv("; break; - case Instruction::URem: Out << "getURem("; break; - case Instruction::SRem: Out << "getSRem("; break; - case Instruction::FRem: Out << "getFRem("; break; - case Instruction::And: Out << "getAnd("; break; - case Instruction::Or: Out << "getOr("; break; - case Instruction::Xor: Out << "getXor("; break; - case Instruction::ICmp: - Out << "getICmp(ICmpInst::ICMP_"; - switch (CE->getPredicate()) { - case ICmpInst::ICMP_EQ: Out << "EQ"; break; - case ICmpInst::ICMP_NE: Out << "NE"; break; - case ICmpInst::ICMP_SLT: Out << "SLT"; break; - case ICmpInst::ICMP_ULT: Out << "ULT"; break; - case ICmpInst::ICMP_SGT: Out << "SGT"; break; - case ICmpInst::ICMP_UGT: Out << "UGT"; break; - case ICmpInst::ICMP_SLE: Out << "SLE"; break; - case ICmpInst::ICMP_ULE: Out << "ULE"; break; - case ICmpInst::ICMP_SGE: Out << "SGE"; break; - case ICmpInst::ICMP_UGE: Out << "UGE"; break; - default: error("Invalid ICmp Predicate"); - } - break; - case Instruction::FCmp: - Out << "getFCmp(FCmpInst::FCMP_"; - switch (CE->getPredicate()) { - case FCmpInst::FCMP_FALSE: Out << "FALSE"; break; - case FCmpInst::FCMP_ORD: Out << "ORD"; break; - case FCmpInst::FCMP_UNO: Out << "UNO"; break; - case FCmpInst::FCMP_OEQ: Out << "OEQ"; break; - case FCmpInst::FCMP_UEQ: Out << "UEQ"; break; - case FCmpInst::FCMP_ONE: Out << "ONE"; break; - case FCmpInst::FCMP_UNE: Out << "UNE"; break; - case FCmpInst::FCMP_OLT: Out << "OLT"; break; - case FCmpInst::FCMP_ULT: Out << "ULT"; break; - case FCmpInst::FCMP_OGT: Out << "OGT"; break; - case FCmpInst::FCMP_UGT: Out << "UGT"; break; - case FCmpInst::FCMP_OLE: Out << "OLE"; break; - case FCmpInst::FCMP_ULE: Out << "ULE"; break; - case FCmpInst::FCMP_OGE: Out << "OGE"; break; - case FCmpInst::FCMP_UGE: Out << "UGE"; break; - case FCmpInst::FCMP_TRUE: Out << "TRUE"; break; - default: error("Invalid FCmp Predicate"); - } - break; - case Instruction::Shl: Out << "getShl("; break; - case Instruction::LShr: Out << "getLShr("; break; - case Instruction::AShr: Out << "getAShr("; break; - case Instruction::Select: Out << "getSelect("; break; - case Instruction::ExtractElement: Out << "getExtractElement("; break; - case Instruction::InsertElement: Out << "getInsertElement("; break; - case Instruction::ShuffleVector: Out << "getShuffleVector("; break; - default: - error("Invalid constant expression"); - break; + break; + case Instruction::FCmp: + Out << "getFCmp(FCmpInst::FCMP_"; + switch (CE->getPredicate()) { + case FCmpInst::FCMP_FALSE: Out << "FALSE"; break; + case FCmpInst::FCMP_ORD: Out << "ORD"; break; + case FCmpInst::FCMP_UNO: Out << "UNO"; break; + case FCmpInst::FCMP_OEQ: Out << "OEQ"; break; + case FCmpInst::FCMP_UEQ: Out << "UEQ"; break; + case FCmpInst::FCMP_ONE: Out << "ONE"; break; + case FCmpInst::FCMP_UNE: Out << "UNE"; break; + case FCmpInst::FCMP_OLT: Out << "OLT"; break; + case FCmpInst::FCMP_ULT: Out << "ULT"; break; + case FCmpInst::FCMP_OGT: Out << "OGT"; break; + case FCmpInst::FCMP_UGT: Out << "UGT"; break; + case FCmpInst::FCMP_OLE: Out << "OLE"; break; + case FCmpInst::FCMP_ULE: Out << "ULE"; break; + case FCmpInst::FCMP_OGE: Out << "OGE"; break; + case FCmpInst::FCMP_UGE: Out << "UGE"; break; + case FCmpInst::FCMP_TRUE: Out << "TRUE"; break; + default: error("Invalid FCmp Predicate"); } - Out << getCppName(CE->getOperand(0)); - for (unsigned i = 1; i < CE->getNumOperands(); ++i) - Out << ", " << getCppName(CE->getOperand(i)); - Out << ");"; + break; + case Instruction::Shl: Out << "getShl("; break; + case Instruction::LShr: Out << "getLShr("; break; + case Instruction::AShr: Out << "getAShr("; break; + case Instruction::Select: Out << "getSelect("; break; + case Instruction::ExtractElement: Out << "getExtractElement("; break; + case Instruction::InsertElement: Out << "getInsertElement("; break; + case Instruction::ShuffleVector: Out << "getShuffleVector("; break; + default: + error("Invalid constant expression"); + break; } - } else { - error("Bad Constant"); - Out << "Constant* " << constName << " = 0; "; + Out << getCppName(CE->getOperand(0)); + for (unsigned i = 1; i < CE->getNumOperands(); ++i) + Out << ", " << getCppName(CE->getOperand(i)); + Out << ");"; } - nl(Out); + } else { + error("Bad Constant"); + Out << "Constant* " << constName << " = 0; "; } + nl(Out); +} - void CppWriter::printConstants(const Module* M) { - // Traverse all the global variables looking for constant initializers - for (Module::const_global_iterator I = TheModule->global_begin(), - E = TheModule->global_end(); I != E; ++I) - if (I->hasInitializer()) - printConstant(I->getInitializer()); - - // Traverse the LLVM functions looking for constants - for (Module::const_iterator FI = TheModule->begin(), FE = TheModule->end(); - FI != FE; ++FI) { - // Add all of the basic blocks and instructions - for (Function::const_iterator BB = FI->begin(), - E = FI->end(); BB != E; ++BB) { - for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; - ++I) { - for (unsigned i = 0; i < I->getNumOperands(); ++i) { - if (Constant* C = dyn_cast(I->getOperand(i))) { - printConstant(C); - } +void CppWriter::printConstants(const Module* M) { + // Traverse all the global variables looking for constant initializers + for (Module::const_global_iterator I = TheModule->global_begin(), + E = TheModule->global_end(); I != E; ++I) + if (I->hasInitializer()) + printConstant(I->getInitializer()); + + // Traverse the LLVM functions looking for constants + for (Module::const_iterator FI = TheModule->begin(), FE = TheModule->end(); + FI != FE; ++FI) { + // Add all of the basic blocks and instructions + for (Function::const_iterator BB = FI->begin(), + E = FI->end(); BB != E; ++BB) { + for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; + ++I) { + for (unsigned i = 0; i < I->getNumOperands(); ++i) { + if (Constant* C = dyn_cast(I->getOperand(i))) { + printConstant(C); } } } } } +} - void CppWriter::printVariableUses(const GlobalVariable *GV) { - nl(Out) << "// Type Definitions"; - nl(Out); - printType(GV->getType()); - if (GV->hasInitializer()) { - Constant *Init = GV->getInitializer(); - printType(Init->getType()); - if (Function *F = dyn_cast(Init)) { - nl(Out)<< "/ Function Declarations"; nl(Out); - printFunctionHead(F); - } else if (GlobalVariable* gv = dyn_cast(Init)) { - nl(Out) << "// Global Variable Declarations"; nl(Out); - printVariableHead(gv); - - nl(Out) << "// Global Variable Definitions"; nl(Out); - printVariableBody(gv); - } else { - nl(Out) << "// Constant Definitions"; nl(Out); - printConstant(Init); - } +void CppWriter::printVariableUses(const GlobalVariable *GV) { + nl(Out) << "// Type Definitions"; + nl(Out); + printType(GV->getType()); + if (GV->hasInitializer()) { + Constant *Init = GV->getInitializer(); + printType(Init->getType()); + if (Function *F = dyn_cast(Init)) { + nl(Out)<< "/ Function Declarations"; nl(Out); + printFunctionHead(F); + } else if (GlobalVariable* gv = dyn_cast(Init)) { + nl(Out) << "// Global Variable Declarations"; nl(Out); + printVariableHead(gv); + + nl(Out) << "// Global Variable Definitions"; nl(Out); + printVariableBody(gv); + } else { + nl(Out) << "// Constant Definitions"; nl(Out); + printConstant(Init); } } +} - void CppWriter::printVariableHead(const GlobalVariable *GV) { - nl(Out) << "GlobalVariable* " << getCppName(GV); - if (is_inline) { - Out << " = mod->getGlobalVariable(mod->getContext(), "; - printEscapedString(GV->getName()); - Out << ", " << getCppName(GV->getType()->getElementType()) << ",true)"; - nl(Out) << "if (!" << getCppName(GV) << ") {"; - in(); nl(Out) << getCppName(GV); - } - Out << " = new GlobalVariable(/*Module=*/*mod, "; - nl(Out) << "/*Type=*/"; - printCppName(GV->getType()->getElementType()); - Out << ","; - nl(Out) << "/*isConstant=*/" << (GV->isConstant()?"true":"false"); - Out << ","; - nl(Out) << "/*Linkage=*/"; - printLinkageType(GV->getLinkage()); - Out << ","; - nl(Out) << "/*Initializer=*/0, "; - if (GV->hasInitializer()) { - Out << "// has initializer, specified below"; - } - nl(Out) << "/*Name=*/\""; +void CppWriter::printVariableHead(const GlobalVariable *GV) { + nl(Out) << "GlobalVariable* " << getCppName(GV); + if (is_inline) { + Out << " = mod->getGlobalVariable(mod->getContext(), "; printEscapedString(GV->getName()); + Out << ", " << getCppName(GV->getType()->getElementType()) << ",true)"; + nl(Out) << "if (!" << getCppName(GV) << ") {"; + in(); nl(Out) << getCppName(GV); + } + Out << " = new GlobalVariable(/*Module=*/*mod, "; + nl(Out) << "/*Type=*/"; + printCppName(GV->getType()->getElementType()); + Out << ","; + nl(Out) << "/*isConstant=*/" << (GV->isConstant()?"true":"false"); + Out << ","; + nl(Out) << "/*Linkage=*/"; + printLinkageType(GV->getLinkage()); + Out << ","; + nl(Out) << "/*Initializer=*/0, "; + if (GV->hasInitializer()) { + Out << "// has initializer, specified below"; + } + nl(Out) << "/*Name=*/\""; + printEscapedString(GV->getName()); + Out << "\");"; + nl(Out); + + if (GV->hasSection()) { + printCppName(GV); + Out << "->setSection(\""; + printEscapedString(GV->getSection()); Out << "\");"; nl(Out); - - if (GV->hasSection()) { - printCppName(GV); - Out << "->setSection(\""; - printEscapedString(GV->getSection()); - Out << "\");"; - nl(Out); - } - if (GV->getAlignment()) { - printCppName(GV); - Out << "->setAlignment(" << utostr(GV->getAlignment()) << ");"; - nl(Out); - } - if (GV->getVisibility() != GlobalValue::DefaultVisibility) { - printCppName(GV); - Out << "->setVisibility("; - printVisibilityType(GV->getVisibility()); - Out << ");"; - nl(Out); - } - if (GV->isThreadLocal()) { - printCppName(GV); - Out << "->setThreadLocal(true);"; - nl(Out); - } - if (is_inline) { - out(); Out << "}"; nl(Out); - } } - - void CppWriter::printVariableBody(const GlobalVariable *GV) { - if (GV->hasInitializer()) { - printCppName(GV); - Out << "->setInitializer("; - Out << getCppName(GV->getInitializer()) << ");"; - nl(Out); - } + if (GV->getAlignment()) { + printCppName(GV); + Out << "->setAlignment(" << utostr(GV->getAlignment()) << ");"; + nl(Out); } - - std::string CppWriter::getOpName(Value* V) { - if (!isa(V) || DefinedValues.find(V) != DefinedValues.end()) - return getCppName(V); - - // See if its alread in the map of forward references, if so just return the - // name we already set up for it - ForwardRefMap::const_iterator I = ForwardRefs.find(V); - if (I != ForwardRefs.end()) - return I->second; - - // This is a new forward reference. Generate a unique name for it - std::string result(std::string("fwdref_") + utostr(uniqueNum++)); - - // Yes, this is a hack. An Argument is the smallest instantiable value that - // we can make as a placeholder for the real value. We'll replace these - // Argument instances later. - Out << "Argument* " << result << " = new Argument(" - << getCppName(V->getType()) << ");"; + if (GV->getVisibility() != GlobalValue::DefaultVisibility) { + printCppName(GV); + Out << "->setVisibility("; + printVisibilityType(GV->getVisibility()); + Out << ");"; nl(Out); - ForwardRefs[V] = result; - return result; } + if (GV->isThreadLocal()) { + printCppName(GV); + Out << "->setThreadLocal(true);"; + nl(Out); + } + if (is_inline) { + out(); Out << "}"; nl(Out); + } +} - // printInstruction - This member is called for each Instruction in a function. - void CppWriter::printInstruction(const Instruction *I, - const std::string& bbname) { - std::string iName(getCppName(I)); - - // Before we emit this instruction, we need to take care of generating any - // forward references. So, we get the names of all the operands in advance - const unsigned Ops(I->getNumOperands()); - std::string* opNames = new std::string[Ops]; - for (unsigned i = 0; i < Ops; i++) { - opNames[i] = getOpName(I->getOperand(i)); - } +void CppWriter::printVariableBody(const GlobalVariable *GV) { + if (GV->hasInitializer()) { + printCppName(GV); + Out << "->setInitializer("; + Out << getCppName(GV->getInitializer()) << ");"; + nl(Out); + } +} - switch (I->getOpcode()) { - default: - error("Invalid instruction"); - break; +std::string CppWriter::getOpName(Value* V) { + if (!isa(V) || DefinedValues.find(V) != DefinedValues.end()) + return getCppName(V); + + // See if its alread in the map of forward references, if so just return the + // name we already set up for it + ForwardRefMap::const_iterator I = ForwardRefs.find(V); + if (I != ForwardRefs.end()) + return I->second; + + // This is a new forward reference. Generate a unique name for it + std::string result(std::string("fwdref_") + utostr(uniqueNum++)); + + // Yes, this is a hack. An Argument is the smallest instantiable value that + // we can make as a placeholder for the real value. We'll replace these + // Argument instances later. + Out << "Argument* " << result << " = new Argument(" + << getCppName(V->getType()) << ");"; + nl(Out); + ForwardRefs[V] = result; + return result; +} - case Instruction::Ret: { - const ReturnInst* ret = cast(I); - Out << "ReturnInst::Create(mod->getContext(), " - << (ret->getReturnValue() ? opNames[0] + ", " : "") << bbname << ");"; - break; - } - case Instruction::Br: { - const BranchInst* br = cast(I); - Out << "BranchInst::Create(" ; - if (br->getNumOperands() == 3 ) { - Out << opNames[2] << ", " - << opNames[1] << ", " - << opNames[0] << ", "; - - } else if (br->getNumOperands() == 1) { - Out << opNames[0] << ", "; - } else { - error("Branch with 2 operands?"); - } - Out << bbname << ");"; - break; - } - case Instruction::Switch: { - const SwitchInst *SI = cast(I); - Out << "SwitchInst* " << iName << " = SwitchInst::Create(" - << opNames[0] << ", " +// printInstruction - This member is called for each Instruction in a function. +void CppWriter::printInstruction(const Instruction *I, + const std::string& bbname) { + std::string iName(getCppName(I)); + + // Before we emit this instruction, we need to take care of generating any + // forward references. So, we get the names of all the operands in advance + const unsigned Ops(I->getNumOperands()); + std::string* opNames = new std::string[Ops]; + for (unsigned i = 0; i < Ops; i++) { + opNames[i] = getOpName(I->getOperand(i)); + } + + switch (I->getOpcode()) { + default: + error("Invalid instruction"); + break; + + case Instruction::Ret: { + const ReturnInst* ret = cast(I); + Out << "ReturnInst::Create(mod->getContext(), " + << (ret->getReturnValue() ? opNames[0] + ", " : "") << bbname << ");"; + break; + } + case Instruction::Br: { + const BranchInst* br = cast(I); + Out << "BranchInst::Create(" ; + if (br->getNumOperands() == 3 ) { + Out << opNames[2] << ", " << opNames[1] << ", " - << SI->getNumCases() << ", " << bbname << ");"; - nl(Out); - for (unsigned i = 2; i != SI->getNumOperands(); i += 2) { - Out << iName << "->addCase(" - << opNames[i] << ", " - << opNames[i+1] << ");"; - nl(Out); - } - break; + << opNames[0] << ", "; + + } else if (br->getNumOperands() == 1) { + Out << opNames[0] << ", "; + } else { + error("Branch with 2 operands?"); } - case Instruction::IndirectBr: { - const IndirectBrInst *IBI = cast(I); - Out << "IndirectBrInst *" << iName << " = IndirectBrInst::Create(" - << opNames[0] << ", " << IBI->getNumDestinations() << ");"; + Out << bbname << ");"; + break; + } + case Instruction::Switch: { + const SwitchInst *SI = cast(I); + Out << "SwitchInst* " << iName << " = SwitchInst::Create(" + << opNames[0] << ", " + << opNames[1] << ", " + << SI->getNumCases() << ", " << bbname << ");"; + nl(Out); + for (unsigned i = 2; i != SI->getNumOperands(); i += 2) { + Out << iName << "->addCase(" + << opNames[i] << ", " + << opNames[i+1] << ");"; nl(Out); - for (unsigned i = 1; i != IBI->getNumOperands(); ++i) { - Out << iName << "->addDestination(" << opNames[i] << ");"; - nl(Out); - } - break; } - case Instruction::Invoke: { - const InvokeInst* inv = cast(I); - Out << "std::vector " << iName << "_params;"; - nl(Out); - for (unsigned i = 0; i < inv->getNumArgOperands(); ++i) { - Out << iName << "_params.push_back(" - << getOpName(inv->getArgOperand(i)) << ");"; - nl(Out); - } - // FIXME: This shouldn't use magic numbers -3, -2, and -1. - Out << "InvokeInst *" << iName << " = InvokeInst::Create(" - << getOpName(inv->getCalledFunction()) << ", " - << getOpName(inv->getNormalDest()) << ", " - << getOpName(inv->getUnwindDest()) << ", " - << iName << "_params.begin(), " - << iName << "_params.end(), \""; - printEscapedString(inv->getName()); - Out << "\", " << bbname << ");"; - nl(Out) << iName << "->setCallingConv("; - printCallingConv(inv->getCallingConv()); - Out << ");"; - printAttributes(inv->getAttributes(), iName); - Out << iName << "->setAttributes(" << iName << "_PAL);"; + break; + } + case Instruction::IndirectBr: { + const IndirectBrInst *IBI = cast(I); + Out << "IndirectBrInst *" << iName << " = IndirectBrInst::Create(" + << opNames[0] << ", " << IBI->getNumDestinations() << ");"; + nl(Out); + for (unsigned i = 1; i != IBI->getNumOperands(); ++i) { + Out << iName << "->addDestination(" << opNames[i] << ");"; nl(Out); - break; - } - case Instruction::Unwind: { - Out << "new UnwindInst(" - << bbname << ");"; - break; - } - case Instruction::Unreachable: { - Out << "new UnreachableInst(" - << "mod->getContext(), " - << bbname << ");"; - break; - } - case Instruction::Add: - case Instruction::FAdd: - case Instruction::Sub: - case Instruction::FSub: - case Instruction::Mul: - case Instruction::FMul: - case Instruction::UDiv: - case Instruction::SDiv: - case Instruction::FDiv: - case Instruction::URem: - case Instruction::SRem: - case Instruction::FRem: - case Instruction::And: - case Instruction::Or: - case Instruction::Xor: - case Instruction::Shl: - case Instruction::LShr: - case Instruction::AShr:{ - Out << "BinaryOperator* " << iName << " = BinaryOperator::Create("; - switch (I->getOpcode()) { - case Instruction::Add: Out << "Instruction::Add"; break; - case Instruction::FAdd: Out << "Instruction::FAdd"; break; - case Instruction::Sub: Out << "Instruction::Sub"; break; - case Instruction::FSub: Out << "Instruction::FSub"; break; - case Instruction::Mul: Out << "Instruction::Mul"; break; - case Instruction::FMul: Out << "Instruction::FMul"; break; - case Instruction::UDiv:Out << "Instruction::UDiv"; break; - case Instruction::SDiv:Out << "Instruction::SDiv"; break; - case Instruction::FDiv:Out << "Instruction::FDiv"; break; - case Instruction::URem:Out << "Instruction::URem"; break; - case Instruction::SRem:Out << "Instruction::SRem"; break; - case Instruction::FRem:Out << "Instruction::FRem"; break; - case Instruction::And: Out << "Instruction::And"; break; - case Instruction::Or: Out << "Instruction::Or"; break; - case Instruction::Xor: Out << "Instruction::Xor"; break; - case Instruction::Shl: Out << "Instruction::Shl"; break; - case Instruction::LShr:Out << "Instruction::LShr"; break; - case Instruction::AShr:Out << "Instruction::AShr"; break; - default: Out << "Instruction::BadOpCode"; break; - } - Out << ", " << opNames[0] << ", " << opNames[1] << ", \""; - printEscapedString(I->getName()); - Out << "\", " << bbname << ");"; - break; - } - case Instruction::FCmp: { - Out << "FCmpInst* " << iName << " = new FCmpInst(*" << bbname << ", "; - switch (cast(I)->getPredicate()) { - case FCmpInst::FCMP_FALSE: Out << "FCmpInst::FCMP_FALSE"; break; - case FCmpInst::FCMP_OEQ : Out << "FCmpInst::FCMP_OEQ"; break; - case FCmpInst::FCMP_OGT : Out << "FCmpInst::FCMP_OGT"; break; - case FCmpInst::FCMP_OGE : Out << "FCmpInst::FCMP_OGE"; break; - case FCmpInst::FCMP_OLT : Out << "FCmpInst::FCMP_OLT"; break; - case FCmpInst::FCMP_OLE : Out << "FCmpInst::FCMP_OLE"; break; - case FCmpInst::FCMP_ONE : Out << "FCmpInst::FCMP_ONE"; break; - case FCmpInst::FCMP_ORD : Out << "FCmpInst::FCMP_ORD"; break; - case FCmpInst::FCMP_UNO : Out << "FCmpInst::FCMP_UNO"; break; - case FCmpInst::FCMP_UEQ : Out << "FCmpInst::FCMP_UEQ"; break; - case FCmpInst::FCMP_UGT : Out << "FCmpInst::FCMP_UGT"; break; - case FCmpInst::FCMP_UGE : Out << "FCmpInst::FCMP_UGE"; break; - case FCmpInst::FCMP_ULT : Out << "FCmpInst::FCMP_ULT"; break; - case FCmpInst::FCMP_ULE : Out << "FCmpInst::FCMP_ULE"; break; - case FCmpInst::FCMP_UNE : Out << "FCmpInst::FCMP_UNE"; break; - case FCmpInst::FCMP_TRUE : Out << "FCmpInst::FCMP_TRUE"; break; - default: Out << "FCmpInst::BAD_ICMP_PREDICATE"; break; - } - Out << ", " << opNames[0] << ", " << opNames[1] << ", \""; - printEscapedString(I->getName()); - Out << "\");"; - break; - } - case Instruction::ICmp: { - Out << "ICmpInst* " << iName << " = new ICmpInst(*" << bbname << ", "; - switch (cast(I)->getPredicate()) { - case ICmpInst::ICMP_EQ: Out << "ICmpInst::ICMP_EQ"; break; - case ICmpInst::ICMP_NE: Out << "ICmpInst::ICMP_NE"; break; - case ICmpInst::ICMP_ULE: Out << "ICmpInst::ICMP_ULE"; break; - case ICmpInst::ICMP_SLE: Out << "ICmpInst::ICMP_SLE"; break; - case ICmpInst::ICMP_UGE: Out << "ICmpInst::ICMP_UGE"; break; - case ICmpInst::ICMP_SGE: Out << "ICmpInst::ICMP_SGE"; break; - case ICmpInst::ICMP_ULT: Out << "ICmpInst::ICMP_ULT"; break; - case ICmpInst::ICMP_SLT: Out << "ICmpInst::ICMP_SLT"; break; - case ICmpInst::ICMP_UGT: Out << "ICmpInst::ICMP_UGT"; break; - case ICmpInst::ICMP_SGT: Out << "ICmpInst::ICMP_SGT"; break; - default: Out << "ICmpInst::BAD_ICMP_PREDICATE"; break; - } - Out << ", " << opNames[0] << ", " << opNames[1] << ", \""; - printEscapedString(I->getName()); - Out << "\");"; - break; } - case Instruction::Alloca: { - const AllocaInst* allocaI = cast(I); - Out << "AllocaInst* " << iName << " = new AllocaInst(" - << getCppName(allocaI->getAllocatedType()) << ", "; - if (allocaI->isArrayAllocation()) - Out << opNames[0] << ", "; - Out << "\""; - printEscapedString(allocaI->getName()); - Out << "\", " << bbname << ");"; - if (allocaI->getAlignment()) - nl(Out) << iName << "->setAlignment(" - << allocaI->getAlignment() << ");"; - break; - } - case Instruction::Load:{ - const LoadInst* load = cast(I); - Out << "LoadInst* " << iName << " = new LoadInst(" - << opNames[0] << ", \""; - printEscapedString(load->getName()); - Out << "\", " << (load->isVolatile() ? "true" : "false" ) - << ", " << bbname << ");"; - break; - } - case Instruction::Store: { - const StoreInst* store = cast(I); - Out << " new StoreInst(" - << opNames[0] << ", " - << opNames[1] << ", " - << (store->isVolatile() ? "true" : "false") - << ", " << bbname << ");"; - break; + break; + } + case Instruction::Invoke: { + const InvokeInst* inv = cast(I); + Out << "std::vector " << iName << "_params;"; + nl(Out); + for (unsigned i = 0; i < inv->getNumArgOperands(); ++i) { + Out << iName << "_params.push_back(" + << getOpName(inv->getArgOperand(i)) << ");"; + nl(Out); + } + // FIXME: This shouldn't use magic numbers -3, -2, and -1. + Out << "InvokeInst *" << iName << " = InvokeInst::Create(" + << getOpName(inv->getCalledFunction()) << ", " + << getOpName(inv->getNormalDest()) << ", " + << getOpName(inv->getUnwindDest()) << ", " + << iName << "_params.begin(), " + << iName << "_params.end(), \""; + printEscapedString(inv->getName()); + Out << "\", " << bbname << ");"; + nl(Out) << iName << "->setCallingConv("; + printCallingConv(inv->getCallingConv()); + Out << ");"; + printAttributes(inv->getAttributes(), iName); + Out << iName << "->setAttributes(" << iName << "_PAL);"; + nl(Out); + break; + } + case Instruction::Unwind: { + Out << "new UnwindInst(" + << bbname << ");"; + break; + } + case Instruction::Unreachable: { + Out << "new UnreachableInst(" + << "mod->getContext(), " + << bbname << ");"; + break; + } + case Instruction::Add: + case Instruction::FAdd: + case Instruction::Sub: + case Instruction::FSub: + case Instruction::Mul: + case Instruction::FMul: + case Instruction::UDiv: + case Instruction::SDiv: + case Instruction::FDiv: + case Instruction::URem: + case Instruction::SRem: + case Instruction::FRem: + case Instruction::And: + case Instruction::Or: + case Instruction::Xor: + case Instruction::Shl: + case Instruction::LShr: + case Instruction::AShr:{ + Out << "BinaryOperator* " << iName << " = BinaryOperator::Create("; + switch (I->getOpcode()) { + case Instruction::Add: Out << "Instruction::Add"; break; + case Instruction::FAdd: Out << "Instruction::FAdd"; break; + case Instruction::Sub: Out << "Instruction::Sub"; break; + case Instruction::FSub: Out << "Instruction::FSub"; break; + case Instruction::Mul: Out << "Instruction::Mul"; break; + case Instruction::FMul: Out << "Instruction::FMul"; break; + case Instruction::UDiv:Out << "Instruction::UDiv"; break; + case Instruction::SDiv:Out << "Instruction::SDiv"; break; + case Instruction::FDiv:Out << "Instruction::FDiv"; break; + case Instruction::URem:Out << "Instruction::URem"; break; + case Instruction::SRem:Out << "Instruction::SRem"; break; + case Instruction::FRem:Out << "Instruction::FRem"; break; + case Instruction::And: Out << "Instruction::And"; break; + case Instruction::Or: Out << "Instruction::Or"; break; + case Instruction::Xor: Out << "Instruction::Xor"; break; + case Instruction::Shl: Out << "Instruction::Shl"; break; + case Instruction::LShr:Out << "Instruction::LShr"; break; + case Instruction::AShr:Out << "Instruction::AShr"; break; + default: Out << "Instruction::BadOpCode"; break; + } + Out << ", " << opNames[0] << ", " << opNames[1] << ", \""; + printEscapedString(I->getName()); + Out << "\", " << bbname << ");"; + break; + } + case Instruction::FCmp: { + Out << "FCmpInst* " << iName << " = new FCmpInst(*" << bbname << ", "; + switch (cast(I)->getPredicate()) { + case FCmpInst::FCMP_FALSE: Out << "FCmpInst::FCMP_FALSE"; break; + case FCmpInst::FCMP_OEQ : Out << "FCmpInst::FCMP_OEQ"; break; + case FCmpInst::FCMP_OGT : Out << "FCmpInst::FCMP_OGT"; break; + case FCmpInst::FCMP_OGE : Out << "FCmpInst::FCMP_OGE"; break; + case FCmpInst::FCMP_OLT : Out << "FCmpInst::FCMP_OLT"; break; + case FCmpInst::FCMP_OLE : Out << "FCmpInst::FCMP_OLE"; break; + case FCmpInst::FCMP_ONE : Out << "FCmpInst::FCMP_ONE"; break; + case FCmpInst::FCMP_ORD : Out << "FCmpInst::FCMP_ORD"; break; + case FCmpInst::FCMP_UNO : Out << "FCmpInst::FCMP_UNO"; break; + case FCmpInst::FCMP_UEQ : Out << "FCmpInst::FCMP_UEQ"; break; + case FCmpInst::FCMP_UGT : Out << "FCmpInst::FCMP_UGT"; break; + case FCmpInst::FCMP_UGE : Out << "FCmpInst::FCMP_UGE"; break; + case FCmpInst::FCMP_ULT : Out << "FCmpInst::FCMP_ULT"; break; + case FCmpInst::FCMP_ULE : Out << "FCmpInst::FCMP_ULE"; break; + case FCmpInst::FCMP_UNE : Out << "FCmpInst::FCMP_UNE"; break; + case FCmpInst::FCMP_TRUE : Out << "FCmpInst::FCMP_TRUE"; break; + default: Out << "FCmpInst::BAD_ICMP_PREDICATE"; break; } - case Instruction::GetElementPtr: { - const GetElementPtrInst* gep = cast(I); - if (gep->getNumOperands() <= 2) { - Out << "GetElementPtrInst* " << iName << " = GetElementPtrInst::Create(" - << opNames[0]; - if (gep->getNumOperands() == 2) - Out << ", " << opNames[1]; - } else { - Out << "std::vector " << iName << "_indices;"; - nl(Out); - for (unsigned i = 1; i < gep->getNumOperands(); ++i ) { - Out << iName << "_indices.push_back(" - << opNames[i] << ");"; - nl(Out); - } - Out << "Instruction* " << iName << " = GetElementPtrInst::Create(" - << opNames[0] << ", " << iName << "_indices.begin(), " - << iName << "_indices.end()"; - } - Out << ", \""; - printEscapedString(gep->getName()); - Out << "\", " << bbname << ");"; - break; + Out << ", " << opNames[0] << ", " << opNames[1] << ", \""; + printEscapedString(I->getName()); + Out << "\");"; + break; + } + case Instruction::ICmp: { + Out << "ICmpInst* " << iName << " = new ICmpInst(*" << bbname << ", "; + switch (cast(I)->getPredicate()) { + case ICmpInst::ICMP_EQ: Out << "ICmpInst::ICMP_EQ"; break; + case ICmpInst::ICMP_NE: Out << "ICmpInst::ICMP_NE"; break; + case ICmpInst::ICMP_ULE: Out << "ICmpInst::ICMP_ULE"; break; + case ICmpInst::ICMP_SLE: Out << "ICmpInst::ICMP_SLE"; break; + case ICmpInst::ICMP_UGE: Out << "ICmpInst::ICMP_UGE"; break; + case ICmpInst::ICMP_SGE: Out << "ICmpInst::ICMP_SGE"; break; + case ICmpInst::ICMP_ULT: Out << "ICmpInst::ICMP_ULT"; break; + case ICmpInst::ICMP_SLT: Out << "ICmpInst::ICMP_SLT"; break; + case ICmpInst::ICMP_UGT: Out << "ICmpInst::ICMP_UGT"; break; + case ICmpInst::ICMP_SGT: Out << "ICmpInst::ICMP_SGT"; break; + default: Out << "ICmpInst::BAD_ICMP_PREDICATE"; break; } - case Instruction::PHI: { - const PHINode* phi = cast(I); - - Out << "PHINode* " << iName << " = PHINode::Create(" - << getCppName(phi->getType()) << ", \""; - printEscapedString(phi->getName()); - Out << "\", " << bbname << ");"; - nl(Out) << iName << "->reserveOperandSpace(" - << phi->getNumIncomingValues() - << ");"; + Out << ", " << opNames[0] << ", " << opNames[1] << ", \""; + printEscapedString(I->getName()); + Out << "\");"; + break; + } + case Instruction::Alloca: { + const AllocaInst* allocaI = cast(I); + Out << "AllocaInst* " << iName << " = new AllocaInst(" + << getCppName(allocaI->getAllocatedType()) << ", "; + if (allocaI->isArrayAllocation()) + Out << opNames[0] << ", "; + Out << "\""; + printEscapedString(allocaI->getName()); + Out << "\", " << bbname << ");"; + if (allocaI->getAlignment()) + nl(Out) << iName << "->setAlignment(" + << allocaI->getAlignment() << ");"; + break; + } + case Instruction::Load:{ + const LoadInst* load = cast(I); + Out << "LoadInst* " << iName << " = new LoadInst(" + << opNames[0] << ", \""; + printEscapedString(load->getName()); + Out << "\", " << (load->isVolatile() ? "true" : "false" ) + << ", " << bbname << ");"; + break; + } + case Instruction::Store: { + const StoreInst* store = cast(I); + Out << " new StoreInst(" + << opNames[0] << ", " + << opNames[1] << ", " + << (store->isVolatile() ? "true" : "false") + << ", " << bbname << ");"; + break; + } + case Instruction::GetElementPtr: { + const GetElementPtrInst* gep = cast(I); + if (gep->getNumOperands() <= 2) { + Out << "GetElementPtrInst* " << iName << " = GetElementPtrInst::Create(" + << opNames[0]; + if (gep->getNumOperands() == 2) + Out << ", " << opNames[1]; + } else { + Out << "std::vector " << iName << "_indices;"; nl(Out); - for (unsigned i = 0; i < phi->getNumOperands(); i+=2) { - Out << iName << "->addIncoming(" - << opNames[i] << ", " << opNames[i+1] << ");"; - nl(Out); - } - break; - } - case Instruction::Trunc: - case Instruction::ZExt: - case Instruction::SExt: - case Instruction::FPTrunc: - case Instruction::FPExt: - case Instruction::FPToUI: - case Instruction::FPToSI: - case Instruction::UIToFP: - case Instruction::SIToFP: - case Instruction::PtrToInt: - case Instruction::IntToPtr: - case Instruction::BitCast: { - const CastInst* cst = cast(I); - Out << "CastInst* " << iName << " = new "; - switch (I->getOpcode()) { - case Instruction::Trunc: Out << "TruncInst"; break; - case Instruction::ZExt: Out << "ZExtInst"; break; - case Instruction::SExt: Out << "SExtInst"; break; - case Instruction::FPTrunc: Out << "FPTruncInst"; break; - case Instruction::FPExt: Out << "FPExtInst"; break; - case Instruction::FPToUI: Out << "FPToUIInst"; break; - case Instruction::FPToSI: Out << "FPToSIInst"; break; - case Instruction::UIToFP: Out << "UIToFPInst"; break; - case Instruction::SIToFP: Out << "SIToFPInst"; break; - case Instruction::PtrToInt: Out << "PtrToIntInst"; break; - case Instruction::IntToPtr: Out << "IntToPtrInst"; break; - case Instruction::BitCast: Out << "BitCastInst"; break; - default: assert(!"Unreachable"); break; - } - Out << "(" << opNames[0] << ", " - << getCppName(cst->getType()) << ", \""; - printEscapedString(cst->getName()); - Out << "\", " << bbname << ");"; - break; - } - case Instruction::Call:{ - const CallInst* call = cast(I); - if (const InlineAsm* ila = dyn_cast(call->getCalledValue())) { - Out << "InlineAsm* " << getCppName(ila) << " = InlineAsm::get(" - << getCppName(ila->getFunctionType()) << ", \"" - << ila->getAsmString() << "\", \"" - << ila->getConstraintString() << "\"," - << (ila->hasSideEffects() ? "true" : "false") << ");"; - nl(Out); - } - if (call->getNumOperands() > 2) { - Out << "std::vector " << iName << "_params;"; + for (unsigned i = 1; i < gep->getNumOperands(); ++i ) { + Out << iName << "_indices.push_back(" + << opNames[i] << ");"; nl(Out); - for (unsigned i = 1; i < call->getNumOperands(); ++i) { - Out << iName << "_params.push_back(" << opNames[i] << ");"; - nl(Out); - } - Out << "CallInst* " << iName << " = CallInst::Create(" - << opNames[0] << ", " << iName << "_params.begin(), " - << iName << "_params.end(), \""; - } else if (call->getNumOperands() == 2) { - Out << "CallInst* " << iName << " = CallInst::Create(" - << opNames[0] << ", " << opNames[1] << ", \""; - } else { - Out << "CallInst* " << iName << " = CallInst::Create(" << opNames[0] - << ", \""; } - printEscapedString(call->getName()); - Out << "\", " << bbname << ");"; - nl(Out) << iName << "->setCallingConv("; - printCallingConv(call->getCallingConv()); - Out << ");"; - nl(Out) << iName << "->setTailCall(" - << (call->isTailCall() ? "true":"false"); - Out << ");"; - printAttributes(call->getAttributes(), iName); - Out << iName << "->setAttributes(" << iName << "_PAL);"; + Out << "Instruction* " << iName << " = GetElementPtrInst::Create(" + << opNames[0] << ", " << iName << "_indices.begin(), " + << iName << "_indices.end()"; + } + Out << ", \""; + printEscapedString(gep->getName()); + Out << "\", " << bbname << ");"; + break; + } + case Instruction::PHI: { + const PHINode* phi = cast(I); + + Out << "PHINode* " << iName << " = PHINode::Create(" + << getCppName(phi->getType()) << ", \""; + printEscapedString(phi->getName()); + Out << "\", " << bbname << ");"; + nl(Out) << iName << "->reserveOperandSpace(" + << phi->getNumIncomingValues() + << ");"; + nl(Out); + for (unsigned i = 0; i < phi->getNumOperands(); i+=2) { + Out << iName << "->addIncoming(" + << opNames[i] << ", " << opNames[i+1] << ");"; + nl(Out); + } + break; + } + case Instruction::Trunc: + case Instruction::ZExt: + case Instruction::SExt: + case Instruction::FPTrunc: + case Instruction::FPExt: + case Instruction::FPToUI: + case Instruction::FPToSI: + case Instruction::UIToFP: + case Instruction::SIToFP: + case Instruction::PtrToInt: + case Instruction::IntToPtr: + case Instruction::BitCast: { + const CastInst* cst = cast(I); + Out << "CastInst* " << iName << " = new "; + switch (I->getOpcode()) { + case Instruction::Trunc: Out << "TruncInst"; break; + case Instruction::ZExt: Out << "ZExtInst"; break; + case Instruction::SExt: Out << "SExtInst"; break; + case Instruction::FPTrunc: Out << "FPTruncInst"; break; + case Instruction::FPExt: Out << "FPExtInst"; break; + case Instruction::FPToUI: Out << "FPToUIInst"; break; + case Instruction::FPToSI: Out << "FPToSIInst"; break; + case Instruction::UIToFP: Out << "UIToFPInst"; break; + case Instruction::SIToFP: Out << "SIToFPInst"; break; + case Instruction::PtrToInt: Out << "PtrToIntInst"; break; + case Instruction::IntToPtr: Out << "IntToPtrInst"; break; + case Instruction::BitCast: Out << "BitCastInst"; break; + default: assert(!"Unreachable"); break; + } + Out << "(" << opNames[0] << ", " + << getCppName(cst->getType()) << ", \""; + printEscapedString(cst->getName()); + Out << "\", " << bbname << ");"; + break; + } + case Instruction::Call:{ + const CallInst* call = cast(I); + if (const InlineAsm* ila = dyn_cast(call->getCalledValue())) { + Out << "InlineAsm* " << getCppName(ila) << " = InlineAsm::get(" + << getCppName(ila->getFunctionType()) << ", \"" + << ila->getAsmString() << "\", \"" + << ila->getConstraintString() << "\"," + << (ila->hasSideEffects() ? "true" : "false") << ");"; nl(Out); - break; - } - case Instruction::Select: { - const SelectInst* sel = cast(I); - Out << "SelectInst* " << getCppName(sel) << " = SelectInst::Create("; - Out << opNames[0] << ", " << opNames[1] << ", " << opNames[2] << ", \""; - printEscapedString(sel->getName()); - Out << "\", " << bbname << ");"; - break; - } - case Instruction::UserOp1: - /// FALL THROUGH - case Instruction::UserOp2: { - /// FIXME: What should be done here? - break; - } - case Instruction::VAArg: { - const VAArgInst* va = cast(I); - Out << "VAArgInst* " << getCppName(va) << " = new VAArgInst(" - << opNames[0] << ", " << getCppName(va->getType()) << ", \""; - printEscapedString(va->getName()); - Out << "\", " << bbname << ");"; - break; - } - case Instruction::ExtractElement: { - const ExtractElementInst* eei = cast(I); - Out << "ExtractElementInst* " << getCppName(eei) - << " = new ExtractElementInst(" << opNames[0] - << ", " << opNames[1] << ", \""; - printEscapedString(eei->getName()); - Out << "\", " << bbname << ");"; - break; - } - case Instruction::InsertElement: { - const InsertElementInst* iei = cast(I); - Out << "InsertElementInst* " << getCppName(iei) - << " = InsertElementInst::Create(" << opNames[0] - << ", " << opNames[1] << ", " << opNames[2] << ", \""; - printEscapedString(iei->getName()); - Out << "\", " << bbname << ");"; - break; } - case Instruction::ShuffleVector: { - const ShuffleVectorInst* svi = cast(I); - Out << "ShuffleVectorInst* " << getCppName(svi) - << " = new ShuffleVectorInst(" << opNames[0] - << ", " << opNames[1] << ", " << opNames[2] << ", \""; - printEscapedString(svi->getName()); - Out << "\", " << bbname << ");"; - break; - } - case Instruction::ExtractValue: { - const ExtractValueInst *evi = cast(I); - Out << "std::vector " << iName << "_indices;"; + if (call->getNumOperands() > 2) { + Out << "std::vector " << iName << "_params;"; nl(Out); - for (unsigned i = 0; i < evi->getNumIndices(); ++i) { - Out << iName << "_indices.push_back(" - << evi->idx_begin()[i] << ");"; + for (unsigned i = 1; i < call->getNumOperands(); ++i) { + Out << iName << "_params.push_back(" << opNames[i] << ");"; nl(Out); } - Out << "ExtractValueInst* " << getCppName(evi) - << " = ExtractValueInst::Create(" << opNames[0] - << ", " - << iName << "_indices.begin(), " << iName << "_indices.end(), \""; - printEscapedString(evi->getName()); - Out << "\", " << bbname << ");"; - break; + Out << "CallInst* " << iName << " = CallInst::Create(" + << opNames[0] << ", " << iName << "_params.begin(), " + << iName << "_params.end(), \""; + } else if (call->getNumOperands() == 2) { + Out << "CallInst* " << iName << " = CallInst::Create(" + << opNames[0] << ", " << opNames[1] << ", \""; + } else { + Out << "CallInst* " << iName << " = CallInst::Create(" << opNames[0] + << ", \""; } - case Instruction::InsertValue: { - const InsertValueInst *ivi = cast(I); - Out << "std::vector " << iName << "_indices;"; + printEscapedString(call->getName()); + Out << "\", " << bbname << ");"; + nl(Out) << iName << "->setCallingConv("; + printCallingConv(call->getCallingConv()); + Out << ");"; + nl(Out) << iName << "->setTailCall(" + << (call->isTailCall() ? "true":"false"); + Out << ");"; + printAttributes(call->getAttributes(), iName); + Out << iName << "->setAttributes(" << iName << "_PAL);"; + nl(Out); + break; + } + case Instruction::Select: { + const SelectInst* sel = cast(I); + Out << "SelectInst* " << getCppName(sel) << " = SelectInst::Create("; + Out << opNames[0] << ", " << opNames[1] << ", " << opNames[2] << ", \""; + printEscapedString(sel->getName()); + Out << "\", " << bbname << ");"; + break; + } + case Instruction::UserOp1: + /// FALL THROUGH + case Instruction::UserOp2: { + /// FIXME: What should be done here? + break; + } + case Instruction::VAArg: { + const VAArgInst* va = cast(I); + Out << "VAArgInst* " << getCppName(va) << " = new VAArgInst(" + << opNames[0] << ", " << getCppName(va->getType()) << ", \""; + printEscapedString(va->getName()); + Out << "\", " << bbname << ");"; + break; + } + case Instruction::ExtractElement: { + const ExtractElementInst* eei = cast(I); + Out << "ExtractElementInst* " << getCppName(eei) + << " = new ExtractElementInst(" << opNames[0] + << ", " << opNames[1] << ", \""; + printEscapedString(eei->getName()); + Out << "\", " << bbname << ");"; + break; + } + case Instruction::InsertElement: { + const InsertElementInst* iei = cast(I); + Out << "InsertElementInst* " << getCppName(iei) + << " = InsertElementInst::Create(" << opNames[0] + << ", " << opNames[1] << ", " << opNames[2] << ", \""; + printEscapedString(iei->getName()); + Out << "\", " << bbname << ");"; + break; + } + case Instruction::ShuffleVector: { + const ShuffleVectorInst* svi = cast(I); + Out << "ShuffleVectorInst* " << getCppName(svi) + << " = new ShuffleVectorInst(" << opNames[0] + << ", " << opNames[1] << ", " << opNames[2] << ", \""; + printEscapedString(svi->getName()); + Out << "\", " << bbname << ");"; + break; + } + case Instruction::ExtractValue: { + const ExtractValueInst *evi = cast(I); + Out << "std::vector " << iName << "_indices;"; + nl(Out); + for (unsigned i = 0; i < evi->getNumIndices(); ++i) { + Out << iName << "_indices.push_back(" + << evi->idx_begin()[i] << ");"; + nl(Out); + } + Out << "ExtractValueInst* " << getCppName(evi) + << " = ExtractValueInst::Create(" << opNames[0] + << ", " + << iName << "_indices.begin(), " << iName << "_indices.end(), \""; + printEscapedString(evi->getName()); + Out << "\", " << bbname << ");"; + break; + } + case Instruction::InsertValue: { + const InsertValueInst *ivi = cast(I); + Out << "std::vector " << iName << "_indices;"; + nl(Out); + for (unsigned i = 0; i < ivi->getNumIndices(); ++i) { + Out << iName << "_indices.push_back(" + << ivi->idx_begin()[i] << ");"; nl(Out); - for (unsigned i = 0; i < ivi->getNumIndices(); ++i) { - Out << iName << "_indices.push_back(" - << ivi->idx_begin()[i] << ");"; - nl(Out); - } - Out << "InsertValueInst* " << getCppName(ivi) - << " = InsertValueInst::Create(" << opNames[0] - << ", " << opNames[1] << ", " - << iName << "_indices.begin(), " << iName << "_indices.end(), \""; - printEscapedString(ivi->getName()); - Out << "\", " << bbname << ");"; - break; } + Out << "InsertValueInst* " << getCppName(ivi) + << " = InsertValueInst::Create(" << opNames[0] + << ", " << opNames[1] << ", " + << iName << "_indices.begin(), " << iName << "_indices.end(), \""; + printEscapedString(ivi->getName()); + Out << "\", " << bbname << ");"; + break; + } } DefinedValues.insert(I); nl(Out); delete [] opNames; } - // Print out the types, constants and declarations needed by one function - void CppWriter::printFunctionUses(const Function* F) { - nl(Out) << "// Type Definitions"; nl(Out); - if (!is_inline) { - // Print the function's return type - printType(F->getReturnType()); - - // Print the function's function type - printType(F->getFunctionType()); - - // Print the types of each of the function's arguments - for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end(); - AI != AE; ++AI) { - printType(AI->getType()); - } - } +// Print out the types, constants and declarations needed by one function +void CppWriter::printFunctionUses(const Function* F) { + nl(Out) << "// Type Definitions"; nl(Out); + if (!is_inline) { + // Print the function's return type + printType(F->getReturnType()); - // Print type definitions for every type referenced by an instruction and - // make a note of any global values or constants that are referenced - SmallPtrSet gvs; - SmallPtrSet consts; - for (Function::const_iterator BB = F->begin(), BE = F->end(); - BB != BE; ++BB){ - for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); - I != E; ++I) { - // Print the type of the instruction itself - printType(I->getType()); + // Print the function's function type + printType(F->getFunctionType()); - // Print the type of each of the instruction's operands - for (unsigned i = 0; i < I->getNumOperands(); ++i) { - Value* operand = I->getOperand(i); - printType(operand->getType()); - - // If the operand references a GVal or Constant, make a note of it - if (GlobalValue* GV = dyn_cast(operand)) { - gvs.insert(GV); - if (GlobalVariable *GVar = dyn_cast(GV)) - if (GVar->hasInitializer()) - consts.insert(GVar->getInitializer()); - } else if (Constant* C = dyn_cast(operand)) - consts.insert(C); - } - } + // Print the types of each of the function's arguments + for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end(); + AI != AE; ++AI) { + printType(AI->getType()); } + } - // Print the function declarations for any functions encountered - nl(Out) << "// Function Declarations"; nl(Out); - for (SmallPtrSet::iterator I = gvs.begin(), E = gvs.end(); + // Print type definitions for every type referenced by an instruction and + // make a note of any global values or constants that are referenced + SmallPtrSet gvs; + SmallPtrSet consts; + for (Function::const_iterator BB = F->begin(), BE = F->end(); + BB != BE; ++BB){ + for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I) { - if (Function* Fun = dyn_cast(*I)) { - if (!is_inline || Fun != F) - printFunctionHead(Fun); + // Print the type of the instruction itself + printType(I->getType()); + + // Print the type of each of the instruction's operands + for (unsigned i = 0; i < I->getNumOperands(); ++i) { + Value* operand = I->getOperand(i); + printType(operand->getType()); + + // If the operand references a GVal or Constant, make a note of it + if (GlobalValue* GV = dyn_cast(operand)) { + gvs.insert(GV); + if (GlobalVariable *GVar = dyn_cast(GV)) + if (GVar->hasInitializer()) + consts.insert(GVar->getInitializer()); + } else if (Constant* C = dyn_cast(operand)) + consts.insert(C); } } + } - // Print the global variable declarations for any variables encountered - nl(Out) << "// Global Variable Declarations"; nl(Out); - for (SmallPtrSet::iterator I = gvs.begin(), E = gvs.end(); - I != E; ++I) { - if (GlobalVariable* F = dyn_cast(*I)) - printVariableHead(F); + // Print the function declarations for any functions encountered + nl(Out) << "// Function Declarations"; nl(Out); + for (SmallPtrSet::iterator I = gvs.begin(), E = gvs.end(); + I != E; ++I) { + if (Function* Fun = dyn_cast(*I)) { + if (!is_inline || Fun != F) + printFunctionHead(Fun); } + } - // Print the constants found - nl(Out) << "// Constant Definitions"; nl(Out); - for (SmallPtrSet::iterator I = consts.begin(), - E = consts.end(); I != E; ++I) { - printConstant(*I); - } - - // Process the global variables definitions now that all the constants have - // been emitted. These definitions just couple the gvars with their constant - // initializers. - nl(Out) << "// Global Variable Definitions"; nl(Out); - for (SmallPtrSet::iterator I = gvs.begin(), E = gvs.end(); - I != E; ++I) { - if (GlobalVariable* GV = dyn_cast(*I)) - printVariableBody(GV); - } + // Print the global variable declarations for any variables encountered + nl(Out) << "// Global Variable Declarations"; nl(Out); + for (SmallPtrSet::iterator I = gvs.begin(), E = gvs.end(); + I != E; ++I) { + if (GlobalVariable* F = dyn_cast(*I)) + printVariableHead(F); + } + +// Print the constants found + nl(Out) << "// Constant Definitions"; nl(Out); + for (SmallPtrSet::iterator I = consts.begin(), + E = consts.end(); I != E; ++I) { + printConstant(*I); + } + + // Process the global variables definitions now that all the constants have + // been emitted. These definitions just couple the gvars with their constant + // initializers. + nl(Out) << "// Global Variable Definitions"; nl(Out); + for (SmallPtrSet::iterator I = gvs.begin(), E = gvs.end(); + I != E; ++I) { + if (GlobalVariable* GV = dyn_cast(*I)) + printVariableBody(GV); } +} - void CppWriter::printFunctionHead(const Function* F) { - nl(Out) << "Function* " << getCppName(F); - if (is_inline) { - Out << " = mod->getFunction(\""; - printEscapedString(F->getName()); - Out << "\", " << getCppName(F->getFunctionType()) << ");"; - nl(Out) << "if (!" << getCppName(F) << ") {"; - nl(Out) << getCppName(F); - } - Out<< " = Function::Create("; - nl(Out,1) << "/*Type=*/" << getCppName(F->getFunctionType()) << ","; - nl(Out) << "/*Linkage=*/"; - printLinkageType(F->getLinkage()); - Out << ","; - nl(Out) << "/*Name=*/\""; +void CppWriter::printFunctionHead(const Function* F) { + nl(Out) << "Function* " << getCppName(F); + if (is_inline) { + Out << " = mod->getFunction(\""; printEscapedString(F->getName()); - Out << "\", mod); " << (F->isDeclaration()? "// (external, no body)" : ""); - nl(Out,-1); + Out << "\", " << getCppName(F->getFunctionType()) << ");"; + nl(Out) << "if (!" << getCppName(F) << ") {"; + nl(Out) << getCppName(F); + } + Out<< " = Function::Create("; + nl(Out,1) << "/*Type=*/" << getCppName(F->getFunctionType()) << ","; + nl(Out) << "/*Linkage=*/"; + printLinkageType(F->getLinkage()); + Out << ","; + nl(Out) << "/*Name=*/\""; + printEscapedString(F->getName()); + Out << "\", mod); " << (F->isDeclaration()? "// (external, no body)" : ""); + nl(Out,-1); + printCppName(F); + Out << "->setCallingConv("; + printCallingConv(F->getCallingConv()); + Out << ");"; + nl(Out); + if (F->hasSection()) { + printCppName(F); + Out << "->setSection(\"" << F->getSection() << "\");"; + nl(Out); + } + if (F->getAlignment()) { + printCppName(F); + Out << "->setAlignment(" << F->getAlignment() << ");"; + nl(Out); + } + if (F->getVisibility() != GlobalValue::DefaultVisibility) { printCppName(F); - Out << "->setCallingConv("; - printCallingConv(F->getCallingConv()); + Out << "->setVisibility("; + printVisibilityType(F->getVisibility()); Out << ");"; nl(Out); - if (F->hasSection()) { - printCppName(F); - Out << "->setSection(\"" << F->getSection() << "\");"; - nl(Out); - } - if (F->getAlignment()) { - printCppName(F); - Out << "->setAlignment(" << F->getAlignment() << ");"; - nl(Out); - } - if (F->getVisibility() != GlobalValue::DefaultVisibility) { - printCppName(F); - Out << "->setVisibility("; - printVisibilityType(F->getVisibility()); - Out << ");"; - nl(Out); - } - if (F->hasGC()) { - printCppName(F); - Out << "->setGC(\"" << F->getGC() << "\");"; - nl(Out); - } - if (is_inline) { - Out << "}"; - nl(Out); - } - printAttributes(F->getAttributes(), getCppName(F)); + } + if (F->hasGC()) { printCppName(F); - Out << "->setAttributes(" << getCppName(F) << "_PAL);"; + Out << "->setGC(\"" << F->getGC() << "\");"; nl(Out); } + if (is_inline) { + Out << "}"; + nl(Out); + } + printAttributes(F->getAttributes(), getCppName(F)); + printCppName(F); + Out << "->setAttributes(" << getCppName(F) << "_PAL);"; + nl(Out); +} - void CppWriter::printFunctionBody(const Function *F) { - if (F->isDeclaration()) - return; // external functions have no bodies. - - // Clear the DefinedValues and ForwardRefs maps because we can't have - // cross-function forward refs - ForwardRefs.clear(); - DefinedValues.clear(); - - // Create all the argument values - if (!is_inline) { - if (!F->arg_empty()) { - Out << "Function::arg_iterator args = " << getCppName(F) - << "->arg_begin();"; - nl(Out); - } - for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end(); - AI != AE; ++AI) { - Out << "Value* " << getCppName(AI) << " = args++;"; +void CppWriter::printFunctionBody(const Function *F) { + if (F->isDeclaration()) + return; // external functions have no bodies. + + // Clear the DefinedValues and ForwardRefs maps because we can't have + // cross-function forward refs + ForwardRefs.clear(); + DefinedValues.clear(); + + // Create all the argument values + if (!is_inline) { + if (!F->arg_empty()) { + Out << "Function::arg_iterator args = " << getCppName(F) + << "->arg_begin();"; + nl(Out); + } + for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end(); + AI != AE; ++AI) { + Out << "Value* " << getCppName(AI) << " = args++;"; + nl(Out); + if (AI->hasName()) { + Out << getCppName(AI) << "->setName(\"" << AI->getName() << "\");"; nl(Out); - if (AI->hasName()) { - Out << getCppName(AI) << "->setName(\"" << AI->getName() << "\");"; - nl(Out); - } } } + } - // Create all the basic blocks + // Create all the basic blocks + nl(Out); + for (Function::const_iterator BI = F->begin(), BE = F->end(); + BI != BE; ++BI) { + std::string bbname(getCppName(BI)); + Out << "BasicBlock* " << bbname << + " = BasicBlock::Create(mod->getContext(), \""; + if (BI->hasName()) + printEscapedString(BI->getName()); + Out << "\"," << getCppName(BI->getParent()) << ",0);"; nl(Out); - for (Function::const_iterator BI = F->begin(), BE = F->end(); - BI != BE; ++BI) { - std::string bbname(getCppName(BI)); - Out << "BasicBlock* " << bbname << - " = BasicBlock::Create(mod->getContext(), \""; - if (BI->hasName()) - printEscapedString(BI->getName()); - Out << "\"," << getCppName(BI->getParent()) << ",0);"; - nl(Out); - } - - // Output all of its basic blocks... for the function - for (Function::const_iterator BI = F->begin(), BE = F->end(); - BI != BE; ++BI) { - std::string bbname(getCppName(BI)); - nl(Out) << "// Block " << BI->getName() << " (" << bbname << ")"; - nl(Out); - - // Output all of the instructions in the basic block... - for (BasicBlock::const_iterator I = BI->begin(), E = BI->end(); - I != E; ++I) { - printInstruction(I,bbname); - } - } + } - // Loop over the ForwardRefs and resolve them now that all instructions - // are generated. - if (!ForwardRefs.empty()) { - nl(Out) << "// Resolve Forward References"; - nl(Out); - } + // Output all of its basic blocks... for the function + for (Function::const_iterator BI = F->begin(), BE = F->end(); + BI != BE; ++BI) { + std::string bbname(getCppName(BI)); + nl(Out) << "// Block " << BI->getName() << " (" << bbname << ")"; + nl(Out); - while (!ForwardRefs.empty()) { - ForwardRefMap::iterator I = ForwardRefs.begin(); - Out << I->second << "->replaceAllUsesWith(" - << getCppName(I->first) << "); delete " << I->second << ";"; - nl(Out); - ForwardRefs.erase(I); + // Output all of the instructions in the basic block... + for (BasicBlock::const_iterator I = BI->begin(), E = BI->end(); + I != E; ++I) { + printInstruction(I,bbname); } } - void CppWriter::printInline(const std::string& fname, - const std::string& func) { - const Function* F = TheModule->getFunction(func); - if (!F) { - error(std::string("Function '") + func + "' not found in input module"); - return; - } - if (F->isDeclaration()) { - error(std::string("Function '") + func + "' is external!"); - return; - } - nl(Out) << "BasicBlock* " << fname << "(Module* mod, Function *" - << getCppName(F); - unsigned arg_count = 1; - for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end(); - AI != AE; ++AI) { - Out << ", Value* arg_" << arg_count; - } - Out << ") {"; + // Loop over the ForwardRefs and resolve them now that all instructions + // are generated. + if (!ForwardRefs.empty()) { + nl(Out) << "// Resolve Forward References"; nl(Out); - is_inline = true; - printFunctionUses(F); - printFunctionBody(F); - is_inline = false; - Out << "return " << getCppName(F->begin()) << ";"; - nl(Out) << "}"; + } + + while (!ForwardRefs.empty()) { + ForwardRefMap::iterator I = ForwardRefs.begin(); + Out << I->second << "->replaceAllUsesWith(" + << getCppName(I->first) << "); delete " << I->second << ";"; nl(Out); + ForwardRefs.erase(I); } +} - void CppWriter::printModuleBody() { - // Print out all the type definitions - nl(Out) << "// Type Definitions"; nl(Out); - printTypes(TheModule); - - // Functions can call each other and global variables can reference them so - // define all the functions first before emitting their function bodies. - nl(Out) << "// Function Declarations"; nl(Out); - for (Module::const_iterator I = TheModule->begin(), E = TheModule->end(); - I != E; ++I) - printFunctionHead(I); - - // Process the global variables declarations. We can't initialze them until - // after the constants are printed so just print a header for each global - nl(Out) << "// Global Variable Declarations\n"; nl(Out); - for (Module::const_global_iterator I = TheModule->global_begin(), - E = TheModule->global_end(); I != E; ++I) { - printVariableHead(I); - } - - // Print out all the constants definitions. Constants don't recurse except - // through GlobalValues. All GlobalValues have been declared at this point - // so we can proceed to generate the constants. - nl(Out) << "// Constant Definitions"; nl(Out); - printConstants(TheModule); - - // Process the global variables definitions now that all the constants have - // been emitted. These definitions just couple the gvars with their constant - // initializers. - nl(Out) << "// Global Variable Definitions"; nl(Out); - for (Module::const_global_iterator I = TheModule->global_begin(), - E = TheModule->global_end(); I != E; ++I) { - printVariableBody(I); - } - - // Finally, we can safely put out all of the function bodies. - nl(Out) << "// Function Definitions"; nl(Out); - for (Module::const_iterator I = TheModule->begin(), E = TheModule->end(); - I != E; ++I) { - if (!I->isDeclaration()) { - nl(Out) << "// Function: " << I->getName() << " (" << getCppName(I) - << ")"; - nl(Out) << "{"; - nl(Out,1); - printFunctionBody(I); - nl(Out,-1) << "}"; - nl(Out); - } +void CppWriter::printInline(const std::string& fname, + const std::string& func) { + const Function* F = TheModule->getFunction(func); + if (!F) { + error(std::string("Function '") + func + "' not found in input module"); + return; + } + if (F->isDeclaration()) { + error(std::string("Function '") + func + "' is external!"); + return; + } + nl(Out) << "BasicBlock* " << fname << "(Module* mod, Function *" + << getCppName(F); + unsigned arg_count = 1; + for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end(); + AI != AE; ++AI) { + Out << ", Value* arg_" << arg_count; + } + Out << ") {"; + nl(Out); + is_inline = true; + printFunctionUses(F); + printFunctionBody(F); + is_inline = false; + Out << "return " << getCppName(F->begin()) << ";"; + nl(Out) << "}"; + nl(Out); +} + +void CppWriter::printModuleBody() { + // Print out all the type definitions + nl(Out) << "// Type Definitions"; nl(Out); + printTypes(TheModule); + + // Functions can call each other and global variables can reference them so + // define all the functions first before emitting their function bodies. + nl(Out) << "// Function Declarations"; nl(Out); + for (Module::const_iterator I = TheModule->begin(), E = TheModule->end(); + I != E; ++I) + printFunctionHead(I); + + // Process the global variables declarations. We can't initialze them until + // after the constants are printed so just print a header for each global + nl(Out) << "// Global Variable Declarations\n"; nl(Out); + for (Module::const_global_iterator I = TheModule->global_begin(), + E = TheModule->global_end(); I != E; ++I) { + printVariableHead(I); + } + + // Print out all the constants definitions. Constants don't recurse except + // through GlobalValues. All GlobalValues have been declared at this point + // so we can proceed to generate the constants. + nl(Out) << "// Constant Definitions"; nl(Out); + printConstants(TheModule); + + // Process the global variables definitions now that all the constants have + // been emitted. These definitions just couple the gvars with their constant + // initializers. + nl(Out) << "// Global Variable Definitions"; nl(Out); + for (Module::const_global_iterator I = TheModule->global_begin(), + E = TheModule->global_end(); I != E; ++I) { + printVariableBody(I); + } + + // Finally, we can safely put out all of the function bodies. + nl(Out) << "// Function Definitions"; nl(Out); + for (Module::const_iterator I = TheModule->begin(), E = TheModule->end(); + I != E; ++I) { + if (!I->isDeclaration()) { + nl(Out) << "// Function: " << I->getName() << " (" << getCppName(I) + << ")"; + nl(Out) << "{"; + nl(Out,1); + printFunctionBody(I); + nl(Out,-1) << "}"; + nl(Out); } } +} - void CppWriter::printProgram(const std::string& fname, - const std::string& mName) { - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "#include \n"; - Out << "using namespace llvm;\n\n"; - Out << "Module* " << fname << "();\n\n"; - Out << "int main(int argc, char**argv) {\n"; - Out << " Module* Mod = " << fname << "();\n"; - Out << " verifyModule(*Mod, PrintMessageAction);\n"; - Out << " PassManager PM;\n"; - Out << " PM.add(createPrintModulePass(&outs()));\n"; - Out << " PM.run(*Mod);\n"; - Out << " return 0;\n"; - Out << "}\n\n"; - printModule(fname,mName); +void CppWriter::printProgram(const std::string& fname, + const std::string& mName) { + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "#include \n"; + Out << "using namespace llvm;\n\n"; + Out << "Module* " << fname << "();\n\n"; + Out << "int main(int argc, char**argv) {\n"; + Out << " Module* Mod = " << fname << "();\n"; + Out << " verifyModule(*Mod, PrintMessageAction);\n"; + Out << " PassManager PM;\n"; + Out << " PM.add(createPrintModulePass(&outs()));\n"; + Out << " PM.run(*Mod);\n"; + Out << " return 0;\n"; + Out << "}\n\n"; + printModule(fname,mName); +} + +void CppWriter::printModule(const std::string& fname, + const std::string& mName) { + nl(Out) << "Module* " << fname << "() {"; + nl(Out,1) << "// Module Construction"; + nl(Out) << "Module* mod = new Module(\""; + printEscapedString(mName); + Out << "\", getGlobalContext());"; + if (!TheModule->getTargetTriple().empty()) { + nl(Out) << "mod->setDataLayout(\"" << TheModule->getDataLayout() << "\");"; + } + if (!TheModule->getTargetTriple().empty()) { + nl(Out) << "mod->setTargetTriple(\"" << TheModule->getTargetTriple() + << "\");"; + } + + if (!TheModule->getModuleInlineAsm().empty()) { + nl(Out) << "mod->setModuleInlineAsm(\""; + printEscapedString(TheModule->getModuleInlineAsm()); + Out << "\");"; } + nl(Out); - void CppWriter::printModule(const std::string& fname, + // Loop over the dependent libraries and emit them. + Module::lib_iterator LI = TheModule->lib_begin(); + Module::lib_iterator LE = TheModule->lib_end(); + while (LI != LE) { + Out << "mod->addLibrary(\"" << *LI << "\");"; + nl(Out); + ++LI; + } + printModuleBody(); + nl(Out) << "return mod;"; + nl(Out,-1) << "}"; + nl(Out); +} + +void CppWriter::printContents(const std::string& fname, const std::string& mName) { - nl(Out) << "Module* " << fname << "() {"; - nl(Out,1) << "// Module Construction"; - nl(Out) << "Module* mod = new Module(\""; - printEscapedString(mName); - Out << "\", getGlobalContext());"; - if (!TheModule->getTargetTriple().empty()) { - nl(Out) << "mod->setDataLayout(\"" << TheModule->getDataLayout() << "\");"; - } - if (!TheModule->getTargetTriple().empty()) { - nl(Out) << "mod->setTargetTriple(\"" << TheModule->getTargetTriple() - << "\");"; - } - - if (!TheModule->getModuleInlineAsm().empty()) { - nl(Out) << "mod->setModuleInlineAsm(\""; - printEscapedString(TheModule->getModuleInlineAsm()); - Out << "\");"; - } - nl(Out); - - // Loop over the dependent libraries and emit them. - Module::lib_iterator LI = TheModule->lib_begin(); - Module::lib_iterator LE = TheModule->lib_end(); - while (LI != LE) { - Out << "mod->addLibrary(\"" << *LI << "\");"; - nl(Out); - ++LI; - } - printModuleBody(); - nl(Out) << "return mod;"; - nl(Out,-1) << "}"; - nl(Out); - } - - void CppWriter::printContents(const std::string& fname, - const std::string& mName) { - Out << "\nModule* " << fname << "(Module *mod) {\n"; - Out << "\nmod->setModuleIdentifier(\""; - printEscapedString(mName); - Out << "\");\n"; - printModuleBody(); - Out << "\nreturn mod;\n"; - Out << "\n}\n"; - } - - void CppWriter::printFunction(const std::string& fname, - const std::string& funcName) { - const Function* F = TheModule->getFunction(funcName); - if (!F) { - error(std::string("Function '") + funcName + "' not found in input module"); - return; - } - Out << "\nFunction* " << fname << "(Module *mod) {\n"; - printFunctionUses(F); - printFunctionHead(F); - printFunctionBody(F); - Out << "return " << getCppName(F) << ";\n"; - Out << "}\n"; - } - - void CppWriter::printFunctions() { - const Module::FunctionListType &funcs = TheModule->getFunctionList(); - Module::const_iterator I = funcs.begin(); - Module::const_iterator IE = funcs.end(); - - for (; I != IE; ++I) { - const Function &func = *I; - if (!func.isDeclaration()) { - std::string name("define_"); - name += func.getName(); - printFunction(name, func.getName()); - } + Out << "\nModule* " << fname << "(Module *mod) {\n"; + Out << "\nmod->setModuleIdentifier(\""; + printEscapedString(mName); + Out << "\");\n"; + printModuleBody(); + Out << "\nreturn mod;\n"; + Out << "\n}\n"; +} + +void CppWriter::printFunction(const std::string& fname, + const std::string& funcName) { + const Function* F = TheModule->getFunction(funcName); + if (!F) { + error(std::string("Function '") + funcName + "' not found in input module"); + return; + } + Out << "\nFunction* " << fname << "(Module *mod) {\n"; + printFunctionUses(F); + printFunctionHead(F); + printFunctionBody(F); + Out << "return " << getCppName(F) << ";\n"; + Out << "}\n"; +} + +void CppWriter::printFunctions() { + const Module::FunctionListType &funcs = TheModule->getFunctionList(); + Module::const_iterator I = funcs.begin(); + Module::const_iterator IE = funcs.end(); + + for (; I != IE; ++I) { + const Function &func = *I; + if (!func.isDeclaration()) { + std::string name("define_"); + name += func.getName(); + printFunction(name, func.getName()); } } +} - void CppWriter::printVariable(const std::string& fname, - const std::string& varName) { - const GlobalVariable* GV = TheModule->getNamedGlobal(varName); - - if (!GV) { - error(std::string("Variable '") + varName + "' not found in input module"); - return; - } - Out << "\nGlobalVariable* " << fname << "(Module *mod) {\n"; - printVariableUses(GV); - printVariableHead(GV); - printVariableBody(GV); - Out << "return " << getCppName(GV) << ";\n"; - Out << "}\n"; - } - - void CppWriter::printType(const std::string& fname, - const std::string& typeName) { - const Type* Ty = TheModule->getTypeByName(typeName); - if (!Ty) { - error(std::string("Type '") + typeName + "' not found in input module"); - return; - } - Out << "\nType* " << fname << "(Module *mod) {\n"; - printType(Ty); - Out << "return " << getCppName(Ty) << ";\n"; - Out << "}\n"; - } - - bool CppWriter::runOnModule(Module &M) { - TheModule = &M; - - // Emit a header - Out << "// Generated by llvm2cpp - DO NOT MODIFY!\n\n"; - - // Get the name of the function we're supposed to generate - std::string fname = FuncName.getValue(); - - // Get the name of the thing we are to generate - std::string tgtname = NameToGenerate.getValue(); - if (GenerationType == GenModule || - GenerationType == GenContents || - GenerationType == GenProgram || - GenerationType == GenFunctions) { - if (tgtname == "!bad!") { - if (M.getModuleIdentifier() == "-") - tgtname = ""; - else - tgtname = M.getModuleIdentifier(); - } - } else if (tgtname == "!bad!") - error("You must use the -for option with -gen-{function,variable,type}"); +void CppWriter::printVariable(const std::string& fname, + const std::string& varName) { + const GlobalVariable* GV = TheModule->getNamedGlobal(varName); + + if (!GV) { + error(std::string("Variable '") + varName + "' not found in input module"); + return; + } + Out << "\nGlobalVariable* " << fname << "(Module *mod) {\n"; + printVariableUses(GV); + printVariableHead(GV); + printVariableBody(GV); + Out << "return " << getCppName(GV) << ";\n"; + Out << "}\n"; +} - switch (WhatToGenerate(GenerationType)) { - case GenProgram: - if (fname.empty()) - fname = "makeLLVMModule"; - printProgram(fname,tgtname); - break; - case GenModule: - if (fname.empty()) - fname = "makeLLVMModule"; - printModule(fname,tgtname); - break; - case GenContents: - if (fname.empty()) - fname = "makeLLVMModuleContents"; - printContents(fname,tgtname); - break; - case GenFunction: - if (fname.empty()) - fname = "makeLLVMFunction"; - printFunction(fname,tgtname); - break; - case GenFunctions: - printFunctions(); - break; - case GenInline: - if (fname.empty()) - fname = "makeLLVMInline"; - printInline(fname,tgtname); - break; - case GenVariable: - if (fname.empty()) - fname = "makeLLVMVariable"; - printVariable(fname,tgtname); - break; - case GenType: - if (fname.empty()) - fname = "makeLLVMType"; - printType(fname,tgtname); - break; - default: - error("Invalid generation option"); +void CppWriter::printType(const std::string& fname, + const std::string& typeName) { + const Type* Ty = TheModule->getTypeByName(typeName); + if (!Ty) { + error(std::string("Type '") + typeName + "' not found in input module"); + return; + } + Out << "\nType* " << fname << "(Module *mod) {\n"; + printType(Ty); + Out << "return " << getCppName(Ty) << ";\n"; + Out << "}\n"; +} + +bool CppWriter::runOnModule(Module &M) { + TheModule = &M; + + // Emit a header + Out << "// Generated by llvm2cpp - DO NOT MODIFY!\n\n"; + + // Get the name of the function we're supposed to generate + std::string fname = FuncName.getValue(); + + // Get the name of the thing we are to generate + std::string tgtname = NameToGenerate.getValue(); + if (GenerationType == GenModule || + GenerationType == GenContents || + GenerationType == GenProgram || + GenerationType == GenFunctions) { + if (tgtname == "!bad!") { + if (M.getModuleIdentifier() == "-") + tgtname = ""; + else + tgtname = M.getModuleIdentifier(); } + } else if (tgtname == "!bad!") + error("You must use the -for option with -gen-{function,variable,type}"); - return false; + switch (WhatToGenerate(GenerationType)) { + case GenProgram: + if (fname.empty()) + fname = "makeLLVMModule"; + printProgram(fname,tgtname); + break; + case GenModule: + if (fname.empty()) + fname = "makeLLVMModule"; + printModule(fname,tgtname); + break; + case GenContents: + if (fname.empty()) + fname = "makeLLVMModuleContents"; + printContents(fname,tgtname); + break; + case GenFunction: + if (fname.empty()) + fname = "makeLLVMFunction"; + printFunction(fname,tgtname); + break; + case GenFunctions: + printFunctions(); + break; + case GenInline: + if (fname.empty()) + fname = "makeLLVMInline"; + printInline(fname,tgtname); + break; + case GenVariable: + if (fname.empty()) + fname = "makeLLVMVariable"; + printVariable(fname,tgtname); + break; + case GenType: + if (fname.empty()) + fname = "makeLLVMType"; + printType(fname,tgtname); + break; + default: + error("Invalid generation option"); } + + return false; } char CppWriter::ID = 0; From sabre at nondot.org Mon Jun 21 18:14:47 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 21 Jun 2010 23:14:47 -0000 Subject: [llvm-commits] [llvm] r106501 - /llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Message-ID: <20100621231447.845542A6C12C@llvm.org> Author: lattner Date: Mon Jun 21 18:14:47 2010 New Revision: 106501 URL: http://llvm.org/viewvc/llvm-project?rev=106501&view=rev Log: eliminate a mutable global variable, use raw_ostream::indent instead of rolling our own. Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=106501&r1=106500&r2=106501&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Mon Jun 21 18:14:47 2010 @@ -99,6 +99,7 @@ ValueSet DefinedValues; ForwardRefMap ForwardRefs; bool is_inline; + unsigned indent_level; public: static char ID; @@ -120,6 +121,11 @@ void error(const std::string& msg); + + formatted_raw_ostream& nl(formatted_raw_ostream &Out, int delta = 0); + inline void in() { indent_level++; } + inline void out() { if (indent_level >0) indent_level--; } + private: void printLinkageType(GlobalValue::LinkageTypes LT); void printVisibilityType(GlobalValue::VisibilityTypes VisTypes); @@ -155,20 +161,14 @@ }; } // end anonymous namespace. -// FIXME: Shouldn't be using globals for this. -static unsigned indent_level = 0; -static formatted_raw_ostream& nl(formatted_raw_ostream &Out, int delta = 0) { - Out << "\n"; +formatted_raw_ostream &CppWriter::nl(formatted_raw_ostream &Out, int delta) { + Out << '\n'; if (delta >= 0 || indent_level >= unsigned(-delta)) indent_level += delta; - for (unsigned i = 0; i < indent_level; ++i) - Out << " "; + Out.indent(indent_level); return Out; } -static inline void in() { indent_level++; } -static inline void out() { if (indent_level >0) indent_level--; } - static inline void sanitize(std::string &str) { for (size_t i = 0; i < str.length(); ++i) if (!isalnum(str[i]) && str[i] != '_') From sabre at nondot.org Mon Jun 21 18:19:36 2010 From: sabre at nondot.org (Chris Lattner) Date: Mon, 21 Jun 2010 23:19:36 -0000 Subject: [llvm-commits] [llvm] r106502 - /llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Message-ID: <20100621231936.597C32A6C12C@llvm.org> Author: lattner Date: Mon Jun 21 18:19:36 2010 New Revision: 106502 URL: http://llvm.org/viewvc/llvm-project?rev=106502&view=rev Log: add some support for blockaddress. This isn't really enough to be useful, but it will cover uses of blockaddress that are actually in a function. Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=106502&r1=106501&r2=106502&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Mon Jun 21 18:19:36 2010 @@ -936,6 +936,9 @@ Out << ", " << getCppName(CE->getOperand(i)); Out << ");"; } + } else if (const BlockAddress *BA = dyn_cast(CV)) { + Out << "Constant* " << constName << " = "; + Out << "BlockAddress::get(" << getOpName(BA->getBasicBlock()) << ");"; } else { error("Bad Constant"); Out << "Constant* " << constName << " = 0; "; @@ -1088,9 +1091,8 @@ // forward references. So, we get the names of all the operands in advance const unsigned Ops(I->getNumOperands()); std::string* opNames = new std::string[Ops]; - for (unsigned i = 0; i < Ops; i++) { + for (unsigned i = 0; i < Ops; i++) opNames[i] = getOpName(I->getOperand(i)); - } switch (I->getOpcode()) { default: @@ -1106,7 +1108,7 @@ case Instruction::Br: { const BranchInst* br = cast(I); Out << "BranchInst::Create(" ; - if (br->getNumOperands() == 3 ) { + if (br->getNumOperands() == 3) { Out << opNames[2] << ", " << opNames[1] << ", " << opNames[0] << ", "; From echristo at apple.com Mon Jun 21 18:49:08 2010 From: echristo at apple.com (Eric Christopher) Date: Mon, 21 Jun 2010 23:49:08 -0000 Subject: [llvm-commits] [llvm] r106505 - /llvm/trunk/Makefile.rules Message-ID: <20100621234908.8FC1F2A6C12C@llvm.org> Author: echristo Date: Mon Jun 21 18:49:08 2010 New Revision: 106505 URL: http://llvm.org/viewvc/llvm-project?rev=106505&view=rev Log: Fix typo. Modified: llvm/trunk/Makefile.rules Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=106505&r1=106504&r2=106505&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Mon Jun 21 18:49:08 2010 @@ -935,7 +935,7 @@ endif ############################################################################### -# Set up variables for building libararies +# Set up variables for building libraries ############################################################################### #--------------------------------------------------------- From wdietz2 at illinois.edu Mon Jun 21 18:49:37 2010 From: wdietz2 at illinois.edu (Will Dietz) Date: Mon, 21 Jun 2010 23:49:37 -0000 Subject: [llvm-commits] [poolalloc] r106506 - /poolalloc/trunk/test/Makefile Message-ID: <20100621234937.9FD482A6C12C@llvm.org> Author: wdietz2 Date: Mon Jun 21 18:49:37 2010 New Revision: 106506 URL: http://llvm.org/viewvc/llvm-project?rev=106506&view=rev Log: remove unused variable in test/Makefile Modified: poolalloc/trunk/test/Makefile Modified: poolalloc/trunk/test/Makefile URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/Makefile?rev=106506&r1=106505&r2=106506&view=diff ============================================================================== --- poolalloc/trunk/test/Makefile (original) +++ poolalloc/trunk/test/Makefile Mon Jun 21 18:49:37 2010 @@ -326,9 +326,6 @@ .PHONY: lit -#Path to 'lit' -LIT=$(LLVM_SRC_ROOT)/utils/lit/lit.py - #Figure out what our configuration is #Better way? ifeq ($(ENABLE_OPTIMIZED),1) From bob.wilson at apple.com Mon Jun 21 19:11:03 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 22 Jun 2010 00:11:03 -0000 Subject: [llvm-commits] [llvm] r106508 - /llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Message-ID: <20100622001103.C46022A6C12C@llvm.org> Author: bwilson Date: Mon Jun 21 19:11:03 2010 New Revision: 106508 URL: http://llvm.org/viewvc/llvm-project?rev=106508&view=rev Log: Include named metadata when cloning a module. Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneModule.cpp?rev=106508&r1=106507&r2=106508&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneModule.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Mon Jun 21 19:11:03 2010 @@ -122,6 +122,17 @@ if (const Constant* C = I->getAliasee()) GA->setAliasee(cast(MapValue(C, ValueMap))); } + + // And named metadata.... + for (Module::const_named_metadata_iterator I = M->named_metadata_begin(), + E = M->named_metadata_end(); I != E; ++I) { + const NamedMDNode &NMD = *I; + SmallVector MDs; + for (unsigned i = 0, e = NMD.getNumOperands(); i != e; ++i) + MDs.push_back(cast(MapValue(NMD.getOperand(i), ValueMap))); + NamedMDNode::Create(New->getContext(), NMD.getName(), + MDs.data(), MDs.size(), New); + } return New; } From clattner at apple.com Mon Jun 21 19:27:49 2010 From: clattner at apple.com (Chris Lattner) Date: Mon, 21 Jun 2010 17:27:49 -0700 Subject: [llvm-commits] [llvm] r106075 - in /llvm/trunk: include/llvm/Module.h lib/Analysis/DebugInfo.cpp lib/CodeGen/AsmPrinter/DwarfDebug.cpp lib/VMCore/Module.cpp In-Reply-To: <20100616005355.C0B432A6C12D@llvm.org> References: <20100616005355.C0B432A6C12D@llvm.org> Message-ID: <0344EB53-EF9E-4604-80DF-A092255F2967@apple.com> On Jun 15, 2010, at 5:53 PM, Devang Patel wrote: > Author: dpatel > Date: Tue Jun 15 19:53:55 2010 > New Revision: 106075 > > URL: http://llvm.org/viewvc/llvm-project?rev=106075&view=rev > Log: > Use separate named MDNode to hold each function's local variable info. > This speeds up local variable handling in DwarfDebug. Ok. > +++ llvm/trunk/include/llvm/Module.h Tue Jun 15 19:53:55 2010 > @@ -326,6 +326,7 @@ > /// specified name. This method returns null if a NamedMDNode with the > /// specified name is not found. > NamedMDNode *getNamedMetadata(StringRef Name) const; > + NamedMDNode *getNamedMetadataUsingTwine(Twine Name) const; Twine's should always be taken by const reference, not by copy. Also, please just name it getNamedMetadata, not getNamedMetadataUsingTwine. To solve the ambiguity problems you got, just remove the stringref version. > +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Tue Jun 15 19:53:55 2010 > @@ -1053,8 +1053,12 @@ > // The optimizer may remove local variable. If there is an interest > // to preserve variable info in such situation then stash it in a > // named mdnode. .. > + DISubprogram Fn(getDISubprogram(Context)); > + const Twine FnLVName = Twine("llvm.dbg.lv.", Fn.getName()); > + NamedMDNode *FnLocals = M.getNamedMetadataUsingTwine(FnLVName); This is just barely safe, but is really dangerous. Please use: NamedMDNode *FnLocals = M.getNamedMetadata(Twine("llvm.dbg.lv.")+Fn.getName()); The temporaries are destroyed at the end of the statement. > + if (!FnLocals) > + FnLocals = NamedMDNode::Create(VMContext, FnLVName, NULL, 0, &M); Just pass in the same expression to form the twine here as well. > +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Jun 15 19:53:55 2010 > @@ -2259,8 +2259,9 @@ > } > > // Collect info for variables that were optimized out. > - if (NamedMDNode *NMD = > - MF->getFunction()->getParent()->getNamedMetadata("llvm.dbg.lv")) { > + const Twine FnLVName = Twine("llvm.dbg.lv.", MF->getFunction()->getName()); > + if (NamedMDNode *NMD = > + MF->getFunction()->getParent()->getNamedMetadataUsingTwine(FnLVName)) { Same deal as above. -Chris From gohman at apple.com Mon Jun 21 19:32:04 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 22 Jun 2010 00:32:04 -0000 Subject: [llvm-commits] [llvm] r106512 - /llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Message-ID: <20100622003204.A9A472A6C12C@llvm.org> Author: djg Date: Mon Jun 21 19:32:04 2010 New Revision: 106512 URL: http://llvm.org/viewvc/llvm-project?rev=106512&view=rev Log: Fix the new load-unfolding code to update LiveVariable's dead flags, in addition to the kill flags. Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=106512&r1=106511&r2=106512&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Mon Jun 21 19:32:04 2010 @@ -961,8 +961,14 @@ if (LV) { for (unsigned i = 0, e = mi->getNumOperands(); i != e; ++i) { MachineOperand &MO = mi->getOperand(i); - if (MO.isReg() && MO.isUse() && MO.isKill()) - LV->replaceKillInstruction(Reg, mi, NewMIs[0]); + if (MO.isReg() && MO.getReg() != 0 && + TargetRegisterInfo::isVirtualRegister(MO.getReg())) { + if (MO.isUse()) { + if (MO.isKill()) + LV->replaceKillInstruction(MO.getReg(), mi, NewMIs[0]); + } else if (LV->removeVirtualRegisterDead(MO.getReg(), mi)) + LV->addVirtualRegisterDead(MO.getReg(), NewMIs[1]); + } } LV->addVirtualRegisterKilled(Reg, NewMIs[1]); } From sabre at nondot.org Mon Jun 21 19:40:26 2010 From: sabre at nondot.org (Chris Lattner) Date: Tue, 22 Jun 2010 00:40:26 -0000 Subject: [llvm-commits] [llvm] r106513 - /llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Message-ID: <20100622004026.D5A6B2A6C12C@llvm.org> Author: lattner Date: Mon Jun 21 19:40:26 2010 New Revision: 106513 URL: http://llvm.org/viewvc/llvm-project?rev=106513&view=rev Log: make sure to initialize indent_level Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=106513&r1=106512&r2=106513&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Mon Jun 21 19:40:26 2010 @@ -104,7 +104,7 @@ public: static char ID; explicit CppWriter(formatted_raw_ostream &o) : - ModulePass(&ID), Out(o), uniqueNum(0), is_inline(false) {} + ModulePass(&ID), Out(o), uniqueNum(0), is_inline(false), indent_level(0){} virtual const char *getPassName() const { return "C++ backend"; } From gohman at apple.com Mon Jun 21 20:00:39 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 22 Jun 2010 01:00:39 -0000 Subject: [llvm-commits] [test-suite] r106514 - /test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/archie-client/pfs.h Message-ID: <20100622010039.E59632A6C12C@llvm.org> Author: djg Date: Mon Jun 21 20:00:39 2010 New Revision: 106514 URL: http://llvm.org/viewvc/llvm-project?rev=106514&view=rev Log: Change this struct's name so that it doesn't conflict with a keyword in C99. Modified: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/archie-client/pfs.h Modified: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/archie-client/pfs.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/archie-client/pfs.h?rev=106514&r1=106513&r2=106514&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/archie-client/pfs.h (original) +++ test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/archie-client/pfs.h Mon Jun 21 20:00:39 2010 @@ -210,7 +210,7 @@ char *atype; /* Authentication type */ char *rights; /* Rights */ char *principals; /* Authorized principals */ - struct restrict *restrictions; /* Restrictions on use */ + struct restrict_ *restrictions; /* Restrictions on use */ struct acl *previous; /* Previous elt in linked list */ struct acl *next; /* Next element in linked list */ }; @@ -232,7 +232,7 @@ /* Definition of structure contining access restrictions */ /* for future extensions */ -struct restrict { +struct restrict_ { struct acl *previous; /* Previous elt in linked list */ struct acl *next; /* Next element in linked list */ }; From dpatel at apple.com Mon Jun 21 20:01:58 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 22 Jun 2010 01:01:58 -0000 Subject: [llvm-commits] [llvm] r106515 - in /llvm/trunk/lib: Analysis/DebugInfo.cpp CodeGen/AsmPrinter/DwarfDebug.cpp Message-ID: <20100622010158.7C6D02A6C12C@llvm.org> Author: dpatel Date: Mon Jun 21 20:01:58 2010 New Revision: 106515 URL: http://llvm.org/viewvc/llvm-project?rev=106515&view=rev Log: Do not rely on Twine temporaries to survive. Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=106515&r1=106514&r2=106515&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DebugInfo.cpp (original) +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Mon Jun 21 20:01:58 2010 @@ -1059,14 +1059,14 @@ StringRef FName = "fn"; if (Fn.getFunction()) FName = Fn.getFunction()->getName(); - const Twine FnLVName = Twine("llvm.dbg.lv.", FName); char One = '\1'; if (FName.startswith(StringRef(&One, 1))) FName = FName.substr(1); - - NamedMDNode *FnLocals = M.getNamedMetadataUsingTwine(FnLVName); + NamedMDNode *FnLocals = + M.getNamedMetadataUsingTwine(Twine("llvm.dbg.lv.", FName)); if (!FnLocals) - FnLocals = NamedMDNode::Create(VMContext, FnLVName, NULL, 0, &M); + FnLocals = NamedMDNode::Create(VMContext, Twine("llvm.dbg.lv.", FName), + NULL, 0, &M); FnLocals->addOperand(Node); } return DIVariable(Node); Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=106515&r1=106514&r2=106515&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Jun 21 20:01:58 2010 @@ -2257,9 +2257,10 @@ } // Collect info for variables that were optimized out. - const Twine FnLVName = Twine("llvm.dbg.lv.", MF->getFunction()->getName()); - if (NamedMDNode *NMD = - MF->getFunction()->getParent()->getNamedMetadataUsingTwine(FnLVName)) { + const Function *F = MF->getFunction(); + const Module *M = F->getParent(); + if (NamedMDNode *NMD = + M->getNamedMetadataUsingTwine(Twine("llvm.dbg.lv.", F->getName()))) { for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) { DIVariable DV(cast_or_null(NMD->getOperand(i))); if (!DV || !Processed.insert(DV)) From dpatel at apple.com Mon Jun 21 20:02:24 2010 From: dpatel at apple.com (Devang Patel) Date: Mon, 21 Jun 2010 18:02:24 -0700 Subject: [llvm-commits] [llvm] r106075 - in /llvm/trunk: include/llvm/Module.h lib/Analysis/DebugInfo.cpp lib/CodeGen/AsmPrinter/DwarfDebug.cpp lib/VMCore/Module.cpp In-Reply-To: <0344EB53-EF9E-4604-80DF-A092255F2967@apple.com> References: <20100616005355.C0B432A6C12D@llvm.org> <0344EB53-EF9E-4604-80DF-A092255F2967@apple.com> Message-ID: <8E48C5E6-D3FD-4E00-9880-062672A77206@apple.com> On Jun 21, 2010, at 5:27 PM, Chris Lattner wrote: >> +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Tue Jun 15 19:53:55 2010 >> @@ -1053,8 +1053,12 @@ >> // The optimizer may remove local variable. If there is an interest >> // to preserve variable info in such situation then stash it in a >> // named mdnode. > .. >> + DISubprogram Fn(getDISubprogram(Context)); >> + const Twine FnLVName = Twine("llvm.dbg.lv.", Fn.getName()); >> + NamedMDNode *FnLocals = M.getNamedMetadataUsingTwine(FnLVName); > > This is just barely safe, but is really dangerous. Please use: > > NamedMDNode *FnLocals = M.getNamedMetadata(Twine("llvm.dbg.lv.")+Fn.getName()); > > The temporaries are destroyed at the end of the statement. Fixed. I'll use separate patch for other changes. Thanks for the review! - Devang From dpatel at apple.com Mon Jun 21 20:06:05 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 22 Jun 2010 01:06:05 -0000 Subject: [llvm-commits] [llvm] r106516 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Message-ID: <20100622010605.D3CD22A6C12C@llvm.org> Author: dpatel Date: Mon Jun 21 20:06:05 2010 New Revision: 106516 URL: http://llvm.org/viewvc/llvm-project?rev=106516&view=rev Log: Discard special LLVM prefix from linkage name. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=106516&r1=106515&r2=106516&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Jun 21 20:06:05 2010 @@ -2260,7 +2260,8 @@ const Function *F = MF->getFunction(); const Module *M = F->getParent(); if (NamedMDNode *NMD = - M->getNamedMetadataUsingTwine(Twine("llvm.dbg.lv.", F->getName()))) { + M->getNamedMetadataUsingTwine(Twine("llvm.dbg.lv.", + getRealLinkageName(F->getName())))) { for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) { DIVariable DV(cast_or_null(NMD->getOperand(i))); if (!DV || !Processed.insert(DV)) From evan.cheng at apple.com Mon Jun 21 20:18:17 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 22 Jun 2010 01:18:17 -0000 Subject: [llvm-commits] [llvm] r106517 - in /llvm/trunk: include/llvm/Target/TargetInstrInfo.h lib/CodeGen/BranchFolding.cpp lib/CodeGen/BranchFolding.h lib/CodeGen/TargetInstrInfoImpl.cpp lib/Target/ARM/Thumb2ITBlockPass.cpp lib/Target/ARM/Thumb2InstrInfo.cpp lib/Target/ARM/Thumb2InstrInfo.h test/CodeGen/Thumb2/2010-06-21-TailMergeBug.ll Message-ID: <20100622011817.27C5E2A6C12C@llvm.org> Author: evancheng Date: Mon Jun 21 20:18:16 2010 New Revision: 106517 URL: http://llvm.org/viewvc/llvm-project?rev=106517&view=rev Log: Tail merging pass shall not break up IT blocks. rdar://8115404 Added: llvm/trunk/test/CodeGen/Thumb2/2010-06-21-TailMergeBug.ll Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h llvm/trunk/lib/CodeGen/BranchFolding.cpp llvm/trunk/lib/CodeGen/BranchFolding.h llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.h Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=106517&r1=106516&r2=106517&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Mon Jun 21 20:18:16 2010 @@ -327,6 +327,14 @@ /// used by the tail merging pass. virtual void ReplaceTailWithBranchTo(MachineBasicBlock::iterator Tail, MachineBasicBlock *NewDest) const = 0; + + /// isLegalToSplitMBBAt - Return true if it's legal to split the given basic + /// block at the specified instruction (i.e. instruction would be the start + /// of a new basic block). + virtual bool isLegalToSplitMBBAt(MachineBasicBlock &MBB, + MachineBasicBlock::iterator MBBI) const { + return true; + } /// copyRegToReg - Emit instructions to copy between a pair of registers. It /// returns false if the target does not how to copy between the specified Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=106517&r1=106516&r2=106517&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original) +++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Mon Jun 21 20:18:16 2010 @@ -370,6 +370,9 @@ /// iterator. This returns the new MBB. MachineBasicBlock *BranchFolder::SplitMBBAt(MachineBasicBlock &CurMBB, MachineBasicBlock::iterator BBI1) { + if (!TII->isLegalToSplitMBBAt(CurMBB, BBI1)) + return 0; + MachineFunction &MF = *CurMBB.getParent(); // Create the fall-through block. @@ -614,9 +617,10 @@ /// CreateCommonTailOnlyBlock - None of the blocks to be tail-merged consist /// only of the common tail. Create a block that does by splitting one. -unsigned BranchFolder::CreateCommonTailOnlyBlock(MachineBasicBlock *&PredBB, - unsigned maxCommonTailLength) { - unsigned commonTailIndex = 0; +bool BranchFolder::CreateCommonTailOnlyBlock(MachineBasicBlock *&PredBB, + unsigned maxCommonTailLength, + unsigned &commonTailIndex) { + commonTailIndex = 0; unsigned TimeEstimate = ~0U; for (unsigned i = 0, e = SameTails.size(); i != e; ++i) { // Use PredBB if possible; that doesn't require a new branch. @@ -644,6 +648,11 @@ << maxCommonTailLength); MachineBasicBlock *newMBB = SplitMBBAt(*MBB, BBI); + if (!newMBB) { + DEBUG(dbgs() << "... failed!"); + return false; + } + SameTails[commonTailIndex].setBlock(newMBB); SameTails[commonTailIndex].setTailStartPos(newMBB->begin()); @@ -651,7 +660,7 @@ if (PredBB == MBB) PredBB = newMBB; - return commonTailIndex; + return true; } // See if any of the blocks in MergePotentials (which all have a common single @@ -746,7 +755,11 @@ !SameTails[commonTailIndex].tailIsWholeBlock())) { // None of the blocks consist entirely of the common tail. // Split a block so that one does. - commonTailIndex = CreateCommonTailOnlyBlock(PredBB, maxCommonTailLength); + if (!CreateCommonTailOnlyBlock(PredBB, + maxCommonTailLength, commonTailIndex)) { + RemoveBlocksWithHash(CurHash, SuccBB, PredBB); + continue; + } } MachineBasicBlock *MBB = SameTails[commonTailIndex].getBlock(); Modified: llvm/trunk/lib/CodeGen/BranchFolding.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.h?rev=106517&r1=106516&r2=106517&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/BranchFolding.h (original) +++ llvm/trunk/lib/CodeGen/BranchFolding.h Mon Jun 21 20:18:16 2010 @@ -102,8 +102,9 @@ MachineBasicBlock *PredBB); void RemoveBlocksWithHash(unsigned CurHash, MachineBasicBlock* SuccBB, MachineBasicBlock* PredBB); - unsigned CreateCommonTailOnlyBlock(MachineBasicBlock *&PredBB, - unsigned maxCommonTailLength); + bool CreateCommonTailOnlyBlock(MachineBasicBlock *&PredBB, + unsigned maxCommonTailLength, + unsigned &commonTailIndex); bool OptimizeBranches(MachineFunction &MF); bool OptimizeBlock(MachineBasicBlock *MBB); Modified: llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp?rev=106517&r1=106516&r2=106517&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp (original) +++ llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp Mon Jun 21 20:18:16 2010 @@ -28,6 +28,8 @@ #include "llvm/Support/raw_ostream.h" using namespace llvm; +/// ReplaceTailWithBranchTo - Delete the instruction OldInst and everything +/// after it, replacing it with an unconditional branch to NewDest. void TargetInstrInfoImpl::ReplaceTailWithBranchTo(MachineBasicBlock::iterator Tail, MachineBasicBlock *NewDest) const { Modified: llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp?rev=106517&r1=106516&r2=106517&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp Mon Jun 21 20:18:16 2010 @@ -62,13 +62,6 @@ char Thumb2ITBlockPass::ID = 0; } -static ARMCC::CondCodes getPredicate(const MachineInstr *MI, unsigned &PredReg){ - unsigned Opc = MI->getOpcode(); - if (Opc == ARM::tBcc || Opc == ARM::t2Bcc) - return ARMCC::AL; - return llvm::getInstrPredicate(MI, PredReg); -} - bool Thumb2ITBlockPass::MoveCPSRUseUp(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, @@ -82,7 +75,7 @@ for (unsigned i = 0; i < 4; ++i) { MachineInstr *MI = &*I; unsigned MPredReg = 0; - ARMCC::CondCodes MCC = getPredicate(MI, MPredReg); + ARMCC::CondCodes MCC = llvm::getITInstrPredicate(MI, MPredReg); if (MCC != ARMCC::AL) { if (MPredReg != PredReg || (MCC != CC && MCC != OCC)) return false; @@ -209,7 +202,7 @@ return false; unsigned PredReg = 0; - ARMCC::CondCodes CC = getPredicate(First, PredReg); + ARMCC::CondCodes CC = llvm::getITInstrPredicate(First, PredReg); if (CC == ARMCC::AL) return Modified; @@ -222,7 +215,7 @@ return Modified; MachineInstr *NMI = &*MBBI; unsigned NPredReg = 0; - ARMCC::CondCodes NCC = getPredicate(NMI, NPredReg); + ARMCC::CondCodes NCC = llvm::getITInstrPredicate(NMI, NPredReg); if (NCC != CC && NCC != OCC) { if (NCC != ARMCC::AL) return Modified; @@ -321,7 +314,7 @@ while (I != E && I->isDebugValue()) ++I; unsigned NPredReg = 0; - ARMCC::CondCodes NCC = getPredicate(I, NPredReg); + ARMCC::CondCodes NCC = llvm::getITInstrPredicate(I, NPredReg); if (NCC == CC || NCC == OCC) return true; } @@ -339,7 +332,7 @@ MachineInstr *MI = &*MBBI; DebugLoc dl = MI->getDebugLoc(); unsigned PredReg = 0; - ARMCC::CondCodes CC = getPredicate(MI, PredReg); + ARMCC::CondCodes CC = llvm::getITInstrPredicate(MI, PredReg); if (CC == ARMCC::AL) { ++MBBI; continue; @@ -375,7 +368,7 @@ MI = NMI; unsigned NPredReg = 0; - ARMCC::CondCodes NCC = getPredicate(NMI, NPredReg); + ARMCC::CondCodes NCC = llvm::getITInstrPredicate(NMI, NPredReg); if (NCC == CC || NCC == OCC) { Mask |= (NCC & 1) << Pos; // Add implicit use of ITSTATE. Modified: llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp?rev=106517&r1=106516&r2=106517&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp Mon Jun 21 20:18:16 2010 @@ -88,6 +88,14 @@ } bool +Thumb2InstrInfo::isLegalToSplitMBBAt(MachineBasicBlock &MBB, + MachineBasicBlock::iterator MBBI) const { + unsigned PredReg = 0; + return llvm::getITInstrPredicate(MBBI, PredReg) == ARMCC::AL; +} + + +bool Thumb2InstrInfo::copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, unsigned DestReg, unsigned SrcReg, @@ -605,3 +613,11 @@ MBB->insert(++MBBI, SrcMI); } } + +ARMCC::CondCodes +llvm::getITInstrPredicate(const MachineInstr *MI, unsigned &PredReg) { + unsigned Opc = MI->getOpcode(); + if (Opc == ARM::tBcc || Opc == ARM::t2Bcc) + return ARMCC::AL; + return llvm::getInstrPredicate(MI, PredReg); +} Modified: llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.h?rev=106517&r1=106516&r2=106517&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.h Mon Jun 21 20:18:16 2010 @@ -35,6 +35,9 @@ void ReplaceTailWithBranchTo(MachineBasicBlock::iterator Tail, MachineBasicBlock *NewDest) const; + bool isLegalToSplitMBBAt(MachineBasicBlock &MBB, + MachineBasicBlock::iterator MBBI) const; + bool copyRegToReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, unsigned DestReg, unsigned SrcReg, @@ -68,6 +71,13 @@ ScheduleHazardRecognizer * CreateTargetPostRAHazardRecognizer(const InstrItineraryData &II) const; }; + +/// getITInstrPredicate - Valid only in Thumb2 mode. This function is identical +/// to llvm::getInstrPredicate except it returns AL for conditional branch +/// instructions which are "predicated", but are not in IT blocks. +ARMCC::CondCodes getITInstrPredicate(const MachineInstr *MI, unsigned &PredReg); + + } #endif // THUMB2INSTRUCTIONINFO_H Added: llvm/trunk/test/CodeGen/Thumb2/2010-06-21-TailMergeBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/2010-06-21-TailMergeBug.ll?rev=106517&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Thumb2/2010-06-21-TailMergeBug.ll (added) +++ llvm/trunk/test/CodeGen/Thumb2/2010-06-21-TailMergeBug.ll Mon Jun 21 20:18:16 2010 @@ -0,0 +1,127 @@ +; RUN: llc < %s -mtriple=thumbv7-apple-darwin -O3 -relocation-model=pic -mcpu=cortex-a8 | FileCheck %s +; rdar://8115404 +; Tail merging must not split an IT block. + +%struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } +%struct._RuneCharClass = type { [14 x i8], i32 } +%struct._RuneEntry = type { i32, i32, i32, i32* } +%struct._RuneLocale = type { [8 x i8], [32 x i8], i32 (i8*, i32, i8**)*, i32 (i32, i8*, i32, i8**)*, i32, [256 x i32], [256 x i32], [256 x i32], %struct._RuneRange, %struct._RuneRange, %struct._RuneRange, i8*, i32, i32, %struct._RuneCharClass* } +%struct._RuneRange = type { i32, %struct._RuneEntry* } +%struct.__sFILEX = type opaque +%struct.__sbuf = type { i8*, i32 } + + at finput = external global %struct.FILE* ; <%struct.FILE**> [#uses=1] + at _DefaultRuneLocale = external global %struct._RuneLocale ; <%struct._RuneLocale*> [#uses=0] + at token_buffer = external global [1025 x i8], align 4 ; <[1025 x i8]*> [#uses=1] + at .str73 = external constant [6 x i8], align 4 ; <[6 x i8]*> [#uses=0] + at .str174 = external constant [5 x i8], align 4 ; <[5 x i8]*> [#uses=0] + at .str275 = external constant [6 x i8], align 4 ; <[6 x i8]*> [#uses=0] + at .str376 = external constant [5 x i8], align 4 ; <[5 x i8]*> [#uses=0] + at .str477 = external constant [6 x i8], align 4 ; <[6 x i8]*> [#uses=0] + at .str578 = external constant [6 x i8], align 4 ; <[6 x i8]*> [#uses=0] + at .str679 = external constant [7 x i8], align 4 ; <[7 x i8]*> [#uses=0] + at .str780 = external constant [6 x i8], align 4 ; <[6 x i8]*> [#uses=0] + at .str881 = external constant [5 x i8], align 4 ; <[5 x i8]*> [#uses=0] + at .str982 = external constant [6 x i8], align 4 ; <[6 x i8]*> [#uses=0] + at .str1083 = external constant [9 x i8], align 4 ; <[9 x i8]*> [#uses=0] + at .str1184 = external constant [7 x i8], align 4 ; <[7 x i8]*> [#uses=0] + at .str1285 = external constant [16 x i8], align 4 ; <[16 x i8]*> [#uses=0] + at .str1386 = external constant [12 x i8], align 4 ; <[12 x i8]*> [#uses=0] + at .str1487 = external constant [5 x i8], align 4 ; <[5 x i8]*> [#uses=0] + at llvm.used = external global [1 x i8*] ; <[1 x i8*]*> [#uses=0] + +define fastcc i32 @parse_percent_token() nounwind { +entry: +; CHECK: ittt eq +; CHECK: ittt eq +; CHECK: ittt eq +; CHECK: ittt eq +; CHECK: ittt eq +; CHECK: moveq r0 +; CHECK-NOT: LBB0_ +; CHECK: ldreq +; CHECK: popeq + switch i32 undef, label %bb7 [ + i32 37, label %bb43 + i32 48, label %bb5 + i32 50, label %bb4 + i32 60, label %bb2 + i32 61, label %bb6 + i32 62, label %bb3 + i32 123, label %bb1 + ] + +bb1: ; preds = %entry + ret i32 8 + +bb2: ; preds = %entry + ret i32 15 + +bb3: ; preds = %entry + ret i32 16 + +bb4: ; preds = %entry + ret i32 17 + +bb5: ; preds = %entry + ret i32 9 + +bb6: ; preds = %entry + ret i32 18 + +bb7: ; preds = %entry + br i1 undef, label %bb.i.i, label %bb1.i.i + +bb.i.i: ; preds = %bb7 + br i1 undef, label %bb43, label %bb12 + +bb1.i.i: ; preds = %bb7 + unreachable + +bb9: ; preds = %bb.i.i2 + br i1 undef, label %bb10, label %bb11 + +bb10: ; preds = %bb9 + br label %bb11 + +bb11: ; preds = %bb10, %bb9 + %p.0 = phi i8* [ undef, %bb10 ], [ %p.1, %bb9 ] ; [#uses=1] + %0 = load %struct.FILE** @finput, align 4 ; <%struct.FILE*> [#uses=1] + %1 = tail call i32 @getc(%struct.FILE* %0) nounwind ; [#uses=0] + br label %bb12 + +bb12: ; preds = %bb11, %bb.i.i + %p.1 = phi i8* [ %p.0, %bb11 ], [ getelementptr inbounds ([1025 x i8]* @token_buffer, i32 0, i32 0), %bb.i.i ] ; [#uses=2] + %2 = icmp ult i32 undef, 128 ; [#uses=1] + br i1 %2, label %bb.i.i2, label %bb1.i.i3 + +bb.i.i2: ; preds = %bb12 + %3 = load i32* null, align 4 ; [#uses=1] + %4 = lshr i32 %3, 8 ; [#uses=1] + %.lobit.i1 = and i32 %4, 1 ; [#uses=1] + %.not = icmp ne i32 %.lobit.i1, 0 ; [#uses=1] + %or.cond = or i1 %.not, undef ; [#uses=1] + br i1 %or.cond, label %bb9, label %bb14 + +bb1.i.i3: ; preds = %bb12 + unreachable + +bb14: ; preds = %bb.i.i2 + store i8 0, i8* %p.1, align 1 + br i1 undef, label %bb43, label %bb15 + +bb15: ; preds = %bb14 + unreachable + +bb43: ; preds = %bb14, %bb.i.i, %entry + %.0 = phi i32 [ 7, %entry ], [ 24, %bb.i.i ], [ 9, %bb14 ] ; [#uses=1] + ret i32 %.0 +} + +declare i32 @getc(%struct.FILE* nocapture) nounwind + +declare i32 @strcmp(i8* nocapture, i8* nocapture) nounwind readonly + +declare i32 @__maskrune(i32, i32) + +declare i32 @ungetc(i32, %struct.FILE* nocapture) nounwind From dpatel at apple.com Mon Jun 21 20:19:39 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 22 Jun 2010 01:19:39 -0000 Subject: [llvm-commits] [llvm] r106518 - in /llvm/trunk: include/llvm/Module.h lib/Analysis/DebugInfo.cpp lib/CodeGen/AsmPrinter/DwarfDebug.cpp lib/VMCore/Module.cpp Message-ID: <20100622011939.454652A6C12C@llvm.org> Author: dpatel Date: Mon Jun 21 20:19:38 2010 New Revision: 106518 URL: http://llvm.org/viewvc/llvm-project?rev=106518&view=rev Log: Use single interface, using twine, to get named metadata. getNamedMetadata(). Modified: llvm/trunk/include/llvm/Module.h llvm/trunk/lib/Analysis/DebugInfo.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp llvm/trunk/lib/VMCore/Module.cpp Modified: llvm/trunk/include/llvm/Module.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Module.h?rev=106518&r1=106517&r2=106518&view=diff ============================================================================== --- llvm/trunk/include/llvm/Module.h (original) +++ llvm/trunk/include/llvm/Module.h Mon Jun 21 20:19:38 2010 @@ -325,8 +325,7 @@ /// getNamedMetadata - Return the first NamedMDNode in the module with the /// specified name. This method returns null if a NamedMDNode with the /// specified name is not found. - NamedMDNode *getNamedMetadata(StringRef Name) const; - NamedMDNode *getNamedMetadataUsingTwine(Twine Name) const; + NamedMDNode *getNamedMetadata(const Twine &Name) const; /// getOrInsertNamedMetadata - Return the first named MDNode in the module /// with the specified name. This method returns a new NamedMDNode if a Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=106518&r1=106517&r2=106518&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DebugInfo.cpp (original) +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Mon Jun 21 20:19:38 2010 @@ -1062,8 +1062,7 @@ char One = '\1'; if (FName.startswith(StringRef(&One, 1))) FName = FName.substr(1); - NamedMDNode *FnLocals = - M.getNamedMetadataUsingTwine(Twine("llvm.dbg.lv.", FName)); + NamedMDNode *FnLocals = M.getNamedMetadata(Twine("llvm.dbg.lv.", FName)); if (!FnLocals) FnLocals = NamedMDNode::Create(VMContext, Twine("llvm.dbg.lv.", FName), NULL, 0, &M); Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=106518&r1=106517&r2=106518&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Jun 21 20:19:38 2010 @@ -2260,8 +2260,8 @@ const Function *F = MF->getFunction(); const Module *M = F->getParent(); if (NamedMDNode *NMD = - M->getNamedMetadataUsingTwine(Twine("llvm.dbg.lv.", - getRealLinkageName(F->getName())))) { + M->getNamedMetadata(Twine("llvm.dbg.lv.", + getRealLinkageName(F->getName())))) { for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) { DIVariable DV(cast_or_null(NMD->getOperand(i))); if (!DV || !Processed.insert(DV)) Modified: llvm/trunk/lib/VMCore/Module.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Module.cpp?rev=106518&r1=106517&r2=106518&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Module.cpp (original) +++ llvm/trunk/lib/VMCore/Module.cpp Mon Jun 21 20:19:38 2010 @@ -313,11 +313,7 @@ /// getNamedMetadata - Return the first NamedMDNode in the module with the /// specified name. This method returns null if a NamedMDNode with the /// specified name is not found. -NamedMDNode *Module::getNamedMetadata(StringRef Name) const { - return NamedMDSymTab->lookup(Name); -} - -NamedMDNode *Module::getNamedMetadataUsingTwine(Twine Name) const { +NamedMDNode *Module::getNamedMetadata(const Twine &Name) const { SmallString<256> NameData; StringRef NameRef = Name.toStringRef(NameData); return NamedMDSymTab->lookup(NameRef); From gohman at apple.com Mon Jun 21 21:07:21 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 22 Jun 2010 02:07:21 -0000 Subject: [llvm-commits] [llvm] r106520 - /llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Message-ID: <20100622020721.42CB22A6C12C@llvm.org> Author: djg Date: Mon Jun 21 21:07:21 2010 New Revision: 106520 URL: http://llvm.org/viewvc/llvm-project?rev=106520&view=rev Log: When unfolding a load, avoid assuming which instruction that kill and dead flags will end up on. Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=106520&r1=106519&r2=106520&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Mon Jun 21 21:07:21 2010 @@ -964,10 +964,24 @@ if (MO.isReg() && MO.getReg() != 0 && TargetRegisterInfo::isVirtualRegister(MO.getReg())) { if (MO.isUse()) { - if (MO.isKill()) - LV->replaceKillInstruction(MO.getReg(), mi, NewMIs[0]); - } else if (LV->removeVirtualRegisterDead(MO.getReg(), mi)) - LV->addVirtualRegisterDead(MO.getReg(), NewMIs[1]); + if (MO.isKill()) { + if (NewMIs[0]->killsRegister(MO.getReg())) + LV->replaceKillInstruction(MO.getReg(), mi, NewMIs[0]); + else { + assert(NewMIs[1]->killsRegister(MO.getReg()) && + "Kill missing after load unfold!"); + LV->replaceKillInstruction(MO.getReg(), mi, NewMIs[1]); + } + } + } else if (LV->removeVirtualRegisterDead(MO.getReg(), mi)) { + if (NewMIs[1]->registerDefIsDead(MO.getReg())) + LV->addVirtualRegisterDead(MO.getReg(), NewMIs[1]); + else { + assert(NewMIs[0]->registerDefIsDead(MO.getReg()) && + "Dead flag missing after load unfold!"); + LV->addVirtualRegisterDead(MO.getReg(), NewMIs[0]); + } + } } } LV->addVirtualRegisterKilled(Reg, NewMIs[1]); From bob.wilson at apple.com Mon Jun 21 21:08:51 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 22 Jun 2010 02:08:51 -0000 Subject: [llvm-commits] [llvm] r106521 - /llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Message-ID: <20100622020851.41EE92A6C12C@llvm.org> Author: bwilson Date: Mon Jun 21 21:08:51 2010 New Revision: 106521 URL: http://llvm.org/viewvc/llvm-project?rev=106521&view=rev Log: Revert my change to clone named metadata. Buildbots are complaining. --- Reverse-merging r106508 into '.': U lib/Transforms/Utils/CloneModule.cpp Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneModule.cpp?rev=106521&r1=106520&r2=106521&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneModule.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Mon Jun 21 21:08:51 2010 @@ -122,17 +122,6 @@ if (const Constant* C = I->getAliasee()) GA->setAliasee(cast(MapValue(C, ValueMap))); } - - // And named metadata.... - for (Module::const_named_metadata_iterator I = M->named_metadata_begin(), - E = M->named_metadata_end(); I != E; ++I) { - const NamedMDNode &NMD = *I; - SmallVector MDs; - for (unsigned i = 0, e = NMD.getNumOperands(); i != e; ++i) - MDs.push_back(cast(MapValue(NMD.getOperand(i), ValueMap))); - NamedMDNode::Create(New->getContext(), NMD.getName(), - MDs.data(), MDs.size(), New); - } return New; } From espindola at google.com Mon Jun 21 21:16:03 2010 From: espindola at google.com (Rafael Espindola) Date: Mon, 21 Jun 2010 22:16:03 -0400 Subject: [llvm-commits] [patch][gold plugin] Add an extra-library-path option to the plugin Message-ID: Add an extra-library-path option to the plugin. This is used to support having a library both as bitcode and native code. We want to use the bitcode first, but if codegen produces new undefined references we have to use the native code to satisfy those references. Gold has no notion of bitcode and native search directories, so instead it has an API where the plugin can instruct it to look for the libraries it is passing to it. This patch uses that API. Cheers, -- Rafael ?vila de Esp?ndola -------------- next part -------------- A non-text attachment was scrubbed... Name: lib_path.patch Type: text/x-patch Size: 2159 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100621/062a6ce1/attachment.bin From espindola at google.com Mon Jun 21 21:34:28 2010 From: espindola at google.com (Rafael Espindola) Date: Mon, 21 Jun 2010 22:34:28 -0400 Subject: [llvm-commits] [patch][gold plugin] Don't internalize symbols in objects that we will use as pass-through Message-ID: Cary, the patch is for LLVM, but I am ccing you in case you think this should be done in gold somehow. This is hopefully the last patch is the libgcc and its dependencies saga. The last remaining issue that i know is that gold can ask us to load a file because it is used only on the IR. We then internalize the symbols in that file and run codegen. Codegen can then create new undefined references to those files that forces gold to fetch them again (from the native code this time). There are a number of problem with this *) Gold doesn't implement this all that well. It still has in its symbol table that it loaded a file defining that symbol. *) We would end up with multiple copies of some symbols. *) LLVM can use smaller chunks of files than gold. Consider the case of a file defining functions foo and bar. Function foo is used from elf, and so we don't internalize it. Function bar is not used at that time and we drop it. Now codegen introduces an undefined reference to bar. What should gold do? Bringing in that file will fail because we will have two visible definitions of foo. Not doing so will fail because there is no where else to find bar. The best solution I could find is to disable internalize for any functions defined in a library that is passed through. The attached patch does this. It can be optimized, but I am not sure if that is worth it, since normally there are only two libraries being passed through (libgcc and libc). Cheers, -- Rafael ?vila de Esp?ndola -------------- next part -------------- A non-text attachment was scrubbed... Name: ironly.patch Type: text/x-patch Size: 1811 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100621/35bd9093/attachment.bin From bob.wilson at apple.com Mon Jun 21 22:34:25 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 22 Jun 2010 03:34:25 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r106524 - /llvm-gcc-4.2/trunk/gcc/Makefile.in Message-ID: <20100622033425.356B12A6C12C@llvm.org> Author: bwilson Date: Mon Jun 21 22:34:24 2010 New Revision: 106524 URL: http://llvm.org/viewvc/llvm-project?rev=106524&view=rev Log: Don't create a link to /usr/lib/libstdc++.dylib when building for an arm-darwin target. Radar 8114627. Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/Makefile.in?rev=106524&r1=106523&r2=106524&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/Makefile.in (original) +++ llvm-gcc-4.2/trunk/gcc/Makefile.in Mon Jun 21 22:34:24 2010 @@ -4108,8 +4108,12 @@ -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) -$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext) - -rm -f $(DESTDIR)$(libsubdir)/libstdc++.dylib - $(LN_S) /usr/lib/libstdc++.6.dylib $(DESTDIR)$(libsubdir)/libstdc++.dylib + case $(target) in \ + arm*-*-*) ;; \ + *) \ + rm -f $(DESTDIR)$(libsubdir)/libstdc++.dylib; \ + $(LN_S) /usr/lib/libstdc++.6.dylib $(DESTDIR)$(libsubdir)/libstdc++.dylib;; \ + esac -( cd $(DESTDIR)$(bindir) && \ $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version)$(exeext) ) -if [ -f gcc-cross$(exeext) ] ; then \ From dpatel at apple.com Tue Jun 22 00:16:56 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 22 Jun 2010 05:16:56 -0000 Subject: [llvm-commits] [llvm] r106528 - /llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Message-ID: <20100622051656.696812A6C12C@llvm.org> Author: dpatel Date: Tue Jun 22 00:16:56 2010 New Revision: 106528 URL: http://llvm.org/viewvc/llvm-project?rev=106528&view=rev Log: Do not rely on DenseMap slot which can be easily invalidated when DenseMap grows. Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp?rev=106528&r1=106527&r2=106528&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Tue Jun 22 00:16:56 2010 @@ -21,17 +21,15 @@ using namespace llvm; Value *llvm::MapValue(const Value *V, ValueToValueMapTy &VM) { - Value *&VMSlot = VM[V]; - if (VMSlot) return VMSlot; // Does it exist in the map yet? + ValueToValueMapTy::iterator VMI = VM.find(V); + if (VMI != VM.end()) + return VMI->second; - // NOTE: VMSlot can be invalidated by any reference to VM, which can grow the - // DenseMap. This includes any recursive calls to MapValue. - // Global values and non-function-local metadata do not need to be seeded into // the ValueMap if they are using the identity mapping. if (isa(V) || isa(V) || isa(V) || (isa(V) && !cast(V)->isFunctionLocal())) - return VMSlot = const_cast(V); + return VM[V] = const_cast(V); if (const MDNode *MD = dyn_cast(V)) { SmallVector Elts; @@ -46,7 +44,7 @@ if (isa(C) || isa(C) || isa(C) || isa(C) || isa(C) || isa(C)) - return VMSlot = C; // Primitive constants map directly + return VM[V] = C; // Primitive constants map directly if (ConstantArray *CA = dyn_cast(C)) { for (User::op_iterator b = CA->op_begin(), i = b, e = CA->op_end(); From dpatel at apple.com Tue Jun 22 01:14:09 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 22 Jun 2010 06:14:09 -0000 Subject: [llvm-commits] [llvm] r106529 - /llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Message-ID: <20100622061409.2F4862A6C12C@llvm.org> Author: dpatel Date: Tue Jun 22 01:14:09 2010 New Revision: 106529 URL: http://llvm.org/viewvc/llvm-project?rev=106529&view=rev Log: Revert 106528. It is causing self host failures. Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp?rev=106529&r1=106528&r2=106529&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Tue Jun 22 01:14:09 2010 @@ -21,15 +21,17 @@ using namespace llvm; Value *llvm::MapValue(const Value *V, ValueToValueMapTy &VM) { - ValueToValueMapTy::iterator VMI = VM.find(V); - if (VMI != VM.end()) - return VMI->second; + Value *&VMSlot = VM[V]; + if (VMSlot) return VMSlot; // Does it exist in the map yet? + // NOTE: VMSlot can be invalidated by any reference to VM, which can grow the + // DenseMap. This includes any recursive calls to MapValue. + // Global values and non-function-local metadata do not need to be seeded into // the ValueMap if they are using the identity mapping. if (isa(V) || isa(V) || isa(V) || (isa(V) && !cast(V)->isFunctionLocal())) - return VM[V] = const_cast(V); + return VMSlot = const_cast(V); if (const MDNode *MD = dyn_cast(V)) { SmallVector Elts; @@ -44,7 +46,7 @@ if (isa(C) || isa(C) || isa(C) || isa(C) || isa(C) || isa(C)) - return VM[V] = C; // Primitive constants map directly + return VMSlot = C; // Primitive constants map directly if (ConstantArray *CA = dyn_cast(C)) { for (User::op_iterator b = CA->op_begin(), i = b, e = CA->op_end(); From plmdvy at gmail.com Tue Jun 22 01:32:22 2010 From: plmdvy at gmail.com (Paul Davey) Date: Tue, 22 Jun 2010 18:32:22 +1200 Subject: [llvm-commits] [PATCH] more haiku suppor Message-ID: some fixes: Google test had some issues in the haiku support. cmake lists trying to link libm and libpthread when it doesnt exist but support is there, fixed by checking for haiku via the BEOS variable -------------- next part -------------- A non-text attachment was scrubbed... Name: haiku-llvm.diff Type: application/octet-stream Size: 1973 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100622/864d30ba/attachment.obj From plmdvy at gmail.com Tue Jun 22 03:54:29 2010 From: plmdvy at gmail.com (Paul Davey) Date: Tue, 22 Jun 2010 20:54:29 +1200 Subject: [llvm-commits] [PATCH] more haiku suppor In-Reply-To: References: Message-ID: use this one instead, while fixing 80 column stuff i made a mistake On Tue, Jun 22, 2010 at 6:32 PM, Paul Davey wrote: > some fixes: > ?Google test had some issues in the haiku support. > ?cmake lists trying to link libm and libpthread when it doesnt exist > but support is there, fixed by checking for haiku via the BEOS > variable > -------------- next part -------------- A non-text attachment was scrubbed... Name: haiku-llvm.diff Type: application/octet-stream Size: 1953 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20100622/2a341e25/attachment.obj From gohman at apple.com Tue Jun 22 08:15:46 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 22 Jun 2010 13:15:46 -0000 Subject: [llvm-commits] [llvm] r106537 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp test/Analysis/ScalarEvolution/trip-count10.ll Message-ID: <20100622131547.0FEFB2A6C12C@llvm.org> Author: djg Date: Tue Jun 22 08:15:46 2010 New Revision: 106537 URL: http://llvm.org/viewvc/llvm-project?rev=106537&view=rev Log: Allow "exhaustive" trip count evaluation on phi nodes with all constant operands. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp llvm/trunk/test/Analysis/ScalarEvolution/trip-count10.ll Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=106537&r1=106536&r2=106537&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Jun 22 08:15:46 2010 @@ -4133,8 +4133,7 @@ // constant or derived from a PHI node themselves. PHINode *PHI = 0; for (unsigned Op = 0, e = I->getNumOperands(); Op != e; ++Op) - if (!(isa(I->getOperand(Op)) || - isa(I->getOperand(Op)))) { + if (!isa(I->getOperand(Op))) { PHINode *P = getConstantEvolvingPHI(I->getOperand(Op), L); if (P == 0) return 0; // Not evolving from PHI if (PHI == 0) @@ -4155,11 +4154,9 @@ const TargetData *TD) { if (isa(V)) return PHIVal; if (Constant *C = dyn_cast(V)) return C; - if (GlobalValue *GV = dyn_cast(V)) return GV; Instruction *I = cast(V); - std::vector Operands; - Operands.resize(I->getNumOperands()); + std::vector Operands(I->getNumOperands()); for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) { Operands[i] = EvaluateExpression(I->getOperand(i), PHIVal, TD); @@ -4201,8 +4198,8 @@ return RetVal = 0; // Must be a constant. Value *BEValue = PN->getIncomingValue(SecondIsBackedge); - PHINode *PN2 = getConstantEvolvingPHI(BEValue, L); - if (PN2 != PN) + if (getConstantEvolvingPHI(BEValue, L) != PN && + !isa(BEValue)) return RetVal = 0; // Not derived from same PHI. // Execute the loop symbolically to determine the exit value. @@ -4249,8 +4246,9 @@ if (StartCST == 0) return getCouldNotCompute(); // Must be a constant. Value *BEValue = PN->getIncomingValue(SecondIsBackedge); - PHINode *PN2 = getConstantEvolvingPHI(BEValue, L); - if (PN2 != PN) return getCouldNotCompute(); // Not derived from same PHI. + if (getConstantEvolvingPHI(BEValue, L) != PN && + !isa(BEValue)) + return getCouldNotCompute(); // Not derived from same PHI. // Okay, we find a PHI node that defines the trip count of this loop. Execute // the loop symbolically to determine when the condition gets a value of Modified: llvm/trunk/test/Analysis/ScalarEvolution/trip-count10.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/trip-count10.ll?rev=106537&r1=106536&r2=106537&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/trip-count10.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/trip-count10.ll Tue Jun 22 08:15:46 2010 @@ -105,3 +105,22 @@ retbb: ret void } + +; PHI nodes with all constant operands. + +; CHECK: Determining loop execution counts for: @constant_phi_operands +; CHECK: Loop %loop: backedge-taken count is 1 +; CHECK: Loop %loop: max backedge-taken count is 1 + +define void @constant_phi_operands() nounwind { +entry: + br label %loop + +loop: + %i = phi i64 [ 1, %loop ], [ 0, %entry ] + %exitcond = icmp eq i64 %i, 1 + br i1 %exitcond, label %return, label %loop + +return: + ret void +} From gohman at apple.com Tue Jun 22 08:53:29 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 22 Jun 2010 13:53:29 -0000 Subject: [llvm-commits] [llvm] r106538 - /llvm/trunk/lib/Support/MemoryBuffer.cpp Message-ID: <20100622135329.61B8E2A6C12C@llvm.org> Author: djg Date: Tue Jun 22 08:53:29 2010 New Revision: 106538 URL: http://llvm.org/viewvc/llvm-project?rev=106538&view=rev Log: Add an explicit keyword. Modified: llvm/trunk/lib/Support/MemoryBuffer.cpp Modified: llvm/trunk/lib/Support/MemoryBuffer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/MemoryBuffer.cpp?rev=106538&r1=106537&r2=106538&view=diff ============================================================================== --- llvm/trunk/lib/Support/MemoryBuffer.cpp (original) +++ llvm/trunk/lib/Support/MemoryBuffer.cpp Tue Jun 22 08:53:29 2010 @@ -170,7 +170,7 @@ class FileCloser { int FD; public: - FileCloser(int FD) : FD(FD) {} + explicit FileCloser(int FD) : FD(FD) {} ~FileCloser() { ::close(FD); } }; } From gohman at apple.com Tue Jun 22 08:57:08 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 22 Jun 2010 13:57:08 -0000 Subject: [llvm-commits] [llvm] r106539 - /llvm/trunk/include/llvm/Support/MemoryBuffer.h Message-ID: <20100622135708.DF3DC2A6C12C@llvm.org> Author: djg Date: Tue Jun 22 08:57:08 2010 New Revision: 106539 URL: http://llvm.org/viewvc/llvm-project?rev=106539&view=rev Log: Add a comment explaining a non-obvious API. Modified: llvm/trunk/include/llvm/Support/MemoryBuffer.h Modified: llvm/trunk/include/llvm/Support/MemoryBuffer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MemoryBuffer.h?rev=106539&r1=106538&r2=106539&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/MemoryBuffer.h (original) +++ llvm/trunk/include/llvm/Support/MemoryBuffer.h Tue Jun 22 08:57:08 2010 @@ -26,6 +26,11 @@ /// into a memory buffer. In addition to basic access to the characters in the /// file, this interface guarantees you can read one character past the end of /// the file, and that this character will read as '\0'. +/// +/// The '\0' guarantee is needed to support an optimization -- it's intended to +/// be more efficient for clients which are reading all the data to stop +/// reading when they encounter a '\0' than to continually check the file +/// position to see if it has reached the end of the file. class MemoryBuffer { const char *BufferStart; // Start of the buffer. const char *BufferEnd; // End of the buffer. From gohman at apple.com Tue Jun 22 10:08:58 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 22 Jun 2010 15:08:58 -0000 Subject: [llvm-commits] [llvm] r106542 - in /llvm/trunk/lib: Analysis/ CodeGen/ Target/ARM/ Target/X86/ Transforms/Hello/ Transforms/IPO/ Transforms/Instrumentation/ Transforms/Scalar/ Transforms/Utils/ Message-ID: <20100622150858.53E602A6C12C@llvm.org> Author: djg Date: Tue Jun 22 10:08:57 2010 New Revision: 106542 URL: http://llvm.org/viewvc/llvm-project?rev=106542&view=rev Log: Use pre-increment instead of post-increment when the result is not used. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp llvm/trunk/lib/CodeGen/IfConversion.cpp llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp llvm/trunk/lib/Transforms/Hello/Hello.cpp llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp llvm/trunk/lib/Transforms/Scalar/ADCE.cpp llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/trunk/lib/Transforms/Scalar/GVN.cpp llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Jun 22 10:08:57 2010 @@ -456,7 +456,7 @@ // Okay, we have a cache entry. If we know it is not dirty, just return it // with no computation. if (!CacheP.second) { - NumCacheNonLocal++; + ++NumCacheNonLocal; return Cache; } @@ -478,7 +478,7 @@ BasicBlock *QueryBB = QueryCS.getInstruction()->getParent(); for (BasicBlock **PI = PredCache->GetPreds(QueryBB); *PI; ++PI) DirtyBlocks.push_back(*PI); - NumUncacheNonLocal++; + ++NumUncacheNonLocal; } // isReadonlyCall - If this is a read-only call, we can be more aggressive. Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IfConversion.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/IfConversion.cpp (original) +++ llvm/trunk/lib/CodeGen/IfConversion.cpp Tue Jun 22 10:08:57 2010 @@ -303,8 +303,8 @@ RetVal = IfConvertSimple(BBI, Kind); DEBUG(dbgs() << (RetVal ? "succeeded!" : "failed!") << "\n"); if (RetVal) { - if (isFalse) NumSimpleFalse++; - else NumSimple++; + if (isFalse) ++NumSimpleFalse; + else ++NumSimple; } break; } @@ -330,11 +330,11 @@ DEBUG(dbgs() << (RetVal ? "succeeded!" : "failed!") << "\n"); if (RetVal) { if (isFalse) { - if (isRev) NumTriangleFRev++; - else NumTriangleFalse++; + if (isRev) ++NumTriangleFRev; + else ++NumTriangleFalse; } else { - if (isRev) NumTriangleRev++; - else NumTriangle++; + if (isRev) ++NumTriangleRev; + else ++NumTriangle; } } break; @@ -346,7 +346,7 @@ << BBI.FalseBB->getNumber() << ") "); RetVal = IfConvertDiamond(BBI, Kind, NumDups, NumDups2); DEBUG(dbgs() << (RetVal ? "succeeded!" : "failed!") << "\n"); - if (RetVal) NumDiamonds++; + if (RetVal) ++NumDiamonds; break; } } @@ -1317,7 +1317,7 @@ BBI.IsAnalyzed = false; BBI.NonPredSize = 0; - NumIfConvBBs++; + ++NumIfConvBBs; } /// CopyAndPredicateBlock - Copy and predicate instructions from source BB to @@ -1373,7 +1373,7 @@ ToBBI.ClobbersPred |= FromBBI.ClobbersPred; ToBBI.IsAnalyzed = false; - NumDupBBs++; + ++NumDupBBs; } /// MergeBlocks - Move all instructions from FromBB to the end of ToBB. Modified: llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp (original) +++ llvm/trunk/lib/CodeGen/PreAllocSplitting.cpp Tue Jun 22 10:08:57 2010 @@ -836,7 +836,7 @@ if (IntervalSSMap.count(CurrLI->reg)) IntervalSSMap[NewVReg] = IntervalSSMap[CurrLI->reg]; - NumRenumbers++; + ++NumRenumbers; } bool PreAllocSplitting::Rematerialize(unsigned VReg, VNInfo* ValNo, @@ -1192,7 +1192,7 @@ int StoreFrameIndex; unsigned StoreVReg = TII->isStoreToStackSlot(*UI, StoreFrameIndex); if (StoreVReg != Reg || StoreFrameIndex != FrameIndex) - NonSpills++; + ++NonSpills; int DefIdx = (*UI)->findRegisterDefOperandIdx(Reg); if (DefIdx != -1 && (*UI)->isRegTiedToUseOperand(DefIdx)) @@ -1255,7 +1255,7 @@ (*LI)->removeValNo(CurrVN); DefMI->eraseFromParent(); VNUseCount.erase(CurrVN); - NumDeadSpills++; + ++NumDeadSpills; changed = true; continue; } @@ -1328,7 +1328,7 @@ if (VI->second.erase(use)) VI->second.insert(NewMI); - NumDeadSpills++; + ++NumDeadSpills; changed = true; continue; } @@ -1350,7 +1350,7 @@ LIs->RemoveMachineInstrFromMaps(DefMI); (*LI)->removeValNo(CurrVN); DefMI->eraseFromParent(); - NumDeadSpills++; + ++NumDeadSpills; changed = true; } } Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Tue Jun 22 10:08:57 2010 @@ -350,7 +350,7 @@ MCE.processDebugLoc(MI.getDebugLoc(), true); - NumEmitted++; // Keep track of the # of mi's emitted + ++NumEmitted; // Keep track of the # of mi's emitted switch (MI.getDesc().TSFlags & ARMII::FormMask) { default: { llvm_unreachable("Unhandled instruction encoding format!"); Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Tue Jun 22 10:08:57 2010 @@ -407,7 +407,7 @@ std::vector CPEs; CPEs.push_back(CPEntry(CPEMI, i)); CPEntries.push_back(CPEs); - NumCPEs++; + ++NumCPEs; DEBUG(errs() << "Moved CPI#" << i << " to end of function as #" << i << "\n"); } @@ -725,7 +725,7 @@ // correspond to anything in the source. unsigned Opc = isThumb ? (isThumb2 ? ARM::t2B : ARM::tB) : ARM::B; BuildMI(OrigBB, DebugLoc(), TII->get(Opc)).addMBB(NewBB); - NumSplit++; + ++NumSplit; // Update the CFG. All succs of OrigBB are now succs of NewBB. while (!OrigBB->succ_empty()) { @@ -948,7 +948,7 @@ if (--CPE->RefCount == 0) { RemoveDeadCPEMI(CPEMI); CPE->CPEMI = NULL; - NumCPEs--; + --NumCPEs; return true; } return false; @@ -1249,7 +1249,7 @@ U.CPEMI = BuildMI(NewIsland, DebugLoc(), TII->get(ARM::CONSTPOOL_ENTRY)) .addImm(ID).addConstantPoolIndex(CPI).addImm(Size); CPEntries[CPI].push_back(CPEntry(U.CPEMI, ID, 1)); - NumCPEs++; + ++NumCPEs; BBOffsets[NewIsland->getNumber()] = BBOffsets[NewMBB->getNumber()]; // Compensate for .align 2 in thumb mode. @@ -1372,7 +1372,7 @@ BBSizes[MBB->getNumber()] += 2; AdjustBBOffsetsAfter(MBB, 2); HasFarJump = true; - NumUBrFixed++; + ++NumUBrFixed; DEBUG(errs() << " Changed B to long jump " << *MI); @@ -1405,7 +1405,7 @@ MachineInstr *BMI = &MBB->back(); bool NeedSplit = (BMI != MI) || !BBHasFallthrough(MBB); - NumCBrFixed++; + ++NumCBrFixed; if (BMI != MI) { if (llvm::next(MachineBasicBlock::iterator(MI)) == prior(MBB->end()) && BMI->getOpcode() == Br.UncondBr) { Modified: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Tue Jun 22 10:08:57 2010 @@ -131,30 +131,30 @@ static int getLoadStoreMultipleOpcode(int Opcode) { switch (Opcode) { case ARM::LDR: - NumLDMGened++; + ++NumLDMGened; return ARM::LDM; case ARM::STR: - NumSTMGened++; + ++NumSTMGened; return ARM::STM; case ARM::t2LDRi8: case ARM::t2LDRi12: - NumLDMGened++; + ++NumLDMGened; return ARM::t2LDM; case ARM::t2STRi8: case ARM::t2STRi12: - NumSTMGened++; + ++NumSTMGened; return ARM::t2STM; case ARM::VLDRS: - NumVLDMGened++; + ++NumVLDMGened; return ARM::VLDMS; case ARM::VSTRS: - NumVSTMGened++; + ++NumVSTMGened; return ARM::VSTMS; case ARM::VLDRD: - NumVLDMGened++; + ++NumVLDMGened; return ARM::VLDMD; case ARM::VSTRD: - NumVSTMGened++; + ++NumVSTMGened; return ARM::VSTMD; default: llvm_unreachable("Unhandled opcode!"); } @@ -319,7 +319,7 @@ // Try to do the merge. MachineBasicBlock::iterator Loc = memOps[insertAfter].MBBI; - Loc++; + ++Loc; if (!MergeOps(MBB, Loc, Offset, Base, BaseKill, Opcode, Pred, PredReg, Scratch, dl, Regs)) return; @@ -1082,7 +1082,7 @@ CurrPred = Pred; CurrPredReg = PredReg; MemOps.push_back(MemOpQueueEntry(Offset, Reg, isKill, Position, MBBI)); - NumMemOps++; + ++NumMemOps; Advance = true; } else { if (Clobber) { @@ -1096,7 +1096,7 @@ if (Offset > MemOps.back().Offset) { MemOps.push_back(MemOpQueueEntry(Offset, Reg, isKill, Position, MBBI)); - NumMemOps++; + ++NumMemOps; Advance = true; } else { for (MemOpQueueIter I = MemOps.begin(), E = MemOps.end(); @@ -1104,7 +1104,7 @@ if (Offset < I->Offset) { MemOps.insert(I, MemOpQueueEntry(Offset, Reg, isKill, Position, MBBI)); - NumMemOps++; + ++NumMemOps; Advance = true; break; } else if (Offset == I->Offset) { Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Tue Jun 22 10:08:57 2010 @@ -138,7 +138,7 @@ // MOVPC32r is basically a call plus a pop instruction. if (Desc.getOpcode() == X86::MOVPC32r) emitInstruction(*I, &II->get(X86::POP32r)); - NumEmitted++; // Keep track of the # of mi's emitted + ++NumEmitted; // Keep track of the # of mi's emitted } } } while (MCE.finishFunction(MF)); Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Tue Jun 22 10:08:57 2010 @@ -133,7 +133,7 @@ // Emit an fxch to update the runtime processors version of the state. BuildMI(*MBB, I, dl, TII->get(X86::XCH_F)).addReg(STReg); - NumFXCH++; + ++NumFXCH; } void duplicateToTop(unsigned RegNo, unsigned AsReg, MachineInstr *I) { @@ -1021,7 +1021,7 @@ // StackTop can be 1 if a FpSET_ST0_* was before this. Exchange them. if (StackTop == 1) { BuildMI(*MBB, I, dl, TII->get(X86::XCH_F)).addReg(X86::ST1); - NumFXCH++; + ++NumFXCH; StackTop = 0; break; } @@ -1058,7 +1058,7 @@ // StackTop can be 1 if a FpSET_ST0_* was before this. Exchange them. if (StackTop == 1) { BuildMI(*MBB, I, dl, TII->get(X86::XCH_F)).addReg(X86::ST1); - NumFXCH++; + ++NumFXCH; StackTop = 0; break; } Modified: llvm/trunk/lib/Transforms/Hello/Hello.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Hello/Hello.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Hello/Hello.cpp (original) +++ llvm/trunk/lib/Transforms/Hello/Hello.cpp Tue Jun 22 10:08:57 2010 @@ -28,7 +28,7 @@ Hello() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F) { - HelloCounter++; + ++HelloCounter; errs() << "Hello: "; errs().write_escaped(F.getName()) << '\n'; return false; @@ -46,7 +46,7 @@ Hello2() : FunctionPass(&ID) {} virtual bool runOnFunction(Function &F) { - HelloCounter++; + ++HelloCounter; errs() << "Hello: "; errs().write_escaped(F.getName()) << '\n'; return false; Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Tue Jun 22 10:08:57 2010 @@ -107,12 +107,12 @@ // Check if it is ok to perform this promotion. if (isSafeToUpdateAllCallers(F) == false) { DEBUG(dbgs() << "SretPromotion: Not all callers can be updated\n"); - NumRejectedSRETUses++; + ++NumRejectedSRETUses; return 0; } DEBUG(dbgs() << "SretPromotion: sret argument will be promoted\n"); - NumSRET++; + ++NumSRET; // [1] Replace use of sret parameter AllocaInst *TheAlloca = new AllocaInst(STy, NULL, "mrv", F->getEntryBlock().begin()); Modified: llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp Tue Jun 22 10:08:57 2010 @@ -143,7 +143,7 @@ ProfileInfo::Edge edge = ProfileInfo::getEdge(0,entry); if (!std::binary_search(MST.begin(), MST.end(), edge)) { printEdgeCounter(edge,entry,i); - IncrementCounterInBlock(entry, i, Counters); NumEdgesInserted++; + IncrementCounterInBlock(entry, i, Counters); ++NumEdgesInserted; Initializer[i++] = (Zero); } else{ Initializer[i++] = (Uncounted); @@ -166,7 +166,7 @@ ProfileInfo::Edge edge = ProfileInfo::getEdge(BB,0); if (!std::binary_search(MST.begin(), MST.end(), edge)) { printEdgeCounter(edge,BB,i); - IncrementCounterInBlock(BB, i, Counters); NumEdgesInserted++; + IncrementCounterInBlock(BB, i, Counters); ++NumEdgesInserted; Initializer[i++] = (Zero); } else{ Initializer[i++] = (Uncounted); @@ -189,11 +189,11 @@ if (TI->getNumSuccessors() == 1) { // Insert counter at the start of the block printEdgeCounter(edge,BB,i); - IncrementCounterInBlock(BB, i, Counters); NumEdgesInserted++; + IncrementCounterInBlock(BB, i, Counters); ++NumEdgesInserted; } else { // Insert counter at the start of the block printEdgeCounter(edge,Succ,i); - IncrementCounterInBlock(Succ, i, Counters); NumEdgesInserted++; + IncrementCounterInBlock(Succ, i, Counters); ++NumEdgesInserted; } Initializer[i++] = (Zero); } else { Modified: llvm/trunk/lib/Transforms/Scalar/ADCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ADCE.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ADCE.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ADCE.cpp Tue Jun 22 10:08:57 2010 @@ -83,7 +83,7 @@ for (SmallVector::iterator I = worklist.begin(), E = worklist.end(); I != E; ++I) { - NumRemoved++; + ++NumRemoved; (*I)->eraseFromParent(); } Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Jun 22 10:08:57 2010 @@ -218,7 +218,7 @@ isElidable(DepStore)) { // Delete the store and now-dead instructions that feed it. DeleteDeadInstruction(DepStore); - NumFastStores++; + ++NumFastStores; MadeChange = true; // DeleteDeadInstruction can delete the current instruction in loop @@ -249,7 +249,7 @@ BBI = BB.begin(); else if (BBI != BB.begin()) // Revisit this instruction if possible. --BBI; - NumFastStores++; + ++NumFastStores; MadeChange = true; continue; } @@ -270,7 +270,7 @@ BBI = BB.begin(); else if (BBI != BB.begin()) // Revisit this instruction if possible. --BBI; - NumFastStores++; + ++NumFastStores; MadeChange = true; continue; } @@ -303,7 +303,7 @@ // DCE instructions only used to calculate that store DeleteDeadInstruction(Dependency); - NumFastStores++; + ++NumFastStores; return true; } @@ -349,9 +349,9 @@ if (deadPointers.count(pointerOperand)) { // DCE instructions only used to calculate that store. Instruction *Dead = BBI; - BBI++; + ++BBI; DeleteDeadInstruction(Dead, &deadPointers); - NumFastStores++; + ++NumFastStores; MadeChange = true; continue; } @@ -371,9 +371,9 @@ // However, if this load is unused and not volatile, we can go ahead and // remove it, and not have to worry about it making our pointer undead! if (L->use_empty() && !L->isVolatile()) { - BBI++; + ++BBI; DeleteDeadInstruction(L, &deadPointers); - NumFastOther++; + ++NumFastOther; MadeChange = true; continue; } @@ -391,9 +391,9 @@ // Dead alloca's can be DCE'd when we reach them if (A->use_empty()) { - BBI++; + ++BBI; DeleteDeadInstruction(A, &deadPointers); - NumFastOther++; + ++NumFastOther; MadeChange = true; } @@ -426,9 +426,9 @@ getPointerSize(*I)); if (A == AliasAnalysis::ModRef) - modRef++; + ++modRef; else - other++; + ++other; if (A == AliasAnalysis::ModRef || A == AliasAnalysis::Ref) dead.push_back(*I); @@ -442,9 +442,9 @@ } else if (isInstructionTriviallyDead(BBI)) { // For any non-memory-affecting non-terminators, DCE them as we reach them Instruction *Inst = BBI; - BBI++; + ++BBI; DeleteDeadInstruction(Inst, &deadPointers); - NumFastOther++; + ++NumFastOther; MadeChange = true; continue; } @@ -497,7 +497,7 @@ // Remove it! ++BBI; DeleteDeadInstruction(S, &deadPointers); - NumFastStores++; + ++NumFastStores; MadeChange = true; continue; Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Tue Jun 22 10:08:57 2010 @@ -1501,7 +1501,7 @@ MD->invalidateCachedPointerInfo(V); VN.erase(LI); toErase.push_back(LI); - NumGVNLoad++; + ++NumGVNLoad; return true; } @@ -1724,7 +1724,7 @@ MD->invalidateCachedPointerInfo(V); VN.erase(LI); toErase.push_back(LI); - NumPRELoad++; + ++NumPRELoad; return true; } @@ -1785,7 +1785,7 @@ MD->invalidateCachedPointerInfo(AvailVal); VN.erase(L); toErase.push_back(L); - NumGVNLoad++; + ++NumGVNLoad; return true; } @@ -1831,7 +1831,7 @@ MD->invalidateCachedPointerInfo(StoredVal); VN.erase(L); toErase.push_back(L); - NumGVNLoad++; + ++NumGVNLoad; return true; } @@ -1861,7 +1861,7 @@ MD->invalidateCachedPointerInfo(DepLI); VN.erase(L); toErase.push_back(L); - NumGVNLoad++; + ++NumGVNLoad; return true; } @@ -1872,7 +1872,7 @@ L->replaceAllUsesWith(UndefValue::get(L->getType())); VN.erase(L); toErase.push_back(L); - NumGVNLoad++; + ++NumGVNLoad; return true; } @@ -1883,7 +1883,7 @@ L->replaceAllUsesWith(UndefValue::get(L->getType())); VN.erase(L); toErase.push_back(L); - NumGVNLoad++; + ++NumGVNLoad; return true; } } @@ -2015,7 +2015,7 @@ BasicBlock *BB = FI; ++FI; bool removedBlock = MergeBlockIntoPredecessor(BB, this); - if (removedBlock) NumGVNBlocks++; + if (removedBlock) ++NumGVNBlocks; Changed |= removedBlock; } @@ -2142,12 +2142,12 @@ localAvail[*PI]->table.find(ValNo); if (predV == localAvail[*PI]->table.end()) { PREPred = *PI; - NumWithout++; + ++NumWithout; } else if (predV->second == CurInst) { NumWithout = 2; } else { predMap[*PI] = predV->second; - NumWith++; + ++NumWith; } } @@ -2202,7 +2202,7 @@ PREInstr->setName(CurInst->getName() + ".pre"); predMap[PREPred] = PREInstr; VN.add(PREInstr, ValNo); - NumGVNPRE++; + ++NumGVNPRE; // Update the availability map to include the new instruction. localAvail[PREPred]->table.insert(std::make_pair(ValNo, PREInstr)); Modified: llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopDeletion.cpp Tue Jun 22 10:08:57 2010 @@ -83,7 +83,7 @@ if (!L->makeLoopInvariant(I, Changed, Preheader->getTerminator())) return false; - BI++; + ++BI; } // Make sure that no instructions in the block have potential side-effects. @@ -176,7 +176,7 @@ BasicBlock::iterator BI = exitBlock->begin(); while (PHINode* P = dyn_cast(BI)) { P->replaceUsesOfWith(exitingBlock, preheader); - BI++; + ++BI; } // Update the dominator tree and remove the instructions and blocks that will @@ -226,7 +226,7 @@ LPM.deleteLoopFromQueue(L); Changed = true; - NumDeleted++; + ++NumDeleted; return Changed; } Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Tue Jun 22 10:08:57 2010 @@ -649,7 +649,7 @@ } } } - NumRestrictBounds++; + ++NumRestrictBounds; return true; } @@ -1159,7 +1159,7 @@ B_SplitCondition, B_IndVar, B_IndVarIncrement, BLoop, EVOpNum); - NumIndexSplit++; + ++NumIndexSplit; return true; } Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Tue Jun 22 10:08:57 2010 @@ -147,7 +147,7 @@ continue; // PHI nodes don't count. if (isa(OI)) continue; // Debug intrinsics don't count as size. - Size++; + ++Size; } if (Size > MAX_HEADER_SIZE) @@ -263,7 +263,7 @@ preserveCanonicalLoopForm(LPM); - NumRotated++; + ++NumRotated; return true; } Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Tue Jun 22 10:08:57 2010 @@ -632,7 +632,7 @@ // Remove the memcpy MD.removeInstruction(cpy); cpy->eraseFromParent(); - NumMemCpyInstr++; + ++NumMemCpyInstr; return true; } @@ -710,7 +710,7 @@ if (MD.getDependency(C) == dep) { MD.removeInstruction(M); M->eraseFromParent(); - NumMemCpyInstr++; + ++NumMemCpyInstr; return true; } Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Jun 22 10:08:57 2010 @@ -926,7 +926,7 @@ DeleteDeadInstructions(); AI->eraseFromParent(); - NumReplaced++; + ++NumReplaced; } /// DeleteDeadInstructions - Erase instructions on the DeadInstrs list, Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=106542&r1=106541&r2=106542&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Tue Jun 22 10:08:57 2010 @@ -192,7 +192,7 @@ if (!Preheader) { Preheader = InsertPreheaderForLoop(L); if (Preheader) { - NumInserted++; + ++NumInserted; Changed = true; } } @@ -215,7 +215,7 @@ // allowed. if (!L->contains(*PI)) { if (RewriteLoopExitBlock(L, ExitBlock)) { - NumInserted++; + ++NumInserted; Changed = true; } break; @@ -244,7 +244,7 @@ // loop header. LoopLatch = InsertUniqueBackedgeBlock(L, Preheader); if (LoopLatch) { - NumInserted++; + ++NumInserted; Changed = true; } } From gohman at apple.com Tue Jun 22 10:25:42 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 22 Jun 2010 15:25:42 -0000 Subject: [llvm-commits] [llvm] r106543 - /llvm/trunk/include/llvm/Analysis/LoopInfo.h Message-ID: <20100622152542.878A12A6C12C@llvm.org> Author: djg Date: Tue Jun 22 10:25:42 2010 New Revision: 106543 URL: http://llvm.org/viewvc/llvm-project?rev=106543&view=rev Log: Split out the code for finding a unique loop predecessor from getLoopPreheader into a separate function, for clients which don't require a proper preheader. Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=106543&r1=106542&r2=106543&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue Jun 22 10:25:42 2010 @@ -256,6 +256,27 @@ /// BlockT *getLoopPreheader() const { // Keep track of nodes outside the loop branching to the header... + BlockT *Out = getLoopPredecessor(); + if (!Out) return 0; + + // Make sure there is only one exit out of the preheader. + typedef GraphTraits BlockTraits; + typename BlockTraits::ChildIteratorType SI = BlockTraits::child_begin(Out); + ++SI; + if (SI != BlockTraits::child_end(Out)) + return 0; // Multiple exits from the block, must not be a preheader. + + // The predecessor has exactly one successor, so it is a preheader. + return Out; + } + + /// getLoopPredecessor - If the given loop's header has exactly one unique + /// predecessor outside the loop, return it. Otherwise return null. + /// This is less strict that the loop "preheader" concept, which requires + /// the predecessor to have exactly one successor. + /// + BlockT *getLoopPredecessor() const { + // Keep track of nodes outside the loop branching to the header... BlockT *Out = 0; // Loop over the predecessors of the header node... @@ -273,13 +294,6 @@ // Make sure there is only one exit out of the preheader. assert(Out && "Header of loop has no predecessors from outside loop?"); - typename BlockTraits::ChildIteratorType SI = BlockTraits::child_begin(Out); - ++SI; - if (SI != BlockTraits::child_end(Out)) - return 0; // Multiple exits from the block, must not be a preheader. - - // If there is exactly one preheader, return it. If there was zero, then - // Out is still null. return Out; } From stoklund at 2pi.dk Tue Jun 22 11:13:57 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 22 Jun 2010 16:13:57 -0000 Subject: [llvm-commits] [llvm] r106548 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp lib/CodeGen/SimpleRegisterCoalescing.h test/CodeGen/X86/pr2659.ll Message-ID: <20100622161357.992CF2A6C12C@llvm.org> Author: stoklund Date: Tue Jun 22 11:13:57 2010 New Revision: 106548 URL: http://llvm.org/viewvc/llvm-project?rev=106548&view=rev Log: Remove the SimpleJoin optimization from SimpleRegisterCoalescing. Measurements show that it does not speed up coalescing, so there is no reason the keep the added complexity around. Also clean out some unused methods and static functions. Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h llvm/trunk/test/CodeGen/X86/pr2659.ll Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=106548&r1=106547&r2=106548&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Jun 22 11:13:57 2010 @@ -1034,119 +1034,6 @@ } -/// isWinToJoinVRWithSrcPhysReg - Return true if it's worth while to join a -/// a virtual destination register with physical source register. -bool -SimpleRegisterCoalescing::isWinToJoinVRWithSrcPhysReg(MachineInstr *CopyMI, - MachineBasicBlock *CopyMBB, - LiveInterval &DstInt, - LiveInterval &SrcInt) { - // If the virtual register live interval is long but it has low use desity, - // do not join them, instead mark the physical register as its allocation - // preference. - const TargetRegisterClass *RC = mri_->getRegClass(DstInt.reg); - unsigned Threshold = allocatableRCRegs_[RC].count() * 2; - unsigned Length = li_->getApproximateInstructionCount(DstInt); - if (Length > Threshold && - std::distance(mri_->use_nodbg_begin(DstInt.reg), - mri_->use_nodbg_end()) * Threshold < Length) - return false; - - // If the virtual register live interval extends into a loop, turn down - // aggressiveness. - SlotIndex CopyIdx = - li_->getInstructionIndex(CopyMI).getDefIndex(); - const MachineLoop *L = loopInfo->getLoopFor(CopyMBB); - if (!L) { - // Let's see if the virtual register live interval extends into the loop. - LiveInterval::iterator DLR = DstInt.FindLiveRangeContaining(CopyIdx); - assert(DLR != DstInt.end() && "Live range not found!"); - DLR = DstInt.FindLiveRangeContaining(DLR->end.getNextSlot()); - if (DLR != DstInt.end()) { - CopyMBB = li_->getMBBFromIndex(DLR->start); - L = loopInfo->getLoopFor(CopyMBB); - } - } - - if (!L || Length <= Threshold) - return true; - - SlotIndex UseIdx = CopyIdx.getUseIndex(); - LiveInterval::iterator SLR = SrcInt.FindLiveRangeContaining(UseIdx); - MachineBasicBlock *SMBB = li_->getMBBFromIndex(SLR->start); - if (loopInfo->getLoopFor(SMBB) != L) { - if (!loopInfo->isLoopHeader(CopyMBB)) - return false; - // If vr's live interval extends pass the loop header, do not join. - for (MachineBasicBlock::succ_iterator SI = CopyMBB->succ_begin(), - SE = CopyMBB->succ_end(); SI != SE; ++SI) { - MachineBasicBlock *SuccMBB = *SI; - if (SuccMBB == CopyMBB) - continue; - if (DstInt.overlaps(li_->getMBBStartIdx(SuccMBB), - li_->getMBBEndIdx(SuccMBB))) - return false; - } - } - return true; -} - -/// isWinToJoinVRWithDstPhysReg - Return true if it's worth while to join a -/// copy from a virtual source register to a physical destination register. -bool -SimpleRegisterCoalescing::isWinToJoinVRWithDstPhysReg(MachineInstr *CopyMI, - MachineBasicBlock *CopyMBB, - LiveInterval &DstInt, - LiveInterval &SrcInt) { - // If the virtual register live interval is long but it has low use density, - // do not join them, instead mark the physical register as its allocation - // preference. - const TargetRegisterClass *RC = mri_->getRegClass(SrcInt.reg); - unsigned Threshold = allocatableRCRegs_[RC].count() * 2; - unsigned Length = li_->getApproximateInstructionCount(SrcInt); - if (Length > Threshold && - std::distance(mri_->use_nodbg_begin(SrcInt.reg), - mri_->use_nodbg_end()) * Threshold < Length) - return false; - - if (SrcInt.empty()) - // Must be implicit_def. - return false; - - // If the virtual register live interval is defined or cross a loop, turn - // down aggressiveness. - SlotIndex CopyIdx = - li_->getInstructionIndex(CopyMI).getDefIndex(); - SlotIndex UseIdx = CopyIdx.getUseIndex(); - LiveInterval::iterator SLR = SrcInt.FindLiveRangeContaining(UseIdx); - assert(SLR != SrcInt.end() && "Live range not found!"); - SLR = SrcInt.FindLiveRangeContaining(SLR->start.getPrevSlot()); - if (SLR == SrcInt.end()) - return true; - MachineBasicBlock *SMBB = li_->getMBBFromIndex(SLR->start); - const MachineLoop *L = loopInfo->getLoopFor(SMBB); - - if (!L || Length <= Threshold) - return true; - - if (loopInfo->getLoopFor(CopyMBB) != L) { - if (SMBB != L->getLoopLatch()) - return false; - // If vr's live interval is extended from before the loop latch, do not - // join. - for (MachineBasicBlock::pred_iterator PI = SMBB->pred_begin(), - PE = SMBB->pred_end(); PI != PE; ++PI) { - MachineBasicBlock *PredMBB = *PI; - if (PredMBB == SMBB) - continue; - if (SrcInt.overlaps(li_->getMBBStartIdx(PredMBB), - li_->getMBBEndIdx(PredMBB))) - return false; - } - } - return true; -} - /// isWinToJoinCrossClass - Return true if it's profitable to coalesce /// two virtual registers from different register classes. bool @@ -1921,236 +1808,6 @@ return ThisValNoAssignments[VN] = UltimateVN; } -static bool InVector(VNInfo *Val, const SmallVector &V) { - return std::find(V.begin(), V.end(), Val) != V.end(); -} - -/// RangeIsDefinedByCopyFromReg - Return true if the specified live range of -/// the specified live interval is defined by a copy from the specified -/// register. -bool SimpleRegisterCoalescing::RangeIsDefinedByCopy(LiveInterval &li, - LiveRange *LR, - CoalescerPair &CP) { - if (CP.isCoalescable(LR->valno->getCopy())) - return true; - // FIXME: Do isPHIDef and isDefAccurate both need to be tested? - if ((LR->valno->isPHIDef() || !LR->valno->isDefAccurate()) && - TargetRegisterInfo::isPhysicalRegister(li.reg) && - *tri_->getSuperRegisters(li.reg)) { - // It's a sub-register live interval, we may not have precise information. - // Re-compute it. - MachineInstr *DefMI = li_->getInstructionFromIndex(LR->start); - if (CP.isCoalescable(DefMI)) { - // Cache computed info. - LR->valno->def = LR->start; - LR->valno->setCopy(DefMI); - return true; - } - } - return false; -} - - -/// ValueLiveAt - Return true if the LiveRange pointed to by the given -/// iterator, or any subsequent range with the same value number, -/// is live at the given point. -bool SimpleRegisterCoalescing::ValueLiveAt(LiveInterval::iterator LRItr, - LiveInterval::iterator LREnd, - SlotIndex defPoint) const { - for (const VNInfo *valno = LRItr->valno; - (LRItr != LREnd) && (LRItr->valno == valno); ++LRItr) { - if (LRItr->contains(defPoint)) - return true; - } - - return false; -} - - -/// SimpleJoin - Attempt to joint the specified interval into this one. The -/// caller of this method must guarantee that the RHS only contains a single -/// value number and that the RHS is not defined by a copy from this -/// interval. This returns false if the intervals are not joinable, or it -/// joins them and returns true. -bool SimpleRegisterCoalescing::SimpleJoin(LiveInterval &LHS, LiveInterval &RHS, - CoalescerPair &CP) { - assert(RHS.containsOneValue()); - - // Some number (potentially more than one) value numbers in the current - // interval may be defined as copies from the RHS. Scan the overlapping - // portions of the LHS and RHS, keeping track of this and looking for - // overlapping live ranges that are NOT defined as copies. If these exist, we - // cannot coalesce. - - LiveInterval::iterator LHSIt = LHS.begin(), LHSEnd = LHS.end(); - LiveInterval::iterator RHSIt = RHS.begin(), RHSEnd = RHS.end(); - - if (LHSIt->start < RHSIt->start) { - LHSIt = std::upper_bound(LHSIt, LHSEnd, RHSIt->start); - if (LHSIt != LHS.begin()) --LHSIt; - } else if (RHSIt->start < LHSIt->start) { - RHSIt = std::upper_bound(RHSIt, RHSEnd, LHSIt->start); - if (RHSIt != RHS.begin()) --RHSIt; - } - - SmallVector EliminatedLHSVals; - - while (1) { - // Determine if these live intervals overlap. - bool Overlaps = false; - if (LHSIt->start <= RHSIt->start) - Overlaps = LHSIt->end > RHSIt->start; - else - Overlaps = RHSIt->end > LHSIt->start; - - // If the live intervals overlap, there are two interesting cases: if the - // LHS interval is defined by a copy from the RHS, it's ok and we record - // that the LHS value # is the same as the RHS. If it's not, then we cannot - // coalesce these live ranges and we bail out. - if (Overlaps) { - // If we haven't already recorded that this value # is safe, check it. - if (!InVector(LHSIt->valno, EliminatedLHSVals)) { - // If it's re-defined by an early clobber somewhere in the live range, - // then conservatively abort coalescing. - if (LHSIt->valno->hasRedefByEC()) - return false; - // Copy from the RHS? - if (!RangeIsDefinedByCopy(LHS, LHSIt, CP)) - return false; // Nope, bail out. - - if (ValueLiveAt(LHSIt, LHS.end(), RHSIt->valno->def)) - // Here is an interesting situation: - // BB1: - // vr1025 = copy vr1024 - // .. - // BB2: - // vr1024 = op - // = vr1025 - // Even though vr1025 is copied from vr1024, it's not safe to - // coalesce them since the live range of vr1025 intersects the - // def of vr1024. This happens because vr1025 is assigned the - // value of the previous iteration of vr1024. - return false; - EliminatedLHSVals.push_back(LHSIt->valno); - } - - // We know this entire LHS live range is okay, so skip it now. - if (++LHSIt == LHSEnd) break; - continue; - } - - if (LHSIt->end < RHSIt->end) { - if (++LHSIt == LHSEnd) break; - } else { - // One interesting case to check here. It's possible that we have - // something like "X3 = Y" which defines a new value number in the LHS, - // and is the last use of this liverange of the RHS. In this case, we - // want to notice this copy (so that it gets coalesced away) even though - // the live ranges don't actually overlap. - if (LHSIt->start == RHSIt->end) { - if (InVector(LHSIt->valno, EliminatedLHSVals)) { - // We already know that this value number is going to be merged in - // if coalescing succeeds. Just skip the liverange. - if (++LHSIt == LHSEnd) break; - } else { - // If it's re-defined by an early clobber somewhere in the live range, - // then conservatively abort coalescing. - if (LHSIt->valno->hasRedefByEC()) - return false; - // Otherwise, if this is a copy from the RHS, mark it as being merged - // in. - if (RangeIsDefinedByCopy(LHS, LHSIt, CP)) { - if (ValueLiveAt(LHSIt, LHS.end(), RHSIt->valno->def)) - // Here is an interesting situation: - // BB1: - // vr1025 = copy vr1024 - // .. - // BB2: - // vr1024 = op - // = vr1025 - // Even though vr1025 is copied from vr1024, it's not safe to - // coalesced them since live range of vr1025 intersects the - // def of vr1024. This happens because vr1025 is assigned the - // value of the previous iteration of vr1024. - return false; - EliminatedLHSVals.push_back(LHSIt->valno); - - // We know this entire LHS live range is okay, so skip it now. - if (++LHSIt == LHSEnd) break; - } - } - } - - if (++RHSIt == RHSEnd) break; - } - } - - // If we got here, we know that the coalescing will be successful and that - // the value numbers in EliminatedLHSVals will all be merged together. Since - // the most common case is that EliminatedLHSVals has a single number, we - // optimize for it: if there is more than one value, we merge them all into - // the lowest numbered one, then handle the interval as if we were merging - // with one value number. - VNInfo *LHSValNo = NULL; - if (EliminatedLHSVals.size() > 1) { - // Loop through all the equal value numbers merging them into the smallest - // one. - VNInfo *Smallest = EliminatedLHSVals[0]; - for (unsigned i = 1, e = EliminatedLHSVals.size(); i != e; ++i) { - if (EliminatedLHSVals[i]->id < Smallest->id) { - // Merge the current notion of the smallest into the smaller one. - LHS.MergeValueNumberInto(Smallest, EliminatedLHSVals[i]); - Smallest = EliminatedLHSVals[i]; - } else { - // Merge into the smallest. - LHS.MergeValueNumberInto(EliminatedLHSVals[i], Smallest); - } - } - LHSValNo = Smallest; - } else if (EliminatedLHSVals.empty()) { - if (TargetRegisterInfo::isPhysicalRegister(LHS.reg) && - *tri_->getSuperRegisters(LHS.reg)) - // Imprecise sub-register information. Can't handle it. - return false; - llvm_unreachable("No copies from the RHS?"); - } else { - LHSValNo = EliminatedLHSVals[0]; - } - - // Okay, now that there is a single LHS value number that we're merging the - // RHS into, update the value number info for the LHS to indicate that the - // value number is defined where the RHS value number was. - const VNInfo *VNI = RHS.getValNumInfo(0); - LHSValNo->def = VNI->def; - LHSValNo->setCopy(VNI->getCopy()); - - // Okay, the final step is to loop over the RHS live intervals, adding them to - // the LHS. - if (VNI->hasPHIKill()) - LHSValNo->setHasPHIKill(true); - LHS.addKills(LHSValNo, VNI->kills); - LHS.MergeRangesInAsValue(RHS, LHSValNo); - - LHS.ComputeJoinedWeight(RHS); - - // Update regalloc hint if both are virtual registers. - if (TargetRegisterInfo::isVirtualRegister(LHS.reg) && - TargetRegisterInfo::isVirtualRegister(RHS.reg)) { - std::pair RHSPref = mri_->getRegAllocationHint(RHS.reg); - std::pair LHSPref = mri_->getRegAllocationHint(LHS.reg); - if (RHSPref != LHSPref) - mri_->setRegAllocationHint(LHS.reg, RHSPref.first, RHSPref.second); - } - - // Update the liveintervals of sub-registers. - if (TargetRegisterInfo::isPhysicalRegister(LHS.reg)) - for (const unsigned *AS = tri_->getSubRegisters(LHS.reg); *AS; ++AS) - li_->getOrCreateInterval(*AS).MergeInClobberRanges(*li_, LHS, - li_->getVNInfoAllocator()); - - return true; -} - /// JoinIntervals - Attempt to join these two intervals. On failure, this /// returns false. Otherwise, if one of the intervals being joined is a /// physreg, this method always canonicalizes LHS to be it. The output @@ -2222,150 +1879,84 @@ } } - // Compute ultimate value numbers for the LHS and RHS values. - if (RHS.containsOneValue()) { - // Copies from a liveinterval with a single value are simple to handle and - // very common, handle the special case here. This is important, because - // often RHS is small and LHS is large (e.g. a physreg). - - // Find out if the RHS is defined as a copy from some value in the LHS. - int RHSVal0DefinedFromLHS = -1; - int RHSValID = -1; - VNInfo *RHSValNoInfo = NULL; - VNInfo *RHSValNoInfo0 = RHS.getValNumInfo(0); - unsigned RHSSrcReg = li_->getVNInfoSourceReg(RHSValNoInfo0); - if (RHSSrcReg == 0 || RHSSrcReg != LHS.reg) { - // If RHS is not defined as a copy from the LHS, we can use simpler and - // faster checks to see if the live ranges are coalescable. This joiner - // can't swap the LHS/RHS intervals though. - if (!TargetRegisterInfo::isPhysicalRegister(RHS.reg)) { - return SimpleJoin(LHS, RHS, CP); - } else { - RHSValNoInfo = RHSValNoInfo0; - } - } else { - // It was defined as a copy from the LHS, find out what value # it is. - RHSValNoInfo = - LHS.getLiveRangeContaining(RHSValNoInfo0->def.getPrevSlot())->valno; - RHSValID = RHSValNoInfo->id; - RHSVal0DefinedFromLHS = RHSValID; - } - - LHSValNoAssignments.resize(LHS.getNumValNums(), -1); - RHSValNoAssignments.resize(RHS.getNumValNums(), -1); - NewVNInfo.resize(LHS.getNumValNums(), NULL); - - // Okay, *all* of the values in LHS that are defined as a copy from RHS - // should now get updated. - for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end(); - i != e; ++i) { - VNInfo *VNI = *i; - unsigned VN = VNI->id; - if (unsigned LHSSrcReg = li_->getVNInfoSourceReg(VNI)) { - if (LHSSrcReg != RHS.reg) { - // If this is not a copy from the RHS, its value number will be - // unmodified by the coalescing. - NewVNInfo[VN] = VNI; - LHSValNoAssignments[VN] = VN; - } else if (RHSValID == -1) { - // Otherwise, it is a copy from the RHS, and we don't already have a - // value# for it. Keep the current value number, but remember it. - LHSValNoAssignments[VN] = RHSValID = VN; - NewVNInfo[VN] = RHSValNoInfo; - LHSValsDefinedFromRHS[VNI] = RHSValNoInfo0; - } else { - // Otherwise, use the specified value #. - LHSValNoAssignments[VN] = RHSValID; - if (VN == (unsigned)RHSValID) { // Else this val# is dead. - NewVNInfo[VN] = RHSValNoInfo; - LHSValsDefinedFromRHS[VNI] = RHSValNoInfo0; - } - } - } else { - NewVNInfo[VN] = VNI; - LHSValNoAssignments[VN] = VN; - } - } + // Loop over the value numbers of the LHS, seeing if any are defined from + // the RHS. + for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end(); + i != e; ++i) { + VNInfo *VNI = *i; + if (VNI->isUnused() || VNI->getCopy() == 0) // Src not defined by a copy? + continue; - assert(RHSValID != -1 && "Didn't find value #?"); - RHSValNoAssignments[0] = RHSValID; - if (RHSVal0DefinedFromLHS != -1) { - // This path doesn't go through ComputeUltimateVN so just set - // it to anything. - RHSValsDefinedFromLHS[RHSValNoInfo0] = (VNInfo*)1; - } - } else { - // Loop over the value numbers of the LHS, seeing if any are defined from - // the RHS. - for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end(); - i != e; ++i) { - VNInfo *VNI = *i; - if (VNI->isUnused() || VNI->getCopy() == 0) // Src not defined by a copy? - continue; + // Never join with a register that has EarlyClobber redefs. + if (VNI->hasRedefByEC()) + return false; - // DstReg is known to be a register in the LHS interval. If the src is - // from the RHS interval, we can use its value #. - if (!CP.isCoalescable(VNI->getCopy())) - continue; + // DstReg is known to be a register in the LHS interval. If the src is + // from the RHS interval, we can use its value #. + if (!CP.isCoalescable(VNI->getCopy())) + continue; - // Figure out the value # from the RHS. - LiveRange *lr = RHS.getLiveRangeContaining(VNI->def.getPrevSlot()); - // The copy could be to an aliased physreg. - if (!lr) continue; - LHSValsDefinedFromRHS[VNI] = lr->valno; - } + // Figure out the value # from the RHS. + LiveRange *lr = RHS.getLiveRangeContaining(VNI->def.getPrevSlot()); + // The copy could be to an aliased physreg. + if (!lr) continue; + LHSValsDefinedFromRHS[VNI] = lr->valno; + } - // Loop over the value numbers of the RHS, seeing if any are defined from - // the LHS. - for (LiveInterval::vni_iterator i = RHS.vni_begin(), e = RHS.vni_end(); - i != e; ++i) { - VNInfo *VNI = *i; - if (VNI->isUnused() || VNI->getCopy() == 0) // Src not defined by a copy? - continue; + // Loop over the value numbers of the RHS, seeing if any are defined from + // the LHS. + for (LiveInterval::vni_iterator i = RHS.vni_begin(), e = RHS.vni_end(); + i != e; ++i) { + VNInfo *VNI = *i; + if (VNI->isUnused() || VNI->getCopy() == 0) // Src not defined by a copy? + continue; - // DstReg is known to be a register in the RHS interval. If the src is - // from the LHS interval, we can use its value #. - if (!CP.isCoalescable(VNI->getCopy())) - continue; + // Never join with a register that has EarlyClobber redefs. + if (VNI->hasRedefByEC()) + return false; - // Figure out the value # from the LHS. - LiveRange *lr = LHS.getLiveRangeContaining(VNI->def.getPrevSlot()); - // The copy could be to an aliased physreg. - if (!lr) continue; - RHSValsDefinedFromLHS[VNI] = lr->valno; - } - - LHSValNoAssignments.resize(LHS.getNumValNums(), -1); - RHSValNoAssignments.resize(RHS.getNumValNums(), -1); - NewVNInfo.reserve(LHS.getNumValNums() + RHS.getNumValNums()); - - for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end(); - i != e; ++i) { - VNInfo *VNI = *i; - unsigned VN = VNI->id; - if (LHSValNoAssignments[VN] >= 0 || VNI->isUnused()) - continue; - ComputeUltimateVN(VNI, NewVNInfo, - LHSValsDefinedFromRHS, RHSValsDefinedFromLHS, - LHSValNoAssignments, RHSValNoAssignments); - } - for (LiveInterval::vni_iterator i = RHS.vni_begin(), e = RHS.vni_end(); - i != e; ++i) { - VNInfo *VNI = *i; - unsigned VN = VNI->id; - if (RHSValNoAssignments[VN] >= 0 || VNI->isUnused()) - continue; - // If this value number isn't a copy from the LHS, it's a new number. - if (RHSValsDefinedFromLHS.find(VNI) == RHSValsDefinedFromLHS.end()) { - NewVNInfo.push_back(VNI); - RHSValNoAssignments[VN] = NewVNInfo.size()-1; - continue; - } + // DstReg is known to be a register in the RHS interval. If the src is + // from the LHS interval, we can use its value #. + if (!CP.isCoalescable(VNI->getCopy())) + continue; - ComputeUltimateVN(VNI, NewVNInfo, - RHSValsDefinedFromLHS, LHSValsDefinedFromRHS, - RHSValNoAssignments, LHSValNoAssignments); + // Figure out the value # from the LHS. + LiveRange *lr = LHS.getLiveRangeContaining(VNI->def.getPrevSlot()); + // The copy could be to an aliased physreg. + if (!lr) continue; + RHSValsDefinedFromLHS[VNI] = lr->valno; + } + + LHSValNoAssignments.resize(LHS.getNumValNums(), -1); + RHSValNoAssignments.resize(RHS.getNumValNums(), -1); + NewVNInfo.reserve(LHS.getNumValNums() + RHS.getNumValNums()); + + for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end(); + i != e; ++i) { + VNInfo *VNI = *i; + unsigned VN = VNI->id; + if (LHSValNoAssignments[VN] >= 0 || VNI->isUnused()) + continue; + ComputeUltimateVN(VNI, NewVNInfo, + LHSValsDefinedFromRHS, RHSValsDefinedFromLHS, + LHSValNoAssignments, RHSValNoAssignments); + } + for (LiveInterval::vni_iterator i = RHS.vni_begin(), e = RHS.vni_end(); + i != e; ++i) { + VNInfo *VNI = *i; + unsigned VN = VNI->id; + if (RHSValNoAssignments[VN] >= 0 || VNI->isUnused()) + continue; + // If this value number isn't a copy from the LHS, it's a new number. + if (RHSValsDefinedFromLHS.find(VNI) == RHSValsDefinedFromLHS.end()) { + NewVNInfo.push_back(VNI); + RHSValNoAssignments[VN] = NewVNInfo.size()-1; + continue; } + + ComputeUltimateVN(VNI, NewVNInfo, + RHSValsDefinedFromLHS, LHSValsDefinedFromRHS, + RHSValNoAssignments, LHSValNoAssignments); } // Armed with the mappings of LHS/RHS values to ultimate values, walk the Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h?rev=106548&r1=106547&r2=106548&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h Tue Jun 22 11:13:57 2010 @@ -113,14 +113,7 @@ /// below to update aliases. bool JoinIntervals(LiveInterval &LHS, LiveInterval &RHS, bool &Swapped, CoalescerPair &CP); - - /// SimpleJoin - Attempt to join the specified interval into this one. The - /// caller of this method must guarantee that the RHS only contains a single - /// value number and that the RHS is not defined by a copy from this - /// interval. This returns false if the intervals are not joinable, or it - /// joins them and returns true. - bool SimpleJoin(LiveInterval &LHS, LiveInterval &RHS, CoalescerPair &CP); - + /// Return true if the two specified registers belong to different register /// classes. The registers may be either phys or virt regs. bool differingRegisterClasses(unsigned RegA, unsigned RegB) const; @@ -161,23 +154,6 @@ bool CanCoalesceWithImpDef(MachineInstr *CopyMI, LiveInterval &li, LiveInterval &ImpLi) const; - /// TurnCopiesFromValNoToImpDefs - The specified value# is defined by an - /// implicit_def and it is being removed. Turn all copies from this value# - /// into implicit_defs. - void TurnCopiesFromValNoToImpDefs(LiveInterval &li, VNInfo *VNI); - - /// isWinToJoinVRWithSrcPhysReg - Return true if it's worth while to join a - /// a virtual destination register with physical source register. - bool isWinToJoinVRWithSrcPhysReg(MachineInstr *CopyMI, - MachineBasicBlock *CopyMBB, - LiveInterval &DstInt, LiveInterval &SrcInt); - - /// isWinToJoinVRWithDstPhysReg - Return true if it's worth while to join a - /// copy from a virtual source register to a physical destination register. - bool isWinToJoinVRWithDstPhysReg(MachineInstr *CopyMI, - MachineBasicBlock *CopyMBB, - LiveInterval &DstInt, LiveInterval &SrcInt); - /// isWinToJoinCrossClass - Return true if it's profitable to coalesce /// two virtual registers from different register classes. bool isWinToJoinCrossClass(unsigned SrcReg, @@ -205,17 +181,6 @@ bool CanJoinInsertSubRegToPhysReg(unsigned DstReg, unsigned SrcReg, unsigned SubIdx, unsigned &RealDstReg); - /// ValueLiveAt - Return true if the LiveRange pointed to by the given - /// iterator, or any subsequent range with the same value number, - /// is live at the given point. - bool ValueLiveAt(LiveInterval::iterator LRItr, LiveInterval::iterator LREnd, - SlotIndex defPoint) const; - - /// RangeIsDefinedByCopy - Return true if the specified live range of the - /// specified live interval is defined by a coalescable copy. - bool RangeIsDefinedByCopy(LiveInterval &li, LiveRange *LR, - CoalescerPair &CP); - /// UpdateRegDefsUses - Replace all defs and uses of SrcReg to DstReg and /// update the subregister number if it is not zero. If DstReg is a /// physical register and the existing subregister number of the def / use Modified: llvm/trunk/test/CodeGen/X86/pr2659.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr2659.ll?rev=106548&r1=106547&r2=106548&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/pr2659.ll (original) +++ llvm/trunk/test/CodeGen/X86/pr2659.ll Tue Jun 22 11:13:57 2010 @@ -17,7 +17,7 @@ ; CHECK: %forcond.preheader.forbody_crit_edge ; CHECK: movl $1 ; CHECK-NOT: xorl -; CHECK-NEXT: movl $1 +; CHECK-NEXT: movl ifthen: ; preds = %entry ret i32 0 From jan_sjodin at yahoo.com Tue Jun 22 12:08:19 2010 From: jan_sjodin at yahoo.com (Jan Sjodin) Date: Tue, 22 Jun 2010 10:08:19 -0700 (PDT) Subject: [llvm-commits] Issue with Win64 local area stack offset In-Reply-To: References: <273445.8686.qm@web55603.mail.re4.yahoo.com> Message-ID: <613808.27538.qm@web55606.mail.re4.yahoo.com> I did a couple of tests with this function: %structType = type <{ <16 x i32> }> define i64 @myfun(i64 %arg0, i64 %arg1) nounwind { entry: %test.i = alloca %structType, align 64 %conv4.i = ptrtoint %structType* %test.i to i64 %tmp0 = add i64 %conv4.i, %arg0 %tmp1 = add i64 %tmp0, %arg1 ret i64 %tmp1 } I compiled with: llc.exe -disable-fp-elim -march=x86-64 -stack-alignment=64 Original llc: _myfun: # @myfun # BB#0: # %entry pushq %rbp movq %rsp, %rbp subq $112, %rsp leaq -80(%rbp,%rcx), %rax addq %rdx, %rax addq $112, %rsp popq %rbp ret If %arg0 and %arg1 are 0, and assuming that rsp is 0xB8 at the entry: %rbp == 0xB0 leaq -80(%rbp, %rcx) == 0x60 (not aligned) Patched llc: # BB#0: # %entry pushq %rbp movq %rsp, %rbp subq $112, %rsp leaq -112(%rbp,%rcx), %rax addq %rdx, %rax addq $112, %rsp popq %rbp ret %rbp == 0xB0 leaq -112(%rbp,%rcx) == 0x40 (aligned) Second test was compiled with: llc.exe -disable-fp-elim -march=x86-64 -stack-alignment=64 Original llc: # BB#0: # %entry subq $120, %rsp leaq 32(%rsp,%rcx), %rax addq %rdx, %rax addq $120, %rsp ret at entry: %rsp = 0xB8 after alloc: %rsp == 0x40 leaq 32(%rsp,%rcx) == 0x60 (not aligned) Patched llc: # BB#0: # %entry subq $120, %rsp leaq (%rsp,%rcx), %rax addq %rdx, %rax addq $120, %rsp ret at entry: %rsp == 0xB8 after alloc: %rsp == 0x40 leaq (%rsp,%rcx) == 0x40 (aligned) The code that is handling the shadow space is in X86FastISel.cpp: // Allocate shadow area for Win64 if (Subtarget->isTargetWin64()) { CCInfo.AllocateStack(32, 8); } This was a patch that I submitted a while back, because it was not handled in the fast isel. This was perhaps incomplete because the only other place that i can find is in X86IselLowering::LowerMemOpCallTo: const unsigned FirstStackArgOffset = (Subtarget->isTargetWin64() ? 32 : 0); The shadow space allocation should be handled by X86IselLowering::lowerCall imo. - Jan ----- Original Message ---- > From: Anton Korobeynikov > To: Jan Sjodin > Cc: llvm-commits at cs.uiuc.edu > Sent: Mon, June 21, 2010 6:56:17 PM > Subject: Re: [llvm-commits] Issue with Win64 local area stack offset > > Hello, Jan > I hope this is clear because it is easy to get confused > and it would be > nice if someone can confirm this issue. Below is a > simple patch that fixes the > problem by not allocating the spill area and > sets the LAO to 8. The shadow > area is already handled by the function > call lowering code. I might be wrong, but it doesn't seem so. Call lowering > code only puts the arguments assuming that there is a shadow space already > allocated, but nothing inside prologue allocates it (this was what > "StackSize +=32" used for). Please verify your observations on: 1. > Function in case of eliminated FP 2. Function with just 2 > arguments Thanks! -- With best regards, Anton > Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State > University From criswell at uiuc.edu Tue Jun 22 12:15:17 2010 From: criswell at uiuc.edu (John Criswell) Date: Tue, 22 Jun 2010 17:15:17 -0000 Subject: [llvm-commits] [poolalloc] r106554 - /poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp Message-ID: <20100622171517.9507A2A6C12C@llvm.org> Author: criswell Date: Tue Jun 22 12:15:17 2010 New Revision: 106554 URL: http://llvm.org/viewvc/llvm-project?rev=106554&view=rev Log: Pool handles can be NULL. Check for NULL pool handles before trying to lock or unlock the pool. Modified: poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp Modified: poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp?rev=106554&r1=106553&r2=106554&view=diff ============================================================================== --- poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp (original) +++ poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp Tue Jun 22 12:15:17 2010 @@ -867,9 +867,9 @@ void *poolalloc(PoolTy *Pool, unsigned NumBytes) { DO_IF_FORCE_MALLOCFREE(return malloc(NumBytes)); - pthread_mutex_lock(&Pool->pool_lock); + if (Pool) pthread_mutex_lock(&Pool->pool_lock); void* to_return = poolalloc_internal(Pool, NumBytes); - pthread_mutex_unlock(&Pool->pool_lock); + if (Pool) pthread_mutex_unlock(&Pool->pool_lock); return to_return; } @@ -877,25 +877,25 @@ unsigned Alignment, unsigned NumBytes) { //punt and use pool alloc. //I don't know if this is safe or breaks any assumptions in the runtime - pthread_mutex_lock(&Pool->pool_lock); + if (Pool) pthread_mutex_lock(&Pool->pool_lock); intptr_t base = (intptr_t)poolalloc_internal(Pool, NumBytes + Alignment - 1); - pthread_mutex_unlock(&Pool->pool_lock); + if (Pool) pthread_mutex_unlock(&Pool->pool_lock); return (void*)((base + (Alignment - 1)) & ~((intptr_t)Alignment -1)); } void poolfree(PoolTy *Pool, void *Node) { DO_IF_FORCE_MALLOCFREE(free(Node); return); - pthread_mutex_lock(&Pool->pool_lock); + if (Pool) pthread_mutex_lock(&Pool->pool_lock); poolfree_internal(Pool, Node); - pthread_mutex_unlock(&Pool->pool_lock); + if (Pool) pthread_mutex_unlock(&Pool->pool_lock); } void *poolrealloc(PoolTy *Pool, void *Node, unsigned NumBytes) { DO_IF_FORCE_MALLOCFREE(return realloc(Node, NumBytes)); - pthread_mutex_lock(&Pool->pool_lock); + if (Pool) pthread_mutex_lock(&Pool->pool_lock); void* to_return = poolrealloc_internal(Pool, Node, NumBytes); - pthread_mutex_unlock(&Pool->pool_lock); + if (Pool) pthread_mutex_unlock(&Pool->pool_lock); return to_return; } @@ -1026,23 +1026,23 @@ unsigned long long poolalloc_pc(PoolTy *Pool, unsigned NumBytes) { - pthread_mutex_lock(&Pool->pool_lock); + if (Pool) pthread_mutex_lock(&Pool->pool_lock); void *Result = poolalloc_internal(Pool, NumBytes); - pthread_mutex_unlock(&Pool->pool_lock); + if (Pool) pthread_mutex_unlock(&Pool->pool_lock); return (char*)Result-(char*)Pool->Slabs; } void poolfree_pc(PoolTy *Pool, unsigned long long Node) { - pthread_mutex_lock(&Pool->pool_lock); + if (Pool) pthread_mutex_lock(&Pool->pool_lock); poolfree_internal(Pool, (char*)Pool->Slabs+Node); - pthread_mutex_unlock(&Pool->pool_lock); + if (Pool) pthread_mutex_unlock(&Pool->pool_lock); } unsigned long long poolrealloc_pc(PoolTy *Pool, unsigned long long Node, unsigned NumBytes) { - pthread_mutex_lock(&Pool->pool_lock); + if (Pool) pthread_mutex_lock(&Pool->pool_lock); void *Result = poolrealloc_internal(Pool, (char*)Pool->Slabs+Node, NumBytes); - pthread_mutex_unlock(&Pool->pool_lock); + if (Pool) pthread_mutex_unlock(&Pool->pool_lock); return (char*)Result-(char*)Pool->Slabs; } @@ -1060,25 +1060,25 @@ void* poolalloc_pca(PoolTy *Pool, unsigned NumBytes) { - pthread_mutex_lock(&Pool->pool_lock); + if (Pool) pthread_mutex_lock(&Pool->pool_lock); void* to_return = poolalloc_internal(Pool, NumBytes); - pthread_mutex_unlock(&Pool->pool_lock); + if (Pool) pthread_mutex_unlock(&Pool->pool_lock); return to_return; } void poolfree_pca(PoolTy *Pool, void* Node) { - pthread_mutex_lock(&Pool->pool_lock); + if (Pool) pthread_mutex_lock(&Pool->pool_lock); poolfree_internal(Pool, Node); - pthread_mutex_unlock(&Pool->pool_lock); + if (Pool) pthread_mutex_unlock(&Pool->pool_lock); } void* poolrealloc_pca(PoolTy *Pool, void* Node, unsigned NumBytes) { - pthread_mutex_lock(&Pool->pool_lock); + if (Pool) pthread_mutex_lock(&Pool->pool_lock); void* to_return = poolrealloc_internal(Pool, Node, NumBytes); - pthread_mutex_unlock(&Pool->pool_lock); + if (Pool) pthread_mutex_unlock(&Pool->pool_lock); return to_return; } From gohman at apple.com Tue Jun 22 12:25:57 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 22 Jun 2010 17:25:57 -0000 Subject: [llvm-commits] [llvm] r106555 - in /llvm/trunk: include/llvm/CodeGen/MachineBasicBlock.h include/llvm/CodeGen/MachineLoopInfo.h lib/CodeGen/MachineBasicBlock.cpp lib/CodeGen/MachineLICM.cpp lib/CodeGen/PHIElimination.cpp Message-ID: <20100622172557.90D422A6C12C@llvm.org> Author: djg Date: Tue Jun 22 12:25:57 2010 New Revision: 106555 URL: http://llvm.org/viewvc/llvm-project?rev=106555&view=rev Log: Move PHIElimination's SplitCriticalEdge for MachineBasicBlocks out into a utility routine, teach it how to update MachineLoopInfo, and make use of it in MachineLICM to split critical edges on demand. Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp llvm/trunk/lib/CodeGen/MachineLICM.cpp llvm/trunk/lib/CodeGen/PHIElimination.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=106555&r1=106554&r2=106555&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Tue Jun 22 12:25:57 2010 @@ -19,6 +19,7 @@ namespace llvm { +class Pass; class BasicBlock; class MachineFunction; class MCSymbol; @@ -281,6 +282,14 @@ /// it returns end() iterator getFirstTerminator(); + /// SplitCriticalEdge - Split the critical edge from this block to the + /// given successor block, and return the newly created block, or null + /// if splitting is not possible. + /// + /// This function updates LiveVariables, MachineDominatorTree, and + /// MachineLoopInfo, as applicable. + MachineBasicBlock *SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P); + void pop_front() { Insts.pop_front(); } void pop_back() { Insts.pop_back(); } void push_back(MachineInstr *MI) { Insts.push_back(MI); } Modified: llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h?rev=106555&r1=106554&r2=106555&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineLoopInfo.h Tue Jun 22 12:25:57 2010 @@ -64,13 +64,13 @@ void operator=(const MachineLoopInfo &); // do not implement MachineLoopInfo(const MachineLoopInfo &); // do not implement - LoopInfoBase& getBase() { return LI; } - public: static char ID; // Pass identification, replacement for typeid MachineLoopInfo() : MachineFunctionPass(&ID) {} + LoopInfoBase& getBase() { return LI; } + /// iterator/begin/end - The interface to the top-level loops in the current /// function. /// Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=106555&r1=106554&r2=106555&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Tue Jun 22 12:25:57 2010 @@ -13,7 +13,10 @@ #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/BasicBlock.h" +#include "llvm/CodeGen/LiveVariables.h" +#include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/Target/TargetRegisterInfo.h" @@ -396,6 +399,82 @@ return FBB == 0; } +MachineBasicBlock * +MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) { + MachineFunction *MF = getParent(); + DebugLoc dl; // FIXME: this is nowhere + + // We may need to update this's terminator, but we can't do that if AnalyzeBranch + // fails. If this uses a jump table, we won't touch it. + const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); + MachineBasicBlock *TBB = 0, *FBB = 0; + SmallVector Cond; + if (TII->AnalyzeBranch(*this, TBB, FBB, Cond)) + return NULL; + + MachineBasicBlock *NMBB = MF->CreateMachineBasicBlock(); + MF->insert(llvm::next(MachineFunction::iterator(this)), NMBB); + DEBUG(dbgs() << "PHIElimination splitting critical edge:" + " BB#" << getNumber() + << " -- BB#" << NMBB->getNumber() + << " -- BB#" << Succ->getNumber() << '\n'); + + ReplaceUsesOfBlockWith(Succ, NMBB); + updateTerminator(); + + // Insert unconditional "jump Succ" instruction in NMBB if necessary. + NMBB->addSuccessor(Succ); + if (!NMBB->isLayoutSuccessor(Succ)) { + Cond.clear(); + MF->getTarget().getInstrInfo()->InsertBranch(*NMBB, Succ, NULL, Cond, dl); + } + + // Fix PHI nodes in Succ so they refer to NMBB instead of this + for (MachineBasicBlock::iterator i = Succ->begin(), e = Succ->end(); + i != e && i->isPHI(); ++i) + for (unsigned ni = 1, ne = i->getNumOperands(); ni != ne; ni += 2) + if (i->getOperand(ni+1).getMBB() == this) + i->getOperand(ni+1).setMBB(NMBB); + + if (LiveVariables *LV = + P->getAnalysisIfAvailable()) + LV->addNewBlock(NMBB, this, Succ); + + if (MachineDominatorTree *MDT = + P->getAnalysisIfAvailable()) + MDT->addNewBlock(NMBB, this); + + if (MachineLoopInfo *MLI = + P->getAnalysisIfAvailable()) + if (MachineLoop *TIL = MLI->getLoopFor(this)) { + // If one or the other blocks were not in a loop, the new block is not + // either, and thus LI doesn't need to be updated. + if (MachineLoop *DestLoop = MLI->getLoopFor(Succ)) { + if (TIL == DestLoop) { + // Both in the same loop, the NMBB joins loop. + DestLoop->addBasicBlockToLoop(NMBB, MLI->getBase()); + } else if (TIL->contains(DestLoop)) { + // Edge from an outer loop to an inner loop. Add to the outer loop. + TIL->addBasicBlockToLoop(NMBB, MLI->getBase()); + } else if (DestLoop->contains(TIL)) { + // Edge from an inner loop to an outer loop. Add to the outer loop. + DestLoop->addBasicBlockToLoop(NMBB, MLI->getBase()); + } else { + // Edge from two loops with no containment relation. Because these + // are natural loops, we know that the destination block must be the + // header of its loop (adding a branch into a loop elsewhere would + // create an irreducible loop). + assert(DestLoop->getHeader() == Succ && + "Should not create irreducible loops!"); + if (MachineLoop *P = DestLoop->getParentLoop()) + P->addBasicBlockToLoop(NMBB, MLI->getBase()); + } + } + } + + return NMBB; +} + /// removeFromParent - This method unlinks 'this' from the containing function, /// and returns it, but does not delete it. MachineBasicBlock *MachineBasicBlock::removeFromParent() { Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=106555&r1=106554&r2=106555&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Tue Jun 22 12:25:57 2010 @@ -83,7 +83,6 @@ const char *getPassName() const { return "Machine Instruction LICM"; } - // FIXME: Loop preheaders? virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesCFG(); AU.addRequired(); @@ -182,6 +181,10 @@ /// current loop preheader that may become duplicates of instructions that /// are hoisted out of the loop. void InitCSEMap(MachineBasicBlock *BB); + + /// getCurPreheader - Get the preheader for the current loop, splitting + /// a critical edge if needed. + MachineBasicBlock *getCurPreheader(); }; } // end anonymous namespace @@ -193,11 +196,11 @@ return new MachineLICM(PreRegAlloc); } -/// LoopIsOuterMostWithPreheader - Test if the given loop is the outer-most -/// loop that has a preheader. -static bool LoopIsOuterMostWithPreheader(MachineLoop *CurLoop) { +/// LoopIsOuterMostWithPredecessor - Test if the given loop is the outer-most +/// loop that has a unique predecessor. +static bool LoopIsOuterMostWithPredecessor(MachineLoop *CurLoop) { for (MachineLoop *L = CurLoop->getParentLoop(); L; L = L->getParentLoop()) - if (L->getLoopPreheader()) + if (L->getLoopPredecessor()) return false; return true; } @@ -223,20 +226,11 @@ for (MachineLoopInfo::iterator I = MLI->begin(), E = MLI->end(); I != E; ++I){ CurLoop = *I; + CurPreheader = 0; // If this is done before regalloc, only visit outer-most preheader-sporting // loops. - if (PreRegAlloc && !LoopIsOuterMostWithPreheader(CurLoop)) - continue; - - // Determine the block to which to hoist instructions. If we can't find a - // suitable loop preheader, we can't do any hoisting. - // - // FIXME: We are only hoisting if the basic block coming into this loop - // has only one successor. This isn't the case in general because we haven't - // broken critical edges or added preheaders. - CurPreheader = CurLoop->getLoopPreheader(); - if (!CurPreheader) + if (PreRegAlloc && !LoopIsOuterMostWithPredecessor(CurLoop)) continue; if (!PreRegAlloc) @@ -438,13 +432,16 @@ /// operands that is safe to hoist, this instruction is called to do the /// dirty work. void MachineLICM::HoistPostRA(MachineInstr *MI, unsigned Def) { + MachineBasicBlock *Preheader = getCurPreheader(); + if (!Preheader) return; + // Now move the instructions to the predecessor, inserting it before any // terminator instructions. DEBUG({ dbgs() << "Hoisting " << *MI; - if (CurPreheader->getBasicBlock()) + if (Preheader->getBasicBlock()) dbgs() << " to MachineBasicBlock " - << CurPreheader->getName(); + << Preheader->getName(); if (MI->getParent()->getBasicBlock()) dbgs() << " from MachineBasicBlock " << MI->getParent()->getName(); @@ -453,7 +450,7 @@ // Splice the instruction to the preheader. MachineBasicBlock *MBB = MI->getParent(); - CurPreheader->splice(CurPreheader->getFirstTerminator(), MBB, MI); + Preheader->splice(Preheader->getFirstTerminator(), MBB, MI); // Add register to livein list to all the BBs in the current loop since a // loop invariant must be kept live throughout the whole loop. This is @@ -756,6 +753,9 @@ /// that are safe to hoist, this instruction is called to do the dirty work. /// void MachineLICM::Hoist(MachineInstr *MI) { + MachineBasicBlock *Preheader = getCurPreheader(); + if (!Preheader) return; + // First check whether we should hoist this instruction. if (!IsLoopInvariantInst(*MI) || !IsProfitableToHoist(*MI)) { // If not, try unfolding a hoistable load. @@ -767,9 +767,9 @@ // terminator instructions. DEBUG({ dbgs() << "Hoisting " << *MI; - if (CurPreheader->getBasicBlock()) + if (Preheader->getBasicBlock()) dbgs() << " to MachineBasicBlock " - << CurPreheader->getName(); + << Preheader->getName(); if (MI->getParent()->getBasicBlock()) dbgs() << " from MachineBasicBlock " << MI->getParent()->getName(); @@ -779,7 +779,7 @@ // If this is the first instruction being hoisted to the preheader, // initialize the CSE map with potential common expressions. if (FirstInLoop) { - InitCSEMap(CurPreheader); + InitCSEMap(Preheader); FirstInLoop = false; } @@ -789,7 +789,7 @@ CI = CSEMap.find(Opcode); if (!EliminateCSE(MI, CI)) { // Otherwise, splice the instruction to the preheader. - CurPreheader->splice(CurPreheader->getFirstTerminator(),MI->getParent(),MI); + Preheader->splice(Preheader->getFirstTerminator(),MI->getParent(),MI); // Clear the kill flags of any register this instruction defines, // since they may need to be live throughout the entire loop @@ -813,3 +813,30 @@ ++NumHoisted; Changed = true; } + +MachineBasicBlock *MachineLICM::getCurPreheader() { + // Determine the block to which to hoist instructions. If we can't find a + // suitable loop predecessor, we can't do any hoisting. + + // If we've tried to get a preheader and failed, don't try again. + if (CurPreheader == reinterpret_cast(-1)) + return 0; + + if (!CurPreheader) { + CurPreheader = CurLoop->getLoopPreheader(); + if (!CurPreheader) { + MachineBasicBlock *Pred = CurLoop->getLoopPredecessor(); + if (!Pred) { + CurPreheader = reinterpret_cast(-1); + return 0; + } + + CurPreheader = Pred->SplitCriticalEdge(CurLoop->getHeader(), this); + if (!CurPreheader) { + CurPreheader = reinterpret_cast(-1); + return 0; + } + } + } + return CurPreheader; +} Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=106555&r1=106554&r2=106555&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Tue Jun 22 12:25:57 2010 @@ -34,7 +34,6 @@ using namespace llvm; STATISTIC(NumAtomic, "Number of atomic phis lowered"); -STATISTIC(NumSplits, "Number of critical edges split on demand"); STATISTIC(NumReused, "Number of reused lowered phis"); char PHIElimination::ID = 0; @@ -391,58 +390,8 @@ // (not considering PHI nodes). If the register is live in to this block // anyway, we would gain nothing from splitting. if (!LV.isLiveIn(Reg, MBB) && LV.isLiveOut(Reg, *PreMBB)) - SplitCriticalEdge(PreMBB, &MBB); + PreMBB->SplitCriticalEdge(&MBB, this); } } return true; } - -MachineBasicBlock *PHIElimination::SplitCriticalEdge(MachineBasicBlock *A, - MachineBasicBlock *B) { - assert(A && B && "Missing MBB end point"); - - MachineFunction *MF = A->getParent(); - DebugLoc dl; // FIXME: this is nowhere - - // We may need to update A's terminator, but we can't do that if AnalyzeBranch - // fails. If A uses a jump table, we won't touch it. - const TargetInstrInfo *TII = MF->getTarget().getInstrInfo(); - MachineBasicBlock *TBB = 0, *FBB = 0; - SmallVector Cond; - if (TII->AnalyzeBranch(*A, TBB, FBB, Cond)) - return NULL; - - ++NumSplits; - - MachineBasicBlock *NMBB = MF->CreateMachineBasicBlock(); - MF->insert(llvm::next(MachineFunction::iterator(A)), NMBB); - DEBUG(dbgs() << "PHIElimination splitting critical edge:" - " BB#" << A->getNumber() - << " -- BB#" << NMBB->getNumber() - << " -- BB#" << B->getNumber() << '\n'); - - A->ReplaceUsesOfBlockWith(B, NMBB); - A->updateTerminator(); - - // Insert unconditional "jump B" instruction in NMBB if necessary. - NMBB->addSuccessor(B); - if (!NMBB->isLayoutSuccessor(B)) { - Cond.clear(); - MF->getTarget().getInstrInfo()->InsertBranch(*NMBB, B, NULL, Cond, dl); - } - - // Fix PHI nodes in B so they refer to NMBB instead of A - for (MachineBasicBlock::iterator i = B->begin(), e = B->end(); - i != e && i->isPHI(); ++i) - for (unsigned ni = 1, ne = i->getNumOperands(); ni != ne; ni += 2) - if (i->getOperand(ni+1).getMBB() == A) - i->getOperand(ni+1).setMBB(NMBB); - - if (LiveVariables *LV=getAnalysisIfAvailable()) - LV->addNewBlock(NMBB, A, B); - - if (MachineDominatorTree *MDT=getAnalysisIfAvailable()) - MDT->addNewBlock(NMBB, A); - - return NMBB; -} From bruno.cardoso at gmail.com Tue Jun 22 13:09:33 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 22 Jun 2010 18:09:33 -0000 Subject: [llvm-commits] [llvm] r106556 - /llvm/trunk/lib/Target/X86/X86InstrSSE.td Message-ID: <20100622180933.1F04F2A6C12C@llvm.org> Author: bruno Date: Tue Jun 22 13:09:32 2010 New Revision: 106556 URL: http://llvm.org/viewvc/llvm-project?rev=106556&view=rev Log: Reorganize SSE instructions, making easier to see oportunities for refactoring Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106556&r1=106555&r2=106556&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jun 22 13:09:32 2010 @@ -448,55 +448,145 @@ // SSE1 Instructions //===----------------------------------------------------------------------===// -// Move Instructions. Register-to-register movss is not used for FR32 -// register copies because it's a partial register update; FsMOVAPSrr is -// used instead. Register-to-register movss is not modeled as an INSERT_SUBREG -// because INSERT_SUBREG requires that the insert be implementable in terms of -// a copy, and just mentioned, we don't use movss for copies. -let Constraints = "$src1 = $dst" in +// Conversion Instructions + +// Match intrinsics which expect XMM operand(s). +def CVTSS2SIrr: SSI<0x2D, MRMSrcReg, (outs GR32:$dst), (ins FR32:$src), + "cvtss2si{l}\t{$src, $dst|$dst, $src}", []>; +def CVTSS2SIrm: SSI<0x2D, MRMSrcMem, (outs GR32:$dst), (ins f32mem:$src), + "cvtss2si{l}\t{$src, $dst|$dst, $src}", []>; + +def CVTDQ2PSrr : PSI<0x5B, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src), + "cvtdq2ps\t{$src, $dst|$dst, $src}", []>; +def CVTDQ2PSrm : PSI<0x5B, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src), + "cvtdq2ps\t{$src, $dst|$dst, $src}", []>; + +// Aliases for intrinsics +def Int_CVTTSS2SIrr : SSI<0x2C, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src), + "cvttss2si\t{$src, $dst|$dst, $src}", + [(set GR32:$dst, + (int_x86_sse_cvttss2si VR128:$src))]>; +def Int_CVTTSS2SIrm : SSI<0x2C, MRMSrcMem, (outs GR32:$dst), (ins f32mem:$src), + "cvttss2si\t{$src, $dst|$dst, $src}", + [(set GR32:$dst, + (int_x86_sse_cvttss2si(load addr:$src)))]>; + +let Constraints = "$src1 = $dst" in { + def Int_CVTSI2SSrr : SSI<0x2A, MRMSrcReg, + (outs VR128:$dst), (ins VR128:$src1, GR32:$src2), + "cvtsi2ss\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (int_x86_sse_cvtsi2ss VR128:$src1, + GR32:$src2))]>; + def Int_CVTSI2SSrm : SSI<0x2A, MRMSrcMem, + (outs VR128:$dst), (ins VR128:$src1, i32mem:$src2), + "cvtsi2ss\t{$src2, $dst|$dst, $src2}", + [(set VR128:$dst, (int_x86_sse_cvtsi2ss VR128:$src1, + (loadi32 addr:$src2)))]>; +} + +// Compare Instructions +let Defs = [EFLAGS] in { +def COMISSrr: PSI<0x2F, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2), + "comiss\t{$src2, $src1|$src1, $src2}", []>; +def COMISSrm: PSI<0x2F, MRMSrcMem, (outs), (ins VR128:$src1, f128mem:$src2), + "comiss\t{$src2, $src1|$src1, $src2}", []>; +} // Defs = [EFLAGS] + +//===----------------------------------------------------------------------===// +// SSE 1 & 2 - Move Instructions +//===----------------------------------------------------------------------===// + +// Move Instructions. Register-to-register movss/movsd is not used for FR32/64 +// register copies because it's a partial register update; FsMOVAPSrr/FsMOVAPDrr +// is used instead. Register-to-register movss/movsd is not modeled as an +// INSERT_SUBREG because INSERT_SUBREG requires that the insert be implementable +// in terms of a copy, and just mentioned, we don't use movss/movsd for copies. +let Constraints = "$src1 = $dst" in { def MOVSSrr : SSI<0x10, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, FR32:$src2), "movss\t{$src2, $dst|$dst, $src2}", [(set (v4f32 VR128:$dst), (movl VR128:$src1, (scalar_to_vector FR32:$src2)))]>; +def MOVSDrr : SDI<0x10, MRMSrcReg, + (outs VR128:$dst), (ins VR128:$src1, FR64:$src2), + "movsd\t{$src2, $dst|$dst, $src2}", + [(set (v2f64 VR128:$dst), + (movl VR128:$src1, (scalar_to_vector FR64:$src2)))]>; +} + +// Loading from memory automatically zeroing upper bits. +let canFoldAsLoad = 1, isReMaterializable = 1 in { +def MOVSSrm : SSI<0x10, MRMSrcMem, (outs FR32:$dst), (ins f32mem:$src), + "movss\t{$src, $dst|$dst, $src}", + [(set FR32:$dst, (loadf32 addr:$src))]>; +let AddedComplexity = 20 in +def MOVSDrm : SDI<0x10, MRMSrcMem, (outs FR64:$dst), (ins f64mem:$src), + "movsd\t{$src, $dst|$dst, $src}", + [(set FR64:$dst, (loadf64 addr:$src))]>; +} +let AddedComplexity = 15 in { // Extract the low 32-bit value from one vector and insert it into another. -let AddedComplexity = 15 in def : Pat<(v4f32 (movl VR128:$src1, VR128:$src2)), (MOVSSrr (v4f32 VR128:$src1), (EXTRACT_SUBREG (v4f32 VR128:$src2), sub_ss))>; +// Extract the low 64-bit value from one vector and insert it into another. +def : Pat<(v2f64 (movl VR128:$src1, VR128:$src2)), + (MOVSDrr (v2f64 VR128:$src1), + (EXTRACT_SUBREG (v2f64 VR128:$src2), sub_sd))>; +} // Implicitly promote a 32-bit scalar to a vector. def : Pat<(v4f32 (scalar_to_vector FR32:$src)), (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), FR32:$src, sub_ss)>; +// Implicitly promote a 64-bit scalar to a vector. +def : Pat<(v2f64 (scalar_to_vector FR64:$src)), + (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), FR64:$src, sub_sd)>; -// Loading from memory automatically zeroing upper bits. -let canFoldAsLoad = 1, isReMaterializable = 1 in -def MOVSSrm : SSI<0x10, MRMSrcMem, (outs FR32:$dst), (ins f32mem:$src), - "movss\t{$src, $dst|$dst, $src}", - [(set FR32:$dst, (loadf32 addr:$src))]>; - +let AddedComplexity = 20 in { // MOVSSrm zeros the high parts of the register; represent this // with SUBREG_TO_REG. -let AddedComplexity = 20 in { def : Pat<(v4f32 (X86vzmovl (v4f32 (scalar_to_vector (loadf32 addr:$src))))), (SUBREG_TO_REG (i32 0), (MOVSSrm addr:$src), sub_ss)>; def : Pat<(v4f32 (scalar_to_vector (loadf32 addr:$src))), (SUBREG_TO_REG (i32 0), (MOVSSrm addr:$src), sub_ss)>; def : Pat<(v4f32 (X86vzmovl (loadv4f32 addr:$src))), (SUBREG_TO_REG (i32 0), (MOVSSrm addr:$src), sub_ss)>; +// MOVSDrm zeros the high parts of the register; represent this +// with SUBREG_TO_REG. +def : Pat<(v2f64 (X86vzmovl (v2f64 (scalar_to_vector (loadf64 addr:$src))))), + (SUBREG_TO_REG (i64 0), (MOVSDrm addr:$src), sub_sd)>; +def : Pat<(v2f64 (scalar_to_vector (loadf64 addr:$src))), + (SUBREG_TO_REG (i64 0), (MOVSDrm addr:$src), sub_sd)>; +def : Pat<(v2f64 (X86vzmovl (loadv2f64 addr:$src))), + (SUBREG_TO_REG (i64 0), (MOVSDrm addr:$src), sub_sd)>; +def : Pat<(v2f64 (X86vzmovl (bc_v2f64 (loadv4f32 addr:$src)))), + (SUBREG_TO_REG (i64 0), (MOVSDrm addr:$src), sub_sd)>; +def : Pat<(v2f64 (X86vzload addr:$src)), + (SUBREG_TO_REG (i64 0), (MOVSDrm addr:$src), sub_sd)>; } // Store scalar value to memory. def MOVSSmr : SSI<0x11, MRMDestMem, (outs), (ins f32mem:$dst, FR32:$src), "movss\t{$src, $dst|$dst, $src}", [(store FR32:$src, addr:$dst)]>; +def MOVSDmr : SDI<0x11, MRMDestMem, (outs), (ins f64mem:$dst, FR64:$src), + "movsd\t{$src, $dst|$dst, $src}", + [(store FR64:$src, addr:$dst)]>; // Extract and store. def : Pat<(store (f32 (vector_extract (v4f32 VR128:$src), (iPTR 0))), addr:$dst), (MOVSSmr addr:$dst, (EXTRACT_SUBREG (v4f32 VR128:$src), sub_ss))>; +def : Pat<(store (f64 (vector_extract (v2f64 VR128:$src), (iPTR 0))), + addr:$dst), + (MOVSDmr addr:$dst, + (EXTRACT_SUBREG (v2f64 VR128:$src), sub_sd))>; + +//===----------------------------------------------------------------------===// +// SSE 1 & 2 - Conversion Instructions +//===----------------------------------------------------------------------===// // Conversion instructions def CVTTSS2SIrr : SSI<0x2C, MRMSrcReg, (outs GR32:$dst), (ins FR32:$src), @@ -505,19 +595,27 @@ def CVTTSS2SIrm : SSI<0x2C, MRMSrcMem, (outs GR32:$dst), (ins f32mem:$src), "cvttss2si\t{$src, $dst|$dst, $src}", [(set GR32:$dst, (fp_to_sint (loadf32 addr:$src)))]>; +def CVTTSD2SIrr : SDI<0x2C, MRMSrcReg, (outs GR32:$dst), (ins FR64:$src), + "cvttsd2si\t{$src, $dst|$dst, $src}", + [(set GR32:$dst, (fp_to_sint FR64:$src))]>; +def CVTTSD2SIrm : SDI<0x2C, MRMSrcMem, (outs GR32:$dst), (ins f64mem:$src), + "cvttsd2si\t{$src, $dst|$dst, $src}", + [(set GR32:$dst, (fp_to_sint (loadf64 addr:$src)))]>; + def CVTSI2SSrr : SSI<0x2A, MRMSrcReg, (outs FR32:$dst), (ins GR32:$src), "cvtsi2ss\t{$src, $dst|$dst, $src}", [(set FR32:$dst, (sint_to_fp GR32:$src))]>; def CVTSI2SSrm : SSI<0x2A, MRMSrcMem, (outs FR32:$dst), (ins i32mem:$src), "cvtsi2ss\t{$src, $dst|$dst, $src}", [(set FR32:$dst, (sint_to_fp (loadi32 addr:$src)))]>; +def CVTSI2SDrr : SDI<0x2A, MRMSrcReg, (outs FR64:$dst), (ins GR32:$src), + "cvtsi2sd\t{$src, $dst|$dst, $src}", + [(set FR64:$dst, (sint_to_fp GR32:$src))]>; +def CVTSI2SDrm : SDI<0x2A, MRMSrcMem, (outs FR64:$dst), (ins i32mem:$src), + "cvtsi2sd\t{$src, $dst|$dst, $src}", + [(set FR64:$dst, (sint_to_fp (loadi32 addr:$src)))]>; // Match intrinsics which expect XMM operand(s). -def CVTSS2SIrr: SSI<0x2D, MRMSrcReg, (outs GR32:$dst), (ins FR32:$src), - "cvtss2si{l}\t{$src, $dst|$dst, $src}", []>; -def CVTSS2SIrm: SSI<0x2D, MRMSrcMem, (outs GR32:$dst), (ins f32mem:$src), - "cvtss2si{l}\t{$src, $dst|$dst, $src}", []>; - def Int_CVTSS2SIrr : SSI<0x2D, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src), "cvtss2si\t{$src, $dst|$dst, $src}", [(set GR32:$dst, (int_x86_sse_cvtss2si VR128:$src))]>; @@ -525,6 +623,13 @@ "cvtss2si\t{$src, $dst|$dst, $src}", [(set GR32:$dst, (int_x86_sse_cvtss2si (load addr:$src)))]>; +def Int_CVTSD2SIrr : SDI<0x2D, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src), + "cvtsd2si\t{$src, $dst|$dst, $src}", + [(set GR32:$dst, (int_x86_sse2_cvtsd2si VR128:$src))]>; +def Int_CVTSD2SIrm : SDI<0x2D, MRMSrcMem, (outs GR32:$dst), (ins f128mem:$src), + "cvtsd2si\t{$src, $dst|$dst, $src}", + [(set GR32:$dst, (int_x86_sse2_cvtsd2si + (load addr:$src)))]>; // Match intrinsics which expect MM and XMM operand(s). def Int_CVTPS2PIrr : PSI<0x2D, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src), @@ -534,6 +639,15 @@ "cvtps2pi\t{$src, $dst|$dst, $src}", [(set VR64:$dst, (int_x86_sse_cvtps2pi (load addr:$src)))]>; +def Int_CVTPD2PIrr : PDI<0x2D, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src), + "cvtpd2pi\t{$src, $dst|$dst, $src}", + [(set VR64:$dst, (int_x86_sse_cvtpd2pi VR128:$src))]>; +def Int_CVTPD2PIrm : PDI<0x2D, MRMSrcMem, (outs VR64:$dst), (ins f128mem:$src), + "cvtpd2pi\t{$src, $dst|$dst, $src}", + [(set VR64:$dst, (int_x86_sse_cvtpd2pi + (memop addr:$src)))]>; + +// Match intrinsics which expect MM and XMM operand(s). def Int_CVTTPS2PIrr: PSI<0x2C, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src), "cvttps2pi\t{$src, $dst|$dst, $src}", [(set VR64:$dst, (int_x86_sse_cvttps2pi VR128:$src))]>; @@ -541,6 +655,14 @@ "cvttps2pi\t{$src, $dst|$dst, $src}", [(set VR64:$dst, (int_x86_sse_cvttps2pi (load addr:$src)))]>; +def Int_CVTTPD2PIrr: PDI<0x2C, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src), + "cvttpd2pi\t{$src, $dst|$dst, $src}", + [(set VR64:$dst, (int_x86_sse_cvttpd2pi VR128:$src))]>; +def Int_CVTTPD2PIrm: PDI<0x2C, MRMSrcMem, (outs VR64:$dst), (ins f128mem:$src), + "cvttpd2pi\t{$src, $dst|$dst, $src}", + [(set VR64:$dst, (int_x86_sse_cvttpd2pi + (memop addr:$src)))]>; + let Constraints = "$src1 = $dst" in { def Int_CVTPI2PSrr : PSI<0x2A, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR64:$src2), @@ -554,48 +676,45 @@ (load addr:$src2)))]>; } -// Aliases for intrinsics -def Int_CVTTSS2SIrr : SSI<0x2C, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src), - "cvttss2si\t{$src, $dst|$dst, $src}", - [(set GR32:$dst, - (int_x86_sse_cvttss2si VR128:$src))]>; -def Int_CVTTSS2SIrm : SSI<0x2C, MRMSrcMem, (outs GR32:$dst), (ins f32mem:$src), - "cvttss2si\t{$src, $dst|$dst, $src}", - [(set GR32:$dst, - (int_x86_sse_cvttss2si(load addr:$src)))]>; - -let Constraints = "$src1 = $dst" in { - def Int_CVTSI2SSrr : SSI<0x2A, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, GR32:$src2), - "cvtsi2ss\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (int_x86_sse_cvtsi2ss VR128:$src1, - GR32:$src2))]>; - def Int_CVTSI2SSrm : SSI<0x2A, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, i32mem:$src2), - "cvtsi2ss\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, (int_x86_sse_cvtsi2ss VR128:$src1, - (loadi32 addr:$src2)))]>; -} +//===----------------------------------------------------------------------===// +// SSE 1 & 2 - Compare Instructions +//===----------------------------------------------------------------------===// // Comparison instructions let Constraints = "$src1 = $dst", neverHasSideEffects = 1 in { def CMPSSrr : SSIi8<0xC2, MRMSrcReg, (outs FR32:$dst), (ins FR32:$src1, FR32:$src, SSECC:$cc), "cmp${cc}ss\t{$src, $dst|$dst, $src}", []>; -let mayLoad = 1 in + let mayLoad = 1 in def CMPSSrm : SSIi8<0xC2, MRMSrcMem, (outs FR32:$dst), (ins FR32:$src1, f32mem:$src, SSECC:$cc), "cmp${cc}ss\t{$src, $dst|$dst, $src}", []>; - // Accept explicit immediate argument form instead of comparison code. + def CMPSDrr : SDIi8<0xC2, MRMSrcReg, + (outs FR64:$dst), (ins FR64:$src1, FR64:$src, SSECC:$cc), + "cmp${cc}sd\t{$src, $dst|$dst, $src}", []>; + let mayLoad = 1 in + def CMPSDrm : SDIi8<0xC2, MRMSrcMem, + (outs FR64:$dst), (ins FR64:$src1, f64mem:$src, SSECC:$cc), + "cmp${cc}sd\t{$src, $dst|$dst, $src}", []>; + +// Accept explicit immediate argument form instead of comparison code. let isAsmParserOnly = 1 in { def CMPSSrr_alt : SSIi8<0xC2, MRMSrcReg, (outs FR32:$dst), (ins FR32:$src1, FR32:$src, i8imm:$src2), "cmpss\t{$src2, $src, $dst|$dst, $src, $src2}", []>; -let mayLoad = 1 in + let mayLoad = 1 in def CMPSSrm_alt : SSIi8<0xC2, MRMSrcMem, (outs FR32:$dst), (ins FR32:$src1, f32mem:$src, i8imm:$src2), "cmpss\t{$src2, $src, $dst|$dst, $src, $src2}", []>; + + def CMPSDrr_alt : SDIi8<0xC2, MRMSrcReg, + (outs FR64:$dst), (ins FR64:$src1, FR64:$src, i8imm:$src2), + "cmpsd\t{$src2, $src, $dst|$dst, $src, $src2}", []>; + let mayLoad = 1 in + def CMPSDrm_alt : SDIi8<0xC2, MRMSrcMem, + (outs FR64:$dst), (ins FR64:$src1, f64mem:$src, i8imm:$src2), + "cmpsd\t{$src2, $src, $dst|$dst, $src, $src2}", []>; } } @@ -606,12 +725,12 @@ def UCOMISSrm: PSI<0x2E, MRMSrcMem, (outs), (ins FR32:$src1, f32mem:$src2), "ucomiss\t{$src2, $src1|$src1, $src2}", [(set EFLAGS, (X86cmp FR32:$src1, (loadf32 addr:$src2)))]>; - -def COMISSrr: PSI<0x2F, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2), - "comiss\t{$src2, $src1|$src1, $src2}", []>; -def COMISSrm: PSI<0x2F, MRMSrcMem, (outs), (ins VR128:$src1, f128mem:$src2), - "comiss\t{$src2, $src1|$src1, $src2}", []>; - +def UCOMISDrr: PDI<0x2E, MRMSrcReg, (outs), (ins FR64:$src1, FR64:$src2), + "ucomisd\t{$src2, $src1|$src1, $src2}", + [(set EFLAGS, (X86cmp FR64:$src1, FR64:$src2))]>; +def UCOMISDrm: PDI<0x2E, MRMSrcMem, (outs), (ins FR64:$src1, f64mem:$src2), + "ucomisd\t{$src2, $src1|$src1, $src2}", + [(set EFLAGS, (X86cmp FR64:$src1, (loadf64 addr:$src2)))]>; } // Defs = [EFLAGS] // Aliases to match intrinsics which expect XMM operand(s). @@ -629,6 +748,19 @@ "cmp${cc}ss\t{$src, $dst|$dst, $src}", [(set VR128:$dst, (int_x86_sse_cmp_ss VR128:$src1, (load addr:$src), imm:$cc))]>; + + def Int_CMPSDrr : SDIi8<0xC2, MRMSrcReg, + (outs VR128:$dst), + (ins VR128:$src1, VR128:$src, SSECC:$cc), + "cmp${cc}sd\t{$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse2_cmp_sd VR128:$src1, + VR128:$src, imm:$cc))]>; + def Int_CMPSDrm : SDIi8<0xC2, MRMSrcMem, + (outs VR128:$dst), + (ins VR128:$src1, f64mem:$src, SSECC:$cc), + "cmp${cc}sd\t{$src, $dst|$dst, $src}", + [(set VR128:$dst, (int_x86_sse2_cmp_sd VR128:$src1, + (load addr:$src), imm:$cc))]>; } let Defs = [EFLAGS] in { @@ -640,6 +772,14 @@ "ucomiss\t{$src2, $src1|$src1, $src2}", [(set EFLAGS, (X86ucomi (v4f32 VR128:$src1), (load addr:$src2)))]>; +def Int_UCOMISDrr: PDI<0x2E, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2), + "ucomisd\t{$src2, $src1|$src1, $src2}", + [(set EFLAGS, (X86ucomi (v2f64 VR128:$src1), + VR128:$src2))]>; +def Int_UCOMISDrm: PDI<0x2E, MRMSrcMem, (outs),(ins VR128:$src1, f128mem:$src2), + "ucomisd\t{$src2, $src1|$src1, $src2}", + [(set EFLAGS, (X86ucomi (v2f64 VR128:$src1), + (load addr:$src2)))]>; def Int_COMISSrr: PSI<0x2F, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2), "comiss\t{$src2, $src1|$src1, $src2}", @@ -649,31 +789,50 @@ "comiss\t{$src2, $src1|$src1, $src2}", [(set EFLAGS, (X86comi (v4f32 VR128:$src1), (load addr:$src2)))]>; +def Int_COMISDrr: PDI<0x2F, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2), + "comisd\t{$src2, $src1|$src1, $src2}", + [(set EFLAGS, (X86comi (v2f64 VR128:$src1), + VR128:$src2))]>; +def Int_COMISDrm: PDI<0x2F, MRMSrcMem, (outs), (ins VR128:$src1, f128mem:$src2), + "comisd\t{$src2, $src1|$src1, $src2}", + [(set EFLAGS, (X86comi (v2f64 VR128:$src1), + (load addr:$src2)))]>; } // Defs = [EFLAGS] -// Aliases of packed SSE1 instructions for scalar use. These all have names -// that start with 'Fs'. +// Aliases of packed SSE1 & SSE2 instructions for scalar use. These all have +// names that start with 'Fs'. // Alias instructions that map fld0 to pxor for sse. let isReMaterializable = 1, isAsCheapAsAMove = 1, isCodeGenOnly = 1, - canFoldAsLoad = 1 in + canFoldAsLoad = 1 in { // FIXME: Set encoding to pseudo! def FsFLD0SS : I<0xEF, MRMInitReg, (outs FR32:$dst), (ins), "", [(set FR32:$dst, fp32imm0)]>, Requires<[HasSSE1]>, TB, OpSize; +def FsFLD0SD : I<0xEF, MRMInitReg, (outs FR64:$dst), (ins), "", + [(set FR64:$dst, fpimm0)]>, + Requires<[HasSSE2]>, TB, OpSize; +} -// Alias instruction to do FR32 reg-to-reg copy using movaps. Upper bits are -// disregarded. -let neverHasSideEffects = 1 in +// Alias instruction to do FR32 or FR64 reg-to-reg copy using movaps. Upper +// bits are disregarded. +let neverHasSideEffects = 1 in { def FsMOVAPSrr : PSI<0x28, MRMSrcReg, (outs FR32:$dst), (ins FR32:$src), "movaps\t{$src, $dst|$dst, $src}", []>; +def FsMOVAPDrr : PDI<0x28, MRMSrcReg, (outs FR64:$dst), (ins FR64:$src), + "movapd\t{$src, $dst|$dst, $src}", []>; +} -// Alias instruction to load FR32 from f128mem using movaps. Upper bits are -// disregarded. -let canFoldAsLoad = 1, isReMaterializable = 1 in +// Alias instruction to load FR32 or FR64 from f128mem using movaps. Upper +// bits are disregarded. +let canFoldAsLoad = 1, isReMaterializable = 1 in { def FsMOVAPSrm : PSI<0x28, MRMSrcMem, (outs FR32:$dst), (ins f128mem:$src), "movaps\t{$src, $dst|$dst, $src}", [(set FR32:$dst, (alignedloadfsf32 addr:$src))]>; +def FsMOVAPDrm : PDI<0x28, MRMSrcMem, (outs FR64:$dst), (ins f128mem:$src), + "movapd\t{$src, $dst|$dst, $src}", + [(set FR64:$dst, (alignedloadfsf64 addr:$src))]>; +} /// sse12_fp_alias_pack_logical - SSE 1 & 2 aliased packed FP logical ops /// @@ -1327,67 +1486,7 @@ // SSE2 Instructions //===---------------------------------------------------------------------===// -// Move Instructions. Register-to-register movsd is not used for FR64 -// register copies because it's a partial register update; FsMOVAPDrr is -// used instead. Register-to-register movsd is not modeled as an INSERT_SUBREG -// because INSERT_SUBREG requires that the insert be implementable in terms of -// a copy, and just mentioned, we don't use movsd for copies. -let Constraints = "$src1 = $dst" in -def MOVSDrr : SDI<0x10, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, FR64:$src2), - "movsd\t{$src2, $dst|$dst, $src2}", - [(set (v2f64 VR128:$dst), - (movl VR128:$src1, (scalar_to_vector FR64:$src2)))]>; - -// Extract the low 64-bit value from one vector and insert it into another. -let AddedComplexity = 15 in -def : Pat<(v2f64 (movl VR128:$src1, VR128:$src2)), - (MOVSDrr (v2f64 VR128:$src1), - (EXTRACT_SUBREG (v2f64 VR128:$src2), sub_sd))>; - -// Implicitly promote a 64-bit scalar to a vector. -def : Pat<(v2f64 (scalar_to_vector FR64:$src)), - (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), FR64:$src, sub_sd)>; - -// Loading from memory automatically zeroing upper bits. -let canFoldAsLoad = 1, isReMaterializable = 1, AddedComplexity = 20 in -def MOVSDrm : SDI<0x10, MRMSrcMem, (outs FR64:$dst), (ins f64mem:$src), - "movsd\t{$src, $dst|$dst, $src}", - [(set FR64:$dst, (loadf64 addr:$src))]>; - -// MOVSDrm zeros the high parts of the register; represent this -// with SUBREG_TO_REG. -let AddedComplexity = 20 in { -def : Pat<(v2f64 (X86vzmovl (v2f64 (scalar_to_vector (loadf64 addr:$src))))), - (SUBREG_TO_REG (i64 0), (MOVSDrm addr:$src), sub_sd)>; -def : Pat<(v2f64 (scalar_to_vector (loadf64 addr:$src))), - (SUBREG_TO_REG (i64 0), (MOVSDrm addr:$src), sub_sd)>; -def : Pat<(v2f64 (X86vzmovl (loadv2f64 addr:$src))), - (SUBREG_TO_REG (i64 0), (MOVSDrm addr:$src), sub_sd)>; -def : Pat<(v2f64 (X86vzmovl (bc_v2f64 (loadv4f32 addr:$src)))), - (SUBREG_TO_REG (i64 0), (MOVSDrm addr:$src), sub_sd)>; -def : Pat<(v2f64 (X86vzload addr:$src)), - (SUBREG_TO_REG (i64 0), (MOVSDrm addr:$src), sub_sd)>; -} - -// Store scalar value to memory. -def MOVSDmr : SDI<0x11, MRMDestMem, (outs), (ins f64mem:$dst, FR64:$src), - "movsd\t{$src, $dst|$dst, $src}", - [(store FR64:$src, addr:$dst)]>; - -// Extract and store. -def : Pat<(store (f64 (vector_extract (v2f64 VR128:$src), (iPTR 0))), - addr:$dst), - (MOVSDmr addr:$dst, - (EXTRACT_SUBREG (v2f64 VR128:$src), sub_sd))>; - // Conversion instructions -def CVTTSD2SIrr : SDI<0x2C, MRMSrcReg, (outs GR32:$dst), (ins FR64:$src), - "cvttsd2si\t{$src, $dst|$dst, $src}", - [(set GR32:$dst, (fp_to_sint FR64:$src))]>; -def CVTTSD2SIrm : SDI<0x2C, MRMSrcMem, (outs GR32:$dst), (ins f64mem:$src), - "cvttsd2si\t{$src, $dst|$dst, $src}", - [(set GR32:$dst, (fp_to_sint (loadf64 addr:$src)))]>; def CVTSD2SSrr : SDI<0x5A, MRMSrcReg, (outs FR32:$dst), (ins FR64:$src), "cvtsd2ss\t{$src, $dst|$dst, $src}", [(set FR32:$dst, (fround FR64:$src))]>; @@ -1395,29 +1494,11 @@ "cvtsd2ss\t{$src, $dst|$dst, $src}", [(set FR32:$dst, (fround (loadf64 addr:$src)))]>, XD, Requires<[HasSSE2, OptForSize]>; -def CVTSI2SDrr : SDI<0x2A, MRMSrcReg, (outs FR64:$dst), (ins GR32:$src), - "cvtsi2sd\t{$src, $dst|$dst, $src}", - [(set FR64:$dst, (sint_to_fp GR32:$src))]>; -def CVTSI2SDrm : SDI<0x2A, MRMSrcMem, (outs FR64:$dst), (ins i32mem:$src), - "cvtsi2sd\t{$src, $dst|$dst, $src}", - [(set FR64:$dst, (sint_to_fp (loadi32 addr:$src)))]>; -def CVTPD2DQrm : S3DI<0xE6, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src), - "cvtpd2dq\t{$src, $dst|$dst, $src}", []>; -def CVTPD2DQrr : S3DI<0xE6, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src), - "cvtpd2dq\t{$src, $dst|$dst, $src}", []>; -def CVTDQ2PDrm : S3SI<0xE6, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src), - "cvtdq2pd\t{$src, $dst|$dst, $src}", []>; -def CVTDQ2PDrr : S3SI<0xE6, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src), - "cvtdq2pd\t{$src, $dst|$dst, $src}", []>; def CVTPS2DQrr : PDI<0x5B, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src), "cvtps2dq\t{$src, $dst|$dst, $src}", []>; def CVTPS2DQrm : PDI<0x5B, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src), "cvtps2dq\t{$src, $dst|$dst, $src}", []>; -def CVTDQ2PSrr : PSI<0x5B, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src), - "cvtdq2ps\t{$src, $dst|$dst, $src}", []>; -def CVTDQ2PSrm : PSI<0x5B, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src), - "cvtdq2ps\t{$src, $dst|$dst, $src}", []>; def COMISDrr: PDI<0x2F, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2), "comisd\t{$src2, $src1|$src1, $src2}", []>; def COMISDrm: PDI<0x2F, MRMSrcMem, (outs), (ins VR128:$src1, f128mem:$src2), @@ -1437,30 +1518,7 @@ (CVTSS2SDrr (MOVSSrm addr:$src))>, Requires<[HasSSE2, OptForSpeed]>; -// Match intrinsics which expect XMM operand(s). -def Int_CVTSD2SIrr : SDI<0x2D, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src), - "cvtsd2si\t{$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse2_cvtsd2si VR128:$src))]>; -def Int_CVTSD2SIrm : SDI<0x2D, MRMSrcMem, (outs GR32:$dst), (ins f128mem:$src), - "cvtsd2si\t{$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse2_cvtsd2si - (load addr:$src)))]>; - // Match intrinsics which expect MM and XMM operand(s). -def Int_CVTPD2PIrr : PDI<0x2D, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src), - "cvtpd2pi\t{$src, $dst|$dst, $src}", - [(set VR64:$dst, (int_x86_sse_cvtpd2pi VR128:$src))]>; -def Int_CVTPD2PIrm : PDI<0x2D, MRMSrcMem, (outs VR64:$dst), (ins f128mem:$src), - "cvtpd2pi\t{$src, $dst|$dst, $src}", - [(set VR64:$dst, (int_x86_sse_cvtpd2pi - (memop addr:$src)))]>; -def Int_CVTTPD2PIrr: PDI<0x2C, MRMSrcReg, (outs VR64:$dst), (ins VR128:$src), - "cvttpd2pi\t{$src, $dst|$dst, $src}", - [(set VR64:$dst, (int_x86_sse_cvttpd2pi VR128:$src))]>; -def Int_CVTTPD2PIrm: PDI<0x2C, MRMSrcMem, (outs VR64:$dst), (ins f128mem:$src), - "cvttpd2pi\t{$src, $dst|$dst, $src}", - [(set VR64:$dst, (int_x86_sse_cvttpd2pi - (memop addr:$src)))]>; def Int_CVTPI2PDrr : PDI<0x2A, MRMSrcReg, (outs VR128:$dst), (ins VR64:$src), "cvtpi2pd\t{$src, $dst|$dst, $src}", [(set VR128:$dst, (int_x86_sse_cvtpi2pd VR64:$src))]>; @@ -1479,96 +1537,6 @@ [(set GR32:$dst, (int_x86_sse2_cvttsd2si (load addr:$src)))]>; -// Comparison instructions -let Constraints = "$src1 = $dst", neverHasSideEffects = 1 in { - def CMPSDrr : SDIi8<0xC2, MRMSrcReg, - (outs FR64:$dst), (ins FR64:$src1, FR64:$src, SSECC:$cc), - "cmp${cc}sd\t{$src, $dst|$dst, $src}", []>; -let mayLoad = 1 in - def CMPSDrm : SDIi8<0xC2, MRMSrcMem, - (outs FR64:$dst), (ins FR64:$src1, f64mem:$src, SSECC:$cc), - "cmp${cc}sd\t{$src, $dst|$dst, $src}", []>; - - // Accept explicit immediate argument form instead of comparison code. -let isAsmParserOnly = 1 in { - def CMPSDrr_alt : SDIi8<0xC2, MRMSrcReg, - (outs FR64:$dst), (ins FR64:$src1, FR64:$src, i8imm:$src2), - "cmpsd\t{$src2, $src, $dst|$dst, $src, $src2}", []>; -let mayLoad = 1 in - def CMPSDrm_alt : SDIi8<0xC2, MRMSrcMem, - (outs FR64:$dst), (ins FR64:$src1, f64mem:$src, i8imm:$src2), - "cmpsd\t{$src2, $src, $dst|$dst, $src, $src2}", []>; -} -} - -let Defs = [EFLAGS] in { -def UCOMISDrr: PDI<0x2E, MRMSrcReg, (outs), (ins FR64:$src1, FR64:$src2), - "ucomisd\t{$src2, $src1|$src1, $src2}", - [(set EFLAGS, (X86cmp FR64:$src1, FR64:$src2))]>; -def UCOMISDrm: PDI<0x2E, MRMSrcMem, (outs), (ins FR64:$src1, f64mem:$src2), - "ucomisd\t{$src2, $src1|$src1, $src2}", - [(set EFLAGS, (X86cmp FR64:$src1, (loadf64 addr:$src2)))]>; -} // Defs = [EFLAGS] - -// Aliases to match intrinsics which expect XMM operand(s). -let Constraints = "$src1 = $dst" in { - def Int_CMPSDrr : SDIi8<0xC2, MRMSrcReg, - (outs VR128:$dst), - (ins VR128:$src1, VR128:$src, SSECC:$cc), - "cmp${cc}sd\t{$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse2_cmp_sd VR128:$src1, - VR128:$src, imm:$cc))]>; - def Int_CMPSDrm : SDIi8<0xC2, MRMSrcMem, - (outs VR128:$dst), - (ins VR128:$src1, f64mem:$src, SSECC:$cc), - "cmp${cc}sd\t{$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse2_cmp_sd VR128:$src1, - (load addr:$src), imm:$cc))]>; -} - -let Defs = [EFLAGS] in { -def Int_UCOMISDrr: PDI<0x2E, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2), - "ucomisd\t{$src2, $src1|$src1, $src2}", - [(set EFLAGS, (X86ucomi (v2f64 VR128:$src1), - VR128:$src2))]>; -def Int_UCOMISDrm: PDI<0x2E, MRMSrcMem, (outs),(ins VR128:$src1, f128mem:$src2), - "ucomisd\t{$src2, $src1|$src1, $src2}", - [(set EFLAGS, (X86ucomi (v2f64 VR128:$src1), - (load addr:$src2)))]>; - -def Int_COMISDrr: PDI<0x2F, MRMSrcReg, (outs), (ins VR128:$src1, VR128:$src2), - "comisd\t{$src2, $src1|$src1, $src2}", - [(set EFLAGS, (X86comi (v2f64 VR128:$src1), - VR128:$src2))]>; -def Int_COMISDrm: PDI<0x2F, MRMSrcMem, (outs), (ins VR128:$src1, f128mem:$src2), - "comisd\t{$src2, $src1|$src1, $src2}", - [(set EFLAGS, (X86comi (v2f64 VR128:$src1), - (load addr:$src2)))]>; -} // Defs = [EFLAGS] - -// Aliases of packed SSE2 instructions for scalar use. These all have names -// that start with 'Fs'. - -// Alias instructions that map fld0 to pxor for sse. -let isReMaterializable = 1, isAsCheapAsAMove = 1, isCodeGenOnly = 1, - canFoldAsLoad = 1 in -def FsFLD0SD : I<0xEF, MRMInitReg, (outs FR64:$dst), (ins), "", - [(set FR64:$dst, fpimm0)]>, - Requires<[HasSSE2]>, TB, OpSize; - -// Alias instruction to do FR64 reg-to-reg copy using movapd. Upper bits are -// disregarded. -let neverHasSideEffects = 1 in -def FsMOVAPDrr : PDI<0x28, MRMSrcReg, (outs FR64:$dst), (ins FR64:$src), - "movapd\t{$src, $dst|$dst, $src}", []>; - -// Alias instruction to load FR64 from f128mem using movapd. Upper bits are -// disregarded. -let canFoldAsLoad = 1, isReMaterializable = 1 in -def FsMOVAPDrm : PDI<0x28, MRMSrcMem, (outs FR64:$dst), (ins f128mem:$src), - "movapd\t{$src, $dst|$dst, $src}", - [(set FR64:$dst, (alignedloadfsf64 addr:$src))]>; - //===---------------------------------------------------------------------===// // SSE packed FP Instructions @@ -2422,6 +2390,16 @@ // SSE3 Instructions //===---------------------------------------------------------------------===// +// Conversion Instructions +def CVTPD2DQrm : S3DI<0xE6, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src), + "cvtpd2dq\t{$src, $dst|$dst, $src}", []>; +def CVTPD2DQrr : S3DI<0xE6, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src), + "cvtpd2dq\t{$src, $dst|$dst, $src}", []>; +def CVTDQ2PDrm : S3SI<0xE6, MRMSrcMem, (outs VR128:$dst), (ins f128mem:$src), + "cvtdq2pd\t{$src, $dst|$dst, $src}", []>; +def CVTDQ2PDrr : S3SI<0xE6, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src), + "cvtdq2pd\t{$src, $dst|$dst, $src}", []>; + // Move Instructions def MOVSHDUPrr : S3SI<0x16, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src), "movshdup\t{$src, $dst|$dst, $src}", From evan.cheng at apple.com Tue Jun 22 13:12:50 2010 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 22 Jun 2010 11:12:50 -0700 Subject: [llvm-commits] [llvm] r106548 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp lib/CodeGen/SimpleRegisterCoalescing.h test/CodeGen/X86/pr2659.ll In-Reply-To: <20100622161357.992CF2A6C12C@llvm.org> References: <20100622161357.992CF2A6C12C@llvm.org> Message-ID: <8C130105-6745-4992-9BF2-B77F1A049FED@apple.com> SimpleRegisterCoalescing without SimpleJoin!? Could be it the coalescer is not appropriately named? Evan On Jun 22, 2010, at 9:13 AM, Jakob Stoklund Olesen wrote: > Author: stoklund > Date: Tue Jun 22 11:13:57 2010 > New Revision: 106548 > > URL: http://llvm.org/viewvc/llvm-project?rev=106548&view=rev > Log: > Remove the SimpleJoin optimization from SimpleRegisterCoalescing. > > Measurements show that it does not speed up coalescing, so there is no reason > the keep the added complexity around. > > Also clean out some unused methods and static functions. > > Modified: > llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp > llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h > llvm/trunk/test/CodeGen/X86/pr2659.ll > > Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=106548&r1=106547&r2=106548&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) > +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Jun 22 11:13:57 2010 > @@ -1034,119 +1034,6 @@ > } > > > -/// isWinToJoinVRWithSrcPhysReg - Return true if it's worth while to join a > -/// a virtual destination register with physical source register. > -bool > -SimpleRegisterCoalescing::isWinToJoinVRWithSrcPhysReg(MachineInstr *CopyMI, > - MachineBasicBlock *CopyMBB, > - LiveInterval &DstInt, > - LiveInterval &SrcInt) { > - // If the virtual register live interval is long but it has low use desity, > - // do not join them, instead mark the physical register as its allocation > - // preference. > - const TargetRegisterClass *RC = mri_->getRegClass(DstInt.reg); > - unsigned Threshold = allocatableRCRegs_[RC].count() * 2; > - unsigned Length = li_->getApproximateInstructionCount(DstInt); > - if (Length > Threshold && > - std::distance(mri_->use_nodbg_begin(DstInt.reg), > - mri_->use_nodbg_end()) * Threshold < Length) > - return false; > - > - // If the virtual register live interval extends into a loop, turn down > - // aggressiveness. > - SlotIndex CopyIdx = > - li_->getInstructionIndex(CopyMI).getDefIndex(); > - const MachineLoop *L = loopInfo->getLoopFor(CopyMBB); > - if (!L) { > - // Let's see if the virtual register live interval extends into the loop. > - LiveInterval::iterator DLR = DstInt.FindLiveRangeContaining(CopyIdx); > - assert(DLR != DstInt.end() && "Live range not found!"); > - DLR = DstInt.FindLiveRangeContaining(DLR->end.getNextSlot()); > - if (DLR != DstInt.end()) { > - CopyMBB = li_->getMBBFromIndex(DLR->start); > - L = loopInfo->getLoopFor(CopyMBB); > - } > - } > - > - if (!L || Length <= Threshold) > - return true; > - > - SlotIndex UseIdx = CopyIdx.getUseIndex(); > - LiveInterval::iterator SLR = SrcInt.FindLiveRangeContaining(UseIdx); > - MachineBasicBlock *SMBB = li_->getMBBFromIndex(SLR->start); > - if (loopInfo->getLoopFor(SMBB) != L) { > - if (!loopInfo->isLoopHeader(CopyMBB)) > - return false; > - // If vr's live interval extends pass the loop header, do not join. > - for (MachineBasicBlock::succ_iterator SI = CopyMBB->succ_begin(), > - SE = CopyMBB->succ_end(); SI != SE; ++SI) { > - MachineBasicBlock *SuccMBB = *SI; > - if (SuccMBB == CopyMBB) > - continue; > - if (DstInt.overlaps(li_->getMBBStartIdx(SuccMBB), > - li_->getMBBEndIdx(SuccMBB))) > - return false; > - } > - } > - return true; > -} > - > -/// isWinToJoinVRWithDstPhysReg - Return true if it's worth while to join a > -/// copy from a virtual source register to a physical destination register. > -bool > -SimpleRegisterCoalescing::isWinToJoinVRWithDstPhysReg(MachineInstr *CopyMI, > - MachineBasicBlock *CopyMBB, > - LiveInterval &DstInt, > - LiveInterval &SrcInt) { > - // If the virtual register live interval is long but it has low use density, > - // do not join them, instead mark the physical register as its allocation > - // preference. > - const TargetRegisterClass *RC = mri_->getRegClass(SrcInt.reg); > - unsigned Threshold = allocatableRCRegs_[RC].count() * 2; > - unsigned Length = li_->getApproximateInstructionCount(SrcInt); > - if (Length > Threshold && > - std::distance(mri_->use_nodbg_begin(SrcInt.reg), > - mri_->use_nodbg_end()) * Threshold < Length) > - return false; > - > - if (SrcInt.empty()) > - // Must be implicit_def. > - return false; > - > - // If the virtual register live interval is defined or cross a loop, turn > - // down aggressiveness. > - SlotIndex CopyIdx = > - li_->getInstructionIndex(CopyMI).getDefIndex(); > - SlotIndex UseIdx = CopyIdx.getUseIndex(); > - LiveInterval::iterator SLR = SrcInt.FindLiveRangeContaining(UseIdx); > - assert(SLR != SrcInt.end() && "Live range not found!"); > - SLR = SrcInt.FindLiveRangeContaining(SLR->start.getPrevSlot()); > - if (SLR == SrcInt.end()) > - return true; > - MachineBasicBlock *SMBB = li_->getMBBFromIndex(SLR->start); > - const MachineLoop *L = loopInfo->getLoopFor(SMBB); > - > - if (!L || Length <= Threshold) > - return true; > - > - if (loopInfo->getLoopFor(CopyMBB) != L) { > - if (SMBB != L->getLoopLatch()) > - return false; > - // If vr's live interval is extended from before the loop latch, do not > - // join. > - for (MachineBasicBlock::pred_iterator PI = SMBB->pred_begin(), > - PE = SMBB->pred_end(); PI != PE; ++PI) { > - MachineBasicBlock *PredMBB = *PI; > - if (PredMBB == SMBB) > - continue; > - if (SrcInt.overlaps(li_->getMBBStartIdx(PredMBB), > - li_->getMBBEndIdx(PredMBB))) > - return false; > - } > - } > - return true; > -} > - > /// isWinToJoinCrossClass - Return true if it's profitable to coalesce > /// two virtual registers from different register classes. > bool > @@ -1921,236 +1808,6 @@ > return ThisValNoAssignments[VN] = UltimateVN; > } > > -static bool InVector(VNInfo *Val, const SmallVector &V) { > - return std::find(V.begin(), V.end(), Val) != V.end(); > -} > - > -/// RangeIsDefinedByCopyFromReg - Return true if the specified live range of > -/// the specified live interval is defined by a copy from the specified > -/// register. > -bool SimpleRegisterCoalescing::RangeIsDefinedByCopy(LiveInterval &li, > - LiveRange *LR, > - CoalescerPair &CP) { > - if (CP.isCoalescable(LR->valno->getCopy())) > - return true; > - // FIXME: Do isPHIDef and isDefAccurate both need to be tested? > - if ((LR->valno->isPHIDef() || !LR->valno->isDefAccurate()) && > - TargetRegisterInfo::isPhysicalRegister(li.reg) && > - *tri_->getSuperRegisters(li.reg)) { > - // It's a sub-register live interval, we may not have precise information. > - // Re-compute it. > - MachineInstr *DefMI = li_->getInstructionFromIndex(LR->start); > - if (CP.isCoalescable(DefMI)) { > - // Cache computed info. > - LR->valno->def = LR->start; > - LR->valno->setCopy(DefMI); > - return true; > - } > - } > - return false; > -} > - > - > -/// ValueLiveAt - Return true if the LiveRange pointed to by the given > -/// iterator, or any subsequent range with the same value number, > -/// is live at the given point. > -bool SimpleRegisterCoalescing::ValueLiveAt(LiveInterval::iterator LRItr, > - LiveInterval::iterator LREnd, > - SlotIndex defPoint) const { > - for (const VNInfo *valno = LRItr->valno; > - (LRItr != LREnd) && (LRItr->valno == valno); ++LRItr) { > - if (LRItr->contains(defPoint)) > - return true; > - } > - > - return false; > -} > - > - > -/// SimpleJoin - Attempt to joint the specified interval into this one. The > -/// caller of this method must guarantee that the RHS only contains a single > -/// value number and that the RHS is not defined by a copy from this > -/// interval. This returns false if the intervals are not joinable, or it > -/// joins them and returns true. > -bool SimpleRegisterCoalescing::SimpleJoin(LiveInterval &LHS, LiveInterval &RHS, > - CoalescerPair &CP) { > - assert(RHS.containsOneValue()); > - > - // Some number (potentially more than one) value numbers in the current > - // interval may be defined as copies from the RHS. Scan the overlapping > - // portions of the LHS and RHS, keeping track of this and looking for > - // overlapping live ranges that are NOT defined as copies. If these exist, we > - // cannot coalesce. > - > - LiveInterval::iterator LHSIt = LHS.begin(), LHSEnd = LHS.end(); > - LiveInterval::iterator RHSIt = RHS.begin(), RHSEnd = RHS.end(); > - > - if (LHSIt->start < RHSIt->start) { > - LHSIt = std::upper_bound(LHSIt, LHSEnd, RHSIt->start); > - if (LHSIt != LHS.begin()) --LHSIt; > - } else if (RHSIt->start < LHSIt->start) { > - RHSIt = std::upper_bound(RHSIt, RHSEnd, LHSIt->start); > - if (RHSIt != RHS.begin()) --RHSIt; > - } > - > - SmallVector EliminatedLHSVals; > - > - while (1) { > - // Determine if these live intervals overlap. > - bool Overlaps = false; > - if (LHSIt->start <= RHSIt->start) > - Overlaps = LHSIt->end > RHSIt->start; > - else > - Overlaps = RHSIt->end > LHSIt->start; > - > - // If the live intervals overlap, there are two interesting cases: if the > - // LHS interval is defined by a copy from the RHS, it's ok and we record > - // that the LHS value # is the same as the RHS. If it's not, then we cannot > - // coalesce these live ranges and we bail out. > - if (Overlaps) { > - // If we haven't already recorded that this value # is safe, check it. > - if (!InVector(LHSIt->valno, EliminatedLHSVals)) { > - // If it's re-defined by an early clobber somewhere in the live range, > - // then conservatively abort coalescing. > - if (LHSIt->valno->hasRedefByEC()) > - return false; > - // Copy from the RHS? > - if (!RangeIsDefinedByCopy(LHS, LHSIt, CP)) > - return false; // Nope, bail out. > - > - if (ValueLiveAt(LHSIt, LHS.end(), RHSIt->valno->def)) > - // Here is an interesting situation: > - // BB1: > - // vr1025 = copy vr1024 > - // .. > - // BB2: > - // vr1024 = op > - // = vr1025 > - // Even though vr1025 is copied from vr1024, it's not safe to > - // coalesce them since the live range of vr1025 intersects the > - // def of vr1024. This happens because vr1025 is assigned the > - // value of the previous iteration of vr1024. > - return false; > - EliminatedLHSVals.push_back(LHSIt->valno); > - } > - > - // We know this entire LHS live range is okay, so skip it now. > - if (++LHSIt == LHSEnd) break; > - continue; > - } > - > - if (LHSIt->end < RHSIt->end) { > - if (++LHSIt == LHSEnd) break; > - } else { > - // One interesting case to check here. It's possible that we have > - // something like "X3 = Y" which defines a new value number in the LHS, > - // and is the last use of this liverange of the RHS. In this case, we > - // want to notice this copy (so that it gets coalesced away) even though > - // the live ranges don't actually overlap. > - if (LHSIt->start == RHSIt->end) { > - if (InVector(LHSIt->valno, EliminatedLHSVals)) { > - // We already know that this value number is going to be merged in > - // if coalescing succeeds. Just skip the liverange. > - if (++LHSIt == LHSEnd) break; > - } else { > - // If it's re-defined by an early clobber somewhere in the live range, > - // then conservatively abort coalescing. > - if (LHSIt->valno->hasRedefByEC()) > - return false; > - // Otherwise, if this is a copy from the RHS, mark it as being merged > - // in. > - if (RangeIsDefinedByCopy(LHS, LHSIt, CP)) { > - if (ValueLiveAt(LHSIt, LHS.end(), RHSIt->valno->def)) > - // Here is an interesting situation: > - // BB1: > - // vr1025 = copy vr1024 > - // .. > - // BB2: > - // vr1024 = op > - // = vr1025 > - // Even though vr1025 is copied from vr1024, it's not safe to > - // coalesced them since live range of vr1025 intersects the > - // def of vr1024. This happens because vr1025 is assigned the > - // value of the previous iteration of vr1024. > - return false; > - EliminatedLHSVals.push_back(LHSIt->valno); > - > - // We know this entire LHS live range is okay, so skip it now. > - if (++LHSIt == LHSEnd) break; > - } > - } > - } > - > - if (++RHSIt == RHSEnd) break; > - } > - } > - > - // If we got here, we know that the coalescing will be successful and that > - // the value numbers in EliminatedLHSVals will all be merged together. Since > - // the most common case is that EliminatedLHSVals has a single number, we > - // optimize for it: if there is more than one value, we merge them all into > - // the lowest numbered one, then handle the interval as if we were merging > - // with one value number. > - VNInfo *LHSValNo = NULL; > - if (EliminatedLHSVals.size() > 1) { > - // Loop through all the equal value numbers merging them into the smallest > - // one. > - VNInfo *Smallest = EliminatedLHSVals[0]; > - for (unsigned i = 1, e = EliminatedLHSVals.size(); i != e; ++i) { > - if (EliminatedLHSVals[i]->id < Smallest->id) { > - // Merge the current notion of the smallest into the smaller one. > - LHS.MergeValueNumberInto(Smallest, EliminatedLHSVals[i]); > - Smallest = EliminatedLHSVals[i]; > - } else { > - // Merge into the smallest. > - LHS.MergeValueNumberInto(EliminatedLHSVals[i], Smallest); > - } > - } > - LHSValNo = Smallest; > - } else if (EliminatedLHSVals.empty()) { > - if (TargetRegisterInfo::isPhysicalRegister(LHS.reg) && > - *tri_->getSuperRegisters(LHS.reg)) > - // Imprecise sub-register information. Can't handle it. > - return false; > - llvm_unreachable("No copies from the RHS?"); > - } else { > - LHSValNo = EliminatedLHSVals[0]; > - } > - > - // Okay, now that there is a single LHS value number that we're merging the > - // RHS into, update the value number info for the LHS to indicate that the > - // value number is defined where the RHS value number was. > - const VNInfo *VNI = RHS.getValNumInfo(0); > - LHSValNo->def = VNI->def; > - LHSValNo->setCopy(VNI->getCopy()); > - > - // Okay, the final step is to loop over the RHS live intervals, adding them to > - // the LHS. > - if (VNI->hasPHIKill()) > - LHSValNo->setHasPHIKill(true); > - LHS.addKills(LHSValNo, VNI->kills); > - LHS.MergeRangesInAsValue(RHS, LHSValNo); > - > - LHS.ComputeJoinedWeight(RHS); > - > - // Update regalloc hint if both are virtual registers. > - if (TargetRegisterInfo::isVirtualRegister(LHS.reg) && > - TargetRegisterInfo::isVirtualRegister(RHS.reg)) { > - std::pair RHSPref = mri_->getRegAllocationHint(RHS.reg); > - std::pair LHSPref = mri_->getRegAllocationHint(LHS.reg); > - if (RHSPref != LHSPref) > - mri_->setRegAllocationHint(LHS.reg, RHSPref.first, RHSPref.second); > - } > - > - // Update the liveintervals of sub-registers. > - if (TargetRegisterInfo::isPhysicalRegister(LHS.reg)) > - for (const unsigned *AS = tri_->getSubRegisters(LHS.reg); *AS; ++AS) > - li_->getOrCreateInterval(*AS).MergeInClobberRanges(*li_, LHS, > - li_->getVNInfoAllocator()); > - > - return true; > -} > - > /// JoinIntervals - Attempt to join these two intervals. On failure, this > /// returns false. Otherwise, if one of the intervals being joined is a > /// physreg, this method always canonicalizes LHS to be it. The output > @@ -2222,150 +1879,84 @@ > } > } > > - // Compute ultimate value numbers for the LHS and RHS values. > - if (RHS.containsOneValue()) { > - // Copies from a liveinterval with a single value are simple to handle and > - // very common, handle the special case here. This is important, because > - // often RHS is small and LHS is large (e.g. a physreg). > - > - // Find out if the RHS is defined as a copy from some value in the LHS. > - int RHSVal0DefinedFromLHS = -1; > - int RHSValID = -1; > - VNInfo *RHSValNoInfo = NULL; > - VNInfo *RHSValNoInfo0 = RHS.getValNumInfo(0); > - unsigned RHSSrcReg = li_->getVNInfoSourceReg(RHSValNoInfo0); > - if (RHSSrcReg == 0 || RHSSrcReg != LHS.reg) { > - // If RHS is not defined as a copy from the LHS, we can use simpler and > - // faster checks to see if the live ranges are coalescable. This joiner > - // can't swap the LHS/RHS intervals though. > - if (!TargetRegisterInfo::isPhysicalRegister(RHS.reg)) { > - return SimpleJoin(LHS, RHS, CP); > - } else { > - RHSValNoInfo = RHSValNoInfo0; > - } > - } else { > - // It was defined as a copy from the LHS, find out what value # it is. > - RHSValNoInfo = > - LHS.getLiveRangeContaining(RHSValNoInfo0->def.getPrevSlot())->valno; > - RHSValID = RHSValNoInfo->id; > - RHSVal0DefinedFromLHS = RHSValID; > - } > - > - LHSValNoAssignments.resize(LHS.getNumValNums(), -1); > - RHSValNoAssignments.resize(RHS.getNumValNums(), -1); > - NewVNInfo.resize(LHS.getNumValNums(), NULL); > - > - // Okay, *all* of the values in LHS that are defined as a copy from RHS > - // should now get updated. > - for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end(); > - i != e; ++i) { > - VNInfo *VNI = *i; > - unsigned VN = VNI->id; > - if (unsigned LHSSrcReg = li_->getVNInfoSourceReg(VNI)) { > - if (LHSSrcReg != RHS.reg) { > - // If this is not a copy from the RHS, its value number will be > - // unmodified by the coalescing. > - NewVNInfo[VN] = VNI; > - LHSValNoAssignments[VN] = VN; > - } else if (RHSValID == -1) { > - // Otherwise, it is a copy from the RHS, and we don't already have a > - // value# for it. Keep the current value number, but remember it. > - LHSValNoAssignments[VN] = RHSValID = VN; > - NewVNInfo[VN] = RHSValNoInfo; > - LHSValsDefinedFromRHS[VNI] = RHSValNoInfo0; > - } else { > - // Otherwise, use the specified value #. > - LHSValNoAssignments[VN] = RHSValID; > - if (VN == (unsigned)RHSValID) { // Else this val# is dead. > - NewVNInfo[VN] = RHSValNoInfo; > - LHSValsDefinedFromRHS[VNI] = RHSValNoInfo0; > - } > - } > - } else { > - NewVNInfo[VN] = VNI; > - LHSValNoAssignments[VN] = VN; > - } > - } > + // Loop over the value numbers of the LHS, seeing if any are defined from > + // the RHS. > + for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end(); > + i != e; ++i) { > + VNInfo *VNI = *i; > + if (VNI->isUnused() || VNI->getCopy() == 0) // Src not defined by a copy? > + continue; > > - assert(RHSValID != -1 && "Didn't find value #?"); > - RHSValNoAssignments[0] = RHSValID; > - if (RHSVal0DefinedFromLHS != -1) { > - // This path doesn't go through ComputeUltimateVN so just set > - // it to anything. > - RHSValsDefinedFromLHS[RHSValNoInfo0] = (VNInfo*)1; > - } > - } else { > - // Loop over the value numbers of the LHS, seeing if any are defined from > - // the RHS. > - for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end(); > - i != e; ++i) { > - VNInfo *VNI = *i; > - if (VNI->isUnused() || VNI->getCopy() == 0) // Src not defined by a copy? > - continue; > + // Never join with a register that has EarlyClobber redefs. > + if (VNI->hasRedefByEC()) > + return false; > > - // DstReg is known to be a register in the LHS interval. If the src is > - // from the RHS interval, we can use its value #. > - if (!CP.isCoalescable(VNI->getCopy())) > - continue; > + // DstReg is known to be a register in the LHS interval. If the src is > + // from the RHS interval, we can use its value #. > + if (!CP.isCoalescable(VNI->getCopy())) > + continue; > > - // Figure out the value # from the RHS. > - LiveRange *lr = RHS.getLiveRangeContaining(VNI->def.getPrevSlot()); > - // The copy could be to an aliased physreg. > - if (!lr) continue; > - LHSValsDefinedFromRHS[VNI] = lr->valno; > - } > + // Figure out the value # from the RHS. > + LiveRange *lr = RHS.getLiveRangeContaining(VNI->def.getPrevSlot()); > + // The copy could be to an aliased physreg. > + if (!lr) continue; > + LHSValsDefinedFromRHS[VNI] = lr->valno; > + } > > - // Loop over the value numbers of the RHS, seeing if any are defined from > - // the LHS. > - for (LiveInterval::vni_iterator i = RHS.vni_begin(), e = RHS.vni_end(); > - i != e; ++i) { > - VNInfo *VNI = *i; > - if (VNI->isUnused() || VNI->getCopy() == 0) // Src not defined by a copy? > - continue; > + // Loop over the value numbers of the RHS, seeing if any are defined from > + // the LHS. > + for (LiveInterval::vni_iterator i = RHS.vni_begin(), e = RHS.vni_end(); > + i != e; ++i) { > + VNInfo *VNI = *i; > + if (VNI->isUnused() || VNI->getCopy() == 0) // Src not defined by a copy? > + continue; > > - // DstReg is known to be a register in the RHS interval. If the src is > - // from the LHS interval, we can use its value #. > - if (!CP.isCoalescable(VNI->getCopy())) > - continue; > + // Never join with a register that has EarlyClobber redefs. > + if (VNI->hasRedefByEC()) > + return false; > > - // Figure out the value # from the LHS. > - LiveRange *lr = LHS.getLiveRangeContaining(VNI->def.getPrevSlot()); > - // The copy could be to an aliased physreg. > - if (!lr) continue; > - RHSValsDefinedFromLHS[VNI] = lr->valno; > - } > - > - LHSValNoAssignments.resize(LHS.getNumValNums(), -1); > - RHSValNoAssignments.resize(RHS.getNumValNums(), -1); > - NewVNInfo.reserve(LHS.getNumValNums() + RHS.getNumValNums()); > - > - for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end(); > - i != e; ++i) { > - VNInfo *VNI = *i; > - unsigned VN = VNI->id; > - if (LHSValNoAssignments[VN] >= 0 || VNI->isUnused()) > - continue; > - ComputeUltimateVN(VNI, NewVNInfo, > - LHSValsDefinedFromRHS, RHSValsDefinedFromLHS, > - LHSValNoAssignments, RHSValNoAssignments); > - } > - for (LiveInterval::vni_iterator i = RHS.vni_begin(), e = RHS.vni_end(); > - i != e; ++i) { > - VNInfo *VNI = *i; > - unsigned VN = VNI->id; > - if (RHSValNoAssignments[VN] >= 0 || VNI->isUnused()) > - continue; > - // If this value number isn't a copy from the LHS, it's a new number. > - if (RHSValsDefinedFromLHS.find(VNI) == RHSValsDefinedFromLHS.end()) { > - NewVNInfo.push_back(VNI); > - RHSValNoAssignments[VN] = NewVNInfo.size()-1; > - continue; > - } > + // DstReg is known to be a register in the RHS interval. If the src is > + // from the LHS interval, we can use its value #. > + if (!CP.isCoalescable(VNI->getCopy())) > + continue; > > - ComputeUltimateVN(VNI, NewVNInfo, > - RHSValsDefinedFromLHS, LHSValsDefinedFromRHS, > - RHSValNoAssignments, LHSValNoAssignments); > + // Figure out the value # from the LHS. > + LiveRange *lr = LHS.getLiveRangeContaining(VNI->def.getPrevSlot()); > + // The copy could be to an aliased physreg. > + if (!lr) continue; > + RHSValsDefinedFromLHS[VNI] = lr->valno; > + } > + > + LHSValNoAssignments.resize(LHS.getNumValNums(), -1); > + RHSValNoAssignments.resize(RHS.getNumValNums(), -1); > + NewVNInfo.reserve(LHS.getNumValNums() + RHS.getNumValNums()); > + > + for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end(); > + i != e; ++i) { > + VNInfo *VNI = *i; > + unsigned VN = VNI->id; > + if (LHSValNoAssignments[VN] >= 0 || VNI->isUnused()) > + continue; > + ComputeUltimateVN(VNI, NewVNInfo, > + LHSValsDefinedFromRHS, RHSValsDefinedFromLHS, > + LHSValNoAssignments, RHSValNoAssignments); > + } > + for (LiveInterval::vni_iterator i = RHS.vni_begin(), e = RHS.vni_end(); > + i != e; ++i) { > + VNInfo *VNI = *i; > + unsigned VN = VNI->id; > + if (RHSValNoAssignments[VN] >= 0 || VNI->isUnused()) > + continue; > + // If this value number isn't a copy from the LHS, it's a new number. > + if (RHSValsDefinedFromLHS.find(VNI) == RHSValsDefinedFromLHS.end()) { > + NewVNInfo.push_back(VNI); > + RHSValNoAssignments[VN] = NewVNInfo.size()-1; > + continue; > } > + > + ComputeUltimateVN(VNI, NewVNInfo, > + RHSValsDefinedFromLHS, LHSValsDefinedFromRHS, > + RHSValNoAssignments, LHSValNoAssignments); > } > > // Armed with the mappings of LHS/RHS values to ultimate values, walk the > > Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h?rev=106548&r1=106547&r2=106548&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h (original) > +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h Tue Jun 22 11:13:57 2010 > @@ -113,14 +113,7 @@ > /// below to update aliases. > bool JoinIntervals(LiveInterval &LHS, LiveInterval &RHS, bool &Swapped, > CoalescerPair &CP); > - > - /// SimpleJoin - Attempt to join the specified interval into this one. The > - /// caller of this method must guarantee that the RHS only contains a single > - /// value number and that the RHS is not defined by a copy from this > - /// interval. This returns false if the intervals are not joinable, or it > - /// joins them and returns true. > - bool SimpleJoin(LiveInterval &LHS, LiveInterval &RHS, CoalescerPair &CP); > - > + > /// Return true if the two specified registers belong to different register > /// classes. The registers may be either phys or virt regs. > bool differingRegisterClasses(unsigned RegA, unsigned RegB) const; > @@ -161,23 +154,6 @@ > bool CanCoalesceWithImpDef(MachineInstr *CopyMI, > LiveInterval &li, LiveInterval &ImpLi) const; > > - /// TurnCopiesFromValNoToImpDefs - The specified value# is defined by an > - /// implicit_def and it is being removed. Turn all copies from this value# > - /// into implicit_defs. > - void TurnCopiesFromValNoToImpDefs(LiveInterval &li, VNInfo *VNI); > - > - /// isWinToJoinVRWithSrcPhysReg - Return true if it's worth while to join a > - /// a virtual destination register with physical source register. > - bool isWinToJoinVRWithSrcPhysReg(MachineInstr *CopyMI, > - MachineBasicBlock *CopyMBB, > - LiveInterval &DstInt, LiveInterval &SrcInt); > - > - /// isWinToJoinVRWithDstPhysReg - Return true if it's worth while to join a > - /// copy from a virtual source register to a physical destination register. > - bool isWinToJoinVRWithDstPhysReg(MachineInstr *CopyMI, > - MachineBasicBlock *CopyMBB, > - LiveInterval &DstInt, LiveInterval &SrcInt); > - > /// isWinToJoinCrossClass - Return true if it's profitable to coalesce > /// two virtual registers from different register classes. > bool isWinToJoinCrossClass(unsigned SrcReg, > @@ -205,17 +181,6 @@ > bool CanJoinInsertSubRegToPhysReg(unsigned DstReg, unsigned SrcReg, > unsigned SubIdx, unsigned &RealDstReg); > > - /// ValueLiveAt - Return true if the LiveRange pointed to by the given > - /// iterator, or any subsequent range with the same value number, > - /// is live at the given point. > - bool ValueLiveAt(LiveInterval::iterator LRItr, LiveInterval::iterator LREnd, > - SlotIndex defPoint) const; > - > - /// RangeIsDefinedByCopy - Return true if the specified live range of the > - /// specified live interval is defined by a coalescable copy. > - bool RangeIsDefinedByCopy(LiveInterval &li, LiveRange *LR, > - CoalescerPair &CP); > - > /// UpdateRegDefsUses - Replace all defs and uses of SrcReg to DstReg and > /// update the subregister number if it is not zero. If DstReg is a > /// physical register and the existing subregister number of the def / use > > Modified: llvm/trunk/test/CodeGen/X86/pr2659.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pr2659.ll?rev=106548&r1=106547&r2=106548&view=diff > ============================================================================== > --- llvm/trunk/test/CodeGen/X86/pr2659.ll (original) > +++ llvm/trunk/test/CodeGen/X86/pr2659.ll Tue Jun 22 11:13:57 2010 > @@ -17,7 +17,7 @@ > ; CHECK: %forcond.preheader.forbody_crit_edge > ; CHECK: movl $1 > ; CHECK-NOT: xorl > -; CHECK-NEXT: movl $1 > +; CHECK-NEXT: movl > > ifthen: ; preds = %entry > ret i32 0 > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From bruno.cardoso at gmail.com Tue Jun 22 13:17:40 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 22 Jun 2010 18:17:40 -0000 Subject: [llvm-commits] [llvm] r106557 - /llvm/trunk/lib/Target/X86/X86InstrSSE.td Message-ID: <20100622181740.4F1842A6C12C@llvm.org> Author: bruno Date: Tue Jun 22 13:17:40 2010 New Revision: 106557 URL: http://llvm.org/viewvc/llvm-project?rev=106557&view=rev Log: Reorganize logical and arithmetic SSE 1 & 2 instructions Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106557&r1=106556&r2=106557&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jun 22 13:17:40 2010 @@ -834,6 +834,10 @@ [(set FR64:$dst, (alignedloadfsf64 addr:$src))]>; } +//===----------------------------------------------------------------------===// +// SSE 1 & 2 - Logical Instructions +//===----------------------------------------------------------------------===// + /// sse12_fp_alias_pack_logical - SSE 1 & 2 aliased packed FP logical ops /// multiclass sse12_fp_alias_pack_logical opc, string OpcodeStr, @@ -868,6 +872,82 @@ let neverHasSideEffects = 1, Pattern = [], isCommutable = 0 in defm FsANDN : sse12_fp_alias_pack_logical<0x55, "andn", undef, 1>; +/// sse12_fp_packed_logical - SSE 1 & 2 packed FP logical ops +/// +multiclass sse12_fp_packed_logical opc, string OpcodeStr, + SDNode OpNode, int HasPat = 0, + list> Pattern = []> { + let isAsmParserOnly = 1 in { + defm V#NAME#PS : sse12_fp_packed_logical_rm, + VEX_4V; + + defm V#NAME#PD : sse12_fp_packed_logical_rm, + OpSize, VEX_4V; + } + let Constraints = "$src1 = $dst" in { + defm PS : sse12_fp_packed_logical_rm, TB; + + defm PD : sse12_fp_packed_logical_rm, + TB, OpSize; + } +} + +defm AND : sse12_fp_packed_logical<0x54, "and", and>; +defm OR : sse12_fp_packed_logical<0x56, "or", or>; +defm XOR : sse12_fp_packed_logical<0x57, "xor", xor>; +let isCommutable = 0 in + defm ANDN : sse12_fp_packed_logical<0x55, "andn", undef /* dummy */, 1, [ + // single r+r + [(set VR128:$dst, (v2i64 (and (xor VR128:$src1, + (bc_v2i64 (v4i32 immAllOnesV))), + VR128:$src2)))], + // double r+r + [(set VR128:$dst, (and (vnot (bc_v2i64 (v2f64 VR128:$src1))), + (bc_v2i64 (v2f64 VR128:$src2))))], + // single r+m + [(set VR128:$dst, (v2i64 (and (xor (bc_v2i64 (v4f32 VR128:$src1)), + (bc_v2i64 (v4i32 immAllOnesV))), + (memopv2i64 addr:$src2))))], + // double r+m + [(set VR128:$dst, (and (vnot (bc_v2i64 (v2f64 VR128:$src1))), + (memopv2i64 addr:$src2)))]]>; + +//===----------------------------------------------------------------------===// +// SSE 1 & 2 - Arithmetic Instructions +//===----------------------------------------------------------------------===// + /// basic_sse12_fp_binop_rm - SSE 1 & 2 binops come in both scalar and /// vector forms. /// @@ -876,8 +956,7 @@ /// plain scalar form, in that it takes an entire vector (instead of a scalar) /// and leaves the top elements unmodified (therefore these cannot be commuted). /// -/// These three forms can each be reg+reg or reg+mem, so there are a total of -/// six "instructions". +/// These three forms can each be reg+reg or reg+mem. /// multiclass basic_sse12_fp_binop_rm opc, string OpcodeStr, SDNode OpNode> { @@ -953,8 +1032,6 @@ /// onto C operators don't use this form since they just use the plain /// vector form instead of having a separate vector intrinsic form. /// -/// This provides a total of eight "instructions". -/// multiclass sse12_fp_binop_rm opc, string OpcodeStr, SDNode OpNode> { @@ -1210,79 +1287,6 @@ defm RCP : sse1_fp_unop_rm<0x53, "rcp", X86frcp, int_x86_sse_rcp_ss, int_x86_sse_rcp_ps>; -/// sse12_fp_packed_logical - SSE 1 & 2 packed FP logical ops -/// -multiclass sse12_fp_packed_logical opc, string OpcodeStr, - SDNode OpNode, int HasPat = 0, - list> Pattern = []> { - let isAsmParserOnly = 1 in { - defm V#NAME#PS : sse12_fp_packed_logical_rm, - VEX_4V; - - defm V#NAME#PD : sse12_fp_packed_logical_rm, - OpSize, VEX_4V; - } - let Constraints = "$src1 = $dst" in { - defm PS : sse12_fp_packed_logical_rm, TB; - - defm PD : sse12_fp_packed_logical_rm, - TB, OpSize; - } -} - -// Logical -defm AND : sse12_fp_packed_logical<0x54, "and", and>; -defm OR : sse12_fp_packed_logical<0x56, "or", or>; -defm XOR : sse12_fp_packed_logical<0x57, "xor", xor>; -let isCommutable = 0 in - defm ANDN : sse12_fp_packed_logical<0x55, "andn", undef /* dummy */, 1, [ - // single r+r - [(set VR128:$dst, (v2i64 (and (xor VR128:$src1, - (bc_v2i64 (v4i32 immAllOnesV))), - VR128:$src2)))], - // double r+r - [(set VR128:$dst, (and (vnot (bc_v2i64 (v2f64 VR128:$src1))), - (bc_v2i64 (v2f64 VR128:$src2))))], - // single r+m - [(set VR128:$dst, (v2i64 (and (xor (bc_v2i64 (v4f32 VR128:$src1)), - (bc_v2i64 (v4i32 immAllOnesV))), - (memopv2i64 addr:$src2))))], - // double r+m - [(set VR128:$dst, (and (vnot (bc_v2i64 (v2f64 VR128:$src1))), - (memopv2i64 addr:$src2)))]]>; - let Constraints = "$src1 = $dst" in { def CMPPSrri : PSIi8<0xC2, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, VR128:$src, SSECC:$cc), From stoklund at 2pi.dk Tue Jun 22 13:23:36 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 22 Jun 2010 11:23:36 -0700 Subject: [llvm-commits] [llvm] r106548 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp lib/CodeGen/SimpleRegisterCoalescing.h test/CodeGen/X86/pr2659.ll In-Reply-To: <8C130105-6745-4992-9BF2-B77F1A049FED@apple.com> References: <20100622161357.992CF2A6C12C@llvm.org> <8C130105-6745-4992-9BF2-B77F1A049FED@apple.com> Message-ID: <297FD1BE-F409-4A04-BB35-27B11908547F@2pi.dk> On Jun 22, 2010, at 11:12 AM, Evan Cheng wrote: > SimpleRegisterCoalescing without SimpleJoin!? Could be it the coalescer is not appropriately named? Given the amount of minuses in the patch, it is a lot closer to being appropriately named now ;-) NoLongerEntirelyRidiculouslyComplicatedRegisterCoalescing? From daniel at zuster.org Tue Jun 22 13:39:51 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 22 Jun 2010 18:39:51 -0000 Subject: [llvm-commits] [test-suite] r106558 - in /test-suite/trunk: External/SPEC/Makefile.spec Makefile.programs Message-ID: <20100622183951.C1C8F2A6C12C@llvm.org> Author: ddunbar Date: Tue Jun 22 13:39:51 2010 New Revision: 106558 URL: http://llvm.org/viewvc/llvm-project?rev=106558&view=rev Log: Tweak USE_REFERENCE_OUTPUT=1 implementation to not fall over when reference outputs are missing. Modified: test-suite/trunk/External/SPEC/Makefile.spec test-suite/trunk/Makefile.programs Modified: test-suite/trunk/External/SPEC/Makefile.spec URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/Makefile.spec?rev=106558&r1=106557&r2=106558&view=diff ============================================================================== --- test-suite/trunk/External/SPEC/Makefile.spec (original) +++ test-suite/trunk/External/SPEC/Makefile.spec Tue Jun 22 13:39:51 2010 @@ -56,14 +56,20 @@ else -# In this case, we opt out of generating the native output and just copy it from -# a reference output. We accept either a generic reference output, or one -# specific to the current test configuration (i.e., SMALL_PROBLEM_SIZE). -Output/%.out-nat: $(KEYED_REFERENCE_OUTPUT_FILE) Output/.dir - cp $< $@ +# Otherwise, pick the best reference output based on +# 'progamname.reference_output'. +# +# Note that this rule needs to be in both Makefile.programs and Makefile.spec. +Output/%.out-nat: Output/.dir + -if [ -f "$(PROJ_SRC_DIR)/$*.reference_output.$(REFERENCE_OUTPUT_KEY)" ]; then \ + cp $(PROJ_SRC_DIR)/$*.reference_output.$(REFERENCE_OUTPUT_KEY) $@; \ + elif [ -f "$(PROJ_SRC_DIR)/$*.reference_output" ]; then \ + cp $(PROJ_SRC_DIR)/$*.reference_output $@; \ + else \ + printf "ERROR: %s: %s\n" "NO REFERENCE OUTPUT" "$(PROJ_SRC_DIR)/$*.reference_output" > $@; \ + cat $@; \ + fi -Output/%.out-nat: $(REFERENCE_OUTPUT_FILE) Output/.dir - cp $< $@ endif $(PROGRAMS_TO_TEST:%=Output/%.out-simple): \ Modified: test-suite/trunk/Makefile.programs URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=106558&r1=106557&r2=106558&view=diff ============================================================================== --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Tue Jun 22 13:39:51 2010 @@ -96,19 +96,6 @@ endif endif -# If the app wants to USE_REFERENCE_OUTPUT, but hasn't specified a file -# containing the reference output, default to programname.reference_output. -ifndef REFERENCE_OUTPUT_FILE -REFERENCE_OUTPUT_FILE = $(PROJ_SRC_DIR)/%.reference_output -ifeq ($(REFERENCE_OUTPUT_KEY),) -KEYED_REFERENCE_OUTPUT_FILE = $(PROJ_SRC_DIR)/%.reference_output -else -KEYED_REFERENCE_OUTPUT_FILE = $(PROJ_SRC_DIR)/%.reference_output.$(REFERENCE_OUTPUT_KEY) -endif -else -KEYED_REFERENCE_OUTPUT_FILE = $(REFERENCE_OUTPUT_FILE) -endif - # RUNSAFELY - This program simply runs another program. If the program works # correctly, this script has no effect, otherwise it will do things like print a # stack trace of a core dump. It always returns "successful" so that tests will @@ -860,16 +847,34 @@ Output/%.LOC.txt: $(SRCDIR)/%.LOC.txt Output/.dir cp $< $@ else + +# Rules to support USE_REFERENCE_OUTPUT. ifdef USE_REFERENCE_OUTPUT -# In this case, we opt out of generating the native output and just copy it from -# a reference output. We accept either a generic reference output, or one -# specific to the current test configuration (i.e., SMALL_PROBLEM_SIZE). -Output/%.out-nat: $(KEYED_REFERENCE_OUTPUT_FILE) Output/.dir - cp $< $@ +# If a reference output file is specified, use that. +ifdef REFERENCE_OUTPUT_FILE Output/%.out-nat: $(REFERENCE_OUTPUT_FILE) Output/.dir cp $< $@ + +else + +# Otherwise, pick the best reference output based on +# 'progamname.reference_output'. +# +# Note that this rule needs to be in both Makefile.programs and Makefile.spec. +Output/%.out-nat: Output/.dir + -if [ -f "$(PROJ_SRC_DIR)/$*.reference_output.$(REFERENCE_OUTPUT_KEY)" ]; then \ + cp $(PROJ_SRC_DIR)/$*.reference_output.$(REFERENCE_OUTPUT_KEY) $@; \ + elif [ -f "$(PROJ_SRC_DIR)/$*.reference_output" ]; then \ + cp $(PROJ_SRC_DIR)/$*.reference_output $@; \ + else \ + printf "ERROR: %s: %s\n" "NO REFERENCE OUTPUT" "$(PROJ_SRC_DIR)/$*.reference_output" > $@; \ + cat $@; \ + fi + +endif + endif endif From daniel at zuster.org Tue Jun 22 13:39:54 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 22 Jun 2010 18:39:54 -0000 Subject: [llvm-commits] [test-suite] r106559 - /test-suite/trunk/SingleSource/UnitTests/initp1.reference_output Message-ID: <20100622183954.3F6C32A6C12D@llvm.org> Author: ddunbar Date: Tue Jun 22 13:39:54 2010 New Revision: 106559 URL: http://llvm.org/viewvc/llvm-project?rev=106559&view=rev Log: Add initp1 reference output. Added: test-suite/trunk/SingleSource/UnitTests/initp1.reference_output Added: test-suite/trunk/SingleSource/UnitTests/initp1.reference_output URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/initp1.reference_output?rev=106559&view=auto ============================================================================== --- test-suite/trunk/SingleSource/UnitTests/initp1.reference_output (added) +++ test-suite/trunk/SingleSource/UnitTests/initp1.reference_output Tue Jun 22 13:39:54 2010 @@ -0,0 +1,2 @@ +exit 134 +RunSafely.sh detected a failure with these command-line arguments: 500 1 /dev/null Output/initp1.out-nat Output/initp1.native From dpatel at apple.com Tue Jun 22 13:52:38 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 22 Jun 2010 18:52:38 -0000 Subject: [llvm-commits] [llvm] r106560 - /llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Message-ID: <20100622185238.DF5C22A6C12C@llvm.org> Author: dpatel Date: Tue Jun 22 13:52:38 2010 New Revision: 106560 URL: http://llvm.org/viewvc/llvm-project?rev=106560&view=rev Log: Clone named metadata while cloning a module. Reapply Bob's patch. Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneModule.cpp?rev=106560&r1=106559&r2=106560&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneModule.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Tue Jun 22 13:52:38 2010 @@ -122,6 +122,17 @@ if (const Constant* C = I->getAliasee()) GA->setAliasee(cast(MapValue(C, ValueMap))); } + + // And named metadata.... + for (Module::const_named_metadata_iterator I = M->named_metadata_begin(), + E = M->named_metadata_end(); I != E; ++I) { + const NamedMDNode &NMD = *I; + SmallVector MDs; + for (unsigned i = 0, e = NMD.getNumOperands(); i != e; ++i) + MDs.push_back(cast(MapValue(NMD.getOperand(i), ValueMap))); + NamedMDNode::Create(New->getContext(), NMD.getName(), + MDs.data(), MDs.size(), New); + } return New; } From wangmp at apple.com Tue Jun 22 14:40:50 2010 From: wangmp at apple.com (Mon P Wang) Date: Tue, 22 Jun 2010 19:40:50 -0000 Subject: [llvm-commits] [llvm] r106562 - in /llvm/trunk/test/CodeGen: Generic/v-binop-widen.ll Generic/v-binop-widen2.ll X86/v-binop-widen.ll X86/v-binop-widen2.ll Message-ID: <20100622194050.47E182A6C12C@llvm.org> Author: wangmp Date: Tue Jun 22 14:40:50 2010 New Revision: 106562 URL: http://llvm.org/viewvc/llvm-project?rev=106562&view=rev Log: Move v-binop-widen tests to X86 since they don't work on all platforms Added: llvm/trunk/test/CodeGen/X86/v-binop-widen.ll - copied, changed from r106555, llvm/trunk/test/CodeGen/Generic/v-binop-widen.ll llvm/trunk/test/CodeGen/X86/v-binop-widen2.ll - copied, changed from r106555, llvm/trunk/test/CodeGen/Generic/v-binop-widen2.ll Removed: llvm/trunk/test/CodeGen/Generic/v-binop-widen.ll llvm/trunk/test/CodeGen/Generic/v-binop-widen2.ll Removed: llvm/trunk/test/CodeGen/Generic/v-binop-widen.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/v-binop-widen.ll?rev=106561&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/v-binop-widen.ll (original) +++ llvm/trunk/test/CodeGen/Generic/v-binop-widen.ll (removed) @@ -1,8 +0,0 @@ -; RUN: llc -march=x86 < %s - -%vec = type <9 x float> -define %vec @vecdiv( %vec %p1, %vec %p2) -{ - %result = fdiv %vec %p1, %p2 - ret %vec %result -} Removed: llvm/trunk/test/CodeGen/Generic/v-binop-widen2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/v-binop-widen2.ll?rev=106561&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Generic/v-binop-widen2.ll (original) +++ llvm/trunk/test/CodeGen/Generic/v-binop-widen2.ll (removed) @@ -1,37 +0,0 @@ -; RUN: llvm-as < %s | lli - -%vec = type <6 x float> - -define %vec @vecdiv( %vec %p1, %vec %p2) -{ - %result = fdiv %vec %p1, %p2 - ret %vec %result -} - - at a = constant %vec < float 2.0, float 4.0, float 8.0, float 16.0, float 32.0, float 64.0 > - at b = constant %vec < float 2.0, float 2.0, float 2.0, float 2.0, float 2.0, float 2.0 > - -; Expected result: < 1.0, 2.0, 4.0, ..., 2.0^(n-1) > -; main() returns 0 if the result is expected and 1 otherwise -define i32 @main() nounwind { -entry: - %avec = load %vec* @a - %bvec = load %vec* @b - - %res = call %vec @vecdiv(%vec %avec, %vec %bvec) - br label %loop -loop: - %idx = phi i32 [0, %entry], [%nextInd, %looptail] - %expected = phi float [1.0, %entry], [%nextExpected, %looptail] - %elem = extractelement %vec %res, i32 %idx - %expcmp = fcmp oeq float %elem, %expected - br i1 %expcmp, label %looptail, label %return -looptail: - %nextExpected = fmul float %expected, 2.0 - %nextInd = add i32 %idx, 1 - %cmp = icmp slt i32 %nextInd, 6 - br i1 %cmp, label %loop, label %return -return: - %retval = phi i32 [0, %looptail], [1, %loop] - ret i32 %retval -} Copied: llvm/trunk/test/CodeGen/X86/v-binop-widen.ll (from r106555, llvm/trunk/test/CodeGen/Generic/v-binop-widen.ll) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/v-binop-widen.ll?p2=llvm/trunk/test/CodeGen/X86/v-binop-widen.ll&p1=llvm/trunk/test/CodeGen/Generic/v-binop-widen.ll&r1=106555&r2=106562&rev=106562&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/v-binop-widen.ll (original) +++ llvm/trunk/test/CodeGen/X86/v-binop-widen.ll Tue Jun 22 14:40:50 2010 @@ -1,4 +1,7 @@ -; RUN: llc -march=x86 < %s +; RUN: llc -march=x86 < %s | FileCheck %s +; CHECK: divss +; CHECK: divps +; CHECK: divps %vec = type <9 x float> define %vec @vecdiv( %vec %p1, %vec %p2) @@ -6,3 +9,4 @@ %result = fdiv %vec %p1, %p2 ret %vec %result } + Copied: llvm/trunk/test/CodeGen/X86/v-binop-widen2.ll (from r106555, llvm/trunk/test/CodeGen/Generic/v-binop-widen2.ll) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/v-binop-widen2.ll?p2=llvm/trunk/test/CodeGen/X86/v-binop-widen2.ll&p1=llvm/trunk/test/CodeGen/Generic/v-binop-widen2.ll&r1=106555&r2=106562&rev=106562&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/v-binop-widen2.ll (original) +++ llvm/trunk/test/CodeGen/X86/v-binop-widen2.ll Tue Jun 22 14:40:50 2010 @@ -1,7 +1,9 @@ -; RUN: llvm-as < %s | lli +; RUN: llc -march=x86 < %s | FileCheck %s %vec = type <6 x float> - +; CHECK: divss +; CHECK: divss +; CHECK: divps define %vec @vecdiv( %vec %p1, %vec %p2) { %result = fdiv %vec %p1, %p2 @@ -13,6 +15,7 @@ ; Expected result: < 1.0, 2.0, 4.0, ..., 2.0^(n-1) > ; main() returns 0 if the result is expected and 1 otherwise +; to execute, use llvm-as < %s | lli define i32 @main() nounwind { entry: %avec = load %vec* @a From ggreif at gmail.com Tue Jun 22 14:46:37 2010 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 22 Jun 2010 19:46:37 -0000 Subject: [llvm-commits] [llvm] r106563 - /llvm/trunk/lib/VMCore/IntrinsicInst.cpp Message-ID: <20100622194637.B39992A6C12C@llvm.org> Author: ggreif Date: Tue Jun 22 14:46:37 2010 New Revision: 106563 URL: http://llvm.org/viewvc/llvm-project?rev=106563&view=rev Log: warmup ritual: use high-level argument accessors Modified: llvm/trunk/lib/VMCore/IntrinsicInst.cpp Modified: llvm/trunk/lib/VMCore/IntrinsicInst.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/IntrinsicInst.cpp?rev=106563&r1=106562&r2=106563&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/IntrinsicInst.cpp (original) +++ llvm/trunk/lib/VMCore/IntrinsicInst.cpp Tue Jun 22 14:46:37 2010 @@ -54,7 +54,7 @@ /// Value *DbgDeclareInst::getAddress() const { - if (MDNode* MD = cast_or_null(getOperand(1))) + if (MDNode* MD = cast_or_null(getArgOperand(0))) return MD->getOperand(0); else return NULL; @@ -65,9 +65,9 @@ /// const Value *DbgValueInst::getValue() const { - return cast(getOperand(1))->getOperand(0); + return cast(getArgOperand(0))->getOperand(0); } Value *DbgValueInst::getValue() { - return cast(getOperand(1))->getOperand(0); + return cast(getArgOperand(0))->getOperand(0); } From monping at apple.com Tue Jun 22 14:46:53 2010 From: monping at apple.com (Mon Ping Wang) Date: Tue, 22 Jun 2010 12:46:53 -0700 Subject: [llvm-commits] [llvm] r106038 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp test/CodeGen/Generic/v-binop-widen.ll test/CodeGen/Generic/v-binop-widen2.ll In-Reply-To: References: <20100615202905.4C9A42A6C12C@llvm.org> <86890B00-CE41-41F8-AC07-EF87AAA2CC41@apple.com> <8BB70DCD-CA07-4568-BCCD-0BCD6CE38F04@2pi.dk> <20100617141737.GA10744@hutcs.cs.hut.fi> Message-ID: <4CF4293B-A1ED-403B-80DB-E95724CB0707@apple.com> Sorry for the delay. I moved them to x86 directory. -- Mon Ping On Jun 17, 2010, at 7:25 AM, Jakob Stoklund Olesen wrote: > > On Jun 17, 2010, at 7:17 AM, Visa Putkinen wrote: > >> On Wed, Jun 16, 2010 at 02:16:50PM -0700, Jakob Stoklund Olesen wrote: >>> On Jun 16, 2010, at 2:09 PM, Jim Grosbach wrote: >>>> I changed the test to use "< %s" in r106146 so it'll stop polluting the test source directoy. I don't know what FileCheck entries should also be there, though. >> >> Thanks, Jim. I'll use "< %s" in the future. >> >>> Many tests pass simply by not crashing llc. I am guessing that is the case here. >> >> That is indeed the case here. >> >>> If the test case can crash llc without needing fancy options, multiple tests can be collected in one file, see test/CodeGen/X86/crash.ll. >> >> Good to know. In that case v-binop-widen.ll should be moved into a >> crash.ll (or be removed altogether). The test was supposed to demo a >> crash in X86 target caused by a bug in common CodeGen code. So should >> such tests be under test/CodeGen/X86 or test/CodeGen/Generic? > > If it requires the X86 target, it should go in the X86 directory. > > The X86 target may not be present when running the Generic tests. > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From stoklund at 2pi.dk Tue Jun 22 14:51:58 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 22 Jun 2010 12:51:58 -0700 Subject: [llvm-commits] [llvm] r106038 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp test/CodeGen/Generic/v-binop-widen.ll test/CodeGen/Generic/v-binop-widen2.ll In-Reply-To: <4CF4293B-A1ED-403B-80DB-E95724CB0707@apple.com> References: <20100615202905.4C9A42A6C12C@llvm.org> <86890B00-CE41-41F8-AC07-EF87AAA2CC41@apple.com> <8BB70DCD-CA07-4568-BCCD-0BCD6CE38F04@2pi.dk> <20100617141737.GA10744@hutcs.cs.hut.fi> <4CF4293B-A1ED-403B-80DB-E95724CB0707@apple.com> Message-ID: <3A609326-9D02-4BB1-A196-6FA92A708FE0@2pi.dk> On Jun 22, 2010, at 12:46 PM, Mon Ping Wang wrote: > > Sorry for the delay. I moved them to x86 directory. > > -- Mon Ping Thanks, Mon Ping. The ppc and arm buildbots should go green after this. /jakob From isanbard at gmail.com Tue Jun 22 14:56:08 2010 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 22 Jun 2010 19:56:08 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r106564 - in /llvm-gcc-4.2/trunk/gcc: cp/cp-lang.c langhooks-def.h langhooks.h llvm-backend.cpp llvm-convert.cpp Message-ID: <20100622195608.1EB0F2A6C12C@llvm.org> Author: void Date: Tue Jun 22 14:56:07 2010 New Revision: 106564 URL: http://llvm.org/viewvc/llvm-project?rev=106564&view=rev Log: A thunk should take the linkage and visibility of the call it's thunking. This requires us to set the linkage and visibility after all other functions have had theirs set. If there is a thunk that points to a thunk, then we need to process the thunk that calls a non-thunk first and so on until all thunks are processed. Modified: llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c llvm-gcc-4.2/trunk/gcc/langhooks-def.h llvm-gcc-4.2/trunk/gcc/langhooks.h llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c?rev=106564&r1=106563&r2=106564&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c Tue Jun 22 14:56:07 2010 @@ -38,6 +38,8 @@ static void cp_init_ts (void); /* LLVM LOCAL */ static bool cp_function_thunk_p (tree fndecl); +/* LLVM LOCAL */ +static tree cp_thunk_target (tree thunk); /* Lang hooks common to C++ and ObjC++ are declared in cp/cp-objcp-common.h; consequently, there should be very few hooks below. */ @@ -56,6 +58,10 @@ #undef LANG_HOOKS_FUNCTION_THUNK_P #define LANG_HOOKS_FUNCTION_THUNK_P cp_function_thunk_p /* LLVM LOCAL end */ +/* LLVM LOCAL begin */ +#undef LANG_HOOKS_THUNK_TARGET +#define LANG_HOOKS_THUNK_TARGET cp_thunk_target +/* LLVM LOCAL end */ /* Each front end provides its own lang hook initializer. */ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; @@ -152,13 +158,21 @@ } /* LLVM LOCAL begin */ -bool +static bool cp_function_thunk_p (tree fndecl) { return DECL_THUNK_P (fndecl); } /* LLVM LOCAL end */ +/* LLVM LOCAL begin */ +static tree +cp_thunk_target (tree thunk) +{ + return THUNK_TARGET (thunk); +} +/* LLVM LOCAL begin */ + void finish_file (void) { Modified: llvm-gcc-4.2/trunk/gcc/langhooks-def.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/langhooks-def.h?rev=106564&r1=106563&r2=106564&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/langhooks-def.h (original) +++ llvm-gcc-4.2/trunk/gcc/langhooks-def.h Tue Jun 22 14:56:07 2010 @@ -159,6 +159,9 @@ /* LLVM LOCAL */ #define LANG_HOOKS_FUNCTION_THUNK_P hook_bool_tree_false +/* LLVM LOCAL */ +#define LANG_HOOKS_THUNK_TARGET lhd_return_null_tree + /* APPLE LOCAL begin radar 6353006 */ #define LANG_HOOKS_BUILD_GENERIC_BLOCK_STRUCT_TYPE \ lhd_build_generic_block_struct_type @@ -366,6 +369,8 @@ LANG_HOOKS_BUILD_GENERIC_BLOCK_STRUCT_TYPE, \ /* LLVM LOCAL */ \ LANG_HOOKS_FUNCTION_THUNK_P, \ + /* LLVM LOCAL */ \ + LANG_HOOKS_THUNK_TARGET, \ } #endif /* GCC_LANG_HOOKS_DEF_H */ Modified: llvm-gcc-4.2/trunk/gcc/langhooks.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/langhooks.h?rev=106564&r1=106563&r2=106564&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/langhooks.h (original) +++ llvm-gcc-4.2/trunk/gcc/langhooks.h Tue Jun 22 14:56:07 2010 @@ -490,6 +490,11 @@ bool (*function_is_thunk_p) (tree fndecl); /* LLVM LOCAL end */ + /* LLVM LOCAL begin */ + /* Returns the target of a thunk. */ + tree (*thunk_target) (tree thunk); + /* LLVM LOCAL end */ + /* Whenever you add entries here, make sure you adjust langhooks-def.h and langhooks.c accordingly. */ }; Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=106564&r1=106563&r2=106564&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue Jun 22 14:56:07 2010 @@ -91,6 +91,9 @@ TargetFolder *TheFolder = 0; TypeConverter *TheTypeConverter = 0; +// A list of thunks to post-process. +std::vector Thunks; + /// DisableLLVMOptimizations - Allow the user to specify: /// "-mllvm -disable-llvm-optzns" on the llvm-gcc command line to force llvm /// optimizations off. @@ -121,8 +124,8 @@ // than the LLVM Value pointer while using PCH. // Collection of LLVM Values -static std::vector LLVMValues; -typedef DenseMap LLVMValuesMapTy; +static std::vector LLVMValues; +typedef DenseMap LLVMValuesMapTy; static LLVMValuesMapTy LLVMValuesMap; /// LocalLLVMValueIDs - This is the set of local IDs we have in our mapping, @@ -859,6 +862,47 @@ timevar_push(TV_LLVM_PERFILE); LLVMContext &Context = getGlobalContext(); + // Assign the correct linkage to the thunks now that we've set the linkage and + // visibility to their targets. + SmallPtrSet ThunkOfThunk; + + for (std::vector::iterator + I = Thunks.begin(), E = Thunks.end(); I != E; ++I) { + tree thunk = *I; + tree thunk_target = lang_hooks.thunk_target(thunk); + + if (lang_hooks.function_is_thunk_p (thunk_target)) { + ThunkOfThunk.insert(thunk); + continue; + } + + Function *Thunk = cast(DECL_LLVM(thunk)); + const Function *ThunkTarget = cast(DECL_LLVM(thunk_target)); + + Thunk->setLinkage(ThunkTarget->getLinkage()); + Thunk->setVisibility(ThunkTarget->getVisibility()); + } + + // There's a situation where a thunk calls another thunk. In that case, we + // want to process first the thunk that calls a non-thunk. Then we process + // each thunk in turn until all thunks have been processed. + while (!ThunkOfThunk.empty()) + for (SmallPtrSet::iterator + I = ThunkOfThunk.begin(), E = ThunkOfThunk.end(); I != E; ++I) { + tree thunk = *I; + tree thunk_target = lang_hooks.thunk_target(thunk); + + if (!ThunkOfThunk.count(thunk_target)) { + Function *Thunk = cast(DECL_LLVM(thunk)); + const Function *ThunkTarget = cast(DECL_LLVM(thunk_target)); + + Thunk->setLinkage(ThunkTarget->getLinkage()); + Thunk->setVisibility(ThunkTarget->getVisibility()); + ThunkOfThunk.erase(thunk); + break; + } + } + performLateBackendInitialization(); createPerFunctionOptimizationPasses(); Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=106564&r1=106563&r2=106564&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Jun 22 14:56:07 2010 @@ -75,6 +75,8 @@ static LLVMContext &Context = getGlobalContext(); +extern std::vector Thunks; + // Check for GCC bug 17347: C++ FE sometimes creates bogus ctor trees // which we should throw out #define BOGUS_CTOR(exp) \ @@ -528,34 +530,41 @@ // The function should not already have a body. assert(Fn->empty() && "Function expanded multiple times!"); - // Compute the linkage that the function should get. - if (DECL_LLVM_PRIVATE(FnDecl)) { - Fn->setLinkage(Function::PrivateLinkage); - } else if (DECL_LLVM_LINKER_PRIVATE(FnDecl)) { - Fn->setLinkage(Function::LinkerPrivateLinkage); - } else if (!TREE_PUBLIC(FnDecl) /*|| lang_hooks.llvm_is_in_anon(subr)*/) { - Fn->setLinkage(Function::InternalLinkage); - } else if (DECL_EXTERNAL(FnDecl) && - lookup_attribute ("always_inline", DECL_ATTRIBUTES (FnDecl))) { - Fn->setLinkage(Function::AvailableExternallyLinkage); - } else if (DECL_COMDAT(FnDecl)) { - Fn->setLinkage(Function::getLinkOnceLinkage(flag_odr)); - } else if (DECL_WEAK(FnDecl) && !lang_hooks.function_is_thunk_p (FnDecl)) { - // The user may have explicitly asked for weak linkage - ignore flag_odr. - Fn->setLinkage(Function::WeakAnyLinkage); - } else if (DECL_ONE_ONLY(FnDecl) || lang_hooks.function_is_thunk_p (FnDecl)) { - Fn->setLinkage(Function::getWeakLinkage(flag_odr)); - } else if (IS_EXTERN_INLINE(FnDecl)) { - // gcc "extern inline", C99 "inline" - Fn->setLinkage(Function::AvailableExternallyLinkage); - } + if (!lang_hooks.function_is_thunk_p (FnDecl)) { + // Compute the linkage that the function should get. + if (DECL_LLVM_PRIVATE(FnDecl)) { + Fn->setLinkage(Function::PrivateLinkage); + } else if (DECL_LLVM_LINKER_PRIVATE(FnDecl)) { + Fn->setLinkage(Function::LinkerPrivateLinkage); + } else if (!TREE_PUBLIC(FnDecl) /*|| lang_hooks.llvm_is_in_anon(subr)*/) { + Fn->setLinkage(Function::InternalLinkage); + } else if (DECL_EXTERNAL(FnDecl) && + lookup_attribute ("always_inline", DECL_ATTRIBUTES (FnDecl))) { + Fn->setLinkage(Function::AvailableExternallyLinkage); + } else if (DECL_COMDAT(FnDecl)) { + Fn->setLinkage(Function::getLinkOnceLinkage(flag_odr)); + } else if (DECL_WEAK(FnDecl)) { + // The user may have explicitly asked for weak linkage - ignore flag_odr. + Fn->setLinkage(Function::WeakAnyLinkage); + } else if (DECL_ONE_ONLY(FnDecl) || lang_hooks.function_is_thunk_p (FnDecl)) { + Fn->setLinkage(Function::getWeakLinkage(flag_odr)); + } else if (IS_EXTERN_INLINE(FnDecl)) { + // gcc "extern inline", C99 "inline" + Fn->setLinkage(Function::AvailableExternallyLinkage); + } #ifdef TARGET_ADJUST_LLVM_LINKAGE - TARGET_ADJUST_LLVM_LINKAGE(Fn,FnDecl); + TARGET_ADJUST_LLVM_LINKAGE(Fn, FnDecl); #endif /* TARGET_ADJUST_LLVM_LINKAGE */ - // Handle visibility style - handleVisibility(FnDecl, Fn); + // Handle visibility style. + handleVisibility(FnDecl, Fn); + } else { + // A thunk should get its visibility and linkage from the function being + // thunked. Set the information after all functions have been processed + // through here. + Thunks.push_back(FnDecl); + } // Handle attribute "aligned". if (DECL_ALIGN (FnDecl) != FUNCTION_BOUNDARY) From isanbard at gmail.com Tue Jun 22 15:30:14 2010 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 22 Jun 2010 20:30:14 -0000 Subject: [llvm-commits] [llvm] r106569 - in /llvm/trunk/test/FrontendC++: thunk-linkonce-odr.cpp thunk-weak-odr.cpp Message-ID: <20100622203014.C6EBC2A6C12C@llvm.org> Author: void Date: Tue Jun 22 15:30:14 2010 New Revision: 106569 URL: http://llvm.org/viewvc/llvm-project?rev=106569&view=rev Log: Corresponding test changes for r106564. Added: llvm/trunk/test/FrontendC++/thunk-linkonce-odr.cpp - copied, changed from r106499, llvm/trunk/test/FrontendC++/thunk-weak-odr.cpp Removed: llvm/trunk/test/FrontendC++/thunk-weak-odr.cpp Copied: llvm/trunk/test/FrontendC++/thunk-linkonce-odr.cpp (from r106499, llvm/trunk/test/FrontendC++/thunk-weak-odr.cpp) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/thunk-linkonce-odr.cpp?p2=llvm/trunk/test/FrontendC%2B%2B/thunk-linkonce-odr.cpp&p1=llvm/trunk/test/FrontendC%2B%2B/thunk-weak-odr.cpp&r1=106499&r2=106569&rev=106569&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/thunk-weak-odr.cpp (original) +++ llvm/trunk/test/FrontendC++/thunk-linkonce-odr.cpp Tue Jun 22 15:30:14 2010 @@ -1,5 +1,5 @@ // RUN: %llvmgxx %s -S -o - | FileCheck %s -// +// & struct A { virtual int f() { return 1; } @@ -27,7 +27,7 @@ return f(&d); } -// Thunks should be marked as "weak ODR", not just "weak". +// Thunks should be marked as "linkonce ODR" not "weak". // -// CHECK: define weak_odr i32 @_ZThn{{[48]}}_N1C1fEv -// CHECK: define weak_odr i32 @_ZThn{{[48]}}_N1D1fEv +// CHECK: define linkonce_odr i32 @_ZThn{{[48]}}_N1C1fEv +// CHECK: define linkonce_odr i32 @_ZThn{{[48]}}_N1D1fEv Removed: llvm/trunk/test/FrontendC++/thunk-weak-odr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/thunk-weak-odr.cpp?rev=106568&view=auto ============================================================================== --- llvm/trunk/test/FrontendC++/thunk-weak-odr.cpp (original) +++ llvm/trunk/test/FrontendC++/thunk-weak-odr.cpp (removed) @@ -1,33 +0,0 @@ -// RUN: %llvmgxx %s -S -o - | FileCheck %s -// - -struct A { - virtual int f() { return 1; } -}; - -struct B { - virtual int f() { return 2; } -}; - -struct C : A, B { - virtual int f() { return 3; } -}; - -struct D : C { - virtual int f() { return 4; } -}; - -static int f(D* d) { - B* b = d; - return b->f(); -}; - -int g() { - D d; - return f(&d); -} - -// Thunks should be marked as "weak ODR", not just "weak". -// -// CHECK: define weak_odr i32 @_ZThn{{[48]}}_N1C1fEv -// CHECK: define weak_odr i32 @_ZThn{{[48]}}_N1D1fEv From bruno.cardoso at gmail.com Tue Jun 22 15:30:51 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 22 Jun 2010 20:30:51 -0000 Subject: [llvm-commits] [llvm] r106570 - in /llvm/trunk: test/TableGen/defmclass.td utils/TableGen/TGParser.cpp Message-ID: <20100622203051.0F5D42A6C12C@llvm.org> Author: bruno Date: Tue Jun 22 15:30:50 2010 New Revision: 106570 URL: http://llvm.org/viewvc/llvm-project?rev=106570&view=rev Log: Fix a subtle multiclass bug: when using class inheritance on a toplevel 'defm', make sure to properly resolve references. Modified: llvm/trunk/test/TableGen/defmclass.td llvm/trunk/utils/TableGen/TGParser.cpp Modified: llvm/trunk/test/TableGen/defmclass.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/TableGen/defmclass.td?rev=106570&r1=106569&r2=106570&view=diff ============================================================================== --- llvm/trunk/test/TableGen/defmclass.td (original) +++ llvm/trunk/test/TableGen/defmclass.td Tue Jun 22 15:30:50 2010 @@ -16,6 +16,7 @@ class I op> : BaseI { bits<4> opcode = op; int val = !if(!eq(Prefix, xd.Prefix), 7, 21); + int check = !if(hasVEX_4VPrefix, 0, 10); } multiclass R { @@ -33,4 +34,5 @@ defm SD : R, M, XS; } +// CHECK: int check = 0; defm Instr : Y, VEX; Modified: llvm/trunk/utils/TableGen/TGParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TGParser.cpp?rev=106570&r1=106569&r2=106570&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/TGParser.cpp (original) +++ llvm/trunk/utils/TableGen/TGParser.cpp Tue Jun 22 15:30:50 2010 @@ -2020,7 +2020,6 @@ } } else { Records.addDef(CurRec); - CurRec->resolveReferences(); } NewRecDefs.push_back(CurRec); @@ -2064,9 +2063,6 @@ if (SetValue(CurRec, LetStack[i][j].Loc, LetStack[i][j].Name, LetStack[i][j].Bits, LetStack[i][j].Value)) return true; - - if (!CurMultiClass) - CurRec->resolveReferences(); } if (Lex.getCode() != tgtok::comma) break; @@ -2075,6 +2071,10 @@ } } + if (!CurMultiClass) + for (unsigned i = 0, e = NewRecDefs.size(); i != e; ++i) + NewRecDefs[i]->resolveReferences(); + if (Lex.getCode() != tgtok::semi) return TokError("expected ';' at end of defm"); Lex.Lex(); From dalej at apple.com Tue Jun 22 15:39:19 2010 From: dalej at apple.com (Dale Johannesen) Date: Tue, 22 Jun 2010 13:39:19 -0700 Subject: [llvm-commits] [llvm] r106038 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp test/CodeGen/Generic/v-binop-widen.ll test/CodeGen/Generic/v-binop-widen2.ll In-Reply-To: <3A609326-9D02-4BB1-A196-6FA92A708FE0@2pi.dk> References: <20100615202905.4C9A42A6C12C@llvm.org> <86890B00-CE41-41F8-AC07-EF87AAA2CC41@apple.com> <8BB70DCD-CA07-4568-BCCD-0BCD6CE38F04@2pi.dk> <20100617141737.GA10744@hutcs.cs.hut.fi> <4CF4293B-A1ED-403B-80DB-E95724CB0707@apple.com> <3A609326-9D02-4BB1-A196-6FA92A708FE0@2pi.dk> Message-ID: On Jun 22, 2010, at 12:51 PMPDT, Jakob Stoklund Olesen wrote: > > On Jun 22, 2010, at 12:46 PM, Mon Ping Wang wrote: > >> >> Sorry for the delay. I moved them to x86 directory. >> >> -- Mon Ping > > Thanks, Mon Ping. > > The ppc and arm buildbots should go green after this. The tests might need SSE specified too. Let me try it real quick. From ggreif at gmail.com Tue Jun 22 15:40:38 2010 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 22 Jun 2010 20:40:38 -0000 Subject: [llvm-commits] [llvm] r106573 - /llvm/trunk/lib/VMCore/AutoUpgrade.cpp Message-ID: <20100622204038.2C4342A6C12D@llvm.org> Author: ggreif Date: Tue Jun 22 15:40:38 2010 New Revision: 106573 URL: http://llvm.org/viewvc/llvm-project?rev=106573&view=rev Log: use high-level accessors Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AutoUpgrade.cpp?rev=106573&r1=106572&r2=106573&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AutoUpgrade.cpp (original) +++ llvm/trunk/lib/VMCore/AutoUpgrade.cpp Tue Jun 22 15:40:38 2010 @@ -344,11 +344,11 @@ if (isLoadH || isLoadL || isMovL || isMovSD || isShufPD || isUnpckhPD || isUnpcklPD || isPunpckhQPD || isPunpcklQPD) { std::vector Idxs; - Value *Op0 = CI->getOperand(1); + Value *Op0 = CI->getArgOperand(0); ShuffleVectorInst *SI = NULL; if (isLoadH || isLoadL) { Value *Op1 = UndefValue::get(Op0->getType()); - Value *Addr = new BitCastInst(CI->getOperand(2), + Value *Addr = new BitCastInst(CI->getArgOperand(1), Type::getDoublePtrTy(C), "upgraded.", CI); Value *Load = new LoadInst(Addr, "upgraded.", false, 8, CI); @@ -381,7 +381,7 @@ SI = new ShuffleVectorInst(ZeroV, Op0, Mask, "upgraded.", CI); } else if (isMovSD || isUnpckhPD || isUnpcklPD || isPunpckhQPD || isPunpcklQPD) { - Value *Op1 = CI->getOperand(2); + Value *Op1 = CI->getArgOperand(1); if (isMovSD) { Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 2)); Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 1)); @@ -395,8 +395,8 @@ Value *Mask = ConstantVector::get(Idxs); SI = new ShuffleVectorInst(Op0, Op1, Mask, "upgraded.", CI); } else if (isShufPD) { - Value *Op1 = CI->getOperand(2); - unsigned MaskVal = cast(CI->getOperand(3))->getZExtValue(); + Value *Op1 = CI->getArgOperand(1); + unsigned MaskVal = cast(CI->getArgOperand(2))->getZExtValue(); Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), MaskVal & 1)); Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), ((MaskVal >> 1) & 1)+2)); @@ -416,8 +416,8 @@ CI->eraseFromParent(); } else if (F->getName() == "llvm.x86.sse41.pmulld") { // Upgrade this set of intrinsics into vector multiplies. - Instruction *Mul = BinaryOperator::CreateMul(CI->getOperand(1), - CI->getOperand(2), + Instruction *Mul = BinaryOperator::CreateMul(CI->getArgOperand(0), + CI->getArgOperand(1), CI->getName(), CI); // Fix up all the uses with our new multiply. @@ -556,10 +556,10 @@ case Intrinsic::x86_mmx_psrl_w: { Value *Operands[2]; - Operands[0] = CI->getOperand(1); + Operands[0] = CI->getArgOperand(0); // Cast the second parameter to the correct type. - BitCastInst *BC = new BitCastInst(CI->getOperand(2), + BitCastInst *BC = new BitCastInst(CI->getArgOperand(1), NewFn->getFunctionType()->getParamType(1), "upgraded.", CI); Operands[1] = BC; @@ -643,8 +643,8 @@ case Intrinsic::memset: { // Add isVolatile const llvm::Type *I1Ty = llvm::Type::getInt1Ty(CI->getContext()); - Value *Operands[5] = { CI->getOperand(1), CI->getOperand(2), - CI->getOperand(3), CI->getOperand(4), + Value *Operands[5] = { CI->getArgOperand(0), CI->getArgOperand(1), + CI->getArgOperand(2), CI->getArgOperand(3), llvm::ConstantInt::get(I1Ty, 0) }; CallInst *NewCI = CallInst::Create(NewFn, Operands, Operands+5, CI->getName(), CI); @@ -726,7 +726,8 @@ if (Function *Declare = M->getFunction("llvm.dbg.declare")) { if (!Declare->use_empty()) { DbgDeclareInst *DDI = cast(Declare->use_back()); - if (!isa(DDI->getOperand(1)) ||!isa(DDI->getOperand(2))) { + if (!isa(DDI->getArgOperand(0)) || + !isa(DDI->getArgOperand(1))) { while (!Declare->use_empty()) { CallInst *CI = cast(Declare->use_back()); CI->eraseFromParent(); From grosbach at apple.com Tue Jun 22 15:52:03 2010 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 22 Jun 2010 20:52:03 -0000 Subject: [llvm-commits] [llvm] r106574 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <20100622205203.2F2A52A6C12C@llvm.org> Author: grosbach Date: Tue Jun 22 15:52:02 2010 New Revision: 106574 URL: http://llvm.org/viewvc/llvm-project?rev=106574&view=rev Log: fix typo Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=106574&r1=106573&r2=106574&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jun 22 15:52:02 2010 @@ -9843,7 +9843,7 @@ // On X86 and X86-64, atomic operations are lowered to locked instructions. // Locked instructions, in turn, have implicit fence semantics (all memory -// operations are flushed before issuing the locked instruction, and the +// operations are flushed before issuing the locked instruction, and they // are not buffered), so we can fold away the common pattern of // fence-atomic-fence. static SDValue PerformMEMBARRIERCombine(SDNode* N, SelectionDAG &DAG) { From dalej at apple.com Tue Jun 22 15:54:03 2010 From: dalej at apple.com (Dale Johannesen) Date: Tue, 22 Jun 2010 20:54:03 -0000 Subject: [llvm-commits] [llvm] r106575 - in /llvm/trunk/test/CodeGen/X86: v-binop-widen.ll v-binop-widen2.ll Message-ID: <20100622205403.E718B2A6C12C@llvm.org> Author: johannes Date: Tue Jun 22 15:54:03 2010 New Revision: 106575 URL: http://llvm.org/viewvc/llvm-project?rev=106575&view=rev Log: Add SSE so these actually pass on non-X86 hosts. Modified: llvm/trunk/test/CodeGen/X86/v-binop-widen.ll llvm/trunk/test/CodeGen/X86/v-binop-widen2.ll Modified: llvm/trunk/test/CodeGen/X86/v-binop-widen.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/v-binop-widen.ll?rev=106575&r1=106574&r2=106575&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/v-binop-widen.ll (original) +++ llvm/trunk/test/CodeGen/X86/v-binop-widen.ll Tue Jun 22 15:54:03 2010 @@ -1,4 +1,4 @@ -; RUN: llc -march=x86 < %s | FileCheck %s +; RUN: llc -march=x86 -mattr=+sse < %s | FileCheck %s ; CHECK: divss ; CHECK: divps ; CHECK: divps Modified: llvm/trunk/test/CodeGen/X86/v-binop-widen2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/v-binop-widen2.ll?rev=106575&r1=106574&r2=106575&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/v-binop-widen2.ll (original) +++ llvm/trunk/test/CodeGen/X86/v-binop-widen2.ll Tue Jun 22 15:54:03 2010 @@ -1,4 +1,4 @@ -; RUN: llc -march=x86 < %s | FileCheck %s +; RUN: llc -march=x86 -mattr=+sse < %s | FileCheck %s %vec = type <6 x float> ; CHECK: divss From dalej at apple.com Tue Jun 22 15:55:03 2010 From: dalej at apple.com (Dale Johannesen) Date: Tue, 22 Jun 2010 13:55:03 -0700 Subject: [llvm-commits] [llvm] r106038 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp test/CodeGen/Generic/v-binop-widen.ll test/CodeGen/Generic/v-binop-widen2.ll In-Reply-To: References: <20100615202905.4C9A42A6C12C@llvm.org> <86890B00-CE41-41F8-AC07-EF87AAA2CC41@apple.com> <8BB70DCD-CA07-4568-BCCD-0BCD6CE38F04@2pi.dk> <20100617141737.GA10744@hutcs.cs.hut.fi> <4CF4293B-A1ED-403B-80DB-E95724CB0707@apple.com> <3A609326-9D02-4BB1-A196-6FA92A708FE0@2pi.dk> Message-ID: On Jun 22, 2010, at 1:39 PMPDT, Dale Johannesen wrote: > > On Jun 22, 2010, at 12:51 PMPDT, Jakob Stoklund Olesen wrote: > >> >> On Jun 22, 2010, at 12:46 PM, Mon Ping Wang wrote: >> >>> >>> Sorry for the delay. I moved them to x86 directory. >>> >>> -- Mon Ping >> >> Thanks, Mon Ping. >> >> The ppc and arm buildbots should go green after this. > > The tests might need SSE specified too. Let me try it real quick. yes, they did. I took care of it. From echristo at apple.com Tue Jun 22 16:01:04 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 22 Jun 2010 21:01:04 -0000 Subject: [llvm-commits] [llvm] r106576 - in /llvm/trunk: autoconf/configure.ac configure include/llvm/Config/config.h.in lib/Support/PrettyStackTrace.cpp Message-ID: <20100622210104.BD1A22A6C12C@llvm.org> Author: echristo Date: Tue Jun 22 16:01:04 2010 New Revision: 106576 URL: http://llvm.org/viewvc/llvm-project?rev=106576&view=rev Log: Look for and use a different darwin crash reporter library. Modified: llvm/trunk/autoconf/configure.ac llvm/trunk/configure llvm/trunk/include/llvm/Config/config.h.in llvm/trunk/lib/Support/PrettyStackTrace.cpp Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=106576&r1=106575&r2=106576&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Tue Jun 22 16:01:04 2010 @@ -1248,6 +1248,10 @@ AC_DEFINE_UNQUOTED([USE_OPROFILE],$USE_OPROFILE, [Define if we have the oprofile JIT-support library]) +dnl gCRAnnotations isn't the function we care about, but it's the only +dnl thing exported. +AC_CHECK_LIB(CrashReporterClient, gCRAnnotations) + dnl===-----------------------------------------------------------------------=== dnl=== dnl=== SECTION 6: Check for header files @@ -1284,6 +1288,9 @@ AC_CHECK_HEADERS([ffi.h ffi/ffi.h]) fi +dnl Try to find Darwin specific crash reporting library. +AC_CHECK_HEADERS([CrashReporterClient.h]) + dnl===-----------------------------------------------------------------------=== dnl=== dnl=== SECTION 7: Check for types and structures Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=106576&r1=106575&r2=106576&view=diff ============================================================================== --- llvm/trunk/configure (original) +++ llvm/trunk/configure Tue Jun 22 16:01:04 2010 @@ -14775,6 +14775,94 @@ +{ echo "$as_me:$LINENO: checking for gCRAnnotations in -lCrashReporterClient" >&5 +echo $ECHO_N "checking for gCRAnnotations in -lCrashReporterClient... $ECHO_C" >&6; } +if test "${ac_cv_lib_CrashReporterClient_gCRAnnotations+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lCrashReporterClient $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gCRAnnotations (); +int +main () +{ +return gCRAnnotations (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_CrashReporterClient_gCRAnnotations=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_CrashReporterClient_gCRAnnotations=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_CrashReporterClient_gCRAnnotations" >&5 +echo "${ECHO_T}$ac_cv_lib_CrashReporterClient_gCRAnnotations" >&6; } +if test $ac_cv_lib_CrashReporterClient_gCRAnnotations = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCRASHREPORTERCLIENT 1 +_ACEOF + + LIBS="-lCrashReporterClient $LIBS" + +fi + + + @@ -16950,6 +17038,176 @@ fi +for ac_header in CrashReporterClient.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to llvmbugs at cs.uiuc.edu ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + { echo "$as_me:$LINENO: checking for HUGE_VAL sanity" >&5 Modified: llvm/trunk/include/llvm/Config/config.h.in URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.in?rev=106576&r1=106575&r2=106576&view=diff ============================================================================== --- llvm/trunk/include/llvm/Config/config.h.in (original) +++ llvm/trunk/include/llvm/Config/config.h.in Tue Jun 22 16:01:04 2010 @@ -63,6 +63,9 @@ /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR +/* Define to 1 if you have the header file. */ +#undef HAVE_CRASHREPORTERCLIENT_H + /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H @@ -175,6 +178,10 @@ /* Set to 1 if the isnan function is found in */ #undef HAVE_ISNAN_IN_MATH_H +/* Define to 1 if you have the `CrashReporterClient' library + (-lCrashReporterClient). */ +#undef HAVE_LIBCRASHREPORTERCLIENT + /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL Modified: llvm/trunk/lib/Support/PrettyStackTrace.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/PrettyStackTrace.cpp?rev=106576&r1=106575&r2=106576&view=diff ============================================================================== --- llvm/trunk/lib/Support/PrettyStackTrace.cpp (original) +++ llvm/trunk/lib/Support/PrettyStackTrace.cpp Tue Jun 22 16:01:04 2010 @@ -12,11 +12,17 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Config/config.h" // Get autoconf configuration settings #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Signals.h" #include "llvm/System/ThreadLocal.h" #include "llvm/ADT/SmallString.h" + +#ifdef HAVE_CRASHREPORTERCLIENT_H +#include +#endif + using namespace llvm; namespace llvm { @@ -49,7 +55,7 @@ } // Integrate with crash reporter. -#ifdef __APPLE__ +#if defined (__APPLE__) && !defined (HAVE_CRASHREPORTERCLIENT_H) static const char *__crashreporter_info__ = 0; asm(".desc ___crashreporter_info__, 0x10"); #endif @@ -71,7 +77,11 @@ } if (!TmpStr.empty()) { +#ifndef HAVE_CRASHREPORTERCLIENT_H __crashreporter_info__ = strdup(std::string(TmpStr.str()).c_str()); +#else + CRSetCrashLogMessage(std::string(TmpStr.str()).c_str()); +#endif errs() << TmpStr.str(); } From echristo at apple.com Tue Jun 22 16:11:51 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 22 Jun 2010 21:11:51 -0000 Subject: [llvm-commits] [llvm] r106577 - in /llvm/trunk/test/MC/AsmParser/X86: x86_32-encoding.s x86_64-encoding.s Message-ID: <20100622211151.64FA12A6C12C@llvm.org> Author: echristo Date: Tue Jun 22 16:11:51 2010 New Revision: 106577 URL: http://llvm.org/viewvc/llvm-project?rev=106577&view=rev Log: Move a 64-bit test to the 64-bit file. Fixes an llvm-mc assertion during test runs. Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=106577&r1=106576&r2=106577&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Tue Jun 22 16:11:51 2010 @@ -9967,12 +9967,6 @@ // CHECK: encoding: [0x66,0x0f,0x3a,0xdf,0x14,0x82,0x80] aeskeygenassist $128, %xmm1, %xmm2 -// rdar://7840289 -// CHECK: pshufb CPI1_0(%rip), %xmm1 -// CHECK: encoding: [0x66,0x0f,0x38,0x00,0x0d,A,A,A,A] -// CHECK: fixup A - offset: 5, value: CPI1_0-4 -pshufb CPI1_0(%rip), %xmm1 - // rdar://7910087 // CHECK: bsfw %bx, %bx // CHECK: encoding: [0x66,0x0f,0xbc,0xdb] Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=106577&r1=106576&r2=106577&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Tue Jun 22 16:11:51 2010 @@ -360,3 +360,9 @@ // CHECK: encoding: [0xc5,0x19,0x55,0x54,0xcb,0xfc] vandnpd -4(%rbx,%rcx,8), %xmm12, %xmm10 +// rdar://7840289 +// CHECK: pshufb CPI1_0(%rip), %xmm1 +// CHECK: encoding: [0x66,0x0f,0x38,0x00,0x0d,A,A,A,A] +// CHECK: fixup A - offset: 5, value: CPI1_0-4 +pshufb CPI1_0(%rip), %xmm1 + From bob.wilson at apple.com Tue Jun 22 17:04:24 2010 From: bob.wilson at apple.com (Bob Wilson) Date: Tue, 22 Jun 2010 22:04:24 -0000 Subject: [llvm-commits] [llvm] r106582 - in /llvm/trunk: lib/Target/ARM/Thumb1InstrInfo.cpp test/CodeGen/ARM/arm-returnaddr.ll Message-ID: <20100622220424.364702A6C12C@llvm.org> Author: bwilson Date: Tue Jun 22 17:04:24 2010 New Revision: 106582 URL: http://llvm.org/viewvc/llvm-project?rev=106582&view=rev Log: Thumb1 functions using @llvm.returnaddress were not saving the incoming LR. Radar 8031193. Modified: llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp llvm/trunk/test/CodeGen/ARM/arm-returnaddr.ll Modified: llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp?rev=106582&r1=106581&r2=106582&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb1InstrInfo.cpp Tue Jun 22 17:04:24 2010 @@ -175,10 +175,10 @@ isKill = false; } - if (isKill) { + if (isKill) MBB.addLiveIn(Reg); - MIB.addReg(Reg, RegState::Kill); - } + + MIB.addReg(Reg, getKillRegState(isKill)); } return true; } Modified: llvm/trunk/test/CodeGen/ARM/arm-returnaddr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/arm-returnaddr.ll?rev=106582&r1=106581&r2=106582&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/arm-returnaddr.ll (original) +++ llvm/trunk/test/CodeGen/ARM/arm-returnaddr.ll Tue Jun 22 17:04:24 2010 @@ -1,11 +1,12 @@ ; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s -; RUN: llc < %s -mtriple=thumbv6-apple-darwin +; RUN: llc < %s -mtriple=thumbv6-apple-darwin | FileCheck %s ; rdar://8015977 ; rdar://8020118 define i8* @rt0(i32 %x) nounwind readnone { entry: ; CHECK: rt0: +; CHECK: {r7, lr} ; CHECK: mov r0, lr %0 = tail call i8* @llvm.returnaddress(i32 0) ret i8* %0 @@ -14,6 +15,7 @@ define i8* @rt2() nounwind readnone { entry: ; CHECK: rt2: +; CHECK: {r7, lr} ; CHECK: ldr r0, [r7] ; CHECK: ldr r0, [r0] ; CHECK: ldr r0, [r0, #4] From stoklund at 2pi.dk Tue Jun 22 17:11:07 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 22 Jun 2010 22:11:07 -0000 Subject: [llvm-commits] [llvm] r106583 - /llvm/trunk/lib/CodeGen/LowerSubregs.cpp Message-ID: <20100622221107.B34662A6C12C@llvm.org> Author: stoklund Date: Tue Jun 22 17:11:07 2010 New Revision: 106583 URL: http://llvm.org/viewvc/llvm-project?rev=106583&view=rev Log: Also convert SUBREG_TO_REG to a KILL when relevant, like the other subreg instructions. This does not affect codegen much because SUBREG_TO_REG is only used by X86 and X86 does not use the register scavenger, but it prevents verifier errors. Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=106583&r1=106582&r2=106583&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original) +++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Tue Jun 22 17:11:07 2010 @@ -166,10 +166,10 @@ MI->getOperand(1).isImm() && (MI->getOperand(2).isReg() && MI->getOperand(2).isUse()) && MI->getOperand(3).isImm() && "Invalid subreg_to_reg"); - + unsigned DstReg = MI->getOperand(0).getReg(); unsigned InsReg = MI->getOperand(2).getReg(); - unsigned InsSIdx = MI->getOperand(2).getSubReg(); + assert(!MI->getOperand(2).getSubReg() && "SubIdx on physreg?"); unsigned SubIdx = MI->getOperand(3).getImm(); assert(SubIdx != 0 && "Invalid index for insert_subreg"); @@ -182,13 +182,18 @@ DEBUG(dbgs() << "subreg: CONVERTING: " << *MI); - if (DstSubReg == InsReg && InsSIdx == 0) { + if (DstSubReg == InsReg) { // No need to insert an identify copy instruction. // Watch out for case like this: - // %RAX = ... - // %RAX = SUBREG_TO_REG 0, %EAX:3, 3 - // The first def is defining RAX, not EAX so the top bits were not - // zero extended. + // %RAX = SUBREG_TO_REG 0, %EAX, 3 + // We must leave %RAX live. + if (DstReg != InsReg) { + MI->setDesc(TII->get(TargetOpcode::KILL)); + MI->RemoveOperand(3); // SubIdx + MI->RemoveOperand(1); // Imm + DEBUG(dbgs() << "subreg: replace by: " << *MI); + return true; + } DEBUG(dbgs() << "subreg: eliminated!"); } else { // Insert sub-register copy From isanbard at gmail.com Tue Jun 22 17:16:17 2010 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 22 Jun 2010 22:16:17 -0000 Subject: [llvm-commits] [llvm] r106586 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Message-ID: <20100622221617.8A8F02A6C12C@llvm.org> Author: void Date: Tue Jun 22 17:16:17 2010 New Revision: 106586 URL: http://llvm.org/viewvc/llvm-project?rev=106586&view=rev Log: Fix the formatting of the switch statement and add a missing break. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=106586&r1=106585&r2=106586&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Tue Jun 22 17:16:17 2010 @@ -3007,16 +3007,16 @@ EVT VT = Load1->getValueType(0); switch (VT.getSimpleVT().SimpleTy) { - default: { + default: // XMM registers. In 64-bit mode we can be a bit more aggressive since we // have 16 of them to play with. if (TM.getSubtargetImpl()->is64Bit()) { if (NumLoads >= 3) return false; - } else if (NumLoads) + } else if (NumLoads) { return false; + } break; - } case MVT::i8: case MVT::i16: case MVT::i32: @@ -3025,6 +3025,7 @@ case MVT::f64: if (NumLoads) return false; + break; } return true; From jan_sjodin at yahoo.com Tue Jun 22 17:37:37 2010 From: jan_sjodin at yahoo.com (Jan Sjodin) Date: Tue, 22 Jun 2010 15:37:37 -0700 (PDT) Subject: [llvm-commits] Issue with Win64 local area stack offset Message-ID: <489333.28347.qm@web55604.mail.re4.yahoo.com> I did another experiment and made sure the slow isel was exercised. With the example below we need to push two arguments on the stack which should be above the shadow area. I updated the patch to do the right thing and it now does the same thing as fast isel. The shadow area is simply pushed before any arguments are analyzed on the caller/callee side. Example: %structType = type <{ <16 x i32> }> define i64 @myfun(i64 %arg0, i64 %arg1, i64 %arg2, i64 %arg3, i64 %arg4, i64 %arg5) nounwind { entry: %test.i = alloca %structType, align 64 %conv4.i = ptrtoint %structType* %test.i to i64 %tmp0 = add i64 %conv4.i, %arg0 %tmp1 = add i64 %tmp0, %arg1 %tmp2 = add i64 %tmp1, %arg2 %tmp3 = add i64 %tmp2, %arg3 %tmp4 = add i64 %tmp3, %arg4 %tmp5 = add i64 %tmp4, %arg5 ret i64 %tmp5 } define i64 @myfuncaller() nounwind { %temp = call i64 @myfun(i64 0, i64 0, i64 0, i64 0, i64 0, i64 0) ret i64 %temp } Generated code with new patch: _myfun: # @myfun # BB#0: # %entry pushq %rbp movq %rsp, %rbp subq $112, %rsp leaq -112(%rbp,%rcx), %rax addq %rdx, %rax addq %r8, %rax addq %r9, %rax addq 48(%rbp), %rax addq 56(%rbp), %rax addq $112, %rsp popq %rbp ret .def _myfuncaller; .scl 2; .type 32; .endef .globl _myfuncaller .align 16, 0x90 _myfuncaller: # @myfuncaller # BB#0: pushq %rbp movq %rsp, %rbp subq $48, %rsp # <-- 16 bytes arg + 32 bytes shadow area xorl %ecx, %ecx xorl %edx, %edx xorl %r8d, %r8d xorl %r9d, %r9d movq $0, 40(%rsp) # <-- offsets above shadow area movq $0, 32(%rsp) call _myfun addq $48, %rsp popq %rbp ret Index: lib/Target/X86/X86RegisterInfo.cpp =================================================================== --- lib/Target/X86/X86RegisterInfo.cpp (revision 106454) +++ lib/Target/X86/X86RegisterInfo.cpp (working copy) @@ -914,9 +914,6 @@ StackSize = std::max(MinSize, StackSize > 128 ? StackSize - 128 : 0); MFI->setStackSize(StackSize); } else if (Subtarget->isTargetWin64()) { - // We need to always allocate 32 bytes as register spill area. - // FIXME: We might reuse these 32 bytes for leaf functions. - StackSize += 32; MFI->setStackSize(StackSize); } Index: lib/Target/X86/X86ISelLowering.cpp =================================================================== --- lib/Target/X86/X86ISelLowering.cpp (revision 106454) +++ lib/Target/X86/X86ISelLowering.cpp (working copy) @@ -1521,6 +1521,12 @@ SmallVector ArgLocs; CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs, *DAG.getContext()); + + // Allocate shadow area for Win64 + if (IsWin64) { + CCInfo.AllocateStack(32, 8); + } + CCInfo.AnalyzeFormalArguments(Ins, CCAssignFnForNode(CallConv)); unsigned LastVal = ~0U; @@ -1746,8 +1752,7 @@ DebugLoc dl, SelectionDAG &DAG, const CCValAssign &VA, ISD::ArgFlagsTy Flags) const { - const unsigned FirstStackArgOffset = (Subtarget->isTargetWin64() ? 32 : 0); - unsigned LocMemOffset = FirstStackArgOffset + VA.getLocMemOffset(); + unsigned LocMemOffset = VA.getLocMemOffset(); SDValue PtrOff = DAG.getIntPtrConstant(LocMemOffset); PtrOff = DAG.getNode(ISD::ADD, dl, getPointerTy(), StackPtr, PtrOff); if (Flags.isByVal()) { @@ -1829,6 +1834,12 @@ SmallVector ArgLocs; CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs, *DAG.getContext()); + + // Allocate shadow area for Win64 + if (Subtarget->isTargetWin64()) { + CCInfo.AllocateStack(32, 8); + } + CCInfo.AnalyzeCallOperands(Outs, CCAssignFnForNode(CallConv)); // Get a count of how many bytes are to be pushed on the stack. Index: lib/Target/X86/X86TargetMachine.cpp =================================================================== --- lib/Target/X86/X86TargetMachine.cpp (revision 106454) +++ lib/Target/X86/X86TargetMachine.cpp (working copy) @@ -100,7 +100,7 @@ DataLayout(Subtarget.getDataLayout()), FrameInfo(TargetFrameInfo::StackGrowsDown, Subtarget.getStackAlignment(), - (Subtarget.isTargetWin64() ? -40 : + (Subtarget.isTargetWin64() ? -8 : (Subtarget.is64Bit() ? -8 : -4))), InstrInfo(*this), JITInfo(*this), TLInfo(*this), TSInfo(*this), ELFWriterInfo(*this) { From bruno.cardoso at gmail.com Tue Jun 22 17:38:56 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 22 Jun 2010 22:38:56 -0000 Subject: [llvm-commits] [llvm] r106588 - in /llvm/trunk: lib/Target/X86/X86InstrFormats.td lib/Target/X86/X86InstrInfo.h lib/Target/X86/X86InstrSSE.td lib/Target/X86/X86MCCodeEmitter.cpp test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100622223857.170FD2A6C12C@llvm.org> Author: bruno Date: Tue Jun 22 17:38:56 2010 New Revision: 106588 URL: http://llvm.org/viewvc/llvm-project?rev=106588&view=rev Log: Add AVX MOV{SS,SD}{rr,rm} instructions Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td llvm/trunk/lib/Target/X86/X86InstrInfo.h llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFormats.td?rev=106588&r1=106587&r2=106588&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFormats.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFormats.td Tue Jun 22 17:38:56 2010 @@ -83,7 +83,6 @@ class OpSize { bit hasOpSizePrefix = 1; } class AdSize { bit hasAdSizePrefix = 1; } class REX_W { bit hasREX_WPrefix = 1; } -class VEX_4V { bit hasVEX_4VPrefix = 1; } class LOCK { bit hasLockPrefix = 1; } class SegFS { bits<2> SegOvrBits = 1; } class SegGS { bits<2> SegOvrBits = 2; } @@ -102,6 +101,8 @@ class T8 { bits<4> Prefix = 13; } class TA { bits<4> Prefix = 14; } class TF { bits<4> Prefix = 15; } +class VEX { bit hasVEXPrefix = 1; } +class VEX_4V : VEX { bit hasVEX_4VPrefix = 1; } class X86Inst opcod, Format f, ImmType i, dag outs, dag ins, string AsmStr, Domain d = GenericDomain> @@ -125,11 +126,12 @@ bits<4> Prefix = 0; // Which prefix byte does this inst have? bit hasREX_WPrefix = 0; // Does this inst requires the REX.W prefix? - bit hasVEX_4VPrefix = 0; // Does this inst requires the VEX.VVVV prefix? FPFormat FPForm = NotFP; // What flavor of FP instruction is this? bit hasLockPrefix = 0; // Does this inst have a 0xF0 prefix? bits<2> SegOvrBits = 0; // Segment override prefix. Domain ExeDomain = d; + bit hasVEXPrefix = 0; // Does this inst requires a VEX prefix? + bit hasVEX_4VPrefix = 0; // Does this inst requires the VEX.VVVV field? // TSFlags layout should be kept in sync with X86InstrInfo.h. let TSFlags{5-0} = FormBits; @@ -143,7 +145,8 @@ let TSFlags{21-20} = SegOvrBits; let TSFlags{23-22} = ExeDomain.Value; let TSFlags{31-24} = Opcode; - let TSFlags{32} = hasVEX_4VPrefix; + let TSFlags{32} = hasVEXPrefix; + let TSFlags{33} = hasVEX_4VPrefix; } class I o, Format f, dag outs, dag ins, string asm, @@ -217,24 +220,24 @@ // SI - SSE 1 & 2 scalar instructions class SI o, Format F, dag outs, dag ins, string asm, list pattern> : I { - let Predicates = !if(hasVEX_4VPrefix /* VEX_4V */, + let Predicates = !if(hasVEXPrefix /* VEX_4V */, !if(!eq(Prefix, 11 /* XD */), [HasAVX, HasSSE2], [HasAVX, HasSSE1]), !if(!eq(Prefix, 12 /* XS */), [HasSSE1], [HasSSE2])); // AVX instructions have a 'v' prefix in the mnemonic - let AsmString = !if(hasVEX_4VPrefix, !strconcat("v", asm), asm); + let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm); } // PI - SSE 1 & 2 packed instructions class PI o, Format F, dag outs, dag ins, string asm, list pattern, Domain d> : I { - let Predicates = !if(hasVEX_4VPrefix /* VEX_4V */, + let Predicates = !if(hasVEXPrefix /* VEX_4V */, !if(hasOpSizePrefix /* OpSize */, [HasAVX, HasSSE2], [HasAVX, HasSSE1]), !if(hasOpSizePrefix /* OpSize */, [HasSSE2], [HasSSE1])); // AVX instructions have a 'v' prefix in the mnemonic - let AsmString = !if(hasVEX_4VPrefix, !strconcat("v", asm), asm); + let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm); } // SSE1 Instruction Templates: Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=106588&r1=106587&r2=106588&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Tue Jun 22 17:38:56 2010 @@ -424,13 +424,14 @@ // those enums below are used, TSFlags must be shifted right by 32 first. enum { //===------------------------------------------------------------------===// - // VEX_4V - VEX prefixes are instruction prefixes used in AVX. + // VEXPrefix - VEX prefixes are instruction prefixes used in AVX. // VEX_4V is used to specify an additional AVX/SSE register. Several 2 // address instructions in SSE are represented as 3 address ones in AVX // and the additional register is encoded in VEX_VVVV prefix. // VEXShift = 0, - VEX_4V = 1 << VEXShift + VEX = 1 << VEXShift, + VEX_4V = 2 << VEXShift }; // getBaseOpcodeFor - This function returns the "base" X86 opcode for the Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106588&r1=106587&r2=106588&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jun 22 17:38:56 2010 @@ -496,33 +496,48 @@ // SSE 1 & 2 - Move Instructions //===----------------------------------------------------------------------===// +class sse12_move_rr : + SI<0x10, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src1, RC:$src2), asm, + [(set (vt VR128:$dst), (movl VR128:$src1, (scalar_to_vector RC:$src2)))]>; + +// Loading from memory automatically zeroing upper bits. +class sse12_move_rm : + SI<0x10, MRMSrcMem, (outs RC:$dst), (ins x86memop:$src), + !strconcat(OpcodeStr, "\t{$src, $dst|$dst, $src}"), + [(set RC:$dst, (mem_pat addr:$src))]>; + // Move Instructions. Register-to-register movss/movsd is not used for FR32/64 // register copies because it's a partial register update; FsMOVAPSrr/FsMOVAPDrr // is used instead. Register-to-register movss/movsd is not modeled as an // INSERT_SUBREG because INSERT_SUBREG requires that the insert be implementable // in terms of a copy, and just mentioned, we don't use movss/movsd for copies. +let isAsmParserOnly = 1 in { + def VMOVSSrr : sse12_move_rr, XS, VEX_4V; + def VMOVSDrr : sse12_move_rr, XD, VEX_4V; + + let canFoldAsLoad = 1, isReMaterializable = 1 in { + def VMOVSSrm : sse12_move_rm, XS, VEX; + + let AddedComplexity = 20 in + def VMOVSDrm : sse12_move_rm, XD, VEX; + } +} + let Constraints = "$src1 = $dst" in { -def MOVSSrr : SSI<0x10, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, FR32:$src2), - "movss\t{$src2, $dst|$dst, $src2}", - [(set (v4f32 VR128:$dst), - (movl VR128:$src1, (scalar_to_vector FR32:$src2)))]>; -def MOVSDrr : SDI<0x10, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, FR64:$src2), - "movsd\t{$src2, $dst|$dst, $src2}", - [(set (v2f64 VR128:$dst), - (movl VR128:$src1, (scalar_to_vector FR64:$src2)))]>; + def MOVSSrr : sse12_move_rr, XS; + def MOVSDrr : sse12_move_rr, XD; } -// Loading from memory automatically zeroing upper bits. let canFoldAsLoad = 1, isReMaterializable = 1 in { -def MOVSSrm : SSI<0x10, MRMSrcMem, (outs FR32:$dst), (ins f32mem:$src), - "movss\t{$src, $dst|$dst, $src}", - [(set FR32:$dst, (loadf32 addr:$src))]>; -let AddedComplexity = 20 in -def MOVSDrm : SDI<0x10, MRMSrcMem, (outs FR64:$dst), (ins f64mem:$src), - "movsd\t{$src, $dst|$dst, $src}", - [(set FR64:$dst, (loadf64 addr:$src))]>; + def MOVSSrm : sse12_move_rm, XS; + + let AddedComplexity = 20 in + def MOVSDrm : sse12_move_rm, XD; } let AddedComplexity = 15 in { @@ -574,6 +589,15 @@ "movsd\t{$src, $dst|$dst, $src}", [(store FR64:$src, addr:$dst)]>; +let isAsmParserOnly = 1 in { +def VMOVSSmr : SI<0x11, MRMDestMem, (outs), (ins f32mem:$dst, FR32:$src), + "movss\t{$src, $dst|$dst, $src}", + [(store FR32:$src, addr:$dst)]>, XS, VEX_4V; +def VMOVSDmr : SI<0x11, MRMDestMem, (outs), (ins f64mem:$dst, FR64:$src), + "movsd\t{$src, $dst|$dst, $src}", + [(store FR64:$src, addr:$dst)]>, XD, VEX_4V; +} + // Extract and store. def : Pat<(store (f32 (vector_extract (v4f32 VR128:$src), (iPTR 0))), addr:$dst), Modified: llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp?rev=106588&r1=106587&r2=106588&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86MCCodeEmitter.cpp Tue Jun 22 17:38:56 2010 @@ -714,15 +714,21 @@ // Keep track of the current byte being emitted. unsigned CurByte = 0; - // Is this instruction encoded in AVX form? - bool IsAVXForm = false; + // Is this instruction encoded using the AVX VEX prefix? + bool HasVEXPrefix = false; + + // It uses the VEX.VVVV field? + bool HasVEX_4V = false; + + if ((TSFlags >> 32) & X86II::VEX) + HasVEXPrefix = true; if ((TSFlags >> 32) & X86II::VEX_4V) - IsAVXForm = true; + HasVEX_4V = true; // FIXME: We should emit the prefixes in exactly the same order as GAS does, // in order to provide diffability. - if (!IsAVXForm) + if (!HasVEXPrefix) EmitOpcodePrefix(TSFlags, CurByte, MI, Desc, OS); else EmitVEXOpcodePrefix(TSFlags, CurByte, MI, Desc, OS); @@ -772,7 +778,7 @@ EmitByte(BaseOpcode, CurByte, OS); SrcRegNum = CurOp + 1; - if (IsAVXForm) // Skip 1st src (which is encoded in VEX_VVVV) + if (HasVEX_4V) // Skip 1st src (which is encoded in VEX_VVVV) SrcRegNum++; EmitRegModRMByte(MI.getOperand(SrcRegNum), @@ -783,7 +789,7 @@ case X86II::MRMSrcMem: { int AddrOperands = X86AddrNumOperands; unsigned FirstMemOp = CurOp+1; - if (IsAVXForm) { + if (HasVEX_4V) { ++AddrOperands; ++FirstMemOp; // Skip the register source (which is encoded in VEX_VVVV). } Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=106588&r1=106587&r2=106588&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Tue Jun 22 17:38:56 2010 @@ -10302,3 +10302,19 @@ // CHECK: encoding: [0xc5,0xe9,0x55,0x6c,0xcb,0xfc] vandnpd -4(%ebx,%ecx,8), %xmm2, %xmm5 +// CHECK: vmovss -4(%ebx,%ecx,8), %xmm5 +// CHECK: encoding: [0xc5,0xfa,0x10,0x6c,0xcb,0xfc] + vmovss -4(%ebx,%ecx,8), %xmm5 + +// CHECK: vmovss %xmm4, %xmm2, %xmm5 +// CHECK: encoding: [0xc5,0xea,0x10,0xec] + vmovss %xmm4, %xmm2, %xmm5 + +// CHECK: vmovsd -4(%ebx,%ecx,8), %xmm5 +// CHECK: encoding: [0xc5,0xfb,0x10,0x6c,0xcb,0xfc] + vmovsd -4(%ebx,%ecx,8), %xmm5 + +// CHECK: vmovsd %xmm4, %xmm2, %xmm5 +// CHECK: encoding: [0xc5,0xeb,0x10,0xec] + vmovsd %xmm4, %xmm2, %xmm5 + Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=106588&r1=106587&r2=106588&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Tue Jun 22 17:38:56 2010 @@ -360,6 +360,22 @@ // CHECK: encoding: [0xc5,0x19,0x55,0x54,0xcb,0xfc] vandnpd -4(%rbx,%rcx,8), %xmm12, %xmm10 +// CHECK: vmovss -4(%rbx,%rcx,8), %xmm10 +// CHECK: encoding: [0xc5,0x7a,0x10,0x54,0xcb,0xfc] + vmovss -4(%rbx,%rcx,8), %xmm10 + +// CHECK: vmovss %xmm14, %xmm10, %xmm15 +// CHECK: encoding: [0xc4,0x41,0x2a,0x10,0xfe] + vmovss %xmm14, %xmm10, %xmm15 + +// CHECK: vmovsd -4(%rbx,%rcx,8), %xmm10 +// CHECK: encoding: [0xc5,0x7b,0x10,0x54,0xcb,0xfc] + vmovsd -4(%rbx,%rcx,8), %xmm10 + +// CHECK: vmovsd %xmm14, %xmm10, %xmm15 +// CHECK: encoding: [0xc4,0x41,0x2b,0x10,0xfe] + vmovsd %xmm14, %xmm10, %xmm15 + // rdar://7840289 // CHECK: pshufb CPI1_0(%rip), %xmm1 // CHECK: encoding: [0x66,0x0f,0x38,0x00,0x0d,A,A,A,A] From dpatel at apple.com Tue Jun 22 17:50:42 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 22 Jun 2010 22:50:42 -0000 Subject: [llvm-commits] [llvm] r106591 - /llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Message-ID: <20100622225042.73D962A6C12C@llvm.org> Author: dpatel Date: Tue Jun 22 17:50:42 2010 New Revision: 106591 URL: http://llvm.org/viewvc/llvm-project?rev=106591&view=rev Log: While cloning a module, clone metadata attached with instructions. Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneModule.cpp?rev=106591&r1=106590&r2=106591&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneModule.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Tue Jun 22 17:50:42 2010 @@ -133,6 +133,21 @@ NamedMDNode::Create(New->getContext(), NMD.getName(), MDs.data(), MDs.size(), New); } - + + // Update metadata attach with instructions. + for (Module::iterator MI = New->begin(), ME = New->end(); MI != ME; ++MI) + for (Function::iterator FI = MI->begin(), FE = MI->end(); + FI != FE; ++FI) + for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); + BI != BE; ++BI) { + SmallVector, 4 > MDs; + BI->getAllMetadata(MDs); + for (SmallVector, 4>::iterator + MDI = MDs.begin(), MDE = MDs.end(); MDI != MDE; ++MDI) { + Value *MappedValue = MapValue(MDI->second, ValueMap); + if (MDI->second != MappedValue && MappedValue) + BI->setMetadata(MDI->first, cast(MappedValue)); + } + } return New; } From dpatel at apple.com Tue Jun 22 17:53:21 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 22 Jun 2010 22:53:21 -0000 Subject: [llvm-commits] [llvm] r106592 - /llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Message-ID: <20100622225321.C458A2A6C12C@llvm.org> Author: dpatel Date: Tue Jun 22 17:53:21 2010 New Revision: 106592 URL: http://llvm.org/viewvc/llvm-project?rev=106592&view=rev Log: If a metadata operand is seeded in value map and the metadata should also be seeded in value map. This is not limited to function local metadata. Failure to seed metdata in such cases causes troubles when in a cloned module, metadata from a new module refers to values in old module. Usually this results in mysterious bugpoint crashes. For example, Checking to see if we can delete global inits: Unknown constant! UNREACHABLE executed at /d/g/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:904! Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp?rev=106592&r1=106591&r2=106592&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Tue Jun 22 17:53:21 2010 @@ -21,23 +21,44 @@ using namespace llvm; Value *llvm::MapValue(const Value *V, ValueToValueMapTy &VM) { - Value *&VMSlot = VM[V]; - if (VMSlot) return VMSlot; // Does it exist in the map yet? + ValueToValueMapTy::iterator VMI = VM.find(V); + if (VMI != VM.end()) + return VMI->second; // Does it exist in the map yet? - // NOTE: VMSlot can be invalidated by any reference to VM, which can grow the - // DenseMap. This includes any recursive calls to MapValue. - - // Global values and non-function-local metadata do not need to be seeded into + // Global values, metadata strings and inline asm do not need to be seeded into // the ValueMap if they are using the identity mapping. - if (isa(V) || isa(V) || isa(V) || - (isa(V) && !cast(V)->isFunctionLocal())) - return VMSlot = const_cast(V); + if (isa(V) || isa(V) || isa(V)) { + VM.insert(std::make_pair(V, const_cast(V))); + return const_cast(V); + } if (const MDNode *MD = dyn_cast(V)) { + // Insert a place holder in map to handle mdnode cycles. + Value *TmpV = MDString::get(V->getContext(), + std::string("llvm.md.clone.tmp." + VM.size())); + VM.insert(std::make_pair(V, MDNode::get(V->getContext(), &TmpV, 1))); + + bool ReuseMD = true; SmallVector Elts; - for (unsigned i = 0, e = MD->getNumOperands(); i != e; ++i) - Elts.push_back(MD->getOperand(i) ? MapValue(MD->getOperand(i), VM) : 0); - return VM[V] = MDNode::get(V->getContext(), Elts.data(), Elts.size()); + // If metadata element is mapped to a new value then seed metadata + // in the map. + for (unsigned i = 0, e = MD->getNumOperands(); i != e; ++i) { + if (!MD->getOperand(i)) + Elts.push_back(0); + else { + Value *MappedOp = MapValue(MD->getOperand(i), VM); + if (MappedOp != MD->getOperand(i)) + ReuseMD = false; + Elts.push_back(MappedOp); + } + } + if (ReuseMD) { + VM.insert(std::make_pair(V, const_cast(V))); + return const_cast(V); + } + MDNode *NewMD = MDNode::get(V->getContext(), Elts.data(), Elts.size()); + VM.insert(std::make_pair(V, NewMD)); + return NewMD; } Constant *C = const_cast(dyn_cast(V)); @@ -46,7 +67,7 @@ if (isa(C) || isa(C) || isa(C) || isa(C) || isa(C) || isa(C)) - return VMSlot = C; // Primitive constants map directly + return VM[V] = C; // Primitive constants map directly if (ConstantArray *CA = dyn_cast(C)) { for (User::op_iterator b = CA->op_begin(), i = b, e = CA->op_end(); From bruno.cardoso at gmail.com Tue Jun 22 18:02:38 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 22 Jun 2010 23:02:38 -0000 Subject: [llvm-commits] [llvm] r106593 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100622230239.0CD6A2A6C12C@llvm.org> Author: bruno Date: Tue Jun 22 18:02:38 2010 New Revision: 106593 URL: http://llvm.org/viewvc/llvm-project?rev=106593&view=rev Log: Reapply support for AVX unpack and interleave instructions, with testcases this time. Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106593&r1=106592&r2=106593&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jun 22 18:02:38 2010 @@ -444,6 +444,22 @@ RC:$src1, (mem_frag addr:$src2)))], d>; } +/// sse12_unpack_interleave - SSE 1 & 2 unpack and interleave +multiclass sse12_unpack_interleave opc, PatFrag OpNode, ValueType vt, + PatFrag mem_frag, RegisterClass RC, + X86MemOperand x86memop, string asm, + Domain d> { + def rr : PI; + def rm : PI; +} + //===----------------------------------------------------------------------===// // SSE1 Instructions //===----------------------------------------------------------------------===// @@ -1388,50 +1404,32 @@ VR128:$src1, (memopv2f64 addr:$src2))))]>; let AddedComplexity = 10 in { - def UNPCKHPSrr : PSI<0x15, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), - "unpckhps\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4f32 (unpckh VR128:$src1, VR128:$src2)))]>; - def UNPCKHPSrm : PSI<0x15, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), - "unpckhps\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4f32 (unpckh VR128:$src1, - (memopv4f32 addr:$src2))))]>; - - def UNPCKLPSrr : PSI<0x14, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), - "unpcklps\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v4f32 (unpckl VR128:$src1, VR128:$src2)))]>; - def UNPCKLPSrm : PSI<0x14, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), - "unpcklps\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (unpckl VR128:$src1, (memopv4f32 addr:$src2)))]>; - def UNPCKHPDrr : PDI<0x15, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), - "unpckhpd\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2f64 (unpckh VR128:$src1, VR128:$src2)))]>; - def UNPCKHPDrm : PDI<0x15, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), - "unpckhpd\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2f64 (unpckh VR128:$src1, - (memopv2f64 addr:$src2))))]>; - - def UNPCKLPDrr : PDI<0x14, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src2), - "unpcklpd\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (v2f64 (unpckl VR128:$src1, VR128:$src2)))]>; - def UNPCKLPDrm : PDI<0x14, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src2), - "unpcklpd\t{$src2, $dst|$dst, $src2}", - [(set VR128:$dst, - (unpckl VR128:$src1, (memopv2f64 addr:$src2)))]>; + let Constraints = "", isAsmParserOnly = 1 in { + defm VUNPCKHPS: sse12_unpack_interleave<0x15, unpckh, v4f32, memopv4f32, + VR128, f128mem, "unpckhps\t{$src2, $src1, $dst|$dst, $src1, $src2}", + SSEPackedSingle>, VEX_4V; + defm VUNPCKHPD: sse12_unpack_interleave<0x15, unpckh, v2f64, memopv2f64, + VR128, f128mem, "unpckhpd\t{$src2, $src1, $dst|$dst, $src1, $src2}", + SSEPackedDouble>, OpSize, VEX_4V; + defm VUNPCKLPS: sse12_unpack_interleave<0x14, unpckl, v4f32, memopv4f32, + VR128, f128mem, "unpcklps\t{$src2, $src1, $dst|$dst, $src1, $src2}", + SSEPackedSingle>, VEX_4V; + defm VUNPCKLPD: sse12_unpack_interleave<0x14, unpckl, v2f64, memopv2f64, + VR128, f128mem, "unpcklpd\t{$src2, $src1, $dst|$dst, $src1, $src2}", + SSEPackedDouble>, OpSize, VEX_4V; + } + defm UNPCKHPS: sse12_unpack_interleave<0x15, unpckh, v4f32, memopv4f32, + VR128, f128mem, "unpckhps\t{$src2, $dst|$dst, $src2}", + SSEPackedSingle>, TB; + defm UNPCKHPD: sse12_unpack_interleave<0x15, unpckh, v2f64, memopv2f64, + VR128, f128mem, "unpckhpd\t{$src2, $dst|$dst, $src2}", + SSEPackedDouble>, TB, OpSize; + defm UNPCKLPS: sse12_unpack_interleave<0x14, unpckl, v4f32, memopv4f32, + VR128, f128mem, "unpcklps\t{$src2, $dst|$dst, $src2}", + SSEPackedSingle>, TB; + defm UNPCKLPD: sse12_unpack_interleave<0x14, unpckl, v2f64, memopv2f64, + VR128, f128mem, "unpcklpd\t{$src2, $dst|$dst, $src2}", + SSEPackedDouble>, TB, OpSize; } // AddedComplexity } // Constraints = "$src1 = $dst" Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=106593&r1=106592&r2=106593&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Tue Jun 22 18:02:38 2010 @@ -10318,3 +10318,35 @@ // CHECK: encoding: [0xc5,0xeb,0x10,0xec] vmovsd %xmm4, %xmm2, %xmm5 +// CHECK: vunpckhps %xmm1, %xmm2, %xmm4 +// CHECK: encoding: [0xc5,0xe8,0x15,0xe1] + vunpckhps %xmm1, %xmm2, %xmm4 + +// CHECK: vunpckhpd %xmm1, %xmm2, %xmm4 +// CHECK: encoding: [0xc5,0xe9,0x15,0xe1] + vunpckhpd %xmm1, %xmm2, %xmm4 + +// CHECK: vunpcklps %xmm1, %xmm2, %xmm4 +// CHECK: encoding: [0xc5,0xe8,0x14,0xe1] + vunpcklps %xmm1, %xmm2, %xmm4 + +// CHECK: vunpcklpd %xmm1, %xmm2, %xmm4 +// CHECK: encoding: [0xc5,0xe9,0x14,0xe1] + vunpcklpd %xmm1, %xmm2, %xmm4 + +// CHECK: vunpckhps -4(%ebx,%ecx,8), %xmm2, %xmm5 +// CHECK: encoding: [0xc5,0xe8,0x15,0x6c,0xcb,0xfc] + vunpckhps -4(%ebx,%ecx,8), %xmm2, %xmm5 + +// CHECK: vunpckhpd -4(%ebx,%ecx,8), %xmm2, %xmm5 +// CHECK: encoding: [0xc5,0xe9,0x15,0x6c,0xcb,0xfc] + vunpckhpd -4(%ebx,%ecx,8), %xmm2, %xmm5 + +// CHECK: vunpcklps -4(%ebx,%ecx,8), %xmm2, %xmm5 +// CHECK: encoding: [0xc5,0xe8,0x14,0x6c,0xcb,0xfc] + vunpcklps -4(%ebx,%ecx,8), %xmm2, %xmm5 + +// CHECK: vunpcklpd -4(%ebx,%ecx,8), %xmm2, %xmm5 +// CHECK: encoding: [0xc5,0xe9,0x14,0x6c,0xcb,0xfc] + vunpcklpd -4(%ebx,%ecx,8), %xmm2, %xmm5 + Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=106593&r1=106592&r2=106593&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Tue Jun 22 18:02:38 2010 @@ -382,3 +382,35 @@ // CHECK: fixup A - offset: 5, value: CPI1_0-4 pshufb CPI1_0(%rip), %xmm1 +// CHECK: vunpckhps %xmm15, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0x15,0xef] + vunpckhps %xmm15, %xmm12, %xmm13 + +// CHECK: vunpckhpd %xmm15, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x19,0x15,0xef] + vunpckhpd %xmm15, %xmm12, %xmm13 + +// CHECK: vunpcklps %xmm15, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0x14,0xef] + vunpcklps %xmm15, %xmm12, %xmm13 + +// CHECK: vunpcklpd %xmm15, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x19,0x14,0xef] + vunpcklpd %xmm15, %xmm12, %xmm13 + +// CHECK: vunpckhps -4(%rbx,%rcx,8), %xmm12, %xmm15 +// CHECK: encoding: [0xc5,0x18,0x15,0x7c,0xcb,0xfc] + vunpckhps -4(%rbx,%rcx,8), %xmm12, %xmm15 + +// CHECK: vunpckhpd -4(%rbx,%rcx,8), %xmm12, %xmm15 +// CHECK: encoding: [0xc5,0x19,0x15,0x7c,0xcb,0xfc] + vunpckhpd -4(%rbx,%rcx,8), %xmm12, %xmm15 + +// CHECK: vunpcklps -4(%rbx,%rcx,8), %xmm12, %xmm15 +// CHECK: encoding: [0xc5,0x18,0x14,0x7c,0xcb,0xfc] + vunpcklps -4(%rbx,%rcx,8), %xmm12, %xmm15 + +// CHECK: vunpcklpd -4(%rbx,%rcx,8), %xmm12, %xmm15 +// CHECK: encoding: [0xc5,0x19,0x14,0x7c,0xcb,0xfc] + vunpcklpd -4(%rbx,%rcx,8), %xmm12, %xmm15 + From gohman at apple.com Tue Jun 22 18:07:13 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 22 Jun 2010 23:07:13 -0000 Subject: [llvm-commits] [llvm] r106594 - in /llvm/trunk: lib/Transforms/Scalar/LoopStrengthReduce.cpp test/CodeGen/X86/optimize-max-3.ll Message-ID: <20100622230713.A30552A6C12C@llvm.org> Author: djg Date: Tue Jun 22 18:07:13 2010 New Revision: 106594 URL: http://llvm.org/viewvc/llvm-project?rev=106594&view=rev Log: Fix OptimizeMax to handle an odd case where one of the max operands is another max which folds. This fixes PR7454. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/test/CodeGen/X86/optimize-max-3.ll Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=106594&r1=106593&r2=106594&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Jun 22 18:07:13 2010 @@ -1643,8 +1643,11 @@ NewRHS = Sel->getOperand(1); else if (SE.getSCEV(Sel->getOperand(2)) == MaxRHS) NewRHS = Sel->getOperand(2); + else if (const SCEVUnknown *SU = dyn_cast(MaxRHS)) + NewRHS = SU->getValue(); else - llvm_unreachable("Max doesn't match expected pattern!"); + // Max doesn't match expected pattern. + return Cond; // Determine the new comparison opcode. It may be signed or unsigned, // and the original comparison may be either equality or inequality. Modified: llvm/trunk/test/CodeGen/X86/optimize-max-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/optimize-max-3.ll?rev=106594&r1=106593&r2=106594&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/optimize-max-3.ll (original) +++ llvm/trunk/test/CodeGen/X86/optimize-max-3.ll Tue Jun 22 18:07:13 2010 @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=x86-64 | FileCheck %s +; RUN: llc < %s -march=x86-64 -asm-verbose=false | FileCheck %s ; LSR's OptimizeMax should eliminate the select (max). @@ -30,3 +30,46 @@ for.end: ; preds = %for.body, %entry ret void } + +; In this case, one of the max operands is another max, which folds, +; leaving a two-operand max which doesn't fit the usual pattern. +; OptimizeMax should handle this case. +; PR7454 + +; CHECK: _Z18GenerateStatusPagei: + +; CHECK: jle +; CHECK-NEXT: xorl %edi, %edi +; CHECK-NEXT: align +; CHECK-NEXT: BB1_2: +; CHECK-NEXT: callq +; CHECK-NEXT: incl %ebx +; CHECK-NEXT: cmpl %r14d, %ebx +; CHECK-NEXT: movq %rax, %rdi +; CHECK-NEXT: jl + +define void @_Z18GenerateStatusPagei(i32 %jobs_to_display) nounwind { +entry: + %cmp.i = icmp sgt i32 %jobs_to_display, 0 ; [#uses=1] + %tmp = select i1 %cmp.i, i32 %jobs_to_display, i32 0 ; [#uses=3] + %cmp8 = icmp sgt i32 %tmp, 0 ; [#uses=1] + br i1 %cmp8, label %bb.nph, label %for.end + +bb.nph: ; preds = %entry + %tmp11 = icmp sgt i32 %tmp, 1 ; [#uses=1] + %smax = select i1 %tmp11, i32 %tmp, i32 1 ; [#uses=1] + br label %for.body + +for.body: ; preds = %for.body, %bb.nph + %i.010 = phi i32 [ 0, %bb.nph ], [ %inc, %for.body ] ; [#uses=1] + %it.0.09 = phi float* [ null, %bb.nph ], [ %call.i, %for.body ] ; [#uses=1] + %call.i = call float* @_ZSt18_Rb_tree_decrementPKSt18_Rb_tree_node_base(float* %it.0.09) ; [#uses=1] + %inc = add nsw i32 %i.010, 1 ; [#uses=2] + %exitcond = icmp eq i32 %inc, %smax ; [#uses=1] + br i1 %exitcond, label %for.end, label %for.body + +for.end: ; preds = %for.body, %entry + ret void +} + +declare float* @_ZSt18_Rb_tree_decrementPKSt18_Rb_tree_node_base(float*) From dpatel at apple.com Tue Jun 22 18:29:56 2010 From: dpatel at apple.com (Devang Patel) Date: Tue, 22 Jun 2010 23:29:56 -0000 Subject: [llvm-commits] [llvm] r106598 - /llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Message-ID: <20100622232956.0D1112A6C12C@llvm.org> Author: dpatel Date: Tue Jun 22 18:29:55 2010 New Revision: 106598 URL: http://llvm.org/viewvc/llvm-project?rev=106598&view=rev Log: Revert 106592 for now. It causes clang-selfhost build failure. Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp?rev=106598&r1=106597&r2=106598&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Tue Jun 22 18:29:55 2010 @@ -21,44 +21,23 @@ using namespace llvm; Value *llvm::MapValue(const Value *V, ValueToValueMapTy &VM) { - ValueToValueMapTy::iterator VMI = VM.find(V); - if (VMI != VM.end()) - return VMI->second; // Does it exist in the map yet? + Value *&VMSlot = VM[V]; + if (VMSlot) return VMSlot; // Does it exist in the map yet? - // Global values, metadata strings and inline asm do not need to be seeded into + // NOTE: VMSlot can be invalidated by any reference to VM, which can grow the + // DenseMap. This includes any recursive calls to MapValue. + + // Global values and non-function-local metadata do not need to be seeded into // the ValueMap if they are using the identity mapping. - if (isa(V) || isa(V) || isa(V)) { - VM.insert(std::make_pair(V, const_cast(V))); - return const_cast(V); - } + if (isa(V) || isa(V) || isa(V) || + (isa(V) && !cast(V)->isFunctionLocal())) + return VMSlot = const_cast(V); if (const MDNode *MD = dyn_cast(V)) { - // Insert a place holder in map to handle mdnode cycles. - Value *TmpV = MDString::get(V->getContext(), - std::string("llvm.md.clone.tmp." + VM.size())); - VM.insert(std::make_pair(V, MDNode::get(V->getContext(), &TmpV, 1))); - - bool ReuseMD = true; SmallVector Elts; - // If metadata element is mapped to a new value then seed metadata - // in the map. - for (unsigned i = 0, e = MD->getNumOperands(); i != e; ++i) { - if (!MD->getOperand(i)) - Elts.push_back(0); - else { - Value *MappedOp = MapValue(MD->getOperand(i), VM); - if (MappedOp != MD->getOperand(i)) - ReuseMD = false; - Elts.push_back(MappedOp); - } - } - if (ReuseMD) { - VM.insert(std::make_pair(V, const_cast(V))); - return const_cast(V); - } - MDNode *NewMD = MDNode::get(V->getContext(), Elts.data(), Elts.size()); - VM.insert(std::make_pair(V, NewMD)); - return NewMD; + for (unsigned i = 0, e = MD->getNumOperands(); i != e; ++i) + Elts.push_back(MD->getOperand(i) ? MapValue(MD->getOperand(i), VM) : 0); + return VM[V] = MDNode::get(V->getContext(), Elts.data(), Elts.size()); } Constant *C = const_cast(dyn_cast(V)); @@ -67,7 +46,7 @@ if (isa(C) || isa(C) || isa(C) || isa(C) || isa(C) || isa(C)) - return VM[V] = C; // Primitive constants map directly + return VMSlot = C; // Primitive constants map directly if (ConstantArray *CA = dyn_cast(C)) { for (User::op_iterator b = CA->op_begin(), i = b, e = CA->op_end(); From gohman at apple.com Tue Jun 22 18:32:47 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 22 Jun 2010 23:32:47 -0000 Subject: [llvm-commits] [llvm] r106599 - /llvm/trunk/test/CodeGen/X86/optimize-max-3.ll Message-ID: <20100622233247.B562C2A6C12C@llvm.org> Author: djg Date: Tue Jun 22 18:32:47 2010 New Revision: 106599 URL: http://llvm.org/viewvc/llvm-project?rev=106599&view=rev Log: Loosen up this test so that it doesn't depend as much on register allocation details. Modified: llvm/trunk/test/CodeGen/X86/optimize-max-3.ll Modified: llvm/trunk/test/CodeGen/X86/optimize-max-3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/optimize-max-3.ll?rev=106599&r1=106598&r2=106599&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/optimize-max-3.ll (original) +++ llvm/trunk/test/CodeGen/X86/optimize-max-3.ll Tue Jun 22 18:32:47 2010 @@ -39,7 +39,8 @@ ; CHECK: _Z18GenerateStatusPagei: ; CHECK: jle -; CHECK-NEXT: xorl %edi, %edi +; CHECK-NOT: cmov +; CHECK: xorl %edi, %edi ; CHECK-NEXT: align ; CHECK-NEXT: BB1_2: ; CHECK-NEXT: callq From bruno.cardoso at gmail.com Tue Jun 22 18:37:59 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Tue, 22 Jun 2010 23:37:59 -0000 Subject: [llvm-commits] [llvm] r106600 - in /llvm/trunk: lib/Target/X86/X86InstrFormats.td lib/Target/X86/X86InstrSSE.td test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100622233759.B5BD02A6C12C@llvm.org> Author: bruno Date: Tue Jun 22 18:37:59 2010 New Revision: 106600 URL: http://llvm.org/viewvc/llvm-project?rev=106600&view=rev Log: Add AVX compare packed instructions Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFormats.td?rev=106600&r1=106599&r2=106600&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFormats.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFormats.td Tue Jun 22 18:37:59 2010 @@ -240,6 +240,18 @@ let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm); } +// PIi8 - SSE 1 & 2 packed instructions with immediate +class PIi8 o, Format F, dag outs, dag ins, string asm, + list pattern, Domain d> + : Ii8 { + let Predicates = !if(hasVEX_4VPrefix /* VEX_4V */, + !if(hasOpSizePrefix /* OpSize */, [HasAVX, HasSSE2], [HasAVX, HasSSE1]), + !if(hasOpSizePrefix /* OpSize */, [HasSSE2], [HasSSE1])); + + // AVX instructions have a 'v' prefix in the mnemonic + let AsmString = !if(hasVEX_4VPrefix, !strconcat("v", asm), asm); +} + // SSE1 Instruction Templates: // // SSI - SSE1 instructions with XS prefix. Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106600&r1=106599&r2=106600&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Jun 22 18:37:59 2010 @@ -460,6 +460,27 @@ (mem_frag addr:$src2))))], d>; } +multiclass sse12_cmp { + def rri : PIi8<0xC2, MRMSrcReg, + (outs RC:$dst), (ins RC:$src1, RC:$src, sse_imm_op:$cc), asm, + [(set RC:$dst, (Int RC:$src1, RC:$src, imm:$cc))], d>; + def rmi : PIi8<0xC2, MRMSrcMem, + (outs RC:$dst), (ins RC:$src1, f128mem:$src, sse_imm_op:$cc), asm, + [(set RC:$dst, (Int RC:$src1, (memop addr:$src), imm:$cc))], d>; +} + +// FIXME: rename instructions to only use the class above +multiclass sse12_cmp_alt { + def rri_alt : PIi8<0xC2, MRMSrcReg, + (outs RC:$dst), (ins RC:$src1, RC:$src, sse_imm_op:$src2), asm, + [], d>; + def rmi_alt : PIi8<0xC2, MRMSrcMem, + (outs RC:$dst), (ins RC:$src1, f128mem:$src, sse_imm_op:$src2), asm, + [], d>; +} + //===----------------------------------------------------------------------===// // SSE1 Instructions //===----------------------------------------------------------------------===// @@ -1327,44 +1348,42 @@ defm RCP : sse1_fp_unop_rm<0x53, "rcp", X86frcp, int_x86_sse_rcp_ss, int_x86_sse_rcp_ps>; +// Compare let Constraints = "$src1 = $dst" in { - def CMPPSrri : PSIi8<0xC2, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src, SSECC:$cc), - "cmp${cc}ps\t{$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1, - VR128:$src, imm:$cc))]>; - def CMPPSrmi : PSIi8<0xC2, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, SSECC:$cc), - "cmp${cc}ps\t{$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse_cmp_ps VR128:$src1, - (memop addr:$src), imm:$cc))]>; - def CMPPDrri : PDIi8<0xC2, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src, SSECC:$cc), - "cmp${cc}pd\t{$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, - VR128:$src, imm:$cc))]>; - def CMPPDrmi : PDIi8<0xC2, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, SSECC:$cc), - "cmp${cc}pd\t{$src, $dst|$dst, $src}", - [(set VR128:$dst, (int_x86_sse2_cmp_pd VR128:$src1, - (memop addr:$src), imm:$cc))]>; - - // Accept explicit immediate argument form instead of comparison code. + defm CMPPS : sse12_cmp, + TB; + defm CMPPD : sse12_cmp, + TB, OpSize; +} let isAsmParserOnly = 1 in { - def CMPPSrri_alt : PSIi8<0xC2, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src, i8imm:$src2), - "cmpps\t{$src2, $src, $dst|$dst, $src, $src}", []>; - def CMPPSrmi_alt : PSIi8<0xC2, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, i8imm:$src2), - "cmpps\t{$src2, $src, $dst|$dst, $src, $src}", []>; - def CMPPDrri_alt : PDIi8<0xC2, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src, i8imm:$src2), - "cmppd\t{$src2, $src, $dst|$dst, $src, $src2}", []>; - def CMPPDrmi_alt : PDIi8<0xC2, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, f128mem:$src, i8imm:$src2), - "cmppd\t{$src2, $src, $dst|$dst, $src, $src2}", []>; + defm VCMPPS : sse12_cmp, VEX_4V; + defm VCMPPD : sse12_cmp, OpSize, VEX_4V; } + +let isAsmParserOnly = 1, Pattern = [] in { + // Accept explicit immediate argument form instead of comparison code. + let Constraints = "$src1 = $dst" in { + defm CMPPS : sse12_cmp_alt, TB; + defm CMPPD : sse12_cmp_alt, TB, OpSize; + } + defm VCMPPS : sse12_cmp_alt, VEX_4V; + defm VCMPPD : sse12_cmp_alt, OpSize, VEX_4V; } + def : Pat<(v4i32 (X86cmpps (v4f32 VR128:$src1), VR128:$src2, imm:$cc)), (CMPPSrri (v4f32 VR128:$src1), (v4f32 VR128:$src2), imm:$cc)>; def : Pat<(v4i32 (X86cmpps (v4f32 VR128:$src1), (memop addr:$src2), imm:$cc)), Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=106600&r1=106599&r2=106600&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Tue Jun 22 18:37:59 2010 @@ -10350,3 +10350,27 @@ // CHECK: encoding: [0xc5,0xe9,0x14,0x6c,0xcb,0xfc] vunpcklpd -4(%ebx,%ecx,8), %xmm2, %xmm5 +// CHECK: vcmpps $0, %xmm0, %xmm6, %xmm1 +// CHECK: encoding: [0xc5,0xc8,0xc2,0xc8,0x00] + vcmpps $0, %xmm0, %xmm6, %xmm1 + +// CHECK: vcmpps $0, (%eax), %xmm6, %xmm1 +// CHECK: encoding: [0xc5,0xc8,0xc2,0x08,0x00] + vcmpps $0, (%eax), %xmm6, %xmm1 + +// CHECK: vcmpps $7, %xmm0, %xmm6, %xmm1 +// CHECK: encoding: [0xc5,0xc8,0xc2,0xc8,0x07] + vcmpps $7, %xmm0, %xmm6, %xmm1 + +// CHECK: vcmppd $0, %xmm0, %xmm6, %xmm1 +// CHECK: encoding: [0xc5,0xc9,0xc2,0xc8,0x00] + vcmppd $0, %xmm0, %xmm6, %xmm1 + +// CHECK: vcmppd $0, (%eax), %xmm6, %xmm1 +// CHECK: encoding: [0xc5,0xc9,0xc2,0x08,0x00] + vcmppd $0, (%eax), %xmm6, %xmm1 + +// CHECK: vcmppd $7, %xmm0, %xmm6, %xmm1 +// CHECK: encoding: [0xc5,0xc9,0xc2,0xc8,0x07] + vcmppd $7, %xmm0, %xmm6, %xmm1 + Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=106600&r1=106599&r2=106600&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Tue Jun 22 18:37:59 2010 @@ -414,3 +414,27 @@ // CHECK: encoding: [0xc5,0x19,0x14,0x7c,0xcb,0xfc] vunpcklpd -4(%rbx,%rcx,8), %xmm12, %xmm15 +// CHECK: vcmpps $0, %xmm10, %xmm12, %xmm15 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xfa,0x00] + vcmpps $0, %xmm10, %xmm12, %xmm15 + +// CHECK: vcmpps $0, (%rax), %xmm12, %xmm15 +// CHECK: encoding: [0xc5,0x18,0xc2,0x38,0x00] + vcmpps $0, (%rax), %xmm12, %xmm15 + +// CHECK: vcmpps $7, %xmm10, %xmm12, %xmm15 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xfa,0x07] + vcmpps $7, %xmm10, %xmm12, %xmm15 + +// CHECK: vcmppd $0, %xmm10, %xmm12, %xmm15 +// CHECK: encoding: [0xc4,0x41,0x19,0xc2,0xfa,0x00] + vcmppd $0, %xmm10, %xmm12, %xmm15 + +// CHECK: vcmppd $0, (%rax), %xmm12, %xmm15 +// CHECK: encoding: [0xc5,0x19,0xc2,0x38,0x00] + vcmppd $0, (%rax), %xmm12, %xmm15 + +// CHECK: vcmppd $7, %xmm10, %xmm12, %xmm15 +// CHECK: encoding: [0xc4,0x41,0x19,0xc2,0xfa,0x07] + vcmppd $7, %xmm10, %xmm12, %xmm15 + From gohman at apple.com Tue Jun 22 18:43:28 2010 From: gohman at apple.com (Dan Gohman) Date: Tue, 22 Jun 2010 23:43:28 -0000 Subject: [llvm-commits] [llvm] r106603 - in /llvm/trunk: include/llvm/Analysis/ScalarEvolution.h lib/Analysis/ScalarEvolution.cpp Message-ID: <20100622234328.4B67A2A6C12D@llvm.org> Author: djg Date: Tue Jun 22 18:43:28 2010 New Revision: 106603 URL: http://llvm.org/viewvc/llvm-project?rev=106603&view=rev Log: Replace ScalarEvolution's private copy of getLoopPredecessor with LoopInfo's public copy. Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=106603&r1=106602&r2=106603&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original) +++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Tue Jun 22 18:43:28 2010 @@ -343,10 +343,6 @@ BackedgeTakenInfo HowManyLessThans(const SCEV *LHS, const SCEV *RHS, const Loop *L, bool isSigned); - /// getLoopPredecessor - If the given loop's header has exactly one unique - /// predecessor outside the loop, return it. Otherwise return null. - BasicBlock *getLoopPredecessor(const Loop *L); - /// getPredecessorWithUniqueSuccessorForBB - Return a predecessor of BB /// (which may not be an immediate predecessor) which has exactly one /// successor from which BB is reachable, or null if no such block is Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=106603&r1=106602&r2=106603&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Jun 22 18:43:28 2010 @@ -4691,23 +4691,6 @@ return getCouldNotCompute(); } -/// getLoopPredecessor - If the given loop's header has exactly one unique -/// predecessor outside the loop, return it. Otherwise return null. -/// This is less strict that the loop "preheader" concept, which requires -/// the predecessor to have only one single successor. -/// -BasicBlock *ScalarEvolution::getLoopPredecessor(const Loop *L) { - BasicBlock *Header = L->getHeader(); - BasicBlock *Pred = 0; - for (pred_iterator PI = pred_begin(Header), E = pred_end(Header); - PI != E; ++PI) - if (!L->contains(*PI)) { - if (Pred && Pred != *PI) return 0; // Multiple predecessors. - Pred = *PI; - } - return Pred; -} - /// getPredecessorWithUniqueSuccessorForBB - Return a predecessor of BB /// (which may not be an immediate predecessor) which has exactly one /// successor from which BB is reachable, or null if no such block is @@ -4725,7 +4708,7 @@ // If the header has a unique predecessor outside the loop, it must be // a block that has exactly one successor that can reach the loop. if (Loop *L = LI->getLoopFor(BB)) - return std::make_pair(getLoopPredecessor(L), L->getHeader()); + return std::make_pair(L->getLoopPredecessor(), L->getHeader()); return std::pair(); } @@ -5176,7 +5159,7 @@ // as there are predecessors that can be found that have unique successors // leading to the original header. for (std::pair - Pair(getLoopPredecessor(L), L->getHeader()); + Pair(L->getLoopPredecessor(), L->getHeader()); Pair.first; Pair = getPredecessorWithUniqueSuccessorForBB(Pair.first)) { From isanbard at gmail.com Tue Jun 22 18:44:15 2010 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 22 Jun 2010 23:44:15 -0000 Subject: [llvm-commits] [llvm] r106604 - /llvm/trunk/utils/buildit/build_llvm Message-ID: <20100622234415.DB75D2A6C12C@llvm.org> Author: void Date: Tue Jun 22 18:44:15 2010 New Revision: 106604 URL: http://llvm.org/viewvc/llvm-project?rev=106604&view=rev Log: Generate DWARF information during Apple-style build. They'll be stripped out later on. But we need them saved in the symbols directory. Modified: llvm/trunk/utils/buildit/build_llvm Modified: llvm/trunk/utils/buildit/build_llvm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/build_llvm?rev=106604&r1=106603&r2=106604&view=diff ============================================================================== --- llvm/trunk/utils/buildit/build_llvm (original) +++ llvm/trunk/utils/buildit/build_llvm Tue Jun 22 18:44:15 2010 @@ -197,6 +197,7 @@ UNIVERSAL_SDK_PATH=$SDKROOT \ NO_RUNTIME_LIBS=1 \ DISABLE_EDIS=1 \ + DEBUG_SYMBOLS=1 \ LLVM_SUBMIT_VERSION=$LLVM_SUBMIT_VERSION \ LLVM_SUBMIT_SUBVERSION=$LLVM_SUBMIT_SUBVERSION \ CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'" \ @@ -222,6 +223,7 @@ make $LOCAL_MAKEFLAGS $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$HOSTS" \ NO_RUNTIME_LIBS=1 \ DISABLE_EDIS=1 \ + DEBUG_SYMBOLS=1 \ LLVM_SUBMIT_VERSION=$LLVM_SUBMIT_VERSION \ LLVM_SUBMIT_SUBVERSION=$LLVM_SUBMIT_SUBVERSION \ OPTIMIZE_OPTION='-O3' VERBOSE=1 install @@ -268,16 +270,8 @@ -exec lipo -extract ppc7400 -extract i386 -extract x86_64 {} -output {} \; fi -cd $DEST_DIR$DEST_ROOT -if [ "$INSTALL_LIBLTO" == yes ]; then - mkdir -p $DT_HOME/lib - mv lib/libLTO.dylib $DT_HOME/lib/libLTO.dylib - strip -S $DT_HOME/lib/libLTO.dylib -fi -rm -f lib/libLTO.a lib/libLTO.la - # The Hello dylib is an example of how to build a pass. No need to install it. -rm lib/libLLVMHello.dylib +rm $DEST_DIR$DEST_ROOT/lib/libLLVMHello.dylib # Compress manpages MDIR=$DEST_DIR$DEST_ROOT/share/man/man1 @@ -323,8 +317,20 @@ | cpio -pdml $SYM_DIR/src || exit 1 ################################################################################ +# Install and strip libLTO.dylib + +cd $DEST_DIR$DEST_ROOT +if [ "$INSTALL_LIBLTO" = "yes" ]; then + mkdir -p $DT_HOME/lib + mv lib/libLTO.dylib $DT_HOME/lib/libLTO.dylib + strip -S $DT_HOME/lib/libLTO.dylib +fi +rm -f lib/libLTO.a lib/libLTO.la + +################################################################################ # Remove debugging information from DEST_DIR. +cd $DIR || exit 1 find $DEST_DIR -name \*.a -print | xargs ranlib || exit 1 find $DEST_DIR -name \*.dSYM -print | xargs rm -r || exit 1 chgrp -h -R wheel $DEST_DIR @@ -338,7 +344,7 @@ ################################################################################ # symlinks so that B&I can find things -if [ "$INSTALL_LIBLTO" == yes ]; then +if [ "$INSTALL_LIBLTO" = "yes" ]; then mkdir -p $DEST_DIR/usr/lib/ cd $DEST_DIR/usr/lib && \ ln -s ../../$DEVELOPER_DIR/usr/lib/libLTO.dylib ./libLTO.dylib From echristo at apple.com Tue Jun 22 18:51:47 2010 From: echristo at apple.com (Eric Christopher) Date: Tue, 22 Jun 2010 23:51:47 -0000 Subject: [llvm-commits] [llvm] r106608 - /llvm/trunk/lib/MC/MachObjectWriter.cpp Message-ID: <20100622235147.77A7E2A6C12C@llvm.org> Author: echristo Date: Tue Jun 22 18:51:47 2010 New Revision: 106608 URL: http://llvm.org/viewvc/llvm-project?rev=106608&view=rev Log: Get the addend correct for i386 pic. Thanks Daniel! Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MachObjectWriter.cpp?rev=106608&r1=106607&r2=106608&view=diff ============================================================================== --- llvm/trunk/lib/MC/MachObjectWriter.cpp (original) +++ llvm/trunk/lib/MC/MachObjectWriter.cpp Tue Jun 22 18:51:47 2010 @@ -747,7 +747,6 @@ !Is64Bit && "Should only be called with a 32-bit TLVP relocation!"); - // If this is a subtraction then we're pcrel. unsigned Log2Size = getFixupKindLog2Size(Fixup.getKind()); uint32_t Value = Layout.getFragmentOffset(Fragment)+Fixup.getOffset(); unsigned IsPCRel = 0; @@ -761,7 +760,14 @@ // between the picbase and the next address. For 32-bit static the addend // is zero. if (Target.getSymB()) { + // If this is a subtraction then we're pcrel. + uint32_t FixupAddress = + Layout.getFragmentAddress(Fragment) + Fixup.getOffset(); + MCSymbolData *SD_B = &Asm.getSymbolData(Target.getSymB()->getSymbol()); IsPCRel = 1; + FixedValue = (FixupAddress - Layout.getSymbolAddress(SD_B) + + Target.getConstant()); + FixedValue += 1 << Log2Size; } else { FixedValue = 0; } From daniel at zuster.org Tue Jun 22 19:19:11 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 23 Jun 2010 00:19:11 -0000 Subject: [llvm-commits] [zorg] r106610 - /zorg/trunk/lnt/lnt/tests/nt.py Message-ID: <20100623001912.07C132A6C12C@llvm.org> Author: ddunbar Date: Tue Jun 22 19:19:11 2010 New Revision: 106610 URL: http://llvm.org/viewvc/llvm-project?rev=106610&view=rev Log: LNT/nt: Don't accept '0' as a valid source tag for llvm-gcc, that is the default when no build number was set. Modified: zorg/trunk/lnt/lnt/tests/nt.py Modified: zorg/trunk/lnt/lnt/tests/nt.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/tests/nt.py?rev=106610&r1=106609&r2=106610&view=diff ============================================================================== --- zorg/trunk/lnt/lnt/tests/nt.py (original) +++ zorg/trunk/lnt/lnt/tests/nt.py Tue Jun 22 19:19:11 2010 @@ -392,8 +392,11 @@ if run_info.get('cc_src_version','').isdigit(): run_info['run_order'] = run_info['cc_src_revision'] - # Otherwise, if this is a production compiler, look for a source tag. + # Otherwise, if this is a production compiler, look for a source tag. We + # don't accept 0 as a valid source tag, since that is what llvm-gcc + # defaults to when no build number is given. elif (run_info.get('cc_build') == 'PROD' and + run_info.get('cc_src_tag') != '0' and run_info.get('cc_src_tag','').isdigit()): run_info['run_order'] = run_info['cc_src_tag'] From stuart at apple.com Tue Jun 22 19:31:14 2010 From: stuart at apple.com (Stuart Hastings) Date: Wed, 23 Jun 2010 00:31:14 -0000 Subject: [llvm-commits] [llvm] r106611 - in /llvm/trunk/test/FrontendC++: 2010-06-22-BitfieldInit.cpp 2010-06-22-ZeroBitfield.cpp Message-ID: <20100623003114.6A7672A6C12C@llvm.org> Author: stuart Date: Tue Jun 22 19:31:14 2010 New Revision: 106611 URL: http://llvm.org/viewvc/llvm-project?rev=106611&view=rev Log: Less incorrect handling of zero-length bitfields. Radars 7992077 and 8093043. Added: llvm/trunk/test/FrontendC++/2010-06-22-BitfieldInit.cpp llvm/trunk/test/FrontendC++/2010-06-22-ZeroBitfield.cpp Added: llvm/trunk/test/FrontendC++/2010-06-22-BitfieldInit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2010-06-22-BitfieldInit.cpp?rev=106611&view=auto ============================================================================== --- llvm/trunk/test/FrontendC++/2010-06-22-BitfieldInit.cpp (added) +++ llvm/trunk/test/FrontendC++/2010-06-22-BitfieldInit.cpp Tue Jun 22 19:31:14 2010 @@ -0,0 +1,20 @@ +// RUN: %llvmgxx -g -c %s +struct TEST2 +{ + int subid:32; + int :0; +}; + +typedef struct _TEST3 +{ + TEST2 foo; + TEST2 foo2; +} TEST3; + +TEST3 test = + { + {0}, + {0} + }; + +int main() { return 0; } Added: llvm/trunk/test/FrontendC++/2010-06-22-ZeroBitfield.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2010-06-22-ZeroBitfield.cpp?rev=106611&view=auto ============================================================================== --- llvm/trunk/test/FrontendC++/2010-06-22-ZeroBitfield.cpp (added) +++ llvm/trunk/test/FrontendC++/2010-06-22-ZeroBitfield.cpp Tue Jun 22 19:31:14 2010 @@ -0,0 +1,5 @@ +// RUN: %llvmgxx -g -c %s +struct s8_0 { unsigned : 0; }; +struct s8_1 { double x; }; +struct s8 { s8_0 a; s8_1 b; }; +s8 f8() { return s8(); } From stuart at apple.com Tue Jun 22 19:31:28 2010 From: stuart at apple.com (Stuart Hastings) Date: Wed, 23 Jun 2010 00:31:28 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r106612 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <20100623003129.0DC002A6C12C@llvm.org> Author: stuart Date: Tue Jun 22 19:31:28 2010 New Revision: 106612 URL: http://llvm.org/viewvc/llvm-project?rev=106612&view=rev Log: Less incorrect handling of zero-length bitfields. Radars 7992077 and 8093043. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=106612&r1=106611&r2=106612&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Jun 22 19:31:28 2010 @@ -8297,6 +8297,7 @@ unsigned HOST_WIDE_INT CtorIndex; tree FieldValue; tree Field; // The FIELD_DECL for the field. + FOR_EACH_CONSTRUCTOR_ELT(CONSTRUCTOR_ELTS(exp), CtorIndex, Field, FieldValue){ // If an explicit field is specified, use it. if (Field == 0) { @@ -8310,30 +8311,40 @@ } } - // Decode the field's value. - Constant *Val = Convert(FieldValue); - // GCCFieldOffsetInBits is where GCC is telling us to put the current field. uint64_t GCCFieldOffsetInBits = getFieldOffsetInBits(Field); NextField = TREE_CHAIN(Field); uint64_t FieldSizeInBits = 0; - if (DECL_SIZE(Field)) + uint64_t ValueSizeInBits = 0; + Constant *Val = 0; + ConstantInt *ValC = 0; + + // Zero-sized bitfields upset the type converter. If it's not a + // bit-field, or it is a bit-field but it has a non-zero precision + // type, go ahead and convert it. + if (!DECL_BIT_FIELD_TYPE(Field) || TYPE_PRECISION(TREE_TYPE(Field))) + Val = Convert(FieldValue); // Decode the field's value. + + if (DECL_SIZE(Field)) { FieldSizeInBits = getInt64(DECL_SIZE(Field), true); - uint64_t ValueSizeInBits = Val->getType()->getPrimitiveSizeInBits(); - ConstantInt *ValC = dyn_cast(Val); - if (ValC && ValC->isZero() && DECL_SIZE(Field)) { - // G++ has various bugs handling {} initializers where it doesn't - // synthesize a zero node of the right type. Instead of figuring out G++, - // just hack around it by special casing zero and allowing it to be the - // wrong size. - if (ValueSizeInBits != FieldSizeInBits) { - APInt ValAsInt = ValC->getValue(); - ValC = ConstantInt::get(Context, ValueSizeInBits < FieldSizeInBits ? - ValAsInt.zext(FieldSizeInBits) : - ValAsInt.trunc(FieldSizeInBits)); - ValueSizeInBits = FieldSizeInBits; - Val = ValC; + if (FieldSizeInBits == 0) + continue; // Skip zero-sized fields. + ValueSizeInBits = Val->getType()->getPrimitiveSizeInBits(); + ValC = dyn_cast(Val); + if (ValC && ValC->isZero()) { + // G++ has various bugs handling {} initializers where it doesn't + // synthesize a zero node of the right type. Instead of figuring out G++, + // just hack around it by special casing zero and allowing it to be the + // wrong size. + if (ValueSizeInBits != FieldSizeInBits) { + APInt ValAsInt = ValC->getValue(); + ValC = ConstantInt::get(Context, ValueSizeInBits < FieldSizeInBits ? + ValAsInt.zext(FieldSizeInBits) : + ValAsInt.trunc(FieldSizeInBits)); + ValueSizeInBits = FieldSizeInBits; + Val = ValC; + } } } From daniel at zuster.org Tue Jun 22 19:45:26 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 22 Jun 2010 17:45:26 -0700 Subject: [llvm-commits] [llvm] r106066 - in /llvm/trunk: lib/CodeGen/MachineSink.cpp lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/MachineSink-CritEdge.ll In-Reply-To: <20100615234631.7B3142A6C12C@llvm.org> References: <20100615234631.7B3142A6C12C@llvm.org> Message-ID: Hi Bill, It looks like bzip2 is being miscompiled with this commit in, I reverted it in r106610. Can you take a look? - Daniel On Tue, Jun 15, 2010 at 4:46 PM, Bill Wendling wrote: > Author: void > Date: Tue Jun 15 18:46:31 2010 > New Revision: 106066 > > URL: http://llvm.org/viewvc/llvm-project?rev=106066&view=rev > Log: > Create a more targeted fix for not sinking instructions into a range where it > will conflict with another live range. The place which creates this scenerio is > the code in X86 that lowers a select instruction by splitting the MBBs. This > eliminates the need to check from the bottom up in an MBB for live pregs. > > > Modified: > ? ?llvm/trunk/lib/CodeGen/MachineSink.cpp > ? ?llvm/trunk/lib/Target/X86/X86ISelLowering.cpp > ? ?llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll > > Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=106066&r1=106065&r2=106066&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/MachineSink.cpp (original) > +++ llvm/trunk/lib/CodeGen/MachineSink.cpp Tue Jun 15 18:46:31 2010 > @@ -25,7 +25,6 @@ > ?#include "llvm/Target/TargetRegisterInfo.h" > ?#include "llvm/Target/TargetInstrInfo.h" > ?#include "llvm/Target/TargetMachine.h" > -#include "llvm/ADT/SmallSet.h" > ?#include "llvm/ADT/Statistic.h" > ?#include "llvm/Support/Debug.h" > ?#include "llvm/Support/raw_ostream.h" > @@ -62,7 +61,6 @@ > ? ? bool ProcessBlock(MachineBasicBlock &MBB); > ? ? bool SinkInstruction(MachineInstr *MI, bool &SawStore); > ? ? bool AllUsesDominatedByBlock(unsigned Reg, MachineBasicBlock *MBB) const; > - ? ?bool LiveOutOfBasicBlock(const MachineInstr *MI, unsigned Reg) const; > ? }; > ?} // end anonymous namespace > > @@ -168,44 +166,6 @@ > ? return MadeChange; > ?} > > -/// LiveOutOfBasicBlock - Determine if the physical register, defined and dead > -/// in MI, is live on exit from the basic block. > -bool MachineSinking::LiveOutOfBasicBlock(const MachineInstr *MI, > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? unsigned Reg) const { > - ?assert(TargetRegisterInfo::isPhysicalRegister(Reg) && > - ? ? ? ? "Only want to determine if a physical register is live out of a BB!"); > - > - ?const MachineBasicBlock *MBB = MI->getParent(); > - ?SmallSet KilledRegs; > - ?MachineBasicBlock::const_iterator I = MBB->end(); > - ?MachineBasicBlock::const_iterator E = MBB->begin(); > - ?assert(I != E && "How can there be an empty block at this point?!"); > - > - ?// Loop through the instructions bottom-up. If we see a kill of the preg > - ?// first, then it's not live out of the BB. If we see a use or def first, then > - ?// we assume that it is live out of the BB. > - ?do { > - ? ?const MachineInstr &CurMI = *--I; > - > - ? ?for (unsigned i = 0, e = CurMI.getNumOperands(); i != e; ++i) { > - ? ? ?const MachineOperand &MO = CurMI.getOperand(i); > - ? ? ?if (!MO.isReg()) continue; ?// Ignore non-register operands. > - > - ? ? ?unsigned MOReg = MO.getReg(); > - ? ? ?if (MOReg == 0) continue; > - > - ? ? ?if (MOReg == Reg) { > - ? ? ? ?if (MO.isKill()) > - ? ? ? ? ?return false; > - ? ? ? ?if (MO.isUse() || MO.isDef()) > - ? ? ? ? ?return true; > - ? ? ?} > - ? ?} > - ?} while (I != E); > - > - ?return false; > -} > - > ?/// SinkInstruction - Determine whether it is safe to sink the specified machine > ?/// instruction out of its current block into a successor. > ?bool MachineSinking::SinkInstruction(MachineInstr *MI, bool &SawStore) { > @@ -228,7 +188,6 @@ > ? // SuccToSinkTo - This is the successor to sink this instruction to, once we > ? // decide. > ? MachineBasicBlock *SuccToSinkTo = 0; > - ?SmallVector PhysRegs; > > ? for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { > ? ? const MachineOperand &MO = MI->getOperand(i); > @@ -257,12 +216,9 @@ > ? ? ? ? ? if (AllocatableSet.test(AliasReg)) > ? ? ? ? ? ? return false; > ? ? ? ? } > - ? ? ?} else { > - ? ? ? ?if (!MO.isDead()) > - ? ? ? ? ?// A def that isn't dead. We can't move it. > - ? ? ? ? ?return false; > - ? ? ? ?else > - ? ? ? ? ?PhysRegs.push_back(Reg); > + ? ? ?} else if (!MO.isDead()) { > + ? ? ? ?// A def that isn't dead. We can't move it. > + ? ? ? ?return false; > ? ? ? } > ? ? } else { > ? ? ? // Virtual register uses are always safe to sink. > @@ -329,10 +285,14 @@ > ? // If the instruction to move defines a dead physical register which is live > ? // when leaving the basic block, don't move it because it could turn into a > ? // "zombie" define of that preg. E.g., EFLAGS. () > - ?for (SmallVectorImpl::const_iterator > - ? ? ? ? I = PhysRegs.begin(), E = PhysRegs.end(); I != E; ++I) > - ? ?if (LiveOutOfBasicBlock(MI, *I)) > + ?for (unsigned I = 0, E = MI->getNumOperands(); I != E; ++I) { > + ? ?const MachineOperand &MO = MI->getOperand(I); > + ? ?if (!MO.isReg()) continue; > + ? ?unsigned Reg = MO.getReg(); > + ? ?if (Reg == 0 || !TargetRegisterInfo::isPhysicalRegister(Reg)) continue; > + ? ?if (SuccToSinkTo->isLiveIn(Reg)) > ? ? ? return false; > + ?} > > ? DEBUG(dbgs() << "Sink instr " << *MI << "\tinto block " << *SuccToSinkTo); > > > Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=106066&r1=106065&r2=106066&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jun 15 18:46:31 2010 > @@ -8465,22 +8465,42 @@ > ? MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); > ? unsigned Opc = > ? ? X86::GetCondBranchFromCond((X86::CondCode)MI->getOperand(3).getImm()); > + > ? BuildMI(BB, DL, TII->get(Opc)).addMBB(sinkMBB); > ? F->insert(It, copy0MBB); > ? F->insert(It, sinkMBB); > + > ? // Update machine-CFG edges by first adding all successors of the current > ? // block to the new block which will contain the Phi node for the select. > ? for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), > ? ? ? ? ?E = BB->succ_end(); I != E; ++I) > ? ? sinkMBB->addSuccessor(*I); > + > ? // Next, remove all successors of the current block, and add the true > ? // and fallthrough blocks as its successors. > ? while (!BB->succ_empty()) > ? ? BB->removeSuccessor(BB->succ_begin()); > + > ? // Add the true and fallthrough blocks as its successors. > ? BB->addSuccessor(copy0MBB); > ? BB->addSuccessor(sinkMBB); > > + ?// If the EFLAGS register isn't dead in the terminator, then claim that it's > + ?// live into the sink and copy blocks. > + ?const MachineFunction *MF = BB->getParent(); > + ?const TargetRegisterInfo *TRI = MF->getTarget().getRegisterInfo(); > + ?BitVector ReservedRegs = TRI->getReservedRegs(*MF); > + ?const MachineInstr *Term = BB->getFirstTerminator(); > + > + ?for (unsigned I = 0, E = Term->getNumOperands(); I != E; ++I) { > + ? ?const MachineOperand &MO = Term->getOperand(I); > + ? ?if (!MO.isReg() || MO.isKill() || MO.isDead()) continue; > + ? ?unsigned Reg = MO.getReg(); > + ? ?if (Reg != X86::EFLAGS) continue; > + ? ?copy0MBB->addLiveIn(Reg); > + ? ?sinkMBB->addLiveIn(Reg); > + ?} > + > ? // ?copy0MBB: > ? // ? %FalseValue = ... > ? // ? # fallthrough to sinkMBB > > Modified: llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll?rev=106066&r1=106065&r2=106066&view=diff > ============================================================================== > --- llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll (original) > +++ llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll Tue Jun 15 18:46:31 2010 > @@ -1,10 +1,4 @@ > ?; RUN: llc < %s | FileCheck %s > -; XFAIL: * > -; > -; See . This test isn't valid after we made machine > -; sinking more conservative about sinking instructions that define a preg into a > -; block when we don't know if the preg is killed within the current block. > - > ?target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" > ?target triple = "x86_64-apple-darwin10.0.0" > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From daniel at zuster.org Tue Jun 22 19:48:25 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 23 Jun 2010 00:48:25 -0000 Subject: [llvm-commits] [llvm] r106614 - in /llvm/trunk: lib/CodeGen/MachineSink.cpp lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/MachineSink-CritEdge.ll Message-ID: <20100623004825.6E7072A6C12C@llvm.org> Author: ddunbar Date: Tue Jun 22 19:48:25 2010 New Revision: 106614 URL: http://llvm.org/viewvc/llvm-project?rev=106614&view=rev Log: Revert r106066, "Create a more targeted fix for not sinking instructions into a range where it"... it causes bzip2 to be miscompiled by Clang. Conflicts: lib/CodeGen/MachineSink.cpp Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=106614&r1=106613&r2=106614&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineSink.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineSink.cpp Tue Jun 22 19:48:25 2010 @@ -25,6 +25,7 @@ #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/ADT/SmallSet.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" @@ -61,6 +62,7 @@ bool ProcessBlock(MachineBasicBlock &MBB); bool SinkInstruction(MachineInstr *MI, bool &SawStore); bool AllUsesDominatedByBlock(unsigned Reg, MachineBasicBlock *MBB) const; + bool LiveOutOfBasicBlock(const MachineInstr *MI, unsigned Reg) const; }; } // end anonymous namespace @@ -166,6 +168,44 @@ return MadeChange; } +/// LiveOutOfBasicBlock - Determine if the physical register, defined and dead +/// in MI, is live on exit from the basic block. +bool MachineSinking::LiveOutOfBasicBlock(const MachineInstr *MI, + unsigned Reg) const { + assert(TargetRegisterInfo::isPhysicalRegister(Reg) && + "Only want to determine if a physical register is live out of a BB!"); + + const MachineBasicBlock *MBB = MI->getParent(); + SmallSet KilledRegs; + MachineBasicBlock::const_iterator I = MBB->end(); + MachineBasicBlock::const_iterator E = MBB->begin(); + assert(I != E && "How can there be an empty block at this point?!"); + + // Loop through the instructions bottom-up. If we see a kill of the preg + // first, then it's not live out of the BB. If we see a use or def first, then + // we assume that it is live out of the BB. + do { + const MachineInstr &CurMI = *--I; + + for (unsigned i = 0, e = CurMI.getNumOperands(); i != e; ++i) { + const MachineOperand &MO = CurMI.getOperand(i); + if (!MO.isReg()) continue; // Ignore non-register operands. + + unsigned MOReg = MO.getReg(); + if (MOReg == 0) continue; + + if (MOReg == Reg) { + if (MO.isKill()) + return false; + if (MO.isUse() || MO.isDef()) + return true; + } + } + } while (I != E); + + return false; +} + /// SinkInstruction - Determine whether it is safe to sink the specified machine /// instruction out of its current block into a successor. bool MachineSinking::SinkInstruction(MachineInstr *MI, bool &SawStore) { @@ -188,6 +228,7 @@ // SuccToSinkTo - This is the successor to sink this instruction to, once we // decide. MachineBasicBlock *SuccToSinkTo = 0; + SmallVector PhysRegs; for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { const MachineOperand &MO = MI->getOperand(i); @@ -216,9 +257,12 @@ if (AllocatableSet.test(AliasReg)) return false; } - } else if (!MO.isDead()) { - // A def that isn't dead. We can't move it. - return false; + } else { + if (!MO.isDead()) + // A def that isn't dead. We can't move it. + return false; + else + PhysRegs.push_back(Reg); } } else { // Virtual register uses are always safe to sink. @@ -282,18 +326,13 @@ if (MI->getParent() == SuccToSinkTo) return false; - // If the instruction to move defines or uses a dead physical register which - // is live when leaving the basic block, don't move it because it could turn - // into a zombie define or misuse of that preg. E.g., EFLAGS. - // () - for (unsigned I = 0, E = MI->getNumOperands(); I != E; ++I) { - const MachineOperand &MO = MI->getOperand(I); - if (!MO.isReg()) continue; - unsigned Reg = MO.getReg(); - if (Reg == 0 || !TargetRegisterInfo::isPhysicalRegister(Reg)) continue; - if (SuccToSinkTo->isLiveIn(Reg)) + // If the instruction to move defines a dead physical register which is live + // when leaving the basic block, don't move it because it could turn into a + // "zombie" define of that preg. E.g., EFLAGS. () + for (SmallVectorImpl::const_iterator + I = PhysRegs.begin(), E = PhysRegs.end(); I != E; ++I) + if (LiveOutOfBasicBlock(MI, *I)) return false; - } DEBUG(dbgs() << "Sink instr " << *MI << "\tinto block " << *SuccToSinkTo); Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=106614&r1=106613&r2=106614&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jun 22 19:48:25 2010 @@ -8466,42 +8466,22 @@ MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); unsigned Opc = X86::GetCondBranchFromCond((X86::CondCode)MI->getOperand(3).getImm()); - BuildMI(BB, DL, TII->get(Opc)).addMBB(sinkMBB); F->insert(It, copy0MBB); F->insert(It, sinkMBB); - // Update machine-CFG edges by first adding all successors of the current // block to the new block which will contain the Phi node for the select. for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), E = BB->succ_end(); I != E; ++I) sinkMBB->addSuccessor(*I); - // Next, remove all successors of the current block, and add the true // and fallthrough blocks as its successors. while (!BB->succ_empty()) BB->removeSuccessor(BB->succ_begin()); - // Add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); - // If the EFLAGS register isn't dead in the terminator, then claim that it's - // live into the sink and copy blocks. - const MachineFunction *MF = BB->getParent(); - const TargetRegisterInfo *TRI = MF->getTarget().getRegisterInfo(); - BitVector ReservedRegs = TRI->getReservedRegs(*MF); - const MachineInstr *Term = BB->getFirstTerminator(); - - for (unsigned I = 0, E = Term->getNumOperands(); I != E; ++I) { - const MachineOperand &MO = Term->getOperand(I); - if (!MO.isReg() || MO.isKill() || MO.isDead()) continue; - unsigned Reg = MO.getReg(); - if (Reg != X86::EFLAGS) continue; - copy0MBB->addLiveIn(Reg); - sinkMBB->addLiveIn(Reg); - } - // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB Modified: llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll?rev=106614&r1=106613&r2=106614&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll (original) +++ llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll Tue Jun 22 19:48:25 2010 @@ -1,4 +1,10 @@ ; RUN: llc < %s | FileCheck %s +; XFAIL: * +; +; See . This test isn't valid after we made machine +; sinking more conservative about sinking instructions that define a preg into a +; block when we don't know if the preg is killed within the current block. + target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-apple-darwin10.0.0" From daniel at zuster.org Tue Jun 22 19:49:14 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 22 Jun 2010 17:49:14 -0700 Subject: [llvm-commits] [llvm] r106066 - in /llvm/trunk: lib/CodeGen/MachineSink.cpp lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/MachineSink-CritEdge.ll In-Reply-To: References: <20100615234631.7B3142A6C12C@llvm.org> Message-ID: On Tue, Jun 22, 2010 at 5:45 PM, Daniel Dunbar wrote: > Hi Bill, > > It looks like bzip2 is being miscompiled with this commit in, I > reverted it in r106610. Err, r106614 that should read. - Daniel > > Can you take a look? > > ?- Daniel > > On Tue, Jun 15, 2010 at 4:46 PM, Bill Wendling wrote: >> Author: void >> Date: Tue Jun 15 18:46:31 2010 >> New Revision: 106066 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=106066&view=rev >> Log: >> Create a more targeted fix for not sinking instructions into a range where it >> will conflict with another live range. The place which creates this scenerio is >> the code in X86 that lowers a select instruction by splitting the MBBs. This >> eliminates the need to check from the bottom up in an MBB for live pregs. >> >> >> Modified: >> ? ?llvm/trunk/lib/CodeGen/MachineSink.cpp >> ? ?llvm/trunk/lib/Target/X86/X86ISelLowering.cpp >> ? ?llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll >> >> Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=106066&r1=106065&r2=106066&view=diff >> ============================================================================== >> --- llvm/trunk/lib/CodeGen/MachineSink.cpp (original) >> +++ llvm/trunk/lib/CodeGen/MachineSink.cpp Tue Jun 15 18:46:31 2010 >> @@ -25,7 +25,6 @@ >> ?#include "llvm/Target/TargetRegisterInfo.h" >> ?#include "llvm/Target/TargetInstrInfo.h" >> ?#include "llvm/Target/TargetMachine.h" >> -#include "llvm/ADT/SmallSet.h" >> ?#include "llvm/ADT/Statistic.h" >> ?#include "llvm/Support/Debug.h" >> ?#include "llvm/Support/raw_ostream.h" >> @@ -62,7 +61,6 @@ >> ? ? bool ProcessBlock(MachineBasicBlock &MBB); >> ? ? bool SinkInstruction(MachineInstr *MI, bool &SawStore); >> ? ? bool AllUsesDominatedByBlock(unsigned Reg, MachineBasicBlock *MBB) const; >> - ? ?bool LiveOutOfBasicBlock(const MachineInstr *MI, unsigned Reg) const; >> ? }; >> ?} // end anonymous namespace >> >> @@ -168,44 +166,6 @@ >> ? return MadeChange; >> ?} >> >> -/// LiveOutOfBasicBlock - Determine if the physical register, defined and dead >> -/// in MI, is live on exit from the basic block. >> -bool MachineSinking::LiveOutOfBasicBlock(const MachineInstr *MI, >> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? unsigned Reg) const { >> - ?assert(TargetRegisterInfo::isPhysicalRegister(Reg) && >> - ? ? ? ? "Only want to determine if a physical register is live out of a BB!"); >> - >> - ?const MachineBasicBlock *MBB = MI->getParent(); >> - ?SmallSet KilledRegs; >> - ?MachineBasicBlock::const_iterator I = MBB->end(); >> - ?MachineBasicBlock::const_iterator E = MBB->begin(); >> - ?assert(I != E && "How can there be an empty block at this point?!"); >> - >> - ?// Loop through the instructions bottom-up. If we see a kill of the preg >> - ?// first, then it's not live out of the BB. If we see a use or def first, then >> - ?// we assume that it is live out of the BB. >> - ?do { >> - ? ?const MachineInstr &CurMI = *--I; >> - >> - ? ?for (unsigned i = 0, e = CurMI.getNumOperands(); i != e; ++i) { >> - ? ? ?const MachineOperand &MO = CurMI.getOperand(i); >> - ? ? ?if (!MO.isReg()) continue; ?// Ignore non-register operands. >> - >> - ? ? ?unsigned MOReg = MO.getReg(); >> - ? ? ?if (MOReg == 0) continue; >> - >> - ? ? ?if (MOReg == Reg) { >> - ? ? ? ?if (MO.isKill()) >> - ? ? ? ? ?return false; >> - ? ? ? ?if (MO.isUse() || MO.isDef()) >> - ? ? ? ? ?return true; >> - ? ? ?} >> - ? ?} >> - ?} while (I != E); >> - >> - ?return false; >> -} >> - >> ?/// SinkInstruction - Determine whether it is safe to sink the specified machine >> ?/// instruction out of its current block into a successor. >> ?bool MachineSinking::SinkInstruction(MachineInstr *MI, bool &SawStore) { >> @@ -228,7 +188,6 @@ >> ? // SuccToSinkTo - This is the successor to sink this instruction to, once we >> ? // decide. >> ? MachineBasicBlock *SuccToSinkTo = 0; >> - ?SmallVector PhysRegs; >> >> ? for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { >> ? ? const MachineOperand &MO = MI->getOperand(i); >> @@ -257,12 +216,9 @@ >> ? ? ? ? ? if (AllocatableSet.test(AliasReg)) >> ? ? ? ? ? ? return false; >> ? ? ? ? } >> - ? ? ?} else { >> - ? ? ? ?if (!MO.isDead()) >> - ? ? ? ? ?// A def that isn't dead. We can't move it. >> - ? ? ? ? ?return false; >> - ? ? ? ?else >> - ? ? ? ? ?PhysRegs.push_back(Reg); >> + ? ? ?} else if (!MO.isDead()) { >> + ? ? ? ?// A def that isn't dead. We can't move it. >> + ? ? ? ?return false; >> ? ? ? } >> ? ? } else { >> ? ? ? // Virtual register uses are always safe to sink. >> @@ -329,10 +285,14 @@ >> ? // If the instruction to move defines a dead physical register which is live >> ? // when leaving the basic block, don't move it because it could turn into a >> ? // "zombie" define of that preg. E.g., EFLAGS. () >> - ?for (SmallVectorImpl::const_iterator >> - ? ? ? ? I = PhysRegs.begin(), E = PhysRegs.end(); I != E; ++I) >> - ? ?if (LiveOutOfBasicBlock(MI, *I)) >> + ?for (unsigned I = 0, E = MI->getNumOperands(); I != E; ++I) { >> + ? ?const MachineOperand &MO = MI->getOperand(I); >> + ? ?if (!MO.isReg()) continue; >> + ? ?unsigned Reg = MO.getReg(); >> + ? ?if (Reg == 0 || !TargetRegisterInfo::isPhysicalRegister(Reg)) continue; >> + ? ?if (SuccToSinkTo->isLiveIn(Reg)) >> ? ? ? return false; >> + ?} >> >> ? DEBUG(dbgs() << "Sink instr " << *MI << "\tinto block " << *SuccToSinkTo); >> >> >> Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=106066&r1=106065&r2=106066&view=diff >> ============================================================================== >> --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) >> +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jun 15 18:46:31 2010 >> @@ -8465,22 +8465,42 @@ >> ? MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); >> ? unsigned Opc = >> ? ? X86::GetCondBranchFromCond((X86::CondCode)MI->getOperand(3).getImm()); >> + >> ? BuildMI(BB, DL, TII->get(Opc)).addMBB(sinkMBB); >> ? F->insert(It, copy0MBB); >> ? F->insert(It, sinkMBB); >> + >> ? // Update machine-CFG edges by first adding all successors of the current >> ? // block to the new block which will contain the Phi node for the select. >> ? for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), >> ? ? ? ? ?E = BB->succ_end(); I != E; ++I) >> ? ? sinkMBB->addSuccessor(*I); >> + >> ? // Next, remove all successors of the current block, and add the true >> ? // and fallthrough blocks as its successors. >> ? while (!BB->succ_empty()) >> ? ? BB->removeSuccessor(BB->succ_begin()); >> + >> ? // Add the true and fallthrough blocks as its successors. >> ? BB->addSuccessor(copy0MBB); >> ? BB->addSuccessor(sinkMBB); >> >> + ?// If the EFLAGS register isn't dead in the terminator, then claim that it's >> + ?// live into the sink and copy blocks. >> + ?const MachineFunction *MF = BB->getParent(); >> + ?const TargetRegisterInfo *TRI = MF->getTarget().getRegisterInfo(); >> + ?BitVector ReservedRegs = TRI->getReservedRegs(*MF); >> + ?const MachineInstr *Term = BB->getFirstTerminator(); >> + >> + ?for (unsigned I = 0, E = Term->getNumOperands(); I != E; ++I) { >> + ? ?const MachineOperand &MO = Term->getOperand(I); >> + ? ?if (!MO.isReg() || MO.isKill() || MO.isDead()) continue; >> + ? ?unsigned Reg = MO.getReg(); >> + ? ?if (Reg != X86::EFLAGS) continue; >> + ? ?copy0MBB->addLiveIn(Reg); >> + ? ?sinkMBB->addLiveIn(Reg); >> + ?} >> + >> ? // ?copy0MBB: >> ? // ? %FalseValue = ... >> ? // ? # fallthrough to sinkMBB >> >> Modified: llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll?rev=106066&r1=106065&r2=106066&view=diff >> ============================================================================== >> --- llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll (original) >> +++ llvm/trunk/test/CodeGen/X86/MachineSink-CritEdge.ll Tue Jun 15 18:46:31 2010 >> @@ -1,10 +1,4 @@ >> ?; RUN: llc < %s | FileCheck %s >> -; XFAIL: * >> -; >> -; See . This test isn't valid after we made machine >> -; sinking more conservative about sinking instructions that define a preg into a >> -; block when we don't know if the preg is killed within the current block. >> - >> ?target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" >> ?target triple = "x86_64-apple-darwin10.0.0" >> >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > From ccoutant at google.com Tue Jun 22 18:22:38 2010 From: ccoutant at google.com (Cary Coutant) Date: Tue, 22 Jun 2010 16:22:38 -0700 Subject: [llvm-commits] [patch][gold plugin] Don't internalize symbols in objects that we will use as pass-through In-Reply-To: References: Message-ID: > The last remaining issue that i know is that gold can ask us to load a > file because it is used only on the IR. We then internalize the > symbols in that file and run codegen. Codegen can then create new > undefined references to those files that forces gold to fetch them > again (from the native code this time). I'm not sure I understand the scenario here. As I understand it, you have libgcc and libc in archive form, and full of IR objects. You have a reference to a symbol in one of those libraries in your IR code, so gold is loading a .o from the archive, and your plugin is claiming it. During LTO, you determine you don't actually need the symbol (because you ended up inlining it, perhaps, and it was IRONLY), so you drop the definition only to have later codegen generate a call to that routine, assuming that it's a standard library routine that can be found in object form. Is this about right? > There are a number of problem with this > *) Gold doesn't implement this all that well. It still has in its > symbol table that it loaded a file defining that symbol. What's still in the symbol table is a placeholder symbol, though. You mean that it won't load a definition for that symbol from an archive of real objects? That could probably be fixed, although it seems like the compiler really ought to be responsible for providing the definition. > *) We would end up with multiple copies of some symbols. How? If you have references to A and B in the IR, and you define A in a replacement file, but then search a real archive where A and B are both defined in the same object, yes, you could get a multiple definition. If this is the case, you should be breaking up the archive library into finer-grained objects. > *) LLVM can use smaller chunks of files than gold. Consider the case > of a file defining functions foo and bar. Function foo is used from > elf, and so we don't internalize it. Function bar is not used at that > time and we drop it. Now codegen introduces an undefined reference to > bar. What should gold do? Bringing in that file will fail because we > will have two visible definitions of foo. Not doing so will fail > because there is no where else to find bar. Right. What should gold do? Ideally, LTO would be able to anticipate any low-level routines needed by the late stages of codegen, and provide definitions of those routines in the replacement files it adds to the link. Adding a low-level library as a catch-all replacement file at the end of the link is just a hack, but to make that work, you need to have such symbols each in their own object file, so gold can load just what it needs without being forced to load symbols it doesn't need. > The best solution I could find is to disable internalize for any > functions defined in a library that is passed through. The attached > patch does this. It can be optimized, but I am not sure if that is > worth it, since normally there are only two libraries being passed > through (libgcc and libc). By "pass through," I assume you mean those low-level libraries that provide the functions that might be called by code generated late (after LTO analysis). Does this mean that gold first sees these libraries as IR files, then the plugin turns around and adds the "real" ELF equivalents as replacement files in order to catch these references introduced by late codegen? If you decline to internalize these symbols during LTO analysis, what's the point of providing them as IR files in the first place? (Maybe I'm not clear on what "internalize" means.) -cary From nicholas at mxc.ca Wed Jun 23 00:11:41 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 22 Jun 2010 22:11:41 -0700 Subject: [llvm-commits] [patch][gold plugin] Add an extra-library-path option to the plugin In-Reply-To: References: Message-ID: <4C21978D.1080707@mxc.ca> Rafael Espindola wrote: > Add an extra-library-path option to the plugin. This is used to support > having a library both as bitcode and native code. We want to use the > bitcode first, but if codegen produces new undefined references we have to use > the native code to satisfy those references. > > Gold has no notion of bitcode and native search directories, so instead it has > an API where the plugin can instruct it to look for the libraries it is passing > to it. This patch uses that API. I wish it were named 'late-bound native libraries' or last-chance native libraries or something. It also seems odd that it only supports one library. Anyhow, this patch is implements the feature as exposed by gold. Thanks! Nick From nicholas at mxc.ca Wed Jun 23 00:29:41 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 22 Jun 2010 22:29:41 -0700 Subject: [llvm-commits] [patch][gold plugin] Don't internalize symbols in objects that we will use as pass-through In-Reply-To: References: Message-ID: <4C219BC5.6090402@mxc.ca> Rafael Espindola wrote: > Cary, the patch is for LLVM, but I am ccing you in case you think this > should be done in gold somehow. > > This is hopefully the last patch is the libgcc and its dependencies saga. > > The last remaining issue that i know is that gold can ask us to load a > file because it is used only on the IR. We then internalize the > symbols in that file and run codegen. Codegen can then create new > undefined references to those files that forces gold to fetch them > again (from the native code this time). To restate, the scenario is: 1 you've got memcpy defined in IR and uses only in IR 2 so you internalize memcpy and inline it out of existence 3 then LLVM codegen emits a call to memcpy since it detected a copy loop and assumes libc/libgcc will always be there 4 you want gold to link against native libc/libgcc that weren't in the original link line So things went awry at step 3 really, but I'm going to assume that you've already considered and rejected removing all libcalls from the backend. Firstly, do you really need to do this? Why do you need to link against libgcc/libc as bitcode if you're willing to link to them as native code after all? > There are a number of problem with this > *) Gold doesn't implement this all that well. It still has in its > symbol table that it loaded a file defining that symbol. > *) We would end up with multiple copies of some symbols. > *) LLVM can use smaller chunks of files than gold. Consider the case > of a file defining functions foo and bar. Function foo is used from > elf, and so we don't internalize it. Function bar is not used at that > time and we drop it. Now codegen introduces an undefined reference to > bar. What should gold do? Bringing in that file will fail because we > will have two visible definitions of foo. Not doing so will fail > because there is no where else to find bar. > > The best solution I could find is to disable internalize for any > functions defined in a library that is passed through. The attached > patch does this. It can be optimized, but I am not sure if that is > worth it, since normally there are only two libraries being passed > through (libgcc and libc). + sys::Path path = sys::Path(file->name); + cf.pass_through = false; + if (path.getSuffix() == "a") { + llvm::StringRef basename = path.getBasename(); + if (basename.startswith("lib")) { + llvm::StringRef libname = basename.substr(strlen("lib")); + for (std::vector::iterator i = options::pass_through.begin(), + e = options::pass_through.end(); + i != e; ++i) { + llvm::StringRef item = *i; + if (item.startswith("-l") && + item.substr(strlen("-l")) == libname) + cf.pass_through = true; + } + } + } Please factor this into a helper function that takes file->name and returns whether or not it was found to be one of the pass_through libraries. Nick From devang.patel at gmail.com Wed Jun 23 00:35:08 2010 From: devang.patel at gmail.com (Devang Patel) Date: Tue, 22 Jun 2010 22:35:08 -0700 Subject: [llvm-commits] [patch][gold plugin] Don't internalize symbols in objects that we will use as pass-through In-Reply-To: References: Message-ID: On Tue, Jun 22, 2010 at 4:22 PM, Cary Coutant wrote: >> The last remaining issue that i know is that gold can ask us to load a >> file because it is used only on the IR. We then internalize the >> symbols in that file and run codegen. Codegen can then create new >> undefined references to those files that forces gold to fetch them >> again (from the native code this time). > > I'm not sure I understand the scenario here. As I understand it, you > have libgcc and libc in archive form, and full of IR objects. You have > a reference to a symbol in one of those libraries in your IR code, so > gold is loading a .o from the archive, and your plugin is claiming it. > During LTO, you determine you don't actually need the symbol (because > you ended up inlining it, perhaps, and it was IRONLY), so you drop the > definition only to have later codegen generate a call to that routine, > assuming that it's a standard library routine that can be found in > object form. Is this about right? > >> There are a number of problem with this >> *) Gold doesn't implement this all that well. It still has in its >> symbol table that it loaded a file defining that symbol. > > What's still in the symbol table is a placeholder symbol, though. You > mean that it won't load a definition for that symbol from an archive > of real objects? That could probably be fixed, although it seems like > the compiler really ought to be responsible for providing the > definition. > >> *) We would end up with multiple copies of some symbols. > > How? If you have references to A and B in the IR, and you define A in > a replacement file, but then search a real archive where A and B are > both defined in the same object, yes, you could get a multiple > definition. If this is the case, you should be breaking up the archive > library into finer-grained objects. > >> *) LLVM can use smaller chunks of files than gold. Consider the case >> of a file defining functions foo and bar. Function foo is used from >> elf, and so we don't internalize it. Function bar is not used at that >> time and we drop it. Now codegen introduces an undefined reference to >> bar. What should gold do? Bringing in that file will fail because we >> will have two visible definitions of foo. Not doing so will fail >> because there is no where else to find bar. > > Right. What should gold do? Ideally, LTO would be able to anticipate > any low-level routines needed by the late stages of codegen, and > provide definitions of those routines in the replacement files it adds > to the link. ... or ... The LLVM optimizer do not optimize away the symbols whose reference may be introduced by LLVM codegen (how to arrange this can be considered LLVM internal detail). The traditional linker can dead strip such symbols later on if their reference is not introduced by LLVM codegen phase. > Adding a low-level library as a catch-all replacement > file at the end of the link is just a hack, but to make that work, you > need to have such symbols each in their own object file, so gold can > load just what it needs without being forced to load symbols it > doesn't need. > >> The best solution I could find is to disable internalize for any >> functions defined in a library that is passed through. The attached >> patch does this. It can be optimized, but I am not sure if that is >> worth it, since normally there are only two libraries being passed >> through (libgcc and libc). > > By "pass through," I assume you mean those low-level libraries that > provide the functions that might be called by code generated late > (after LTO analysis). Does this mean that gold first sees these > libraries as IR files, then the plugin turns around and adds the > "real" ELF equivalents as replacement files in order to catch these > references introduced by late codegen? If you decline to internalize > these symbols during LTO analysis, what's the point of providing them > as IR files in the first place? (Maybe I'm not clear on what > "internalize" means.) > > -cary > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > - Devang From nicholas at mxc.ca Wed Jun 23 01:48:34 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Wed, 23 Jun 2010 06:48:34 -0000 Subject: [llvm-commits] [llvm] r106620 - in /llvm/trunk: cmake/config-ix.cmake utils/TableGen/CMakeLists.txt utils/unittest/googletest/README.LLVM utils/unittest/googletest/include/gtest/internal/gtest-port.h Message-ID: <20100623064834.B22A92A6C12C@llvm.org> Author: nicholas Date: Wed Jun 23 01:48:34 2010 New Revision: 106620 URL: http://llvm.org/viewvc/llvm-project?rev=106620&view=rev Log: Don't link against libm and libpthread which don't exist in BeOS/Haiku. Also, Haiku like Linux provides , so use it. Patch by Paul Davey! Modified: llvm/trunk/cmake/config-ix.cmake llvm/trunk/utils/TableGen/CMakeLists.txt llvm/trunk/utils/unittest/googletest/README.LLVM llvm/trunk/utils/unittest/googletest/include/gtest/internal/gtest-port.h Modified: llvm/trunk/cmake/config-ix.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=106620&r1=106619&r2=106620&view=diff ============================================================================== --- llvm/trunk/cmake/config-ix.cmake (original) +++ llvm/trunk/cmake/config-ix.cmake Wed Jun 23 01:48:34 2010 @@ -4,7 +4,7 @@ include(CheckFunctionExists) include(CheckCXXSourceCompiles) -if( UNIX ) +if( UNIX AND NOT BEOS ) # Used by check_symbol_exists: set(CMAKE_REQUIRED_LIBRARIES m) endif() Modified: llvm/trunk/utils/TableGen/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CMakeLists.txt?rev=106620&r1=106619&r2=106620&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CMakeLists.txt (original) +++ llvm/trunk/utils/TableGen/CMakeLists.txt Wed Jun 23 01:48:34 2010 @@ -41,6 +41,6 @@ if( MINGW ) target_link_libraries(tblgen imagehlp psapi) endif( MINGW ) -if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD ) +if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD AND NOT BEOS ) target_link_libraries(tblgen pthread) endif() Modified: llvm/trunk/utils/unittest/googletest/README.LLVM URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/unittest/googletest/README.LLVM?rev=106620&r1=106619&r2=106620&view=diff ============================================================================== --- llvm/trunk/utils/unittest/googletest/README.LLVM (original) +++ llvm/trunk/utils/unittest/googletest/README.LLVM Wed Jun 23 01:48:34 2010 @@ -27,3 +27,5 @@ Modified as follows: * To GTestStreamToHelper in include/gtest/internal/gtest-internal.h, added the ability to stream with raw_os_ostream. +* To refresh Haiku support in include/gtest/internal/gtest-port.h, + see http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20100621/102898.html Modified: llvm/trunk/utils/unittest/googletest/include/gtest/internal/gtest-port.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/unittest/googletest/include/gtest/internal/gtest-port.h?rev=106620&r1=106619&r2=106620&view=diff ============================================================================== --- llvm/trunk/utils/unittest/googletest/include/gtest/internal/gtest-port.h (original) +++ llvm/trunk/utils/unittest/googletest/include/gtest/internal/gtest-port.h Wed Jun 23 01:48:34 2010 @@ -80,6 +80,7 @@ // the given platform; otherwise undefined): // GTEST_OS_AIX - IBM AIX // GTEST_OS_CYGWIN - Cygwin +// GTEST_OS_HAIKU - Haiku // GTEST_OS_LINUX - Linux // GTEST_OS_MAC - Mac OS X // GTEST_OS_SOLARIS - Sun Solaris @@ -220,11 +221,11 @@ #elif defined(_AIX) #define GTEST_OS_AIX 1 #elif defined(__HAIKU__) -#define GTEST_OS_HAIKU +#define GTEST_OS_HAIKU 1 #endif // __CYGWIN__ -#if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_SYMBIAN || \ - GTEST_OS_SOLARIS || GTEST_OS_AIX +#if GTEST_OS_CYGWIN || GTEST_OS_HAIKU || GTEST_OS_LINUX || GTEST_OS_MAC || \ + GTEST_OS_SYMBIAN || GTEST_OS_SOLARIS || GTEST_OS_AIX // On some platforms, needs someone to define size_t, and // won't compile otherwise. We can #include it here as we already From nicholas at mxc.ca Wed Jun 23 01:49:34 2010 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 22 Jun 2010 23:49:34 -0700 Subject: [llvm-commits] [PATCH] more haiku suppor In-Reply-To: References: Message-ID: <4C21AE7E.4010209@mxc.ca> Paul Davey wrote: > some fixes: > Google test had some issues in the haiku support. > cmake lists trying to link libm and libpthread when it doesnt exist > but support is there, fixed by checking for haiku via the BEOS > variable Committed in r106620. Thanks! Nick From echristo at apple.com Wed Jun 23 03:01:49 2010 From: echristo at apple.com (Eric Christopher) Date: Wed, 23 Jun 2010 08:01:49 -0000 Subject: [llvm-commits] [llvm] r106621 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td Message-ID: <20100623080149.775DB2A6C12D@llvm.org> Author: echristo Date: Wed Jun 23 03:01:49 2010 New Revision: 106621 URL: http://llvm.org/viewvc/llvm-project?rev=106621&view=rev Log: Update uses, defs, and comments for darwin tls patterns. Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=106621&r1=106620&r2=106621&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Wed Jun 23 03:01:49 2010 @@ -1705,13 +1705,10 @@ [(X86tlsaddr tls64addr:$sym)]>, Requires<[In64BitMode]>; -// FIXME: Not true for darwin -let Defs = [RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11, - FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0, ST1, - MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, - XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, - XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS], - Uses = [RSP], +// For x86_64, the address of the thunk is passed in %rdi, on return +// the address of the variable is in %rax. All other registers are preserved. +let Defs = [RAX], + Uses = [RDI], usesCustomInserter = 1 in def TLSCall_64 : I<0, Pseudo, (outs), (ins i64mem:$sym), "# Fixme into a call", Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=106621&r1=106620&r2=106621&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Wed Jun 23 03:01:49 2010 @@ -3851,12 +3851,11 @@ [(X86tlsaddr tls32addr:$sym)]>, Requires<[In32BitMode]>; -// FIXME: Not true for darwin -let Defs = [EAX, ECX, EDX, FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0, - MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, - XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, - XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS], - Uses = [ESP], +// For i386, the address of the thunk is passed on the stack, on return the +// address of the variable is in %eax. %ecx is trashed during the function +// call. %edx is preserved. +let Defs = [EAX], + Uses = [ESP, ECX], usesCustomInserter = 1 in def TLSCall_32 : I<0, Pseudo, (outs), (ins i32mem:$sym), "# Fixme into a call", From ggreif at gmail.com Wed Jun 23 03:45:32 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 23 Jun 2010 08:45:32 -0000 Subject: [llvm-commits] [llvm] r106622 - /llvm/trunk/lib/VMCore/AutoUpgrade.cpp Message-ID: <20100623084532.67AD32A6C12C@llvm.org> Author: ggreif Date: Wed Jun 23 03:45:32 2010 New Revision: 106622 URL: http://llvm.org/viewvc/llvm-project?rev=106622&view=rev Log: use helper to neatly access arguments Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AutoUpgrade.cpp?rev=106622&r1=106621&r2=106622&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AutoUpgrade.cpp (original) +++ llvm/trunk/lib/VMCore/AutoUpgrade.cpp Wed Jun 23 03:45:32 2010 @@ -18,6 +18,7 @@ #include "llvm/Module.h" #include "llvm/IntrinsicInst.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/CallSite.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/IRBuilder.h" #include @@ -314,7 +315,8 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { Function *F = CI->getCalledFunction(); LLVMContext &C = CI->getContext(); - + ImmutableCallSite CS(CI); + assert(F && "CallInst has no function associated with it."); if (!NewFn) { @@ -583,9 +585,8 @@ case Intrinsic::ctlz: case Intrinsic::ctpop: case Intrinsic::cttz: { - // Build a small vector of the 1..(N-1) operands, which are the - // parameters. - SmallVector Operands(CI->op_begin()+1, CI->op_end()); + // Build a small vector of the original arguments. + SmallVector Operands(CS.arg_begin(), CS.arg_end()); // Construct a new CallInst CallInst *NewCI = CallInst::Create(NewFn, Operands.begin(), Operands.end(), @@ -620,7 +621,7 @@ case Intrinsic::eh_selector: case Intrinsic::eh_typeid_for: { // Only the return type changed. - SmallVector Operands(CI->op_begin() + 1, CI->op_end()); + SmallVector Operands(CS.arg_begin(), CS.arg_end()); CallInst *NewCI = CallInst::Create(NewFn, Operands.begin(), Operands.end(), "upgraded." + CI->getName(), CI); NewCI->setTailCall(CI->isTailCall()); From ggreif at gmail.com Wed Jun 23 08:09:06 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 23 Jun 2010 13:09:06 -0000 Subject: [llvm-commits] [llvm] r106623 - /llvm/trunk/lib/VMCore/AsmWriter.cpp Message-ID: <20100623130906.A92E92A6C12C@llvm.org> Author: ggreif Date: Wed Jun 23 08:09:06 2010 New Revision: 106623 URL: http://llvm.org/viewvc/llvm-project?rev=106623&view=rev Log: use ArgOperand accessors Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=106623&r1=106622&r2=106623&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Jun 23 08:09:06 2010 @@ -1854,6 +1854,7 @@ default: Out << " cc" << CI->getCallingConv(); break; } + Operand = CI->getCalledValue(); const PointerType *PTy = cast(Operand->getType()); const FunctionType *FTy = cast(PTy->getElementType()); const Type *RetTy = FTy->getReturnType(); @@ -1877,10 +1878,10 @@ writeOperand(Operand, true); } Out << '('; - for (unsigned op = 1, Eop = I.getNumOperands(); op < Eop; ++op) { - if (op > 1) + for (unsigned op = 0, Eop = CI->getNumArgOperands(); op < Eop; ++op) { + if (op > 0) Out << ", "; - writeParamOperand(I.getOperand(op), PAL.getParamAttributes(op)); + writeParamOperand(CI->getArgOperand(op), PAL.getParamAttributes(op + 1)); } Out << ')'; if (PAL.getFnAttributes() != Attribute::None) @@ -1925,10 +1926,10 @@ writeOperand(Operand, true); } Out << '('; - for (unsigned op = 0, Eop = I.getNumOperands() - 3; op < Eop; ++op) { + for (unsigned op = 0, Eop = II->getNumArgOperands(); op < Eop; ++op) { if (op) Out << ", "; - writeParamOperand(I.getOperand(op), PAL.getParamAttributes(op + 1)); + writeParamOperand(II->getArgOperand(op), PAL.getParamAttributes(op + 1)); } Out << ')'; From ggreif at gmail.com Wed Jun 23 08:56:57 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 23 Jun 2010 13:56:57 -0000 Subject: [llvm-commits] [llvm] r106626 - /llvm/trunk/lib/VMCore/Verifier.cpp Message-ID: <20100623135657.A72232A6C12C@llvm.org> Author: ggreif Date: Wed Jun 23 08:56:57 2010 New Revision: 106626 URL: http://llvm.org/viewvc/llvm-project?rev=106626&view=rev Log: use ArgOperand accessors Modified: llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=106626&r1=106625&r2=106626&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Wed Jun 23 08:56:57 2010 @@ -1637,16 +1637,16 @@ default: break; case Intrinsic::dbg_declare: { // llvm.dbg.declare - Assert1(CI.getOperand(1) && isa(CI.getOperand(1)), + Assert1(CI.getArgOperand(0) && isa(CI.getArgOperand(0)), "invalid llvm.dbg.declare intrinsic call 1", &CI); - MDNode *MD = cast(CI.getOperand(1)); + MDNode *MD = cast(CI.getArgOperand(0)); Assert1(MD->getNumOperands() == 1, "invalid llvm.dbg.declare intrinsic call 2", &CI); } break; case Intrinsic::memcpy: case Intrinsic::memmove: case Intrinsic::memset: - Assert1(isa(CI.getOperand(4)), + Assert1(isa(CI.getArgOperand(3)), "alignment argument of memory intrinsics must be a constant int", &CI); break; @@ -1655,10 +1655,10 @@ case Intrinsic::gcread: if (ID == Intrinsic::gcroot) { AllocaInst *AI = - dyn_cast(CI.getOperand(1)->stripPointerCasts()); + dyn_cast(CI.getArgOperand(0)->stripPointerCasts()); Assert1(AI && AI->getType()->getElementType()->isPointerTy(), "llvm.gcroot parameter #1 must be a pointer alloca.", &CI); - Assert1(isa(CI.getOperand(2)), + Assert1(isa(CI.getArgOperand(1)), "llvm.gcroot parameter #2 must be a constant.", &CI); } @@ -1666,32 +1666,32 @@ "Enclosing function does not use GC.", &CI); break; case Intrinsic::init_trampoline: - Assert1(isa(CI.getOperand(2)->stripPointerCasts()), + Assert1(isa(CI.getArgOperand(1)->stripPointerCasts()), "llvm.init_trampoline parameter #2 must resolve to a function.", &CI); break; case Intrinsic::prefetch: - Assert1(isa(CI.getOperand(2)) && - isa(CI.getOperand(3)) && - cast(CI.getOperand(2))->getZExtValue() < 2 && - cast(CI.getOperand(3))->getZExtValue() < 4, + Assert1(isa(CI.getArgOperand(1)) && + isa(CI.getArgOperand(2)) && + cast(CI.getArgOperand(1))->getZExtValue() < 2 && + cast(CI.getArgOperand(2))->getZExtValue() < 4, "invalid arguments to llvm.prefetch", &CI); break; case Intrinsic::stackprotector: - Assert1(isa(CI.getOperand(2)->stripPointerCasts()), + Assert1(isa(CI.getArgOperand(1)->stripPointerCasts()), "llvm.stackprotector parameter #2 must resolve to an alloca.", &CI); break; case Intrinsic::lifetime_start: case Intrinsic::lifetime_end: case Intrinsic::invariant_start: - Assert1(isa(CI.getOperand(1)), + Assert1(isa(CI.getArgOperand(0)), "size argument of memory use markers must be a constant integer", &CI); break; case Intrinsic::invariant_end: - Assert1(isa(CI.getOperand(2)), + Assert1(isa(CI.getArgOperand(1)), "llvm.invariant.end parameter #2 must be a constant integer", &CI); break; } From stoklund at 2pi.dk Wed Jun 23 10:34:36 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 23 Jun 2010 15:34:36 -0000 Subject: [llvm-commits] [llvm] r106627 - /llvm/trunk/lib/CodeGen/LiveInterval.cpp Message-ID: <20100623153436.79D312A6C12C@llvm.org> Author: stoklund Date: Wed Jun 23 10:34:36 2010 New Revision: 106627 URL: http://llvm.org/viewvc/llvm-project?rev=106627&view=rev Log: Add a few VNInfo data structure checks. Modified: llvm/trunk/lib/CodeGen/LiveInterval.cpp Modified: llvm/trunk/lib/CodeGen/LiveInterval.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveInterval.cpp?rev=106627&r1=106626&r2=106627&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveInterval.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveInterval.cpp Wed Jun 23 10:34:36 2010 @@ -529,6 +529,7 @@ SmallVector ReplacedValNos; iterator IP = begin(); for (const_iterator I = RHS.begin(), E = RHS.end(); I != E; ++I) { + assert(I->valno == RHS.getValNumInfo(I->valno->id) && "Bad VNInfo"); if (I->valno != RHSValNo) continue; SlotIndex Start = I->start, End = I->end; @@ -823,8 +824,10 @@ else { OS << " = "; for (LiveInterval::Ranges::const_iterator I = ranges.begin(), - E = ranges.end(); I != E; ++I) - OS << *I; + E = ranges.end(); I != E; ++I) { + OS << *I; + assert(I->valno == getValNumInfo(I->valno->id) && "Bad VNInfo"); + } } // Print value number info. From grosbach at apple.com Wed Jun 23 10:49:19 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 23 Jun 2010 15:49:19 -0000 Subject: [llvm-commits] [llvm] r106628 - /llvm/trunk/include/llvm/Target/TargetLowering.h Message-ID: <20100623154919.2DED62A6C12C@llvm.org> Author: grosbach Date: Wed Jun 23 10:49:18 2010 New Revision: 106628 URL: http://llvm.org/viewvc/llvm-project?rev=106628&view=rev Log: remove trailing whitespace Modified: llvm/trunk/include/llvm/Target/TargetLowering.h Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=106628&r1=106627&r2=106628&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed Jun 23 10:49:18 2010 @@ -114,7 +114,7 @@ /// isSelectExpensive - Return true if the select operation is expensive for /// this target. bool isSelectExpensive() const { return SelectIsExpensive; } - + /// isIntDivCheap() - Return true if integer divide is usually cheaper than /// a sequence of several shifts, adds, and multiplies for this target. bool isIntDivCheap() const { return IntDivIsCheap; } @@ -131,10 +131,10 @@ virtual MVT::SimpleValueType getSetCCResultType(EVT VT) const; - /// getCmpLibcallReturnType - Return the ValueType for comparison + /// getCmpLibcallReturnType - Return the ValueType for comparison /// libcalls. Comparions libcalls include floating point comparion calls, /// and Ordered/Unordered check calls on floating point numbers. - virtual + virtual MVT::SimpleValueType getCmpLibcallReturnType() const; /// getBooleanContents - For targets without i1 registers, this gives the @@ -208,7 +208,7 @@ ValueTypeActions[I] = Action; } }; - + const ValueTypeActionImpl &getValueTypeActions() const { return ValueTypeActions; } @@ -229,7 +229,7 @@ /// returns the integer type to transform to. EVT getTypeToTransformTo(LLVMContext &Context, EVT VT) const { if (VT.isSimple()) { - assert((unsigned)VT.getSimpleVT().SimpleTy < + assert((unsigned)VT.getSimpleVT().SimpleTy < array_lengthof(TransformToType)); EVT NVT = TransformToType[VT.getSimpleVT().SimpleTy]; assert(getTypeAction(Context, NVT) != Promote && @@ -256,7 +256,7 @@ return EVT::getIntegerVT(Context, VT.getSizeInBits() / 2); else // Promote to a power of two size, avoiding multi-step promotion. - return getTypeAction(Context, NVT) == Promote ? + return getTypeAction(Context, NVT) == Promote ? getTypeToTransformTo(Context, NVT) : NVT; } assert(0 && "Unsupported extended type!"); @@ -302,11 +302,11 @@ /// intrinsic will need to map to a MemIntrinsicNode (touches memory). If /// this is the case, it returns true and store the intrinsic /// information into the IntrinsicInfo that was passed to the function. - struct IntrinsicInfo { + struct IntrinsicInfo { unsigned opc; // target opcode EVT memVT; // memory VT const Value* ptrVal; // value representing memory location - int offset; // offset off of ptrVal + int offset; // offset off of ptrVal unsigned align; // alignment bool vol; // is volatile? bool readMem; // reads memory? @@ -324,7 +324,7 @@ virtual bool isFPImmLegal(const APFloat &Imm, EVT VT) const { return false; } - + /// isShuffleMaskLegal - Targets can use this to indicate that they only /// support *some* VECTOR_SHUFFLE operations, those with specific masks. /// By default, if a target supports the VECTOR_SHUFFLE node, all mask values @@ -446,7 +446,7 @@ "Table isn't big enough!"); unsigned Ty = (unsigned)VT.getSimpleVT().SimpleTy; return (LegalizeAction)(IndexedModeActions[Ty][IdxMode] & 0x0f); - } + } /// isIndexedStoreLegal - Return true if the specified indexed load is legal /// on this target. @@ -492,7 +492,7 @@ assert((VT.isInteger() || VT.isFloatingPoint()) && "Cannot autopromote this type, add it with AddPromotedToType."); - + EVT NVT = VT; do { NVT = (MVT::SimpleValueType)(NVT.getSimpleVT().SimpleTy+1); @@ -516,14 +516,14 @@ /// function arguments in the caller parameter area. This is the actual /// alignment, not its logarithm. virtual unsigned getByValTypeAlignment(const Type *Ty) const; - + /// getRegisterType - Return the type of registers that this ValueType will /// eventually require. EVT getRegisterType(MVT VT) const { assert((unsigned)VT.SimpleTy < array_lengthof(RegisterTypeForVT)); return RegisterTypeForVT[VT.SimpleTy]; } - + /// getRegisterType - Return the type of registers that this ValueType will /// eventually require. EVT getRegisterType(LLVMContext &Context, EVT VT) const { @@ -606,7 +606,7 @@ /// of the specified type. This is used, for example, in situations where an /// array copy/move/set is converted to a sequence of store operations. It's /// use helps to ensure that such replacements don't generate code that causes - /// an alignment error (trap) on the target machine. + /// an alignment error (trap) on the target machine. /// @brief Determine if the target supports unaligned memory accesses. virtual bool allowsUnalignedMemoryAccesses(EVT VT) const { return false; @@ -637,7 +637,7 @@ MachineFunction &MF) const { return MVT::Other; } - + /// usesUnderscoreSetJmp - Determine if we should use _setjmp or setjmp /// to implement llvm.setjmp. bool usesUnderscoreSetJmp() const { @@ -701,7 +701,7 @@ unsigned getPrefLoopAlignment() const { return PrefLoopAlignment; } - + /// getPreIndexedAddressParts - returns true by value, base pointer and /// offset pointer and addressing mode by reference if the node's address /// can be legally represented as pre-indexed load / store address. @@ -711,7 +711,7 @@ SelectionDAG &DAG) const { return false; } - + /// getPostIndexedAddressParts - returns true by value, base pointer and /// offset pointer and addressing mode by reference if this node can be /// combined with a load / store to form a post-indexed load / store. @@ -721,12 +721,12 @@ SelectionDAG &DAG) const { return false; } - + /// getJumpTableEncoding - Return the entry encoding for a jump table in the /// current function. The returned value is a member of the /// MachineJumpTableInfo::JTEntryKind enum. virtual unsigned getJumpTableEncoding() const; - + virtual const MCExpr * LowerCustomJumpTableEntry(const MachineJumpTableInfo *MJTI, const MachineBasicBlock *MBB, unsigned uid, @@ -734,7 +734,7 @@ assert(0 && "Need to implement this hook if target has custom JTIs"); return 0; } - + /// getPICJumpTableRelocaBase - Returns relocation base for the given PIC /// jumptable. virtual SDValue getPICJumpTableRelocBase(SDValue Table, @@ -746,7 +746,7 @@ virtual const MCExpr * getPICJumpTableRelocBaseExpr(const MachineFunction *MF, unsigned JTI, MCContext &Ctx) const; - + /// isOffsetFoldingLegal - Return true if folding a constant offset /// with the given GlobalAddress is legal. It is frequently not legal in /// PIC relocation models. @@ -758,10 +758,10 @@ //===--------------------------------------------------------------------===// // TargetLowering Optimization Methods // - + /// TargetLoweringOpt - A convenience struct that encapsulates a DAG, and two /// SDValues for returning information from TargetLowering to its clients - /// that want to combine + /// that want to combine struct TargetLoweringOpt { SelectionDAG &DAG; bool LegalTys; @@ -775,14 +775,14 @@ bool LegalTypes() const { return LegalTys; } bool LegalOperations() const { return LegalOps; } - - bool CombineTo(SDValue O, SDValue N) { - Old = O; - New = N; + + bool CombineTo(SDValue O, SDValue N) { + Old = O; + New = N; return true; } - - /// ShrinkDemandedConstant - Check to see if the specified operand of the + + /// ShrinkDemandedConstant - Check to see if the specified operand of the /// specified instruction is a constant integer. If so, check to see if /// there are any bits set in the constant that are not demanded. If so, /// shrink the constant and return true. @@ -795,25 +795,25 @@ bool ShrinkDemandedOp(SDValue Op, unsigned BitWidth, const APInt &Demanded, DebugLoc dl); }; - + /// SimplifyDemandedBits - Look at Op. At this point, we know that only the /// DemandedMask bits of the result of Op are ever used downstream. If we can /// use this information to simplify Op, create a new simplified DAG node and - /// return true, returning the original and new nodes in Old and New. - /// Otherwise, analyze the expression and return a mask of KnownOne and - /// KnownZero bits for the expression (used to simplify the caller). - /// The KnownZero/One bits may only be accurate for those bits in the + /// return true, returning the original and new nodes in Old and New. + /// Otherwise, analyze the expression and return a mask of KnownOne and + /// KnownZero bits for the expression (used to simplify the caller). + /// The KnownZero/One bits may only be accurate for those bits in the /// DemandedMask. - bool SimplifyDemandedBits(SDValue Op, const APInt &DemandedMask, + bool SimplifyDemandedBits(SDValue Op, const APInt &DemandedMask, APInt &KnownZero, APInt &KnownOne, TargetLoweringOpt &TLO, unsigned Depth = 0) const; - + /// computeMaskedBitsForTargetNode - Determine which of the bits specified in - /// Mask are known to be either zero or one and return them in the + /// Mask are known to be either zero or one and return them in the /// KnownZero/KnownOne bitsets. virtual void computeMaskedBitsForTargetNode(const SDValue Op, const APInt &Mask, - APInt &KnownZero, + APInt &KnownZero, APInt &KnownOne, const SelectionDAG &DAG, unsigned Depth = 0) const; @@ -823,7 +823,7 @@ /// DAG Combiner. virtual unsigned ComputeNumSignBitsForTargetNode(SDValue Op, unsigned Depth = 0) const; - + struct DAGCombinerInfo { void *DC; // The DAG Combiner object. bool BeforeLegalize; @@ -831,15 +831,15 @@ bool CalledByLegalizer; public: SelectionDAG &DAG; - + DAGCombinerInfo(SelectionDAG &dag, bool bl, bool blo, bool cl, void *dc) : DC(dc), BeforeLegalize(bl), BeforeLegalizeOps(blo), CalledByLegalizer(cl), DAG(dag) {} - + bool isBeforeLegalize() const { return BeforeLegalize; } bool isBeforeLegalizeOps() const { return BeforeLegalizeOps; } bool isCalledByLegalizer() const { return CalledByLegalizer; } - + void AddToWorklist(SDNode *N); SDValue CombineTo(SDNode *N, const std::vector &To, bool AddTo = true); @@ -849,7 +849,7 @@ void CommitTargetLoweringOpt(const TargetLoweringOpt &TLO); }; - /// SimplifySetCC - Try to simplify a setcc built with the specified operands + /// SimplifySetCC - Try to simplify a setcc built with the specified operands /// and cc. If it is unable to simplify it, return a null SDValue. SDValue SimplifySetCC(EVT VT, SDValue N0, SDValue N1, ISD::CondCode Cond, bool foldBooleans, @@ -890,7 +890,7 @@ virtual bool IsDesirableToPromoteOp(SDValue Op, EVT &PVT) const { return false; } - + //===--------------------------------------------------------------------===// // TargetLowering Configuration Methods - These methods should be invoked by // the derived class constructor to configure this object for the target. @@ -930,7 +930,7 @@ void setStackPointerRegisterToSaveRestore(unsigned R) { StackPointerRegisterToSaveRestore = R; } - + /// setExceptionPointerRegister - If set to a physical register, this sets /// the register that receives the exception address on entry to a landing /// pad. @@ -953,12 +953,12 @@ /// expensive, and if possible, should be replaced by an alternate sequence /// of instructions not containing an integer divide. void setIntDivIsCheap(bool isCheap = true) { IntDivIsCheap = isCheap; } - + /// setPow2DivIsCheap - Tells the code generator that it shouldn't generate /// srl/add/sra for a signed divide by power of two, and let the target handle /// it. void setPow2DivIsCheap(bool isCheap = true) { Pow2DivIsCheap = isCheap; } - + /// addRegisterClass - Add the specified register class as an available /// regclass for the specified value type. This indicates the selector can /// handle values of that class natively. @@ -981,7 +981,7 @@ assert(Op < array_lengthof(OpActions[0]) && "Table isn't big enough!"); OpActions[(unsigned)VT.SimpleTy][Op] = (uint8_t)Action; } - + /// setLoadExtAction - Indicate that the specified load with extension does /// not work with the specified type and indicate what to do about it. void setLoadExtAction(unsigned ExtType, MVT VT, @@ -991,7 +991,7 @@ "Table isn't big enough!"); LoadExtActions[VT.SimpleTy][ExtType] = (uint8_t)Action; } - + /// setTruncStoreAction - Indicate that the specified truncating store does /// not work with the specified type and indicate what to do about it. void setTruncStoreAction(MVT ValVT, MVT MemVT, @@ -1016,7 +1016,7 @@ IndexedModeActions[(unsigned)VT.SimpleTy][IdxMode] &= ~0xf0; IndexedModeActions[(unsigned)VT.SimpleTy][IdxMode] |= ((uint8_t)Action) <<4; } - + /// setIndexedStoreAction - Indicate that the specified indexed store does or /// does not work with the specified type and indicate what to do about /// it. NOTE: All indexed mode stores are initialized to Expand in @@ -1031,7 +1031,7 @@ IndexedModeActions[(unsigned)VT.SimpleTy][IdxMode] &= ~0x0f; IndexedModeActions[(unsigned)VT.SimpleTy][IdxMode] |= ((uint8_t)Action); } - + /// setCondCodeAction - Indicate that the specified condition code is or isn't /// supported on the target and indicate what to do about it. void setCondCodeAction(ISD::CondCode CC, MVT VT, @@ -1058,7 +1058,7 @@ assert(unsigned(NT >> 3) < array_lengthof(TargetDAGCombineArray)); TargetDAGCombineArray[NT >> 3] |= 1 << (NT&7); } - + /// setJumpBufSize - Set the target's required jmp_buf buffer size (in /// bytes); default is 200 void setJumpBufSize(unsigned Size) { @@ -1076,7 +1076,7 @@ void setIfCvtBlockSizeLimit(unsigned Limit) { IfCvtBlockSizeLimit = Limit; } - + /// setIfCvtDupBlockSizeLimit - Set the target's block size limit (in number /// of instructions) to be considered for code duplication during /// if-conversion; default is 2. @@ -1089,7 +1089,7 @@ void setPrefLoopAlignment(unsigned Align) { PrefLoopAlignment = Align; } - + public: //===--------------------------------------------------------------------===// // Lowering methods - These methods must be implemented by targets so that @@ -1198,7 +1198,7 @@ SmallVectorImpl &Results, SelectionDAG &DAG) const; - /// LowerOperation - This callback is invoked for operations that are + /// LowerOperation - This callback is invoked for operations that are /// unsupported by the target, which are registered to use 'custom' lowering, /// and whose defined values are all legal. /// If the target has no operations that require custom lowering, it need not @@ -1241,7 +1241,7 @@ //===--------------------------------------------------------------------===// // Inline Asm Support hooks // - + /// ExpandInlineAsm - This hook allows the target to expand an inline asm /// call to be explicit llvm code if it wants to. This is useful for /// turning simple inline asms into LLVM intrinsics, which gives the @@ -1249,7 +1249,7 @@ virtual bool ExpandInlineAsm(CallInst *CI) const { return false; } - + enum ConstraintType { C_Register, // Constraint represents specific register(s). C_RegisterClass, // Constraint represents any of register(s) in class. @@ -1257,7 +1257,7 @@ C_Other, // Something else. C_Unknown // Unsupported constraint. }; - + /// AsmOperandInfo - This contains information for each constraint that we are /// lowering. struct AsmOperandInfo : public InlineAsm::ConstraintInfo { @@ -1269,25 +1269,25 @@ /// ConstraintType - Information about the constraint code, e.g. Register, /// RegisterClass, Memory, Other, Unknown. TargetLowering::ConstraintType ConstraintType; - + /// 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. Value *CallOperandVal; - + /// ConstraintVT - The ValueType for the operand value. EVT ConstraintVT; - + /// isMatchingInputConstraint - Return true of this is an input operand that /// is a matching constraint like "4". bool isMatchingInputConstraint() const; - + /// getMatchedOperand - If this is an input matching constraint, this method /// returns the output operand it matches. unsigned getMatchedOperand() const; - + AsmOperandInfo(const InlineAsm::ConstraintInfo &info) - : InlineAsm::ConstraintInfo(info), + : InlineAsm::ConstraintInfo(info), ConstraintType(TargetLowering::C_Unknown), CallOperandVal(0), ConstraintVT(MVT::Other) { } @@ -1303,15 +1303,15 @@ SDValue Op, bool hasMemory, SelectionDAG *DAG = 0) const; - + /// getConstraintType - Given a constraint, return the type of constraint it /// is for this target. virtual ConstraintType getConstraintType(const std::string &Constraint) const; - + /// getRegClassForInlineAsmConstraint - Given a constraint letter (e.g. "r"), /// return a list of registers that can be used to satisfy the constraint. /// This should only be used for C_RegisterClass constraints. - virtual std::vector + virtual std::vector getRegClassForInlineAsmConstraint(const std::string &Constraint, EVT VT) const; @@ -1325,16 +1325,16 @@ /// /// This should only be used for C_Register constraints. On error, /// this returns a register number of 0 and a null register class pointer.. - virtual std::pair + virtual std::pair getRegForInlineAsmConstraint(const std::string &Constraint, EVT VT) const; - + /// LowerXConstraint - try to replace an X constraint, which matches anything, /// with another that has more specific requirements based on the type of the /// corresponding operand. This returns null if there is no replacement to /// make. virtual const char *LowerXConstraint(EVT ConstraintVT) const; - + /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops /// vector. If it is invalid, don't add anything to Ops. If hasMemory is true /// it means one of the asm constraint of the inline asm instruction being @@ -1343,11 +1343,11 @@ bool hasMemory, std::vector &Ops, SelectionDAG &DAG) const; - + //===--------------------------------------------------------------------===// // Instruction Emitting Hooks // - + // EmitInstrWithCustomInserter - This method should be implemented by targets // that mark instructions with the 'usesCustomInserter' flag. These // instructions are special in various ways, which require special support to @@ -1376,7 +1376,7 @@ int64_t Scale; AddrMode() : BaseGV(0), BaseOffs(0), HasBaseReg(false), Scale(0) {} }; - + /// isLegalAddressingMode - Return true if the addressing mode represented by /// AM is legal for this target, for a load/store of the specified type. /// The type may be VoidTy, in which case only return true if the addressing @@ -1429,9 +1429,9 @@ //===--------------------------------------------------------------------===// // Div utility functions // - SDValue BuildSDIV(SDNode *N, SelectionDAG &DAG, + SDValue BuildSDIV(SDNode *N, SelectionDAG &DAG, std::vector* Created) const; - SDValue BuildUDIV(SDNode *N, SelectionDAG &DAG, + SDValue BuildUDIV(SDNode *N, SelectionDAG &DAG, std::vector* Created) const; @@ -1468,7 +1468,7 @@ void setLibcallCallingConv(RTLIB::Libcall Call, CallingConv::ID CC) { LibcallCallingConvs[Call] = CC; } - + /// getLibcallCallingConv - Get the CallingConv that should be used for the /// specified libcall. CallingConv::ID getLibcallCallingConv(RTLIB::Libcall Call) const { @@ -1497,12 +1497,12 @@ /// a real cost model is in place. If we ever optimize for size, this will be /// set to true unconditionally. bool IntDivIsCheap; - + /// Pow2DivIsCheap - Tells the code generator that it shouldn't generate /// srl/add/sra for a signed divide by power of two, and let the target handle /// it. bool Pow2DivIsCheap; - + /// UseUnderscoreSetJmp - This target prefers to use _setjmp to implement /// llvm.setjmp. Defaults to false. bool UseUnderscoreSetJmp; @@ -1522,10 +1522,10 @@ /// SchedPreferenceInfo - The target scheduling preference: shortest possible /// total cycles or lowest register usage. Sched::Preference SchedPreferenceInfo; - + /// JumpBufSize - The size, in bytes, of the target's jmp_buf buffers unsigned JumpBufSize; - + /// JumpBufAlignment - The alignment, in bytes, of the target's jmp_buf /// buffers unsigned JumpBufAlignment; @@ -1533,7 +1533,7 @@ /// IfCvtBlockSizeLimit - The maximum allowed size for a block to be /// if-converted. unsigned IfCvtBlockSizeLimit; - + /// IfCvtDupBlockSizeLimit - The maximum allowed size for a block to be /// duplicated during if-conversion. unsigned IfCvtDupBlockSizeLimit; @@ -1581,12 +1581,12 @@ /// operations that are not should be described. Note that operations on /// non-legal value types are not described here. uint8_t OpActions[MVT::LAST_VALUETYPE][ISD::BUILTIN_OP_END]; - + /// LoadExtActions - For each load extension type and each value type, /// keep a LegalizeAction that indicates how instruction selection should deal /// with a load of a specific value type and extension type. uint8_t LoadExtActions[MVT::LAST_VALUETYPE][ISD::LAST_LOADEXT_TYPE]; - + /// TruncStoreActions - For each value type pair keep a LegalizeAction that /// indicates whether a truncating store of a specific value type and /// truncating type is legal. @@ -1598,7 +1598,7 @@ /// value_type for the reference. The second dimension represents the various /// modes for load store. uint8_t IndexedModeActions[MVT::LAST_VALUETYPE][ISD::LAST_INDEXED_MODE]; - + /// CondCodeActions - For each condition code (ISD::CondCode) keep a /// LegalizeAction that indicates how instruction selection should /// deal with the condition code. @@ -1613,7 +1613,7 @@ /// which sets a bit in this array. unsigned char TargetDAGCombineArray[(ISD::BUILTIN_OP_END+CHAR_BIT-1)/CHAR_BIT]; - + /// PromoteToType - For operations that must be promoted to a specific type, /// this holds the destination type. This map should be sparse, so don't hold /// it as an array. From grosbach at apple.com Wed Jun 23 11:07:42 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 23 Jun 2010 16:07:42 -0000 Subject: [llvm-commits] [llvm] r106630 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp Message-ID: <20100623160742.90ED62A6C12C@llvm.org> Author: grosbach Date: Wed Jun 23 11:07:42 2010 New Revision: 106630 URL: http://llvm.org/viewvc/llvm-project?rev=106630&view=rev Log: Some targets don't require the fencing MEMBARRIER instructions surrounding atomic intrinsics, either because the use locking instructions for the atomics, or because they perform the locking directly. Add support in the DAG combiner to fold away the fences. Modified: llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=106630&r1=106629&r2=106630&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed Jun 23 11:07:42 2010 @@ -702,6 +702,13 @@ return PrefLoopAlignment; } + /// getShouldFoldAtomicFences - return whether the combiner should fold + /// fence MEMBARRIER instructions into the atomic intrinsic instructions. + /// + bool getShouldFoldAtomicFences() const { + return ShouldFoldAtomicFences; + } + /// getPreIndexedAddressParts - returns true by value, base pointer and /// offset pointer and addressing mode by reference if the node's address /// can be legally represented as pre-indexed load / store address. @@ -1090,6 +1097,12 @@ PrefLoopAlignment = Align; } + /// setShouldFoldAtomicFences - Set if the target's implementation of the + /// atomic operation intrinsics includes locking. Default is false. + void setShouldFoldAtomicFences(bool fold) { + ShouldFoldAtomicFences = fold; + } + public: //===--------------------------------------------------------------------===// // Lowering methods - These methods must be implemented by targets so that @@ -1542,6 +1555,11 @@ /// unsigned PrefLoopAlignment; + /// ShouldFoldAtomicFences - Whether fencing MEMBARRIER instructions should + /// be folded into the enclosed atomic intrinsic instruction by the + /// combiner. + bool ShouldFoldAtomicFences; + /// StackPointerRegisterToSaveRestore - If set to a physical register, this /// specifies the register that llvm.savestack/llvm.restorestack should save /// and restore. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=106630&r1=106629&r2=106630&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Jun 23 11:07:42 2010 @@ -211,6 +211,7 @@ SDValue visitBUILD_VECTOR(SDNode *N); SDValue visitCONCAT_VECTORS(SDNode *N); SDValue visitVECTOR_SHUFFLE(SDNode *N); + SDValue visitMEMBARRIER(SDNode *N); SDValue XformToShuffleWithZero(SDNode *N); SDValue ReassociateOps(unsigned Opc, DebugLoc DL, SDValue LHS, SDValue RHS); @@ -1079,6 +1080,7 @@ case ISD::BUILD_VECTOR: return visitBUILD_VECTOR(N); case ISD::CONCAT_VECTORS: return visitCONCAT_VECTORS(N); case ISD::VECTOR_SHUFFLE: return visitVECTOR_SHUFFLE(N); + case ISD::MEMBARRIER: return visitMEMBARRIER(N); } return SDValue(); } @@ -6363,6 +6365,59 @@ return SDValue(); } +SDValue DAGCombiner::visitMEMBARRIER(SDNode* N) { + if (!TLI.getShouldFoldAtomicFences()) + return SDValue(); + + SDValue atomic = N->getOperand(0); + switch (atomic.getOpcode()) { + case ISD::ATOMIC_CMP_SWAP: + case ISD::ATOMIC_SWAP: + case ISD::ATOMIC_LOAD_ADD: + case ISD::ATOMIC_LOAD_SUB: + case ISD::ATOMIC_LOAD_AND: + case ISD::ATOMIC_LOAD_OR: + case ISD::ATOMIC_LOAD_XOR: + case ISD::ATOMIC_LOAD_NAND: + case ISD::ATOMIC_LOAD_MIN: + case ISD::ATOMIC_LOAD_MAX: + case ISD::ATOMIC_LOAD_UMIN: + case ISD::ATOMIC_LOAD_UMAX: + break; + default: + return SDValue(); + } + + SDValue fence = atomic.getOperand(0); + if (fence.getOpcode() != ISD::MEMBARRIER) + return SDValue(); + + switch (atomic.getOpcode()) { + case ISD::ATOMIC_CMP_SWAP: + return SDValue(DAG.UpdateNodeOperands(atomic.getNode(), + fence.getOperand(0), + atomic.getOperand(1), atomic.getOperand(2), + atomic.getOperand(3)), atomic.getResNo()); + case ISD::ATOMIC_SWAP: + case ISD::ATOMIC_LOAD_ADD: + case ISD::ATOMIC_LOAD_SUB: + case ISD::ATOMIC_LOAD_AND: + case ISD::ATOMIC_LOAD_OR: + case ISD::ATOMIC_LOAD_XOR: + case ISD::ATOMIC_LOAD_NAND: + case ISD::ATOMIC_LOAD_MIN: + case ISD::ATOMIC_LOAD_MAX: + case ISD::ATOMIC_LOAD_UMIN: + case ISD::ATOMIC_LOAD_UMAX: + return SDValue(DAG.UpdateNodeOperands(atomic.getNode(), + fence.getOperand(0), + atomic.getOperand(1), atomic.getOperand(2)), + atomic.getResNo()); + default: + return SDValue(); + } +} + /// XformToShuffleWithZero - Returns a vector_shuffle if it able to transform /// an AND to a vector_shuffle with the destination vector and a zero vector. /// e.g. AND V, <0xffffffff, 0, 0xffffffff, 0>. ==> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=106630&r1=106629&r2=106630&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Wed Jun 23 11:07:42 2010 @@ -581,6 +581,7 @@ IfCvtBlockSizeLimit = 2; IfCvtDupBlockSizeLimit = 0; PrefLoopAlignment = 0; + ShouldFoldAtomicFences = false; InitLibcallNames(LibcallRoutineNames); InitCmpLibcallCCs(CmpLibcallCCs); From grosbach at apple.com Wed Jun 23 11:08:50 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 23 Jun 2010 16:08:50 -0000 Subject: [llvm-commits] [llvm] r106631 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <20100623160850.189782A6C12C@llvm.org> Author: grosbach Date: Wed Jun 23 11:08:49 2010 New Revision: 106631 URL: http://llvm.org/viewvc/llvm-project?rev=106631&view=rev Log: When using libcall expansions for the atomic intrinsics, the explicit MEMBARRIER fences aren't necessary for ARM. Tell the combiner to fold them away. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=106631&r1=106630&r2=106631&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Jun 23 11:08:49 2010 @@ -441,6 +441,8 @@ setOperationAction(ISD::ATOMIC_LOAD_NAND, MVT::i8, Expand); setOperationAction(ISD::ATOMIC_LOAD_NAND, MVT::i16, Expand); setOperationAction(ISD::ATOMIC_LOAD_NAND, MVT::i32, Expand); + // Since the libcalls include locking, fold in the fences + setShouldFoldAtomicFences(true); } // 64-bit versions are always libcalls (for now) setOperationAction(ISD::ATOMIC_CMP_SWAP, MVT::i64, Expand); From grosbach at apple.com Wed Jun 23 11:25:07 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 23 Jun 2010 16:25:07 -0000 Subject: [llvm-commits] [llvm] r106633 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <20100623162507.DCAAB2A6C12C@llvm.org> Author: grosbach Date: Wed Jun 23 11:25:07 2010 New Revision: 106633 URL: http://llvm.org/viewvc/llvm-project?rev=106633&view=rev Log: The generic DAG combiner can now fold atomic fences when needed, so switch to using that. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=106633&r1=106632&r2=106633&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jun 23 11:25:07 2010 @@ -347,6 +347,12 @@ if (!Subtarget->hasSSE2()) setOperationAction(ISD::MEMBARRIER , MVT::Other, Expand); + // On X86 and X86-64, atomic operations are lowered to locked instructions. + // Locked instructions, in turn, have implicit fence semantics (all memory + // operations are flushed before issuing the locked instruction, and they + // are not buffered), so we can fold away the common pattern of + // fence-atomic-fence. + setShouldFoldAtomicFences(true); // Expand certain atomics setOperationAction(ISD::ATOMIC_CMP_SWAP, MVT::i8, Custom); @@ -1012,7 +1018,6 @@ setTargetDAGCombine(ISD::SRL); setTargetDAGCombine(ISD::OR); setTargetDAGCombine(ISD::STORE); - setTargetDAGCombine(ISD::MEMBARRIER); setTargetDAGCombine(ISD::ZERO_EXTEND); if (Subtarget->is64Bit()) setTargetDAGCombine(ISD::MUL); @@ -9821,61 +9826,6 @@ return SDValue(); } -// On X86 and X86-64, atomic operations are lowered to locked instructions. -// Locked instructions, in turn, have implicit fence semantics (all memory -// operations are flushed before issuing the locked instruction, and they -// are not buffered), so we can fold away the common pattern of -// fence-atomic-fence. -static SDValue PerformMEMBARRIERCombine(SDNode* N, SelectionDAG &DAG) { - SDValue atomic = N->getOperand(0); - switch (atomic.getOpcode()) { - case ISD::ATOMIC_CMP_SWAP: - case ISD::ATOMIC_SWAP: - case ISD::ATOMIC_LOAD_ADD: - case ISD::ATOMIC_LOAD_SUB: - case ISD::ATOMIC_LOAD_AND: - case ISD::ATOMIC_LOAD_OR: - case ISD::ATOMIC_LOAD_XOR: - case ISD::ATOMIC_LOAD_NAND: - case ISD::ATOMIC_LOAD_MIN: - case ISD::ATOMIC_LOAD_MAX: - case ISD::ATOMIC_LOAD_UMIN: - case ISD::ATOMIC_LOAD_UMAX: - break; - default: - return SDValue(); - } - - SDValue fence = atomic.getOperand(0); - if (fence.getOpcode() != ISD::MEMBARRIER) - return SDValue(); - - switch (atomic.getOpcode()) { - case ISD::ATOMIC_CMP_SWAP: - return SDValue(DAG.UpdateNodeOperands(atomic.getNode(), - fence.getOperand(0), - atomic.getOperand(1), atomic.getOperand(2), - atomic.getOperand(3)), atomic.getResNo()); - case ISD::ATOMIC_SWAP: - case ISD::ATOMIC_LOAD_ADD: - case ISD::ATOMIC_LOAD_SUB: - case ISD::ATOMIC_LOAD_AND: - case ISD::ATOMIC_LOAD_OR: - case ISD::ATOMIC_LOAD_XOR: - case ISD::ATOMIC_LOAD_NAND: - case ISD::ATOMIC_LOAD_MIN: - case ISD::ATOMIC_LOAD_MAX: - case ISD::ATOMIC_LOAD_UMIN: - case ISD::ATOMIC_LOAD_UMAX: - return SDValue(DAG.UpdateNodeOperands(atomic.getNode(), - fence.getOperand(0), - atomic.getOperand(1), atomic.getOperand(2)), - atomic.getResNo()); - default: - return SDValue(); - } -} - static SDValue PerformZExtCombine(SDNode *N, SelectionDAG &DAG) { // (i32 zext (and (i8 x86isd::setcc_carry), 1)) -> // (and (i32 x86isd::setcc_carry), 1) @@ -9923,7 +9873,6 @@ case X86ISD::FAND: return PerformFANDCombine(N, DAG); case X86ISD::BT: return PerformBTCombine(N, DAG, DCI); case X86ISD::VZEXT_MOVL: return PerformVZEXT_MOVLCombine(N, DAG); - case ISD::MEMBARRIER: return PerformMEMBARRIERCombine(N, DAG); case ISD::ZERO_EXTEND: return PerformZExtCombine(N, DAG); } From daniel at zuster.org Wed Jun 23 12:09:26 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 23 Jun 2010 17:09:26 -0000 Subject: [llvm-commits] [llvm] r106634 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGISel.h include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/shift-folding.ll test/CodeGen/X86/store-narrow.ll Message-ID: <20100623170927.0F5F22A6C12C@llvm.org> Author: ddunbar Date: Wed Jun 23 12:09:26 2010 New Revision: 106634 URL: http://llvm.org/viewvc/llvm-project?rev=106634&view=rev Log: Revert r106263, "Fold the ShrinkDemandedOps pass into the regular DAGCombiner pass,"... it was causing both 'file' (with clang) and 176.gcc (with llvm-gcc) to be miscompiled. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/test/CodeGen/X86/shift-folding.ll llvm/trunk/test/CodeGen/X86/store-narrow.ll Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=106634&r1=106633&r2=106634&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Wed Jun 23 12:09:26 2010 @@ -292,6 +292,7 @@ MachineBasicBlock *CodeGenAndEmitDAG(MachineBasicBlock *BB); void LowerArguments(const BasicBlock *BB); + void ShrinkDemandedOps(); void ComputeLiveOutVRegInfo(); /// Create the scheduler. If a specific scheduler was specified Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=106634&r1=106633&r2=106634&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed Jun 23 12:09:26 2010 @@ -773,12 +773,14 @@ SelectionDAG &DAG; bool LegalTys; bool LegalOps; + bool ShrinkOps; SDValue Old; SDValue New; explicit TargetLoweringOpt(SelectionDAG &InDAG, - bool LT, bool LO) : - DAG(InDAG), LegalTys(LT), LegalOps(LO) {} + bool LT, bool LO, + bool Shrink = false) : + DAG(InDAG), LegalTys(LT), LegalOps(LO), ShrinkOps(Shrink) {} bool LegalTypes() const { return LegalTys; } bool LegalOperations() const { return LegalOps; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=106634&r1=106633&r2=106634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Jun 23 12:09:26 2010 @@ -2030,7 +2030,7 @@ // fold (OP (zext x), (zext y)) -> (zext (OP x, y)) // fold (OP (sext x), (sext y)) -> (sext (OP x, y)) // fold (OP (aext x), (aext y)) -> (aext (OP x, y)) - // fold (OP (trunc x), (trunc y)) -> (trunc (OP x, y)) (if trunc isn't free) + // fold (OP (trunc x), (trunc y)) -> (trunc (OP x, y)) // // do not sink logical op inside of a vector extend, since it may combine // into a vsetcc. @@ -2040,10 +2040,7 @@ // Avoid infinite looping with PromoteIntBinOp. (N0.getOpcode() == ISD::ANY_EXTEND && (!LegalTypes || TLI.isTypeDesirableForOp(N->getOpcode(), Op0VT))) || - (N0.getOpcode() == ISD::TRUNCATE && - (!TLI.isZExtFree(VT, Op0VT) || - !TLI.isTruncateFree(Op0VT, VT)) && - TLI.isTypeLegal(Op0VT))) && + (N0.getOpcode() == ISD::TRUNCATE && TLI.isTypeLegal(Op0VT))) && !VT.isVector() && Op0VT == N1.getOperand(0).getValueType() && (!LegalOperations || TLI.isOperationLegal(N->getOpcode(), Op0VT))) { @@ -2430,11 +2427,6 @@ if (SDNode *Rot = MatchRotate(N0, N1, N->getDebugLoc())) return SDValue(Rot, 0); - // Simplify the operands using demanded-bits information. - if (!VT.isVector() && - SimplifyDemandedBits(SDValue(N, 0))) - return SDValue(N, 0); - return SDValue(); } @@ -3168,11 +3160,6 @@ return NewSRL; } - // Attempt to convert a srl of a load into a narrower zero-extending load. - SDValue NarrowLoad = ReduceLoadWidth(N); - if (NarrowLoad.getNode()) - return NarrowLoad; - // Here is a common situation. We want to optimize: // // %a = ... @@ -3650,7 +3637,10 @@ // fold (zext (truncate x)) -> (and x, mask) if (N0.getOpcode() == ISD::TRUNCATE && - (!LegalOperations || TLI.isOperationLegal(ISD::AND, VT))) { + (!LegalOperations || TLI.isOperationLegal(ISD::AND, VT)) && + (!TLI.isTruncateFree(N0.getOperand(0).getValueType(), + N0.getValueType()) || + !TLI.isZExtFree(N0.getValueType(), VT))) { SDValue Op = N0.getOperand(0); if (Op.getValueType().bitsLT(VT)) { Op = DAG.getNode(ISD::ANY_EXTEND, N->getDebugLoc(), VT, Op); @@ -4036,7 +4026,6 @@ /// extended, also fold the extension to form a extending load. SDValue DAGCombiner::ReduceLoadWidth(SDNode *N) { unsigned Opc = N->getOpcode(); - ISD::LoadExtType ExtType = ISD::NON_EXTLOAD; SDValue N0 = N->getOperand(0); EVT VT = N->getValueType(0); @@ -4053,15 +4042,6 @@ ExtVT = cast(N->getOperand(1))->getVT(); if (LegalOperations && !TLI.isLoadExtLegal(ISD::SEXTLOAD, ExtVT)) return SDValue(); - } else if (Opc == ISD::SRL) { - // Annother special-case: SRL is basically zero-extending a narrower - // value. - ExtType = ISD::ZEXTLOAD; - N0 = SDValue(N, 0); - ConstantSDNode *N01 = dyn_cast(N0.getOperand(1)); - if (!N01) return SDValue(); - ExtVT = EVT::getIntegerVT(*DAG.getContext(), - VT.getSizeInBits() - N01->getZExtValue()); } unsigned EVTBits = ExtVT.getSizeInBits(); @@ -4265,17 +4245,8 @@ // fold (truncate (load x)) -> (smaller load x) // fold (truncate (srl (load x), c)) -> (smaller load (x+c/evtbits)) - if (!LegalTypes || TLI.isTypeDesirableForOp(N0.getOpcode(), VT)) { - SDValue Reduced = ReduceLoadWidth(N); - if (Reduced.getNode()) - return Reduced; - } - - // Simplify the operands using demanded-bits information. - if (!VT.isVector() && - SimplifyDemandedBits(SDValue(N, 0))) - return SDValue(N, 0); - + if (!LegalTypes || TLI.isTypeDesirableForOp(N0.getOpcode(), VT)) + return ReduceLoadWidth(N); return SDValue(); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=106634&r1=106633&r2=106634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Jun 23 12:09:26 2010 @@ -2470,18 +2470,10 @@ VT.getVectorNumElements() == Operand.getValueType().getVectorNumElements()) && "Vector element count mismatch!"); - if (OpOpcode == ISD::ZERO_EXTEND || OpOpcode == ISD::SIGN_EXTEND || OpOpcode == ISD::ANY_EXTEND) // (ext (zext x)) -> (zext x) and (ext (sext x)) -> (sext x) return getNode(OpOpcode, DL, VT, Operand.getNode()->getOperand(0)); - - // (ext (trunx x)) -> x - if (OpOpcode == ISD::TRUNCATE) { - SDValue OpOp = Operand.getNode()->getOperand(0); - if (OpOp.getValueType() == VT) - return OpOp; - } break; case ISD::TRUNCATE: assert(VT.isInteger() && Operand.getValueType().isInteger() && Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=106634&r1=106633&r2=106634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jun 23 12:09:26 2010 @@ -372,6 +372,102 @@ }; } +/// TrivialTruncElim - Eliminate some trivial nops that can result from +/// ShrinkDemandedOps: (trunc (ext n)) -> n. +static bool TrivialTruncElim(SDValue Op, + TargetLowering::TargetLoweringOpt &TLO) { + SDValue N0 = Op.getOperand(0); + EVT VT = Op.getValueType(); + if ((N0.getOpcode() == ISD::ZERO_EXTEND || + N0.getOpcode() == ISD::SIGN_EXTEND || + N0.getOpcode() == ISD::ANY_EXTEND) && + N0.getOperand(0).getValueType() == VT) { + return TLO.CombineTo(Op, N0.getOperand(0)); + } + return false; +} + +/// ShrinkDemandedOps - A late transformation pass that shrink expressions +/// using TargetLowering::TargetLoweringOpt::ShrinkDemandedOp. It converts +/// x+y to (VT)((SmallVT)x+(SmallVT)y) if the casts are free. +void SelectionDAGISel::ShrinkDemandedOps() { + SmallVector Worklist; + SmallPtrSet InWorklist; + + // Add all the dag nodes to the worklist. + Worklist.reserve(CurDAG->allnodes_size()); + for (SelectionDAG::allnodes_iterator I = CurDAG->allnodes_begin(), + E = CurDAG->allnodes_end(); I != E; ++I) { + Worklist.push_back(I); + InWorklist.insert(I); + } + + TargetLowering::TargetLoweringOpt TLO(*CurDAG, true, true, true); + while (!Worklist.empty()) { + SDNode *N = Worklist.pop_back_val(); + InWorklist.erase(N); + + if (N->use_empty() && N != CurDAG->getRoot().getNode()) { + // Deleting this node may make its operands dead, add them to the worklist + // if they aren't already there. + for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) + if (InWorklist.insert(N->getOperand(i).getNode())) + Worklist.push_back(N->getOperand(i).getNode()); + + CurDAG->DeleteNode(N); + continue; + } + + // Run ShrinkDemandedOp on scalar binary operations. + if (N->getNumValues() != 1 || + !N->getValueType(0).isSimple() || !N->getValueType(0).isInteger()) + continue; + + unsigned BitWidth = N->getValueType(0).getScalarType().getSizeInBits(); + APInt Demanded = APInt::getAllOnesValue(BitWidth); + APInt KnownZero, KnownOne; + if (!TLI.SimplifyDemandedBits(SDValue(N, 0), Demanded, + KnownZero, KnownOne, TLO) && + (N->getOpcode() != ISD::TRUNCATE || + !TrivialTruncElim(SDValue(N, 0), TLO))) + continue; + + // Revisit the node. + assert(!InWorklist.count(N) && "Already in worklist"); + Worklist.push_back(N); + InWorklist.insert(N); + + // Replace the old value with the new one. + DEBUG(errs() << "\nShrinkDemandedOps replacing "; + TLO.Old.getNode()->dump(CurDAG); + errs() << "\nWith: "; + TLO.New.getNode()->dump(CurDAG); + errs() << '\n'); + + if (InWorklist.insert(TLO.New.getNode())) + Worklist.push_back(TLO.New.getNode()); + + SDOPsWorkListRemover DeadNodes(Worklist, InWorklist); + CurDAG->ReplaceAllUsesOfValueWith(TLO.Old, TLO.New, &DeadNodes); + + if (!TLO.Old.getNode()->use_empty()) continue; + + for (unsigned i = 0, e = TLO.Old.getNode()->getNumOperands(); + i != e; ++i) { + SDNode *OpNode = TLO.Old.getNode()->getOperand(i).getNode(); + if (OpNode->hasOneUse()) { + // Add OpNode to the end of the list to revisit. + DeadNodes.RemoveFromWorklist(OpNode); + Worklist.push_back(OpNode); + InWorklist.insert(OpNode); + } + } + + DeadNodes.RemoveFromWorklist(TLO.Old.getNode()); + CurDAG->DeleteNode(TLO.Old.getNode()); + } +} + void SelectionDAGISel::ComputeLiveOutVRegInfo() { SmallPtrSet VisitedNodes; SmallVector Worklist; @@ -521,8 +617,10 @@ DEBUG(dbgs() << "Optimized legalized selection DAG:\n"; CurDAG->dump()); - if (OptLevel != CodeGenOpt::None) + if (OptLevel != CodeGenOpt::None) { + ShrinkDemandedOps(); ComputeLiveOutVRegInfo(); + } if (ViewISelDAGs) CurDAG->viewGraph("isel input for " + BlockName); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=106634&r1=106633&r2=106634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Wed Jun 23 12:09:26 2010 @@ -1075,7 +1075,7 @@ if (TLO.ShrinkDemandedConstant(Op, ~KnownZero2 & NewMask)) return true; // If the operation can be done in a smaller type, do so. - if (TLO.ShrinkDemandedOp(Op, BitWidth, NewMask, dl)) + if (TLO.ShrinkOps && TLO.ShrinkDemandedOp(Op, BitWidth, NewMask, dl)) return true; // Output known-1 bits are only known if set in both the LHS & RHS. @@ -1109,7 +1109,7 @@ if (TLO.ShrinkDemandedConstant(Op, NewMask)) return true; // If the operation can be done in a smaller type, do so. - if (TLO.ShrinkDemandedOp(Op, BitWidth, NewMask, dl)) + if (TLO.ShrinkOps && TLO.ShrinkDemandedOp(Op, BitWidth, NewMask, dl)) return true; // Output known-0 bits are only known if clear in both the LHS & RHS. @@ -1134,7 +1134,7 @@ if ((KnownZero2 & NewMask) == NewMask) return TLO.CombineTo(Op, Op.getOperand(1)); // If the operation can be done in a smaller type, do so. - if (TLO.ShrinkDemandedOp(Op, BitWidth, NewMask, dl)) + if (TLO.ShrinkOps && TLO.ShrinkDemandedOp(Op, BitWidth, NewMask, dl)) return true; // If all of the unknown bits are known to be zero on one side or the other @@ -1581,7 +1581,7 @@ KnownOne2, TLO, Depth+1)) return true; // See if the operation should be performed at a smaller bit width. - if (TLO.ShrinkDemandedOp(Op, BitWidth, NewMask, dl)) + if (TLO.ShrinkOps && TLO.ShrinkDemandedOp(Op, BitWidth, NewMask, dl)) return true; } // FALL THROUGH Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=106634&r1=106633&r2=106634&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jun 23 12:09:26 2010 @@ -9627,10 +9627,8 @@ if (ShAmt1.getOpcode() == ISD::SUB) { SDValue Sum = ShAmt1.getOperand(0); if (ConstantSDNode *SumC = dyn_cast(Sum)) { - SDValue ShAmt1Op1 = ShAmt1.getOperand(1); - if (ShAmt1Op1.getNode()->getOpcode() == ISD::TRUNCATE) - ShAmt1Op1 = ShAmt1Op1.getOperand(0); - if (SumC->getSExtValue() == Bits && ShAmt1Op1 == ShAmt0) + if (SumC->getSExtValue() == Bits && + ShAmt1.getOperand(1) == ShAmt0) return DAG.getNode(Opc, DL, VT, Op0, Op1, DAG.getNode(ISD::TRUNCATE, DL, Modified: llvm/trunk/test/CodeGen/X86/shift-folding.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/shift-folding.ll?rev=106634&r1=106633&r2=106634&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/shift-folding.ll (original) +++ llvm/trunk/test/CodeGen/X86/shift-folding.ll Wed Jun 23 12:09:26 2010 @@ -21,8 +21,3 @@ ret i32* %P2 } -define fastcc i32 @test4(i32* %d) nounwind { - %tmp4 = load i32* %d - %tmp512 = lshr i32 %tmp4, 24 - ret i32 %tmp512 -} Modified: llvm/trunk/test/CodeGen/X86/store-narrow.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/store-narrow.ll?rev=106634&r1=106633&r2=106634&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/store-narrow.ll (original) +++ llvm/trunk/test/CodeGen/X86/store-narrow.ll Wed Jun 23 12:09:26 2010 @@ -67,7 +67,7 @@ ; X64: movw %si, 2(%rdi) ; X32: test4: -; X32: movl 8(%esp), %eax +; X32: movzwl 8(%esp), %eax ; X32: movw %ax, 2(%{{.*}}) } From daniel at zuster.org Wed Jun 23 12:42:15 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 23 Jun 2010 17:42:15 -0000 Subject: [llvm-commits] [zorg] r106635 - in /zorg/trunk/zorg/buildbot/builders: ClangBuilder.py LLVMBuilder.py Message-ID: <20100623174215.0ADEA2A6C12D@llvm.org> Author: ddunbar Date: Wed Jun 23 12:42:14 2010 New Revision: 106635 URL: http://llvm.org/viewvc/llvm-project?rev=106635&view=rev Log: buildbot: Change test steps to honor jobs property when running 'lit'. Modified: zorg/trunk/zorg/buildbot/builders/ClangBuilder.py zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py Modified: zorg/trunk/zorg/buildbot/builders/ClangBuilder.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/ClangBuilder.py?rev=106635&r1=106634&r2=106635&view=diff ============================================================================== --- zorg/trunk/zorg/buildbot/builders/ClangBuilder.py (original) +++ zorg/trunk/zorg/buildbot/builders/ClangBuilder.py Wed Jun 23 12:42:14 2010 @@ -114,7 +114,7 @@ descriptionDone=["compile", stage1_config, "examples"], workdir=llvm_1_objdir)) - clangTestArgs = '-v' + clangTestArgs = llvmTestArgs = '-v -j %s' % jobs if valgrind: clangTestArgs += ' --vg' if valgrindLeakCheck: @@ -125,7 +125,8 @@ extraTestDirs += '%(builddir)s/llvm/tools/clang/utils/C++Tests' if test: f.addStep(ClangTestCommand(name='test-llvm', - command=[make, "check-lit", "VERBOSE=1"], + command=[make, "check-lit", "VERBOSE=1", + WithProperties("LIT_ARGS=%s" % llvmTestArgs)], description=["testing", "llvm"], descriptionDone=["test", "llvm"], workdir=llvm_1_objdir, @@ -188,7 +189,8 @@ if test: f.addStep(ClangTestCommand(name='test-llvm', - command=[make, "check-lit", "VERBOSE=1"], + command=[make, "check-lit", "VERBOSE=1", + WithProperties("LIT_ARGS=%s" % llvmTestArgs)], description=["testing", "llvm"], descriptionDone=["test", "llvm"], workdir=llvm_2_objdir, Modified: zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py?rev=106635&r1=106634&r2=106635&view=diff ============================================================================== --- zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py (original) +++ zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py Wed Jun 23 12:42:14 2010 @@ -71,7 +71,7 @@ workdir='llvm', timeout=timeout*60)) if test: - litTestArgs = '-v' + litTestArgs = '-v -j %s' % jobs if valgrind: litTestArgs += ' --vg ' if valgrindLeakCheck: From daniel at zuster.org Wed Jun 23 12:43:27 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 23 Jun 2010 17:43:27 -0000 Subject: [llvm-commits] [zorg] r106636 - /zorg/trunk/buildbot/osuosl/master/config/slaves.py Message-ID: <20100623174328.030332A6C12D@llvm.org> Author: ddunbar Date: Wed Jun 23 12:43:27 2010 New Revision: 106636 URL: http://llvm.org/viewvc/llvm-project?rev=106636&view=rev Log: buildbot: Scale back # jobs on osu[78]. Modified: zorg/trunk/buildbot/osuosl/master/config/slaves.py Modified: zorg/trunk/buildbot/osuosl/master/config/slaves.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/osuosl/master/config/slaves.py?rev=106636&r1=106635&r2=106636&view=diff ============================================================================== --- zorg/trunk/buildbot/osuosl/master/config/slaves.py (original) +++ zorg/trunk/buildbot/osuosl/master/config/slaves.py Wed Jun 23 12:43:27 2010 @@ -59,8 +59,8 @@ create_slave("baldrick17", properties={'jobs' : 8}, max_builds=1), # Debian x86_64, 2 x 6-core Opteron 2.6 GHz - create_slave("osu7", properties={'jobs' : 10}, max_builds=4), - create_slave("osu8", properties={'jobs' : 10}, max_builds=4), + create_slave("osu7", properties={'jobs' : 6}, max_builds=4), + create_slave("osu8", properties={'jobs' : 6}, max_builds=4), # Debian, P4 2.8GHz, 1GB mem create_slave("balint1", properties={'jobs' : 1}, max_builds=1), From daniel at zuster.org Wed Jun 23 12:48:29 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 23 Jun 2010 17:48:29 -0000 Subject: [llvm-commits] [zorg] r106637 - /zorg/trunk/buildbot/osuosl/master/config/builders.py Message-ID: <20100623174829.EE09A2A6C12D@llvm.org> Author: ddunbar Date: Wed Jun 23 12:48:29 2010 New Revision: 106637 URL: http://llvm.org/viewvc/llvm-project?rev=106637&view=rev Log: Take -vg builders offline for now, until osu[78] machines get fixed. Modified: zorg/trunk/buildbot/osuosl/master/config/builders.py Modified: zorg/trunk/buildbot/osuosl/master/config/builders.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/osuosl/master/config/builders.py?rev=106637&r1=106636&r2=106637&view=diff ============================================================================== --- zorg/trunk/buildbot/osuosl/master/config/builders.py (original) +++ zorg/trunk/buildbot/osuosl/master/config/builders.py Wed Jun 23 12:48:29 2010 @@ -41,18 +41,18 @@ 'builddir':"llvm-arm-linux", 'factory': LLVMBuilder.getLLVMBuildFactory("arm-pc-linux-gnu", jobs=1, clean=False, timeout=40)}, - {'name': "llvm-i686-linux-vg_leak", - 'slavenames':["osu8"], - 'builddir':"llvm-i686-linux-vg_leak", - 'factory': LLVMBuilder.getLLVMBuildFactory("i686-pc-linux-gnu", valgrind=True, - valgrindLeakCheck=True, - valgrindSuppressions='utils/valgrind/i386-pc-linux-gnu.supp')}, - {'name': "llvm-x86_64-linux-vg_leak", - 'slavenames':["osu7"], - 'builddir':"llvm-x86_64-linux-vg_leak", - 'factory': LLVMBuilder.getLLVMBuildFactory("x86_64-pc-linux-gnu", valgrind=True, - valgrindLeakCheck=True, - valgrindSuppressions='utils/valgrind/x86_64-pc-linux-gnu.supp')}, +# {'name': "llvm-i686-linux-vg_leak", +# 'slavenames':["osu8"], +# 'builddir':"llvm-i686-linux-vg_leak", +# 'factory': LLVMBuilder.getLLVMBuildFactory("i686-pc-linux-gnu", valgrind=True, +# valgrindLeakCheck=True, +# valgrindSuppressions='utils/valgrind/i386-pc-linux-gnu.supp')}, +# {'name': "llvm-x86_64-linux-vg_leak", +# 'slavenames':["osu7"], +# 'builddir':"llvm-x86_64-linux-vg_leak", +# 'factory': LLVMBuilder.getLLVMBuildFactory("x86_64-pc-linux-gnu", valgrind=True, +# valgrindLeakCheck=True, +# valgrindSuppressions='utils/valgrind/x86_64-pc-linux-gnu.supp')}, ] # Offline. @@ -163,10 +163,10 @@ 'builddir' :"clang-i686-xp-msvc9", 'factory' : ClangBuilder.getClangMSVCBuildFactory(jobs=2)}, - {'name': "clang-x86_64-linux-vg", - 'slavenames':["osu7"], - 'builddir':"clang-x86_64-linux-vg", - 'factory': ClangBuilder.getClangBuildFactory(valgrind=True)}, +# {'name': "clang-x86_64-linux-vg", +# 'slavenames':["osu7"], +# 'builddir':"clang-x86_64-linux-vg", +# 'factory': ClangBuilder.getClangBuildFactory(valgrind=True)}, {'name' : "clang-x86_64-darwin10-selfhost", 'slavenames' : ["dunbar-darwin10"], From daniel at zuster.org Wed Jun 23 13:03:11 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 23 Jun 2010 11:03:11 -0700 Subject: [llvm-commits] [llvm] r105528 - in /llvm/trunk: lib/Transforms/IPO/PartialSpecialization.cpp test/Transforms/PartialSpecialize/ test/Transforms/PartialSpecialize/dg.exp test/Transforms/PartialSpecialize/two-specializations.ll In-Reply-To: <20100605145021.2F52F312800A@llvm.org> References: <20100605145021.2F52F312800A@llvm.org> Message-ID: Hi Kenneth, This test is failing on llvm-arm-linux. It looks to me like the order of the partial specialization numbering isn't deterministic? Failure is here: http://google1.osuosl.org:8011/builders/llvm-arm-linux/builds/3516/steps/test-llvm/logs/two-specializations.ll Can you take a look? - Daniel On Sat, Jun 5, 2010 at 7:50 AM, Kenneth Uildriks wrote: > Author: kennethuil > Date: Sat Jun ?5 09:50:21 2010 > New Revision: 105528 > > URL: http://llvm.org/viewvc/llvm-project?rev=105528&view=rev > Log: > Partial specialization was not checking the callsite to make sure it was using the same constants as the specialization, leading to calls to the wrong specialization. ?Patch by Takumi Nakamura\! > > Added: > ? ?llvm/trunk/test/Transforms/PartialSpecialize/ > ? ?llvm/trunk/test/Transforms/PartialSpecialize/dg.exp > ? ?llvm/trunk/test/Transforms/PartialSpecialize/two-specializations.ll > Modified: > ? ?llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp > > Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp?rev=105528&r1=105527&r2=105528&view=diff > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Sat Jun ?5 09:50:21 2010 > @@ -32,6 +32,10 @@ > ?using namespace llvm; > > ?STATISTIC(numSpecialized, "Number of specialized functions created"); > +STATISTIC(numReplaced, "Number of callers replaced by specialization"); > + > +// Maximum number of arguments markable interested > +static const int MaxInterests = 6; > > ?// Call must be used at least occasionally > ?static const int CallsMin = 5; > @@ -40,8 +44,9 @@ > ?static const double ConstValPercent = .1; > > ?namespace { > + ?typedef SmallVector InterestingArgVector; > ? class PartSpec : public ModulePass { > - ? ?void scanForInterest(Function&, SmallVector&); > + ? ?void scanForInterest(Function&, InterestingArgVector&); > ? ? int scanDistribution(Function&, int, std::map&); > ? public : > ? ? static char ID; // Pass identification, replacement for typeid > @@ -61,11 +66,13 @@ > ?SpecializeFunction(Function* F, > ? ? ? ? ? ? ? ? ? ?DenseMap& replacements) { > ? // arg numbers of deleted arguments > - ?DenseSet deleted; > + ?DenseMap deleted; > ? for (DenseMap::iterator > ? ? ? ? ?repb = replacements.begin(), repe = replacements.end(); > - ? ? ? repb != repe; ++repb) > - ? ?deleted.insert(cast(repb->first)->getArgNo()); > + ? ? ? repb != repe; ++repb) { > + ? ?Argument const *arg = cast(repb->first); > + ? ?deleted[arg->getArgNo()] = arg; > + ?} > > ? Function* NF = CloneFunction(F, replacements); > ? NF->setLinkage(GlobalValue::InternalLinkage); > @@ -80,9 +87,23 @@ > ? ? ? if (CS.getCalledFunction() == F) { > > ? ? ? ? SmallVector args; > - ? ? ? ?for (unsigned x = 0; x < CS.arg_size(); ++x) > - ? ? ? ? ?if (!deleted.count(x)) > - ? ? ? ? ? ?args.push_back(CS.getArgument(x)); > + ? ? ? ?// Assemble the non-specialized arguments for the updated callsite. > + ? ? ? ?// In the process, make sure that the specialized arguments are > + ? ? ? ?// constant and match the specialization. ?If that's not the case, > + ? ? ? ?// this callsite needs to call the original or some other > + ? ? ? ?// specialization; don't change it here. > + ? ? ? ?CallSite::arg_iterator as = CS.arg_begin(), ae = CS.arg_end(); > + ? ? ? ?for (CallSite::arg_iterator ai = as; ai != ae; ++ai) { > + ? ? ? ? ?DenseMap::iterator delit = deleted.find( > + ? ? ? ? ? ?std::distance(as, ai)); > + ? ? ? ? ?if (delit == deleted.end()) > + ? ? ? ? ? ?args.push_back(cast(ai)); > + ? ? ? ? ?else { > + ? ? ? ? ? ?Constant *ci = dyn_cast(ai); > + ? ? ? ? ? ?if (!(ci && ci == replacements[delit->second])) > + ? ? ? ? ? ? ?goto next_use; > + ? ? ? ? ?} > + ? ? ? ?} > ? ? ? ? Value* NCall; > ? ? ? ? if (CallInst *CI = dyn_cast(i)) { > ? ? ? ? ? NCall = CallInst::Create(NF, args.begin(), args.end(), > @@ -99,8 +120,11 @@ > ? ? ? ? } > ? ? ? ? CS.getInstruction()->replaceAllUsesWith(NCall); > ? ? ? ? CS.getInstruction()->eraseFromParent(); > + ? ? ? ?++numReplaced; > ? ? ? } > ? ? } > + ?next_use: > + ? ?; > ? } > ? return NF; > ?} > @@ -111,7 +135,7 @@ > ? for (Module::iterator I = M.begin(); I != M.end(); ++I) { > ? ? Function &F = *I; > ? ? if (F.isDeclaration() || F.mayBeOverridden()) continue; > - ? ?SmallVector interestingArgs; > + ? ?InterestingArgVector interestingArgs; > ? ? scanForInterest(F, interestingArgs); > > ? ? // Find the first interesting Argument that we can specialize on > @@ -143,7 +167,7 @@ > > ?/// scanForInterest - This function decides which arguments would be worth > ?/// specializing on. > -void PartSpec::scanForInterest(Function& F, SmallVector& args) { > +void PartSpec::scanForInterest(Function& F, InterestingArgVector& args) { > ? for(Function::arg_iterator ii = F.arg_begin(), ee = F.arg_end(); > ? ? ? ii != ee; ++ii) { > ? ? for(Value::use_iterator ui = ii->use_begin(), ue = ii->use_end(); > > Added: llvm/trunk/test/Transforms/PartialSpecialize/dg.exp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PartialSpecialize/dg.exp?rev=105528&view=auto > ============================================================================== > --- llvm/trunk/test/Transforms/PartialSpecialize/dg.exp (added) > +++ llvm/trunk/test/Transforms/PartialSpecialize/dg.exp Sat Jun ?5 09:50:21 2010 > @@ -0,0 +1,3 @@ > +load_lib llvm.exp > + > +RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] > > Added: llvm/trunk/test/Transforms/PartialSpecialize/two-specializations.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PartialSpecialize/two-specializations.ll?rev=105528&view=auto > ============================================================================== > --- llvm/trunk/test/Transforms/PartialSpecialize/two-specializations.ll (added) > +++ llvm/trunk/test/Transforms/PartialSpecialize/two-specializations.ll Sat Jun ?5 09:50:21 2010 > @@ -0,0 +1,32 @@ > +; If there are two specializations of a function, make sure each callsite > +; calls the right one. > +; > +; RUN: opt -S -partialspecialization %s | FileCheck %s > +declare void @callback1() > +declare void @callback2() > + > +define internal void @UseCallback(void()* %pCallback) { > + ?call void %pCallback() > + ?ret void > +} > + > +define void @foo(void()* %pNonConstCallback) > +{ > +Entry: > +; CHECK: Entry > +; CHECK-NEXT: call void @UseCallback1() > +; CHECK-NEXT: call void @UseCallback1() > +; CHECK-NEXT: call void @UseCallback2() > +; CHECK-NEXT: call void @UseCallback(void ()* %pNonConstCallback) > +; CHECK-NEXT: call void @UseCallback1() > +; CHECK-NEXT: call void @UseCallback2() > +; CHECK-NEXT: call void @UseCallback2() > + ?call void @UseCallback(void()* @callback1) > + ?call void @UseCallback(void()* @callback1) > + ?call void @UseCallback(void()* @callback2) > + ?call void @UseCallback(void()* %pNonConstCallback) > + ?call void @UseCallback(void()* @callback1) > + ?call void @UseCallback(void()* @callback2) > + ?call void @UseCallback(void()* @callback2) > + ?ret void > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From daniel at zuster.org Wed Jun 23 13:06:16 2010 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 23 Jun 2010 18:06:16 -0000 Subject: [llvm-commits] [llvm] r106638 - /llvm/trunk/test/lit.cfg Message-ID: <20100623180616.CBBDA2A6C12C@llvm.org> Author: ddunbar Date: Wed Jun 23 13:06:16 2010 New Revision: 106638 URL: http://llvm.org/viewvc/llvm-project?rev=106638&view=rev Log: tests: Tweak lit.cfg to fix breakage with out-of-dir lookup. Modified: llvm/trunk/test/lit.cfg Modified: llvm/trunk/test/lit.cfg URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg?rev=106638&r1=106637&r2=106638&view=diff ============================================================================== --- llvm/trunk/test/lit.cfg (original) +++ llvm/trunk/test/lit.cfg Wed Jun 23 13:06:16 2010 @@ -49,7 +49,7 @@ config.environment['HOME'] = os.environ['HOME'] # Propogate LLVM_SRC_ROOT into the environment. -config.environment['LLVM_SRC_ROOT'] = config.llvm_src_root +config.environment['LLVM_SRC_ROOT'] = getattr(config, 'llvm_src_root', '') # Propogate PYTHON_EXEUTABLE into the environment config.environment['PYTHON_EXECUTABLE'] = getattr(config, 'python_executable', From simmon12 at illinois.edu Wed Jun 23 13:15:58 2010 From: simmon12 at illinois.edu (Patrick Simmons) Date: Wed, 23 Jun 2010 18:15:58 -0000 Subject: [llvm-commits] [poolalloc] r106642 - in /poolalloc/trunk/lib/DSA: DSGraph.cpp Local.cpp Message-ID: <20100623181558.53F322A6C12C@llvm.org> Author: psimmons Date: Wed Jun 23 13:15:58 2010 New Revision: 106642 URL: http://llvm.org/viewvc/llvm-project?rev=106642&view=rev Log: fix signedness warnings (errors due to -Werror) Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp poolalloc/trunk/lib/DSA/Local.cpp Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=106642&r1=106641&r2=106642&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DSGraph.cpp (original) +++ poolalloc/trunk/lib/DSA/DSGraph.cpp Wed Jun 23 13:15:58 2010 @@ -524,7 +524,7 @@ //are var-arg and which are fixed. Apparently we can't assume this, but I'm not sure //of a better way. For now, this assumption is known limitation. const FunctionType *CalleeFuncType = DSCallSite::FunctionTypeOfCallSite(CS); - unsigned NumFixedArgs = CalleeFuncType->getNumParams(); + int NumFixedArgs = CalleeFuncType->getNumParams(); std::vector Args; Args.reserve(CS.arg_end()-CS.arg_begin()); Modified: poolalloc/trunk/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=106642&r1=106641&r2=106642&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Local.cpp (original) +++ poolalloc/trunk/lib/DSA/Local.cpp Wed Jun 23 13:15:58 2010 @@ -887,11 +887,11 @@ //Get the FunctionType for the called function const FunctionType *CalleeFuncType = DSCallSite::FunctionTypeOfCallSite(CS); - unsigned NumFixedArgs = CalleeFuncType->getNumParams(); + int NumFixedArgs = CalleeFuncType->getNumParams(); // Sanity check--this really, really shouldn't happen if (!CalleeFuncType->isVarArg()) - assert(CS.arg_size() == NumFixedArgs && + assert(CS.arg_size() == static_cast(NumFixedArgs) && "Too many arguments/incorrect function signature!"); std::vector Args; From isanbard at gmail.com Wed Jun 23 13:16:24 2010 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 23 Jun 2010 18:16:24 -0000 Subject: [llvm-commits] [llvm] r106643 - in /llvm/trunk: lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp test/CodeGen/X86/2010-02-19-TailCallRetAddrBug.ll Message-ID: <20100623181624.337992A6C12C@llvm.org> Author: void Date: Wed Jun 23 13:16:24 2010 New Revision: 106643 URL: http://llvm.org/viewvc/llvm-project?rev=106643&view=rev Log: MorphNodeTo doesn't preserve the memory operands. Because we're morphing a node into the same node, but with different non-memory operands, we need to replace the memory operands after it's finished morphing. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp llvm/trunk/test/CodeGen/X86/2010-02-19-TailCallRetAddrBug.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp?rev=106643&r1=106642&r2=106643&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Wed Jun 23 13:16:24 2010 @@ -110,17 +110,35 @@ static void AddFlags(SDNode *N, SDValue Flag, bool AddFlag, SelectionDAG *DAG) { SmallVector VTs; + for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) VTs.push_back(N->getValueType(i)); + if (AddFlag) VTs.push_back(MVT::Flag); + SmallVector Ops; for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) Ops.push_back(N->getOperand(i)); + if (Flag.getNode()) Ops.push_back(Flag); + SDVTList VTList = DAG->getVTList(&VTs[0], VTs.size()); + MachineSDNode::mmo_iterator Begin = 0, End = 0; + MachineSDNode *MN = dyn_cast(N); + + // Store memory references. + if (MN) { + Begin = MN->memoperands_begin(); + End = MN->memoperands_end(); + } + DAG->MorphNodeTo(N, N->getOpcode(), VTList, &Ops[0], Ops.size()); + + // Reset the memory references + if (MN) + MN->setMemRefs(Begin, End); } /// ClusterNeighboringLoads - Force nearby loads together by "flagging" them. @@ -196,13 +214,16 @@ // ensure they are scheduled in order of increasing addresses. SDNode *Lead = Loads[0]; AddFlags(Lead, SDValue(0,0), true, DAG); + SDValue InFlag = SDValue(Lead, Lead->getNumValues()-1); for (unsigned i = 1, e = Loads.size(); i != e; ++i) { bool OutFlag = i < e-1; SDNode *Load = Loads[i]; AddFlags(Load, InFlag, OutFlag, DAG); + if (OutFlag) InFlag = SDValue(Load, Load->getNumValues()-1); + ++LoadsClustered; } } Modified: llvm/trunk/test/CodeGen/X86/2010-02-19-TailCallRetAddrBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-02-19-TailCallRetAddrBug.ll?rev=106643&r1=106642&r2=106643&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2010-02-19-TailCallRetAddrBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2010-02-19-TailCallRetAddrBug.ll Wed Jun 23 13:16:24 2010 @@ -9,11 +9,11 @@ ; lowering of arguments potentially overwrites the value. ; ; Move return address (76(%esp)) to a temporary register (%ebp) -; CHECK: movl 76(%esp), %ebp +; CHECK: movl 76(%esp), [[REGISTER:%[a-z]+]] ; Overwrite return addresss -; CHECK: movl %ecx, 76(%esp) +; CHECK: movl %ebx, 76(%esp) ; Move return address from temporary register (%ebp) to new stack location (60(%esp)) -; CHECK: movl %ebp, 60(%esp) +; CHECK: movl [[REGISTER]], 60(%esp) %tupl_p = type [9 x i32]* From criswell at uiuc.edu Wed Jun 23 13:16:45 2010 From: criswell at uiuc.edu (John Criswell) Date: Wed, 23 Jun 2010 18:16:45 -0000 Subject: [llvm-commits] [poolalloc] r106644 - /poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp Message-ID: <20100623181645.A52A62A6C12C@llvm.org> Author: criswell Date: Wed Jun 23 13:16:45 2010 New Revision: 106644 URL: http://llvm.org/viewvc/llvm-project?rev=106644&view=rev Log: First pass at fixing code that selects the desired size of objects within a pool. Added comments. Modified: poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp Modified: poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp?rev=106644&r1=106643&r2=106644&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp Wed Jun 23 13:16:45 2010 @@ -9,6 +9,11 @@ // // This implements the various pool allocation heuristics. // +// FIXME: It seems that the old alignment heuristics contained in this file +// were designed for 32-bit x86 processors (which makes sense as +// poolalloc was developed before x86-64). We need to revisit this +// code and decide what the heuristics should do today. +// //===----------------------------------------------------------------------===// #include "Heuristic.h" @@ -55,17 +60,60 @@ Heuristic::~Heuristic() {} +// +// Function: getRecommendedSize() +// +// Description: +// Determine the recommended allocation size for objects represented by this +// DSNode. This is used to determine the size of objects allocated by +// poolalloc(). +// +// Inputs: +// N - The DSNode representing the objects whose recommended size the caller +// wants. +// +// Return value: +// The size, in bytes, that should be used in allocating most objects +// represented by this DSNode. +// unsigned Heuristic::getRecommendedSize(const DSNode *N) { unsigned PoolSize = 0; - //FIXME: types -// if (!N->isArray() && N->getType()->isSized()) { -// PoolSize = N->getParentGraph()->getTargetData().getTypeAllocSize(N->getType()); -// } + + // + // If the DSNode only represents singleton objects (i.e., not arrays), then + // find the size of the singleton object. + // + if (!N->isArrayNode()) { + PoolSize = N->getSize(); + } + + // + // If the object size is 1, just say that it's zero. The run-time will + // figure out how to deal with it. + // if (PoolSize == 1) PoolSize = 0; return PoolSize; } -/// Wants8ByteAlignment - FIXME: this is a complete hack for X86 right now. +// +// Function: Wants8ByteAlignment () +// +// Description: +// Determine if an object of the specified type should be allocated on an +// 8-byte boundary. This may either be required by the target platform or may +// merely improved performance by aligning data the way the processor wants +// it. +// +// Return value: +// true - This type should be allocated on an 8-byte boundary. +// false - This type does not need to be allocated on an 8-byte boundary. +// +// Notes: +// FIXME: This is a complete hack for X86 right now. +// FIXME: This code needs to be updated for x86-64. +// FIXME: This code needs to handle LLVM first-class structures and vectors. +// FIXME: What does Offs do? +// static bool Wants8ByteAlignment(const Type *Ty, unsigned Offs, const TargetData &TD) { if (DisableAlignOpt) return true; From dalej at apple.com Wed Jun 23 13:52:34 2010 From: dalej at apple.com (Dale Johannesen) Date: Wed, 23 Jun 2010 18:52:34 -0000 Subject: [llvm-commits] [llvm] r106662 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <20100623185235.0C8E62A6C12C@llvm.org> Author: johannes Date: Wed Jun 23 13:52:34 2010 New Revision: 106662 URL: http://llvm.org/viewvc/llvm-project?rev=106662&view=rev Log: Do not do tail calls to external symbols. If the branch turns out to be ARM-to-Thumb or vice versa the linker cannot resolve this. 8120438. If this optimization is going to be useful we probably need a compiler flag "assume callees are same architecture" or something like that. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=106662&r1=106661&r2=106662&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Jun 23 13:52:34 2010 @@ -1408,29 +1408,26 @@ if (isCalleeStructRet || isCallerStructRet) return false; - // FIXME: Completely disable sibcal for Thumb1 since Thumb1RegisterInfo:: + // FIXME: Completely disable sibcall for Thumb1 since Thumb1RegisterInfo:: // emitEpilogue is not ready for them. if (Subtarget->isThumb1Only()) return false; + // For the moment, we can only do this to functions defined in this + // compilation, or to indirect calls. A Thumb B to an ARM function, + // or vice versa, is not easily fixed up in the linker unlike BL. + // (We could do this by loading the address of the callee into a register; + // that is an extra instruction over the direct call and burns a register + // as well, so is not likely to be a win.) if (isa(Callee)) return false; if (GlobalAddressSDNode *G = dyn_cast(Callee)) { - if (Subtarget->isThumb1Only()) + const GlobalValue *GV = G->getGlobal(); + if (GV->isDeclaration() || GV->isWeakForLinker()) return false; - - // On Thumb, for the moment, we can only do this to functions defined in this - // compilation, or to indirect calls. A Thumb B to an ARM function is not - // easily fixed up in the linker, unlike BL. - if (Subtarget->isThumb()) { - const GlobalValue *GV = G->getGlobal(); - if (GV->isDeclaration() || GV->isWeakForLinker()) - return false; - } } - // If the calling conventions do not match, then we'd better make sure the // results are returned in the same way as what the caller expects. if (!CCMatch) { From dalej at apple.com Wed Jun 23 13:53:12 2010 From: dalej at apple.com (Dale Johannesen) Date: Wed, 23 Jun 2010 18:53:12 -0000 Subject: [llvm-commits] [llvm] r106663 - in /llvm/trunk/test/CodeGen/ARM: ifcvt6.ll insn-sched1-tc.ll ldm-tc.ll Message-ID: <20100623185312.CF4032A6C12C@llvm.org> Author: johannes Date: Wed Jun 23 13:53:12 2010 New Revision: 106663 URL: http://llvm.org/viewvc/llvm-project?rev=106663&view=rev Log: Remove tests invalidated by previous checkin. Removed: llvm/trunk/test/CodeGen/ARM/ifcvt6.ll llvm/trunk/test/CodeGen/ARM/insn-sched1-tc.ll llvm/trunk/test/CodeGen/ARM/ldm-tc.ll Removed: llvm/trunk/test/CodeGen/ARM/ifcvt6.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ifcvt6.ll?rev=106662&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/ifcvt6.ll (original) +++ llvm/trunk/test/CodeGen/ARM/ifcvt6.ll (removed) @@ -1,21 +0,0 @@ -; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \ -; RUN: grep cmpne | count 1 -; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \ -; RUN: grep ldmiahi | count 1 - -define void @foo(i32 %X, i32 %Y) { -entry: - %tmp1 = icmp ult i32 %X, 4 ; [#uses=1] - %tmp4 = icmp eq i32 %Y, 0 ; [#uses=1] - %tmp7 = or i1 %tmp4, %tmp1 ; [#uses=1] - br i1 %tmp7, label %cond_true, label %UnifiedReturnBlock - -cond_true: ; preds = %entry - %tmp10 = call i32 (...)* @bar( ) ; [#uses=0] - ret void - -UnifiedReturnBlock: ; preds = %entry - ret void -} - -declare i32 @bar(...) Removed: llvm/trunk/test/CodeGen/ARM/insn-sched1-tc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/insn-sched1-tc.ll?rev=106662&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/insn-sched1-tc.ll (original) +++ llvm/trunk/test/CodeGen/ARM/insn-sched1-tc.ll (removed) @@ -1,11 +0,0 @@ -; RUN: llc < %s -march=arm -mattr=+v6 -; RUN: llc < %s -mtriple=arm-apple-darwin -mattr=+v6 |\ -; RUN: grep mov | count 2 - -define i32 @test(i32 %x) { - %tmp = trunc i32 %x to i16 ; [#uses=1] - %tmp2 = tail call i32 @f( i32 1, i16 %tmp ) ; [#uses=1] - ret i32 %tmp2 -} - -declare i32 @f(i32, i16) Removed: llvm/trunk/test/CodeGen/ARM/ldm-tc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ldm-tc.ll?rev=106662&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/ldm-tc.ll (original) +++ llvm/trunk/test/CodeGen/ARM/ldm-tc.ll (removed) @@ -1,37 +0,0 @@ -; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s - - at X = external global [0 x i32] ; <[0 x i32]*> [#uses=5] - -define i32 @t1() { -; CHECK: t1: -; CHECK: ldmia - %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 0) ; [#uses=1] - %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; [#uses=1] - %tmp4 = tail call i32 @f1( i32 %tmp, i32 %tmp3 ) ; [#uses=1] - ret i32 %tmp4 -} - -define i32 @t2() { -; CHECK: t2: -; CHECK: ldmia - %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; [#uses=1] - %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; [#uses=1] - %tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 4) ; [#uses=1] - %tmp6 = tail call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; [#uses=1] - ret i32 %tmp6 -} - -define i32 @t3() { -; CHECK: t3: -; CHECK: ldmib -; CHECK: b.w _f2 @ TAILCALL - %tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; [#uses=1] - %tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; [#uses=1] - %tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; [#uses=1] - %tmp6 = tail call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; [#uses=1] - ret i32 %tmp6 -} - -declare i32 @f1(i32, i32) - -declare i32 @f2(i32, i32, i32) From dalej at apple.com Wed Jun 23 13:56:06 2010 From: dalej at apple.com (Dale Johannesen) Date: Wed, 23 Jun 2010 18:56:06 -0000 Subject: [llvm-commits] [llvm] r106664 - in /llvm/trunk/test/CodeGen/ARM: ifcvt6-tc.ll ifcvt6.ll Message-ID: <20100623185606.CB7112A6C12C@llvm.org> Author: johannes Date: Wed Jun 23 13:56:06 2010 New Revision: 106664 URL: http://llvm.org/viewvc/llvm-project?rev=106664&view=rev Log: Reinstate correct test, remove the real invalidated test. Added: llvm/trunk/test/CodeGen/ARM/ifcvt6.ll Removed: llvm/trunk/test/CodeGen/ARM/ifcvt6-tc.ll Removed: llvm/trunk/test/CodeGen/ARM/ifcvt6-tc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ifcvt6-tc.ll?rev=106663&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/ifcvt6-tc.ll (original) +++ llvm/trunk/test/CodeGen/ARM/ifcvt6-tc.ll (removed) @@ -1,23 +0,0 @@ -; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \ -; RUN: grep cmpne | count 1 -; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \ -; RUN: grep bls | count 1 -; Here, tail call wins over eliminating branches. It is 1 fewer instruction -; and removes all stack accesses, so seems like a win. - -define void @foo(i32 %X, i32 %Y) { -entry: - %tmp1 = icmp ult i32 %X, 4 ; [#uses=1] - %tmp4 = icmp eq i32 %Y, 0 ; [#uses=1] - %tmp7 = or i1 %tmp4, %tmp1 ; [#uses=1] - br i1 %tmp7, label %cond_true, label %UnifiedReturnBlock - -cond_true: ; preds = %entry - %tmp10 = tail call i32 (...)* @bar( ) ; [#uses=0] - ret void - -UnifiedReturnBlock: ; preds = %entry - ret void -} - -declare i32 @bar(...) Added: llvm/trunk/test/CodeGen/ARM/ifcvt6.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ifcvt6.ll?rev=106664&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/ifcvt6.ll (added) +++ llvm/trunk/test/CodeGen/ARM/ifcvt6.ll Wed Jun 23 13:56:06 2010 @@ -0,0 +1,21 @@ +; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \ +; RUN: grep cmpne | count 1 +; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \ +; RUN: grep ldmiahi | count 1 + +define void @foo(i32 %X, i32 %Y) { +entry: + %tmp1 = icmp ult i32 %X, 4 ; [#uses=1] + %tmp4 = icmp eq i32 %Y, 0 ; [#uses=1] + %tmp7 = or i1 %tmp4, %tmp1 ; [#uses=1] + br i1 %tmp7, label %cond_true, label %UnifiedReturnBlock + +cond_true: ; preds = %entry + %tmp10 = call i32 (...)* @bar( ) ; [#uses=0] + ret void + +UnifiedReturnBlock: ; preds = %entry + ret void +} + +declare i32 @bar(...) From bruno.cardoso at gmail.com Wed Jun 23 14:50:39 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 23 Jun 2010 19:50:39 -0000 Subject: [llvm-commits] [llvm] r106670 - in /llvm/trunk: test/TableGen/usevalname.td utils/TableGen/Record.cpp Message-ID: <20100623195039.4C9DD2A6C12C@llvm.org> Author: bruno Date: Wed Jun 23 14:50:39 2010 New Revision: 106670 URL: http://llvm.org/viewvc/llvm-project?rev=106670&view=rev Log: Fix a tblgen bug. Given the pattern below as an example: list Pattern = [(set RC:$dst, (v4f32 (shufp:src3 RC:$src1, (mem_frag addr:$src2))))]; The right reference resolving should lead to: list Pattern = [(set VR128:$dst, (v4f32 (shufp:src3 VR128:$src1, (mem_frag addr:$src2))))]; But was yielding: list Pattern = [(set VR128:$dst, (v4f32 (shufp VR128:$src1, (mem_frag addr:$src2))))]; Fix this by passing the right name when creating a new DagInit node. Added: llvm/trunk/test/TableGen/usevalname.td Modified: llvm/trunk/utils/TableGen/Record.cpp Added: llvm/trunk/test/TableGen/usevalname.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/TableGen/usevalname.td?rev=106670&view=auto ============================================================================== --- llvm/trunk/test/TableGen/usevalname.td (added) +++ llvm/trunk/test/TableGen/usevalname.td Wed Jun 23 14:50:39 2010 @@ -0,0 +1,24 @@ +// RUN: tblgen %s | FileCheck %s +// XFAIL: vg_leak + +class Instr pat> { + list Pattern = pat; +} + +class Reg { + int a = 3; +} + +def VR128 : Reg; +def mem_frag; +def set; +def addr; +def shufp : Reg; + +multiclass shuffle { + def rri : Instr<[(set RC:$dst, (shufp:$src3 + RC:$src1, RC:$src2))]>; +} + +// CHECK: shufp:src3 +defm ADD : shuffle; Modified: llvm/trunk/utils/TableGen/Record.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/Record.cpp?rev=106670&r1=106669&r2=106670&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/Record.cpp (original) +++ llvm/trunk/utils/TableGen/Record.cpp Wed Jun 23 14:50:39 2010 @@ -1262,7 +1262,7 @@ Init *Op = Val->resolveReferences(R, RV); if (Args != NewArgs || Op != Val) - return new DagInit(Op, "", NewArgs, ArgNames); + return new DagInit(Op, ValName, NewArgs, ArgNames); return this; } From bruno.cardoso at gmail.com Wed Jun 23 15:07:15 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 23 Jun 2010 20:07:15 -0000 Subject: [llvm-commits] [llvm] r106672 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100623200715.AE0492A6C12C@llvm.org> Author: bruno Date: Wed Jun 23 15:07:15 2010 New Revision: 106672 URL: http://llvm.org/viewvc/llvm-project?rev=106672&view=rev Log: Add AVX SHUF{PS,PD}{rr,rm} instructions Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106672&r1=106671&r2=106672&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Wed Jun 23 15:07:15 2010 @@ -1394,33 +1394,37 @@ (CMPPDrmi VR128:$src1, addr:$src2, imm:$cc)>; // Shuffle and unpack instructions +multiclass sse12_shuffle { + def rmi : PIi8<0xC6, MRMSrcMem, (outs VR128:$dst), + (ins VR128:$src1, f128mem:$src2, i8imm:$src3), asm, + [(set VR128:$dst, (vt (shufp:$src3 + VR128:$src1, (mem_frag addr:$src2))))], d>; + let isConvertibleToThreeAddress = IsConvertibleToThreeAddress in + def rri : PIi8<0xC6, MRMSrcReg, (outs VR128:$dst), + (ins VR128:$src1, VR128:$src2, i8imm:$src3), asm, + [(set VR128:$dst, + (vt (shufp:$src3 VR128:$src1, VR128:$src2)))], d>; +} + let Constraints = "$src1 = $dst" in { - let isConvertibleToThreeAddress = 1 in // Convert to pshufd - def SHUFPSrri : PSIi8<0xC6, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, - VR128:$src2, i8imm:$src3), - "shufps\t{$src3, $src2, $dst|$dst, $src2, $src3}", - [(set VR128:$dst, - (v4f32 (shufp:$src3 VR128:$src1, VR128:$src2)))]>; - def SHUFPSrmi : PSIi8<0xC6, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, - f128mem:$src2, i8imm:$src3), - "shufps\t{$src3, $src2, $dst|$dst, $src2, $src3}", - [(set VR128:$dst, - (v4f32 (shufp:$src3 - VR128:$src1, (memopv4f32 addr:$src2))))]>; - def SHUFPDrri : PDIi8<0xC6, MRMSrcReg, - (outs VR128:$dst), (ins VR128:$src1, VR128:$src2, i8imm:$src3), - "shufpd\t{$src3, $src2, $dst|$dst, $src2, $src3}", - [(set VR128:$dst, - (v2f64 (shufp:$src3 VR128:$src1, VR128:$src2)))]>; - def SHUFPDrmi : PDIi8<0xC6, MRMSrcMem, - (outs VR128:$dst), (ins VR128:$src1, - f128mem:$src2, i8imm:$src3), - "shufpd\t{$src3, $src2, $dst|$dst, $src2, $src3}", - [(set VR128:$dst, - (v2f64 (shufp:$src3 - VR128:$src1, (memopv2f64 addr:$src2))))]>; + defm SHUFPS : sse12_shuffle, + TB; + defm SHUFPD : sse12_shuffle, TB, OpSize; + + let Constraints = "", isAsmParserOnly = 1 in { + defm VSHUFPS : sse12_shuffle, VEX_4V; + defm VSHUFPD : sse12_shuffle, OpSize, VEX_4V; + } let AddedComplexity = 10 in { let Constraints = "", isAsmParserOnly = 1 in { Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=106672&r1=106671&r2=106672&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Wed Jun 23 15:07:15 2010 @@ -10374,3 +10374,19 @@ // CHECK: encoding: [0xc5,0xc9,0xc2,0xc8,0x07] vcmppd $7, %xmm0, %xmm6, %xmm1 +// CHECK: vshufps $8, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc6,0xd9,0x08] + vshufps $8, %xmm1, %xmm2, %xmm3 + +// CHECK: vshufps $8, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc6,0x5c,0xcb,0xfc,0x08] + vshufps $8, -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vshufpd $8, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc6,0xd9,0x08] + vshufpd $8, %xmm1, %xmm2, %xmm3 + +// CHECK: vshufpd $8, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc6,0x5c,0xcb,0xfc,0x08] + vshufpd $8, -4(%ebx,%ecx,8), %xmm2, %xmm3 + Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=106672&r1=106671&r2=106672&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Wed Jun 23 15:07:15 2010 @@ -438,3 +438,19 @@ // CHECK: encoding: [0xc4,0x41,0x19,0xc2,0xfa,0x07] vcmppd $7, %xmm10, %xmm12, %xmm15 +// CHECK: vshufps $8, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc6,0xeb,0x08] + vshufps $8, %xmm11, %xmm12, %xmm13 + +// CHECK: vshufps $8, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x18,0xc6,0x6c,0xcb,0xfc,0x08] + vshufps $8, -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vshufpd $8, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x19,0xc6,0xeb,0x08] + vshufpd $8, %xmm11, %xmm12, %xmm13 + +// CHECK: vshufpd $8, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x19,0xc6,0x6c,0xcb,0xfc,0x08] + vshufpd $8, -4(%rbx,%rcx,8), %xmm12, %xmm13 + From rafael.espindola at gmail.com Wed Jun 23 15:20:59 2010 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Wed, 23 Jun 2010 20:20:59 -0000 Subject: [llvm-commits] [llvm] r106674 - /llvm/trunk/tools/gold/gold-plugin.cpp Message-ID: <20100623202059.CCA3A2A6C12C@llvm.org> Author: rafael Date: Wed Jun 23 15:20:59 2010 New Revision: 106674 URL: http://llvm.org/viewvc/llvm-project?rev=106674&view=rev Log: Add an extra-library-path option to the plugin. This is used to support having a library both as bitcode and native code. We want to use the bitcode first, but if codegen produces new undefined references we have to use the native code to satisfy those references. Gold has no notion of bitcode and native search directories, so instead it has an API where the plugin can instruct it to look for the libraries it is passing to it. This patch uses that API. Modified: llvm/trunk/tools/gold/gold-plugin.cpp Modified: llvm/trunk/tools/gold/gold-plugin.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=106674&r1=106673&r2=106674&view=diff ============================================================================== --- llvm/trunk/tools/gold/gold-plugin.cpp (original) +++ llvm/trunk/tools/gold/gold-plugin.cpp Wed Jun 23 15:20:59 2010 @@ -42,6 +42,7 @@ ld_plugin_get_symbols get_symbols = NULL; ld_plugin_add_input_file add_input_file = NULL; ld_plugin_add_input_library add_input_library = NULL; + ld_plugin_set_extra_library_path set_extra_library_path = NULL; ld_plugin_message message = discard_message; int api_version = 0; @@ -66,6 +67,7 @@ static std::string bc_path; static std::string as_path; static std::vector pass_through; + static std::string extra_library_path; // Additional options to pass into the code generator. // Note: This array will contain all plugin options which are not claimed // as plugin exclusive to pass to the code generator. @@ -88,6 +90,8 @@ } else { as_path = opt.substr(strlen("as=")); } + } else if (opt.startswith("extra-library-path=")) { + extra_library_path = opt.substr(strlen("extra_library_path=")); } else if (opt.startswith("pass-through=")) { llvm::StringRef item = opt.substr(strlen("pass-through=")); pass_through.push_back(item.str()); @@ -198,6 +202,9 @@ case LDPT_ADD_INPUT_LIBRARY: add_input_library = tv->tv_u.tv_add_input_file; break; + case LDPT_SET_EXTRA_LIBRARY_PATH: + set_extra_library_path = tv->tv_u.tv_set_extra_library_path; + break; case LDPT_MESSAGE: message = tv->tv_u.tv_message; break; @@ -445,6 +452,12 @@ return LDPS_ERR; } + if (!options::extra_library_path.empty() && + set_extra_library_path(options::extra_library_path.c_str()) != LDPS_OK) { + (*message)(LDPL_ERROR, "Unable to set the extra library path."); + return LDPS_ERR; + } + for (std::vector::iterator i = options::pass_through.begin(), e = options::pass_through.end(); i != e; ++i) { From gohman at apple.com Wed Jun 23 15:23:18 2010 From: gohman at apple.com (Dan Gohman) Date: Wed, 23 Jun 2010 13:23:18 -0700 Subject: [llvm-commits] [llvm] r106621 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td In-Reply-To: <20100623080149.775DB2A6C12D@llvm.org> References: <20100623080149.775DB2A6C12D@llvm.org> Message-ID: <601694F6-95F8-4808-AF48-8084F10E8C28@apple.com> On Jun 23, 2010, at 1:01 AM, Eric Christopher wrote: > Author: echristo > Date: Wed Jun 23 03:01:49 2010 > New Revision: 106621 > > URL: http://llvm.org/viewvc/llvm-project?rev=106621&view=rev > Log: > Update uses, defs, and comments for darwin tls patterns. > > Modified: > llvm/trunk/lib/Target/X86/X86Instr64bit.td > llvm/trunk/lib/Target/X86/X86InstrInfo.td > > Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=106621&r1=106620&r2=106621&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) > +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Wed Jun 23 03:01:49 2010 > @@ -1705,13 +1705,10 @@ > [(X86tlsaddr tls64addr:$sym)]>, > Requires<[In64BitMode]>; > > > -// FIXME: Not true for darwin > -let Defs = [EAX, ECX, EDX, FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0, > - MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, > - XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, > - XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS], > - Uses = [ESP], > +// For i386, the address of the thunk is passed on the stack, on return the > +// address of the variable is in %eax. %ecx is trashed during the function > +// call. %edx is preserved. > +let Defs = [EAX], > + Uses = [ESP, ECX], If ecx is trashed, it should be listed as a Def, and not as a Use. Also, if all the other registers are preserved, please mention that explicitly, as that's a non-obvious difference from regular calls. > usesCustomInserter = 1 in > def TLSCall_32 : I<0, Pseudo, (outs), (ins i32mem:$sym), > "# Fixme into a call", Please add comments noting that this and TLSCall_64 are Darwin-specific. Please don't put "Fixme" in the string there. Just put "# TLSCall" or whatever, as the other Pseudo instructions do. Thanks, Dan From espindola at google.com Wed Jun 23 15:25:06 2010 From: espindola at google.com (Rafael Espindola) Date: Wed, 23 Jun 2010 16:25:06 -0400 Subject: [llvm-commits] [patch][gold plugin] Add an extra-library-path option to the plugin In-Reply-To: <4C21978D.1080707@mxc.ca> References: <4C21978D.1080707@mxc.ca> Message-ID: > I wish it were named 'late-bound native libraries' or last-chance native > libraries or something. It also seems odd that it only supports one library. > Anyhow, this patch is implements the feature as exposed by gold. Thanks! It is one library *path*. I considered extending this in gold, but decided it was probably not necessary. If you have a setup as strange as having bitcode and native versions of libc, you can probably put the native one and its dependencies in a directory. > Nick > > Thanks, -- Rafael ?vila de Esp?ndola From echristo at apple.com Wed Jun 23 15:35:17 2010 From: echristo at apple.com (Eric Christopher) Date: Wed, 23 Jun 2010 13:35:17 -0700 Subject: [llvm-commits] [llvm] r106621 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td In-Reply-To: <601694F6-95F8-4808-AF48-8084F10E8C28@apple.com> References: <20100623080149.775DB2A6C12D@llvm.org> <601694F6-95F8-4808-AF48-8084F10E8C28@apple.com> Message-ID: <4064C1F8-8696-4118-B2BE-C70AAAE2EE22@apple.com> >> > > If ecx is trashed, it should be listed as a Def, and not as a Use. > OK! > Also, if all the other registers are preserved, please mention that > explicitly, as that's a non-obvious difference from regular calls. > Will do. >> usesCustomInserter = 1 in >> def TLSCall_32 : I<0, Pseudo, (outs), (ins i32mem:$sym), >> "# Fixme into a call", > > Please add comments noting that this and TLSCall_64 are Darwin-specific. > > Please don't put "Fixme" in the string there. Just put "# TLSCall" or > whatever, as the other Pseudo instructions do. Sure. -eric From echristo at apple.com Wed Jun 23 15:49:35 2010 From: echristo at apple.com (Eric Christopher) Date: Wed, 23 Jun 2010 20:49:35 -0000 Subject: [llvm-commits] [llvm] r106677 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td Message-ID: <20100623204935.9FD032A6C12C@llvm.org> Author: echristo Date: Wed Jun 23 15:49:35 2010 New Revision: 106677 URL: http://llvm.org/viewvc/llvm-project?rev=106677&view=rev Log: Update according to feedback. Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=106677&r1=106676&r2=106677&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Wed Jun 23 15:49:35 2010 @@ -1711,7 +1711,7 @@ Uses = [RDI], usesCustomInserter = 1 in def TLSCall_64 : I<0, Pseudo, (outs), (ins i64mem:$sym), - "# Fixme into a call", + "# TLSCall_64", [(X86TLSCall addr:$sym)]>, Requires<[In64BitMode]>; Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=106677&r1=106676&r2=106677&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Wed Jun 23 15:49:35 2010 @@ -3864,12 +3864,12 @@ // For i386, the address of the thunk is passed on the stack, on return the // address of the variable is in %eax. %ecx is trashed during the function -// call. %edx is preserved. -let Defs = [EAX], - Uses = [ESP, ECX], +// call. All other registers are preserved. +let Defs = [EAX, ECX], + Uses = [ESP], usesCustomInserter = 1 in def TLSCall_32 : I<0, Pseudo, (outs), (ins i32mem:$sym), - "# Fixme into a call", + "# TLSCall_32", [(X86TLSCall addr:$sym)]>, Requires<[In32BitMode]>; From nicolasweber at gmx.de Wed Jun 23 15:00:58 2010 From: nicolasweber at gmx.de (Nico Weber) Date: Wed, 23 Jun 2010 20:00:58 -0000 Subject: [llvm-commits] [llvm] r106671 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.td test/MC/AsmParser/X86/x86_32-new-encoder.s utils/TableGen/EDEmitter.cpp Message-ID: <20100623200058.B34062A6C12C@llvm.org> Author: nico Date: Wed Jun 23 15:00:58 2010 New Revision: 106671 URL: http://llvm.org/viewvc/llvm-project?rev=106671&view=rev Log: Add support for the x86 instructions "pusha" and "popa". Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s llvm/trunk/utils/TableGen/EDEmitter.cpp Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=106671&r1=106670&r2=106671&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Wed Jun 23 15:00:58 2010 @@ -820,6 +820,17 @@ Requires<[In32BitMode]>; } +let Defs = [EDI, ESI, EBP, EBX, EDX, ECX, EAX, ESP], Uses = [ESP], + mayLoad=1, neverHasSideEffects=1 in { +def POPA32 : I<0x61, RawFrm, (outs), (ins), "popa{l}", []>, + Requires<[In32BitMode]>; +} +let Defs = [ESP], Uses = [EDI, ESI, EBP, EBX, EDX, ECX, EAX, ESP], + mayStore=1, neverHasSideEffects=1 in { +def PUSHA32 : I<0x60, RawFrm, (outs), (ins), "pusha{l}", []>, + Requires<[In32BitMode]>; +} + let Uses = [EFLAGS], Constraints = "$src = $dst" in // GR32 = bswap GR32 def BSWAP32r : I<0xC8, AddRegFrm, (outs GR32:$dst), (ins GR32:$src), Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s?rev=106671&r1=106670&r2=106671&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-new-encoder.s Wed Jun 23 15:00:58 2010 @@ -398,3 +398,20 @@ // CHECK: [0x65,0x8b,0x05,0x7c,0x00,0x00,0x00] // FIXME: This is a correct bug poor encoding: Use 65 a1 7c 00 00 00 movl %gs:124, %eax + +// CHECK: pusha +// CHECK: encoding: [0x60] + pusha + +// CHECK: popa +// CHECK: encoding: [0x61] + popa + +// CHECK: pushal +// CHECK: encoding: [0x60] + pushal + +// CHECK: popal +// CHECK: encoding: [0x61] + popal + Modified: llvm/trunk/utils/TableGen/EDEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/EDEmitter.cpp?rev=106671&r1=106670&r2=106671&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/EDEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/EDEmitter.cpp Wed Jun 23 15:00:58 2010 @@ -500,6 +500,8 @@ // TODO add support for fixed operands } else if (name.find("F") != name.npos) { // ignore (this pushes onto the FP stack) + } else if (name.find("A") != name.npos) { + // ignore (pushes all GP registoers onto the stack) } else if (name[name.length() - 1] == 'm') { PUSH("src"); } else if (name.find("i") != name.npos) { @@ -518,6 +520,8 @@ // TODO add support for fixed operands } else if (name.find("F") != name.npos) { // ignore (this pops from the FP stack) + } else if (name.find("A") != name.npos) { + // ignore (pushes all GP registoers onto the stack) } else if (name[name.length() - 1] == 'm') { POP("dst"); } else { From bruno.cardoso at gmail.com Wed Jun 23 16:10:57 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 23 Jun 2010 21:10:57 -0000 Subject: [llvm-commits] [llvm] r106678 - in /llvm/trunk: lib/Target/X86/AsmParser/X86AsmParser.cpp test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100623211057.42F392A6C12C@llvm.org> Author: bruno Date: Wed Jun 23 16:10:57 2010 New Revision: 106678 URL: http://llvm.org/viewvc/llvm-project?rev=106678&view=rev Log: Add tests for different AVX cmp opcodes, also teach the x86 asm parser to understand the vcmp instruction Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=106678&r1=106677&r2=106678&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Wed Jun 23 16:10:57 2010 @@ -664,11 +664,13 @@ // FIXME: Hack to recognize cmp{ss,sd,ps,pd}. const MCExpr *ExtraImmOp = 0; - if (PatchedName.startswith("cmp") && + if ((PatchedName.startswith("cmp") || PatchedName.startswith("vcmp")) && (PatchedName.endswith("ss") || PatchedName.endswith("sd") || PatchedName.endswith("ps") || PatchedName.endswith("pd"))) { + bool IsVCMP = PatchedName.startswith("vcmp"); + unsigned SSECCIdx = IsVCMP ? 4 : 3; unsigned SSEComparisonCode = StringSwitch( - PatchedName.slice(3, PatchedName.size() - 2)) + PatchedName.slice(SSECCIdx, PatchedName.size() - 2)) .Case("eq", 0) .Case("lt", 1) .Case("le", 2) @@ -682,14 +684,14 @@ ExtraImmOp = MCConstantExpr::Create(SSEComparisonCode, getParser().getContext()); if (PatchedName.endswith("ss")) { - PatchedName = "cmpss"; + PatchedName = IsVCMP ? "vcmpss" : "cmpss"; } else if (PatchedName.endswith("sd")) { - PatchedName = "cmpsd"; + PatchedName = IsVCMP ? "vcmpsd" : "cmpsd"; } else if (PatchedName.endswith("ps")) { - PatchedName = "cmpps"; + PatchedName = IsVCMP ? "vcmpps" : "cmpps"; } else { assert(PatchedName.endswith("pd") && "Unexpected mnemonic!"); - PatchedName = "cmppd"; + PatchedName = IsVCMP ? "vcmppd" : "cmppd"; } } } Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=106678&r1=106677&r2=106678&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Wed Jun 23 16:10:57 2010 @@ -10390,3 +10390,130 @@ // CHECK: encoding: [0xc5,0xe9,0xc6,0x5c,0xcb,0xfc,0x08] vshufpd $8, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: vcmpps $0, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x00] + vcmpeqps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $2, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x02] + vcmpleps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $1, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x01] + vcmpltps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $4, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x04] + vcmpneqps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $6, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x06] + vcmpnleps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $5, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x05] + vcmpnltps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $7, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x07] + vcmpordps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $3, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0xd9,0x03] + vcmpunordps %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpps $0, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0x5c,0xcb,0xfc,0x00] + vcmpeqps -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpps $2, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0x5c,0xcb,0xfc,0x02] + vcmpleps -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpps $1, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0x5c,0xcb,0xfc,0x01] + vcmpltps -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpps $4, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0x5c,0xcb,0xfc,0x04] + vcmpneqps -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpps $6, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0x5c,0xcb,0xfc,0x06] + vcmpnleps -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpps $5, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0x5c,0xcb,0xfc,0x05] + vcmpnltps -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpps $7, -4(%ebx,%ecx,8), %xmm6, %xmm2 +// CHECK: encoding: [0xc5,0xc8,0xc2,0x54,0xcb,0xfc,0x07] + vcmpordps -4(%ebx,%ecx,8), %xmm6, %xmm2 + +// CHECK: vcmpps $3, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe8,0xc2,0x5c,0xcb,0xfc,0x03] + vcmpunordps -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmppd $0, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0xd9,0x00] + vcmpeqpd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmppd $2, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0xd9,0x02] + vcmplepd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmppd $1, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0xd9,0x01] + vcmpltpd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmppd $4, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0xd9,0x04] + vcmpneqpd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmppd $6, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0xd9,0x06] + vcmpnlepd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmppd $5, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0xd9,0x05] + vcmpnltpd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmppd $7, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0xd9,0x07] + vcmpordpd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmppd $3, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0xd9,0x03] + vcmpunordpd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmppd $0, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0x5c,0xcb,0xfc,0x00] + vcmpeqpd -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmppd $2, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0x5c,0xcb,0xfc,0x02] + vcmplepd -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmppd $1, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0x5c,0xcb,0xfc,0x01] + vcmpltpd -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmppd $4, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0x5c,0xcb,0xfc,0x04] + vcmpneqpd -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmppd $6, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0x5c,0xcb,0xfc,0x06] + vcmpnlepd -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmppd $5, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0x5c,0xcb,0xfc,0x05] + vcmpnltpd -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmppd $7, -4(%ebx,%ecx,8), %xmm6, %xmm2 +// CHECK: encoding: [0xc5,0xc9,0xc2,0x54,0xcb,0xfc,0x07] + vcmpordpd -4(%ebx,%ecx,8), %xmm6, %xmm2 + +// CHECK: vcmppd $3, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xe9,0xc2,0x5c,0xcb,0xfc,0x03] + vcmpunordpd -4(%ebx,%ecx,8), %xmm2, %xmm3 Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=106678&r1=106677&r2=106678&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Wed Jun 23 16:10:57 2010 @@ -454,3 +454,131 @@ // CHECK: encoding: [0xc5,0x19,0xc6,0x6c,0xcb,0xfc,0x08] vshufpd $8, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: vcmpps $0, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x00] + vcmpeqps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $2, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x02] + vcmpleps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $1, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x01] + vcmpltps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $4, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x04] + vcmpneqps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $6, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x06] + vcmpnleps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $5, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x05] + vcmpnltps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $7, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x07] + vcmpordps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $3, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x18,0xc2,0xeb,0x03] + vcmpunordps %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpps $0, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x18,0xc2,0x6c,0xcb,0xfc,0x00] + vcmpeqps -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpps $2, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x18,0xc2,0x6c,0xcb,0xfc,0x02] + vcmpleps -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpps $1, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x18,0xc2,0x6c,0xcb,0xfc,0x01] + vcmpltps -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpps $4, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x18,0xc2,0x6c,0xcb,0xfc,0x04] + vcmpneqps -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpps $6, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x18,0xc2,0x6c,0xcb,0xfc,0x06] + vcmpnleps -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpps $5, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x18,0xc2,0x6c,0xcb,0xfc,0x05] + vcmpnltps -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpps $7, -4(%rbx,%rcx,8), %xmm6, %xmm2 +// CHECK: encoding: [0xc5,0xc8,0xc2,0x54,0xcb,0xfc,0x07] + vcmpordps -4(%rbx,%rcx,8), %xmm6, %xmm2 + +// CHECK: vcmpps $3, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x18,0xc2,0x6c,0xcb,0xfc,0x03] + vcmpunordps -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmppd $0, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x19,0xc2,0xeb,0x00] + vcmpeqpd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmppd $2, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x19,0xc2,0xeb,0x02] + vcmplepd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmppd $1, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x19,0xc2,0xeb,0x01] + vcmpltpd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmppd $4, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x19,0xc2,0xeb,0x04] + vcmpneqpd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmppd $6, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x19,0xc2,0xeb,0x06] + vcmpnlepd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmppd $5, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x19,0xc2,0xeb,0x05] + vcmpnltpd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmppd $7, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x19,0xc2,0xeb,0x07] + vcmpordpd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmppd $3, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x19,0xc2,0xeb,0x03] + vcmpunordpd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmppd $0, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x19,0xc2,0x6c,0xcb,0xfc,0x00] + vcmpeqpd -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmppd $2, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x19,0xc2,0x6c,0xcb,0xfc,0x02] + vcmplepd -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmppd $1, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x19,0xc2,0x6c,0xcb,0xfc,0x01] + vcmpltpd -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmppd $4, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x19,0xc2,0x6c,0xcb,0xfc,0x04] + vcmpneqpd -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmppd $6, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x19,0xc2,0x6c,0xcb,0xfc,0x06] + vcmpnlepd -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmppd $5, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x19,0xc2,0x6c,0xcb,0xfc,0x05] + vcmpnltpd -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmppd $7, -4(%rbx,%rcx,8), %xmm6, %xmm2 +// CHECK: encoding: [0xc5,0xc9,0xc2,0x54,0xcb,0xfc,0x07] + vcmpordpd -4(%rbx,%rcx,8), %xmm6, %xmm2 + +// CHECK: vcmppd $3, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x19,0xc2,0x6c,0xcb,0xfc,0x03] + vcmpunordpd -4(%rbx,%rcx,8), %xmm12, %xmm13 + From echristo at apple.com Wed Jun 23 16:16:46 2010 From: echristo at apple.com (Eric Christopher) Date: Wed, 23 Jun 2010 21:16:46 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r106681 - in /llvm-gcc-4.2/trunk/gcc: configure configure.ac Message-ID: <20100623211647.343592A6C12C@llvm.org> Author: echristo Date: Wed Jun 23 16:16:46 2010 New Revision: 106681 URL: http://llvm.org/viewvc/llvm-project?rev=106681&view=rev Log: If we're building the "apple-way" we're creating a dylib and everything needs to be linked against this as well. No harm done in just checking and linking though. Modified: llvm-gcc-4.2/trunk/gcc/configure llvm-gcc-4.2/trunk/gcc/configure.ac Modified: llvm-gcc-4.2/trunk/gcc/configure URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/configure?rev=106681&r1=106680&r2=106681&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/configure (original) +++ llvm-gcc-4.2/trunk/gcc/configure Wed Jun 23 16:16:46 2010 @@ -1,8 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59. +# Generated by GNU Autoconf 2.60. # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -16,11 +17,35 @@ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi +BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset @@ -29,8 +54,43 @@ fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -44,18 +104,19 @@ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -63,157 +124,386 @@ # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf at gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -222,7 +512,19 @@ as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -231,39 +533,27 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= @@ -300,17 +590,249 @@ #endif #if HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif +#endif +#if HAVE_STDINT_H +# include #endif #if HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn cxx_compat_warn warn_cflags WERROR checkingenabled_flag nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep DSYMUTIL LLVMBASEPATH LLVMBUILDMODE datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_selected_languages all_stagestuff build_exeext build_i nstall_headers_dir build_xm_file_list build_xm_include_list build_xm_defines check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_cxx_file out_object_file out_cxx_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +target_noncanonical +build_libsubdir +build_subdir +host_subdir +target_subdir +GENINSRC +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +NO_MINUS_C_MINUS_O +OUTPUT_OPTION +CPP +GREP +EGREP +strict1_warn +cxx_compat_warn +warn_cflags +WERROR +checkingenabled_flag +nocommon_flag +TREEBROWSER +valgrind_path +valgrind_path_defines +valgrind_command +coverage_flags +enable_multilib +enable_decimal_float +enable_shared +TARGET_SYSTEM_ROOT +TARGET_SYSTEM_ROOT_DEFINE +CROSS_SYSTEM_HEADER_DIR +onestep +DSYMUTIL +LLVMBASEPATH +LLVMBUILDMODE +SET_MAKE +AWK +LN_S +LN +RANLIB +ranlib_flags +INSTALL +INSTALL_PROGRAM +INSTALL_DATA +make_compare_target +have_mktemp_command +MAKEINFO +BUILD_INFO +GENERATED_MANPAGES +FLEX +BISON +NM +AR +stage1_cflags +COLLECT2_LIBS +GNAT_LIBEXC +LDEXP_LIB +TARGET_GETGROUPS_T +LIBICONV +LTLIBICONV +LIBICONV_DEP +manext +objext +gthread_flags +extra_modes_file +extra_opt_files +USE_NLS +LIBINTL +LIBINTL_DEP +INCINTL +XGETTEXT +GMSGFMT +POSUB +CATALOGS +DATADIRNAME +INSTOBJEXT +GENCAT +CATOBJEXT +host_cc_for_libada +CROSS +ALL +SYSTEM_HEADER_DIR +inhibit_libc +CC_FOR_BUILD +BUILD_CFLAGS +STMP_FIXINC +STMP_FIXPROTO +collect2 +gcc_cv_as +ORIGINAL_AS_FOR_TARGET +gcc_cv_ld +ORIGINAL_LD_FOR_TARGET +gcc_cv_nm +ORIGINAL_NM_FOR_TARGET +gcc_cv_objdump +libgcc_visibility +GGC +zlibdir +zlibinc +MAINT +gcc_tooldir +dollar +slibdir +objdir +subdirs +srcdir +all_boot_languages +all_compilers +all_gtfiles +all_gtfiles_files_langs +all_gtfiles_files_files +all_lang_makefrags +all_lang_makefiles +all_languages +all_selected_languages +all_stagestuff +build_exeext +build_install_headers_dir +build_xm_file_list +build_xm_include_list +build_xm_defines +check_languages +cc_set_by_configure +quoted_cc_set_by_configure +cpp_install_dir +xmake_file +tmake_file +extra_gcc_objs +extra_headers_list +extra_objs +extra_parts +extra_passes +extra_programs +float_h_file +gcc_config_arguments +gcc_gxx_include_dir +host_exeext +host_xm_file_list +host_xm_include_list +host_xm_defines +out_host_hook_obj +install +lang_opt_files +lang_specs_files +lang_tree_files +local_prefix +md_file +objc_boehm_gc +out_file +out_cxx_file +out_object_file +out_cxx_object_file +stage_prefix_set_by_configure +quoted_stage_prefix_set_by_configure +thread_file +tm_file_list +tm_include_list +tm_defines +tm_p_file_list +tm_p_include_list +xm_file_list +xm_include_list +xm_defines +c_target_objs +cxx_target_objs +target_cpu_default +GMPLIBS +GMPINC +LIBOBJS +LTLIBOBJS' ac_subst_files='language_hooks' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +CPP +GMPLIBS +GMPINC' + # Initialize some variables set by options. ac_init_help= @@ -337,34 +859,48 @@ # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -386,12 +922,18 @@ --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. @@ -399,7 +941,17 @@ { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` @@ -408,11 +960,7 @@ { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -439,6 +987,12 @@ -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -463,13 +1017,16 @@ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -534,6 +1091,16 @@ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -590,11 +1157,7 @@ { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` @@ -603,7 +1166,7 @@ { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -634,8 +1197,7 @@ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -655,27 +1217,19 @@ { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -702,84 +1256,78 @@ test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP -ac_env_GMPLIBS_set=${GMPLIBS+set} -ac_env_GMPLIBS_value=$GMPLIBS -ac_cv_env_GMPLIBS_set=${GMPLIBS+set} -ac_cv_env_GMPLIBS_value=$GMPLIBS -ac_env_GMPINC_set=${GMPINC+set} -ac_env_GMPINC_value=$GMPINC -ac_cv_env_GMPINC_set=${GMPINC+set} -ac_cv_env_GMPINC_value=$GMPINC - -# + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# # Report the --help message. # if test "$ac_init_help" = "long"; then @@ -806,9 +1354,6 @@ -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -826,15 +1371,22 @@ --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -948,8 +1500,8 @@ CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor GMPLIBS How to link GMP GMPINC How to find GMP include files @@ -958,118 +1510,86 @@ it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +configure +generated by GNU Autoconf 2.60 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1088,7 +1608,7 @@ /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1102,6 +1622,7 @@ test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1123,7 +1644,6 @@ ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1134,7 +1654,7 @@ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1156,9 +1676,7 @@ -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1169,8 +1687,8 @@ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1183,20 +1701,34 @@ _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1207,22 +1739,28 @@ echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1234,26 +1772,24 @@ ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1284,14 +1820,17 @@ # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1307,8 +1846,8 @@ { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1320,12 +1859,11 @@ # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1350,8 +1888,7 @@ # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1368,12 +1905,6 @@ { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - @@ -1390,114 +1921,169 @@ +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_config_headers="$ac_config_headers auto-host.h:config.in" +ac_config_headers="$ac_config_headers auto-host.h:config.in" gcc_version=`cat $srcdir/BASE-VER` # Determine the host, build, and target systems ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. @@ -1540,13 +2126,13 @@ # Prefix 'build-' so this never conflicts with target_subdir. build_subdir="build-${build_noncanonical}" -# Check whether --with-build-libsubdir or --without-build-libsubdir was given. +# Check whether --with-build-libsubdir was given. if test "${with_build_libsubdir+set}" = set; then - withval="$with_build_libsubdir" - build_libsubdir="$withval" + withval=$with_build_libsubdir; build_libsubdir="$withval" else build_libsubdir="$build_subdir" -fi; +fi + # --srcdir=. covers the toplevel, while "test -d" covers the subdirectories if ( test $srcdir = . && test -d gcc ) \ || test -d $srcdir/../host-${host_noncanonical}; then @@ -1560,17 +2146,17 @@ # Set program_transform_name test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" + program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" + program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed +rm -f conftest.sed # Check for bogus environment variables. @@ -1581,8 +2167,8 @@ # - one of the terminals (":" and ";") is the first or last sign # - two terminals occur directly after each other # - the path contains an element with a dot in it -echo "$as_me:$LINENO: checking LIBRARY_PATH variable" >&5 -echo $ECHO_N "checking LIBRARY_PATH variable... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking LIBRARY_PATH variable" >&5 +echo $ECHO_N "checking LIBRARY_PATH variable... $ECHO_C" >&6; } case ${LIBRARY_PATH} in [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* ) library_path_setting="contains current directory" @@ -1591,8 +2177,8 @@ library_path_setting="ok" ;; esac -echo "$as_me:$LINENO: result: $library_path_setting" >&5 -echo "${ECHO_T}$library_path_setting" >&6 +{ echo "$as_me:$LINENO: result: $library_path_setting" >&5 +echo "${ECHO_T}$library_path_setting" >&6; } if test "$library_path_setting" != "ok"; then { { echo "$as_me:$LINENO: error: *** LIBRARY_PATH shouldn't contain the current directory when @@ -1612,8 +2198,8 @@ # - one of the terminals (":" and ";") is the first or last sign # - two terminals occur directly after each other # - the path contains an element with a dot in it -echo "$as_me:$LINENO: checking GCC_EXEC_PREFIX variable" >&5 -echo $ECHO_N "checking GCC_EXEC_PREFIX variable... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking GCC_EXEC_PREFIX variable" >&5 +echo $ECHO_N "checking GCC_EXEC_PREFIX variable... $ECHO_C" >&6; } case ${GCC_EXEC_PREFIX} in [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* ) gcc_exec_prefix_setting="contains current directory" @@ -1622,8 +2208,8 @@ gcc_exec_prefix_setting="ok" ;; esac -echo "$as_me:$LINENO: result: $gcc_exec_prefix_setting" >&5 -echo "${ECHO_T}$gcc_exec_prefix_setting" >&6 +{ echo "$as_me:$LINENO: result: $gcc_exec_prefix_setting" >&5 +echo "${ECHO_T}$gcc_exec_prefix_setting" >&6; } if test "$gcc_exec_prefix_setting" != "ok"; then { { echo "$as_me:$LINENO: error: *** GCC_EXEC_PREFIX shouldn't contain the current directory when @@ -1643,17 +2229,17 @@ # Specify the local prefix local_prefix= -# Check whether --with-local-prefix or --without-local-prefix was given. +# Check whether --with-local-prefix was given. if test "${with_local_prefix+set}" = set; then - withval="$with_local_prefix" - case "${withval}" in + withval=$with_local_prefix; case "${withval}" in yes) { { echo "$as_me:$LINENO: error: bad value ${withval} given for local include directory prefix" >&5 echo "$as_me: error: bad value ${withval} given for local include directory prefix" >&2;} { (exit 1); exit 1; }; } ;; no) ;; *) local_prefix=$with_local_prefix ;; esac -fi; +fi + # Default local prefix if it is empty if test x$local_prefix = x; then @@ -1666,17 +2252,17 @@ gcc_gxx_include_dir= # Specify the g++ header file directory -# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given. +# Check whether --with-gxx-include-dir was given. if test "${with_gxx_include_dir+set}" = set; then - withval="$with_gxx_include_dir" - case "${withval}" in + withval=$with_gxx_include_dir; case "${withval}" in yes) { { echo "$as_me:$LINENO: error: bad value ${withval} given for g++ include directory" >&5 echo "$as_me: error: bad value ${withval} given for g++ include directory" >&2;} { (exit 1); exit 1; }; } ;; no) ;; *) gcc_gxx_include_dir=$with_gxx_include_dir ;; esac -fi; +fi + # This logic must match libstdc++-v3/acinclude.m4:GLIBCXX_EXPORT_INSTALL_INFO. if test x${gcc_gxx_include_dir} = x; then @@ -1692,17 +2278,17 @@ fi -# Check whether --with-cpp_install_dir or --without-cpp_install_dir was given. +# Check whether --with-cpp_install_dir was given. if test "${with_cpp_install_dir+set}" = set; then - withval="$with_cpp_install_dir" - if test x$withval = xyes; then + withval=$with_cpp_install_dir; if test x$withval = xyes; then { { echo "$as_me:$LINENO: error: option --with-cpp-install-dir requires an argument" >&5 echo "$as_me: error: option --with-cpp-install-dir requires an argument" >&2;} { (exit 1); exit 1; }; } elif test x$withval != xno; then cpp_install_dir=$withval fi -fi; +fi + # We would like to our source tree to be readonly. However when releases or # pre-releases are generated, the flex/bison generated files as well as the @@ -1710,18 +2296,18 @@ # sources. Therefore we have --enable-generated-files-in-srcdir to do # just that. -echo "$as_me:$LINENO: checking whether to place generated files in the source directory" >&5 -echo $ECHO_N "checking whether to place generated files in the source directory... $ECHO_C" >&6 - # Check whether --enable-generated-files-in-srcdir or --disable-generated-files-in-srcdir was given. +{ echo "$as_me:$LINENO: checking whether to place generated files in the source directory" >&5 +echo $ECHO_N "checking whether to place generated files in the source directory... $ECHO_C" >&6; } + # Check whether --enable-generated-files-in-srcdir was given. if test "${enable_generated_files_in_srcdir+set}" = set; then - enableval="$enable_generated_files_in_srcdir" - generated_files_in_srcdir=$enableval + enableval=$enable_generated_files_in_srcdir; generated_files_in_srcdir=$enableval else generated_files_in_srcdir=no -fi; +fi + -echo "$as_me:$LINENO: result: $generated_files_in_srcdir" >&5 -echo "${ECHO_T}$generated_files_in_srcdir" >&6 +{ echo "$as_me:$LINENO: result: $generated_files_in_srcdir" >&5 +echo "${ECHO_T}$generated_files_in_srcdir" >&6; } if test "$generated_files_in_srcdir" = "yes"; then GENINSRC='' @@ -1736,21 +2322,21 @@ # With GNU ld -# Check whether --with-gnu-ld or --without-gnu-ld was given. +# Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - gnu_ld_flag="$with_gnu_ld" + withval=$with_gnu_ld; gnu_ld_flag="$with_gnu_ld" else gnu_ld_flag=no -fi; +fi + # With pre-defined ld -# Check whether --with-ld or --without-ld was given. +# Check whether --with-ld was given. if test "${with_ld+set}" = set; then - withval="$with_ld" - DEFAULT_LINKER="$with_ld" -fi; + withval=$with_ld; DEFAULT_LINKER="$with_ld" +fi + if test x"${DEFAULT_LINKER+set}" = x"set"; then if test ! -x "$DEFAULT_LINKER"; then { { echo "$as_me:$LINENO: error: cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" >&5 @@ -1766,30 +2352,30 @@ fi -echo "$as_me:$LINENO: checking whether a default linker was specified" >&5 -echo $ECHO_N "checking whether a default linker was specified... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether a default linker was specified" >&5 +echo $ECHO_N "checking whether a default linker was specified... $ECHO_C" >&6; } if test x"${DEFAULT_LINKER+set}" = x"set"; then if test x"$gnu_ld_flag" = x"no"; then - echo "$as_me:$LINENO: result: yes ($DEFAULT_LINKER)" >&5 -echo "${ECHO_T}yes ($DEFAULT_LINKER)" >&6 + { echo "$as_me:$LINENO: result: yes ($DEFAULT_LINKER)" >&5 +echo "${ECHO_T}yes ($DEFAULT_LINKER)" >&6; } else - echo "$as_me:$LINENO: result: yes ($DEFAULT_LINKER - GNU ld)" >&5 -echo "${ECHO_T}yes ($DEFAULT_LINKER - GNU ld)" >&6 + { echo "$as_me:$LINENO: result: yes ($DEFAULT_LINKER - GNU ld)" >&5 +echo "${ECHO_T}yes ($DEFAULT_LINKER - GNU ld)" >&6; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # With demangler in GNU ld -# Check whether --with-demangler-in-ld or --without-demangler-in-ld was given. +# Check whether --with-demangler-in-ld was given. if test "${with_demangler_in_ld+set}" = set; then - withval="$with_demangler_in_ld" - demangler_in_ld="$with_demangler_in_ld" + withval=$with_demangler_in_ld; demangler_in_ld="$with_demangler_in_ld" else demangler_in_ld=no -fi; +fi + # ---------------------- # Find default assembler @@ -1797,20 +2383,20 @@ # With GNU as -# Check whether --with-gnu-as or --without-gnu-as was given. +# Check whether --with-gnu-as was given. if test "${with_gnu_as+set}" = set; then - withval="$with_gnu_as" - gas_flag="$with_gnu_as" + withval=$with_gnu_as; gas_flag="$with_gnu_as" else gas_flag=no -fi; +fi + -# Check whether --with-as or --without-as was given. +# Check whether --with-as was given. if test "${with_as+set}" = set; then - withval="$with_as" - DEFAULT_ASSEMBLER="$with_as" -fi; + withval=$with_as; DEFAULT_ASSEMBLER="$with_as" +fi + if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then if test ! -x "$DEFAULT_ASSEMBLER"; then { { echo "$as_me:$LINENO: error: cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER" >&5 @@ -1826,19 +2412,19 @@ fi -echo "$as_me:$LINENO: checking whether a default assembler was specified" >&5 -echo $ECHO_N "checking whether a default assembler was specified... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether a default assembler was specified" >&5 +echo $ECHO_N "checking whether a default assembler was specified... $ECHO_C" >&6; } if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then if test x"$gas_flag" = x"no"; then - echo "$as_me:$LINENO: result: yes ($DEFAULT_ASSEMBLER)" >&5 -echo "${ECHO_T}yes ($DEFAULT_ASSEMBLER)" >&6 + { echo "$as_me:$LINENO: result: yes ($DEFAULT_ASSEMBLER)" >&5 +echo "${ECHO_T}yes ($DEFAULT_ASSEMBLER)" >&6; } else - echo "$as_me:$LINENO: result: yes ($DEFAULT_ASSEMBLER - GNU as)" >&5 -echo "${ECHO_T}yes ($DEFAULT_ASSEMBLER - GNU as)" >&6 + { echo "$as_me:$LINENO: result: yes ($DEFAULT_ASSEMBLER - GNU as)" >&5 +echo "${ECHO_T}yes ($DEFAULT_ASSEMBLER - GNU as)" >&6; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # --------------- @@ -1863,8 +2449,8 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1877,32 +2463,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1915,36 +2503,51 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1957,74 +2560,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2038,7 +2601,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2049,6 +2612,7 @@ fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -2066,22 +2630,23 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2094,36 +2659,38 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2136,29 +2703,45 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -2171,21 +2754,35 @@ { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -2210,46 +2807,70 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2262,19 +2883,23 @@ fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2293,22 +2918,27 @@ fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -2319,9 +2949,8 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac @@ -2335,14 +2964,14 @@ fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2362,14 +2991,20 @@ } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2387,12 +3022,12 @@ rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2415,24 +3050,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2441,24 +3088,28 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2474,24 +3125,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2500,285 +3163,278 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; int main () { -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration -#include + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - : + ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -continue + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; int main () { -exit (42); +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - break + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h +rm -f conftest.$ac_ext +CC=$ac_save_CC + fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2786,15 +3442,15 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "x$CC" != xcc; then - echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 -echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 +echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; } else - echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 -echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 +echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; } fi set dummy $CC; ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then +if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -2815,14 +3471,23 @@ # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. -ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5' -if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + test -f conftest2.$ac_objext && { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; @@ -2831,19 +3496,32 @@ if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5' - if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + test -f conftest2.$ac_objext && { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; @@ -2859,15 +3537,15 @@ else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi -rm -f conftest* +rm -f core conftest* fi -if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } cat >>confdefs.h <<\_ACEOF #define NO_MINUS_C_MINUS_O 1 @@ -2917,8 +3595,8 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2952,8 +3630,13 @@ #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2978,9 +3661,10 @@ # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2990,8 +3674,13 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3018,6 +3707,7 @@ ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3035,8 +3725,8 @@ else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3059,8 +3749,13 @@ #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3085,9 +3780,10 @@ # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3097,8 +3793,13 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3125,6 +3826,7 @@ ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3147,8 +3849,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3168,39 +3870,54 @@ _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_c_inline=$ac_kw; break + ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break done fi -echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in @@ -3221,23 +3938,170 @@ # sizeof(char) is 1 by definition. -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3261,24 +4125,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3287,9 +4163,10 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -3345,6 +4222,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -3364,18 +4242,27 @@ for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3388,12 +4275,14 @@ ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3416,9 +4305,9 @@ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3432,24 +4321,36 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3458,12 +4359,14 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -3474,8 +4377,8 @@ done -echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6; } if test "${ac_cv_type_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3486,36 +4389,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef void * ac__type_new_; int main () { -if ((void * *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (void *)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3524,20 +4440,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_void_p=no + ac_cv_type_void_p=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6; } -echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_void_p" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -3550,10 +4467,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -3561,24 +4479,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3591,10 +4521,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -3602,24 +4533,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3628,30 +4571,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -3659,24 +4604,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3689,10 +4646,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -3700,24 +4658,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3726,24 +4696,27 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -3754,10 +4727,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -3765,24 +4739,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3791,26 +4777,20 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *), 77 +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3818,8 +4798,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (void *)); } -unsigned long ulongval () { return (long) (sizeof (void *)); } + typedef void * ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -3828,35 +4809,44 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (void *))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (void *)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (void *)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3867,29 +4857,28 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *), 77 +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val else ac_cv_sizeof_void_p=0 fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF -echo "$as_me:$LINENO: checking for short" >&5 -echo $ECHO_N "checking for short... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for short" >&5 +echo $ECHO_N "checking for short... $ECHO_C" >&6; } if test "${ac_cv_type_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3900,36 +4889,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef short ac__type_new_; int main () { -if ((short *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (short)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3938,20 +4940,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_short=no + ac_cv_type_short=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 -echo "${ECHO_T}$ac_cv_type_short" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 +echo "${ECHO_T}$ac_cv_type_short" >&6; } -echo "$as_me:$LINENO: checking size of short" >&5 -echo $ECHO_N "checking size of short... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking size of short" >&5 +echo $ECHO_N "checking size of short... $ECHO_C" >&6; } if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_short" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -3964,10 +4967,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -3975,24 +4979,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4005,10 +5021,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4016,24 +5033,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4042,30 +5071,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -4073,24 +5104,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4103,10 +5146,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4114,24 +5158,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4140,24 +5196,27 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4168,10 +5227,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4179,24 +5239,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4205,26 +5277,20 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short), 77 +echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4232,8 +5298,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (short)); } -unsigned long ulongval () { return (long) (sizeof (short)); } + typedef short ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -4242,35 +5309,44 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (short))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (short)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (short)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4281,29 +5357,28 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short), 77 +echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val else ac_cv_sizeof_short=0 fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 -echo "${ECHO_T}$ac_cv_sizeof_short" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF -echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6; } if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4314,36 +5389,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef int ac__type_new_; int main () { -if ((int *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (int)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4352,20 +5440,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int=no + ac_cv_type_int=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 -echo "${ECHO_T}$ac_cv_type_int" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6; } -echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_int" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -4378,10 +5467,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -4389,24 +5479,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4419,10 +5521,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4430,24 +5533,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4456,30 +5571,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -4487,24 +5604,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4517,10 +5646,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4528,24 +5658,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4554,24 +5696,27 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4582,10 +5727,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4593,24 +5739,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4619,26 +5777,20 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 +echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4646,8 +5798,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (int)); } -unsigned long ulongval () { return (long) (sizeof (int)); } + typedef int ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -4656,35 +5809,44 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (int))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (int)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (int)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4695,29 +5857,28 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int), 77 +echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val else ac_cv_sizeof_int=0 fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF -echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4728,36 +5889,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef long ac__type_new_; int main () { -if ((long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4766,20 +5940,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long=no + ac_cv_type_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6; } -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -4792,10 +5967,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -4803,24 +5979,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4833,10 +6021,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4844,24 +6033,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4870,30 +6071,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -4901,24 +6104,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4931,10 +6146,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4942,24 +6158,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4968,24 +6196,27 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4996,10 +6227,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5007,24 +6239,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5033,26 +6277,20 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5060,8 +6298,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (long)); } -unsigned long ulongval () { return (long) (sizeof (long)); } + typedef long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -5070,35 +6309,44 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (long))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (long)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5109,29 +6357,28 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val else ac_cv_sizeof_long=0 fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF -echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6; } if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5142,36 +6389,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef long long ac__type_new_; int main () { -if ((long long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (long long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5180,20 +6440,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long_long=no + ac_cv_type_long_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6; } if test $ac_cv_type_long_long = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LONG_LONG 1 _ACEOF -echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6; } if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5204,36 +6465,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef long long ac__type_new_; int main () { -if ((long long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (long long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5242,20 +6516,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long_long=no + ac_cv_type_long_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6; } -echo "$as_me:$LINENO: checking size of long long" >&5 -echo $ECHO_N "checking size of long long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking size of long long" >&5 +echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_long_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -5268,10 +6543,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -5279,24 +6555,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5309,10 +6597,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5320,24 +6609,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5346,30 +6647,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -5377,24 +6680,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5407,10 +6722,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5418,24 +6734,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5444,24 +6772,27 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -5472,10 +6803,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5483,24 +6815,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5509,26 +6853,20 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long), 77 +echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5536,8 +6874,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (long long)); } -unsigned long ulongval () { return (long) (sizeof (long long)); } + typedef long long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -5546,35 +6885,44 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (long long))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (long long)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long long)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5585,22 +6933,21 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long), 77 +echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val else ac_cv_sizeof_long_long=0 fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF @@ -5608,8 +6955,8 @@ fi -echo "$as_me:$LINENO: checking for __int64" >&5 -echo $ECHO_N "checking for __int64... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for __int64" >&5 +echo $ECHO_N "checking for __int64... $ECHO_C" >&6; } if test "${ac_cv_type___int64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5620,36 +6967,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef __int64 ac__type_new_; int main () { -if ((__int64 *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (__int64)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5658,20 +7018,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type___int64=no + ac_cv_type___int64=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type___int64" >&5 -echo "${ECHO_T}$ac_cv_type___int64" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type___int64" >&5 +echo "${ECHO_T}$ac_cv_type___int64" >&6; } if test $ac_cv_type___int64 = yes; then cat >>confdefs.h <<_ACEOF #define HAVE___INT64 1 _ACEOF -echo "$as_me:$LINENO: checking for __int64" >&5 -echo $ECHO_N "checking for __int64... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for __int64" >&5 +echo $ECHO_N "checking for __int64... $ECHO_C" >&6; } if test "${ac_cv_type___int64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5682,36 +7043,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef __int64 ac__type_new_; int main () { -if ((__int64 *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (__int64)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5720,20 +7094,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type___int64=no + ac_cv_type___int64=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type___int64" >&5 -echo "${ECHO_T}$ac_cv_type___int64" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type___int64" >&5 +echo "${ECHO_T}$ac_cv_type___int64" >&6; } -echo "$as_me:$LINENO: checking size of __int64" >&5 -echo $ECHO_N "checking size of __int64... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking size of __int64" >&5 +echo $ECHO_N "checking size of __int64... $ECHO_C" >&6; } if test "${ac_cv_sizeof___int64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type___int64" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -5746,10 +7121,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef __int64 ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (__int64))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -5757,24 +7133,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5787,10 +7175,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef __int64 ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (__int64))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5798,24 +7187,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5824,30 +7225,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef __int64 ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (__int64))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -5855,24 +7258,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5885,10 +7300,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef __int64 ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (__int64))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5896,24 +7312,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5922,24 +7350,27 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -5950,10 +7381,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef __int64 ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (__int64))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5961,24 +7393,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5987,26 +7431,20 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof___int64=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64), 77 +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (__int64), 77 +echo "$as_me: error: cannot compute sizeof (__int64) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } ;; esac else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6014,8 +7452,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (__int64)); } -unsigned long ulongval () { return (long) (sizeof (__int64)); } + typedef __int64 ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -6024,35 +7463,44 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (__int64))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (__int64)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (__int64)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6063,22 +7511,21 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64), 77 +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (__int64), 77 +echo "$as_me: error: cannot compute sizeof (__int64) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val else ac_cv_sizeof___int64=0 fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof___int64" >&5 -echo "${ECHO_T}$ac_cv_sizeof___int64" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof___int64" >&5 +echo "${ECHO_T}$ac_cv_sizeof___int64" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF___INT64 $ac_cv_sizeof___int64 _ACEOF @@ -6098,8 +7545,8 @@ # * overlong strings # So, we only use -pedantic if we can disable those warnings. -echo "$as_me:$LINENO: checking whether ${CC} accepts -Wno-long-long" >&5 -echo $ECHO_N "checking whether ${CC} accepts -Wno-long-long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ${CC} accepts -Wno-long-long" >&5 +echo $ECHO_N "checking whether ${CC} accepts -Wno-long-long... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_w_no_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6114,24 +7561,36 @@ _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6140,17 +7599,18 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_w_no_long_long=no + ac_cv_prog_cc_w_no_long_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_no_long_long" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_w_no_long_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_no_long_long" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_w_no_long_long" >&6; } -echo "$as_me:$LINENO: checking whether ${CC} accepts -Wno-variadic-macros" >&5 -echo $ECHO_N "checking whether ${CC} accepts -Wno-variadic-macros... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ${CC} accepts -Wno-variadic-macros" >&5 +echo $ECHO_N "checking whether ${CC} accepts -Wno-variadic-macros... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_w_no_variadic_macros+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6165,24 +7625,36 @@ _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6191,17 +7663,18 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_w_no_variadic_macros=no + ac_cv_prog_cc_w_no_variadic_macros=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_no_variadic_macros" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_w_no_variadic_macros" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_no_variadic_macros" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_w_no_variadic_macros" >&6; } -echo "$as_me:$LINENO: checking whether ${CC} accepts -Wno-overlength-strings" >&5 -echo $ECHO_N "checking whether ${CC} accepts -Wno-overlength-strings... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ${CC} accepts -Wno-overlength-strings" >&5 +echo $ECHO_N "checking whether ${CC} accepts -Wno-overlength-strings... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_w_no_overlength_strings+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6216,24 +7689,36 @@ _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6242,14 +7727,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_w_no_overlength_strings=no + ac_cv_prog_cc_w_no_overlength_strings=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_no_overlength_strings" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_w_no_overlength_strings" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_no_overlength_strings" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_w_no_overlength_strings" >&6; } strict1_warn= if test $ac_cv_prog_cc_w_no_long_long = yes \ @@ -6259,8 +7745,8 @@ fi # Add -Wold-style-definition if it's accepted -echo "$as_me:$LINENO: checking whether ${CC} accepts -Wold-style-definition" >&5 -echo $ECHO_N "checking whether ${CC} accepts -Wold-style-definition... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ${CC} accepts -Wold-style-definition" >&5 +echo $ECHO_N "checking whether ${CC} accepts -Wold-style-definition... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_w_old_style_definition+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6275,24 +7761,36 @@ _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6301,21 +7799,22 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_w_old_style_definition=no + ac_cv_prog_cc_w_old_style_definition=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_old_style_definition" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_w_old_style_definition" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_old_style_definition" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_w_old_style_definition" >&6; } if test $ac_cv_prog_cc_w_old_style_definition = yes ; then strict1_warn="${strict1_warn} -Wold-style-definition" fi # Add -Wmissing-format-attribute if it's accepted -echo "$as_me:$LINENO: checking whether ${CC} accepts -Wmissing-format-attribute" >&5 -echo $ECHO_N "checking whether ${CC} accepts -Wmissing-format-attribute... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ${CC} accepts -Wmissing-format-attribute" >&5 +echo $ECHO_N "checking whether ${CC} accepts -Wmissing-format-attribute... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_w_missing_format_attribute+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6330,24 +7829,36 @@ _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6356,26 +7867,27 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_w_missing_format_attribute=no + ac_cv_prog_cc_w_missing_format_attribute=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_missing_format_attribute" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_w_missing_format_attribute" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_missing_format_attribute" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_w_missing_format_attribute" >&6; } if test $ac_cv_prog_cc_w_missing_format_attribute = yes ; then strict1_warn="${strict1_warn} -Wmissing-format-attribute" fi # Enable -Werror, period. -# Check whether --enable-werror_always or --disable-werror_always was given. +# Check whether --enable-werror_always was given. if test "${enable_werror_always+set}" = set; then - enableval="$enable_werror_always" - + enableval=$enable_werror_always; else enable_werror_always=no -fi; +fi + if test x${enable_werror_always} = xyes ; then strict1_warn="${strict1_warn} -Werror" WERROR=-Werror @@ -6384,8 +7896,8 @@ # Get C++ compatibility warning flag, if supported. -echo "$as_me:$LINENO: checking whether ${CC} accepts -Wc++-compat" >&5 -echo $ECHO_N "checking whether ${CC} accepts -Wc++-compat... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ${CC} accepts -Wc++-compat" >&5 +echo $ECHO_N "checking whether ${CC} accepts -Wc++-compat... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_w_cxx_compat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6400,24 +7912,36 @@ _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6426,14 +7950,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_w_cxx_compat=no + ac_cv_prog_cc_w_cxx_compat=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_cxx_compat" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_w_cxx_compat" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_cxx_compat" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_w_cxx_compat" >&6; } if test x${ac_cv_prog_cc_w_cxx_compat} = xyes; then cxx_compat_warn="-Wc++-compat" fi @@ -6454,10 +7979,9 @@ if test x"`cat $srcdir/DEV-PHASE`" != xexperimental; then is_release=yes fi -# Check whether --enable-werror or --disable-werror was given. +# Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then - enableval="$enable_werror" - + enableval=$enable_werror; else if test x$is_release = x ; then # Default to "yes" on development branches. @@ -6466,17 +7990,17 @@ # Default to "no" on release branches. enable_werror=no fi -fi; +fi + if test x$enable_werror = xyes ; then WERROR=-Werror fi # Enable expensive internal checks -# Check whether --enable-checking or --disable-checking was given. +# Check whether --enable-checking was given. if test "${enable_checking+set}" = set; then - enableval="$enable_checking" - ac_checking_flags="${enableval}" + enableval=$enable_checking; ac_checking_flags="${enableval}" else # Determine the default checks. @@ -6485,7 +8009,8 @@ else ac_checking_flags=release fi -fi; +fi + ac_assert_checking=1 ac_checking= ac_fold_checking= @@ -6619,17 +8144,17 @@ valgrind_command= if test "${ac_cv_header_valgrind_h+set}" = set; then - echo "$as_me:$LINENO: checking for valgrind.h" >&5 -echo $ECHO_N "checking for valgrind.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for valgrind.h" >&5 +echo $ECHO_N "checking for valgrind.h... $ECHO_C" >&6; } if test "${ac_cv_header_valgrind_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_valgrind_h" >&5 -echo "${ECHO_T}$ac_cv_header_valgrind_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_valgrind_h" >&5 +echo "${ECHO_T}$ac_cv_header_valgrind_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking valgrind.h usability" >&5 -echo $ECHO_N "checking valgrind.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking valgrind.h usability" >&5 +echo $ECHO_N "checking valgrind.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6640,24 +8165,36 @@ #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6666,15 +8203,16 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking valgrind.h presence" >&5 -echo $ECHO_N "checking valgrind.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking valgrind.h presence" >&5 +echo $ECHO_N "checking valgrind.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6683,8 +8221,13 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -6708,9 +8251,10 @@ ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -6734,25 +8278,18 @@ echo "$as_me: WARNING: valgrind.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: valgrind.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: valgrind.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for valgrind.h" >&5 -echo $ECHO_N "checking for valgrind.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for valgrind.h" >&5 +echo $ECHO_N "checking for valgrind.h... $ECHO_C" >&6; } if test "${ac_cv_header_valgrind_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_valgrind_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_valgrind_h" >&5 -echo "${ECHO_T}$ac_cv_header_valgrind_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_valgrind_h" >&5 +echo "${ECHO_T}$ac_cv_header_valgrind_h" >&6; } fi if test $ac_cv_header_valgrind_h = yes; then @@ -6766,8 +8303,8 @@ if test x$ac_valgrind_checking != x ; then # It is certainly possible that there's valgrind but no valgrind.h. # GCC relies on making annotations so we must have both. - echo "$as_me:$LINENO: checking for VALGRIND_DISCARD in " >&5 -echo $ECHO_N "checking for VALGRIND_DISCARD in ... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for VALGRIND_DISCARD in " >&5 +echo $ECHO_N "checking for VALGRIND_DISCARD in ... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6779,8 +8316,13 @@ #error VALGRIND_DISCARD not defined #endif _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -6804,11 +8346,12 @@ gcc_cv_header_valgrind_memcheck_h=no fi + rm -f conftest.err conftest.$ac_ext - echo "$as_me:$LINENO: result: $gcc_cv_header_valgrind_memcheck_h" >&5 -echo "${ECHO_T}$gcc_cv_header_valgrind_memcheck_h" >&6 - echo "$as_me:$LINENO: checking for VALGRIND_DISCARD in " >&5 -echo $ECHO_N "checking for VALGRIND_DISCARD in ... $ECHO_C" >&6 + { echo "$as_me:$LINENO: result: $gcc_cv_header_valgrind_memcheck_h" >&5 +echo "${ECHO_T}$gcc_cv_header_valgrind_memcheck_h" >&6; } + { echo "$as_me:$LINENO: checking for VALGRIND_DISCARD in " >&5 +echo $ECHO_N "checking for VALGRIND_DISCARD in ... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6820,8 +8363,13 @@ #error VALGRIND_DISCARD not defined #endif _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -6845,9 +8393,10 @@ gcc_cv_header_memcheck_h=no fi + rm -f conftest.err conftest.$ac_ext - echo "$as_me:$LINENO: result: $gcc_cv_header_memcheck_h" >&5 -echo "${ECHO_T}$gcc_cv_header_memcheck_h" >&6 + { echo "$as_me:$LINENO: result: $gcc_cv_header_memcheck_h" >&5 +echo "${ECHO_T}$gcc_cv_header_memcheck_h" >&6; } # Prepare PATH_SEPARATOR. # The user is always right. @@ -6879,8 +8428,8 @@ # Extract the first word of "valgrind", so it can be a program name with args. set dummy valgrind; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_valgrind_path+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6908,11 +8457,11 @@ fi valgrind_path="$ac_cv_path_valgrind_path" if test -n "$valgrind_path"; then - echo "$as_me:$LINENO: result: $valgrind_path" >&5 -echo "${ECHO_T}$valgrind_path" >&6 + { echo "$as_me:$LINENO: result: $valgrind_path" >&5 +echo "${ECHO_T}$valgrind_path" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$valgrind_path" = "x" \ @@ -6948,13 +8497,13 @@ -# Check whether --enable-mapped-location or --disable-mapped-location was given. +# Check whether --enable-mapped-location was given. if test "${enable_mapped_location+set}" = set; then - enableval="$enable_mapped_location" - + enableval=$enable_mapped_location; else enable_mapped_location=no -fi; +fi + if test "$enable_mapped_location" = yes ; then @@ -6965,10 +8514,9 @@ fi # Enable code coverage collection -# Check whether --enable-coverage or --disable-coverage was given. +# Check whether --enable-coverage was given. if test "${enable_coverage+set}" = set; then - enableval="$enable_coverage" - case "${enableval}" in + enableval=$enable_coverage; case "${enableval}" in yes|noopt) coverage_flags="-fprofile-arcs -ftest-coverage -frandom-seed=\$@ -O0" ;; @@ -6987,16 +8535,17 @@ esac else coverage_flags="" -fi; +fi -# Check whether --enable-gather-detailed-mem-stats or --disable-gather-detailed-mem-stats was given. -if test "${enable_gather_detailed_mem_stats+set}" = set; then - enableval="$enable_gather_detailed_mem_stats" +# Check whether --enable-gather-detailed-mem-stats was given. +if test "${enable_gather_detailed_mem_stats+set}" = set; then + enableval=$enable_gather_detailed_mem_stats; else enable_gather_detailed_mem_stats=no -fi; +fi + if test x$enable_gather_detailed_mem_stats = xyes ; then cat >>confdefs.h <<\_ACEOF @@ -7011,36 +8560,35 @@ # With stabs -# Check whether --with-stabs or --without-stabs was given. +# Check whether --with-stabs was given. if test "${with_stabs+set}" = set; then - withval="$with_stabs" - stabs="$with_stabs" + withval=$with_stabs; stabs="$with_stabs" else stabs=no -fi; +fi + # Determine whether or not multilibs are enabled. -# Check whether --enable-multilib or --disable-multilib was given. +# Check whether --enable-multilib was given. if test "${enable_multilib+set}" = set; then - enableval="$enable_multilib" - + enableval=$enable_multilib; else enable_multilib=yes -fi; +fi + # Enable __cxa_atexit for C++. -# Check whether --enable-__cxa_atexit or --disable-__cxa_atexit was given. +# Check whether --enable-__cxa_atexit was given. if test "${enable___cxa_atexit+set}" = set; then - enableval="$enable___cxa_atexit" + enableval=$enable___cxa_atexit; +fi -fi; # Enable C extension for decimal float if target supports it. -# Check whether --enable-decimal-float or --disable-decimal-float was given. +# Check whether --enable-decimal-float was given. if test "${enable_decimal_float+set}" = set; then - enableval="$enable_decimal_float" - + enableval=$enable_decimal_float; if test x$enablevar = xyes ; then case $target in powerpc*-*-linux* | i?86*-*-linux*) @@ -7056,7 +8604,8 @@ else enable_decimal_float=no -fi; +fi + @@ -7070,18 +8619,17 @@ # Enable threads # Pass with no value to take the default # Pass with a value to specify a thread package -# Check whether --enable-threads or --disable-threads was given. +# Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - + enableval=$enable_threads; else enable_threads='' -fi; +fi -# Check whether --enable-tls or --disable-tls was given. -if test "${enable_tls+set}" = set; then - enableval="$enable_tls" +# Check whether --enable-tls was given. +if test "${enable_tls+set}" = set; then + enableval=$enable_tls; case $enable_tls in yes | no) ;; *) { { echo "$as_me:$LINENO: error: '$enable_tls' is an invalid value for --enable-tls. @@ -7093,33 +8641,33 @@ else enable_tls='' -fi; +fi -# Check whether --enable-objc-gc or --disable-objc-gc was given. + +# Check whether --enable-objc-gc was given. if test "${enable_objc_gc+set}" = set; then - enableval="$enable_objc_gc" - if test x$enable_objc_gc = xno; then + enableval=$enable_objc_gc; if test x$enable_objc_gc = xno; then objc_boehm_gc='' else objc_boehm_gc=1 fi else objc_boehm_gc='' -fi; +fi + -# Check whether --with-dwarf2 or --without-dwarf2 was given. +# Check whether --with-dwarf2 was given. if test "${with_dwarf2+set}" = set; then - withval="$with_dwarf2" - dwarf2="$with_dwarf2" + withval=$with_dwarf2; dwarf2="$with_dwarf2" else dwarf2=no -fi; +fi -# Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then + enableval=$enable_shared; case $enable_shared in yes | no) ;; *) @@ -7136,21 +8684,21 @@ else enable_shared=yes -fi; +fi -# Check whether --with-build-sysroot or --without-build-sysroot was given. + +# Check whether --with-build-sysroot was given. if test "${with_build_sysroot+set}" = set; then - withval="$with_build_sysroot" + withval=$with_build_sysroot; +fi -fi; -# Check whether --with-sysroot or --without-sysroot was given. +# Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then - withval="$with_sysroot" - + withval=$with_sysroot; case ${with_sysroot} in yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;; *) TARGET_SYSTEM_ROOT=$with_sysroot ;; @@ -7182,22 +8730,23 @@ TARGET_SYSTEM_ROOT_DEFINE= CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include' -fi; +fi + # Build with intermodule optimisations -# Check whether --enable-intermodule or --disable-intermodule was given. +# Check whether --enable-intermodule was given. if test "${enable_intermodule+set}" = set; then - enableval="$enable_intermodule" - case ${enable_intermodule} in + enableval=$enable_intermodule; case ${enable_intermodule} in yes) onestep="-onestep";; *) onestep="";; esac else onestep="" -fi; +fi + # LLVM LOCAL begin @@ -7208,8 +8757,8 @@ # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7222,35 +8771,37 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 -echo "${ECHO_T}$DSYMUTIL" >&6 + { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 +echo "${ECHO_T}$DSYMUTIL" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + if test -n "$DSYMUTIL"; then # Found it, now check the version. - echo "$as_me:$LINENO: checking for modern dsymutil" >&5 -echo $ECHO_N "checking for modern dsymutil... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for modern dsymutil" >&5 +echo $ECHO_N "checking for modern dsymutil... $ECHO_C" >&6; } if test "${gcc_cv_prog_dsymutil_modern+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_prog_version=`$DSYMUTIL --version 2>&1 | sed -n 's/^.*.*dwarfutils.\([0-9]*\).*$/\1/p'` - echo "configure:7253: version of dsymutil is $ac_prog_version" >&5 + echo "configure:8804: version of dsymutil is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_dsymutil_modern=no;; 2[5-9]*) @@ -7259,15 +8810,15 @@ esac fi -echo "$as_me:$LINENO: result: $gcc_cv_prog_dsymutil_modern" >&5 -echo "${ECHO_T}$gcc_cv_prog_dsymutil_modern" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_prog_dsymutil_modern" >&5 +echo "${ECHO_T}$gcc_cv_prog_dsymutil_modern" >&6; } else gcc_cv_prog_dsymutil_modern=no fi if test $gcc_cv_prog_dsymutil_modern = no; then - echo "$as_me:$LINENO: result: dsymutil is not available" >&5 -echo "${ECHO_T}dsymutil is not available" >&6 + { echo "$as_me:$LINENO: result: dsymutil is not available" >&5 +echo "${ECHO_T}dsymutil is not available" >&6; } else cat >>confdefs.h <<\_ACEOF @@ -7279,8 +8830,8 @@ # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7293,35 +8844,37 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 -echo "${ECHO_T}$DSYMUTIL" >&6 + { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 +echo "${ECHO_T}$DSYMUTIL" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + if test -n "$DSYMUTIL"; then # Found it, now check the version. - echo "$as_me:$LINENO: checking for modern dsymutil" >&5 -echo $ECHO_N "checking for modern dsymutil... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for modern dsymutil" >&5 +echo $ECHO_N "checking for modern dsymutil... $ECHO_C" >&6; } if test "${gcc_cv_prog_dsymutil_modern+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_prog_version=`$DSYMUTIL --version 2>&1 | sed -n 's/^.*.*dwarfutils.\([0-9]*\).*$/\1/p'` - echo "configure:7324: version of dsymutil is $ac_prog_version" >&5 + echo "configure:8877: version of dsymutil is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_dsymutil_modern=no;; [3-9][0-9]*) @@ -7330,15 +8883,15 @@ esac fi -echo "$as_me:$LINENO: result: $gcc_cv_prog_dsymutil_modern" >&5 -echo "${ECHO_T}$gcc_cv_prog_dsymutil_modern" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_prog_dsymutil_modern" >&5 +echo "${ECHO_T}$gcc_cv_prog_dsymutil_modern" >&6; } else gcc_cv_prog_dsymutil_modern=no fi if test $gcc_cv_prog_dsymutil_modern = no; then - echo "$as_me:$LINENO: result: dsymutil is not available" >&5 -echo "${ECHO_T}dsymutil is not available" >&6 + { echo "$as_me:$LINENO: result: dsymutil is not available" >&5 +echo "${ECHO_T}dsymutil is not available" >&6; } else cat >>confdefs.h <<\_ACEOF @@ -7347,10 +8900,9 @@ fi -# Check whether --enable-llvm or --disable-llvm was given. +# Check whether --enable-llvm was given. if test "${enable_llvm+set}" = set; then - enableval="$enable_llvm" - case "${enableval}" in + enableval=$enable_llvm; case "${enableval}" in yes) { { echo "$as_me:$LINENO: error: You must specify a path to your LLVM tree with --enable-llvm=DIR" >&5 echo "$as_me: error: You must specify a path to your LLVM tree with --enable-llvm=DIR" >&2;} { (exit 1); exit 1; }; } @@ -7403,7 +8955,8 @@ LLVMBASEPATH="" LLVMBUILDMODE="" -fi; +fi + # Send llvm build mode to gcc Makefiles @@ -7411,10 +8964,9 @@ # Sanity check enable_languages in case someone does not run the toplevel # configure # script. -# Check whether --enable-languages or --disable-languages was given. +# Check whether --enable-languages was given. if test "${enable_languages+set}" = set; then - enableval="$enable_languages" - case ,${enable_languages}, in + enableval=$enable_languages; case ,${enable_languages}, in ,,|,yes,) # go safe -- we cannot be much sure without the toplevel # configure's @@ -7434,7 +8986,8 @@ esac else enable_languages=c -fi; +fi + # Used by documentation targets @@ -7445,32 +8998,33 @@ # Checks for other programs # ------------------------- -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -7480,8 +9034,8 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7494,25 +9048,27 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AWK" && break done @@ -7524,8 +9080,8 @@ { (exit 1); exit 1; }; } ;; esac -echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } if test "${gcc_cv_prog_LN_S+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7552,20 +9108,20 @@ fi LN_S="$gcc_cv_prog_LN_S" if test "$gcc_cv_prog_LN_S" = "ln -s"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else if test "$gcc_cv_prog_LN_S" = "ln"; then - echo "$as_me:$LINENO: result: no, using ln" >&5 -echo "${ECHO_T}no, using ln" >&6 + { echo "$as_me:$LINENO: result: no, using ln" >&5 +echo "${ECHO_T}no, using ln" >&6; } else - echo "$as_me:$LINENO: result: no, and neither does ln, so using $gcc_cv_prog_LN_S" >&5 -echo "${ECHO_T}no, and neither does ln, so using $gcc_cv_prog_LN_S" >&6 + { echo "$as_me:$LINENO: result: no, and neither does ln, so using $gcc_cv_prog_LN_S" >&5 +echo "${ECHO_T}no, and neither does ln, so using $gcc_cv_prog_LN_S" >&6; } fi fi -echo "$as_me:$LINENO: checking whether ln works" >&5 -echo $ECHO_N "checking whether ln works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ln works" >&5 +echo $ECHO_N "checking whether ln works... $ECHO_C" >&6; } if test "${acx_cv_prog_LN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7582,19 +9138,19 @@ fi if test $acx_cv_prog_LN = no; then LN="$LN_S" - echo "$as_me:$LINENO: result: no, using $LN" >&5 -echo "${ECHO_T}no, using $LN" >&6 + { echo "$as_me:$LINENO: result: no, using $LN" >&5 +echo "${ECHO_T}no, using $LN" >&6; } else LN="$acx_cv_prog_LN" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7607,32 +9163,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7645,27 +9203,41 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi @@ -7693,8 +9265,8 @@ # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD compatible install" >&5 -echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD compatible install" >&5 +echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7735,8 +9307,8 @@ INSTALL="$ac_install_sh" fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -7750,18 +9322,19 @@ for ac_header in mach/mach_time.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7772,24 +9345,36 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7798,15 +9383,16 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7815,8 +9401,13 @@ /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -7840,9 +9431,10 @@ ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -7866,25 +9458,19 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -7899,8 +9485,8 @@ # APPLE LOCAL end Mach time # See if cmp has --ignore-initial. -echo "$as_me:$LINENO: checking for cmp's capabilities" >&5 -echo $ECHO_N "checking for cmp's capabilities... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for cmp's capabilities" >&5 +echo $ECHO_N "checking for cmp's capabilities... $ECHO_C" >&6; } if test "${gcc_cv_prog_cmp_skip+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7926,8 +9512,8 @@ rm t1 t2 fi -echo "$as_me:$LINENO: result: $gcc_cv_prog_cmp_skip" >&5 -echo "${ECHO_T}$gcc_cv_prog_cmp_skip" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_prog_cmp_skip" >&5 +echo "${ECHO_T}$gcc_cv_prog_cmp_skip" >&6; } make_compare_target=$gcc_cv_prog_cmp_skip @@ -7935,8 +9521,8 @@ # See if we have the mktemp command. # Extract the first word of "mktemp", so it can be a program name with args. set dummy mktemp; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_have_mktemp_command+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7949,36 +9535,39 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_have_mktemp_command="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_prog_have_mktemp_command" && ac_cv_prog_have_mktemp_command="no" fi fi have_mktemp_command=$ac_cv_prog_have_mktemp_command if test -n "$have_mktemp_command"; then - echo "$as_me:$LINENO: result: $have_mktemp_command" >&5 -echo "${ECHO_T}$have_mktemp_command" >&6 + { echo "$as_me:$LINENO: result: $have_mktemp_command" >&5 +echo "${ECHO_T}$have_mktemp_command" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + MISSING="${CONFIG_SHELL-/bin/sh} $srcdir/../missing" # See if makeinfo has been installed and is modern enough # that we can use it. +# LLVM LOCAL begin Recognize more recent versions of makeinfo. # Extract the first word of "makeinfo", so it can be a program name with args. set dummy makeinfo; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_MAKEINFO+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7991,35 +9580,37 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MAKEINFO="makeinfo" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi MAKEINFO=$ac_cv_prog_MAKEINFO if test -n "$MAKEINFO"; then - echo "$as_me:$LINENO: result: $MAKEINFO" >&5 -echo "${ECHO_T}$MAKEINFO" >&6 + { echo "$as_me:$LINENO: result: $MAKEINFO" >&5 +echo "${ECHO_T}$MAKEINFO" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + if test -n "$MAKEINFO"; then # Found it, now check the version. - echo "$as_me:$LINENO: checking for modern makeinfo" >&5 -echo $ECHO_N "checking for modern makeinfo... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for modern makeinfo" >&5 +echo $ECHO_N "checking for modern makeinfo... $ECHO_C" >&6; } if test "${gcc_cv_prog_makeinfo_modern+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'` - echo "configure:8022: version of makeinfo is $ac_prog_version" >&5 + echo "configure:9613: version of makeinfo is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_makeinfo_modern=no;; 4.[4-9]* | 4.1[0-9]*) @@ -8028,12 +9619,13 @@ esac fi -echo "$as_me:$LINENO: result: $gcc_cv_prog_makeinfo_modern" >&5 -echo "${ECHO_T}$gcc_cv_prog_makeinfo_modern" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_prog_makeinfo_modern" >&5 +echo "${ECHO_T}$gcc_cv_prog_makeinfo_modern" >&6; } else gcc_cv_prog_makeinfo_modern=no fi +# LLVM LOCAL end Recognize more recent versions of makeinfo. if test $gcc_cv_prog_makeinfo_modern = no; then MAKEINFO="$MISSING makeinfo" { echo "$as_me:$LINENO: WARNING: @@ -8049,15 +9641,15 @@ # Is pod2man recent enough to regenerate manpages? -echo "$as_me:$LINENO: checking for recent Pod::Man" >&5 -echo $ECHO_N "checking for recent Pod::Man... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for recent Pod::Man" >&5 +echo $ECHO_N "checking for recent Pod::Man... $ECHO_C" >&6; } if (perl -e 'use 1.10 Pod::Man') >/dev/null 2>&1; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } GENERATED_MANPAGES=generated-manpages else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } GENERATED_MANPAGES= fi @@ -8067,8 +9659,8 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_FLEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8081,25 +9673,27 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_FLEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi FLEX=$ac_cv_prog_FLEX if test -n "$FLEX"; then - echo "$as_me:$LINENO: result: $FLEX" >&5 -echo "${ECHO_T}$FLEX" >&6 + { echo "$as_me:$LINENO: result: $FLEX" >&5 +echo "${ECHO_T}$FLEX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$FLEX" && break done test -n "$FLEX" || FLEX="$MISSING flex" @@ -8110,8 +9704,8 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_BISON+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8124,25 +9718,27 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_BISON="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi BISON=$ac_cv_prog_BISON if test -n "$BISON"; then - echo "$as_me:$LINENO: result: $BISON" >&5 -echo "${ECHO_T}$BISON" >&6 + { echo "$as_me:$LINENO: result: $BISON" >&5 +echo "${ECHO_T}$BISON" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$BISON" && break done test -n "$BISON" || BISON="$MISSING bison" @@ -8158,8 +9754,8 @@ else # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8172,26 +9768,28 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_prog_NM" && ac_cv_prog_NM="${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing nm" fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6 + { echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi # AR @@ -8201,8 +9799,8 @@ else # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8215,26 +9813,28 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing ar" fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi @@ -8242,8 +9842,8 @@ # Checks for C headers # -------------------- -echo "$as_me:$LINENO: checking for GNU C library" >&5 -echo $ECHO_N "checking for GNU C library... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for GNU C library" >&5 +echo $ECHO_N "checking for GNU C library... $ECHO_C" >&6; } if test "${gcc_cv_glibc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8266,24 +9866,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8292,13 +9904,14 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gcc_cv_glibc=no + gcc_cv_glibc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gcc_cv_glibc" >&5 -echo "${ECHO_T}$gcc_cv_glibc" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_glibc" >&5 +echo "${ECHO_T}$gcc_cv_glibc" >&6; } if test $gcc_cv_glibc = yes; then cat >>confdefs.h <<\_ACEOF @@ -8312,8 +9925,8 @@ ac_c_preproc_warn_flag=yes -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8337,24 +9950,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8363,9 +9988,10 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -8421,6 +10047,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -8440,18 +10067,27 @@ for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8464,12 +10100,14 @@ ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -8478,8 +10116,8 @@ fi -echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8503,24 +10141,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8529,12 +10179,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_time=no + ac_cv_header_time=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @@ -8543,8 +10194,8 @@ fi -echo "$as_me:$LINENO: checking whether string.h and strings.h may both be included" >&5 -echo $ECHO_N "checking whether string.h and strings.h may both be included... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether string.h and strings.h may both be included" >&5 +echo $ECHO_N "checking whether string.h and strings.h may both be included... $ECHO_C" >&6; } if test "${gcc_cv_header_string+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8565,24 +10216,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8591,12 +10254,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gcc_cv_header_string=no + gcc_cv_header_string=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gcc_cv_header_string" >&5 -echo "${ECHO_T}$gcc_cv_header_string" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_header_string" >&5 +echo "${ECHO_T}$gcc_cv_header_string" >&6; } if test $gcc_cv_header_string = yes; then cat >>confdefs.h <<\_ACEOF @@ -8605,8 +10269,8 @@ fi -echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 -echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; } if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8619,7 +10283,7 @@ #include #include #ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) @@ -8636,24 +10300,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8662,12 +10338,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_sys_wait_h=no + ac_cv_header_sys_wait_h=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF @@ -8704,9 +10381,9 @@ direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -8717,8 +10394,13 @@ /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -8742,10 +10424,12 @@ eval "$as_ac_Header=no" fi + rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -8756,8 +10440,8 @@ # Check for thread headers. -echo "$as_me:$LINENO: checking for thread.h" >&5 -echo $ECHO_N "checking for thread.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for thread.h" >&5 +echo $ECHO_N "checking for thread.h... $ECHO_C" >&6; } if test "${ac_cv_header_thread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8769,8 +10453,13 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -8794,18 +10483,19 @@ ac_cv_header_thread_h=no fi + rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_thread_h" >&5 -echo "${ECHO_T}$ac_cv_header_thread_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_thread_h" >&5 +echo "${ECHO_T}$ac_cv_header_thread_h" >&6; } if test $ac_cv_header_thread_h = yes; then have_thread_h=yes else have_thread_h= fi -echo "$as_me:$LINENO: checking for pthread.h" >&5 -echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8817,8 +10507,13 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -8842,10 +10537,11 @@ ac_cv_header_pthread_h=no fi + rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } if test $ac_cv_header_pthread_h = yes; then have_pthread_h=yes else @@ -8854,8 +10550,8 @@ # These tests can't be done till we know if we have limits.h. -echo "$as_me:$LINENO: checking for CHAR_BIT" >&5 -echo $ECHO_N "checking for CHAR_BIT... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for CHAR_BIT" >&5 +echo $ECHO_N "checking for CHAR_BIT... $ECHO_C" >&6; } if test "${gcc_cv_decl_char_bit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8882,11 +10578,11 @@ fi -echo "$as_me:$LINENO: result: $gcc_cv_decl_char_bit" >&5 -echo "${ECHO_T}$gcc_cv_decl_char_bit" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_decl_char_bit" >&5 +echo "${ECHO_T}$gcc_cv_decl_char_bit" >&6; } if test $gcc_cv_decl_char_bit = no; then - echo "$as_me:$LINENO: checking number of bits in a byte" >&5 -echo $ECHO_N "checking number of bits in a byte... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking number of bits in a byte" >&5 +echo $ECHO_N "checking number of bits in a byte... $ECHO_C" >&6; } if test "${gcc_cv_c_nbby+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8912,24 +10608,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8938,15 +10646,17 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext i=`expr $i + 1` done test -z "$gcc_cv_c_nbby" && gcc_cv_c_nbby=failed fi -echo "$as_me:$LINENO: result: $gcc_cv_c_nbby" >&5 -echo "${ECHO_T}$gcc_cv_c_nbby" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_c_nbby" >&5 +echo "${ECHO_T}$gcc_cv_c_nbby" >&6; } if test $gcc_cv_c_nbby = failed; then { { echo "$as_me:$LINENO: error: cannot determine number of bits in a byte" >&5 echo "$as_me: error: cannot determine number of bits in a byte" >&2;} @@ -8959,8 +10669,8 @@ fi fi -echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8986,24 +10696,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9029,24 +10751,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9055,14 +10789,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_bigendian=no + ac_cv_c_bigendian=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -# It does not; compile a test program. + # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown @@ -9072,11 +10807,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () @@ -9087,24 +10822,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9123,8 +10870,10 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9132,27 +10881,41 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default int main () { + /* Are we little or big endian? From Harbison&Steele. */ union { - long l; - char c[sizeof (long)]; + long int l; + char c[sizeof (long int)]; } u; u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9165,13 +10928,16 @@ ( exit $ac_status ) ac_cv_c_bigendian=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in yes) @@ -9210,8 +10976,8 @@ # These libraries may be used by collect2. # We may need a special search path to get them linked. -echo "$as_me:$LINENO: checking for collect2 libraries" >&5 -echo $ECHO_N "checking for collect2 libraries... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for collect2 libraries" >&5 +echo $ECHO_N "checking for collect2 libraries... $ECHO_C" >&6; } if test "${gcc_cv_collect2_libs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9228,40 +10994,52 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char ldopen (); int main () { -ldopen (); +return ldopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9270,15 +11048,17 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done LIBS="$save_LIBS" test -z "$gcc_cv_collect2_libs" && gcc_cv_collect2_libs='none required' fi -echo "$as_me:$LINENO: result: $gcc_cv_collect2_libs" >&5 -echo "${ECHO_T}$gcc_cv_collect2_libs" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_collect2_libs" >&5 +echo "${ECHO_T}$gcc_cv_collect2_libs" >&6; } case $gcc_cv_collect2_libs in "none required") ;; *) COLLECT2_LIBS=$gcc_cv_collect2_libs ;; @@ -9289,13 +11069,12 @@ # -lexc. So test for it. save_LIBS="$LIBS" LIBS= -echo "$as_me:$LINENO: checking for library containing exc_resume" >&5 -echo $ECHO_N "checking for library containing exc_resume... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for library containing exc_resume" >&5 +echo $ECHO_N "checking for library containing exc_resume... $ECHO_C" >&6; } if test "${ac_cv_search_exc_resume+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_exc_resume=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9303,313 +11082,273 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char exc_resume (); int main () { -exc_resume (); +return exc_resume (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +for ac_lib in '' exc; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_exc_resume="none required" + ac_cv_search_exc_resume=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_exc_resume" = no; then - for ac_lib in exc; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_exc_resume+set}" = set; then + break +fi +done +if test "${ac_cv_search_exc_resume+set}" = set; then + : +else + ac_cv_search_exc_resume=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_exc_resume" >&5 +echo "${ECHO_T}$ac_cv_search_exc_resume" >&6; } +ac_res=$ac_cv_search_exc_resume +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +GNAT_LIBEXC="$LIBS" +LIBS="$save_LIBS" + + +# Some systems put ldexp and frexp in libm instead of libc; assume +# they're both in the same place. jcf-dump needs them. +save_LIBS="$LIBS" +LIBS= +{ echo "$as_me:$LINENO: checking for library containing ldexp" >&5 +echo $ECHO_N "checking for library containing ldexp... $ECHO_C" >&6; } +if test "${ac_cv_search_ldexp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char exc_resume (); +char ldexp (); int main () { -exc_resume (); +return ldexp (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_exc_resume="-l$ac_lib" -break + ac_cv_search_ldexp=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_ldexp+set}" = set; then + break +fi +done +if test "${ac_cv_search_ldexp+set}" = set; then + : +else + ac_cv_search_ldexp=no fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_exc_resume" >&5 -echo "${ECHO_T}$ac_cv_search_exc_resume" >&6 -if test "$ac_cv_search_exc_resume" != no; then - test "$ac_cv_search_exc_resume" = "none required" || LIBS="$ac_cv_search_exc_resume $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_ldexp" >&5 +echo "${ECHO_T}$ac_cv_search_ldexp" >&6; } +ac_res=$ac_cv_search_ldexp +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -GNAT_LIBEXC="$LIBS" +LDEXP_LIB="$LIBS" LIBS="$save_LIBS" -# Some systems put ldexp and frexp in libm instead of libc; assume -# they're both in the same place. jcf-dump needs them. -save_LIBS="$LIBS" -LIBS= -echo "$as_me:$LINENO: checking for library containing ldexp" >&5 -echo $ECHO_N "checking for library containing ldexp... $ECHO_C" >&6 -if test "${ac_cv_search_ldexp+set}" = set; then +# Use only if it exists, +# doesn't clash with , and declares intmax_t. +{ echo "$as_me:$LINENO: checking for inttypes.h" >&5 +echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } +if test "${gcc_cv_header_inttypes_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_ldexp=no -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char ldexp (); +#include +#include int main () { -ldexp (); +intmax_t i = -1; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_ldexp="none required" + gcc_cv_header_inttypes_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + gcc_cv_header_inttypes_h=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_ldexp" = no; then - for ac_lib in m; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char ldexp (); -int -main () -{ -ldexp (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_ldexp="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done -fi -LIBS=$ac_func_search_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_search_ldexp" >&5 -echo "${ECHO_T}$ac_cv_search_ldexp" >&6 -if test "$ac_cv_search_ldexp" != no; then - test "$ac_cv_search_ldexp" = "none required" || LIBS="$ac_cv_search_ldexp $LIBS" - -fi - -LDEXP_LIB="$LIBS" -LIBS="$save_LIBS" - - -# Use only if it exists, -# doesn't clash with , and declares intmax_t. -echo "$as_me:$LINENO: checking for inttypes.h" >&5 -echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 -if test "${gcc_cv_header_inttypes_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ -intmax_t i = -1; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gcc_cv_header_inttypes_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -gcc_cv_header_inttypes_h=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gcc_cv_header_inttypes_h" >&5 -echo "${ECHO_T}$gcc_cv_header_inttypes_h" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_header_inttypes_h" >&5 +echo "${ECHO_T}$gcc_cv_header_inttypes_h" >&6; } if test $gcc_cv_header_inttypes_h = yes; then cat >>confdefs.h <<\_ACEOF @@ -9661,9 +11400,9 @@ clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -9689,53 +11428,59 @@ #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9744,13 +11489,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -9761,8 +11508,8 @@ if test x$ac_cv_func_mbstowcs = xyes; then - echo "$as_me:$LINENO: checking whether mbstowcs works" >&5 -echo $ECHO_N "checking whether mbstowcs works... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether mbstowcs works" >&5 +echo $ECHO_N "checking whether mbstowcs works... $ECHO_C" >&6; } if test "${gcc_cv_func_mbstowcs_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9783,13 +11530,22 @@ } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9802,11 +11558,13 @@ ( exit $ac_status ) gcc_cv_func_mbstowcs_works=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $gcc_cv_func_mbstowcs_works" >&5 -echo "${ECHO_T}$gcc_cv_func_mbstowcs_works" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_func_mbstowcs_works" >&5 +echo "${ECHO_T}$gcc_cv_func_mbstowcs_works" >&6; } if test x$gcc_cv_func_mbstowcs_works = xyes; then cat >>confdefs.h <<\_ACEOF @@ -9816,8 +11574,8 @@ fi fi -echo "$as_me:$LINENO: checking for ssize_t" >&5 -echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ssize_t" >&5 +echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } if test "${ac_cv_type_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9828,36 +11586,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef ssize_t ac__type_new_; int main () { -if ((ssize_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (ssize_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9866,12 +11637,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_ssize_t=no + ac_cv_type_ssize_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 -echo "${ECHO_T}$ac_cv_type_ssize_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 +echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; } if test $ac_cv_type_ssize_t = yes; then : else @@ -9885,8 +11657,8 @@ # Try to determine the array type of the second argument of getgroups # for the target system (int or gid_t). -echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 -echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9908,8 +11680,8 @@ rm -f conftest* fi -echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 -echo "${ECHO_T}$ac_cv_type_uid_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF @@ -9923,8 +11695,8 @@ fi -echo "$as_me:$LINENO: checking type of array argument to getgroups" >&5 -echo $ECHO_N "checking type of array argument to getgroups... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking type of array argument to getgroups" >&5 +echo $ECHO_N "checking type of array argument to getgroups... $ECHO_C" >&6; } if test "${ac_cv_type_getgroups+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9938,7 +11710,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Thanks to Mike Rendell for this test. */ -#include +$ac_includes_default #define NGID 256 #undef MAX #define MAX(x, y) ((x) > (y) ? (x) : (y)) @@ -9948,7 +11720,7 @@ { gid_t gidset[NGID]; int i, n; - union { gid_t gval; long lval; } val; + union { gid_t gval; long int lval; } val; val.lval = -1; for (i = 0; i < NGID; i++) @@ -9956,18 +11728,28 @@ n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, gidset); /* Exit non-zero if getgroups seems to require an array of ints. This - happens when gid_t is short but getgroups modifies an array of ints. */ - exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0); + happens when gid_t is short int but getgroups modifies an array + of ints. */ + return n > 0 && gidset[n] != val.gval; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9980,8 +11762,10 @@ ( exit $ac_status ) ac_cv_type_getgroups=int fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + if test $ac_cv_type_getgroups = cross; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -10002,8 +11786,8 @@ fi fi -echo "$as_me:$LINENO: result: $ac_cv_type_getgroups" >&5 -echo "${ECHO_T}$ac_cv_type_getgroups" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_getgroups" >&5 +echo "${ECHO_T}$ac_cv_type_getgroups" >&6; } cat >>confdefs.h <<_ACEOF #define GETGROUPS_T $ac_cv_type_getgroups @@ -10028,8 +11812,8 @@ -echo "$as_me:$LINENO: checking for sys/mman.h" >&5 -echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for sys/mman.h" >&5 +echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mman_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10041,8 +11825,13 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -10066,18 +11855,19 @@ ac_cv_header_sys_mman_h=no fi + rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6; } if test $ac_cv_header_sys_mman_h = yes; then gcc_header_sys_mman_h=yes else gcc_header_sys_mman_h=no fi -echo "$as_me:$LINENO: checking for mmap" >&5 -echo $ECHO_N "checking for mmap... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for mmap" >&5 +echo $ECHO_N "checking for mmap... $ECHO_C" >&6; } if test "${ac_cv_func_mmap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10104,53 +11894,59 @@ #undef mmap -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char mmap (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_mmap) || defined (__stub___mmap) +#if defined __stub_mmap || defined __stub___mmap choke me -#else -char (*f) () = mmap; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != mmap; +return mmap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -10159,13 +11955,14 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_mmap=no + ac_cv_func_mmap=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_mmap" >&5 -echo "${ECHO_T}$ac_cv_func_mmap" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap" >&5 +echo "${ECHO_T}$ac_cv_func_mmap" >&6; } if test $ac_cv_func_mmap = yes; then gcc_func_mmap=yes else @@ -10178,8 +11975,8 @@ gcc_cv_func_mmap_dev_zero=no gcc_cv_func_mmap_anon=no else - echo "$as_me:$LINENO: checking whether read-only mmap of a plain file works" >&5 -echo $ECHO_N "checking whether read-only mmap of a plain file works... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether read-only mmap of a plain file works" >&5 +echo $ECHO_N "checking whether read-only mmap of a plain file works... $ECHO_C" >&6; } if test "${gcc_cv_func_mmap_file+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10195,10 +11992,10 @@ gcc_cv_func_mmap_file=yes;; esac fi -echo "$as_me:$LINENO: result: $gcc_cv_func_mmap_file" >&5 -echo "${ECHO_T}$gcc_cv_func_mmap_file" >&6 - echo "$as_me:$LINENO: checking whether mmap from /dev/zero works" >&5 -echo $ECHO_N "checking whether mmap from /dev/zero works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_func_mmap_file" >&5 +echo "${ECHO_T}$gcc_cv_func_mmap_file" >&6; } + { echo "$as_me:$LINENO: checking whether mmap from /dev/zero works" >&5 +echo $ECHO_N "checking whether mmap from /dev/zero works... $ECHO_C" >&6; } if test "${gcc_cv_func_mmap_dev_zero+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10219,12 +12016,12 @@ gcc_cv_func_mmap_dev_zero=yes;; esac fi -echo "$as_me:$LINENO: result: $gcc_cv_func_mmap_dev_zero" >&5 -echo "${ECHO_T}$gcc_cv_func_mmap_dev_zero" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_func_mmap_dev_zero" >&5 +echo "${ECHO_T}$gcc_cv_func_mmap_dev_zero" >&6; } # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for. - echo "$as_me:$LINENO: checking for MAP_ANON(YMOUS)" >&5 -echo $ECHO_N "checking for MAP_ANON(YMOUS)... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for MAP_ANON(YMOUS)" >&5 +echo $ECHO_N "checking for MAP_ANON(YMOUS)... $ECHO_C" >&6; } if test "${gcc_cv_decl_map_anon+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10251,24 +12048,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -10277,18 +12086,19 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gcc_cv_decl_map_anon=no + gcc_cv_decl_map_anon=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gcc_cv_decl_map_anon" >&5 -echo "${ECHO_T}$gcc_cv_decl_map_anon" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_decl_map_anon" >&5 +echo "${ECHO_T}$gcc_cv_decl_map_anon" >&6; } if test $gcc_cv_decl_map_anon = no; then gcc_cv_func_mmap_anon=no else - echo "$as_me:$LINENO: checking whether mmap with MAP_ANON(YMOUS) works" >&5 -echo $ECHO_N "checking whether mmap with MAP_ANON(YMOUS) works... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether mmap with MAP_ANON(YMOUS) works" >&5 +echo $ECHO_N "checking whether mmap with MAP_ANON(YMOUS) works... $ECHO_C" >&6; } if test "${gcc_cv_func_mmap_anon+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10304,8 +12114,8 @@ gcc_cv_func_mmap_anon=yes;; esac fi -echo "$as_me:$LINENO: result: $gcc_cv_func_mmap_anon" >&5 -echo "${ECHO_T}$gcc_cv_func_mmap_anon" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_func_mmap_anon" >&5 +echo "${ECHO_T}$gcc_cv_func_mmap_anon" >&6; } fi fi @@ -10340,8 +12150,8 @@ ac_cv_func_vfork_works=yes ;; esac -echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10352,36 +12162,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef pid_t ac__type_new_; int main () { -if ((pid_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (pid_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -10390,12 +12213,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_pid_t=no + ac_cv_type_pid_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } if test $ac_cv_type_pid_t = yes; then : else @@ -10407,13 +12231,12 @@ fi - -for ac_header in unistd.h vfork.h +for ac_header in vfork.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -10424,8 +12247,13 @@ /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -10449,10 +12277,12 @@ eval "$as_ac_Header=no" fi + rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -10466,9 +12296,9 @@ for ac_func in fork vfork do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -10494,53 +12324,59 @@ #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -10549,13 +12385,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -10565,8 +12403,8 @@ done if test "x$ac_cv_func_fork" = xyes; then - echo "$as_me:$LINENO: checking for working fork" >&5 -echo $ECHO_N "checking for working fork... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for working fork" >&5 +echo $ECHO_N "checking for working fork... $ECHO_C" >&6; } if test "${ac_cv_func_fork_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10574,27 +12412,40 @@ ac_cv_func_fork_works=cross else cat >conftest.$ac_ext <<_ACEOF -/* By Ruediger Kuhlmann. */ - #include - #if HAVE_UNISTD_H - # include - #endif - /* Some systems only have a dummy stub for fork() */ - int main () - { - if (fork() < 0) - exit (1); - exit (0); - } +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* By Ruediger Kuhlmann. */ + return fork () < 0; + + ; + return 0; +} _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -10607,11 +12458,13 @@ ( exit $ac_status ) ac_cv_func_fork_works=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 -echo "${ECHO_T}$ac_cv_func_fork_works" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 +echo "${ECHO_T}$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork @@ -10631,8 +12484,8 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then - echo "$as_me:$LINENO: checking for working vfork" >&5 -echo $ECHO_N "checking for working vfork... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for working vfork" >&5 +echo $ECHO_N "checking for working vfork... $ECHO_C" >&6; } if test "${ac_cv_func_vfork_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10646,14 +12499,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ -#include -#include -#include -#include +$ac_includes_default #include -#if HAVE_UNISTD_H -# include -#endif #if HAVE_VFORK_H # include #endif @@ -10725,7 +12572,7 @@ while (wait(&status) != child) ; - exit( + return ( /* Was there some problem with vforking? */ child < 0 @@ -10742,13 +12589,22 @@ } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -10761,11 +12617,13 @@ ( exit $ac_status ) ac_cv_func_vfork_works=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 -echo "${ECHO_T}$ac_cv_func_vfork_works" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 +echo "${ECHO_T}$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then @@ -10813,13 +12671,13 @@ prefix="$acl_save_prefix" -# Check whether --with-gnu-ld or --without-gnu-ld was given. +# Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no -fi; +fi + # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then @@ -10836,8 +12694,8 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by GCC" >&5 -echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -10866,11 +12724,11 @@ ;; esac elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${acl_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10899,17 +12757,17 @@ LD="$acl_cv_path_LD" if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 + { echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10920,14 +12778,14 @@ acl_cv_prog_gnu_ld=no fi fi -echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6 +{ echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld - echo "$as_me:$LINENO: checking for shared library run path origin" >&5 -echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for shared library run path origin" >&5 +echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6; } if test "${acl_cv_rpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -10939,8 +12797,8 @@ acl_cv_rpath=done fi -echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 -echo "${ECHO_T}$acl_cv_rpath" >&6 +{ echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +echo "${ECHO_T}$acl_cv_rpath" >&6; } wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" @@ -10948,13 +12806,13 @@ hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" - # Check whether --enable-rpath or --disable-rpath was given. + # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then - enableval="$enable_rpath" - : + enableval=$enable_rpath; : else enable_rpath=yes -fi; +fi + @@ -10976,10 +12834,9 @@ prefix="$acl_save_prefix" -# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. +# Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then - withval="$with_libiconv_prefix" - + withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else @@ -11002,7 +12859,8 @@ fi fi -fi; +fi + LIBICONV= LTLIBICONV= INCICONV= @@ -11369,8 +13227,8 @@ done - echo "$as_me:$LINENO: checking for iconv" >&5 -echo $ECHO_N "checking for iconv... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for iconv" >&5 +echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -11396,24 +13254,36 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -11422,8 +13292,10 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" @@ -11447,24 +13319,36 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -11474,15 +13358,17 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi -echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 -echo "${ECHO_T}$am_cv_func_iconv" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +echo "${ECHO_T}$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF @@ -11491,10 +13377,10 @@ fi if test "$am_cv_lib_iconv" = yes; then - echo "$as_me:$LINENO: checking how to link with libiconv" >&5 -echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $LIBICONV" >&5 -echo "${ECHO_T}$LIBICONV" >&6 + { echo "$as_me:$LINENO: checking how to link with libiconv" >&5 +echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; } + { echo "$as_me:$LINENO: result: $LIBICONV" >&5 +echo "${ECHO_T}$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= @@ -11504,8 +13390,8 @@ if test "$am_cv_func_iconv" = yes; then - echo "$as_me:$LINENO: checking for iconv declaration" >&5 -echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for iconv declaration" >&5 +echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6; } if test "${am_cv_proto_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -11538,24 +13424,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -11564,17 +13462,18 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -am_cv_proto_iconv_arg1="const" + am_cv_proto_iconv_arg1="const" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - echo "$as_me:$LINENO: result: ${ac_t:- + { echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 echo "${ECHO_T}${ac_t:- - }$am_cv_proto_iconv" >&6 + }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 @@ -11587,8 +13486,8 @@ - echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 -echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 +echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6; } if test "${am_cv_val_LC_MESSAGES+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -11608,24 +13507,36 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -11634,13 +13545,14 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -am_cv_val_LC_MESSAGES=no + am_cv_val_LC_MESSAGES=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 -echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 +echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6; } if test $am_cv_val_LC_MESSAGES = yes; then cat >>confdefs.h <<\_ACEOF @@ -11651,8 +13563,8 @@ - echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 -echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 +echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6; } if test "${am_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -11672,24 +13584,36 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -11698,14 +13622,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -am_cv_langinfo_codeset=no + am_cv_langinfo_codeset=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 -echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 +echo "${ECHO_T}$am_cv_langinfo_codeset" >&6; } if test $am_cv_langinfo_codeset = yes; then cat >>confdefs.h <<\_ACEOF @@ -11763,9 +13688,9 @@ free basename getopt clock getpagesize clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked do ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp` -echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 -echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6 -if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 +echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6; } +if { as_var=gcc_cv_have_decl_$ac_func; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -11791,24 +13716,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -11817,20 +13754,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "gcc_cv_have_decl_$ac_func=no" + eval "gcc_cv_have_decl_$ac_func=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 ; cat >>confdefs.h <<_ACEOF + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } ; cat >>confdefs.h <<_ACEOF #define $ac_tr_decl 1 _ACEOF else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 ; cat >>confdefs.h <<_ACEOF + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ; cat >>confdefs.h <<_ACEOF #define $ac_tr_decl 0 _ACEOF @@ -11845,9 +13783,9 @@ for ac_func in getrlimit setrlimit getrusage do ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp` -echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 -echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6 -if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 +echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6; } +if { as_var=gcc_cv_have_decl_$ac_func; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -11877,24 +13815,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -11903,20 +13853,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "gcc_cv_have_decl_$ac_func=no" + eval "gcc_cv_have_decl_$ac_func=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 ; cat >>confdefs.h <<_ACEOF + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } ; cat >>confdefs.h <<_ACEOF #define $ac_tr_decl 1 _ACEOF else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 ; cat >>confdefs.h <<_ACEOF + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ; cat >>confdefs.h <<_ACEOF #define $ac_tr_decl 0 _ACEOF @@ -11947,24 +13898,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -11979,7 +13942,8 @@ _ACEOF fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # On AIX 5.2, conflicts with , as both define incompatible # FREAD and FWRITE macros. Fortunately, for GCC's single usage of ldgetname @@ -11989,9 +13953,9 @@ for ac_func in ldgetname do ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp` -echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 -echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6 -if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 +echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6; } +if { as_var=gcc_cv_have_decl_$ac_func; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12023,24 +13987,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -12049,20 +14025,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "gcc_cv_have_decl_$ac_func=no" + eval "gcc_cv_have_decl_$ac_func=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 ; cat >>confdefs.h <<_ACEOF + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } ; cat >>confdefs.h <<_ACEOF #define $ac_tr_decl 1 _ACEOF else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 ; cat >>confdefs.h <<_ACEOF + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ; cat >>confdefs.h <<_ACEOF #define $ac_tr_decl 0 _ACEOF @@ -12075,9 +14052,9 @@ for ac_func in times do ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp` -echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 -echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6 -if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 +echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6; } +if { as_var=gcc_cv_have_decl_$ac_func; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12107,24 +14084,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -12133,20 +14122,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "gcc_cv_have_decl_$ac_func=no" + eval "gcc_cv_have_decl_$ac_func=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 ; cat >>confdefs.h <<_ACEOF + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } ; cat >>confdefs.h <<_ACEOF #define $ac_tr_decl 1 _ACEOF else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 ; cat >>confdefs.h <<_ACEOF + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ; cat >>confdefs.h <<_ACEOF #define $ac_tr_decl 0 _ACEOF @@ -12159,9 +14149,9 @@ for ac_func in sigaltstack do ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp` -echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 -echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6 -if eval "test \"\${gcc_cv_have_decl_$ac_func+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 +echo $ECHO_N "checking whether $ac_func is declared... $ECHO_C" >&6; } +if { as_var=gcc_cv_have_decl_$ac_func; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -12189,24 +14179,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -12215,20 +14217,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "gcc_cv_have_decl_$ac_func=no" + eval "gcc_cv_have_decl_$ac_func=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 ; cat >>confdefs.h <<_ACEOF + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } ; cat >>confdefs.h <<_ACEOF #define $ac_tr_decl 1 _ACEOF else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 ; cat >>confdefs.h <<_ACEOF + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ; cat >>confdefs.h <<_ACEOF #define $ac_tr_decl 0 _ACEOF @@ -12238,8 +14241,8 @@ # More time-related stuff. -echo "$as_me:$LINENO: checking for struct tms" >&5 -echo $ECHO_N "checking for struct tms... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for struct tms" >&5 +echo $ECHO_N "checking for struct tms... $ECHO_C" >&6; } if test "${ac_cv_struct_tms+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -12266,24 +14269,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -12292,12 +14307,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_struct_tms=no + ac_cv_struct_tms=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_struct_tms" >&5 -echo "${ECHO_T}$ac_cv_struct_tms" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_struct_tms" >&5 +echo "${ECHO_T}$ac_cv_struct_tms" >&6; } if test $ac_cv_struct_tms = yes; then cat >>confdefs.h <<\_ACEOF @@ -12308,8 +14324,8 @@ # use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE. # revisit after autoconf 2.50. -echo "$as_me:$LINENO: checking for clock_t" >&5 -echo $ECHO_N "checking for clock_t... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for clock_t" >&5 +echo $ECHO_N "checking for clock_t... $ECHO_C" >&6; } if test "${gcc_cv_type_clock_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -12333,24 +14349,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -12359,12 +14387,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gcc_cv_type_clock_t=no + gcc_cv_type_clock_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gcc_cv_type_clock_t" >&5 -echo "${ECHO_T}$gcc_cv_type_clock_t" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_type_clock_t" >&5 +echo "${ECHO_T}$gcc_cv_type_clock_t" >&6; } if test $gcc_cv_type_clock_t = yes; then cat >>confdefs.h <<\_ACEOF @@ -12376,14 +14405,13 @@ # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests. CFLAGS="$saved_CFLAGS" -# Check whether --enable-initfini-array or --disable-initfini-array was given. +# Check whether --enable-initfini-array was given. if test "${enable_initfini_array+set}" = set; then - enableval="$enable_initfini_array" - + enableval=$enable_initfini_array; else -echo "$as_me:$LINENO: checking for .preinit_array/.init_array/.fini_array support" >&5 -echo $ECHO_N "checking for .preinit_array/.init_array/.fini_array support... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for .preinit_array/.init_array/.fini_array support" >&5 +echo $ECHO_N "checking for .preinit_array/.init_array/.fini_array support... $ECHO_C" >&6; } if test "${gcc_cv_initfini_array+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -12403,13 +14431,22 @@ int (*fp) (void) __attribute__ ((section (".init_array"))) = foo; _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -12422,14 +14459,17 @@ ( exit $ac_status ) gcc_cv_initfini_array=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $gcc_cv_initfini_array" >&5 -echo "${ECHO_T}$gcc_cv_initfini_array" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_initfini_array" >&5 +echo "${ECHO_T}$gcc_cv_initfini_array" >&6; } enable_initfini_array=$gcc_cv_initfini_array -fi; +fi + if test $enable_initfini_array = yes; then cat >>confdefs.h <<\_ACEOF @@ -12439,8 +14479,8 @@ fi # mkdir takes a single argument on some systems. -echo "$as_me:$LINENO: checking if mkdir takes one argument" >&5 -echo $ECHO_N "checking if mkdir takes one argument... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if mkdir takes one argument" >&5 +echo $ECHO_N "checking if mkdir takes one argument... $ECHO_C" >&6; } if test "${gcc_cv_mkdir_takes_one_arg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -12470,24 +14510,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -12496,12 +14548,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gcc_cv_mkdir_takes_one_arg=yes + gcc_cv_mkdir_takes_one_arg=yes fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gcc_cv_mkdir_takes_one_arg" >&5 -echo "${ECHO_T}$gcc_cv_mkdir_takes_one_arg" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_mkdir_takes_one_arg" >&5 +echo "${ECHO_T}$gcc_cv_mkdir_takes_one_arg" >&6; } if test $gcc_cv_mkdir_takes_one_arg = yes ; then cat >>confdefs.h <<\_ACEOF @@ -12518,25 +14571,25 @@ # With Setjmp/Longjmp based exception handling. -# Check whether --enable-sjlj-exceptions or --disable-sjlj-exceptions was given. +# Check whether --enable-sjlj-exceptions was given. if test "${enable_sjlj_exceptions+set}" = set; then - enableval="$enable_sjlj_exceptions" - sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi` + enableval=$enable_sjlj_exceptions; sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi` cat >>confdefs.h <<_ACEOF #define CONFIG_SJLJ_EXCEPTIONS $sjlj _ACEOF -fi; +fi + # For platforms with the unwind ABI which includes an unwind library, # libunwind, we can choose to use the system libunwind. -# Check whether --with-system-libunwind or --without-system-libunwind was given. +# Check whether --with-system-libunwind was given. if test "${with_system_libunwind+set}" = set; then - withval="$with_system_libunwind" + withval=$with_system_libunwind; +fi -fi; # config.gcc also contains tests of with_system_libunwind. if test x$with_system_libunwind = xyes; then @@ -12689,8 +14742,8 @@ case ${host} in powerpc*-*-darwin*) - echo "$as_me:$LINENO: checking whether mcontext_t fields have underscores" >&5 -echo $ECHO_N "checking whether mcontext_t fields have underscores... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether mcontext_t fields have underscores" >&5 +echo $ECHO_N "checking whether mcontext_t fields have underscores... $ECHO_C" >&6; } if test "${gcc_cv_mcontext_underscores+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -12702,24 +14755,36 @@ _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -12728,12 +14793,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gcc_cv_mcontext_underscores=yes + gcc_cv_mcontext_underscores=yes fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gcc_cv_mcontext_underscores" >&5 -echo "${ECHO_T}$gcc_cv_mcontext_underscores" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_mcontext_underscores" >&5 +echo "${ECHO_T}$gcc_cv_mcontext_underscores" >&6; } if test $gcc_cv_mcontext_underscores = yes; then cat >>confdefs.h <<\_ACEOF @@ -12744,6 +14810,99 @@ ;; esac +# Check if we have a particular darwin crash reporter library. +case ${host} in + *-*-darwin*) + +{ echo "$as_me:$LINENO: checking for gCRAnnotations in -lCrashReporterClient" >&5 +echo $ECHO_N "checking for gCRAnnotations in -lCrashReporterClient... $ECHO_C" >&6; } +if test "${ac_cv_lib_CrashReporterClient_gCRAnnotations+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lCrashReporterClient $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gCRAnnotations (); +int +main () +{ +return gCRAnnotations (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_CrashReporterClient_gCRAnnotations=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_CrashReporterClient_gCRAnnotations=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_CrashReporterClient_gCRAnnotations" >&5 +echo "${ECHO_T}$ac_cv_lib_CrashReporterClient_gCRAnnotations" >&6; } +if test $ac_cv_lib_CrashReporterClient_gCRAnnotations = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCRASHREPORTERCLIENT 1 +_ACEOF + + LIBS="-lCrashReporterClient $LIBS" + +fi + + ;; +esac + # --------- # Threading # --------- @@ -12791,8 +14950,8 @@ if test x$enable___cxa_atexit = xyes || \ test x$enable___cxa_atexit = x -a x$default_use_cxa_atexit = xyes; then if test x$host = x$target; then - echo "$as_me:$LINENO: checking for __cxa_atexit" >&5 -echo $ECHO_N "checking for __cxa_atexit... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for __cxa_atexit" >&5 +echo $ECHO_N "checking for __cxa_atexit... $ECHO_C" >&6; } if test "${ac_cv_func___cxa_atexit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -12819,53 +14978,59 @@ #undef __cxa_atexit -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char __cxa_atexit (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub___cxa_atexit) || defined (__stub_____cxa_atexit) +#if defined __stub___cxa_atexit || defined __stub_____cxa_atexit choke me -#else -char (*f) () = __cxa_atexit; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != __cxa_atexit; +return __cxa_atexit (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -12874,13 +15039,14 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func___cxa_atexit=no + ac_cv_func___cxa_atexit=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func___cxa_atexit" >&5 -echo "${ECHO_T}$ac_cv_func___cxa_atexit" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func___cxa_atexit" >&5 +echo "${ECHO_T}$ac_cv_func___cxa_atexit" >&6; } if test $ac_cv_func___cxa_atexit = yes; then use_cxa_atexit=yes else @@ -12904,13 +15070,12 @@ use_getipinfo=yes if test x$with_system_libunwind = xyes; then if test x$host = x$target; then - echo "$as_me:$LINENO: checking for library containing _Unwind_GetIPInfo" >&5 -echo $ECHO_N "checking for library containing _Unwind_GetIPInfo... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for library containing _Unwind_GetIPInfo" >&5 +echo $ECHO_N "checking for library containing _Unwind_GetIPInfo... $ECHO_C" >&6; } if test "${ac_cv_search__Unwind_GetIPInfo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search__Unwind_GetIPInfo=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -12918,115 +15083,89 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char _Unwind_GetIPInfo (); int main () { -_Unwind_GetIPInfo (); +return _Unwind_GetIPInfo (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +for ac_lib in '' unwind; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search__Unwind_GetIPInfo="none required" + ac_cv_search__Unwind_GetIPInfo=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search__Unwind_GetIPInfo" = no; then - for ac_lib in unwind; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char _Unwind_GetIPInfo (); -int -main () -{ -_Unwind_GetIPInfo (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search__Unwind_GetIPInfo="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search__Unwind_GetIPInfo+set}" = set; then + break fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done +done +if test "${ac_cv_search__Unwind_GetIPInfo+set}" = set; then + : +else + ac_cv_search__Unwind_GetIPInfo=no fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search__Unwind_GetIPInfo" >&5 -echo "${ECHO_T}$ac_cv_search__Unwind_GetIPInfo" >&6 -if test "$ac_cv_search__Unwind_GetIPInfo" != no; then - test "$ac_cv_search__Unwind_GetIPInfo" = "none required" || LIBS="$ac_cv_search__Unwind_GetIPInfo $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search__Unwind_GetIPInfo" >&5 +echo "${ECHO_T}$ac_cv_search__Unwind_GetIPInfo" >&6; } +ac_res=$ac_cv_search__Unwind_GetIPInfo +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else use_getipinfo=no @@ -13153,22 +15292,22 @@ if test -f ../intl/config.intl; then . ../intl/config.intl fi -echo "$as_me:$LINENO: checking whether NLS is requested" >&5 -echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } if test x"$USE_NLS" != xyes; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF - echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 -echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 +echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6; } # Look for .po and .gmo files in the source directory. CATALOGS= XLINGUAS= @@ -13199,8 +15338,8 @@ fi done LINGUAS="$XLINGUAS" - echo "$as_me:$LINENO: result: $LINGUAS" >&5 -echo "${ECHO_T}$LINGUAS" >&6 + { echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6; } DATADIRNAME=share @@ -13219,29 +15358,28 @@ LIBICONV= ;; esac -# Check whether --enable-secureplt or --disable-secureplt was given. +# Check whether --enable-secureplt was given. if test "${enable_secureplt+set}" = set; then - enableval="$enable_secureplt" + enableval=$enable_secureplt; +fi -fi; # Windows32 Registry support for specifying GCC installation paths. -# Check whether --enable-win32-registry or --disable-win32-registry was given. +# Check whether --enable-win32-registry was given. if test "${enable_win32_registry+set}" = set; then - enableval="$enable_win32_registry" + enableval=$enable_win32_registry; +fi -fi; case $host_os in win32 | pe | cygwin* | mingw32* | uwin*) if test "x$enable_win32_registry" != xno; then - echo "$as_me:$LINENO: checking for library containing RegOpenKeyExA" >&5 -echo $ECHO_N "checking for library containing RegOpenKeyExA... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for library containing RegOpenKeyExA" >&5 +echo $ECHO_N "checking for library containing RegOpenKeyExA... $ECHO_C" >&6; } if test "${ac_cv_search_RegOpenKeyExA+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_RegOpenKeyExA=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13249,115 +15387,89 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char RegOpenKeyExA (); int main () { -RegOpenKeyExA (); +return RegOpenKeyExA (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_RegOpenKeyExA="none required" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_RegOpenKeyExA" = no; then - for ac_lib in advapi32; do +for ac_lib in '' advapi32; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char RegOpenKeyExA (); -int -main () -{ -RegOpenKeyExA (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_RegOpenKeyExA="-l$ac_lib" -break + ac_cv_search_RegOpenKeyExA=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_RegOpenKeyExA+set}" = set; then + break fi +done +if test "${ac_cv_search_RegOpenKeyExA+set}" = set; then + : +else + ac_cv_search_RegOpenKeyExA=no +fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_RegOpenKeyExA" >&5 -echo "${ECHO_T}$ac_cv_search_RegOpenKeyExA" >&6 -if test "$ac_cv_search_RegOpenKeyExA" != no; then - test "$ac_cv_search_RegOpenKeyExA" = "none required" || LIBS="$ac_cv_search_RegOpenKeyExA $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_RegOpenKeyExA" >&5 +echo "${ECHO_T}$ac_cv_search_RegOpenKeyExA" >&6; } +ac_res=$ac_cv_search_RegOpenKeyExA +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else enable_win32_registry=no @@ -13685,8 +15797,8 @@ else # Extract the first word of "$AS_FOR_TARGET", so it can be a program name with args. set dummy $AS_FOR_TARGET; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_gcc_cv_as+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13701,27 +15813,28 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_gcc_cv_as="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi gcc_cv_as=$ac_cv_path_gcc_cv_as - if test -n "$gcc_cv_as"; then - echo "$as_me:$LINENO: result: $gcc_cv_as" >&5 -echo "${ECHO_T}$gcc_cv_as" >&6 + { echo "$as_me:$LINENO: result: $gcc_cv_as" >&5 +echo "${ECHO_T}$gcc_cv_as" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi fi @@ -13729,14 +15842,14 @@ ORIGINAL_AS_FOR_TARGET=$gcc_cv_as -echo "$as_me:$LINENO: checking what assembler to use" >&5 -echo $ECHO_N "checking what assembler to use... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking what assembler to use" >&5 +echo $ECHO_N "checking what assembler to use... $ECHO_C" >&6; } if test "$gcc_cv_as" = ../gas/as-new$build_exeext; then # Single tree build which includes gas. We want to prefer it # over whatever linker top-level may have detected, since # we'll use what we're building after installation anyway. - echo "$as_me:$LINENO: result: newly built gas" >&5 -echo "${ECHO_T}newly built gas" >&6 + { echo "$as_me:$LINENO: result: newly built gas" >&5 +echo "${ECHO_T}newly built gas" >&6; } in_tree_gas=yes gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd for f in $gcc_cv_as_bfd_srcdir/configure \ @@ -13766,8 +15879,8 @@ in_tree_gas_is_elf=yes fi else - echo "$as_me:$LINENO: result: $gcc_cv_as" >&5 -echo "${ECHO_T}$gcc_cv_as" >&6 + { echo "$as_me:$LINENO: result: $gcc_cv_as" >&5 +echo "${ECHO_T}$gcc_cv_as" >&6; } in_tree_gas=no fi @@ -13801,8 +15914,8 @@ else # Extract the first word of "$LD_FOR_TARGET", so it can be a program name with args. set dummy $LD_FOR_TARGET; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_gcc_cv_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13817,27 +15930,28 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_gcc_cv_ld="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi gcc_cv_ld=$ac_cv_path_gcc_cv_ld - if test -n "$gcc_cv_ld"; then - echo "$as_me:$LINENO: result: $gcc_cv_ld" >&5 -echo "${ECHO_T}$gcc_cv_ld" >&6 + { echo "$as_me:$LINENO: result: $gcc_cv_ld" >&5 +echo "${ECHO_T}$gcc_cv_ld" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi fi @@ -13845,14 +15959,14 @@ ORIGINAL_LD_FOR_TARGET=$gcc_cv_ld -echo "$as_me:$LINENO: checking what linker to use" >&5 -echo $ECHO_N "checking what linker to use... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking what linker to use" >&5 +echo $ECHO_N "checking what linker to use... $ECHO_C" >&6; } if test "$gcc_cv_ld" = ../ld/ld-new$build_exeext; then # Single tree build which includes ld. We want to prefer it # over whatever linker top-level may have detected, since # we'll use what we're building after installation anyway. - echo "$as_me:$LINENO: result: newly built ld" >&5 -echo "${ECHO_T}newly built ld" >&6 + { echo "$as_me:$LINENO: result: newly built ld" >&5 +echo "${ECHO_T}newly built ld" >&6; } in_tree_ld=yes in_tree_ld_is_elf=no if (grep 'EMUL = .*elf' ../ld/Makefile \ @@ -13870,8 +15984,8 @@ gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"` gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"` else - echo "$as_me:$LINENO: result: $gcc_cv_ld" >&5 -echo "${ECHO_T}$gcc_cv_ld" >&6 + { echo "$as_me:$LINENO: result: $gcc_cv_ld" >&5 +echo "${ECHO_T}$gcc_cv_ld" >&6; } in_tree_ld=no fi @@ -13892,8 +16006,8 @@ else # Extract the first word of "$NM_FOR_TARGET", so it can be a program name with args. set dummy $NM_FOR_TARGET; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_gcc_cv_nm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13908,41 +16022,42 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_gcc_cv_nm="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi gcc_cv_nm=$ac_cv_path_gcc_cv_nm - if test -n "$gcc_cv_nm"; then - echo "$as_me:$LINENO: result: $gcc_cv_nm" >&5 -echo "${ECHO_T}$gcc_cv_nm" >&6 + { echo "$as_me:$LINENO: result: $gcc_cv_nm" >&5 +echo "${ECHO_T}$gcc_cv_nm" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi fi -echo "$as_me:$LINENO: checking what nm to use" >&5 -echo $ECHO_N "checking what nm to use... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking what nm to use" >&5 +echo $ECHO_N "checking what nm to use... $ECHO_C" >&6; } if test "$gcc_cv_nm" = ../binutils/nm-new$build_exeext; then # Single tree build which includes binutils. - echo "$as_me:$LINENO: result: newly built nm" >&5 -echo "${ECHO_T}newly built nm" >&6 + { echo "$as_me:$LINENO: result: newly built nm" >&5 +echo "${ECHO_T}newly built nm" >&6; } in_tree_nm=yes else - echo "$as_me:$LINENO: result: $gcc_cv_nm" >&5 -echo "${ECHO_T}$gcc_cv_nm" >&6 + { echo "$as_me:$LINENO: result: $gcc_cv_nm" >&5 +echo "${ECHO_T}$gcc_cv_nm" >&6; } in_tree_nm=no fi @@ -13966,8 +16081,8 @@ else # Extract the first word of "$OBJDUMP_FOR_TARGET", so it can be a program name with args. set dummy $OBJDUMP_FOR_TARGET; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_gcc_cv_objdump+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13982,48 +16097,49 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_gcc_cv_objdump="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi gcc_cv_objdump=$ac_cv_path_gcc_cv_objdump - if test -n "$gcc_cv_objdump"; then - echo "$as_me:$LINENO: result: $gcc_cv_objdump" >&5 -echo "${ECHO_T}$gcc_cv_objdump" >&6 + { echo "$as_me:$LINENO: result: $gcc_cv_objdump" >&5 +echo "${ECHO_T}$gcc_cv_objdump" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi fi -echo "$as_me:$LINENO: checking what objdump to use" >&5 -echo $ECHO_N "checking what objdump to use... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking what objdump to use" >&5 +echo $ECHO_N "checking what objdump to use... $ECHO_C" >&6; } if test "$gcc_cv_objdump" = ../binutils/objdump$build_exeext; then # Single tree build which includes binutils. - echo "$as_me:$LINENO: result: newly built objdump" >&5 -echo "${ECHO_T}newly built objdump" >&6 + { echo "$as_me:$LINENO: result: newly built objdump" >&5 +echo "${ECHO_T}newly built objdump" >&6; } elif test x$gcc_cv_objdump = x; then - echo "$as_me:$LINENO: result: not found" >&5 -echo "${ECHO_T}not found" >&6 + { echo "$as_me:$LINENO: result: not found" >&5 +echo "${ECHO_T}not found" >&6; } else - echo "$as_me:$LINENO: result: $gcc_cv_objdump" >&5 -echo "${ECHO_T}$gcc_cv_objdump" >&6 + { echo "$as_me:$LINENO: result: $gcc_cv_objdump" >&5 +echo "${ECHO_T}$gcc_cv_objdump" >&6; } fi # Figure out what assembler alignment features are present. -echo "$as_me:$LINENO: checking assembler for .balign and .p2align" >&5 -echo $ECHO_N "checking assembler for .balign and .p2align... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking assembler for .balign and .p2align" >&5 +echo $ECHO_N "checking assembler for .balign and .p2align... $ECHO_C" >&6; } if test "${gcc_cv_as_balign_and_p2align+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14050,8 +16166,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_balign_and_p2align" >&5 -echo "${ECHO_T}$gcc_cv_as_balign_and_p2align" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_balign_and_p2align" >&5 +echo "${ECHO_T}$gcc_cv_as_balign_and_p2align" >&6; } if test $gcc_cv_as_balign_and_p2align = yes; then cat >>confdefs.h <<\_ACEOF @@ -14060,8 +16176,8 @@ fi -echo "$as_me:$LINENO: checking assembler for .p2align with maximum skip" >&5 -echo $ECHO_N "checking assembler for .p2align with maximum skip... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking assembler for .p2align with maximum skip" >&5 +echo $ECHO_N "checking assembler for .p2align with maximum skip... $ECHO_C" >&6; } if test "${gcc_cv_as_max_skip_p2align+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14087,8 +16203,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_max_skip_p2align" >&5 -echo "${ECHO_T}$gcc_cv_as_max_skip_p2align" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_max_skip_p2align" >&5 +echo "${ECHO_T}$gcc_cv_as_max_skip_p2align" >&6; } if test $gcc_cv_as_max_skip_p2align = yes; then cat >>confdefs.h <<\_ACEOF @@ -14098,8 +16214,8 @@ fi # APPLE LOCAL begin mainline x86_64 literal16 -echo "$as_me:$LINENO: checking assembler for .literal16" >&5 -echo $ECHO_N "checking assembler for .literal16... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking assembler for .literal16" >&5 +echo $ECHO_N "checking assembler for .literal16... $ECHO_C" >&6; } if test "${gcc_cv_as_literal16+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14125,8 +16241,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_literal16" >&5 -echo "${ECHO_T}$gcc_cv_as_literal16" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_literal16" >&5 +echo "${ECHO_T}$gcc_cv_as_literal16" >&6; } if test $gcc_cv_as_literal16 = yes; then cat >>confdefs.h <<\_ACEOF @@ -14136,8 +16252,8 @@ fi # APPLE LOCAL end mainline x86_64 literal16 -echo "$as_me:$LINENO: checking assembler for working .subsection -1" >&5 -echo $ECHO_N "checking assembler for working .subsection -1... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking assembler for working .subsection -1" >&5 +echo $ECHO_N "checking assembler for working .subsection -1... $ECHO_C" >&6; } if test "${gcc_cv_as_subsection_m1+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14175,8 +16291,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_subsection_m1" >&5 -echo "${ECHO_T}$gcc_cv_as_subsection_m1" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_subsection_m1" >&5 +echo "${ECHO_T}$gcc_cv_as_subsection_m1" >&6; } if test $gcc_cv_as_subsection_m1 = yes; then cat >>confdefs.h <<\_ACEOF @@ -14185,8 +16301,8 @@ fi -echo "$as_me:$LINENO: checking assembler for .weak" >&5 -echo $ECHO_N "checking assembler for .weak... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking assembler for .weak" >&5 +echo $ECHO_N "checking assembler for .weak... $ECHO_C" >&6; } if test "${gcc_cv_as_weak+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14212,8 +16328,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_weak" >&5 -echo "${ECHO_T}$gcc_cv_as_weak" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_weak" >&5 +echo "${ECHO_T}$gcc_cv_as_weak" >&6; } if test $gcc_cv_as_weak = yes; then cat >>confdefs.h <<\_ACEOF @@ -14222,8 +16338,8 @@ fi -echo "$as_me:$LINENO: checking assembler for .weakref" >&5 -echo $ECHO_N "checking assembler for .weakref... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking assembler for .weakref" >&5 +echo $ECHO_N "checking assembler for .weakref... $ECHO_C" >&6; } if test "${gcc_cv_as_weakref+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14249,8 +16365,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_weakref" >&5 -echo "${ECHO_T}$gcc_cv_as_weakref" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_weakref" >&5 +echo "${ECHO_T}$gcc_cv_as_weakref" >&6; } if test $gcc_cv_as_weakref = yes; then cat >>confdefs.h <<\_ACEOF @@ -14259,8 +16375,8 @@ fi -echo "$as_me:$LINENO: checking assembler for .nsubspa comdat" >&5 -echo $ECHO_N "checking assembler for .nsubspa comdat... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking assembler for .nsubspa comdat" >&5 +echo $ECHO_N "checking assembler for .nsubspa comdat... $ECHO_C" >&6; } if test "${gcc_cv_as_nsubspa_comdat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14287,8 +16403,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_nsubspa_comdat" >&5 -echo "${ECHO_T}$gcc_cv_as_nsubspa_comdat" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_nsubspa_comdat" >&5 +echo "${ECHO_T}$gcc_cv_as_nsubspa_comdat" >&6; } if test $gcc_cv_as_nsubspa_comdat = yes; then cat >>confdefs.h <<\_ACEOF @@ -14304,8 +16420,8 @@ # ld, we don't know its patchlevel version, so we set the baseline at 2.13 # to be safe. # The gcc_GAS_CHECK_FEATURE call just sets a cache variable. -echo "$as_me:$LINENO: checking assembler for .hidden" >&5 -echo $ECHO_N "checking assembler for .hidden... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking assembler for .hidden" >&5 +echo $ECHO_N "checking assembler for .hidden... $ECHO_C" >&6; } if test "${gcc_cv_as_hidden+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14333,12 +16449,12 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_hidden" >&5 -echo "${ECHO_T}$gcc_cv_as_hidden" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_hidden" >&5 +echo "${ECHO_T}$gcc_cv_as_hidden" >&6; } -echo "$as_me:$LINENO: checking linker for .hidden support" >&5 -echo $ECHO_N "checking linker for .hidden support... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking linker for .hidden support" >&5 +echo $ECHO_N "checking linker for .hidden support... $ECHO_C" >&6; } if test "${gcc_cv_ld_hidden+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14394,8 +16510,8 @@ fi fi fi -echo "$as_me:$LINENO: result: $gcc_cv_ld_hidden" >&5 -echo "${ECHO_T}$gcc_cv_ld_hidden" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_ld_hidden" >&5 +echo "${ECHO_T}$gcc_cv_ld_hidden" >&6; } libgcc_visibility=no @@ -14409,8 +16525,8 @@ fi # Check if we have .[us]leb128, and support symbol arithmetic with it. -echo "$as_me:$LINENO: checking assembler for .sleb128 and .uleb128" >&5 -echo $ECHO_N "checking assembler for .sleb128 and .uleb128... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking assembler for .sleb128 and .uleb128" >&5 +echo $ECHO_N "checking assembler for .sleb128 and .uleb128... $ECHO_C" >&6; } if test "${gcc_cv_as_leb128+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14457,8 +16573,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_leb128" >&5 -echo "${ECHO_T}$gcc_cv_as_leb128" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_leb128" >&5 +echo "${ECHO_T}$gcc_cv_as_leb128" >&6; } if test $gcc_cv_as_leb128 = yes; then cat >>confdefs.h <<\_ACEOF @@ -14469,8 +16585,8 @@ # GAS versions up to and including 2.11.0 may mis-optimize # .eh_frame data. -echo "$as_me:$LINENO: checking assembler for eh_frame optimization" >&5 -echo $ECHO_N "checking assembler for eh_frame optimization... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking assembler for eh_frame optimization" >&5 +echo $ECHO_N "checking assembler for eh_frame optimization... $ECHO_C" >&6; } if test "${gcc_cv_as_eh_frame+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14560,8 +16676,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_eh_frame" >&5 -echo "${ECHO_T}$gcc_cv_as_eh_frame" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_eh_frame" >&5 +echo "${ECHO_T}$gcc_cv_as_eh_frame" >&6; } if test $gcc_cv_as_eh_frame = buggy; then @@ -14572,8 +16688,8 @@ fi -echo "$as_me:$LINENO: checking assembler for section merging support" >&5 -echo $ECHO_N "checking assembler for section merging support... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking assembler for section merging support" >&5 +echo $ECHO_N "checking assembler for section merging support... $ECHO_C" >&6; } if test "${gcc_cv_as_shf_merge+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14600,12 +16716,12 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_shf_merge" >&5 -echo "${ECHO_T}$gcc_cv_as_shf_merge" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_shf_merge" >&5 +echo "${ECHO_T}$gcc_cv_as_shf_merge" >&6; } if test $gcc_cv_as_shf_merge = no; then - echo "$as_me:$LINENO: checking assembler for section merging support" >&5 -echo $ECHO_N "checking assembler for section merging support... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for section merging support" >&5 +echo $ECHO_N "checking assembler for section merging support... $ECHO_C" >&6; } if test "${gcc_cv_as_shf_merge+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14632,8 +16748,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_shf_merge" >&5 -echo "${ECHO_T}$gcc_cv_as_shf_merge" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_shf_merge" >&5 +echo "${ECHO_T}$gcc_cv_as_shf_merge" >&6; } fi @@ -14642,8 +16758,8 @@ _ACEOF -echo "$as_me:$LINENO: checking assembler for COMDAT group support" >&5 -echo $ECHO_N "checking assembler for COMDAT group support... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking assembler for COMDAT group support" >&5 +echo $ECHO_N "checking assembler for COMDAT group support... $ECHO_C" >&6; } if test "${gcc_cv_as_comdat_group+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14670,14 +16786,14 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_comdat_group" >&5 -echo "${ECHO_T}$gcc_cv_as_comdat_group" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_comdat_group" >&5 +echo "${ECHO_T}$gcc_cv_as_comdat_group" >&6; } if test $gcc_cv_as_comdat_group = yes; then gcc_cv_as_comdat_group_percent=no else - echo "$as_me:$LINENO: checking assembler for COMDAT group support" >&5 -echo $ECHO_N "checking assembler for COMDAT group support... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for COMDAT group support" >&5 +echo $ECHO_N "checking assembler for COMDAT group support... $ECHO_C" >&6; } if test "${gcc_cv_as_comdat_group_percent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -14704,8 +16820,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_comdat_group_percent" >&5 -echo "${ECHO_T}$gcc_cv_as_comdat_group_percent" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_comdat_group_percent" >&5 +echo "${ECHO_T}$gcc_cv_as_comdat_group_percent" >&6; } fi if test $in_tree_ld != yes && test x"$ld_vers" != x; then @@ -15075,8 +17191,8 @@ elif test -z "$tls_first_major"; then : # If we don't have a check, assume no support. else - echo "$as_me:$LINENO: checking assembler for thread-local storage support" >&5 -echo $ECHO_N "checking assembler for thread-local storage support... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for thread-local storage support" >&5 +echo $ECHO_N "checking assembler for thread-local storage support... $ECHO_C" >&6; } if test "${gcc_cv_as_tls+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15102,8 +17218,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_tls" >&5 -echo "${ECHO_T}$gcc_cv_as_tls" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_tls" >&5 +echo "${ECHO_T}$gcc_cv_as_tls" >&6; } if test $gcc_cv_as_tls = yes; then set_have_as_tls=yes fi @@ -15118,8 +17234,8 @@ # Target-specific assembler checks. -echo "$as_me:$LINENO: checking linker -Bstatic/-Bdynamic option" >&5 -echo $ECHO_N "checking linker -Bstatic/-Bdynamic option... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking linker -Bstatic/-Bdynamic option" >&5 +echo $ECHO_N "checking linker -Bstatic/-Bdynamic option... $ECHO_C" >&6; } gcc_cv_ld_static_dynamic=no if test $in_tree_ld = yes ; then if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10; then @@ -15139,12 +17255,12 @@ _ACEOF fi -echo "$as_me:$LINENO: result: $gcc_cv_ld_static_dynamic" >&5 -echo "${ECHO_T}$gcc_cv_ld_static_dynamic" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_ld_static_dynamic" >&5 +echo "${ECHO_T}$gcc_cv_ld_static_dynamic" >&6; } if test x"$demangler_in_ld" = xyes; then - echo "$as_me:$LINENO: checking linker --demangle support" >&5 -echo $ECHO_N "checking linker --demangle support... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking linker --demangle support" >&5 +echo $ECHO_N "checking linker --demangle support... $ECHO_C" >&6; } gcc_cv_ld_demangle=no if test $in_tree_ld = yes; then if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 14 -o "$gcc_cv_gld_major_version" -gt 2; then \ @@ -15163,15 +17279,15 @@ _ACEOF fi - echo "$as_me:$LINENO: result: $gcc_cv_ld_demangle" >&5 -echo "${ECHO_T}$gcc_cv_ld_demangle" >&6 + { echo "$as_me:$LINENO: result: $gcc_cv_ld_demangle" >&5 +echo "${ECHO_T}$gcc_cv_ld_demangle" >&6; } fi case "$target" in # All TARGET_ABI_OSF targets. alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*) - echo "$as_me:$LINENO: checking assembler for explicit relocation support" >&5 -echo $ECHO_N "checking assembler for explicit relocation support... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for explicit relocation support" >&5 +echo $ECHO_N "checking assembler for explicit relocation support... $ECHO_C" >&6; } if test "${gcc_cv_as_alpha_explicit_relocs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15209,8 +17325,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_alpha_explicit_relocs" >&5 -echo "${ECHO_T}$gcc_cv_as_alpha_explicit_relocs" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_alpha_explicit_relocs" >&5 +echo "${ECHO_T}$gcc_cv_as_alpha_explicit_relocs" >&6; } if test $gcc_cv_as_alpha_explicit_relocs = yes; then cat >>confdefs.h <<\_ACEOF @@ -15218,8 +17334,8 @@ _ACEOF fi - echo "$as_me:$LINENO: checking assembler for jsrdirect relocation support" >&5 -echo $ECHO_N "checking assembler for jsrdirect relocation support... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for jsrdirect relocation support" >&5 +echo $ECHO_N "checking assembler for jsrdirect relocation support... $ECHO_C" >&6; } if test "${gcc_cv_as_alpha_jsrdirect_relocs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15248,8 +17364,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_alpha_jsrdirect_relocs" >&5 -echo "${ECHO_T}$gcc_cv_as_alpha_jsrdirect_relocs" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_alpha_jsrdirect_relocs" >&5 +echo "${ECHO_T}$gcc_cv_as_alpha_jsrdirect_relocs" >&6; } if test $gcc_cv_as_alpha_jsrdirect_relocs = yes; then cat >>confdefs.h <<\_ACEOF @@ -15260,8 +17376,8 @@ ;; cris-*-*) - echo "$as_me:$LINENO: checking assembler for -no-mul-bug-abort option" >&5 -echo $ECHO_N "checking assembler for -no-mul-bug-abort option... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for -no-mul-bug-abort option" >&5 +echo $ECHO_N "checking assembler for -no-mul-bug-abort option... $ECHO_C" >&6; } if test "${gcc_cv_as_cris_no_mul_bug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15287,8 +17403,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_cris_no_mul_bug" >&5 -echo "${ECHO_T}$gcc_cv_as_cris_no_mul_bug" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_cris_no_mul_bug" >&5 +echo "${ECHO_T}$gcc_cv_as_cris_no_mul_bug" >&6; } if test $gcc_cv_as_cris_no_mul_bug = yes; then cat >>confdefs.h <<\_ACEOF @@ -15299,8 +17415,8 @@ ;; sparc*-*-*) - echo "$as_me:$LINENO: checking assembler for .register" >&5 -echo $ECHO_N "checking assembler for .register... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for .register" >&5 +echo $ECHO_N "checking assembler for .register... $ECHO_C" >&6; } if test "${gcc_cv_as_sparc_register_op+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15322,8 +17438,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_sparc_register_op" >&5 -echo "${ECHO_T}$gcc_cv_as_sparc_register_op" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_sparc_register_op" >&5 +echo "${ECHO_T}$gcc_cv_as_sparc_register_op" >&6; } if test $gcc_cv_as_sparc_register_op = yes; then cat >>confdefs.h <<\_ACEOF @@ -15332,8 +17448,8 @@ fi - echo "$as_me:$LINENO: checking assembler for -relax option" >&5 -echo $ECHO_N "checking assembler for -relax option... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for -relax option" >&5 +echo $ECHO_N "checking assembler for -relax option... $ECHO_C" >&6; } if test "${gcc_cv_as_sparc_relax+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15355,8 +17471,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_sparc_relax" >&5 -echo "${ECHO_T}$gcc_cv_as_sparc_relax" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_sparc_relax" >&5 +echo "${ECHO_T}$gcc_cv_as_sparc_relax" >&6; } if test $gcc_cv_as_sparc_relax = yes; then cat >>confdefs.h <<\_ACEOF @@ -15365,8 +17481,8 @@ fi - echo "$as_me:$LINENO: checking assembler for unaligned pcrel relocs" >&5 -echo $ECHO_N "checking assembler for unaligned pcrel relocs... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for unaligned pcrel relocs" >&5 +echo $ECHO_N "checking assembler for unaligned pcrel relocs... $ECHO_C" >&6; } if test "${gcc_cv_as_sparc_ua_pcrel+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15398,8 +17514,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_sparc_ua_pcrel" >&5 -echo "${ECHO_T}$gcc_cv_as_sparc_ua_pcrel" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_sparc_ua_pcrel" >&5 +echo "${ECHO_T}$gcc_cv_as_sparc_ua_pcrel" >&6; } if test $gcc_cv_as_sparc_ua_pcrel = yes; then cat >>confdefs.h <<\_ACEOF @@ -15407,8 +17523,8 @@ _ACEOF - echo "$as_me:$LINENO: checking assembler for unaligned pcrel relocs against hidden symbols" >&5 -echo $ECHO_N "checking assembler for unaligned pcrel relocs against hidden symbols... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for unaligned pcrel relocs against hidden symbols" >&5 +echo $ECHO_N "checking assembler for unaligned pcrel relocs against hidden symbols... $ECHO_C" >&6; } if test "${gcc_cv_as_sparc_ua_pcrel_hidden+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15449,8 +17565,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_sparc_ua_pcrel_hidden" >&5 -echo "${ECHO_T}$gcc_cv_as_sparc_ua_pcrel_hidden" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_sparc_ua_pcrel_hidden" >&5 +echo "${ECHO_T}$gcc_cv_as_sparc_ua_pcrel_hidden" >&6; } if test $gcc_cv_as_sparc_ua_pcrel_hidden = yes; then cat >>confdefs.h <<\_ACEOF @@ -15461,8 +17577,8 @@ fi # unaligned pcrel relocs - echo "$as_me:$LINENO: checking assembler for offsetable %lo()" >&5 -echo $ECHO_N "checking assembler for offsetable %lo()... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for offsetable %lo()" >&5 +echo $ECHO_N "checking assembler for offsetable %lo()... $ECHO_C" >&6; } if test "${gcc_cv_as_sparc_offsetable_lo10+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15490,8 +17606,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_sparc_offsetable_lo10" >&5 -echo "${ECHO_T}$gcc_cv_as_sparc_offsetable_lo10" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_sparc_offsetable_lo10" >&5 +echo "${ECHO_T}$gcc_cv_as_sparc_offsetable_lo10" >&6; } if test $gcc_cv_as_sparc_offsetable_lo10 = yes; then cat >>confdefs.h <<\_ACEOF @@ -15505,8 +17621,8 @@ case $target_os in cygwin* | pe | mingw32*) # Used for DWARF 2 in PE - echo "$as_me:$LINENO: checking assembler for .secrel32 relocs" >&5 -echo $ECHO_N "checking assembler for .secrel32 relocs... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for .secrel32 relocs" >&5 +echo $ECHO_N "checking assembler for .secrel32 relocs... $ECHO_C" >&6; } if test "${gcc_cv_as_ix86_pe_secrel32+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15539,8 +17655,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_pe_secrel32" >&5 -echo "${ECHO_T}$gcc_cv_as_ix86_pe_secrel32" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_pe_secrel32" >&5 +echo "${ECHO_T}$gcc_cv_as_ix86_pe_secrel32" >&6; } if test $gcc_cv_as_ix86_pe_secrel32 = yes; then cat >>confdefs.h <<\_ACEOF @@ -15551,8 +17667,8 @@ ;; esac - echo "$as_me:$LINENO: checking assembler for filds and fists mnemonics" >&5 -echo $ECHO_N "checking assembler for filds and fists mnemonics... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for filds and fists mnemonics" >&5 +echo $ECHO_N "checking assembler for filds and fists mnemonics... $ECHO_C" >&6; } if test "${gcc_cv_as_ix86_filds_fists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15578,8 +17694,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_filds_fists" >&5 -echo "${ECHO_T}$gcc_cv_as_ix86_filds_fists" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_filds_fists" >&5 +echo "${ECHO_T}$gcc_cv_as_ix86_filds_fists" >&6; } if test $gcc_cv_as_ix86_filds_fists = yes; then cat >>confdefs.h <<\_ACEOF @@ -15588,8 +17704,8 @@ fi - echo "$as_me:$LINENO: checking assembler for cmov syntax" >&5 -echo $ECHO_N "checking assembler for cmov syntax... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for cmov syntax" >&5 +echo $ECHO_N "checking assembler for cmov syntax... $ECHO_C" >&6; } if test "${gcc_cv_as_ix86_cmov_sun_syntax+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15611,8 +17727,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_cmov_sun_syntax" >&5 -echo "${ECHO_T}$gcc_cv_as_ix86_cmov_sun_syntax" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_cmov_sun_syntax" >&5 +echo "${ECHO_T}$gcc_cv_as_ix86_cmov_sun_syntax" >&6; } if test $gcc_cv_as_ix86_cmov_sun_syntax = yes; then cat >>confdefs.h <<\_ACEOF @@ -15621,8 +17737,8 @@ fi - echo "$as_me:$LINENO: checking assembler for ffreep mnemonic" >&5 -echo $ECHO_N "checking assembler for ffreep mnemonic... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for ffreep mnemonic" >&5 +echo $ECHO_N "checking assembler for ffreep mnemonic... $ECHO_C" >&6; } if test "${gcc_cv_as_ix86_ffreep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15644,8 +17760,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_ffreep" >&5 -echo "${ECHO_T}$gcc_cv_as_ix86_ffreep" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_ffreep" >&5 +echo "${ECHO_T}$gcc_cv_as_ix86_ffreep" >&6; } if test $gcc_cv_as_ix86_ffreep = yes; then cat >>confdefs.h <<\_ACEOF @@ -15656,8 +17772,8 @@ # This one is used unconditionally by i386.[ch]; it is to be defined # to 1 if the feature is present, 0 otherwise. - echo "$as_me:$LINENO: checking assembler for GOTOFF in data" >&5 -echo $ECHO_N "checking assembler for GOTOFF in data... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for GOTOFF in data" >&5 +echo $ECHO_N "checking assembler for GOTOFF in data... $ECHO_C" >&6; } if test "${gcc_cv_as_ix86_gotoff_in_data+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15687,8 +17803,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_gotoff_in_data" >&5 -echo "${ECHO_T}$gcc_cv_as_ix86_gotoff_in_data" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_ix86_gotoff_in_data" >&5 +echo "${ECHO_T}$gcc_cv_as_ix86_gotoff_in_data" >&6; } cat >>confdefs.h <<_ACEOF @@ -15698,8 +17814,8 @@ ;; ia64*-*-*) - echo "$as_me:$LINENO: checking assembler for ltoffx and ldxmov relocs" >&5 -echo $ECHO_N "checking assembler for ltoffx and ldxmov relocs... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for ltoffx and ldxmov relocs" >&5 +echo $ECHO_N "checking assembler for ltoffx and ldxmov relocs... $ECHO_C" >&6; } if test "${gcc_cv_as_ia64_ltoffx_ldxmov_relocs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15728,8 +17844,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_ia64_ltoffx_ldxmov_relocs" >&5 -echo "${ECHO_T}$gcc_cv_as_ia64_ltoffx_ldxmov_relocs" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_ia64_ltoffx_ldxmov_relocs" >&5 +echo "${ECHO_T}$gcc_cv_as_ia64_ltoffx_ldxmov_relocs" >&6; } if test $gcc_cv_as_ia64_ltoffx_ldxmov_relocs = yes; then cat >>confdefs.h <<\_ACEOF @@ -15746,8 +17862,8 @@ .csect .text[PR] mfcr 3,128';; *-*-darwin*) - echo "$as_me:$LINENO: checking assembler for .machine directive support" >&5 -echo $ECHO_N "checking assembler for .machine directive support... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for .machine directive support" >&5 +echo $ECHO_N "checking assembler for .machine directive support... $ECHO_C" >&6; } if test "${gcc_cv_as_machine_directive+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15769,8 +17885,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_machine_directive" >&5 -echo "${ECHO_T}$gcc_cv_as_machine_directive" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_machine_directive" >&5 +echo "${ECHO_T}$gcc_cv_as_machine_directive" >&6; } if test x$gcc_cv_as_machine_directive != xyes; then echo "*** This target requires an assembler supporting \".machine\"" >&2 @@ -15784,8 +17900,8 @@ mfcr 3,128';; esac - echo "$as_me:$LINENO: checking assembler for mfcr field support" >&5 -echo $ECHO_N "checking assembler for mfcr field support... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for mfcr field support" >&5 +echo $ECHO_N "checking assembler for mfcr field support... $ECHO_C" >&6; } if test "${gcc_cv_as_powerpc_mfcrf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15811,8 +17927,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_mfcrf" >&5 -echo "${ECHO_T}$gcc_cv_as_powerpc_mfcrf" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_mfcrf" >&5 +echo "${ECHO_T}$gcc_cv_as_powerpc_mfcrf" >&6; } if test $gcc_cv_as_powerpc_mfcrf = yes; then cat >>confdefs.h <<\_ACEOF @@ -15830,8 +17946,8 @@ popcntb 3,3';; esac - echo "$as_me:$LINENO: checking assembler for popcntb support" >&5 -echo $ECHO_N "checking assembler for popcntb support... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for popcntb support" >&5 +echo $ECHO_N "checking assembler for popcntb support... $ECHO_C" >&6; } if test "${gcc_cv_as_powerpc_popcntb+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15857,8 +17973,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_popcntb" >&5 -echo "${ECHO_T}$gcc_cv_as_powerpc_popcntb" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_popcntb" >&5 +echo "${ECHO_T}$gcc_cv_as_powerpc_popcntb" >&6; } if test $gcc_cv_as_powerpc_popcntb = yes; then cat >>confdefs.h <<\_ACEOF @@ -15876,8 +17992,8 @@ frin 1,1';; esac - echo "$as_me:$LINENO: checking assembler for fp round support" >&5 -echo $ECHO_N "checking assembler for fp round support... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for fp round support" >&5 +echo $ECHO_N "checking assembler for fp round support... $ECHO_C" >&6; } if test "${gcc_cv_as_powerpc_fprnd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15903,8 +18019,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_fprnd" >&5 -echo "${ECHO_T}$gcc_cv_as_powerpc_fprnd" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_fprnd" >&5 +echo "${ECHO_T}$gcc_cv_as_powerpc_fprnd" >&6; } if test $gcc_cv_as_powerpc_fprnd = yes; then cat >>confdefs.h <<\_ACEOF @@ -15926,8 +18042,8 @@ addis 11,30,_GLOBAL_OFFSET_TABLE_-.LCF0 at ha';; esac - echo "$as_me:$LINENO: checking assembler for rel16 relocs" >&5 -echo $ECHO_N "checking assembler for rel16 relocs... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for rel16 relocs" >&5 +echo $ECHO_N "checking assembler for rel16 relocs... $ECHO_C" >&6; } if test "${gcc_cv_as_powerpc_rel16+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15953,8 +18069,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_rel16" >&5 -echo "${ECHO_T}$gcc_cv_as_powerpc_rel16" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_rel16" >&5 +echo "${ECHO_T}$gcc_cv_as_powerpc_rel16" >&6; } if test $gcc_cv_as_powerpc_rel16 = yes; then cat >>confdefs.h <<\_ACEOF @@ -15965,8 +18081,8 @@ ;; mips*-*-*) - echo "$as_me:$LINENO: checking assembler for explicit relocation support" >&5 -echo $ECHO_N "checking assembler for explicit relocation support... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for explicit relocation support" >&5 +echo $ECHO_N "checking assembler for explicit relocation support... $ECHO_C" >&6; } if test "${gcc_cv_as_mips_explicit_relocs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15992,8 +18108,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_mips_explicit_relocs" >&5 -echo "${ECHO_T}$gcc_cv_as_mips_explicit_relocs" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_mips_explicit_relocs" >&5 +echo "${ECHO_T}$gcc_cv_as_mips_explicit_relocs" >&6; } if test $gcc_cv_as_mips_explicit_relocs = yes; then if test x$target_cpu_default = x then target_cpu_default=MASK_EXPLICIT_RELOCS @@ -16044,8 +18160,8 @@ .file 1 \"conftest.s\" .loc 1 3 0 $insn" - echo "$as_me:$LINENO: checking assembler for dwarf2 debug_line support" >&5 -echo $ECHO_N "checking assembler for dwarf2 debug_line support... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for dwarf2 debug_line support" >&5 +echo $ECHO_N "checking assembler for dwarf2 debug_line support... $ECHO_C" >&6; } if test "${gcc_cv_as_dwarf2_debug_line+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16076,16 +18192,16 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_dwarf2_debug_line" >&5 -echo "${ECHO_T}$gcc_cv_as_dwarf2_debug_line" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_dwarf2_debug_line" >&5 +echo "${ECHO_T}$gcc_cv_as_dwarf2_debug_line" >&6; } # The .debug_line file table must be in the exact order that # we specified the files, since these indices are also used # by DW_AT_decl_file. Approximate this test by testing if # the assembler bitches if the same index is assigned twice. - echo "$as_me:$LINENO: checking assembler for buggy dwarf2 .file directive" >&5 -echo $ECHO_N "checking assembler for buggy dwarf2 .file directive... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for buggy dwarf2 .file directive" >&5 +echo $ECHO_N "checking assembler for buggy dwarf2 .file directive... $ECHO_C" >&6; } if test "${gcc_cv_as_dwarf2_file_buggy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16108,8 +18224,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_dwarf2_file_buggy" >&5 -echo "${ECHO_T}$gcc_cv_as_dwarf2_file_buggy" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_dwarf2_file_buggy" >&5 +echo "${ECHO_T}$gcc_cv_as_dwarf2_file_buggy" >&6; } if test $gcc_cv_as_dwarf2_debug_line = yes \ @@ -16121,8 +18237,8 @@ fi - echo "$as_me:$LINENO: checking assembler for --gdwarf2 option" >&5 -echo $ECHO_N "checking assembler for --gdwarf2 option... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for --gdwarf2 option" >&5 +echo $ECHO_N "checking assembler for --gdwarf2 option... $ECHO_C" >&6; } if test "${gcc_cv_as_gdwarf2_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16149,8 +18265,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_gdwarf2_flag" >&5 -echo "${ECHO_T}$gcc_cv_as_gdwarf2_flag" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_gdwarf2_flag" >&5 +echo "${ECHO_T}$gcc_cv_as_gdwarf2_flag" >&6; } if test $gcc_cv_as_gdwarf2_flag = yes; then cat >>confdefs.h <<\_ACEOF @@ -16159,8 +18275,8 @@ fi - echo "$as_me:$LINENO: checking assembler for --gstabs option" >&5 -echo $ECHO_N "checking assembler for --gstabs option... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking assembler for --gstabs option" >&5 +echo $ECHO_N "checking assembler for --gstabs option... $ECHO_C" >&6; } if test "${gcc_cv_as_gstabs_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16198,8 +18314,8 @@ rm -f conftest.o conftest.s fi fi -echo "$as_me:$LINENO: result: $gcc_cv_as_gstabs_flag" >&5 -echo "${ECHO_T}$gcc_cv_as_gstabs_flag" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_as_gstabs_flag" >&5 +echo "${ECHO_T}$gcc_cv_as_gstabs_flag" >&6; } if test $gcc_cv_as_gstabs_flag = yes; then cat >>confdefs.h <<\_ACEOF @@ -16209,8 +18325,8 @@ fi fi -echo "$as_me:$LINENO: checking linker read-only and read-write section mixing" >&5 -echo $ECHO_N "checking linker read-only and read-write section mixing... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking linker read-only and read-write section mixing" >&5 +echo $ECHO_N "checking linker read-only and read-write section mixing... $ECHO_C" >&6; } gcc_cv_ld_ro_rw_mix=unknown if test $in_tree_ld = yes ; then if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 \ @@ -16247,11 +18363,11 @@ _ACEOF fi -echo "$as_me:$LINENO: result: $gcc_cv_ld_ro_rw_mix" >&5 -echo "${ECHO_T}$gcc_cv_ld_ro_rw_mix" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_ld_ro_rw_mix" >&5 +echo "${ECHO_T}$gcc_cv_ld_ro_rw_mix" >&6; } -echo "$as_me:$LINENO: checking linker PT_GNU_EH_FRAME support" >&5 -echo $ECHO_N "checking linker PT_GNU_EH_FRAME support... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking linker PT_GNU_EH_FRAME support" >&5 +echo $ECHO_N "checking linker PT_GNU_EH_FRAME support... $ECHO_C" >&6; } gcc_cv_ld_eh_frame_hdr=no if test $in_tree_ld = yes ; then if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 \ @@ -16272,11 +18388,11 @@ _ACEOF fi -echo "$as_me:$LINENO: result: $gcc_cv_ld_eh_frame_hdr" >&5 -echo "${ECHO_T}$gcc_cv_ld_eh_frame_hdr" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_ld_eh_frame_hdr" >&5 +echo "${ECHO_T}$gcc_cv_ld_eh_frame_hdr" >&6; } -echo "$as_me:$LINENO: checking linker position independent executable support" >&5 -echo $ECHO_N "checking linker position independent executable support... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking linker position independent executable support" >&5 +echo $ECHO_N "checking linker position independent executable support... $ECHO_C" >&6; } gcc_cv_ld_pie=no if test $in_tree_ld = yes ; then if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 15 -o "$gcc_cv_gld_major_version" -gt 2 \ @@ -16296,15 +18412,15 @@ _ACEOF fi -echo "$as_me:$LINENO: result: $gcc_cv_ld_pie" >&5 -echo "${ECHO_T}$gcc_cv_ld_pie" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_ld_pie" >&5 +echo "${ECHO_T}$gcc_cv_ld_pie" >&6; } # -------- # UNSORTED # -------- -echo "$as_me:$LINENO: checking linker --as-needed support" >&5 -echo $ECHO_N "checking linker --as-needed support... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking linker --as-needed support" >&5 +echo $ECHO_N "checking linker --as-needed support... $ECHO_C" >&6; } if test "${gcc_cv_ld_as_needed+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16322,8 +18438,8 @@ fi fi -echo "$as_me:$LINENO: result: $gcc_cv_ld_as_needed" >&5 -echo "${ECHO_T}$gcc_cv_ld_as_needed" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_ld_as_needed" >&5 +echo "${ECHO_T}$gcc_cv_ld_as_needed" >&6; } if test x"$gcc_cv_ld_as_needed" = xyes; then cat >>confdefs.h <<\_ACEOF @@ -16334,8 +18450,8 @@ case "$target:$tm_file" in powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*) - echo "$as_me:$LINENO: checking linker support for omitting dot symbols" >&5 -echo $ECHO_N "checking linker support for omitting dot symbols... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking linker support for omitting dot symbols" >&5 +echo $ECHO_N "checking linker support for omitting dot symbols... $ECHO_C" >&6; } if test "${gcc_cv_ld_no_dot_syms+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16370,8 +18486,8 @@ fi fi -echo "$as_me:$LINENO: result: $gcc_cv_ld_no_dot_syms" >&5 -echo "${ECHO_T}$gcc_cv_ld_no_dot_syms" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_ld_no_dot_syms" >&5 +echo "${ECHO_T}$gcc_cv_ld_no_dot_syms" >&6; } if test x"$gcc_cv_ld_no_dot_syms" = xyes; then cat >>confdefs.h <<\_ACEOF @@ -16382,8 +18498,8 @@ ;; esac -echo "$as_me:$LINENO: checking linker --sysroot support" >&5 -echo $ECHO_N "checking linker --sysroot support... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking linker --sysroot support" >&5 +echo $ECHO_N "checking linker --sysroot support... $ECHO_C" >&6; } if test "${gcc_cv_ld_sysroot+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16398,8 +18514,8 @@ fi fi fi -echo "$as_me:$LINENO: result: $gcc_cv_ld_sysroot" >&5 -echo "${ECHO_T}$gcc_cv_ld_sysroot" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_ld_sysroot" >&5 +echo "${ECHO_T}$gcc_cv_ld_sysroot" >&6; } if test x"$gcc_cv_ld_sysroot" = xyes; then cat >>confdefs.h <<\_ACEOF @@ -16419,8 +18535,8 @@ # APPLE LOCAL begin mainline # Test for stack protector support in target C library. -echo "$as_me:$LINENO: checking __stack_chk_fail in target C library" >&5 -echo $ECHO_N "checking __stack_chk_fail in target C library... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking __stack_chk_fail in target C library" >&5 +echo $ECHO_N "checking __stack_chk_fail in target C library... $ECHO_C" >&6; } if test "${gcc_cv_libc_provides_ssp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16455,8 +18571,8 @@ fi ;; *-*-darwin*) - echo "$as_me:$LINENO: checking for __stack_chk_fail" >&5 -echo $ECHO_N "checking for __stack_chk_fail... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for __stack_chk_fail" >&5 +echo $ECHO_N "checking for __stack_chk_fail... $ECHO_C" >&6; } if test "${ac_cv_func___stack_chk_fail+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -16483,53 +18599,59 @@ #undef __stack_chk_fail -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char __stack_chk_fail (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub___stack_chk_fail) || defined (__stub_____stack_chk_fail) +#if defined __stub___stack_chk_fail || defined __stub_____stack_chk_fail choke me -#else -char (*f) () = __stack_chk_fail; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != __stack_chk_fail; +return __stack_chk_fail (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -16538,13 +18660,14 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func___stack_chk_fail=no + ac_cv_func___stack_chk_fail=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func___stack_chk_fail" >&5 -echo "${ECHO_T}$ac_cv_func___stack_chk_fail" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func___stack_chk_fail" >&5 +echo "${ECHO_T}$ac_cv_func___stack_chk_fail" >&6; } if test $ac_cv_func___stack_chk_fail = yes; then gcc_cv_libc_provides_ssp=yes else @@ -16555,8 +18678,8 @@ *) gcc_cv_libc_provides_ssp=no ;; esac fi -echo "$as_me:$LINENO: result: $gcc_cv_libc_provides_ssp" >&5 -echo "${ECHO_T}$gcc_cv_libc_provides_ssp" >&6 +{ echo "$as_me:$LINENO: result: $gcc_cv_libc_provides_ssp" >&5 +echo "${ECHO_T}$gcc_cv_libc_provides_ssp" >&6; } # APPLE LOCAL end mainline if test x$gcc_cv_libc_provides_ssp = xyes; then @@ -16576,10 +18699,9 @@ s390*-*-linux* | \ alpha*-*-linux*) -# Check whether --with-long-double-128 or --without-long-double-128 was given. +# Check whether --with-long-double-128 was given. if test "${with_long_double_128+set}" = set; then - withval="$with_long_double_128" - gcc_cv_target_ldbl128="$with_long_double_128" + withval=$with_long_double_128; gcc_cv_target_ldbl128="$with_long_double_128" else gcc_cv_target_ldbl128=no if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then @@ -16597,7 +18719,8 @@ $glibc_header_dir/bits/wordsize.h > /dev/null 2>&1 \ && gcc_cv_target_ldbl128=yes -fi; +fi + ;; esac if test x$gcc_cv_target_ldbl128 = xyes; then @@ -16610,10 +18733,9 @@ # Find out what GC implementation we want, or may, use. -# Check whether --with-gc or --without-gc was given. +# Check whether --with-gc was given. if test "${with_gc+set}" = set; then - withval="$with_gc" - case "$withval" in + withval=$with_gc; case "$withval" in page) GGC=ggc-$withval ;; @@ -16633,7 +18755,8 @@ esac else GGC=ggc-page -fi; +fi + echo "Using $GGC for garbage collection." @@ -16641,29 +18764,29 @@ zlibdir=-L../zlib zlibinc="-I\$(srcdir)/../zlib" -# Check whether --with-system-zlib or --without-system-zlib was given. +# Check whether --with-system-zlib was given. if test "${with_system_zlib+set}" = set; then - withval="$with_system_zlib" - zlibdir= + withval=$with_system_zlib; zlibdir= zlibinc= -fi; +fi -echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 -echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. + +{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } + # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" - maintainer_mode=$enableval + enableval=$enable_maintainer_mode; maintainer_mode=$enableval else maintainer_mode=no -fi; +fi + -echo "$as_me:$LINENO: result: $maintainer_mode" >&5 -echo "${ECHO_T}$maintainer_mode" >&6 +{ echo "$as_me:$LINENO: result: $maintainer_mode" >&5 +echo "${ECHO_T}$maintainer_mode" >&6; } if test "$maintainer_mode" = "yes"; then MAINT='' @@ -16883,17 +19006,16 @@ # Find a directory in which to install a shared libgcc. -# Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given. +# Check whether --enable-version-specific-runtime-libs was given. if test "${enable_version_specific_runtime_libs+set}" = set; then - enableval="$enable_version_specific_runtime_libs" + enableval=$enable_version_specific_runtime_libs; +fi -fi; -# Check whether --with-slibdir or --without-slibdir was given. +# Check whether --with-slibdir was given. if test "${with_slibdir+set}" = set; then - withval="$with_slibdir" - slibdir="$with_slibdir" + withval=$with_slibdir; slibdir="$with_slibdir" else if test "${enable_version_specific_runtime_libs+set}" = set; then slibdir='$(libsubdir)' @@ -16902,40 +19024,41 @@ else slibdir='$(libdir)' fi -fi; +fi + objdir=`${PWDCMD-pwd}` -# Check whether --with-datarootdir or --without-datarootdir was given. +# Check whether --with-datarootdir was given. if test "${with_datarootdir+set}" = set; then - withval="$with_datarootdir" - datarootdir="\${prefix}/$with_datarootdir" + withval=$with_datarootdir; datarootdir="\${prefix}/$with_datarootdir" else datarootdir='$(prefix)/share' -fi; +fi + -# Check whether --with-docdir or --without-docdir was given. +# Check whether --with-docdir was given. if test "${with_docdir+set}" = set; then - withval="$with_docdir" - docdir="\${prefix}/$with_docdir" + withval=$with_docdir; docdir="\${prefix}/$with_docdir" else docdir='$(datarootdir)' -fi; +fi -# Check whether --with-htmldir or --without-htmldir was given. + +# Check whether --with-htmldir was given. if test "${with_htmldir+set}" = set; then - withval="$with_htmldir" - htmldir="\${prefix}/$with_htmldir" + withval=$with_htmldir; htmldir="\${prefix}/$with_htmldir" else htmldir='$(docdir)' -fi; +fi + # Substitute configuration variables @@ -17032,10 +19155,10 @@ # Create the Makefile # and configure language subdirectories - ac_config_files="$ac_config_files $all_outputs" +ac_config_files="$ac_config_files $all_outputs" - ac_config_commands="$ac_config_commands default" +ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -17055,39 +19178,58 @@ # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -17096,32 +19238,18 @@ # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -17159,11 +19287,35 @@ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi +BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset @@ -17172,8 +19324,43 @@ fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -17187,18 +19374,19 @@ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -17206,159 +19394,120 @@ # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi +# CDPATH. +$as_unset CDPATH - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -17367,7 +19516,19 @@ as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -17376,31 +19537,14 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -17408,30 +19552,20 @@ CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -17458,18 +19592,20 @@ $config_commands Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.60, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir + +ac_pwd='$ac_pwd' +srcdir='$srcdir' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -17480,39 +19616,24 @@ do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -17522,18 +19643,24 @@ $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -17549,37 +19676,49 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF # -# INIT-COMMANDS section. +# INIT-COMMANDS # - subdirs='$subdirs' _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "$all_outputs" ) CONFIG_FILES="$CONFIG_FILES $all_outputs" ;; - "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - "auto-host.h" ) CONFIG_HEADERS="$CONFIG_HEADERS auto-host.h:config.in" ;; + case $ac_config_target in + "auto-host.h") CONFIG_HEADERS="$CONFIG_HEADERS auto-host.h:config.in" ;; + "$all_outputs") CONFIG_FILES="$CONFIG_FILES $all_outputs" ;; + "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -17591,471 +19730,624 @@ fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s, at SHELL@,$SHELL,;t t -s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t -s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t -s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s, at exec_prefix@,$exec_prefix,;t t -s, at prefix@,$prefix,;t t -s, at program_transform_name@,$program_transform_name,;t t -s, at bindir@,$bindir,;t t -s, at sbindir@,$sbindir,;t t -s, at libexecdir@,$libexecdir,;t t -s, at datadir@,$datadir,;t t -s, at sysconfdir@,$sysconfdir,;t t -s, at sharedstatedir@,$sharedstatedir,;t t -s, at localstatedir@,$localstatedir,;t t -s, at libdir@,$libdir,;t t -s, at includedir@,$includedir,;t t -s, at oldincludedir@,$oldincludedir,;t t -s, at infodir@,$infodir,;t t -s, at mandir@,$mandir,;t t -s, at build_alias@,$build_alias,;t t -s, at host_alias@,$host_alias,;t t -s, at target_alias@,$target_alias,;t t -s, at DEFS@,$DEFS,;t t -s, at ECHO_C@,$ECHO_C,;t t -s, at ECHO_N@,$ECHO_N,;t t -s, at ECHO_T@,$ECHO_T,;t t -s, at LIBS@,$LIBS,;t t -s, at build@,$build,;t t -s, at build_cpu@,$build_cpu,;t t -s, at build_vendor@,$build_vendor,;t t -s, at build_os@,$build_os,;t t -s, at host@,$host,;t t -s, at host_cpu@,$host_cpu,;t t -s, at host_vendor@,$host_vendor,;t t -s, at host_os@,$host_os,;t t -s, at target@,$target,;t t -s, at target_cpu@,$target_cpu,;t t -s, at target_vendor@,$target_vendor,;t t -s, at target_os@,$target_os,;t t -s, at target_noncanonical@,$target_noncanonical,;t t -s, at build_libsubdir@,$build_libsubdir,;t t -s, at build_subdir@,$build_subdir,;t t -s, at host_subdir@,$host_subdir,;t t -s, at target_subdir@,$target_subdir,;t t -s, at GENINSRC@,$GENINSRC,;t t -s, at CC@,$CC,;t t -s, at CFLAGS@,$CFLAGS,;t t -s, at LDFLAGS@,$LDFLAGS,;t t -s, at CPPFLAGS@,$CPPFLAGS,;t t -s, at ac_ct_CC@,$ac_ct_CC,;t t -s, at EXEEXT@,$EXEEXT,;t t -s, at OBJEXT@,$OBJEXT,;t t -s, at NO_MINUS_C_MINUS_O@,$NO_MINUS_C_MINUS_O,;t t -s, at OUTPUT_OPTION@,$OUTPUT_OPTION,;t t -s, at CPP@,$CPP,;t t -s, at EGREP@,$EGREP,;t t -s, at strict1_warn@,$strict1_warn,;t t -s, at cxx_compat_warn@,$cxx_compat_warn,;t t -s, at warn_cflags@,$warn_cflags,;t t -s, at WERROR@,$WERROR,;t t -s, at checkingenabled_flag@,$checkingenabled_flag,;t t -s, at nocommon_flag@,$nocommon_flag,;t t -s, at TREEBROWSER@,$TREEBROWSER,;t t -s, at valgrind_path@,$valgrind_path,;t t -s, at valgrind_path_defines@,$valgrind_path_defines,;t t -s, at valgrind_command@,$valgrind_command,;t t -s, at coverage_flags@,$coverage_flags,;t t -s, at enable_multilib@,$enable_multilib,;t t -s, at enable_decimal_float@,$enable_decimal_float,;t t -s, at enable_shared@,$enable_shared,;t t -s, at TARGET_SYSTEM_ROOT@,$TARGET_SYSTEM_ROOT,;t t -s, at TARGET_SYSTEM_ROOT_DEFINE@,$TARGET_SYSTEM_ROOT_DEFINE,;t t -s, at CROSS_SYSTEM_HEADER_DIR@,$CROSS_SYSTEM_HEADER_DIR,;t t -s, at onestep@,$onestep,;t t -s, at DSYMUTIL@,$DSYMUTIL,;t t -s, at LLVMBASEPATH@,$LLVMBASEPATH,;t t -s, at LLVMBUILDMODE@,$LLVMBUILDMODE,;t t -s, at datarootdir@,$datarootdir,;t t -s, at docdir@,$docdir,;t t -s, at htmldir@,$htmldir,;t t -s, at SET_MAKE@,$SET_MAKE,;t t -s, at AWK@,$AWK,;t t -s, at LN_S@,$LN_S,;t t -s, at LN@,$LN,;t t -s, at RANLIB@,$RANLIB,;t t -s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s, at ranlib_flags@,$ranlib_flags,;t t -s, at INSTALL@,$INSTALL,;t t -s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s, at INSTALL_DATA@,$INSTALL_DATA,;t t -s, at make_compare_target@,$make_compare_target,;t t -s, at have_mktemp_command@,$have_mktemp_command,;t t -s, at MAKEINFO@,$MAKEINFO,;t t -s, at BUILD_INFO@,$BUILD_INFO,;t t -s, at GENERATED_MANPAGES@,$GENERATED_MANPAGES,;t t -s, at FLEX@,$FLEX,;t t -s, at BISON@,$BISON,;t t -s, at NM@,$NM,;t t -s, at AR@,$AR,;t t -s, at stage1_cflags@,$stage1_cflags,;t t -s, at COLLECT2_LIBS@,$COLLECT2_LIBS,;t t -s, at GNAT_LIBEXC@,$GNAT_LIBEXC,;t t -s, at LDEXP_LIB@,$LDEXP_LIB,;t t -s, at TARGET_GETGROUPS_T@,$TARGET_GETGROUPS_T,;t t -s, at LIBICONV@,$LIBICONV,;t t -s, at LTLIBICONV@,$LTLIBICONV,;t t -s, at LIBICONV_DEP@,$LIBICONV_DEP,;t t -s, at manext@,$manext,;t t -s, at objext@,$objext,;t t -s, at gthread_flags@,$gthread_flags,;t t -s, at extra_modes_file@,$extra_modes_file,;t t -s, at extra_opt_files@,$extra_opt_files,;t t -s, at USE_NLS@,$USE_NLS,;t t -s, at LIBINTL@,$LIBINTL,;t t -s, at LIBINTL_DEP@,$LIBINTL_DEP,;t t -s, at INCINTL@,$INCINTL,;t t -s, at XGETTEXT@,$XGETTEXT,;t t -s, at GMSGFMT@,$GMSGFMT,;t t -s, at POSUB@,$POSUB,;t t -s, at CATALOGS@,$CATALOGS,;t t -s, at DATADIRNAME@,$DATADIRNAME,;t t -s, at INSTOBJEXT@,$INSTOBJEXT,;t t -s, at GENCAT@,$GENCAT,;t t -s, at CATOBJEXT@,$CATOBJEXT,;t t -s, at host_cc_for_libada@,$host_cc_for_libada,;t t -s, at CROSS@,$CROSS,;t t -s, at ALL@,$ALL,;t t -s, at SYSTEM_HEADER_DIR@,$SYSTEM_HEADER_DIR,;t t -s, at inhibit_libc@,$inhibit_libc,;t t -s, at CC_FOR_BUILD@,$CC_FOR_BUILD,;t t -s, at BUILD_CFLAGS@,$BUILD_CFLAGS,;t t -s, at STMP_FIXINC@,$STMP_FIXINC,;t t -s, at STMP_FIXPROTO@,$STMP_FIXPROTO,;t t -s, at collect2@,$collect2,;t t -s, at gcc_cv_as@,$gcc_cv_as,;t t -s, at ORIGINAL_AS_FOR_TARGET@,$ORIGINAL_AS_FOR_TARGET,;t t -s, at gcc_cv_ld@,$gcc_cv_ld,;t t -s, at ORIGINAL_LD_FOR_TARGET@,$ORIGINAL_LD_FOR_TARGET,;t t -s, at gcc_cv_nm@,$gcc_cv_nm,;t t -s, at ORIGINAL_NM_FOR_TARGET@,$ORIGINAL_NM_FOR_TARGET,;t t -s, at gcc_cv_objdump@,$gcc_cv_objdump,;t t -s, at libgcc_visibility@,$libgcc_visibility,;t t -s, at GGC@,$GGC,;t t -s, at zlibdir@,$zlibdir,;t t -s, at zlibinc@,$zlibinc,;t t -s, at MAINT@,$MAINT,;t t -s, at gcc_tooldir@,$gcc_tooldir,;t t -s, at dollar@,$dollar,;t t -s, at slibdir@,$slibdir,;t t -s, at objdir@,$objdir,;t t -s, at subdirs@,$subdirs,;t t -s, at srcdir@,$srcdir,;t t -s, at all_boot_languages@,$all_boot_languages,;t t -s, at all_compilers@,$all_compilers,;t t -s, at all_gtfiles@,$all_gtfiles,;t t -s, at all_gtfiles_files_langs@,$all_gtfiles_files_langs,;t t -s, at all_gtfiles_files_files@,$all_gtfiles_files_files,;t t -s, at all_lang_makefrags@,$all_lang_makefrags,;t t -s, at all_lang_makefiles@,$all_lang_makefiles,;t t -s, at all_languages@,$all_languages,;t t -s, at all_selected_languages@,$all_selected_languages,;t t -s, at all_stagestuff@,$all_stagestuff,;t t -s, at build_exeext@,$build_exeext,;t t -s, at build_install_headers_dir@,$build_install_headers_dir,;t t -s, at build_xm_file_list@,$build_xm_file_list,;t t -s, at build_xm_include_list@,$build_xm_include_list,;t t -s, at build_xm_defines@,$build_xm_defines,;t t -s, at check_languages@,$check_languages,;t t -s, at cc_set_by_configure@,$cc_set_by_configure,;t t -s, at quoted_cc_set_by_configure@,$quoted_cc_set_by_configure,;t t -s, at cpp_install_dir@,$cpp_install_dir,;t t -s, at xmake_file@,$xmake_file,;t t -s, at tmake_file@,$tmake_file,;t t -s, at extra_gcc_objs@,$extra_gcc_objs,;t t -s, at extra_headers_list@,$extra_headers_list,;t t -s, at extra_objs@,$extra_objs,;t t -s, at extra_parts@,$extra_parts,;t t -s, at extra_passes@,$extra_passes,;t t -s, at extra_programs@,$extra_programs,;t t -s, at float_h_file@,$float_h_file,;t t -s, at gcc_config_arguments@,$gcc_config_arguments,;t t -s, at gcc_gxx_include_dir@,$gcc_gxx_include_dir,;t t -s, at host_exeext@,$host_exeext,;t t -s, at host_xm_file_list@,$host_xm_file_list,;t t -s, at host_xm_include_list@,$host_xm_include_list,;t t -s, at host_xm_defines@,$host_xm_defines,;t t -s, at out_host_hook_obj@,$out_host_hook_obj,;t t -s, at install@,$install,;t t -s, at lang_opt_files@,$lang_opt_files,;t t -s, at lang_specs_files@,$lang_specs_files,;t t -s, at lang_tree_files@,$lang_tree_files,;t t -s, at local_prefix@,$local_prefix,;t t -s, at md_file@,$md_file,;t t -s, at objc_boehm_gc@,$objc_boehm_gc,;t t -s, at out_file@,$out_file,;t t -s, at out_cxx_file@,$out_cxx_file,;t t -s, at out_object_file@,$out_object_file,;t t -s, at out_cxx_object_file@,$out_cxx_object_file,;t t -s, at stage_prefix_set_by_configure@,$stage_prefix_set_by_configure,;t t -s, at quoted_stage_prefix_set_by_configure@,$quoted_stage_prefix_set_by_configure,;t t -s, at thread_file@,$thread_file,;t t -s, at tm_file_list@,$tm_file_list,;t t -s, at tm_include_list@,$tm_include_list,;t t -s, at tm_defines@,$tm_defines,;t t -s, at tm_p_file_list@,$tm_p_file_list,;t t -s, at tm_p_include_list@,$tm_p_include_list,;t t -s, at xm_file_list@,$xm_file_list,;t t -s, at xm_include_list@,$xm_include_list,;t t -s, at xm_defines@,$xm_defines,;t t -s, at c_target_objs@,$c_target_objs,;t t -s, at cxx_target_objs@,$cxx_target_objs,;t t -s, at target_cpu_default@,$target_cpu_default,;t t -s, at GMPLIBS@,$GMPLIBS,;t t -s, at GMPINC@,$GMPINC,;t t -s, at LIBOBJS@,$LIBOBJS,;t t -s, at LTLIBOBJS@,$LTLIBOBJS,;t t -/@language_hooks@/r $language_hooks -s, at language_hooks@,,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +if test -n "$CONFIG_FILES"; then + +_ACEOF + +# Create sed commands to just substitute file output variables. + +# Remaining file output variables are in a fragment that also has non-file +# output varibles. + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +target_noncanonical!$target_noncanonical$ac_delim +build_libsubdir!$build_libsubdir$ac_delim +build_subdir!$build_subdir$ac_delim +host_subdir!$host_subdir$ac_delim +target_subdir!$target_subdir$ac_delim +GENINSRC!$GENINSRC$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +NO_MINUS_C_MINUS_O!$NO_MINUS_C_MINUS_O$ac_delim +OUTPUT_OPTION!$OUTPUT_OPTION$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +strict1_warn!$strict1_warn$ac_delim +cxx_compat_warn!$cxx_compat_warn$ac_delim +warn_cflags!$warn_cflags$ac_delim +WERROR!$WERROR$ac_delim +checkingenabled_flag!$checkingenabled_flag$ac_delim +nocommon_flag!$nocommon_flag$ac_delim +TREEBROWSER!$TREEBROWSER$ac_delim +valgrind_path!$valgrind_path$ac_delim +valgrind_path_defines!$valgrind_path_defines$ac_delim +valgrind_command!$valgrind_command$ac_delim +coverage_flags!$coverage_flags$ac_delim +enable_multilib!$enable_multilib$ac_delim +enable_decimal_float!$enable_decimal_float$ac_delim +enable_shared!$enable_shared$ac_delim +TARGET_SYSTEM_ROOT!$TARGET_SYSTEM_ROOT$ac_delim +TARGET_SYSTEM_ROOT_DEFINE!$TARGET_SYSTEM_ROOT_DEFINE$ac_delim +CROSS_SYSTEM_HEADER_DIR!$CROSS_SYSTEM_HEADER_DIR$ac_delim +onestep!$onestep$ac_delim +DSYMUTIL!$DSYMUTIL$ac_delim +LLVMBASEPATH!$LLVMBASEPATH$ac_delim +LLVMBUILDMODE!$LLVMBUILDMODE$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +AWK!$AWK$ac_delim +LN_S!$LN_S$ac_delim +LN!$LN$ac_delim +RANLIB!$RANLIB$ac_delim +ranlib_flags!$ranlib_flags$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +/^[ ]*@language_hooks@[ ]*$/{ +r $language_hooks +d +} +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +INSTALL!$INSTALL$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +make_compare_target!$make_compare_target$ac_delim +have_mktemp_command!$have_mktemp_command$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +BUILD_INFO!$BUILD_INFO$ac_delim +GENERATED_MANPAGES!$GENERATED_MANPAGES$ac_delim +FLEX!$FLEX$ac_delim +BISON!$BISON$ac_delim +NM!$NM$ac_delim +AR!$AR$ac_delim +stage1_cflags!$stage1_cflags$ac_delim +COLLECT2_LIBS!$COLLECT2_LIBS$ac_delim +GNAT_LIBEXC!$GNAT_LIBEXC$ac_delim +LDEXP_LIB!$LDEXP_LIB$ac_delim +TARGET_GETGROUPS_T!$TARGET_GETGROUPS_T$ac_delim +LIBICONV!$LIBICONV$ac_delim +LTLIBICONV!$LTLIBICONV$ac_delim +LIBICONV_DEP!$LIBICONV_DEP$ac_delim +manext!$manext$ac_delim +objext!$objext$ac_delim +gthread_flags!$gthread_flags$ac_delim +extra_modes_file!$extra_modes_file$ac_delim +extra_opt_files!$extra_opt_files$ac_delim +USE_NLS!$USE_NLS$ac_delim +LIBINTL!$LIBINTL$ac_delim +LIBINTL_DEP!$LIBINTL_DEP$ac_delim +INCINTL!$INCINTL$ac_delim +XGETTEXT!$XGETTEXT$ac_delim +GMSGFMT!$GMSGFMT$ac_delim +POSUB!$POSUB$ac_delim +CATALOGS!$CATALOGS$ac_delim +DATADIRNAME!$DATADIRNAME$ac_delim +INSTOBJEXT!$INSTOBJEXT$ac_delim +GENCAT!$GENCAT$ac_delim +CATOBJEXT!$CATOBJEXT$ac_delim +host_cc_for_libada!$host_cc_for_libada$ac_delim +CROSS!$CROSS$ac_delim +ALL!$ALL$ac_delim +SYSTEM_HEADER_DIR!$SYSTEM_HEADER_DIR$ac_delim +inhibit_libc!$inhibit_libc$ac_delim +CC_FOR_BUILD!$CC_FOR_BUILD$ac_delim +BUILD_CFLAGS!$BUILD_CFLAGS$ac_delim +STMP_FIXINC!$STMP_FIXINC$ac_delim +STMP_FIXPROTO!$STMP_FIXPROTO$ac_delim +collect2!$collect2$ac_delim +gcc_cv_as!$gcc_cv_as$ac_delim +ORIGINAL_AS_FOR_TARGET!$ORIGINAL_AS_FOR_TARGET$ac_delim +gcc_cv_ld!$gcc_cv_ld$ac_delim +ORIGINAL_LD_FOR_TARGET!$ORIGINAL_LD_FOR_TARGET$ac_delim +gcc_cv_nm!$gcc_cv_nm$ac_delim +ORIGINAL_NM_FOR_TARGET!$ORIGINAL_NM_FOR_TARGET$ac_delim +gcc_cv_objdump!$gcc_cv_objdump$ac_delim +libgcc_visibility!$libgcc_visibility$ac_delim +GGC!$GGC$ac_delim +zlibdir!$zlibdir$ac_delim +zlibinc!$zlibinc$ac_delim +MAINT!$MAINT$ac_delim +gcc_tooldir!$gcc_tooldir$ac_delim +dollar!$dollar$ac_delim +slibdir!$slibdir$ac_delim +objdir!$objdir$ac_delim +subdirs!$subdirs$ac_delim +srcdir!$srcdir$ac_delim +all_boot_languages!$all_boot_languages$ac_delim +all_compilers!$all_compilers$ac_delim +all_gtfiles!$all_gtfiles$ac_delim +all_gtfiles_files_langs!$all_gtfiles_files_langs$ac_delim +all_gtfiles_files_files!$all_gtfiles_files_files$ac_delim +all_lang_makefrags!$all_lang_makefrags$ac_delim +all_lang_makefiles!$all_lang_makefiles$ac_delim +all_languages!$all_languages$ac_delim +all_selected_languages!$all_selected_languages$ac_delim +all_stagestuff!$all_stagestuff$ac_delim +build_exeext!$build_exeext$ac_delim +build_install_headers_dir!$build_install_headers_dir$ac_delim +build_xm_file_list!$build_xm_file_list$ac_delim +build_xm_include_list!$build_xm_include_list$ac_delim +build_xm_defines!$build_xm_defines$ac_delim +check_languages!$check_languages$ac_delim +cc_set_by_configure!$cc_set_by_configure$ac_delim +quoted_cc_set_by_configure!$quoted_cc_set_by_configure$ac_delim +cpp_install_dir!$cpp_install_dir$ac_delim +xmake_file!$xmake_file$ac_delim +tmake_file!$tmake_file$ac_delim +extra_gcc_objs!$extra_gcc_objs$ac_delim +extra_headers_list!$extra_headers_list$ac_delim +extra_objs!$extra_objs$ac_delim +extra_parts!$extra_parts$ac_delim +extra_passes!$extra_passes$ac_delim +extra_programs!$extra_programs$ac_delim +float_h_file!$float_h_file$ac_delim +gcc_config_arguments!$gcc_config_arguments$ac_delim +gcc_gxx_include_dir!$gcc_gxx_include_dir$ac_delim +host_exeext!$host_exeext$ac_delim +host_xm_file_list!$host_xm_file_list$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +host_xm_include_list!$host_xm_include_list$ac_delim +host_xm_defines!$host_xm_defines$ac_delim +out_host_hook_obj!$out_host_hook_obj$ac_delim +install!$install$ac_delim +lang_opt_files!$lang_opt_files$ac_delim +lang_specs_files!$lang_specs_files$ac_delim +lang_tree_files!$lang_tree_files$ac_delim +local_prefix!$local_prefix$ac_delim +md_file!$md_file$ac_delim +objc_boehm_gc!$objc_boehm_gc$ac_delim +out_file!$out_file$ac_delim +out_cxx_file!$out_cxx_file$ac_delim +out_object_file!$out_object_file$ac_delim +out_cxx_object_file!$out_cxx_object_file$ac_delim +stage_prefix_set_by_configure!$stage_prefix_set_by_configure$ac_delim +quoted_stage_prefix_set_by_configure!$quoted_stage_prefix_set_by_configure$ac_delim +thread_file!$thread_file$ac_delim +tm_file_list!$tm_file_list$ac_delim +tm_include_list!$tm_include_list$ac_delim +tm_defines!$tm_defines$ac_delim +tm_p_file_list!$tm_p_file_list$ac_delim +tm_p_include_list!$tm_p_include_list$ac_delim +xm_file_list!$xm_file_list$ac_delim +xm_include_list!$xm_include_list$ac_delim +xm_defines!$xm_defines$ac_delim +c_target_objs!$c_target_objs$ac_delim +cxx_target_objs!$cxx_target_objs$ac_delim +target_cpu_default!$target_cpu_default$ac_delim +GMPLIBS!$GMPLIBS$ac_delim +GMPINC!$GMPINC$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 32; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-3.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof _ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + case $ac_mode in + :F) + # + # CONFIG_FILE + # - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." +_ACEOF - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -18063,364 +20355,139 @@ cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s, at configure_input@,$configure_input,;t t -s, at srcdir@,$ac_srcdir,;t t -s, at abs_srcdir@,$ac_abs_srcdir,;t t -s, at top_srcdir@,$ac_top_srcdir,;t t -s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s, at builddir@,$ac_builddir,;t t -s, at abs_builddir@,$ac_abs_builddir,;t t -s, at top_builddir@,$ac_top_builddir,;t t -s, at abs_top_builddir@,$ac_abs_top_builddir,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + rm -f "$tmp/stdin" case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null +while : do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs +rm -f conftest.defines conftest.tail +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac + rm -f "$tmp/out12" + ;; -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - default ) + case $ac_file$ac_mode in + "default":C) case ${CONFIG_HEADERS} in *auto-host.h:config.in*) echo > cstamp-h ;; @@ -18451,11 +20518,10 @@ ;; esac ;; + esac -done -_ACEOF +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF Modified: llvm-gcc-4.2/trunk/gcc/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/configure.ac?rev=106681&r1=106680&r2=106681&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/configure.ac (original) +++ llvm-gcc-4.2/trunk/gcc/configure.ac Wed Jun 23 16:16:46 2010 @@ -1466,6 +1466,13 @@ ;; esac +# Check if we have a particular darwin crash reporter library. +case ${host} in + *-*-darwin*) + AC_CHECK_LIB(CrashReporterClient, gCRAnnotations) + ;; +esac + # --------- # Threading # --------- From bruno.cardoso at gmail.com Wed Jun 23 16:30:27 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Wed, 23 Jun 2010 21:30:27 -0000 Subject: [llvm-commits] [llvm] r106683 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/MC/AsmParser/X86/x86_32-encoding.s Message-ID: <20100623213027.53B482A6C12C@llvm.org> Author: bruno Date: Wed Jun 23 16:30:27 2010 New Revision: 106683 URL: http://llvm.org/viewvc/llvm-project?rev=106683&view=rev Log: Add AVX MOVMSK{PS,PD}rr instructions Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106683&r1=106682&r2=106683&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Wed Jun 23 16:30:27 2010 @@ -1456,13 +1456,26 @@ } // AddedComplexity } // Constraints = "$src1 = $dst" +multiclass sse12_extr_sign_mask { + def rr : PI<0x50, MRMSrcReg, (outs GR32:$dst), (ins RC:$src), + !strconcat(asm, "\t{$src, $dst|$dst, $src}"), + [(set GR32:$dst, (Int RC:$src))], d>; +} + // Mask creation -def MOVMSKPSrr : PSI<0x50, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src), - "movmskps\t{$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse_movmsk_ps VR128:$src))]>; -def MOVMSKPDrr : PDI<0x50, MRMSrcReg, (outs GR32:$dst), (ins VR128:$src), - "movmskpd\t{$src, $dst|$dst, $src}", - [(set GR32:$dst, (int_x86_sse2_movmsk_pd VR128:$src))]>; +defm MOVMSKPS : sse12_extr_sign_mask, TB; +defm MOVMSKPD : sse12_extr_sign_mask, TB, OpSize; + +let isAsmParserOnly = 1 in { + defm VMOVMSKPS : sse12_extr_sign_mask, VEX; + defm VMOVMSKPD : sse12_extr_sign_mask, OpSize, + VEX; +} // Prefetch intrinsic. def PREFETCHT0 : PSI<0x18, MRM1m, (outs), (ins i8mem:$src), Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=106683&r1=106682&r2=106683&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Wed Jun 23 16:30:27 2010 @@ -10517,3 +10517,12 @@ // CHECK: vcmppd $3, -4(%ebx,%ecx,8), %xmm2, %xmm3 // CHECK: encoding: [0xc5,0xe9,0xc2,0x5c,0xcb,0xfc,0x03] vcmpunordpd -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vmovmskps %xmm2, %eax +// CHECK: encoding: [0xc5,0xf8,0x50,0xc2] + vmovmskps %xmm2, %eax + +// CHECK: vmovmskpd %xmm2, %eax +// CHECK: encoding: [0xc5,0xf9,0x50,0xc2] + vmovmskpd %xmm2, %eax + From ggreif at gmail.com Wed Jun 23 16:41:47 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 23 Jun 2010 21:41:47 -0000 Subject: [llvm-commits] [llvm] r106685 - /llvm/trunk/lib/Analysis/MemoryBuiltins.cpp Message-ID: <20100623214147.72DD12A6C12E@llvm.org> Author: ggreif Date: Wed Jun 23 16:41:47 2010 New Revision: 106685 URL: http://llvm.org/viewvc/llvm-project?rev=106685&view=rev Log: use ArgOperand getters Modified: llvm/trunk/lib/Analysis/MemoryBuiltins.cpp Modified: llvm/trunk/lib/Analysis/MemoryBuiltins.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryBuiltins.cpp?rev=106685&r1=106684&r2=106685&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryBuiltins.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryBuiltins.cpp Wed Jun 23 16:41:47 2010 @@ -101,9 +101,9 @@ if (const StructType *ST = dyn_cast(T)) ElementSize = TD->getStructLayout(ST)->getSizeInBytes(); - // If malloc calls' arg can be determined to be a multiple of ElementSize, + // If malloc call's arg can be determined to be a multiple of ElementSize, // return the multiple. Otherwise, return NULL. - Value *MallocArg = CI->getOperand(1); + Value *MallocArg = CI->getArgOperand(0); Value *Multiple = NULL; if (ComputeMultiple(MallocArg, ElementSize, Multiple, LookThroughSExt)) @@ -120,7 +120,7 @@ Value *ArraySize = computeArraySize(CI, TD); if (ArraySize && - ArraySize != ConstantInt::get(CI->getOperand(1)->getType(), 1)) + ArraySize != ConstantInt::get(CI->getArgOperand(0)->getType(), 1)) return CI; // CI is a non-array malloc or we can't figure out that it is an array malloc. From ggreif at gmail.com Wed Jun 23 16:51:12 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 23 Jun 2010 21:51:12 -0000 Subject: [llvm-commits] [llvm] r106686 - in /llvm/trunk: include/llvm/Analysis/MemoryBuiltins.h lib/Analysis/MemoryBuiltins.cpp Message-ID: <20100623215112.A16032A6C12C@llvm.org> Author: ggreif Date: Wed Jun 23 16:51:12 2010 New Revision: 106686 URL: http://llvm.org/viewvc/llvm-project?rev=106686&view=rev Log: minor enhancement to llvm::isFreeCall API: return CallInst; no functional change Modified: llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h llvm/trunk/lib/Analysis/MemoryBuiltins.cpp Modified: llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h?rev=106686&r1=106685&r2=106686&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h (original) +++ llvm/trunk/include/llvm/Analysis/MemoryBuiltins.h Wed Jun 23 16:51:12 2010 @@ -72,8 +72,8 @@ // free Call Utility Functions. // -/// isFreeCall - Returns true if the value is a call to the builtin free() -bool isFreeCall(const Value *I); +/// isFreeCall - Returns non-null if the value is a call to the builtin free() +const CallInst *isFreeCall(const Value *I); } // End llvm namespace Modified: llvm/trunk/lib/Analysis/MemoryBuiltins.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryBuiltins.cpp?rev=106686&r1=106685&r2=106686&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryBuiltins.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryBuiltins.cpp Wed Jun 23 16:51:12 2010 @@ -183,25 +183,25 @@ // free Call Utility Functions. // -/// isFreeCall - Returns true if the value is a call to the builtin free() -bool llvm::isFreeCall(const Value *I) { +/// isFreeCall - Returns non-null if the value is a call to the builtin free() +const CallInst *llvm::isFreeCall(const Value *I) { const CallInst *CI = dyn_cast(I); if (!CI) - return false; + return 0; Function *Callee = CI->getCalledFunction(); if (Callee == 0 || !Callee->isDeclaration() || Callee->getName() != "free") - return false; + return 0; // Check free prototype. // FIXME: workaround for PR5130, this will be obsolete when a nobuiltin // attribute will exist. const FunctionType *FTy = Callee->getFunctionType(); if (!FTy->getReturnType()->isVoidTy()) - return false; + return 0; if (FTy->getNumParams() != 1) - return false; + return 0; if (FTy->param_begin()->get() != Type::getInt8PtrTy(Callee->getContext())) - return false; + return 0; - return true; + return CI; } From echristo at apple.com Wed Jun 23 17:30:09 2010 From: echristo at apple.com (Eric Christopher) Date: Wed, 23 Jun 2010 22:30:09 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r106690 - in /llvm-gcc-4.2/trunk/gcc: c-cppbuiltin.c testsuite/gcc.apple/tls-1.c Message-ID: <20100623223009.497472A6C12D@llvm.org> Author: echristo Date: Wed Jun 23 17:30:09 2010 New Revision: 106690 URL: http://llvm.org/viewvc/llvm-project?rev=106690&view=rev Log: Add a preprocessor definition if we have TLS enabled. And a test. Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/tls-1.c Modified: llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c Modified: llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c?rev=106690&r1=106689&r2=106690&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c Wed Jun 23 17:30:09 2010 @@ -639,6 +639,11 @@ if (flag_openmp) cpp_define (pfile, "_OPENMP=200505"); + /* LLVM LOCAL begin tls */ + if (targetm.have_tls) + cpp_define (pfile, "__HAS_TLS__"); + /* LLVM LOCAL end tls */ + /* A straightforward target hook doesn't work, because of problems linking that hook's body when part of non-C front ends. */ # define preprocessing_asm_p() (cpp_get_options (pfile)->lang == CLK_ASM) Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/tls-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/tls-1.c?rev=106690&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/tls-1.c (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/tls-1.c Wed Jun 23 17:30:09 2010 @@ -0,0 +1,8 @@ +/* Make sure we're emitting the __HAS_TLS__ symbol if we have tls. */ +/* { dg-require-effective-target tls } */ + +#ifdef __HAS_TLS__ +extern __thread int a; +#else +#error "No TLS!" +#endif From ggreif at gmail.com Wed Jun 23 17:48:06 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 23 Jun 2010 22:48:06 -0000 Subject: [llvm-commits] [llvm] r106692 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Message-ID: <20100623224806.EE1DB2A6C12C@llvm.org> Author: ggreif Date: Wed Jun 23 17:48:06 2010 New Revision: 106692 URL: http://llvm.org/viewvc/llvm-project?rev=106692&view=rev Log: use the new isFreeCall API and ArgOperand accessors Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=106692&r1=106691&r2=106692&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Wed Jun 23 17:48:06 2010 @@ -116,8 +116,8 @@ } else if (VAArgInst *V = dyn_cast(Inst)) { Pointer = V->getOperand(0); PointerSize = AA->getTypeStoreSize(V->getType()); - } else if (isFreeCall(Inst)) { - Pointer = Inst->getOperand(1); + } else if (const CallInst *CI = isFreeCall(Inst)) { + Pointer = CI->getArgOperand(0); // calls to free() erase the entire structure PointerSize = ~0ULL; } else if (isa(Inst) || isa(Inst)) { @@ -197,9 +197,9 @@ // pointer, not on query pointers that are indexed off of them. It'd // be nice to handle that at some point. AliasAnalysis::AliasResult R = - AA->alias(II->getOperand(3), ~0U, MemPtr, ~0U); + AA->alias(II->getArgOperand(2), ~0U, MemPtr, ~0U); if (R == AliasAnalysis::MustAlias) { - InvariantTag = II->getOperand(1); + InvariantTag = II->getArgOperand(0); continue; } @@ -210,7 +210,7 @@ // pointer, not on query pointers that are indexed off of them. It'd // be nice to handle that at some point. AliasAnalysis::AliasResult R = - AA->alias(II->getOperand(2), ~0U, MemPtr, ~0U); + AA->alias(II->getArgOperand(1), ~0U, MemPtr, ~0U); if (R == AliasAnalysis::MustAlias) return MemDepResult::getDef(II); } @@ -365,25 +365,26 @@ MemPtr = LI->getPointerOperand(); MemSize = AA->getTypeStoreSize(LI->getType()); } - } else if (isFreeCall(QueryInst)) { - MemPtr = QueryInst->getOperand(1); + } else if (const CallInst *CI = isFreeCall(QueryInst)) { + MemPtr = CI->getArgOperand(0); // calls to free() erase the entire structure, not just a field. MemSize = ~0UL; } else if (isa(QueryInst) || isa(QueryInst)) { int IntrinsicID = 0; // Intrinsic IDs start at 1. - if (IntrinsicInst *II = dyn_cast(QueryInst)) + IntrinsicInst *II = dyn_cast(QueryInst); + if (II) IntrinsicID = II->getIntrinsicID(); switch (IntrinsicID) { case Intrinsic::lifetime_start: case Intrinsic::lifetime_end: case Intrinsic::invariant_start: - MemPtr = QueryInst->getOperand(2); - MemSize = cast(QueryInst->getOperand(1))->getZExtValue(); + MemPtr = II->getArgOperand(1); + MemSize = cast(II->getArgOperand(0))->getZExtValue(); break; case Intrinsic::invariant_end: - MemPtr = QueryInst->getOperand(3); - MemSize = cast(QueryInst->getOperand(2))->getZExtValue(); + MemPtr = II->getArgOperand(2); + MemSize = cast(II->getArgOperand(1))->getZExtValue(); break; default: CallSite QueryCS = CallSite::get(QueryInst); From isanbard at gmail.com Wed Jun 23 18:00:16 2010 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 23 Jun 2010 23:00:16 -0000 Subject: [llvm-commits] [llvm] r106693 - in /llvm/trunk: lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h test/CodeGen/ARM/lsr-on-unrolled-loops.ll Message-ID: <20100623230016.A72AF2A6C12C@llvm.org> Author: void Date: Wed Jun 23 18:00:16 2010 New Revision: 106693 URL: http://llvm.org/viewvc/llvm-project?rev=106693&view=rev Log: We are missing opportunites to use ldm. Take code like this: void t(int *cp0, int *cp1, int *dp, int fmd) { int c0, c1, d0, d1, d2, d3; c0 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000); c1 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000); /* ... */ } It code gens into something pretty bad. But with this change (analogous to the X86 back-end), it will use ldm and generate few instructions. Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h llvm/trunk/test/CodeGen/ARM/lsr-on-unrolled-loops.ll Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=106693&r1=106692&r2=106693&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Wed Jun 23 18:00:16 2010 @@ -1306,6 +1306,107 @@ return MI0->isIdenticalTo(MI1, MachineInstr::IgnoreVRegDefs); } +/// areLoadsFromSameBasePtr - This is used by the pre-regalloc scheduler to +/// determine if two loads are loading from the same base address. It should +/// only return true if the base pointers are the same and the only differences +/// between the two addresses is the offset. It also returns the offsets by +/// reference. +bool ARMBaseInstrInfo::areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2, + int64_t &Offset1, + int64_t &Offset2) const { + // Don't worry about Thumb: just ARM and Thumb2. + if (Subtarget.isThumb1Only()) return false; + + if (!Load1->isMachineOpcode() || !Load2->isMachineOpcode()) + return false; + + switch (Load1->getMachineOpcode()) { + default: + return false; + case ARM::LDR: + case ARM::LDRB: + case ARM::LDRD: + case ARM::LDRH: + case ARM::LDRSB: + case ARM::LDRSH: + case ARM::VLDRD: + case ARM::VLDRS: + case ARM::t2LDRi8: + case ARM::t2LDRDi8: + case ARM::t2LDRSHi8: + case ARM::t2LDRi12: + case ARM::t2LDRSHi12: + break; + } + + switch (Load2->getMachineOpcode()) { + default: + return false; + case ARM::LDR: + case ARM::LDRB: + case ARM::LDRD: + case ARM::LDRH: + case ARM::LDRSB: + case ARM::LDRSH: + case ARM::VLDRD: + case ARM::VLDRS: + case ARM::t2LDRi8: + case ARM::t2LDRDi8: + case ARM::t2LDRSHi8: + case ARM::t2LDRi12: + case ARM::t2LDRSHi12: + break; + } + + // Check if base addresses and chain operands match. + if (Load1->getOperand(0) != Load2->getOperand(0) || + Load1->getOperand(4) != Load2->getOperand(4)) + return false; + + // Index should be Reg0. + if (Load1->getOperand(3) != Load2->getOperand(3)) + return false; + + // Determine the offsets. + if (isa(Load1->getOperand(1)) && + isa(Load2->getOperand(1))) { + Offset1 = cast(Load1->getOperand(1))->getSExtValue(); + Offset2 = cast(Load2->getOperand(1))->getSExtValue(); + return true; + } + + return false; +} + +/// shouldScheduleLoadsNear - This is a used by the pre-regalloc scheduler to +/// determine (in conjuction with areLoadsFromSameBasePtr) if two loads should +/// be scheduled togther. On some targets if two loads are loading from +/// addresses in the same cache line, it's better if they are scheduled +/// together. This function takes two integers that represent the load offsets +/// from the common base address. It returns true if it decides it's desirable +/// to schedule the two loads together. "NumLoads" is the number of loads that +/// have already been scheduled after Load1. +bool ARMBaseInstrInfo::shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2, + int64_t Offset1, int64_t Offset2, + unsigned NumLoads) const { + // Don't worry about Thumb: just ARM and Thumb2. + if (Subtarget.isThumb1Only()) return false; + + assert(Offset2 > Offset1); + + if ((Offset2 - Offset1) / 8 > 64) + return false; + + if (Load1->getMachineOpcode() != Load2->getMachineOpcode()) + return false; // FIXME: overly conservative? + + // Four loads in a row should be sufficient. + if (NumLoads >= 3) + return false; + + return true; +} + bool ARMBaseInstrInfo::isSchedulingBoundary(const MachineInstr *MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const { Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=106693&r1=106692&r2=106693&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Wed Jun 23 18:00:16 2010 @@ -320,6 +320,26 @@ virtual bool produceSameValue(const MachineInstr *MI0, const MachineInstr *MI1) const; + /// areLoadsFromSameBasePtr - This is used by the pre-regalloc scheduler to + /// determine if two loads are loading from the same base address. It should + /// only return true if the base pointers are the same and the only + /// differences between the two addresses is the offset. It also returns the + /// offsets by reference. + virtual bool areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2, + int64_t &Offset1, int64_t &Offset2)const; + + /// shouldScheduleLoadsNear - This is a used by the pre-regalloc scheduler to + /// determine (in conjuction with areLoadsFromSameBasePtr) if two loads should + /// be scheduled togther. On some targets if two loads are loading from + /// addresses in the same cache line, it's better if they are scheduled + /// together. This function takes two integers that represent the load offsets + /// from the common base address. It returns true if it decides it's desirable + /// to schedule the two loads together. "NumLoads" is the number of loads that + /// have already been scheduled after Load1. + virtual bool shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2, + int64_t Offset1, int64_t Offset2, + unsigned NumLoads) const; + virtual bool isSchedulingBoundary(const MachineInstr *MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const; Modified: llvm/trunk/test/CodeGen/ARM/lsr-on-unrolled-loops.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/lsr-on-unrolled-loops.ll?rev=106693&r1=106692&r2=106693&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/lsr-on-unrolled-loops.ll (original) +++ llvm/trunk/test/CodeGen/ARM/lsr-on-unrolled-loops.ll Wed Jun 23 18:00:16 2010 @@ -626,9 +626,11 @@ ; LSR should use count-down iteration to avoid requiring the trip count ; in a register, and it shouldn't require any reloads here. -; CHECK: subs r3, #1 -; CHECK-NEXT: cmp r3, #0 -; CHECK-NEXT: bne.w +; CHECK: @ %bb24 +; CHECK-NEXT: @ in Loop: Header=BB1_1 Depth=1 +; CHECK-NEXT: sub{{.*}} [[REGISTER:r[0-9]+]], #1 +; CHECK-NEXT: cmp{{.*}} [[REGISTER]], #0 +; CHECK-NEXT: bne.w %92 = icmp eq i32 %tmp81, %indvar78 ; [#uses=1] %indvar.next79 = add i32 %indvar78, 1 ; [#uses=1] From grosbach at apple.com Wed Jun 23 18:29:50 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 23 Jun 2010 16:29:50 -0700 Subject: [llvm-commits] [llvm] r106693 - in /llvm/trunk: lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h test/CodeGen/ARM/lsr-on-unrolled-loops.ll In-Reply-To: <20100623230016.A72AF2A6C12C@llvm.org> References: <20100623230016.A72AF2A6C12C@llvm.org> Message-ID: Fantastic! Thanks, Bill. On Jun 23, 2010, at 4:00 PM, Bill Wendling wrote: > Author: void > Date: Wed Jun 23 18:00:16 2010 > New Revision: 106693 > > URL: http://llvm.org/viewvc/llvm-project?rev=106693&view=rev > Log: > We are missing opportunites to use ldm. Take code like this: > > void t(int *cp0, int *cp1, int *dp, int fmd) { > int c0, c1, d0, d1, d2, d3; > c0 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000); > c1 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000); > /* ... */ > } > > It code gens into something pretty bad. But with this change (analogous to the > X86 back-end), it will use ldm and generate few instructions. > > Modified: > llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp > llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h > llvm/trunk/test/CodeGen/ARM/lsr-on-unrolled-loops.ll > > Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=106693&r1=106692&r2=106693&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original) > +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Wed Jun 23 18:00:16 2010 > @@ -1306,6 +1306,107 @@ > return MI0->isIdenticalTo(MI1, MachineInstr::IgnoreVRegDefs); > } > > +/// areLoadsFromSameBasePtr - This is used by the pre-regalloc scheduler to > +/// determine if two loads are loading from the same base address. It should > +/// only return true if the base pointers are the same and the only differences > +/// between the two addresses is the offset. It also returns the offsets by > +/// reference. > +bool ARMBaseInstrInfo::areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2, > + int64_t &Offset1, > + int64_t &Offset2) const { > + // Don't worry about Thumb: just ARM and Thumb2. > + if (Subtarget.isThumb1Only()) return false; > + > + if (!Load1->isMachineOpcode() || !Load2->isMachineOpcode()) > + return false; > + > + switch (Load1->getMachineOpcode()) { > + default: > + return false; > + case ARM::LDR: > + case ARM::LDRB: > + case ARM::LDRD: > + case ARM::LDRH: > + case ARM::LDRSB: > + case ARM::LDRSH: > + case ARM::VLDRD: > + case ARM::VLDRS: > + case ARM::t2LDRi8: > + case ARM::t2LDRDi8: > + case ARM::t2LDRSHi8: > + case ARM::t2LDRi12: > + case ARM::t2LDRSHi12: > + break; > + } > + > + switch (Load2->getMachineOpcode()) { > + default: > + return false; > + case ARM::LDR: > + case ARM::LDRB: > + case ARM::LDRD: > + case ARM::LDRH: > + case ARM::LDRSB: > + case ARM::LDRSH: > + case ARM::VLDRD: > + case ARM::VLDRS: > + case ARM::t2LDRi8: > + case ARM::t2LDRDi8: > + case ARM::t2LDRSHi8: > + case ARM::t2LDRi12: > + case ARM::t2LDRSHi12: > + break; > + } > + > + // Check if base addresses and chain operands match. > + if (Load1->getOperand(0) != Load2->getOperand(0) || > + Load1->getOperand(4) != Load2->getOperand(4)) > + return false; > + > + // Index should be Reg0. > + if (Load1->getOperand(3) != Load2->getOperand(3)) > + return false; > + > + // Determine the offsets. > + if (isa(Load1->getOperand(1)) && > + isa(Load2->getOperand(1))) { > + Offset1 = cast(Load1->getOperand(1))->getSExtValue(); > + Offset2 = cast(Load2->getOperand(1))->getSExtValue(); > + return true; > + } > + > + return false; > +} > + > +/// shouldScheduleLoadsNear - This is a used by the pre-regalloc scheduler to > +/// determine (in conjuction with areLoadsFromSameBasePtr) if two loads should > +/// be scheduled togther. On some targets if two loads are loading from > +/// addresses in the same cache line, it's better if they are scheduled > +/// together. This function takes two integers that represent the load offsets > +/// from the common base address. It returns true if it decides it's desirable > +/// to schedule the two loads together. "NumLoads" is the number of loads that > +/// have already been scheduled after Load1. > +bool ARMBaseInstrInfo::shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2, > + int64_t Offset1, int64_t Offset2, > + unsigned NumLoads) const { > + // Don't worry about Thumb: just ARM and Thumb2. > + if (Subtarget.isThumb1Only()) return false; > + > + assert(Offset2 > Offset1); > + > + if ((Offset2 - Offset1) / 8 > 64) > + return false; > + > + if (Load1->getMachineOpcode() != Load2->getMachineOpcode()) > + return false; // FIXME: overly conservative? > + > + // Four loads in a row should be sufficient. > + if (NumLoads >= 3) > + return false; > + > + return true; > +} > + > bool ARMBaseInstrInfo::isSchedulingBoundary(const MachineInstr *MI, > const MachineBasicBlock *MBB, > const MachineFunction &MF) const { > > Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h?rev=106693&r1=106692&r2=106693&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h (original) > +++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.h Wed Jun 23 18:00:16 2010 > @@ -320,6 +320,26 @@ > virtual bool produceSameValue(const MachineInstr *MI0, > const MachineInstr *MI1) const; > > + /// areLoadsFromSameBasePtr - This is used by the pre-regalloc scheduler to > + /// determine if two loads are loading from the same base address. It should > + /// only return true if the base pointers are the same and the only > + /// differences between the two addresses is the offset. It also returns the > + /// offsets by reference. > + virtual bool areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2, > + int64_t &Offset1, int64_t &Offset2)const; > + > + /// shouldScheduleLoadsNear - This is a used by the pre-regalloc scheduler to > + /// determine (in conjuction with areLoadsFromSameBasePtr) if two loads should > + /// be scheduled togther. On some targets if two loads are loading from > + /// addresses in the same cache line, it's better if they are scheduled > + /// together. This function takes two integers that represent the load offsets > + /// from the common base address. It returns true if it decides it's desirable > + /// to schedule the two loads together. "NumLoads" is the number of loads that > + /// have already been scheduled after Load1. > + virtual bool shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2, > + int64_t Offset1, int64_t Offset2, > + unsigned NumLoads) const; > + > virtual bool isSchedulingBoundary(const MachineInstr *MI, > const MachineBasicBlock *MBB, > const MachineFunction &MF) const; > > Modified: llvm/trunk/test/CodeGen/ARM/lsr-on-unrolled-loops.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/lsr-on-unrolled-loops.ll?rev=106693&r1=106692&r2=106693&view=diff > ============================================================================== > --- llvm/trunk/test/CodeGen/ARM/lsr-on-unrolled-loops.ll (original) > +++ llvm/trunk/test/CodeGen/ARM/lsr-on-unrolled-loops.ll Wed Jun 23 18:00:16 2010 > @@ -626,9 +626,11 @@ > ; LSR should use count-down iteration to avoid requiring the trip count > ; in a register, and it shouldn't require any reloads here. > > -; CHECK: subs r3, #1 > -; CHECK-NEXT: cmp r3, #0 > -; CHECK-NEXT: bne.w > +; CHECK: @ %bb24 > +; CHECK-NEXT: @ in Loop: Header=BB1_1 Depth=1 > +; CHECK-NEXT: sub{{.*}} [[REGISTER:r[0-9]+]], #1 > +; CHECK-NEXT: cmp{{.*}} [[REGISTER]], #0 > +; CHECK-NEXT: bne.w > > %92 = icmp eq i32 %tmp81, %indvar78 ; [#uses=1] > %indvar.next79 = add i32 %indvar78, 1 ; [#uses=1] > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From echristo at apple.com Wed Jun 23 18:34:40 2010 From: echristo at apple.com (Eric Christopher) Date: Wed, 23 Jun 2010 23:34:40 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r106696 - in /llvm-gcc-4.2/trunk/gcc: configure configure.ac Message-ID: <20100623233440.AFBBA2A6C12C@llvm.org> Author: echristo Date: Wed Jun 23 18:34:40 2010 New Revision: 106696 URL: http://llvm.org/viewvc/llvm-project?rev=106696&view=rev Log: Add tls configure support for darwin tls on x86_64 and i386. Modified: llvm-gcc-4.2/trunk/gcc/configure llvm-gcc-4.2/trunk/gcc/configure.ac Modified: llvm-gcc-4.2/trunk/gcc/configure URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/configure?rev=106696&r1=106695&r2=106696&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/configure (original) +++ llvm-gcc-4.2/trunk/gcc/configure Wed Jun 23 18:34:40 2010 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60. +# Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -10,7 +10,8 @@ ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -19,10 +20,13 @@ alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh + + # PATH needs CR @@ -215,7 +219,7 @@ else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. @@ -233,7 +237,6 @@ # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF -# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -242,10 +245,12 @@ alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh + : _ASEOF @@ -253,7 +258,6 @@ CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF -# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -262,10 +266,12 @@ alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh + : (as_func_return () { @@ -512,19 +518,28 @@ as_mkdir_p=false fi -# Find out whether ``test -x'' works. Don't use a zero-byte file, as -# systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - as_executable_p="test -x" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' else - as_executable_p=: + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' fi -rm -f conf$$.file +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -565,36 +580,36 @@ # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include #endif -#if HAVE_STDINT_H +#ifdef HAVE_STDINT_H # include #endif -#if HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H # include #endif" @@ -828,6 +843,7 @@ CC CFLAGS LDFLAGS +LIBS CPPFLAGS CPP GMPLIBS @@ -937,10 +953,10 @@ -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) @@ -956,10 +972,10 @@ -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ @@ -1153,19 +1169,19 @@ -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) @@ -1500,6 +1516,7 @@ CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor @@ -1570,7 +1587,7 @@ if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.60 +generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -1584,7 +1601,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.60. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2463,7 +2480,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2503,7 +2520,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2560,7 +2577,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2601,7 +2618,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2659,7 +2676,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2703,7 +2720,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2844,7 +2861,7 @@ # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. -for ac_file in $ac_files +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in @@ -2872,6 +2889,12 @@ test "$ac_cv_exeext" = no && ac_cv_exeext= else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2883,8 +2906,6 @@ fi ac_exeext=$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. @@ -3062,27 +3083,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 @@ -3137,27 +3141,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 @@ -3192,27 +3179,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 @@ -3248,27 +3218,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 @@ -3384,27 +3337,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 @@ -3537,7 +3473,7 @@ else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi -rm -f core conftest* +rm -f -r core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then @@ -3642,17 +3578,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3686,17 +3615,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3761,17 +3683,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3805,17 +3720,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3882,27 +3790,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 @@ -3959,7 +3850,7 @@ for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -4041,7 +3932,7 @@ for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -4137,27 +4028,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 @@ -4185,7 +4059,7 @@ else ac_cv_header_stdc=no fi -rm -f conftest* +rm -f -r conftest* fi @@ -4206,7 +4080,7 @@ else ac_cv_header_stdc=no fi -rm -f conftest* +rm -f -r conftest* fi @@ -4333,27 +4207,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 @@ -4414,27 +4271,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_void_p=yes else echo "$as_me: failed program was:" >&5 @@ -4448,16 +4288,15 @@ { echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 echo "${ECHO_T}$ac_cv_type_void_p" >&6; } +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of void *" >&5 echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_void_p" = yes; then - # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4467,7 +4306,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; + typedef void * ac__type_sizeof_; int main () { @@ -4491,27 +4330,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4521,7 +4343,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; + typedef void * ac__type_sizeof_; int main () { @@ -4545,27 +4367,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -4592,7 +4397,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; + typedef void * ac__type_sizeof_; int main () { @@ -4616,27 +4421,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4646,7 +4434,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; + typedef void * ac__type_sizeof_; int main () { @@ -4670,27 +4458,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -4727,7 +4498,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; + typedef void * ac__type_sizeof_; int main () { @@ -4751,27 +4522,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -4784,11 +4538,15 @@ done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) +'') if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -4798,7 +4556,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; + typedef void * ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -4857,21 +4615,25 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) +if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_void_p=0 -fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF @@ -4914,27 +4676,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 @@ -4948,16 +4693,15 @@ { echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 echo "${ECHO_T}$ac_cv_type_short" >&6; } +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of short" >&5 echo $ECHO_N "checking size of short... $ECHO_C" >&6; } if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_short" = yes; then - # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4967,7 +4711,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; int main () { @@ -4991,27 +4735,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5021,7 +4748,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; int main () { @@ -5045,27 +4772,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -5092,7 +4802,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; int main () { @@ -5116,27 +4826,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5146,7 +4839,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; int main () { @@ -5170,27 +4863,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -5227,7 +4903,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; int main () { @@ -5251,27 +4927,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -5284,11 +4943,15 @@ done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) +'') if test "$ac_cv_type_short" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_short=0 + fi ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -5298,7 +4961,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -5357,21 +5020,25 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short) +if test "$ac_cv_type_short" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } + else + ac_cv_sizeof_short=0 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_short=0 -fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF @@ -5414,27 +5081,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 @@ -5448,16 +5098,15 @@ { echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6; } +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of int" >&5 echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_int" = yes; then - # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -5467,7 +5116,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; + typedef int ac__type_sizeof_; int main () { @@ -5491,27 +5140,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5521,7 +5153,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; + typedef int ac__type_sizeof_; int main () { @@ -5545,27 +5177,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -5592,7 +5207,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; + typedef int ac__type_sizeof_; int main () { @@ -5616,27 +5231,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5646,7 +5244,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; + typedef int ac__type_sizeof_; int main () { @@ -5670,27 +5268,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -5727,7 +5308,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; + typedef int ac__type_sizeof_; int main () { @@ -5751,27 +5332,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -5784,11 +5348,15 @@ done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) +'') if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -5798,7 +5366,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; + typedef int ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -5857,21 +5425,25 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int) +if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int=0 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_int=0 -fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF @@ -5914,27 +5486,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 @@ -5948,16 +5503,15 @@ { echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6; } +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long" = yes; then - # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -5967,7 +5521,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; + typedef long ac__type_sizeof_; int main () { @@ -5991,27 +5545,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -6021,7 +5558,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; + typedef long ac__type_sizeof_; int main () { @@ -6045,27 +5582,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -6092,7 +5612,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; + typedef long ac__type_sizeof_; int main () { @@ -6116,27 +5636,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -6146,7 +5649,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; + typedef long ac__type_sizeof_; int main () { @@ -6170,27 +5673,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -6227,7 +5713,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; + typedef long ac__type_sizeof_; int main () { @@ -6251,27 +5737,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -6284,11 +5753,15 @@ done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) +'') if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -6298,7 +5771,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; + typedef long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -6357,21 +5830,25 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long) +if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_long=0 -fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF @@ -6414,27 +5891,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 @@ -6490,27 +5950,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 @@ -6524,16 +5967,15 @@ { echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6; } +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long long" >&5 echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long_long" = yes; then - # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -6543,7 +5985,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; + typedef long long ac__type_sizeof_; int main () { @@ -6567,27 +6009,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -6597,7 +6022,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; + typedef long long ac__type_sizeof_; int main () { @@ -6621,27 +6046,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -6668,7 +6076,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; + typedef long long ac__type_sizeof_; int main () { @@ -6692,27 +6100,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -6722,7 +6113,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; + typedef long long ac__type_sizeof_; int main () { @@ -6746,27 +6137,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -6803,7 +6177,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; + typedef long long ac__type_sizeof_; int main () { @@ -6827,27 +6201,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -6860,11 +6217,15 @@ done case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) +'') if test "$ac_cv_type_long_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long_long=0 + fi ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -6874,7 +6235,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; + typedef long long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -6933,21 +6294,25 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) +if test "$ac_cv_type_long_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long_long=0 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_long_long=0 -fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF @@ -6992,27 +6357,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type___int64=yes else echo "$as_me: failed program was:" >&5 @@ -7068,27 +6416,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type___int64=yes else echo "$as_me: failed program was:" >&5 @@ -7102,16 +6433,15 @@ { echo "$as_me:$LINENO: result: $ac_cv_type___int64" >&5 echo "${ECHO_T}$ac_cv_type___int64" >&6; } +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of __int64" >&5 echo $ECHO_N "checking size of __int64... $ECHO_C" >&6; } if test "${ac_cv_sizeof___int64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type___int64" = yes; then - # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -7121,51 +6451,34 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef __int64 ac__type_sizeof_; + typedef __int64 ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -7175,7 +6488,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef __int64 ac__type_sizeof_; + typedef __int64 ac__type_sizeof_; int main () { @@ -7199,27 +6512,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -7246,7 +6542,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef __int64 ac__type_sizeof_; + typedef __int64 ac__type_sizeof_; int main () { @@ -7270,27 +6566,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -7300,7 +6579,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef __int64 ac__type_sizeof_; + typedef __int64 ac__type_sizeof_; int main () { @@ -7324,27 +6603,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -7381,7 +6643,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef __int64 ac__type_sizeof_; + typedef __int64 ac__type_sizeof_; int main () { @@ -7405,27 +6667,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -7438,11 +6683,15 @@ done case $ac_lo in ?*) ac_cv_sizeof___int64=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64) +'') if test "$ac_cv_type___int64" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (__int64) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof___int64=0 + fi ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -7452,7 +6701,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef __int64 ac__type_sizeof_; + typedef __int64 ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -7511,21 +6760,25 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64) +if test "$ac_cv_type___int64" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (__int64) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (__int64) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } + else + ac_cv_sizeof___int64=0 + fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof___int64=0 -fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof___int64" >&5 echo "${ECHO_T}$ac_cv_sizeof___int64" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF___INT64 $ac_cv_sizeof___int64 _ACEOF @@ -7573,27 +6826,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_w_no_long_long=yes else echo "$as_me: failed program was:" >&5 @@ -7637,27 +6873,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_w_no_variadic_macros=yes else echo "$as_me: failed program was:" >&5 @@ -7701,27 +6920,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_w_no_overlength_strings=yes else echo "$as_me: failed program was:" >&5 @@ -7773,27 +6975,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_w_old_style_definition=yes else echo "$as_me: failed program was:" >&5 @@ -7841,27 +7026,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_w_missing_format_attribute=yes else echo "$as_me: failed program was:" >&5 @@ -7924,27 +7092,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_w_cxx_compat=yes else echo "$as_me: failed program was:" >&5 @@ -8177,27 +7328,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -8233,17 +7367,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -8328,17 +7455,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then gcc_cv_header_valgrind_memcheck_h=yes else echo "$as_me: failed program was:" >&5 @@ -8375,17 +7495,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then gcc_cv_header_memcheck_h=yes else echo "$as_me: failed program was:" >&5 @@ -8771,7 +7884,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8801,7 +7914,7 @@ else ac_prog_version=`$DSYMUTIL --version 2>&1 | sed -n 's/^.*.*dwarfutils.\([0-9]*\).*$/\1/p'` - echo "configure:8804: version of dsymutil is $ac_prog_version" >&5 + echo "configure:7917: version of dsymutil is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_dsymutil_modern=no;; 2[5-9]*) @@ -8844,7 +7957,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8874,7 +7987,7 @@ else ac_prog_version=`$DSYMUTIL --version 2>&1 | sed -n 's/^.*.*dwarfutils.\([0-9]*\).*$/\1/p'` - echo "configure:8877: version of dsymutil is $ac_prog_version" >&5 + echo "configure:7990: version of dsymutil is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_dsymutil_modern=no;; [3-9][0-9]*) @@ -9048,7 +8161,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9163,7 +8276,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9203,7 +8316,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9357,27 +8470,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 @@ -9411,19 +8507,12 @@ ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -9535,7 +8624,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_have_mktemp_command="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9580,7 +8669,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MAKEINFO="makeinfo" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9610,7 +8699,7 @@ else ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'` - echo "configure:9613: version of makeinfo is $ac_prog_version" >&5 + echo "configure:8702: version of makeinfo is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_makeinfo_modern=no;; 4.[4-9]* | 4.1[0-9]*) @@ -9673,7 +8762,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_FLEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9718,7 +8807,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_BISON="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9768,7 +8857,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9813,7 +8902,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -9878,27 +8967,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gcc_cv_glibc=yes else echo "$as_me: failed program was:" >&5 @@ -9962,27 +9034,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 @@ -10010,7 +9065,7 @@ else ac_cv_header_stdc=no fi -rm -f conftest* +rm -f -r conftest* fi @@ -10031,7 +9086,7 @@ else ac_cv_header_stdc=no fi -rm -f conftest* +rm -f -r conftest* fi @@ -10153,27 +9208,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 @@ -10228,27 +9266,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gcc_cv_header_string=yes else echo "$as_me: failed program was:" >&5 @@ -10312,27 +9333,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 @@ -10406,17 +9410,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 @@ -10465,17 +9462,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_cv_header_thread_h=yes else echo "$as_me: failed program was:" >&5 @@ -10519,17 +9509,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_cv_header_pthread_h=yes else echo "$as_me: failed program was:" >&5 @@ -10574,7 +9557,7 @@ else gcc_cv_decl_char_bit=no fi -rm -f conftest* +rm -f -r conftest* fi @@ -10620,27 +9603,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gcc_cv_c_nbby=$i; break else echo "$as_me: failed program was:" >&5 @@ -10687,7 +9653,8 @@ int main () { -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ + && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) bogus endian macros #endif @@ -10708,27 +9675,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -10763,27 +9713,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 @@ -10834,27 +9767,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi @@ -11022,27 +9938,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then gcc_cv_collect2_libs="$libs"; break else echo "$as_me: failed program was:" >&5 @@ -11051,7 +9951,7 @@ fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done LIBS="$save_LIBS" @@ -11117,27 +10017,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_search_exc_resume=$ac_res else echo "$as_me: failed program was:" >&5 @@ -11146,7 +10030,7 @@ fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_exc_resume+set}" = set; then break @@ -11224,27 +10108,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_search_ldexp=$ac_res else echo "$as_me: failed program was:" >&5 @@ -11253,7 +10121,7 @@ fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_ldexp+set}" = set; then break @@ -11299,43 +10167,26 @@ { intmax_t i = -1; ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gcc_cv_header_inttypes_h=yes else echo "$as_me: failed program was:" >&5 @@ -11463,27 +10314,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -11492,7 +10327,7 @@ eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -11611,27 +10446,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_ssize_t=yes else echo "$as_me: failed program was:" >&5 @@ -11677,7 +10495,7 @@ else ac_cv_type_uid_t=no fi -rm -f conftest* +rm -f -r conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 @@ -11782,7 +10600,7 @@ else ac_cv_type_getgroups=int fi -rm -f conftest* +rm -f -r conftest* fi fi @@ -11837,17 +10655,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_cv_header_sys_mman_h=yes else echo "$as_me: failed program was:" >&5 @@ -11929,27 +10740,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_mmap=yes else echo "$as_me: failed program was:" >&5 @@ -11958,7 +10753,7 @@ ac_cv_func_mmap=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_mmap" >&5 @@ -12060,27 +10855,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gcc_cv_decl_map_anon=yes else echo "$as_me: failed program was:" >&5 @@ -12187,27 +10965,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 @@ -12259,17 +11020,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 @@ -12359,27 +11113,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 @@ -12388,7 +11126,7 @@ eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` @@ -12501,7 +11239,7 @@ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include -#if HAVE_VFORK_H +#ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming @@ -13266,27 +12004,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 @@ -13295,7 +12017,7 @@ fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" @@ -13331,27 +12053,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else @@ -13361,7 +12067,7 @@ fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi @@ -13436,27 +12142,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then am_cv_proto_iconv_arg1="" else echo "$as_me: failed program was:" >&5 @@ -13519,27 +12208,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then am_cv_val_LC_MESSAGES=yes else echo "$as_me: failed program was:" >&5 @@ -13548,7 +12221,7 @@ am_cv_val_LC_MESSAGES=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 @@ -13596,27 +12269,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then am_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 @@ -13625,7 +12282,7 @@ am_cv_langinfo_codeset=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi @@ -13728,27 +12385,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "gcc_cv_have_decl_$ac_func=yes" else echo "$as_me: failed program was:" >&5 @@ -13823,31 +12463,14 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "gcc_cv_have_decl_$ac_func=yes" else echo "$as_me: failed program was:" >&5 @@ -13910,27 +12533,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 @@ -13999,27 +12605,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "gcc_cv_have_decl_$ac_func=yes" else echo "$as_me: failed program was:" >&5 @@ -14096,27 +12685,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "gcc_cv_have_decl_$ac_func=yes" else echo "$as_me: failed program was:" >&5 @@ -14191,27 +12763,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "gcc_cv_have_decl_$ac_func=yes" else echo "$as_me: failed program was:" >&5 @@ -14281,27 +12836,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_struct_tms=yes else echo "$as_me: failed program was:" >&5 @@ -14361,27 +12899,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gcc_cv_type_clock_t=yes else echo "$as_me: failed program was:" >&5 @@ -14522,27 +13043,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gcc_cv_mkdir_takes_one_arg=no else echo "$as_me: failed program was:" >&5 @@ -14767,27 +13271,10 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then gcc_cv_mcontext_underscores=no else echo "$as_me: failed program was:" >&5 @@ -14856,27 +13343,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_CrashReporterClient_gCRAnnotations=yes else echo "$as_me: failed program was:" >&5 @@ -14885,7 +13356,7 @@ ac_cv_lib_CrashReporterClient_gCRAnnotations=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -15013,27 +13484,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func___cxa_atexit=yes else echo "$as_me: failed program was:" >&5 @@ -15042,7 +13497,7 @@ ac_cv_func___cxa_atexit=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func___cxa_atexit" >&5 @@ -15118,27 +13573,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_search__Unwind_GetIPInfo=$ac_res else echo "$as_me: failed program was:" >&5 @@ -15147,7 +13586,7 @@ fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search__Unwind_GetIPInfo+set}" = set; then break @@ -15422,27 +13861,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_search_RegOpenKeyExA=$ac_res else echo "$as_me: failed program was:" >&5 @@ -15451,7 +13874,7 @@ fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_RegOpenKeyExA+set}" = set; then break @@ -15813,7 +14236,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_gcc_cv_as="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -15930,7 +14353,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_gcc_cv_ld="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -16022,7 +14445,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_gcc_cv_nm="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -16097,7 +14520,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_gcc_cv_objdump="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -16930,6 +15353,11 @@ tls_first_major=2 tls_first_minor=17 ;; + i[34567]86-*-darwin*) + conftest_s='.tbss _a,4,2' + tls_first_major=0 + tls_first_minor=0 + ;; i[34567]86-*-*) conftest_s=' .section ".tdata","awT", at progbits @@ -16950,6 +15378,11 @@ tls_first_minor=14 tls_as_opt=--fatal-warnings ;; + x86_64-*-darwin*) + conftest_s='.tbss _a,4,2' + tls_first_major=0 + tls_first_minor=0 + ;; x86_64-*-*) conftest_s=' .section ".tdata","awT", at progbits @@ -18634,27 +17067,11 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func___stack_chk_fail=yes else echo "$as_me: failed program was:" >&5 @@ -18663,7 +17080,7 @@ ac_cv_func___stack_chk_fail=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func___stack_chk_fail" >&5 @@ -19280,7 +17697,8 @@ ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -19289,10 +17707,13 @@ alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh + + # PATH needs CR @@ -19516,19 +17937,28 @@ as_mkdir_p=false fi -# Find out whether ``test -x'' works. Don't use a zero-byte file, as -# systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - as_executable_p="test -x" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' else - as_executable_p=: + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' fi -rm -f conf$$.file +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -19544,7 +17974,7 @@ # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.60. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -19573,7 +18003,7 @@ Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -19597,7 +18027,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.60, +configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. Modified: llvm-gcc-4.2/trunk/gcc/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/configure.ac?rev=106696&r1=106695&r2=106696&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/configure.ac (original) +++ llvm-gcc-4.2/trunk/gcc/configure.ac Wed Jun 23 18:34:40 2010 @@ -2485,6 +2485,11 @@ tls_first_major=2 tls_first_minor=17 ;; + i[34567]86-*-darwin*) + conftest_s='.tbss _a,4,2' + tls_first_major=0 + tls_first_minor=0 + ;; i[34567]86-*-*) conftest_s=' .section ".tdata","awT", at progbits @@ -2505,6 +2510,11 @@ tls_first_minor=14 tls_as_opt=--fatal-warnings ;; + x86_64-*-darwin*) + conftest_s='.tbss _a,4,2' + tls_first_major=0 + tls_first_minor=0 + ;; x86_64-*-*) conftest_s=' .section ".tdata","awT", at progbits From isanbard at gmail.com Wed Jun 23 18:37:36 2010 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 23 Jun 2010 16:37:36 -0700 Subject: [llvm-commits] [llvm] r106693 - in /llvm/trunk: lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h test/CodeGen/ARM/lsr-on-unrolled-loops.ll In-Reply-To: References: <20100623230016.A72AF2A6C12C@llvm.org> Message-ID: <53BF1E46-C225-4289-90A8-13D03F08C21A@gmail.com> On Jun 23, 2010, at 4:29 PM, Jim Grosbach wrote: > Fantastic! Thanks, Bill. > Welcome. Thanks for your help! :-) Now to see if it passes the nightly tests... -bw From ggreif at gmail.com Wed Jun 23 18:38:08 2010 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 23 Jun 2010 23:38:08 -0000 Subject: [llvm-commits] [llvm] r106697 - in /llvm/trunk/lib/Analysis: BasicAliasAnalysis.cpp ValueTracking.cpp Message-ID: <20100623233808.1F2712A6C12C@llvm.org> Author: ggreif Date: Wed Jun 23 18:38:07 2010 New Revision: 106697 URL: http://llvm.org/viewvc/llvm-project?rev=106697&view=rev Log: use ArgOperand accessors Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/ValueTracking.cpp Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=106697&r1=106696&r2=106697&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Jun 23 18:38:07 2010 @@ -94,7 +94,7 @@ } else if (const CallInst* CI = extractMallocCall(V)) { if (!isArrayMalloc(V, &TD)) // The size is the argument to the malloc call. - if (const ConstantInt* C = dyn_cast(CI->getOperand(1))) + if (const ConstantInt* C = dyn_cast(CI->getArgOperand(0))) return (C->getZExtValue() < Size); return false; } else if (const Argument *A = dyn_cast(V)) { @@ -318,10 +318,10 @@ case Intrinsic::memcpy: case Intrinsic::memmove: { unsigned Len = ~0U; - if (ConstantInt *LenCI = dyn_cast(II->getOperand(3))) + if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) Len = LenCI->getZExtValue(); - Value *Dest = II->getOperand(1); - Value *Src = II->getOperand(2); + Value *Dest = II->getArgOperand(0); + Value *Src = II->getArgOperand(1); if (isNoAlias(Dest, Len, P, Size)) { if (isNoAlias(Src, Len, P, Size)) return NoModRef; @@ -332,9 +332,9 @@ case Intrinsic::memset: // Since memset is 'accesses arguments' only, the AliasAnalysis base class // will handle it for the variable length case. - if (ConstantInt *LenCI = dyn_cast(II->getOperand(3))) { + if (ConstantInt *LenCI = dyn_cast(II->getArgOperand(2))) { unsigned Len = LenCI->getZExtValue(); - Value *Dest = II->getOperand(1); + Value *Dest = II->getArgOperand(0); if (isNoAlias(Dest, Len, P, Size)) return NoModRef; } @@ -352,7 +352,7 @@ case Intrinsic::atomic_load_umax: case Intrinsic::atomic_load_umin: if (TD) { - Value *Op1 = II->getOperand(1); + Value *Op1 = II->getArgOperand(0); unsigned Op1Size = TD->getTypeStoreSize(Op1->getType()); if (isNoAlias(Op1, Op1Size, P, Size)) return NoModRef; @@ -361,14 +361,14 @@ case Intrinsic::lifetime_start: case Intrinsic::lifetime_end: case Intrinsic::invariant_start: { - unsigned PtrSize = cast(II->getOperand(1))->getZExtValue(); - if (isNoAlias(II->getOperand(2), PtrSize, P, Size)) + unsigned PtrSize = cast(II->getArgOperand(0))->getZExtValue(); + if (isNoAlias(II->getArgOperand(1), PtrSize, P, Size)) return NoModRef; break; } case Intrinsic::invariant_end: { - unsigned PtrSize = cast(II->getOperand(2))->getZExtValue(); - if (isNoAlias(II->getOperand(3), PtrSize, P, Size)) + unsigned PtrSize = cast(II->getArgOperand(1))->getZExtValue(); + if (isNoAlias(II->getArgOperand(2), PtrSize, P, Size)) return NoModRef; break; } Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=106697&r1=106696&r2=106697&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ValueTracking.cpp (original) +++ llvm/trunk/lib/Analysis/ValueTracking.cpp Wed Jun 23 18:38:07 2010 @@ -953,7 +953,7 @@ if (const IntrinsicInst *II = dyn_cast(I)) // sqrt(-0.0) = -0.0, no other negative results are possible. if (II->getIntrinsicID() == Intrinsic::sqrt) - return CannotBeNegativeZero(II->getOperand(1), Depth+1); + return CannotBeNegativeZero(II->getArgOperand(0), Depth+1); if (const CallInst *CI = dyn_cast(I)) if (const Function *F = CI->getCalledFunction()) { @@ -966,7 +966,7 @@ if (F->getName() == "fabsl") return true; if (F->getName() == "sqrt" || F->getName() == "sqrtf" || F->getName() == "sqrtl") - return CannotBeNegativeZero(CI->getOperand(1), Depth+1); + return CannotBeNegativeZero(CI->getArgOperand(0), Depth+1); } } From dalej at apple.com Wed Jun 23 18:46:35 2010 From: dalej at apple.com (Dale Johannesen) Date: Wed, 23 Jun 2010 16:46:35 -0700 Subject: [llvm-commits] [llvm] r106693 - in /llvm/trunk: lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h test/CodeGen/ARM/lsr-on-unrolled-loops.ll In-Reply-To: <20100623230016.A72AF2A6C12C@llvm.org> References: <20100623230016.A72AF2A6C12C@llvm.org> Message-ID: <06B42F16-2F24-498B-A04F-5B4CF8E63280@apple.com> On Jun 23, 2010, at 4:00 PMPDT, Bill Wendling wrote: > Author: void > Date: Wed Jun 23 18:00:16 2010 > New Revision: 106693 > > URL: http://llvm.org/viewvc/llvm-project?rev=106693&view=rev > Log: > We are missing opportunites to use ldm. Take code like this: > > void t(int *cp0, int *cp1, int *dp, int fmd) { > int c0, c1, d0, d1, d2, d3; > c0 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000); > c1 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000); > /* ... */ > } You can't combine volatile loads, is there a check for this? I'm also wondering if interference could be a problem, where one pointer points to the other one. I think it's OK as long as there are no stores, as in the example. From dpatel at apple.com Wed Jun 23 18:55:51 2010 From: dpatel at apple.com (Devang Patel) Date: Wed, 23 Jun 2010 23:55:51 -0000 Subject: [llvm-commits] [llvm] r106698 - in /llvm/trunk: include/llvm/Transforms/Utils/Cloning.h lib/Transforms/Utils/CloneFunction.cpp lib/Transforms/Utils/CloneLoop.cpp lib/Transforms/Utils/CloneModule.cpp lib/Transforms/Utils/InlineFunction.cpp lib/Transforms/Utils/LoopUnroll.cpp lib/Transforms/Utils/ValueMapper.cpp Message-ID: <20100623235551.63D102A6C12C@llvm.org> Author: dpatel Date: Wed Jun 23 18:55:51 2010 New Revision: 106698 URL: http://llvm.org/viewvc/llvm-project?rev=106698&view=rev Log: Cosmetic change. Do not use "ValueMap" as a name for a local variable or an argument. Modified: llvm/trunk/include/llvm/Transforms/Utils/Cloning.h llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp llvm/trunk/lib/Transforms/Utils/CloneModule.cpp llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Modified: llvm/trunk/include/llvm/Transforms/Utils/Cloning.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Cloning.h?rev=106698&r1=106697&r2=106698&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/Cloning.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/Cloning.h Wed Jun 23 18:55:51 2010 @@ -46,7 +46,7 @@ /// CloneModule - Return an exact copy of the specified module /// Module *CloneModule(const Module *M); -Module *CloneModule(const Module *M, DenseMap &ValueMap); +Module *CloneModule(const Module *M, DenseMap &VMap); /// ClonedCodeInfo - This struct can be used to capture information about code /// being cloned, while it is being cloned. @@ -89,7 +89,7 @@ /// incoming edges. /// /// The correlation between instructions in the source and result basic blocks -/// is recorded in the ValueMap map. +/// is recorded in the VMap map. /// /// If you have a particular suffix you'd like to use to add to any cloned /// names, specify it as the optional third parameter. @@ -102,34 +102,34 @@ /// parameter. /// BasicBlock *CloneBasicBlock(const BasicBlock *BB, - DenseMap &ValueMap, + DenseMap &VMap, const Twine &NameSuffix = "", Function *F = 0, ClonedCodeInfo *CodeInfo = 0); /// CloneLoop - Clone Loop. Clone dominator info for loop insiders. Populate -/// ValueMap using old blocks to new blocks mapping. +/// VMap using old blocks to new blocks mapping. Loop *CloneLoop(Loop *L, LPPassManager *LPM, LoopInfo *LI, - DenseMap &ValueMap, Pass *P); + DenseMap &VMap, Pass *P); /// CloneFunction - Return a copy of the specified function, but without /// embedding the function into another module. Also, any references specified -/// in the ValueMap are changed to refer to their mapped value instead of the -/// original one. If any of the arguments to the function are in the ValueMap, -/// the arguments are deleted from the resultant function. The ValueMap is +/// in the VMap are changed to refer to their mapped value instead of the +/// original one. If any of the arguments to the function are in the VMap, +/// the arguments are deleted from the resultant function. The VMap is /// updated to include mappings from all of the instructions and basicblocks in /// the function from their old to new values. The final argument captures /// information about the cloned code if non-null. /// Function *CloneFunction(const Function *F, - DenseMap &ValueMap, + DenseMap &VMap, ClonedCodeInfo *CodeInfo = 0); -/// CloneFunction - Version of the function that doesn't need the ValueMap. +/// CloneFunction - Version of the function that doesn't need the VMap. /// inline Function *CloneFunction(const Function *F, ClonedCodeInfo *CodeInfo = 0){ - DenseMap ValueMap; - return CloneFunction(F, ValueMap, CodeInfo); + DenseMap VMap; + return CloneFunction(F, VMap, CodeInfo); } /// Clone OldFunc into NewFunc, transforming the old arguments into references @@ -139,7 +139,7 @@ /// specified suffix to all values cloned. /// void CloneFunctionInto(Function *NewFunc, const Function *OldFunc, - DenseMap &ValueMap, + DenseMap &VMap, SmallVectorImpl &Returns, const char *NameSuffix = "", ClonedCodeInfo *CodeInfo = 0); @@ -152,7 +152,7 @@ /// dead. Since this doesn't produce an exactly copy of the input, it can't be /// used for things like CloneFunction or CloneModule. void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc, - DenseMap &ValueMap, + DenseMap &VMap, SmallVectorImpl &Returns, const char *NameSuffix = "", ClonedCodeInfo *CodeInfo = 0, Modified: llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp?rev=106698&r1=106697&r2=106698&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp Wed Jun 23 18:55:51 2010 @@ -32,7 +32,7 @@ // CloneBasicBlock - See comments in Cloning.h BasicBlock *llvm::CloneBasicBlock(const BasicBlock *BB, - DenseMap &ValueMap, + DenseMap &VMap, const Twine &NameSuffix, Function *F, ClonedCodeInfo *CodeInfo) { BasicBlock *NewBB = BasicBlock::Create(BB->getContext(), "", F); @@ -47,7 +47,7 @@ if (II->hasName()) NewInst->setName(II->getName()+NameSuffix); NewBB->getInstList().push_back(NewInst); - ValueMap[II] = NewInst; // Add instruction map to value. + VMap[II] = NewInst; // Add instruction map to value. hasCalls |= (isa(II) && !isa(II)); if (const AllocaInst *AI = dyn_cast(II)) { @@ -72,7 +72,7 @@ // ArgMap values. // void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc, - DenseMap &ValueMap, + DenseMap &VMap, SmallVectorImpl &Returns, const char *NameSuffix, ClonedCodeInfo *CodeInfo) { assert(NameSuffix && "NameSuffix cannot be null!"); @@ -80,17 +80,17 @@ #ifndef NDEBUG for (Function::const_arg_iterator I = OldFunc->arg_begin(), E = OldFunc->arg_end(); I != E; ++I) - assert(ValueMap.count(I) && "No mapping from source argument specified!"); + assert(VMap.count(I) && "No mapping from source argument specified!"); #endif // Clone any attributes. if (NewFunc->arg_size() == OldFunc->arg_size()) NewFunc->copyAttributesFrom(OldFunc); else { - //Some arguments were deleted with the ValueMap. Copy arguments one by one + //Some arguments were deleted with the VMap. Copy arguments one by one for (Function::const_arg_iterator I = OldFunc->arg_begin(), E = OldFunc->arg_end(); I != E; ++I) - if (Argument* Anew = dyn_cast(ValueMap[I])) + if (Argument* Anew = dyn_cast(VMap[I])) Anew->addAttr( OldFunc->getAttributes() .getParamAttributes(I->getArgNo() + 1)); NewFunc->setAttributes(NewFunc->getAttributes() @@ -111,43 +111,43 @@ const BasicBlock &BB = *BI; // Create a new basic block and copy instructions into it! - BasicBlock *CBB = CloneBasicBlock(&BB, ValueMap, NameSuffix, NewFunc, + BasicBlock *CBB = CloneBasicBlock(&BB, VMap, NameSuffix, NewFunc, CodeInfo); - ValueMap[&BB] = CBB; // Add basic block mapping. + VMap[&BB] = CBB; // Add basic block mapping. if (ReturnInst *RI = dyn_cast(CBB->getTerminator())) Returns.push_back(RI); } // Loop over all of the instructions in the function, fixing up operand - // references as we go. This uses ValueMap to do all the hard work. + // references as we go. This uses VMap to do all the hard work. // - for (Function::iterator BB = cast(ValueMap[OldFunc->begin()]), + for (Function::iterator BB = cast(VMap[OldFunc->begin()]), BE = NewFunc->end(); BB != BE; ++BB) // Loop over all instructions, fixing each one as we find it... for (BasicBlock::iterator II = BB->begin(); II != BB->end(); ++II) - RemapInstruction(II, ValueMap); + RemapInstruction(II, VMap); } /// CloneFunction - Return a copy of the specified function, but without /// embedding the function into another module. Also, any references specified -/// in the ValueMap are changed to refer to their mapped value instead of the -/// original one. If any of the arguments to the function are in the ValueMap, -/// the arguments are deleted from the resultant function. The ValueMap is +/// in the VMap are changed to refer to their mapped value instead of the +/// original one. If any of the arguments to the function are in the VMap, +/// the arguments are deleted from the resultant function. The VMap is /// updated to include mappings from all of the instructions and basicblocks in /// the function from their old to new values. /// Function *llvm::CloneFunction(const Function *F, - DenseMap &ValueMap, + DenseMap &VMap, ClonedCodeInfo *CodeInfo) { std::vector ArgTypes; // The user might be deleting arguments to the function by specifying them in - // the ValueMap. If so, we need to not add the arguments to the arg ty vector + // the VMap. If so, we need to not add the arguments to the arg ty vector // for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I) - if (ValueMap.count(I) == 0) // Haven't mapped the argument to anything yet? + if (VMap.count(I) == 0) // Haven't mapped the argument to anything yet? ArgTypes.push_back(I->getType()); // Create a new function type... @@ -161,13 +161,13 @@ Function::arg_iterator DestI = NewF->arg_begin(); for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I) - if (ValueMap.count(I) == 0) { // Is this argument preserved? + if (VMap.count(I) == 0) { // Is this argument preserved? DestI->setName(I->getName()); // Copy the name over... - ValueMap[I] = DestI++; // Add mapping to ValueMap + VMap[I] = DestI++; // Add mapping to VMap } SmallVector Returns; // Ignore returns cloned. - CloneFunctionInto(NewF, F, ValueMap, Returns, "", CodeInfo); + CloneFunctionInto(NewF, F, VMap, Returns, "", CodeInfo); return NewF; } @@ -179,7 +179,7 @@ struct PruningFunctionCloner { Function *NewFunc; const Function *OldFunc; - DenseMap &ValueMap; + DenseMap &VMap; SmallVectorImpl &Returns; const char *NameSuffix; ClonedCodeInfo *CodeInfo; @@ -191,7 +191,7 @@ const char *nameSuffix, ClonedCodeInfo *codeInfo, const TargetData *td) - : NewFunc(newFunc), OldFunc(oldFunc), ValueMap(valueMap), Returns(returns), + : NewFunc(newFunc), OldFunc(oldFunc), VMap(valueMap), Returns(returns), NameSuffix(nameSuffix), CodeInfo(codeInfo), TD(td) { } @@ -202,7 +202,7 @@ public: /// ConstantFoldMappedInstruction - Constant fold the specified instruction, - /// mapping its operands through ValueMap if they are available. + /// mapping its operands through VMap if they are available. Constant *ConstantFoldMappedInstruction(const Instruction *I); }; } @@ -211,7 +211,7 @@ /// anything that it can reach. void PruningFunctionCloner::CloneBlock(const BasicBlock *BB, std::vector &ToClone){ - Value *&BBEntry = ValueMap[BB]; + Value *&BBEntry = VMap[BB]; // Have we already cloned this block? if (BBEntry) return; @@ -230,7 +230,7 @@ // If this instruction constant folds, don't bother cloning the instruction, // instead, just add the constant to the value map. if (Constant *C = ConstantFoldMappedInstruction(II)) { - ValueMap[II] = C; + VMap[II] = C; continue; } @@ -238,7 +238,7 @@ if (II->hasName()) NewInst->setName(II->getName()+NameSuffix); NewBB->getInstList().push_back(NewInst); - ValueMap[II] = NewInst; // Add instruction map to value. + VMap[II] = NewInst; // Add instruction map to value. hasCalls |= (isa(II) && !isa(II)); if (const AllocaInst *AI = dyn_cast(II)) { @@ -258,12 +258,12 @@ ConstantInt *Cond = dyn_cast(BI->getCondition()); // Or is a known constant in the caller... if (Cond == 0) - Cond = dyn_cast_or_null(ValueMap[BI->getCondition()]); + Cond = dyn_cast_or_null(VMap[BI->getCondition()]); // Constant fold to uncond branch! if (Cond) { BasicBlock *Dest = BI->getSuccessor(!Cond->getZExtValue()); - ValueMap[OldTI] = BranchInst::Create(Dest, NewBB); + VMap[OldTI] = BranchInst::Create(Dest, NewBB); ToClone.push_back(Dest); TerminatorDone = true; } @@ -272,10 +272,10 @@ // If switching on a value known constant in the caller. ConstantInt *Cond = dyn_cast(SI->getCondition()); if (Cond == 0) // Or known constant after constant prop in the callee... - Cond = dyn_cast_or_null(ValueMap[SI->getCondition()]); + Cond = dyn_cast_or_null(VMap[SI->getCondition()]); if (Cond) { // Constant fold to uncond branch! BasicBlock *Dest = SI->getSuccessor(SI->findCaseValue(Cond)); - ValueMap[OldTI] = BranchInst::Create(Dest, NewBB); + VMap[OldTI] = BranchInst::Create(Dest, NewBB); ToClone.push_back(Dest); TerminatorDone = true; } @@ -286,7 +286,7 @@ if (OldTI->hasName()) NewInst->setName(OldTI->getName()+NameSuffix); NewBB->getInstList().push_back(NewInst); - ValueMap[OldTI] = NewInst; // Add instruction map to value. + VMap[OldTI] = NewInst; // Add instruction map to value. // Recursively clone any reachable successor blocks. const TerminatorInst *TI = BB->getTerminator(); @@ -307,13 +307,13 @@ } /// ConstantFoldMappedInstruction - Constant fold the specified instruction, -/// mapping its operands through ValueMap if they are available. +/// mapping its operands through VMap if they are available. Constant *PruningFunctionCloner:: ConstantFoldMappedInstruction(const Instruction *I) { SmallVector Ops; for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) if (Constant *Op = dyn_cast_or_null(MapValue(I->getOperand(i), - ValueMap))) + VMap))) Ops.push_back(Op); else return 0; // All operands not constant! @@ -363,7 +363,7 @@ /// dead. Since this doesn't produce an exact copy of the input, it can't be /// used for things like CloneFunction or CloneModule. void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc, - DenseMap &ValueMap, + DenseMap &VMap, SmallVectorImpl &Returns, const char *NameSuffix, ClonedCodeInfo *CodeInfo, @@ -374,10 +374,10 @@ #ifndef NDEBUG for (Function::const_arg_iterator II = OldFunc->arg_begin(), E = OldFunc->arg_end(); II != E; ++II) - assert(ValueMap.count(II) && "No mapping from source argument specified!"); + assert(VMap.count(II) && "No mapping from source argument specified!"); #endif - PruningFunctionCloner PFC(NewFunc, OldFunc, ValueMap, Returns, + PruningFunctionCloner PFC(NewFunc, OldFunc, VMap, Returns, NameSuffix, CodeInfo, TD); // Clone the entry block, and anything recursively reachable from it. @@ -397,14 +397,14 @@ SmallVector PHIToResolve; for (Function::const_iterator BI = OldFunc->begin(), BE = OldFunc->end(); BI != BE; ++BI) { - BasicBlock *NewBB = cast_or_null(ValueMap[BI]); + BasicBlock *NewBB = cast_or_null(VMap[BI]); if (NewBB == 0) continue; // Dead block. // Add the new block to the new function. NewFunc->getBasicBlockList().push_back(NewBB); // Loop over all of the instructions in the block, fixing up operand - // references as we go. This uses ValueMap to do all the hard work. + // references as we go. This uses VMap to do all the hard work. // BasicBlock::iterator I = NewBB->begin(); @@ -455,7 +455,7 @@ I->setMetadata(DbgKind, 0); } } - RemapInstruction(I, ValueMap); + RemapInstruction(I, VMap); } } @@ -465,19 +465,19 @@ const PHINode *OPN = PHIToResolve[phino]; unsigned NumPreds = OPN->getNumIncomingValues(); const BasicBlock *OldBB = OPN->getParent(); - BasicBlock *NewBB = cast(ValueMap[OldBB]); + BasicBlock *NewBB = cast(VMap[OldBB]); // Map operands for blocks that are live and remove operands for blocks // that are dead. for (; phino != PHIToResolve.size() && PHIToResolve[phino]->getParent() == OldBB; ++phino) { OPN = PHIToResolve[phino]; - PHINode *PN = cast(ValueMap[OPN]); + PHINode *PN = cast(VMap[OPN]); for (unsigned pred = 0, e = NumPreds; pred != e; ++pred) { if (BasicBlock *MappedBlock = - cast_or_null(ValueMap[PN->getIncomingBlock(pred)])) { + cast_or_null(VMap[PN->getIncomingBlock(pred)])) { Value *InVal = MapValue(PN->getIncomingValue(pred), - ValueMap); + VMap); assert(InVal && "Unknown input value?"); PN->setIncomingValue(pred, InVal); PN->setIncomingBlock(pred, MappedBlock); @@ -531,15 +531,15 @@ while ((PN = dyn_cast(I++))) { Value *NV = UndefValue::get(PN->getType()); PN->replaceAllUsesWith(NV); - assert(ValueMap[OldI] == PN && "ValueMap mismatch"); - ValueMap[OldI] = NV; + assert(VMap[OldI] == PN && "VMap mismatch"); + VMap[OldI] = NV; PN->eraseFromParent(); ++OldI; } } // NOTE: We cannot eliminate single entry phi nodes here, because of - // ValueMap. Single entry phi nodes can have multiple ValueMap entries - // pointing at them. Thus, deleting one would require scanning the ValueMap + // VMap. Single entry phi nodes can have multiple VMap entries + // pointing at them. Thus, deleting one would require scanning the VMap // to update any entries in it that would require that. This would be // really slow. } @@ -548,14 +548,14 @@ // and zap unconditional fall-through branches. This happen all the time when // specializing code: code specialization turns conditional branches into // uncond branches, and this code folds them. - Function::iterator I = cast(ValueMap[&OldFunc->getEntryBlock()]); + Function::iterator I = cast(VMap[&OldFunc->getEntryBlock()]); while (I != NewFunc->end()) { BranchInst *BI = dyn_cast(I->getTerminator()); if (!BI || BI->isConditional()) { ++I; continue; } // Note that we can't eliminate uncond branches if the destination has // single-entry PHI nodes. Eliminating the single-entry phi nodes would - // require scanning the ValueMap to update any entries that point to the phi + // require scanning the VMap to update any entries that point to the phi // node. BasicBlock *Dest = BI->getSuccessor(0); if (!Dest->getSinglePredecessor() || isa(Dest->begin())) { Modified: llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp?rev=106698&r1=106697&r2=106698&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp Wed Jun 23 18:55:51 2010 @@ -23,13 +23,13 @@ /// CloneDominatorInfo - Clone basicblock's dominator tree and, if available, /// dominance info. It is expected that basic block is already cloned. static void CloneDominatorInfo(BasicBlock *BB, - DenseMap &ValueMap, + DenseMap &VMap, DominatorTree *DT, DominanceFrontier *DF) { assert (DT && "DominatorTree is not available"); - DenseMap::iterator BI = ValueMap.find(BB); - assert (BI != ValueMap.end() && "BasicBlock clone is missing"); + DenseMap::iterator BI = VMap.find(BB); + assert (BI != VMap.end() && "BasicBlock clone is missing"); BasicBlock *NewBB = cast(BI->second); // NewBB already got dominator info. @@ -43,11 +43,11 @@ // NewBB's dominator is either BB's dominator or BB's dominator's clone. BasicBlock *NewBBDom = BBDom; - DenseMap::iterator BBDomI = ValueMap.find(BBDom); - if (BBDomI != ValueMap.end()) { + DenseMap::iterator BBDomI = VMap.find(BBDom); + if (BBDomI != VMap.end()) { NewBBDom = cast(BBDomI->second); if (!DT->getNode(NewBBDom)) - CloneDominatorInfo(BBDom, ValueMap, DT, DF); + CloneDominatorInfo(BBDom, VMap, DT, DF); } DT->addNewBlock(NewBB, NewBBDom); @@ -60,8 +60,8 @@ for (DominanceFrontier::DomSetType::iterator I = S.begin(), E = S.end(); I != E; ++I) { BasicBlock *DB = *I; - DenseMap::iterator IDM = ValueMap.find(DB); - if (IDM != ValueMap.end()) + DenseMap::iterator IDM = VMap.find(DB); + if (IDM != VMap.end()) NewDFSet.insert(cast(IDM->second)); else NewDFSet.insert(DB); @@ -71,10 +71,10 @@ } } -/// CloneLoop - Clone Loop. Clone dominator info. Populate ValueMap +/// CloneLoop - Clone Loop. Clone dominator info. Populate VMap /// using old blocks to new blocks mapping. Loop *llvm::CloneLoop(Loop *OrigL, LPPassManager *LPM, LoopInfo *LI, - DenseMap &ValueMap, Pass *P) { + DenseMap &VMap, Pass *P) { DominatorTree *DT = NULL; DominanceFrontier *DF = NULL; @@ -104,8 +104,8 @@ for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); I != E; ++I) { BasicBlock *BB = *I; - BasicBlock *NewBB = CloneBasicBlock(BB, ValueMap, ".clone"); - ValueMap[BB] = NewBB; + BasicBlock *NewBB = CloneBasicBlock(BB, VMap, ".clone"); + VMap[BB] = NewBB; if (P) LPM->cloneBasicBlockSimpleAnalysis(BB, NewBB, L); NewLoop->addBasicBlockToLoop(NewBB, LI->getBase()); @@ -117,7 +117,7 @@ for (Loop::block_iterator I = L->block_begin(), E = L->block_end(); I != E; ++I) { BasicBlock *BB = *I; - CloneDominatorInfo(BB, ValueMap, DT, DF); + CloneDominatorInfo(BB, VMap, DT, DF); } // Process sub loops @@ -125,7 +125,7 @@ LoopNest.push_back(*I); } while (!LoopNest.empty()); - // Remap instructions to reference operands from ValueMap. + // Remap instructions to reference operands from VMap. for(SmallVector::iterator NBItr = NewBlocks.begin(), NBE = NewBlocks.end(); NBItr != NBE; ++NBItr) { BasicBlock *NB = *NBItr; @@ -135,8 +135,8 @@ for (unsigned index = 0, num_ops = Insn->getNumOperands(); index != num_ops; ++index) { Value *Op = Insn->getOperand(index); - DenseMap::iterator OpItr = ValueMap.find(Op); - if (OpItr != ValueMap.end()) + DenseMap::iterator OpItr = VMap.find(Op); + if (OpItr != VMap.end()) Insn->setOperand(index, OpItr->second); } } Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneModule.cpp?rev=106698&r1=106697&r2=106698&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneModule.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Wed Jun 23 18:55:51 2010 @@ -28,12 +28,12 @@ Module *llvm::CloneModule(const Module *M) { // Create the value map that maps things from the old module over to the new // module. - DenseMap ValueMap; - return CloneModule(M, ValueMap); + DenseMap VMap; + return CloneModule(M, VMap); } Module *llvm::CloneModule(const Module *M, - DenseMap &ValueMap) { + DenseMap &VMap) { // First off, we need to create the new module... Module *New = new Module(M->getModuleIdentifier(), M->getContext()); New->setDataLayout(M->getDataLayout()); @@ -51,7 +51,7 @@ New->addLibrary(*I); // Loop over all of the global variables, making corresponding globals in the - // new module. Here we add them to the ValueMap and to the new Module. We + // new module. Here we add them to the VMap and to the new Module. We // don't worry about attributes or initializers, they will come later. // for (Module::const_global_iterator I = M->global_begin(), E = M->global_end(); @@ -62,7 +62,7 @@ GlobalValue::ExternalLinkage, 0, I->getName()); GV->setAlignment(I->getAlignment()); - ValueMap[I] = GV; + VMap[I] = GV; } // Loop over the functions in the module, making external functions as before @@ -71,13 +71,13 @@ Function::Create(cast(I->getType()->getElementType()), GlobalValue::ExternalLinkage, I->getName(), New); NF->copyAttributesFrom(I); - ValueMap[I] = NF; + VMap[I] = NF; } // Loop over the aliases in the module for (Module::const_alias_iterator I = M->alias_begin(), E = M->alias_end(); I != E; ++I) - ValueMap[I] = new GlobalAlias(I->getType(), GlobalAlias::ExternalLinkage, + VMap[I] = new GlobalAlias(I->getType(), GlobalAlias::ExternalLinkage, I->getName(), NULL, New); // Now that all of the things that global variable initializer can refer to @@ -86,10 +86,10 @@ // for (Module::const_global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I) { - GlobalVariable *GV = cast(ValueMap[I]); + GlobalVariable *GV = cast(VMap[I]); if (I->hasInitializer()) GV->setInitializer(cast(MapValue(I->getInitializer(), - ValueMap))); + VMap))); GV->setLinkage(I->getLinkage()); GV->setThreadLocal(I->isThreadLocal()); GV->setConstant(I->isConstant()); @@ -98,17 +98,17 @@ // Similarly, copy over function bodies now... // for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) { - Function *F = cast(ValueMap[I]); + Function *F = cast(VMap[I]); if (!I->isDeclaration()) { Function::arg_iterator DestI = F->arg_begin(); for (Function::const_arg_iterator J = I->arg_begin(); J != I->arg_end(); ++J) { DestI->setName(J->getName()); - ValueMap[J] = DestI++; + VMap[J] = DestI++; } SmallVector Returns; // Ignore returns cloned. - CloneFunctionInto(F, I, ValueMap, Returns); + CloneFunctionInto(F, I, VMap, Returns); } F->setLinkage(I->getLinkage()); @@ -117,10 +117,10 @@ // And aliases for (Module::const_alias_iterator I = M->alias_begin(), E = M->alias_end(); I != E; ++I) { - GlobalAlias *GA = cast(ValueMap[I]); + GlobalAlias *GA = cast(VMap[I]); GA->setLinkage(I->getLinkage()); if (const Constant* C = I->getAliasee()) - GA->setAliasee(cast(MapValue(C, ValueMap))); + GA->setAliasee(cast(MapValue(C, VMap))); } // And named metadata.... @@ -129,7 +129,7 @@ const NamedMDNode &NMD = *I; SmallVector MDs; for (unsigned i = 0, e = NMD.getNumOperands(); i != e; ++i) - MDs.push_back(cast(MapValue(NMD.getOperand(i), ValueMap))); + MDs.push_back(cast(MapValue(NMD.getOperand(i), VMap))); NamedMDNode::Create(New->getContext(), NMD.getName(), MDs.data(), MDs.size(), New); } @@ -144,7 +144,7 @@ BI->getAllMetadata(MDs); for (SmallVector, 4>::iterator MDI = MDs.begin(), MDE = MDs.end(); MDI != MDE; ++MDI) { - Value *MappedValue = MapValue(MDI->second, ValueMap); + Value *MappedValue = MapValue(MDI->second, VMap); if (MDI->second != MappedValue && MappedValue) BI->setMetadata(MDI->first, cast(MappedValue)); } Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=106698&r1=106697&r2=106698&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Wed Jun 23 18:55:51 2010 @@ -169,7 +169,7 @@ /// some edges of the callgraph may remain. static void UpdateCallGraphAfterInlining(CallSite CS, Function::iterator FirstNewBlock, - DenseMap &ValueMap, + DenseMap &VMap, InlineFunctionInfo &IFI) { CallGraph &CG = *IFI.CG; const Function *Caller = CS.getInstruction()->getParent()->getParent(); @@ -192,9 +192,9 @@ for (; I != E; ++I) { const Value *OrigCall = I->first; - DenseMap::iterator VMI = ValueMap.find(OrigCall); + DenseMap::iterator VMI = VMap.find(OrigCall); // Only copy the edge if the call was inlined! - if (VMI == ValueMap.end() || VMI->second == 0) + if (VMI == VMap.end() || VMI->second == 0) continue; // If the call was inlined, but then constant folded, there is no edge to @@ -285,8 +285,8 @@ ClonedCodeInfo InlinedFunctionInfo; Function::iterator FirstNewBlock; - { // Scope to destroy ValueMap after cloning. - DenseMap ValueMap; + { // Scope to destroy VMap after cloning. + DenseMap VMap; assert(CalledFunc->arg_size() == CS.arg_size() && "No varargs calls can be inlined!"); @@ -357,14 +357,14 @@ MustClearTailCallFlags = true; } - ValueMap[I] = ActualArg; + VMap[I] = ActualArg; } // We want the inliner to prune the code as it copies. We would LOVE to // have no dead or constant instructions leftover after inlining occurs // (which can happen, e.g., because an argument was constant), but we'll be // happy with whatever the cloner can do. - CloneAndPruneFunctionInto(Caller, CalledFunc, ValueMap, Returns, ".i", + CloneAndPruneFunctionInto(Caller, CalledFunc, VMap, Returns, ".i", &InlinedFunctionInfo, IFI.TD, TheCall); // Remember the first block that is newly cloned over. @@ -372,7 +372,7 @@ // Update the callgraph if requested. if (IFI.CG) - UpdateCallGraphAfterInlining(CS, FirstNewBlock, ValueMap, IFI); + UpdateCallGraphAfterInlining(CS, FirstNewBlock, VMap, IFI); } // If there are any alloca instructions in the block that used to be the entry Modified: llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp?rev=106698&r1=106697&r2=106698&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp Wed Jun 23 18:55:51 2010 @@ -37,13 +37,13 @@ STATISTIC(NumUnrolled, "Number of loops unrolled (completely or otherwise)"); /// RemapInstruction - Convert the instruction operands from referencing the -/// current values into those specified by ValueMap. +/// current values into those specified by VMap. static inline void RemapInstruction(Instruction *I, - DenseMap &ValueMap) { + DenseMap &VMap) { for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) { Value *Op = I->getOperand(op); - DenseMap::iterator It = ValueMap.find(Op); - if (It != ValueMap.end()) + DenseMap::iterator It = VMap.find(Op); + if (It != VMap.end()) I->setOperand(op, It->second); } } @@ -205,26 +205,26 @@ for (std::vector::iterator BB = LoopBlocks.begin(), E = LoopBlocks.end(); BB != E; ++BB) { - ValueToValueMapTy ValueMap; - BasicBlock *New = CloneBasicBlock(*BB, ValueMap, "." + Twine(It)); + ValueToValueMapTy VMap; + BasicBlock *New = CloneBasicBlock(*BB, VMap, "." + Twine(It)); Header->getParent()->getBasicBlockList().push_back(New); // Loop over all of the PHI nodes in the block, changing them to use the // incoming values from the previous block. if (*BB == Header) for (unsigned i = 0, e = OrigPHINode.size(); i != e; ++i) { - PHINode *NewPHI = cast(ValueMap[OrigPHINode[i]]); + PHINode *NewPHI = cast(VMap[OrigPHINode[i]]); Value *InVal = NewPHI->getIncomingValueForBlock(LatchBlock); if (Instruction *InValI = dyn_cast(InVal)) if (It > 1 && L->contains(InValI)) InVal = LastValueMap[InValI]; - ValueMap[OrigPHINode[i]] = InVal; + VMap[OrigPHINode[i]] = InVal; New->getInstList().erase(NewPHI); } // Update our running map of newest clones LastValueMap[*BB] = New; - for (ValueToValueMapTy::iterator VI = ValueMap.begin(), VE = ValueMap.end(); + for (ValueToValueMapTy::iterator VI = VMap.begin(), VE = VMap.end(); VI != VE; ++VI) LastValueMap[VI->first] = VI->second; Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp?rev=106698&r1=106697&r2=106698&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Wed Jun 23 18:55:51 2010 @@ -28,7 +28,7 @@ // DenseMap. This includes any recursive calls to MapValue. // Global values and non-function-local metadata do not need to be seeded into - // the ValueMap if they are using the identity mapping. + // the VM if they are using the identity mapping. if (isa(V) || isa(V) || isa(V) || (isa(V) && !cast(V)->isFunctionLocal())) return VMSlot = const_cast(V); @@ -125,11 +125,11 @@ } /// RemapInstruction - Convert the instruction operands from referencing the -/// current values into those specified by ValueMap. +/// current values into those specified by VMap. /// -void llvm::RemapInstruction(Instruction *I, ValueToValueMapTy &ValueMap) { +void llvm::RemapInstruction(Instruction *I, ValueToValueMapTy &VMap) { for (User::op_iterator op = I->op_begin(), E = I->op_end(); op != E; ++op) { - Value *V = MapValue(*op, ValueMap); + Value *V = MapValue(*op, VMap); assert(V && "Referenced value not in value map!"); *op = V; } From dpatel at apple.com Wed Jun 23 19:00:43 2010 From: dpatel at apple.com (Devang Patel) Date: Thu, 24 Jun 2010 00:00:43 -0000 Subject: [llvm-commits] [llvm] r106699 - in /llvm/trunk/lib/Transforms/Utils: CloneFunction.cpp CloneModule.cpp Message-ID: <20100624000043.18E762A6C12C@llvm.org> Author: dpatel Date: Wed Jun 23 19:00:42 2010 New Revision: 106699 URL: http://llvm.org/viewvc/llvm-project?rev=106699&view=rev Log: Use available typedef for " DenseMap". Modified: llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Modified: llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp?rev=106699&r1=106698&r2=106699&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp Wed Jun 23 19:00:42 2010 @@ -32,7 +32,7 @@ // CloneBasicBlock - See comments in Cloning.h BasicBlock *llvm::CloneBasicBlock(const BasicBlock *BB, - DenseMap &VMap, + ValueToValueMapTy &VMap, const Twine &NameSuffix, Function *F, ClonedCodeInfo *CodeInfo) { BasicBlock *NewBB = BasicBlock::Create(BB->getContext(), "", F); @@ -72,7 +72,7 @@ // ArgMap values. // void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc, - DenseMap &VMap, + ValueToValueMapTy &VMap, SmallVectorImpl &Returns, const char *NameSuffix, ClonedCodeInfo *CodeInfo) { assert(NameSuffix && "NameSuffix cannot be null!"); @@ -138,7 +138,7 @@ /// the function from their old to new values. /// Function *llvm::CloneFunction(const Function *F, - DenseMap &VMap, + ValueToValueMapTy &VMap, ClonedCodeInfo *CodeInfo) { std::vector ArgTypes; @@ -179,14 +179,14 @@ struct PruningFunctionCloner { Function *NewFunc; const Function *OldFunc; - DenseMap &VMap; + ValueToValueMapTy &VMap; SmallVectorImpl &Returns; const char *NameSuffix; ClonedCodeInfo *CodeInfo; const TargetData *TD; public: PruningFunctionCloner(Function *newFunc, const Function *oldFunc, - DenseMap &valueMap, + ValueToValueMapTy &valueMap, SmallVectorImpl &returns, const char *nameSuffix, ClonedCodeInfo *codeInfo, @@ -363,7 +363,7 @@ /// dead. Since this doesn't produce an exact copy of the input, it can't be /// used for things like CloneFunction or CloneModule. void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc, - DenseMap &VMap, + ValueToValueMapTy &VMap, SmallVectorImpl &Returns, const char *NameSuffix, ClonedCodeInfo *CodeInfo, Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneModule.cpp?rev=106699&r1=106698&r2=106699&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneModule.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Wed Jun 23 19:00:42 2010 @@ -28,12 +28,12 @@ Module *llvm::CloneModule(const Module *M) { // Create the value map that maps things from the old module over to the new // module. - DenseMap VMap; + ValueToValueMapTy VMap; return CloneModule(M, VMap); } Module *llvm::CloneModule(const Module *M, - DenseMap &VMap) { + ValueToValueMapTy &VMap) { // First off, we need to create the new module... Module *New = new Module(M->getModuleIdentifier(), M->getContext()); New->setDataLayout(M->getDataLayout()); From stoklund at 2pi.dk Wed Jun 23 19:12:39 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Thu, 24 Jun 2010 00:12:39 -0000 Subject: [llvm-commits] [llvm] r106701 - in /llvm/trunk: include/llvm/CodeGen/LiveIntervalAnalysis.h include/llvm/CodeGen/RegisterCoalescer.h lib/CodeGen/LiveIntervalAnalysis.cpp lib/CodeGen/RegisterCoalescer.cpp lib/CodeGen/SimpleRegisterCoalescing.cpp lib/CodeGen/SimpleRegisterCoalescing.h test/CodeGen/ARM/vget_lane.ll Message-ID: <20100624001239.DD9B02A6C12C@llvm.org> Author: stoklund Date: Wed Jun 23 19:12:39 2010 New Revision: 106701 URL: http://llvm.org/viewvc/llvm-project?rev=106701&view=rev Log: Replace a big gob of old coalescer logic with the new CoalescerPair class. CoalescerPair can determine if a copy can be coalesced, and which register gets merged away. The old logic in SimpleRegisterCoalescing had evolved into something a bit too convoluted. Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h llvm/trunk/test/CodeGen/ARM/vget_lane.ll Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=106701&r1=106700&r2=106701&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Wed Jun 23 19:12:39 2010 @@ -133,10 +133,9 @@ bool conflictsWithPhysReg(const LiveInterval &li, VirtRegMap &vrm, unsigned reg); - /// conflictsWithSubPhysRegRef - Similar to conflictsWithPhysRegRef except - /// it checks for sub-register reference and it can check use as well. - bool conflictsWithSubPhysRegRef(LiveInterval &li, unsigned Reg, - bool CheckUse, + /// conflictsWithAliasRef - Similar to conflictsWithPhysRegRef except + /// it checks for alias uses and defs. + bool conflictsWithAliasRef(LiveInterval &li, unsigned Reg, SmallPtrSet &JoinedCopies); // Interval creation Modified: llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h?rev=106701&r1=106700&r2=106701&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h (original) +++ llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h Wed Jun 23 19:12:39 2010 @@ -165,9 +165,15 @@ /// virtual register. unsigned subIdx_; + /// origDstReg_ - dstReg_ without subreg adjustments. + unsigned origDstReg_; + /// partial_ - True when the original copy was a partial subregister copy. bool partial_; + /// crossClass_ - True when both regs are virtual, and newRC is constrained. + bool crossClass_; + /// flipped_ - True when DstReg and SrcReg are reversed from the oriignal copy /// instruction. bool flipped_; @@ -186,7 +192,8 @@ public: CoalescerPair(const TargetInstrInfo &tii, const TargetRegisterInfo &tri) : tii_(tii), tri_(tri), dstReg_(0), srcReg_(0), subIdx_(0), - partial_(false), flipped_(false), newRC_(0) {} + origDstReg_(0), partial_(false), crossClass_(false), flipped_(false), + newRC_(0) {} /// setRegisters - set registers to match the copy instruction MI. Return /// false if MI is not a coalescable copy instruction. @@ -207,6 +214,9 @@ /// full register, but was a subreg operation. bool isPartial() const { return partial_; } + /// isCrossClass - Return true if DstReg is virtual and NewRC is a smaller register class than DstReg's. + bool isCrossClass() const { return crossClass_; } + /// isFlipped - Return true when getSrcReg is the register being defined by /// the original copy instruction. bool isFlipped() const { return flipped_; } @@ -222,6 +232,10 @@ /// coalesced into, or 0. unsigned getSubIdx() const { return subIdx_; } + /// getOrigDstReg - Return DstReg as it appeared in the original copy + /// instruction before any subreg adjustments. + unsigned getOrigDstReg() const { return isPhys() ? origDstReg_ : dstReg_; } + /// getNewRC - Return the register class of the coalesced register. const TargetRegisterClass *getNewRC() const { return newRC_; } }; Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=106701&r1=106700&r2=106701&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Jun 23 19:12:39 2010 @@ -218,10 +218,7 @@ return false; } -/// conflictsWithSubPhysRegRef - Similar to conflictsWithPhysRegRef except -/// it checks for sub-register reference and it can check use as well. -bool LiveIntervals::conflictsWithSubPhysRegRef(LiveInterval &li, - unsigned Reg, bool CheckUse, +bool LiveIntervals::conflictsWithAliasRef(LiveInterval &li, unsigned Reg, SmallPtrSet &JoinedCopies) { for (LiveInterval::Ranges::const_iterator I = li.ranges.begin(), E = li.ranges.end(); I != E; ++I) { @@ -239,12 +236,11 @@ MachineOperand& MO = MI->getOperand(i); if (!MO.isReg()) continue; - if (MO.isUse() && !CheckUse) - continue; unsigned PhysReg = MO.getReg(); - if (PhysReg == 0 || TargetRegisterInfo::isVirtualRegister(PhysReg)) + if (PhysReg == 0 || PhysReg == Reg || + TargetRegisterInfo::isVirtualRegister(PhysReg)) continue; - if (tri_->isSubRegister(Reg, PhysReg)) + if (tri_->regsOverlap(Reg, PhysReg)) return true; } } @@ -1284,6 +1280,7 @@ continue; SlotIndex KillIdx = VNI->kills[j]; + assert(getInstructionFromIndex(KillIdx) && "Dangling kill"); if (KillIdx > Idx && KillIdx <= End) return true; } Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=106701&r1=106700&r2=106701&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original) +++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Wed Jun 23 19:12:39 2010 @@ -63,7 +63,7 @@ bool CoalescerPair::setRegisters(const MachineInstr *MI) { srcReg_ = dstReg_ = subIdx_ = 0; newRC_ = 0; - flipped_ = false; + flipped_ = crossClass_ = false; unsigned Src, Dst, SrcSub, DstSub; if (!isMoveInstr(MI, Src, Dst, SrcSub, DstSub)) @@ -78,6 +78,7 @@ std::swap(SrcSub, DstSub); flipped_ = true; } + origDstReg_ = Dst; const MachineRegisterInfo &MRI = MI->getParent()->getParent()->getRegInfo(); @@ -100,11 +101,19 @@ } else { // Both registers are virtual. - // Identical sub to sub. - if (SrcSub == DstSub) + // Both registers have subreg indices. + if (SrcSub && DstSub) { + // For now we only handle the case of identical indices in commensurate + // registers: Dreg:ssub_1 + Dreg:ssub_1 -> Dreg + // FIXME: Handle Qreg:ssub_3 + Dreg:ssub_1 as QReg:dsub_1 + Dreg. + if (SrcSub != DstSub) + return false; + const TargetRegisterClass *SrcRC = MRI.getRegClass(Src); + const TargetRegisterClass *DstRC = MRI.getRegClass(Dst); + if (!getCommonSubClass(DstRC, SrcRC)) + return false; SrcSub = DstSub = 0; - else if (SrcSub && DstSub) - return false; // FIXME: Qreg:ssub_3 + Dreg:ssub_1 => QReg:dsub_1 + Dreg. + } // There can be no SrcSub. if (SrcSub) { @@ -124,6 +133,7 @@ newRC_ = getCommonSubClass(DstRC, SrcRC); if (!newRC_) return false; + crossClass_ = newRC_ != DstRC || newRC_ != SrcRC; } // Check our invariants assert(TargetRegisterInfo::isVirtualRegister(Src) && "Src must be virtual"); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=106701&r1=106700&r2=106701&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Wed Jun 23 19:12:39 2010 @@ -783,14 +783,11 @@ /// being updated is not zero, make sure to set it to the correct physical /// subregister. void -SimpleRegisterCoalescing::UpdateRegDefsUses(unsigned SrcReg, unsigned DstReg, - unsigned SubIdx) { - bool DstIsPhys = TargetRegisterInfo::isPhysicalRegister(DstReg); - if (DstIsPhys && SubIdx) { - // Figure out the real physical register we are updating with. - DstReg = tri_->getSubReg(DstReg, SubIdx); - SubIdx = 0; - } +SimpleRegisterCoalescing::UpdateRegDefsUses(const CoalescerPair &CP) { + bool DstIsPhys = CP.isPhys(); + unsigned SrcReg = CP.getSrcReg(); + unsigned DstReg = CP.getDstReg(); + unsigned SubIdx = CP.getSubIdx(); // Collect all the instructions using SrcReg. SmallPtrSet Instrs; @@ -1014,25 +1011,6 @@ return removeIntervalIfEmpty(li, li_, tri_); } -/// CanCoalesceWithImpDef - Returns true if the specified copy instruction -/// from an implicit def to another register can be coalesced away. -bool SimpleRegisterCoalescing::CanCoalesceWithImpDef(MachineInstr *CopyMI, - LiveInterval &li, - LiveInterval &ImpLi) const{ - if (!CopyMI->killsRegister(ImpLi.reg)) - return false; - // Make sure this is the only use. - for (MachineRegisterInfo::use_iterator UI = mri_->use_begin(ImpLi.reg), - UE = mri_->use_end(); UI != UE;) { - MachineInstr *UseMI = &*UI; - ++UI; - if (CopyMI == UseMI || JoinedCopies.count(UseMI)) - continue; - return false; - } - return true; -} - /// isWinToJoinCrossClass - Return true if it's profitable to coalesce /// two virtual registers from different register classes. @@ -1219,17 +1197,6 @@ return true; } -/// getRegAllocPreference - Return register allocation preference register. -/// -static unsigned getRegAllocPreference(unsigned Reg, MachineFunction &MF, - MachineRegisterInfo *MRI, - const TargetRegisterInfo *TRI) { - if (TargetRegisterInfo::isPhysicalRegister(Reg)) - return 0; - std::pair Hint = MRI->getRegAllocationHint(Reg); - return TRI->ResolveRegAllocHint(Hint.first, Hint.second, MF); -} - /// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg, /// which are the src/dst of the copy instruction CopyMI. This returns true /// if the copy was successfully coalesced away. If it is not currently @@ -1244,393 +1211,131 @@ DEBUG(dbgs() << li_->getInstructionIndex(CopyMI) << '\t' << *CopyMI); - unsigned SrcReg, DstReg, SrcSubIdx = 0, DstSubIdx = 0; - bool isExtSubReg = CopyMI->isExtractSubreg(); - bool isInsSubReg = CopyMI->isInsertSubreg(); - bool isSubRegToReg = CopyMI->isSubregToReg(); - unsigned SubIdx = 0; - if (isExtSubReg) { - DstReg = CopyMI->getOperand(0).getReg(); - DstSubIdx = CopyMI->getOperand(0).getSubReg(); - SrcReg = CopyMI->getOperand(1).getReg(); - SrcSubIdx = CopyMI->getOperand(2).getImm(); - } else if (isInsSubReg || isSubRegToReg) { - DstReg = CopyMI->getOperand(0).getReg(); - DstSubIdx = CopyMI->getOperand(3).getImm(); - SrcReg = CopyMI->getOperand(2).getReg(); - SrcSubIdx = CopyMI->getOperand(2).getSubReg(); - if (SrcSubIdx && SrcSubIdx != DstSubIdx) { - // r1025 = INSERT_SUBREG r1025, r1024<2>, 2 Then r1024 has already been - // coalesced to a larger register so the subreg indices cancel out. - DEBUG(dbgs() << "\tSource of insert_subreg or subreg_to_reg is already " - "coalesced to another register.\n"); - return false; // Not coalescable. - } - } else if (tii_->isMoveInstr(*CopyMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx)) { - if (SrcSubIdx && DstSubIdx && SrcSubIdx != DstSubIdx) { - // e.g. %reg16404:1 = MOV8rr %reg16412:2 - Again = true; - return false; // Not coalescable. - } - } else { - llvm_unreachable("Unrecognized copy instruction!"); - } - - // If they are already joined we continue. - if (SrcReg == DstReg) { - DEBUG(dbgs() << "\tCopy already coalesced.\n"); - return false; // Not coalescable. - } - CoalescerPair CP(*tii_, *tri_); if (!CP.setRegisters(CopyMI)) { DEBUG(dbgs() << "\tNot coalescable.\n"); return false; } - bool SrcIsPhys = TargetRegisterInfo::isPhysicalRegister(SrcReg); - bool DstIsPhys = TargetRegisterInfo::isPhysicalRegister(DstReg); - - // If they are both physical registers, we cannot join them. - if (SrcIsPhys && DstIsPhys) { - DEBUG(dbgs() << "\tCan not coalesce physregs.\n"); - return false; // Not coalescable. - } - - // We only join virtual registers with allocatable physical registers. - if (SrcIsPhys && !allocatableRegs_[SrcReg]) { - DEBUG(dbgs() << "\tSrc reg is unallocatable physreg.\n"); - return false; // Not coalescable. - } - if (DstIsPhys && !allocatableRegs_[DstReg]) { - DEBUG(dbgs() << "\tDst reg is unallocatable physreg.\n"); + // If they are already joined we continue. + if (CP.getSrcReg() == CP.getDstReg()) { + DEBUG(dbgs() << "\tCopy already coalesced.\n"); return false; // Not coalescable. } - // We cannot handle dual subreg indices and mismatched classes at the same - // time. - if (SrcSubIdx && DstSubIdx && differingRegisterClasses(SrcReg, DstReg)) { - DEBUG(dbgs() << "\tCannot handle subreg indices and mismatched classes.\n"); - return false; - } - - // Check that a physical source register is compatible with dst regclass - if (SrcIsPhys) { - unsigned SrcSubReg = SrcSubIdx ? - tri_->getSubReg(SrcReg, SrcSubIdx) : SrcReg; - const TargetRegisterClass *DstRC = mri_->getRegClass(DstReg); - const TargetRegisterClass *DstSubRC = DstRC; - if (DstSubIdx) - DstSubRC = DstRC->getSubRegisterRegClass(DstSubIdx); - assert(DstSubRC && "Illegal subregister index"); - if (!DstSubRC->contains(SrcSubReg)) { - DEBUG(dbgs() << "\tIncompatible destination regclass: " - << "none of the super-registers of " - << tri_->getName(SrcSubReg) << " are in " - << DstSubRC->getName() << ".\n"); - return false; // Not coalescable. - } - } - - // Check that a physical dst register is compatible with source regclass - if (DstIsPhys) { - unsigned DstSubReg = DstSubIdx ? - tri_->getSubReg(DstReg, DstSubIdx) : DstReg; - const TargetRegisterClass *SrcRC = mri_->getRegClass(SrcReg); - const TargetRegisterClass *SrcSubRC = SrcRC; - if (SrcSubIdx) - SrcSubRC = SrcRC->getSubRegisterRegClass(SrcSubIdx); - assert(SrcSubRC && "Illegal subregister index"); - if (!SrcSubRC->contains(DstSubReg)) { - DEBUG(dbgs() << "\tIncompatible source regclass: " - << "none of the super-registers of " - << tri_->getName(DstSubReg) << " are in " - << SrcSubRC->getName() << ".\n"); - (void)DstSubReg; - return false; // Not coalescable. - } - } - - // Should be non-null only when coalescing to a sub-register class. - bool CrossRC = false; - const TargetRegisterClass *SrcRC= SrcIsPhys ? 0 : mri_->getRegClass(SrcReg); - const TargetRegisterClass *DstRC= DstIsPhys ? 0 : mri_->getRegClass(DstReg); - const TargetRegisterClass *NewRC = NULL; - unsigned RealDstReg = 0; - unsigned RealSrcReg = 0; - if (isExtSubReg || isInsSubReg || isSubRegToReg) { - SubIdx = CopyMI->getOperand(isExtSubReg ? 2 : 3).getImm(); - if (SrcIsPhys && isExtSubReg) { - // r1024 = EXTRACT_SUBREG EAX, 0 then r1024 is really going to be - // coalesced with AX. - unsigned DstSubIdx = CopyMI->getOperand(0).getSubReg(); - if (DstSubIdx) { - // r1024<2> = EXTRACT_SUBREG EAX, 2. Then r1024 has already been - // coalesced to a larger register so the subreg indices cancel out. - if (DstSubIdx != SubIdx) { - DEBUG(dbgs() << "\t Sub-register indices mismatch.\n"); - return false; // Not coalescable. - } - } else - SrcReg = tri_->getSubReg(SrcReg, SubIdx); - SubIdx = 0; - } else if (DstIsPhys && (isInsSubReg || isSubRegToReg)) { - // EAX = INSERT_SUBREG EAX, r1024, 0 - unsigned SrcSubIdx = CopyMI->getOperand(2).getSubReg(); - if (SrcSubIdx) { - // EAX = INSERT_SUBREG EAX, r1024<2>, 2 Then r1024 has already been - // coalesced to a larger register so the subreg indices cancel out. - if (SrcSubIdx != SubIdx) { - DEBUG(dbgs() << "\t Sub-register indices mismatch.\n"); - return false; // Not coalescable. - } - } else - DstReg = tri_->getSubReg(DstReg, SubIdx); - SubIdx = 0; - } else if ((DstIsPhys && isExtSubReg) || - (SrcIsPhys && (isInsSubReg || isSubRegToReg))) { - if (!isSubRegToReg && CopyMI->getOperand(1).getSubReg()) { - DEBUG(dbgs() << "\tSrc of extract_subreg already coalesced with reg" - << " of a super-class.\n"); - return false; // Not coalescable. - } - - // FIXME: The following checks are somewhat conservative. Perhaps a better - // way to implement this is to treat this as coalescing a vr with the - // super physical register. - if (isExtSubReg) { - if (!CanJoinExtractSubRegToPhysReg(DstReg, SrcReg, SubIdx, RealDstReg)) - return false; // Not coalescable - } else { - if (!CanJoinInsertSubRegToPhysReg(DstReg, SrcReg, SubIdx, RealSrcReg)) - return false; // Not coalescable - } - SubIdx = 0; - } else { - unsigned OldSubIdx = isExtSubReg ? CopyMI->getOperand(0).getSubReg() - : CopyMI->getOperand(2).getSubReg(); - if (OldSubIdx) { - if (OldSubIdx == SubIdx && !differingRegisterClasses(SrcReg, DstReg)) - // r1024<2> = EXTRACT_SUBREG r1025, 2. Then r1024 has already been - // coalesced to a larger register so the subreg indices cancel out. - // Also check if the other larger register is of the same register - // class as the would be resulting register. - SubIdx = 0; - else { - DEBUG(dbgs() << "\t Sub-register indices mismatch.\n"); - return false; // Not coalescable. - } - } - if (SubIdx) { - if (!DstIsPhys && !SrcIsPhys) { - if (isInsSubReg || isSubRegToReg) { - NewRC = tri_->getMatchingSuperRegClass(DstRC, SrcRC, SubIdx); - } else // extract_subreg { - NewRC = tri_->getMatchingSuperRegClass(SrcRC, DstRC, SubIdx); - } - if (!NewRC) { - DEBUG(dbgs() << "\t Conflicting sub-register indices.\n"); - return false; // Not coalescable - } + DEBUG(dbgs() << "\tConsidering merging %reg" << CP.getSrcReg()); - if (!isWinToJoinCrossClass(SrcReg, DstReg, SrcRC, DstRC, NewRC)) { - DEBUG(dbgs() << "\tAvoid coalescing to constrained register class: " - << SrcRC->getName() << "/" - << DstRC->getName() << " -> " - << NewRC->getName() << ".\n"); - Again = true; // May be possible to coalesce later. - return false; - } - } + // Enforce policies. + if (CP.isPhys()) { + DEBUG(dbgs() <<" with physreg %" << tri_->getName(CP.getDstReg()) << "\n"); + // Only coalesce to allocatable physreg. + if (!allocatableRegs_[CP.getDstReg()]) { + DEBUG(dbgs() << "\tRegister is an unallocatable physreg.\n"); + return false; // Not coalescable. } - } else if (differingRegisterClasses(SrcReg, DstReg)) { - if (DisableCrossClassJoin) - return false; - CrossRC = true; + } else { + DEBUG({ + dbgs() << " with reg%" << CP.getDstReg(); + if (CP.getSubIdx()) + dbgs() << ":" << tri_->getSubRegIndexName(CP.getSubIdx()); + dbgs() << " to " << CP.getNewRC()->getName() << "\n"; + }); - // FIXME: What if the result of a EXTRACT_SUBREG is then coalesced - // with another? If it's the resulting destination register, then - // the subidx must be propagated to uses (but only those defined - // by the EXTRACT_SUBREG). If it's being coalesced into another - // register, it should be safe because register is assumed to have - // the register class of the super-register. - - // Process moves where one of the registers have a sub-register index. - MachineOperand *DstMO = CopyMI->findRegisterDefOperand(DstReg); - MachineOperand *SrcMO = CopyMI->findRegisterUseOperand(SrcReg); - SubIdx = DstMO->getSubReg(); - if (SubIdx) { - if (SrcMO->getSubReg()) - // FIXME: can we handle this? + // Avoid constraining virtual register regclass too much. + if (CP.isCrossClass()) { + if (DisableCrossClassJoin) { + DEBUG(dbgs() << "\tCross-class joins disabled.\n"); return false; - // This is not an insert_subreg but it looks like one. - // e.g. %reg1024:4 = MOV32rr %EAX - isInsSubReg = true; - if (SrcIsPhys) { - if (!CanJoinInsertSubRegToPhysReg(DstReg, SrcReg, SubIdx, RealSrcReg)) - return false; // Not coalescable - SubIdx = 0; - } - } else { - SubIdx = SrcMO->getSubReg(); - if (SubIdx) { - // This is not a extract_subreg but it looks like one. - // e.g. %cl = MOV16rr %reg1024:1 - isExtSubReg = true; - if (DstIsPhys) { - if (!CanJoinExtractSubRegToPhysReg(DstReg, SrcReg, SubIdx,RealDstReg)) - return false; // Not coalescable - SubIdx = 0; - } - } - } - - // Now determine the register class of the joined register. - if (!SrcIsPhys && !DstIsPhys) { - if (isExtSubReg) { - NewRC = - SubIdx ? tri_->getMatchingSuperRegClass(SrcRC, DstRC, SubIdx) : SrcRC; - } else if (isInsSubReg) { - NewRC = - SubIdx ? tri_->getMatchingSuperRegClass(DstRC, SrcRC, SubIdx) : DstRC; - } else { - NewRC = getCommonSubClass(SrcRC, DstRC); } - - if (!NewRC) { - DEBUG(dbgs() << "\tDisjoint regclasses: " - << SrcRC->getName() << ", " - << DstRC->getName() << ".\n"); - return false; // Not coalescable. - } - - // If we are joining two virtual registers and the resulting register - // class is more restrictive (fewer register, smaller size). Check if it's - // worth doing the merge. - if (!isWinToJoinCrossClass(SrcReg, DstReg, SrcRC, DstRC, NewRC)) { + if (!isWinToJoinCrossClass(CP.getSrcReg(), CP.getDstReg(), + mri_->getRegClass(CP.getSrcReg()), + mri_->getRegClass(CP.getDstReg()), + CP.getNewRC())) { DEBUG(dbgs() << "\tAvoid coalescing to constrained register class: " - << SrcRC->getName() << "/" - << DstRC->getName() << " -> " - << NewRC->getName() << ".\n"); - // Allow the coalescer to try again in case either side gets coalesced to - // a physical register that's compatible with the other side. e.g. - // r1024 = MOV32to32_ r1025 - // But later r1024 is assigned EAX then r1025 may be coalesced with EAX. + << CP.getNewRC()->getName() << ".\n"); Again = true; // May be possible to coalesce later. return false; } } - } - // Will it create illegal extract_subreg / insert_subreg? - if (SrcIsPhys && HasIncompatibleSubRegDefUse(CopyMI, DstReg, SrcReg)) - return false; - if (DstIsPhys && HasIncompatibleSubRegDefUse(CopyMI, SrcReg, DstReg)) - return false; - - LiveInterval &SrcInt = li_->getInterval(SrcReg); - LiveInterval &DstInt = li_->getInterval(DstReg); - assert(SrcInt.reg == SrcReg && DstInt.reg == DstReg && - "Register mapping is horribly broken!"); - - DEBUG({ - dbgs() << "\t\tInspecting "; - if (SrcRC) dbgs() << SrcRC->getName() << ": "; - SrcInt.print(dbgs(), tri_); - dbgs() << "\n\t\t and "; - if (DstRC) dbgs() << DstRC->getName() << ": "; - DstInt.print(dbgs(), tri_); - dbgs() << "\n"; - }); - - // Save a copy of the virtual register live interval. We'll manually - // merge this into the "real" physical register live interval this is - // coalesced with. - OwningPtr SavedLI; - if (RealDstReg) - SavedLI.reset(li_->dupInterval(&SrcInt)); - else if (RealSrcReg) - SavedLI.reset(li_->dupInterval(&DstInt)); - - if (!isExtSubReg && !isInsSubReg && !isSubRegToReg) { - // Check if it is necessary to propagate "isDead" property. - MachineOperand *mopd = CopyMI->findRegisterDefOperand(DstReg, false); - bool isDead = mopd->isDead(); - - // We need to be careful about coalescing a source physical register with a - // virtual register. Once the coalescing is done, it cannot be broken and - // these are not spillable! If the destination interval uses are far away, - // think twice about coalescing them! - if (!isDead && (SrcIsPhys || DstIsPhys)) { - // If the virtual register live interval is long but it has low use - // density, do not join them, instead mark the physical register as its - // allocation preference. - LiveInterval &JoinVInt = SrcIsPhys ? DstInt : SrcInt; - LiveInterval &JoinPInt = SrcIsPhys ? SrcInt : DstInt; - unsigned JoinVReg = SrcIsPhys ? DstReg : SrcReg; - unsigned JoinPReg = SrcIsPhys ? SrcReg : DstReg; - - // Don't join with physregs that have a ridiculous number of live - // ranges. The data structure performance is really bad when that - // happens. - if (JoinPInt.ranges.size() > 1000) { - mri_->setRegAllocationHint(JoinVInt.reg, 0, JoinPReg); - ++numAborts; - DEBUG(dbgs() - << "\tPhysical register live interval too complicated, abort!\n"); - return false; - } + // When possible, let DstReg be the larger interval. + if (!CP.getSubIdx() && li_->getInterval(CP.getSrcReg()).ranges.size() > + li_->getInterval(CP.getDstReg()).ranges.size()) + CP.flip(); + } + + // We need to be careful about coalescing a source physical register with a + // virtual register. Once the coalescing is done, it cannot be broken and + // these are not spillable! If the destination interval uses are far away, + // think twice about coalescing them! + // FIXME: Why are we skipping this test for partial copies? + // CodeGen/X86/phys_subreg_coalesce-3.ll needs it. + if (!CP.isPartial() && CP.isPhys()) { + LiveInterval &JoinVInt = li_->getInterval(CP.getSrcReg()); + + // Don't join with physregs that have a ridiculous number of live + // ranges. The data structure performance is really bad when that + // happens. + if (li_->hasInterval(CP.getDstReg()) && + li_->getInterval(CP.getDstReg()).ranges.size() > 1000) { + mri_->setRegAllocationHint(CP.getSrcReg(), 0, CP.getDstReg()); + ++numAborts; + DEBUG(dbgs() + << "\tPhysical register live interval too complicated, abort!\n"); + return false; + } - const TargetRegisterClass *RC = mri_->getRegClass(JoinVReg); - unsigned Threshold = allocatableRCRegs_[RC].count() * 2; - unsigned Length = li_->getApproximateInstructionCount(JoinVInt); - if (Length > Threshold && - std::distance(mri_->use_nodbg_begin(JoinVReg), - mri_->use_nodbg_end()) * Threshold < Length) { - // Before giving up coalescing, if definition of source is defined by - // trivial computation, try rematerializing it. - if (ReMaterializeTrivialDef(SrcInt, DstReg, DstSubIdx, CopyMI)) - return true; + const TargetRegisterClass *RC = mri_->getRegClass(CP.getSrcReg()); + unsigned Threshold = allocatableRCRegs_[RC].count() * 2; + unsigned Length = li_->getApproximateInstructionCount(JoinVInt); + if (Length > Threshold && + std::distance(mri_->use_nodbg_begin(CP.getSrcReg()), + mri_->use_nodbg_end()) * Threshold < Length) { + // Before giving up coalescing, if definition of source is defined by + // trivial computation, try rematerializing it. + if (!CP.isFlipped() && + ReMaterializeTrivialDef(JoinVInt, CP.getDstReg(), 0, CopyMI)) + return true; - mri_->setRegAllocationHint(JoinVInt.reg, 0, JoinPReg); - ++numAborts; - DEBUG(dbgs() << "\tMay tie down a physical register, abort!\n"); - Again = true; // May be possible to coalesce later. - return false; - } + mri_->setRegAllocationHint(CP.getSrcReg(), 0, CP.getDstReg()); + ++numAborts; + DEBUG(dbgs() << "\tMay tie down a physical register, abort!\n"); + Again = true; // May be possible to coalesce later. + return false; } } + // We may need the source interval after JoinIntervals has destroyed it. + OwningPtr SavedLI; + if (CP.getOrigDstReg() != CP.getDstReg()) + SavedLI.reset(li_->dupInterval(&li_->getInterval(CP.getSrcReg()))); + // Okay, attempt to join these two intervals. On failure, this returns false. // Otherwise, if one of the intervals being joined is a physreg, this method // always canonicalizes DstInt to be it. The output "SrcInt" will not have // been modified, so we can use this information below to update aliases. - bool Swapped = false; - // If SrcInt is implicitly defined, it's safe to coalesce. - if (SrcInt.empty()) { - if (!CanCoalesceWithImpDef(CopyMI, DstInt, SrcInt)) { - // Only coalesce an empty interval (defined by implicit_def) with - // another interval which has a valno defined by the CopyMI and the CopyMI - // is a kill of the implicit def. - DEBUG(dbgs() << "\tNot profitable!\n"); - return false; - } - } else if (!JoinIntervals(DstInt, SrcInt, Swapped, CP)) { + if (!JoinIntervals(CP)) { // Coalescing failed. // If definition of source is defined by trivial computation, try // rematerializing it. - if (!isExtSubReg && !isInsSubReg && !isSubRegToReg && - ReMaterializeTrivialDef(SrcInt, DstReg, DstSubIdx, CopyMI)) + if (!CP.isFlipped() && + ReMaterializeTrivialDef(li_->getInterval(CP.getSrcReg()), + CP.getDstReg(), 0, CopyMI)) return true; // If we can eliminate the copy without merging the live ranges, do so now. - if (!isExtSubReg && !isInsSubReg && !isSubRegToReg && - (AdjustCopiesBackFrom(SrcInt, DstInt, CopyMI) || - RemoveCopyByCommutingDef(SrcInt, DstInt, CopyMI))) { - JoinedCopies.insert(CopyMI); - DEBUG(dbgs() << "\tTrivial!\n"); - return true; + if (!CP.isPartial()) { + LiveInterval *UseInt = &li_->getInterval(CP.getSrcReg()); + LiveInterval *DefInt = &li_->getInterval(CP.getDstReg()); + if (CP.isFlipped()) + std::swap(UseInt, DefInt); + if (AdjustCopiesBackFrom(*UseInt, *DefInt, CopyMI) || + RemoveCopyByCommutingDef(*UseInt, *DefInt, CopyMI)) { + JoinedCopies.insert(CopyMI); + DEBUG(dbgs() << "\tTrivial!\n"); + return true; + } } // Otherwise, we are unable to join the intervals. @@ -1639,25 +1344,15 @@ return false; } - LiveInterval *ResSrcInt = &SrcInt; - LiveInterval *ResDstInt = &DstInt; - if (Swapped) { - std::swap(SrcReg, DstReg); - std::swap(ResSrcInt, ResDstInt); - } - assert(TargetRegisterInfo::isVirtualRegister(SrcReg) && - "LiveInterval::join didn't work right!"); - - // If we're about to merge live ranges into a physical register live interval, - // we have to update any aliased register's live ranges to indicate that they - // have clobbered values for this range. - if (TargetRegisterInfo::isPhysicalRegister(DstReg)) { + if (CP.isPhys()) { // If this is a extract_subreg where dst is a physical register, e.g. // cl = EXTRACT_SUBREG reg1024, 1 // then create and update the actual physical register allocated to RHS. - if (RealDstReg || RealSrcReg) { - LiveInterval &RealInt = - li_->getOrCreateInterval(RealDstReg ? RealDstReg : RealSrcReg); + unsigned LargerDstReg = CP.getDstReg(); + if (CP.getOrigDstReg() != CP.getDstReg()) { + if (tri_->isSubRegister(CP.getOrigDstReg(), LargerDstReg)) + LargerDstReg = CP.getOrigDstReg(); + LiveInterval &RealInt = li_->getOrCreateInterval(CP.getDstReg()); for (LiveInterval::const_vni_iterator I = SavedLI->vni_begin(), E = SavedLI->vni_end(); I != E; ++I) { const VNInfo *ValNo = *I; @@ -1669,56 +1364,45 @@ RealInt.MergeValueInAsValue(*SavedLI, ValNo, NewValNo); } RealInt.weight += SavedLI->weight; - DstReg = RealDstReg ? RealDstReg : RealSrcReg; } // Update the liveintervals of sub-registers. - for (const unsigned *AS = tri_->getSubRegisters(DstReg); *AS; ++AS) - li_->getOrCreateInterval(*AS).MergeInClobberRanges(*li_, *ResSrcInt, - li_->getVNInfoAllocator()); - } - - // If this is a EXTRACT_SUBREG, make sure the result of coalescing is the - // larger super-register. - if ((isExtSubReg || isInsSubReg || isSubRegToReg) && - !SrcIsPhys && !DstIsPhys) { - if ((isExtSubReg && !Swapped) || - ((isInsSubReg || isSubRegToReg) && Swapped)) { - ResSrcInt->Copy(*ResDstInt, mri_, li_->getVNInfoAllocator()); - std::swap(SrcReg, DstReg); - std::swap(ResSrcInt, ResDstInt); + LiveInterval &LargerInt = li_->getInterval(LargerDstReg); + for (const unsigned *AS = tri_->getSubRegisters(LargerDstReg); *AS; ++AS) { + LiveInterval &SRI = li_->getOrCreateInterval(*AS); + SRI.MergeInClobberRanges(*li_, LargerInt, li_->getVNInfoAllocator()); + DEBUG({ + dbgs() << "\t\tsubreg: "; SRI.print(dbgs(), tri_); dbgs() << "\n"; + }); } } // Coalescing to a virtual register that is of a sub-register class of the // other. Make sure the resulting register is set to the right register class. - if (CrossRC) + if (CP.isCrossClass()) { ++numCrossRCs; - - // This may happen even if it's cross-rc coalescing. e.g. - // %reg1026 = SUBREG_TO_REG 0, %reg1037, 4 - // reg1026 -> GR64, reg1037 -> GR32_ABCD. The resulting register will have to - // be allocate a register from GR64_ABCD. - if (NewRC) - mri_->setRegClass(DstReg, NewRC); + mri_->setRegClass(CP.getDstReg(), CP.getNewRC()); + } // Remember to delete the copy instruction. JoinedCopies.insert(CopyMI); - UpdateRegDefsUses(SrcReg, DstReg, SubIdx); + UpdateRegDefsUses(CP); // If we have extended the live range of a physical register, make sure we // update live-in lists as well. - if (TargetRegisterInfo::isPhysicalRegister(DstReg)) { - const LiveInterval &VRegInterval = li_->getInterval(SrcReg); + if (CP.isPhys()) { SmallVector BlockSeq; - for (LiveInterval::const_iterator I = VRegInterval.begin(), - E = VRegInterval.end(); I != E; ++I ) { + // JoinIntervals invalidates the VNInfos in SrcInt, but we only need the + // ranges for this, and they are preserved. + LiveInterval &SrcInt = li_->getInterval(CP.getSrcReg()); + for (LiveInterval::const_iterator I = SrcInt.begin(), E = SrcInt.end(); + I != E; ++I ) { li_->findLiveInMBBs(I->start, I->end, BlockSeq); for (unsigned idx = 0, size = BlockSeq.size(); idx != size; ++idx) { MachineBasicBlock &block = *BlockSeq[idx]; - if (!block.isLiveIn(DstReg)) - block.addLiveIn(DstReg); + if (!block.isLiveIn(CP.getDstReg())) + block.addLiveIn(CP.getDstReg()); } BlockSeq.clear(); } @@ -1726,32 +1410,17 @@ // SrcReg is guarateed to be the register whose live interval that is // being merged. - li_->removeInterval(SrcReg); + li_->removeInterval(CP.getSrcReg()); // Update regalloc hint. - tri_->UpdateRegAllocHint(SrcReg, DstReg, *mf_); - - // Manually deleted the live interval copy. - if (SavedLI) { - SavedLI->clear(); - SavedLI.reset(); - } - - // If resulting interval has a preference that no longer fits because of subreg - // coalescing, just clear the preference. - unsigned Preference = getRegAllocPreference(ResDstInt->reg, *mf_, mri_, tri_); - if (Preference && (isExtSubReg || isInsSubReg || isSubRegToReg) && - TargetRegisterInfo::isVirtualRegister(ResDstInt->reg)) { - const TargetRegisterClass *RC = mri_->getRegClass(ResDstInt->reg); - if (!RC->contains(Preference)) - mri_->setRegAllocationHint(ResDstInt->reg, 0, 0); - } + tri_->UpdateRegAllocHint(CP.getSrcReg(), CP.getDstReg(), *mf_); DEBUG({ - dbgs() << "\t\tJoined. Result = "; - ResDstInt->print(dbgs(), tri_); - dbgs() << "\n"; - }); + LiveInterval &DstInt = li_->getInterval(CP.getDstReg()); + dbgs() << "\tJoined. Result = "; + DstInt.print(dbgs(), tri_); + dbgs() << "\n"; + }); ++numJoins; return true; @@ -1809,26 +1478,24 @@ } /// JoinIntervals - Attempt to join these two intervals. On failure, this -/// returns false. Otherwise, if one of the intervals being joined is a -/// physreg, this method always canonicalizes LHS to be it. The output -/// "RHS" will not have been modified, so we can use this information -/// below to update aliases. -bool -SimpleRegisterCoalescing::JoinIntervals(LiveInterval &LHS, LiveInterval &RHS, - bool &Swapped, CoalescerPair &CP) { - // Compute the final value assignment, assuming that the live ranges can be - // coalesced. - SmallVector LHSValNoAssignments; - SmallVector RHSValNoAssignments; - DenseMap LHSValsDefinedFromRHS; - DenseMap RHSValsDefinedFromLHS; - SmallVector NewVNInfo; +/// returns false. +bool SimpleRegisterCoalescing::JoinIntervals(CoalescerPair &CP) { + LiveInterval &RHS = li_->getInterval(CP.getSrcReg()); + DEBUG({ dbgs() << "\t\tRHS = "; RHS.print(dbgs(), tri_); dbgs() << "\n"; }); + + // FIXME: Join into CP.getDstReg instead of CP.getOrigDstReg. + // When looking at + // %reg2000 = EXTRACT_SUBREG %EAX, sub_16bit + // we really want to join %reg2000 with %AX ( = CP.getDstReg). We are actually + // joining into %EAX ( = CP.getOrigDstReg) because it is guaranteed to have an + // existing live interval, and we are better equipped to handle interference. + // JoinCopy cleans up the mess by taking a copy of RHS before calling here, + // and merging that copy into CP.getDstReg after. // If a live interval is a physical register, conservatively check if any // of its sub-registers is overlapping the live interval of the virtual // register. If so, do not coalesce. - if (TargetRegisterInfo::isPhysicalRegister(LHS.reg) && - *tri_->getSubRegisters(LHS.reg)) { + if (CP.isPhys() && *tri_->getSubRegisters(CP.getOrigDstReg())) { // If it's coalescing a virtual register to a physical register, estimate // its live interval length. This is the *cost* of scanning an entire live // interval. If the cost is low, we'll do an exhaustive check instead. @@ -1848,10 +1515,11 @@ li_->intervalIsInOneMBB(RHS) && li_->getApproximateInstructionCount(RHS) <= 10) { // Perform a more exhaustive check for some common cases. - if (li_->conflictsWithSubPhysRegRef(RHS, LHS.reg, true, JoinedCopies)) + if (li_->conflictsWithAliasRef(RHS, CP.getOrigDstReg(), JoinedCopies)) return false; } else { - for (const unsigned* SR = tri_->getSubRegisters(LHS.reg); *SR; ++SR) + for (const unsigned* SR = tri_->getAliasSet(CP.getOrigDstReg()); *SR; + ++SR) if (li_->hasInterval(*SR) && RHS.overlaps(li_->getInterval(*SR))) { DEBUG({ dbgs() << "\tInterfere with sub-register "; @@ -1860,25 +1528,19 @@ return false; } } - } else if (TargetRegisterInfo::isPhysicalRegister(RHS.reg) && - *tri_->getSubRegisters(RHS.reg)) { - if (LHS.containsOneValue() && - li_->getApproximateInstructionCount(LHS) <= 10) { - // Perform a more exhaustive check for some common cases. - if (li_->conflictsWithSubPhysRegRef(LHS, RHS.reg, false, JoinedCopies)) - return false; - } else { - for (const unsigned* SR = tri_->getSubRegisters(RHS.reg); *SR; ++SR) - if (li_->hasInterval(*SR) && LHS.overlaps(li_->getInterval(*SR))) { - DEBUG({ - dbgs() << "\tInterfere with sub-register "; - li_->getInterval(*SR).print(dbgs(), tri_); - }); - return false; - } - } } + // Compute the final value assignment, assuming that the live ranges can be + // coalesced. + SmallVector LHSValNoAssignments; + SmallVector RHSValNoAssignments; + DenseMap LHSValsDefinedFromRHS; + DenseMap RHSValsDefinedFromLHS; + SmallVector NewVNInfo; + + LiveInterval &LHS = li_->getInterval(CP.getOrigDstReg()); + DEBUG({ dbgs() << "\t\tLHS = "; LHS.print(dbgs(), tri_); dbgs() << "\n"; }); + // Loop over the value numbers of the LHS, seeing if any are defined from // the RHS. for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end(); @@ -1967,15 +1629,17 @@ LiveInterval::const_iterator JE = RHS.end(); // Skip ahead until the first place of potential sharing. - if (I->start < J->start) { - I = std::upper_bound(I, IE, J->start); - if (I != LHS.begin()) --I; - } else if (J->start < I->start) { - J = std::upper_bound(J, JE, I->start); - if (J != RHS.begin()) --J; + if (I != IE && J != JE) { + if (I->start < J->start) { + I = std::upper_bound(I, IE, J->start); + if (I != LHS.begin()) --I; + } else if (J->start < I->start) { + J = std::upper_bound(J, JE, I->start); + if (J != RHS.begin()) --J; + } } - while (1) { + while (I != IE && J != JE) { // Determine if these two live ranges overlap. bool Overlaps; if (I->start < J->start) { @@ -1997,13 +1661,10 @@ return false; } - if (I->end < J->end) { + if (I->end < J->end) ++I; - if (I == IE) break; - } else { + else ++J; - if (J == JE) break; - } } // Update kill info. Some live ranges are extended due to copy coalescing. @@ -2028,19 +1689,15 @@ LHS.addKills(NewVNInfo[RHSValID], VNI->kills); } + if (LHSValNoAssignments.empty()) + LHSValNoAssignments.push_back(-1); + if (RHSValNoAssignments.empty()) + RHSValNoAssignments.push_back(-1); + // If we get here, we know that we can coalesce the live ranges. Ask the // intervals to coalesce themselves now. - if ((RHS.ranges.size() > LHS.ranges.size() && - TargetRegisterInfo::isVirtualRegister(LHS.reg)) || - TargetRegisterInfo::isPhysicalRegister(RHS.reg)) { - RHS.join(LHS, &RHSValNoAssignments[0], &LHSValNoAssignments[0], NewVNInfo, - mri_); - Swapped = true; - } else { - LHS.join(RHS, &LHSValNoAssignments[0], &RHSValNoAssignments[0], NewVNInfo, - mri_); - Swapped = false; - } + LHS.join(RHS, &LHSValNoAssignments[0], &RHSValNoAssignments[0], NewVNInfo, + mri_); return true; } @@ -2320,8 +1977,8 @@ if (!tii_->isMoveInstr(*MI, SrcReg, DstReg, SrcSubIdx, DstSubIdx)) { assert((MI->isExtractSubreg() || MI->isInsertSubreg() || MI->isSubregToReg()) && "Unrecognized copy instruction"); - DstReg = MI->getOperand(0).getReg(); - if (TargetRegisterInfo::isPhysicalRegister(DstReg)) + SrcReg = MI->getOperand(MI->isSubregToReg() ? 2 : 1).getReg(); + if (TargetRegisterInfo::isPhysicalRegister(SrcReg)) // Do not delete extract_subreg, insert_subreg of physical // registers unless the definition is dead. e.g. // %DO = INSERT_SUBREG %D0, %S0, 1 @@ -2330,7 +1987,7 @@ DoDelete = false; } if (MI->allDefsAreDead()) { - LiveInterval &li = li_->getInterval(DstReg); + LiveInterval &li = li_->getInterval(SrcReg); if (!ShortenDeadCopySrcLiveRange(li, MI)) ShortenDeadCopyLiveRange(li, MI); DoDelete = true; @@ -2388,6 +2045,11 @@ if (MI->registerDefIsDead(DstReg)) { if (!ShortenDeadCopySrcLiveRange(RegInt, MI)) ShortenDeadCopyLiveRange(RegInt, MI); + } else { + // If a value is killed here remove the marker. + SlotIndex UseIdx = li_->getInstructionIndex(MI).getUseIndex(); + if (const LiveRange *LR = RegInt.getLiveRangeContaining(UseIdx)) + LR->valno->removeKill(UseIdx.getDefIndex()); } } li_->RemoveMachineInstrFromMaps(MI); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h?rev=106701&r1=106700&r2=106701&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h Wed Jun 23 19:12:39 2010 @@ -105,14 +105,11 @@ /// possible to coalesce this interval, but it may be possible if other /// things get coalesced, then it returns true by reference in 'Again'. bool JoinCopy(CopyRec &TheCopy, bool &Again); - + /// JoinIntervals - Attempt to join these two intervals. On failure, this - /// returns false. Otherwise, if one of the intervals being joined is a - /// physreg, this method always canonicalizes DestInt to be it. The output - /// "SrcInt" will not have been modified, so we can use this information - /// below to update aliases. - bool JoinIntervals(LiveInterval &LHS, LiveInterval &RHS, bool &Swapped, - CoalescerPair &CP); + /// returns false. The output "SrcInt" will not have been modified, so we can + /// use this information below to update aliases. + bool JoinIntervals(CoalescerPair &CP); /// Return true if the two specified registers belong to different register /// classes. The registers may be either phys or virt regs. @@ -149,11 +146,6 @@ bool ReMaterializeTrivialDef(LiveInterval &SrcInt, unsigned DstReg, unsigned DstSubIdx, MachineInstr *CopyMI); - /// CanCoalesceWithImpDef - Returns true if the specified copy instruction - /// from an implicit def to another register can be coalesced away. - bool CanCoalesceWithImpDef(MachineInstr *CopyMI, - LiveInterval &li, LiveInterval &ImpLi) const; - /// isWinToJoinCrossClass - Return true if it's profitable to coalesce /// two virtual registers from different register classes. bool isWinToJoinCrossClass(unsigned SrcReg, @@ -186,7 +178,7 @@ /// physical register and the existing subregister number of the def / use /// being updated is not zero, make sure to set it to the correct physical /// subregister. - void UpdateRegDefsUses(unsigned SrcReg, unsigned DstReg, unsigned SubIdx); + void UpdateRegDefsUses(const CoalescerPair &CP); /// ShortenDeadCopyLiveRange - Shorten a live range defined by a dead copy. /// Return true if live interval is removed. Modified: llvm/trunk/test/CodeGen/ARM/vget_lane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vget_lane.ll?rev=106701&r1=106700&r2=106701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vget_lane.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vget_lane.ll Wed Jun 23 19:12:39 2010 @@ -204,8 +204,8 @@ define arm_aapcs_vfpcc <2 x float> @test_vset_lanef32(float %arg0_float32_t, <2 x float> %arg1_float32x2_t) nounwind { ;CHECK: test_vset_lanef32: -;CHECK: vmov.f32 -;CHECK: vmov.f32 +;CHECK: vmov.f32 s3, s0 +;CHECK: vmov.f64 d0, d1 entry: %0 = insertelement <2 x float> %arg1_float32x2_t, float %arg0_float32_t, i32 1 ; <<2 x float>> [#uses=1] ret <2 x float> %0 From bruno.cardoso at gmail.com Wed Jun 23 19:15:50 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Thu, 24 Jun 2010 00:15:50 -0000 Subject: [llvm-commits] [llvm] r106702 - /llvm/trunk/lib/Target/X86/X86InstrSSE.td Message-ID: <20100624001550.4F19F2A6C12C@llvm.org> Author: bruno Date: Wed Jun 23 19:15:50 2010 New Revision: 106702 URL: http://llvm.org/viewvc/llvm-project?rev=106702&view=rev Log: Move SSE and AVX shuffle, unpack and compare code to more appropriate places Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106702&r1=106701&r2=106702&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Wed Jun 23 19:15:50 2010 @@ -444,43 +444,6 @@ RC:$src1, (mem_frag addr:$src2)))], d>; } -/// sse12_unpack_interleave - SSE 1 & 2 unpack and interleave -multiclass sse12_unpack_interleave opc, PatFrag OpNode, ValueType vt, - PatFrag mem_frag, RegisterClass RC, - X86MemOperand x86memop, string asm, - Domain d> { - def rr : PI; - def rm : PI; -} - -multiclass sse12_cmp { - def rri : PIi8<0xC2, MRMSrcReg, - (outs RC:$dst), (ins RC:$src1, RC:$src, sse_imm_op:$cc), asm, - [(set RC:$dst, (Int RC:$src1, RC:$src, imm:$cc))], d>; - def rmi : PIi8<0xC2, MRMSrcMem, - (outs RC:$dst), (ins RC:$src1, f128mem:$src, sse_imm_op:$cc), asm, - [(set RC:$dst, (Int RC:$src1, (memop addr:$src), imm:$cc))], d>; -} - -// FIXME: rename instructions to only use the class above -multiclass sse12_cmp_alt { - def rri_alt : PIi8<0xC2, MRMSrcReg, - (outs RC:$dst), (ins RC:$src1, RC:$src, sse_imm_op:$src2), asm, - [], d>; - def rmi_alt : PIi8<0xC2, MRMSrcMem, - (outs RC:$dst), (ins RC:$src1, f128mem:$src, sse_imm_op:$src2), asm, - [], d>; -} - //===----------------------------------------------------------------------===// // SSE1 Instructions //===----------------------------------------------------------------------===// @@ -741,6 +704,27 @@ // SSE 1 & 2 - Compare Instructions //===----------------------------------------------------------------------===// +multiclass sse12_cmp { + def rri : PIi8<0xC2, MRMSrcReg, + (outs RC:$dst), (ins RC:$src1, RC:$src, sse_imm_op:$cc), asm, + [(set RC:$dst, (Int RC:$src1, RC:$src, imm:$cc))], d>; + def rmi : PIi8<0xC2, MRMSrcMem, + (outs RC:$dst), (ins RC:$src1, f128mem:$src, sse_imm_op:$cc), asm, + [(set RC:$dst, (Int RC:$src1, (memop addr:$src), imm:$cc))], d>; +} + +// FIXME: rename instructions to only use the class above +multiclass sse12_cmp_alt { + def rri_alt : PIi8<0xC2, MRMSrcReg, + (outs RC:$dst), (ins RC:$src1, RC:$src, sse_imm_op:$src2), asm, + [], d>; + def rmi_alt : PIi8<0xC2, MRMSrcMem, + (outs RC:$dst), (ins RC:$src1, f128mem:$src, sse_imm_op:$src2), asm, + [], d>; +} + // Comparison instructions let Constraints = "$src1 = $dst", neverHasSideEffects = 1 in { def CMPSSrr : SSIi8<0xC2, MRMSrcReg, @@ -860,6 +844,170 @@ (load addr:$src2)))]>; } // Defs = [EFLAGS] +let Constraints = "$src1 = $dst" in { + defm CMPPS : sse12_cmp, + TB; + defm CMPPD : sse12_cmp, + TB, OpSize; +} +let isAsmParserOnly = 1 in { + defm VCMPPS : sse12_cmp, VEX_4V; + defm VCMPPD : sse12_cmp, OpSize, VEX_4V; +} + +let isAsmParserOnly = 1, Pattern = [] in { + // Accept explicit immediate argument form instead of comparison code. + let Constraints = "$src1 = $dst" in { + defm CMPPS : sse12_cmp_alt, TB; + defm CMPPD : sse12_cmp_alt, TB, OpSize; + } + defm VCMPPS : sse12_cmp_alt, VEX_4V; + defm VCMPPD : sse12_cmp_alt, OpSize, VEX_4V; +} + +def : Pat<(v4i32 (X86cmpps (v4f32 VR128:$src1), VR128:$src2, imm:$cc)), + (CMPPSrri (v4f32 VR128:$src1), (v4f32 VR128:$src2), imm:$cc)>; +def : Pat<(v4i32 (X86cmpps (v4f32 VR128:$src1), (memop addr:$src2), imm:$cc)), + (CMPPSrmi (v4f32 VR128:$src1), addr:$src2, imm:$cc)>; +def : Pat<(v2i64 (X86cmppd (v2f64 VR128:$src1), VR128:$src2, imm:$cc)), + (CMPPDrri VR128:$src1, VR128:$src2, imm:$cc)>; +def : Pat<(v2i64 (X86cmppd (v2f64 VR128:$src1), (memop addr:$src2), imm:$cc)), + (CMPPDrmi VR128:$src1, addr:$src2, imm:$cc)>; + +//===----------------------------------------------------------------------===// +// SSE 1 & 2 - Shuffle Instructions +//===----------------------------------------------------------------------===// + +/// sse12_shuffle - sse 1 & 2 shuffle instructions +multiclass sse12_shuffle { + def rmi : PIi8<0xC6, MRMSrcMem, (outs VR128:$dst), + (ins VR128:$src1, f128mem:$src2, i8imm:$src3), asm, + [(set VR128:$dst, (vt (shufp:$src3 + VR128:$src1, (mem_frag addr:$src2))))], d>; + let isConvertibleToThreeAddress = IsConvertibleToThreeAddress in + def rri : PIi8<0xC6, MRMSrcReg, (outs VR128:$dst), + (ins VR128:$src1, VR128:$src2, i8imm:$src3), asm, + [(set VR128:$dst, + (vt (shufp:$src3 VR128:$src1, VR128:$src2)))], d>; +} + +let isAsmParserOnly = 1 in { + defm VSHUFPS : sse12_shuffle, VEX_4V; + defm VSHUFPD : sse12_shuffle, OpSize, VEX_4V; +} + +let Constraints = "$src1 = $dst" in { + defm SHUFPS : sse12_shuffle, + TB; + defm SHUFPD : sse12_shuffle, TB, OpSize; +} + +//===----------------------------------------------------------------------===// +// SSE 1 & 2 - Unpack Instructions +//===----------------------------------------------------------------------===// + +/// sse12_unpack_interleave - sse 1 & 2 unpack and interleave +multiclass sse12_unpack_interleave opc, PatFrag OpNode, ValueType vt, + PatFrag mem_frag, RegisterClass RC, + X86MemOperand x86memop, string asm, + Domain d> { + def rr : PI; + def rm : PI; +} + +let AddedComplexity = 10 in { + let isAsmParserOnly = 1 in { + defm VUNPCKHPS: sse12_unpack_interleave<0x15, unpckh, v4f32, memopv4f32, + VR128, f128mem, "unpckhps\t{$src2, $src1, $dst|$dst, $src1, $src2}", + SSEPackedSingle>, VEX_4V; + defm VUNPCKHPD: sse12_unpack_interleave<0x15, unpckh, v2f64, memopv2f64, + VR128, f128mem, "unpckhpd\t{$src2, $src1, $dst|$dst, $src1, $src2}", + SSEPackedDouble>, OpSize, VEX_4V; + defm VUNPCKLPS: sse12_unpack_interleave<0x14, unpckl, v4f32, memopv4f32, + VR128, f128mem, "unpcklps\t{$src2, $src1, $dst|$dst, $src1, $src2}", + SSEPackedSingle>, VEX_4V; + defm VUNPCKLPD: sse12_unpack_interleave<0x14, unpckl, v2f64, memopv2f64, + VR128, f128mem, "unpcklpd\t{$src2, $src1, $dst|$dst, $src1, $src2}", + SSEPackedDouble>, OpSize, VEX_4V; + } + + let Constraints = "$src1 = $dst" in { + defm UNPCKHPS: sse12_unpack_interleave<0x15, unpckh, v4f32, memopv4f32, + VR128, f128mem, "unpckhps\t{$src2, $dst|$dst, $src2}", + SSEPackedSingle>, TB; + defm UNPCKHPD: sse12_unpack_interleave<0x15, unpckh, v2f64, memopv2f64, + VR128, f128mem, "unpckhpd\t{$src2, $dst|$dst, $src2}", + SSEPackedDouble>, TB, OpSize; + defm UNPCKLPS: sse12_unpack_interleave<0x14, unpckl, v4f32, memopv4f32, + VR128, f128mem, "unpcklps\t{$src2, $dst|$dst, $src2}", + SSEPackedSingle>, TB; + defm UNPCKLPD: sse12_unpack_interleave<0x14, unpckl, v2f64, memopv2f64, + VR128, f128mem, "unpcklpd\t{$src2, $dst|$dst, $src2}", + SSEPackedDouble>, TB, OpSize; + } // Constraints = "$src1 = $dst" +} // AddedComplexity + +//===----------------------------------------------------------------------===// +// SSE 1 & 2 - Extract Floating-Point Sign mask +//===----------------------------------------------------------------------===// + +/// sse12_extr_sign_mask - sse 1 & 2 unpack and interleave +multiclass sse12_extr_sign_mask { + def rr : PI<0x50, MRMSrcReg, (outs GR32:$dst), (ins RC:$src), + !strconcat(asm, "\t{$src, $dst|$dst, $src}"), + [(set GR32:$dst, (Int RC:$src))], d>; +} + +// Mask creation +defm MOVMSKPS : sse12_extr_sign_mask, TB; +defm MOVMSKPD : sse12_extr_sign_mask, TB, OpSize; + +let isAsmParserOnly = 1 in { + defm VMOVMSKPS : sse12_extr_sign_mask, VEX; + defm VMOVMSKPD : sse12_extr_sign_mask, OpSize, + VEX; +} + +//===----------------------------------------------------------------------===// +// SSE 1 & 2 - Misc aliasing of packed SSE 1 & 2 instructions +//===----------------------------------------------------------------------===// + // Aliases of packed SSE1 & SSE2 instructions for scalar use. These all have // names that start with 'Fs'. @@ -1348,135 +1496,6 @@ defm RCP : sse1_fp_unop_rm<0x53, "rcp", X86frcp, int_x86_sse_rcp_ss, int_x86_sse_rcp_ps>; -// Compare -let Constraints = "$src1 = $dst" in { - defm CMPPS : sse12_cmp, - TB; - defm CMPPD : sse12_cmp, - TB, OpSize; -} -let isAsmParserOnly = 1 in { - defm VCMPPS : sse12_cmp, VEX_4V; - defm VCMPPD : sse12_cmp, OpSize, VEX_4V; -} - -let isAsmParserOnly = 1, Pattern = [] in { - // Accept explicit immediate argument form instead of comparison code. - let Constraints = "$src1 = $dst" in { - defm CMPPS : sse12_cmp_alt, TB; - defm CMPPD : sse12_cmp_alt, TB, OpSize; - } - defm VCMPPS : sse12_cmp_alt, VEX_4V; - defm VCMPPD : sse12_cmp_alt, OpSize, VEX_4V; -} - -def : Pat<(v4i32 (X86cmpps (v4f32 VR128:$src1), VR128:$src2, imm:$cc)), - (CMPPSrri (v4f32 VR128:$src1), (v4f32 VR128:$src2), imm:$cc)>; -def : Pat<(v4i32 (X86cmpps (v4f32 VR128:$src1), (memop addr:$src2), imm:$cc)), - (CMPPSrmi (v4f32 VR128:$src1), addr:$src2, imm:$cc)>; -def : Pat<(v2i64 (X86cmppd (v2f64 VR128:$src1), VR128:$src2, imm:$cc)), - (CMPPDrri VR128:$src1, VR128:$src2, imm:$cc)>; -def : Pat<(v2i64 (X86cmppd (v2f64 VR128:$src1), (memop addr:$src2), imm:$cc)), - (CMPPDrmi VR128:$src1, addr:$src2, imm:$cc)>; - -// Shuffle and unpack instructions -multiclass sse12_shuffle { - def rmi : PIi8<0xC6, MRMSrcMem, (outs VR128:$dst), - (ins VR128:$src1, f128mem:$src2, i8imm:$src3), asm, - [(set VR128:$dst, (vt (shufp:$src3 - VR128:$src1, (mem_frag addr:$src2))))], d>; - let isConvertibleToThreeAddress = IsConvertibleToThreeAddress in - def rri : PIi8<0xC6, MRMSrcReg, (outs VR128:$dst), - (ins VR128:$src1, VR128:$src2, i8imm:$src3), asm, - [(set VR128:$dst, - (vt (shufp:$src3 VR128:$src1, VR128:$src2)))], d>; -} - -let Constraints = "$src1 = $dst" in { - defm SHUFPS : sse12_shuffle, - TB; - defm SHUFPD : sse12_shuffle, TB, OpSize; - - let Constraints = "", isAsmParserOnly = 1 in { - defm VSHUFPS : sse12_shuffle, VEX_4V; - defm VSHUFPD : sse12_shuffle, OpSize, VEX_4V; - } - - let AddedComplexity = 10 in { - let Constraints = "", isAsmParserOnly = 1 in { - defm VUNPCKHPS: sse12_unpack_interleave<0x15, unpckh, v4f32, memopv4f32, - VR128, f128mem, "unpckhps\t{$src2, $src1, $dst|$dst, $src1, $src2}", - SSEPackedSingle>, VEX_4V; - defm VUNPCKHPD: sse12_unpack_interleave<0x15, unpckh, v2f64, memopv2f64, - VR128, f128mem, "unpckhpd\t{$src2, $src1, $dst|$dst, $src1, $src2}", - SSEPackedDouble>, OpSize, VEX_4V; - defm VUNPCKLPS: sse12_unpack_interleave<0x14, unpckl, v4f32, memopv4f32, - VR128, f128mem, "unpcklps\t{$src2, $src1, $dst|$dst, $src1, $src2}", - SSEPackedSingle>, VEX_4V; - defm VUNPCKLPD: sse12_unpack_interleave<0x14, unpckl, v2f64, memopv2f64, - VR128, f128mem, "unpcklpd\t{$src2, $src1, $dst|$dst, $src1, $src2}", - SSEPackedDouble>, OpSize, VEX_4V; - } - defm UNPCKHPS: sse12_unpack_interleave<0x15, unpckh, v4f32, memopv4f32, - VR128, f128mem, "unpckhps\t{$src2, $dst|$dst, $src2}", - SSEPackedSingle>, TB; - defm UNPCKHPD: sse12_unpack_interleave<0x15, unpckh, v2f64, memopv2f64, - VR128, f128mem, "unpckhpd\t{$src2, $dst|$dst, $src2}", - SSEPackedDouble>, TB, OpSize; - defm UNPCKLPS: sse12_unpack_interleave<0x14, unpckl, v4f32, memopv4f32, - VR128, f128mem, "unpcklps\t{$src2, $dst|$dst, $src2}", - SSEPackedSingle>, TB; - defm UNPCKLPD: sse12_unpack_interleave<0x14, unpckl, v2f64, memopv2f64, - VR128, f128mem, "unpcklpd\t{$src2, $dst|$dst, $src2}", - SSEPackedDouble>, TB, OpSize; - } // AddedComplexity -} // Constraints = "$src1 = $dst" - -multiclass sse12_extr_sign_mask { - def rr : PI<0x50, MRMSrcReg, (outs GR32:$dst), (ins RC:$src), - !strconcat(asm, "\t{$src, $dst|$dst, $src}"), - [(set GR32:$dst, (Int RC:$src))], d>; -} - -// Mask creation -defm MOVMSKPS : sse12_extr_sign_mask, TB; -defm MOVMSKPD : sse12_extr_sign_mask, TB, OpSize; - -let isAsmParserOnly = 1 in { - defm VMOVMSKPS : sse12_extr_sign_mask, VEX; - defm VMOVMSKPD : sse12_extr_sign_mask, OpSize, - VEX; -} - // Prefetch intrinsic. def PREFETCHT0 : PSI<0x18, MRM1m, (outs), (ins i8mem:$src), "prefetcht0\t$src", [(prefetch addr:$src, imm, (i32 3))]>; From grosbach at apple.com Wed Jun 23 19:18:19 2010 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 23 Jun 2010 17:18:19 -0700 Subject: [llvm-commits] [llvm] r106693 - in /llvm/trunk: lib/Target/ARM/ARMBaseInstrInfo.cpp lib/Target/ARM/ARMBaseInstrInfo.h test/CodeGen/ARM/lsr-on-unrolled-loops.ll In-Reply-To: <06B42F16-2F24-498B-A04F-5B4CF8E63280@apple.com> References: <20100623230016.A72AF2A6C12C@llvm.org> <06B42F16-2F24-498B-A04F-5B4CF8E63280@apple.com> Message-ID: <9D5FB9CE-0349-4231-AC5F-F218494F28A5@apple.com> On Jun 23, 2010, at 4:46 PM, Dale Johannesen wrote: > > On Jun 23, 2010, at 4:00 PMPDT, Bill Wendling wrote: > >> Author: void >> Date: Wed Jun 23 18:00:16 2010 >> New Revision: 106693 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=106693&view=rev >> Log: >> We are missing opportunites to use ldm. Take code like this: >> >> void t(int *cp0, int *cp1, int *dp, int fmd) { >> int c0, c1, d0, d1, d2, d3; >> c0 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000); >> c1 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000); >> /* ... */ >> } > > You can't combine volatile loads, is there a check for this? > > I'm also wondering if interference could be a problem, where one > pointer points to the other one. I think it's OK as long as there are > no stores, as in the example. > You're right, those are potential gotchas. The ARMLoadStoreOptimizer pass checks for both of those conditions. Bill's patch is adjusting the DAG scheduler to help it keep related loads closer together so that the actual optimization pass will see them and be able to combine them effectively. > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From bruno.cardoso at gmail.com Wed Jun 23 19:32:06 2010 From: bruno.cardoso at gmail.com (Bruno Cardoso Lopes) Date: Thu, 24 Jun 2010 00:32:06 -0000 Subject: [llvm-commits] [llvm] r106705 - in /llvm/trunk: lib/Target/X86/X86InstrFormats.td lib/Target/X86/X86InstrSSE.td test/MC/AsmParser/X86/x86_32-encoding.s test/MC/AsmParser/X86/x86_64-encoding.s Message-ID: <20100624003206.A6FA52A6C12C@llvm.org> Author: bruno Date: Wed Jun 23 19:32:06 2010 New Revision: 106705 URL: http://llvm.org/viewvc/llvm-project?rev=106705&view=rev Log: Add AVX CMP{SS,SD}{rr,rm} instructions and encoding testcases Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td llvm/trunk/lib/Target/X86/X86InstrSSE.td llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFormats.td?rev=106705&r1=106704&r2=106705&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFormats.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFormats.td Wed Jun 23 19:32:06 2010 @@ -228,6 +228,18 @@ let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm); } +// SIi8 - SSE 1 & 2 scalar instructions +class SIi8 o, Format F, dag outs, dag ins, string asm, + list pattern> + : Ii8 { + let Predicates = !if(hasVEXPrefix /* VEX_4V */, + !if(!eq(Prefix, 11 /* XD */), [HasAVX, HasSSE2], [HasAVX, HasSSE1]), + !if(!eq(Prefix, 12 /* XS */), [HasSSE1], [HasSSE2])); + + // AVX instructions have a 'v' prefix in the mnemonic + let AsmString = !if(hasVEXPrefix, !strconcat("v", asm), asm); +} + // PI - SSE 1 & 2 packed instructions class PI o, Format F, dag outs, dag ins, string asm, list pattern, Domain d> Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=106705&r1=106704&r2=106705&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Wed Jun 23 19:32:06 2010 @@ -725,42 +725,61 @@ [], d>; } -// Comparison instructions -let Constraints = "$src1 = $dst", neverHasSideEffects = 1 in { - def CMPSSrr : SSIi8<0xC2, MRMSrcReg, - (outs FR32:$dst), (ins FR32:$src1, FR32:$src, SSECC:$cc), - "cmp${cc}ss\t{$src, $dst|$dst, $src}", []>; - let mayLoad = 1 in - def CMPSSrm : SSIi8<0xC2, MRMSrcMem, - (outs FR32:$dst), (ins FR32:$src1, f32mem:$src, SSECC:$cc), - "cmp${cc}ss\t{$src, $dst|$dst, $src}", []>; - - def CMPSDrr : SDIi8<0xC2, MRMSrcReg, - (outs FR64:$dst), (ins FR64:$src1, FR64:$src, SSECC:$cc), - "cmp${cc}sd\t{$src, $dst|$dst, $src}", []>; +multiclass sse12_cmp_scalar { + def rr : SIi8<0xC2, MRMSrcReg, + (outs RC:$dst), (ins RC:$src1, RC:$src, sse_imm_op:$cc), + asm, []>; let mayLoad = 1 in - def CMPSDrm : SDIi8<0xC2, MRMSrcMem, - (outs FR64:$dst), (ins FR64:$src1, f64mem:$src, SSECC:$cc), - "cmp${cc}sd\t{$src, $dst|$dst, $src}", []>; + def rm : SIi8<0xC2, MRMSrcMem, + (outs RC:$dst), (ins RC:$src1, x86memop:$src, sse_imm_op:$cc), + asm, []>; +} -// Accept explicit immediate argument form instead of comparison code. -let isAsmParserOnly = 1 in { - def CMPSSrr_alt : SSIi8<0xC2, MRMSrcReg, - (outs FR32:$dst), (ins FR32:$src1, FR32:$src, i8imm:$src2), - "cmpss\t{$src2, $src, $dst|$dst, $src, $src2}", []>; - let mayLoad = 1 in - def CMPSSrm_alt : SSIi8<0xC2, MRMSrcMem, - (outs FR32:$dst), (ins FR32:$src1, f32mem:$src, i8imm:$src2), - "cmpss\t{$src2, $src, $dst|$dst, $src, $src2}", []>; - - def CMPSDrr_alt : SDIi8<0xC2, MRMSrcReg, - (outs FR64:$dst), (ins FR64:$src1, FR64:$src, i8imm:$src2), - "cmpsd\t{$src2, $src, $dst|$dst, $src, $src2}", []>; +// FIXME: rename instructions to only use the class above +multiclass sse12_cmp_scalar_alt { + def rr_alt : SIi8<0xC2, MRMSrcReg, + (outs RC:$dst), (ins RC:$src1, RC:$src, sse_imm_op:$src2), + asm, []>; let mayLoad = 1 in - def CMPSDrm_alt : SDIi8<0xC2, MRMSrcMem, - (outs FR64:$dst), (ins FR64:$src1, f64mem:$src, i8imm:$src2), - "cmpsd\t{$src2, $src, $dst|$dst, $src, $src2}", []>; + def rm_alt : SIi8<0xC2, MRMSrcMem, + (outs RC:$dst), (ins RC:$src1, x86memop:$src, sse_imm_op:$src2), + asm, []>; } + +let neverHasSideEffects = 1, isAsmParserOnly = 1 in { + defm VCMPSS : sse12_cmp_scalar, + XS, VEX_4V; + defm VCMPSD : sse12_cmp_scalar, + XD, VEX_4V; + + // Accept explicit immediate argument form instead of comparison code. + let isAsmParserOnly = 1 in { + defm VCMPSS : sse12_cmp_scalar_alt, + XS, VEX_4V; + defm VCMPSD : sse12_cmp_scalar_alt, + XD, VEX_4V; + } +} + +let Constraints = "$src1 = $dst", neverHasSideEffects = 1 in { + defm CMPSS : sse12_cmp_scalar, XS; + defm CMPSD : sse12_cmp_scalar, XD; + + // Accept explicit immediate argument form instead of comparison code. + let isAsmParserOnly = 1 in { + defm CMPSS : sse12_cmp_scalar_alt, XS; + defm CMPSD : sse12_cmp_scalar_alt, XD; + } } let Defs = [EFLAGS] in { Modified: llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s?rev=106705&r1=106704&r2=106705&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_32-encoding.s Wed Jun 23 19:32:06 2010 @@ -10526,3 +10526,131 @@ // CHECK: encoding: [0xc5,0xf9,0x50,0xc2] vmovmskpd %xmm2, %eax +// CHECK: vcmpss $0, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0xd9,0x00] + vcmpeqss %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpss $2, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0xd9,0x02] + vcmpless %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpss $1, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0xd9,0x01] + vcmpltss %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpss $4, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0xd9,0x04] + vcmpneqss %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpss $6, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0xd9,0x06] + vcmpnless %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpss $5, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0xd9,0x05] + vcmpnltss %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpss $7, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0xd9,0x07] + vcmpordss %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpss $3, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0xd9,0x03] + vcmpunordss %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpss $0, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0x5c,0xcb,0xfc,0x00] + vcmpeqss -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpss $2, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0x5c,0xcb,0xfc,0x02] + vcmpless -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpss $1, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0x5c,0xcb,0xfc,0x01] + vcmpltss -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpss $4, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0x5c,0xcb,0xfc,0x04] + vcmpneqss -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpss $6, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0x5c,0xcb,0xfc,0x06] + vcmpnless -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpss $5, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0x5c,0xcb,0xfc,0x05] + vcmpnltss -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpss $7, -4(%ebx,%ecx,8), %xmm6, %xmm2 +// CHECK: encoding: [0xc5,0xca,0xc2,0x54,0xcb,0xfc,0x07] + vcmpordss -4(%ebx,%ecx,8), %xmm6, %xmm2 + +// CHECK: vcmpss $3, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xea,0xc2,0x5c,0xcb,0xfc,0x03] + vcmpunordss -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpsd $0, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0xd9,0x00] + vcmpeqsd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpsd $2, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0xd9,0x02] + vcmplesd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpsd $1, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0xd9,0x01] + vcmpltsd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpsd $4, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0xd9,0x04] + vcmpneqsd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpsd $6, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0xd9,0x06] + vcmpnlesd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpsd $5, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0xd9,0x05] + vcmpnltsd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpsd $7, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0xd9,0x07] + vcmpordsd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpsd $3, %xmm1, %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0xd9,0x03] + vcmpunordsd %xmm1, %xmm2, %xmm3 + +// CHECK: vcmpsd $0, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0x5c,0xcb,0xfc,0x00] + vcmpeqsd -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpsd $2, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0x5c,0xcb,0xfc,0x02] + vcmplesd -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpsd $1, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0x5c,0xcb,0xfc,0x01] + vcmpltsd -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpsd $4, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0x5c,0xcb,0xfc,0x04] + vcmpneqsd -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpsd $6, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0x5c,0xcb,0xfc,0x06] + vcmpnlesd -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpsd $5, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0x5c,0xcb,0xfc,0x05] + vcmpnltsd -4(%ebx,%ecx,8), %xmm2, %xmm3 + +// CHECK: vcmpsd $7, -4(%ebx,%ecx,8), %xmm6, %xmm2 +// CHECK: encoding: [0xc5,0xcb,0xc2,0x54,0xcb,0xfc,0x07] + vcmpordsd -4(%ebx,%ecx,8), %xmm6, %xmm2 + +// CHECK: vcmpsd $3, -4(%ebx,%ecx,8), %xmm2, %xmm3 +// CHECK: encoding: [0xc5,0xeb,0xc2,0x5c,0xcb,0xfc,0x03] + vcmpunordsd -4(%ebx,%ecx,8), %xmm2, %xmm3 + Modified: llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s?rev=106705&r1=106704&r2=106705&view=diff ============================================================================== --- llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s (original) +++ llvm/trunk/test/MC/AsmParser/X86/x86_64-encoding.s Wed Jun 23 19:32:06 2010 @@ -582,3 +582,131 @@ // CHECK: encoding: [0xc5,0x19,0xc2,0x6c,0xcb,0xfc,0x03] vcmpunordpd -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: vcmpss $0, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1a,0xc2,0xeb,0x00] + vcmpeqss %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpss $2, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1a,0xc2,0xeb,0x02] + vcmpless %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpss $1, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1a,0xc2,0xeb,0x01] + vcmpltss %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpss $4, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1a,0xc2,0xeb,0x04] + vcmpneqss %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpss $6, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1a,0xc2,0xeb,0x06] + vcmpnless %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpss $5, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1a,0xc2,0xeb,0x05] + vcmpnltss %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpss $7, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1a,0xc2,0xeb,0x07] + vcmpordss %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpss $3, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1a,0xc2,0xeb,0x03] + vcmpunordss %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpss $0, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1a,0xc2,0x6c,0xcb,0xfc,0x00] + vcmpeqss -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpss $2, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1a,0xc2,0x6c,0xcb,0xfc,0x02] + vcmpless -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpss $1, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1a,0xc2,0x6c,0xcb,0xfc,0x01] + vcmpltss -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpss $4, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1a,0xc2,0x6c,0xcb,0xfc,0x04] + vcmpneqss -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpss $6, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1a,0xc2,0x6c,0xcb,0xfc,0x06] + vcmpnless -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpss $5, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1a,0xc2,0x6c,0xcb,0xfc,0x05] + vcmpnltss -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpss $7, -4(%rbx,%rcx,8), %xmm6, %xmm2 +// CHECK: encoding: [0xc5,0xca,0xc2,0x54,0xcb,0xfc,0x07] + vcmpordss -4(%rbx,%rcx,8), %xmm6, %xmm2 + +// CHECK: vcmpss $3, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1a,0xc2,0x6c,0xcb,0xfc,0x03] + vcmpunordss -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpsd $0, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1b,0xc2,0xeb,0x00] + vcmpeqsd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpsd $2, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1b,0xc2,0xeb,0x02] + vcmplesd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpsd $1, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1b,0xc2,0xeb,0x01] + vcmpltsd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpsd $4, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1b,0xc2,0xeb,0x04] + vcmpneqsd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpsd $6, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1b,0xc2,0xeb,0x06] + vcmpnlesd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpsd $5, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1b,0xc2,0xeb,0x05] + vcmpnltsd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpsd $7, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1b,0xc2,0xeb,0x07] + vcmpordsd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpsd $3, %xmm11, %xmm12, %xmm13 +// CHECK: encoding: [0xc4,0x41,0x1b,0xc2,0xeb,0x03] + vcmpunordsd %xmm11, %xmm12, %xmm13 + +// CHECK: vcmpsd $0, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1b,0xc2,0x6c,0xcb,0xfc,0x00] + vcmpeqsd -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpsd $2, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1b,0xc2,0x6c,0xcb,0xfc,0x02] + vcmplesd -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpsd $1, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1b,0xc2,0x6c,0xcb,0xfc,0x01] + vcmpltsd -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpsd $4, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1b,0xc2,0x6c,0xcb,0xfc,0x04] + vcmpneqsd -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpsd $6, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1b,0xc2,0x6c,0xcb,0xfc,0x06] + vcmpnlesd -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpsd $5, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1b,0xc2,0x6c,0xcb,0xfc,0x05] + vcmpnltsd -4(%rbx,%rcx,8), %xmm12, %xmm13 + +// CHECK: vcmpsd $7, -4(%rbx,%rcx,8), %xmm6, %xmm2 +// CHECK: encoding: [0xc5,0xcb,0xc2,0x54,0xcb,0xfc,0x07] + vcmpordsd -4(%rbx,%rcx,8), %xmm6, %xmm2 + +// CHECK: vcmpsd $3, -4(%rbx,%rcx,8), %xmm12, %xmm13 +// CHECK: encoding: [0xc5,0x1b,0xc2,0x6c,0xcb,0xfc,0x03] + vcmpunordsd -4(%rbx,%rcx,8), %xmm12, %xmm13 + From dpatel at apple.com Wed Jun 23 19:33:28 2010 From: dpatel at apple.com (Devang Patel) Date: Thu, 24 Jun 2010 00:33:28 -0000 Subject: [llvm-commits] [llvm] r106706 - in /llvm/trunk: include/llvm/Transforms/Utils/ lib/Target/PIC16/PIC16Passes/ lib/Transforms/IPO/ lib/Transforms/Scalar/ lib/Transforms/Utils/ tools/bugpoint/ Message-ID: <20100624003328.ADAEF2A6C12C@llvm.org> Author: dpatel Date: Wed Jun 23 19:33:28 2010 New Revision: 106706 URL: http://llvm.org/viewvc/llvm-project?rev=106706&view=rev Log: Use ValueMap instead of DenseMap. The ValueMapper used by various cloning utility maps MDNodes also. Modified: llvm/trunk/include/llvm/Transforms/Utils/Cloning.h llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.cpp llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp llvm/trunk/lib/Transforms/Utils/ValueMapper.h llvm/trunk/tools/bugpoint/BugDriver.h llvm/trunk/tools/bugpoint/CrashDebugger.cpp llvm/trunk/tools/bugpoint/ExtractFunction.cpp llvm/trunk/tools/bugpoint/Miscompilation.cpp Modified: llvm/trunk/include/llvm/Transforms/Utils/Cloning.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Cloning.h?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Utils/Cloning.h (original) +++ llvm/trunk/include/llvm/Transforms/Utils/Cloning.h Wed Jun 23 19:33:28 2010 @@ -18,7 +18,7 @@ #ifndef LLVM_TRANSFORMS_UTILS_CLONING_H #define LLVM_TRANSFORMS_UTILS_CLONING_H -#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/ValueMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/ValueHandle.h" @@ -46,7 +46,7 @@ /// CloneModule - Return an exact copy of the specified module /// Module *CloneModule(const Module *M); -Module *CloneModule(const Module *M, DenseMap &VMap); +Module *CloneModule(const Module *M, ValueMap &VMap); /// ClonedCodeInfo - This struct can be used to capture information about code /// being cloned, while it is being cloned. @@ -102,7 +102,7 @@ /// parameter. /// BasicBlock *CloneBasicBlock(const BasicBlock *BB, - DenseMap &VMap, + ValueMap &VMap, const Twine &NameSuffix = "", Function *F = 0, ClonedCodeInfo *CodeInfo = 0); @@ -110,7 +110,7 @@ /// CloneLoop - Clone Loop. Clone dominator info for loop insiders. Populate /// VMap using old blocks to new blocks mapping. Loop *CloneLoop(Loop *L, LPPassManager *LPM, LoopInfo *LI, - DenseMap &VMap, Pass *P); + ValueMap &VMap, Pass *P); /// CloneFunction - Return a copy of the specified function, but without /// embedding the function into another module. Also, any references specified @@ -122,13 +122,13 @@ /// information about the cloned code if non-null. /// Function *CloneFunction(const Function *F, - DenseMap &VMap, + ValueMap &VMap, ClonedCodeInfo *CodeInfo = 0); /// CloneFunction - Version of the function that doesn't need the VMap. /// inline Function *CloneFunction(const Function *F, ClonedCodeInfo *CodeInfo = 0){ - DenseMap VMap; + ValueMap VMap; return CloneFunction(F, VMap, CodeInfo); } @@ -139,7 +139,7 @@ /// specified suffix to all values cloned. /// void CloneFunctionInto(Function *NewFunc, const Function *OldFunc, - DenseMap &VMap, + ValueMap &VMap, SmallVectorImpl &Returns, const char *NameSuffix = "", ClonedCodeInfo *CodeInfo = 0); @@ -152,7 +152,7 @@ /// dead. Since this doesn't produce an exactly copy of the input, it can't be /// used for things like CloneFunction or CloneModule. void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc, - DenseMap &VMap, + ValueMap &VMap, SmallVectorImpl &Returns, const char *NameSuffix = "", ClonedCodeInfo *CodeInfo = 0, Modified: llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.cpp?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.cpp Wed Jun 23 19:33:28 2010 @@ -150,8 +150,8 @@ // For PIC16, automatic variables of a function are emitted as globals. -// Clone the auto variables of a function and put them in ValueMap, -// this ValueMap will be used while +// Clone the auto variables of a function and put them in VMap, +// this VMap will be used while // Cloning the code of function itself. // void PIC16Cloner::CloneAutos(Function *F) { @@ -160,11 +160,11 @@ Module *M = F->getParent(); Module::GlobalListType &Globals = M->getGlobalList(); - // Clear the leftovers in ValueMap by any previous cloning. - ValueMap.clear(); + // Clear the leftovers in VMap by any previous cloning. + VMap.clear(); // Find the auto globls for this function and clone them, and put them - // in ValueMap. + // in VMap. std::string FnName = F->getName().str(); std::string VarName, ClonedVarName; for (Module::global_iterator I = M->global_begin(), E = M->global_end(); @@ -182,8 +182,8 @@ // Add these new globals to module's globals list. Globals.push_back(ClonedGV); - // Update ValueMap. - ValueMap[GV] = ClonedGV; + // Update VMap. + VMap[GV] = ClonedGV; } } } @@ -236,10 +236,10 @@ } // Clone the given function and return it. -// Note: it uses the ValueMap member of the class, which is already populated +// Note: it uses the VMap member of the class, which is already populated // by cloneAutos by the time we reach here. -// FIXME: Should we just pass ValueMap's ref as a parameter here? rather -// than keeping the ValueMap as a member. +// FIXME: Should we just pass VMap's ref as a parameter here? rather +// than keeping the VMap as a member. Function * PIC16Cloner::cloneFunction(Function *OrgF) { Function *ClonedF; @@ -252,11 +252,11 @@ } // Clone does not exist. - // First clone the autos, and populate ValueMap. + // First clone the autos, and populate VMap. CloneAutos(OrgF); // Now create the clone. - ClonedF = CloneFunction(OrgF, ValueMap); + ClonedF = CloneFunction(OrgF, VMap); // The new function should be for interrupt line. Therefore should have // the name suffixed with IL and section attribute marked with IL. Modified: llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16Passes/PIC16Cloner.h Wed Jun 23 19:33:28 2010 @@ -15,7 +15,7 @@ #ifndef PIC16CLONER_H #define PIC16CLONER_H -#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/ValueMap.h" using namespace llvm; using std::vector; @@ -72,7 +72,7 @@ // the corresponding cloned auto variable of the cloned function. // This value map is passed during the function cloning so that all the // uses of auto variables be updated properly. - DenseMap ValueMap; + ValueMap VMap; // Map of a already cloned functions. map ClonedFunctionMap; Modified: llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PartialInlining.cpp Wed Jun 23 19:33:28 2010 @@ -66,13 +66,13 @@ return 0; // Clone the function, so that we can hack away on it. - DenseMap ValueMap; - Function* duplicateFunction = CloneFunction(F, ValueMap); + ValueMap VMap; + Function* duplicateFunction = CloneFunction(F, VMap); duplicateFunction->setLinkage(GlobalValue::InternalLinkage); F->getParent()->getFunctionList().push_back(duplicateFunction); - BasicBlock* newEntryBlock = cast(ValueMap[entryBlock]); - BasicBlock* newReturnBlock = cast(ValueMap[returnBlock]); - BasicBlock* newNonReturnBlock = cast(ValueMap[nonReturnBlock]); + BasicBlock* newEntryBlock = cast(VMap[entryBlock]); + BasicBlock* newReturnBlock = cast(VMap[returnBlock]); + BasicBlock* newNonReturnBlock = cast(VMap[nonReturnBlock]); // Go ahead and update all uses to the duplicate, so that we can just // use the inliner functionality when we're done hacking. Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Wed Jun 23 19:33:28 2010 @@ -64,10 +64,10 @@ // a call to the specialized function. Returns the specialized function static Function* SpecializeFunction(Function* F, - DenseMap& replacements) { + ValueMap& replacements) { // arg numbers of deleted arguments DenseMap deleted; - for (DenseMap::iterator + for (ValueMap::iterator repb = replacements.begin(), repe = replacements.end(); repb != repe; ++repb) { Argument const *arg = cast(repb->first); @@ -150,7 +150,7 @@ ee = distribution.end(); ii != ee; ++ii) if (total > ii->second && ii->first && ii->second > total * ConstValPercent) { - DenseMap m; + ValueMap m; Function::arg_iterator arg = F.arg_begin(); for (int y = 0; y < interestingArgs[x]; ++y) ++arg; Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Wed Jun 23 19:33:28 2010 @@ -1016,13 +1016,13 @@ BSV = getMax(BSV, IVStartValue, Sign, PHTerm); // [*] Clone Loop - DenseMap ValueMap; - Loop *BLoop = CloneLoop(L, LPM, LI, ValueMap, this); + ValueMap VMap; + Loop *BLoop = CloneLoop(L, LPM, LI, VMap, this); Loop *ALoop = L; // [*] ALoop's exiting edge enters BLoop's header. // ALoop's original exit block becomes BLoop's exit block. - PHINode *B_IndVar = cast(ValueMap[IndVar]); + PHINode *B_IndVar = cast(VMap[IndVar]); BasicBlock *A_ExitingBlock = ExitCondition->getParent(); BranchInst *A_ExitInsn = dyn_cast(A_ExitingBlock->getTerminator()); @@ -1047,7 +1047,7 @@ for (BasicBlock::iterator BI = ALoop->getHeader()->begin(), BE = ALoop->getHeader()->end(); BI != BE; ++BI) { if (PHINode *PN = dyn_cast(BI)) { - PHINode *PNClone = cast(ValueMap[PN]); + PHINode *PNClone = cast(VMap[PN]); InverseMap[PNClone] = PN; } else break; @@ -1085,11 +1085,11 @@ // block. Remove incoming PHINode values from ALoop's exiting block. // Add new incoming values from BLoop's incoming exiting value. // Update BLoop exit block's dominator info.. - BasicBlock *B_ExitingBlock = cast(ValueMap[A_ExitingBlock]); + BasicBlock *B_ExitingBlock = cast(VMap[A_ExitingBlock]); for (BasicBlock::iterator BI = B_ExitBlock->begin(), BE = B_ExitBlock->end(); BI != BE; ++BI) { if (PHINode *PN = dyn_cast(BI)) { - PN->addIncoming(ValueMap[PN->getIncomingValueForBlock(A_ExitingBlock)], + PN->addIncoming(VMap[PN->getIncomingValueForBlock(A_ExitingBlock)], B_ExitingBlock); PN->removeIncomingValue(A_ExitingBlock); } else @@ -1131,7 +1131,7 @@ removeBlocks(A_InactiveBranch, L, A_ActiveBranch); //[*] Eliminate split condition's inactive branch in from BLoop. - BasicBlock *B_SplitCondBlock = cast(ValueMap[A_SplitCondBlock]); + BasicBlock *B_SplitCondBlock = cast(VMap[A_SplitCondBlock]); BranchInst *B_BR = cast(B_SplitCondBlock->getTerminator()); BasicBlock *B_InactiveBranch = NULL; BasicBlock *B_ActiveBranch = NULL; @@ -1146,9 +1146,9 @@ //[*] Move exit condition into split condition block to avoid // executing dead loop iteration. - ICmpInst *B_ExitCondition = cast(ValueMap[ExitCondition]); - Instruction *B_IndVarIncrement = cast(ValueMap[IVIncrement]); - ICmpInst *B_SplitCondition = cast(ValueMap[SplitCondition]); + ICmpInst *B_ExitCondition = cast(VMap[ExitCondition]); + Instruction *B_IndVarIncrement = cast(VMap[IVIncrement]); + ICmpInst *B_SplitCondition = cast(VMap[SplitCondition]); moveExitCondition(A_SplitCondBlock, A_ActiveBranch, A_ExitBlock, ExitCondition, cast(SplitCondition), IndVar, IVIncrement, Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Wed Jun 23 19:33:28 2010 @@ -457,21 +457,21 @@ } // RemapInstruction - Convert the instruction operands from referencing the -// current values into those specified by ValueMap. +// current values into those specified by VMap. // static inline void RemapInstruction(Instruction *I, - DenseMap &ValueMap) { + ValueMap &VMap) { for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) { Value *Op = I->getOperand(op); - DenseMap::iterator It = ValueMap.find(Op); - if (It != ValueMap.end()) Op = It->second; + ValueMap::iterator It = VMap.find(Op); + if (It != VMap.end()) Op = It->second; I->setOperand(op, Op); } } /// CloneLoop - Recursively clone the specified loop and all of its children, /// mapping the blocks with the specified map. -static Loop *CloneLoop(Loop *L, Loop *PL, DenseMap &VM, +static Loop *CloneLoop(Loop *L, Loop *PL, ValueMap &VM, LoopInfo *LI, LPPassManager *LPM) { Loop *New = new Loop(); LPM->insertLoop(New, PL); @@ -615,11 +615,11 @@ // the loop preheader and exit blocks), keeping track of the mapping between // the instructions and blocks. NewBlocks.reserve(LoopBlocks.size()); - DenseMap ValueMap; + ValueMap VMap; for (unsigned i = 0, e = LoopBlocks.size(); i != e; ++i) { - BasicBlock *NewBB = CloneBasicBlock(LoopBlocks[i], ValueMap, ".us", F); + BasicBlock *NewBB = CloneBasicBlock(LoopBlocks[i], VMap, ".us", F); NewBlocks.push_back(NewBB); - ValueMap[LoopBlocks[i]] = NewBB; // Keep the BB mapping. + VMap[LoopBlocks[i]] = NewBB; // Keep the BB mapping. LPM->cloneBasicBlockSimpleAnalysis(LoopBlocks[i], NewBB, L); } @@ -629,7 +629,7 @@ NewBlocks[0], F->end()); // Now we create the new Loop object for the versioned loop. - Loop *NewLoop = CloneLoop(L, L->getParentLoop(), ValueMap, LI, LPM); + Loop *NewLoop = CloneLoop(L, L->getParentLoop(), VMap, LI, LPM); Loop *ParentLoop = L->getParentLoop(); if (ParentLoop) { // Make sure to add the cloned preheader and exit blocks to the parent loop @@ -638,7 +638,7 @@ } for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i) { - BasicBlock *NewExit = cast(ValueMap[ExitBlocks[i]]); + BasicBlock *NewExit = cast(VMap[ExitBlocks[i]]); // The new exit block should be in the same loop as the old one. if (Loop *ExitBBLoop = LI->getLoopFor(ExitBlocks[i])) ExitBBLoop->addBasicBlockToLoop(NewExit, LI->getBase()); @@ -653,8 +653,8 @@ for (BasicBlock::iterator I = ExitSucc->begin(); isa(I); ++I) { PN = cast(I); Value *V = PN->getIncomingValueForBlock(ExitBlocks[i]); - DenseMap::iterator It = ValueMap.find(V); - if (It != ValueMap.end()) V = It->second; + ValueMap::iterator It = VMap.find(V); + if (It != VMap.end()) V = It->second; PN->addIncoming(V, NewExit); } } @@ -663,7 +663,7 @@ for (unsigned i = 0, e = NewBlocks.size(); i != e; ++i) for (BasicBlock::iterator I = NewBlocks[i]->begin(), E = NewBlocks[i]->end(); I != E; ++I) - RemapInstruction(I, ValueMap); + RemapInstruction(I, VMap); // Rewrite the original preheader to select between versions of the loop. BranchInst *OldBR = cast(loopPreheader->getTerminator()); Modified: llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneLoop.cpp Wed Jun 23 19:33:28 2010 @@ -15,7 +15,6 @@ #include "llvm/BasicBlock.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/Analysis/Dominators.h" -#include "llvm/ADT/DenseMap.h" using namespace llvm; @@ -23,12 +22,12 @@ /// CloneDominatorInfo - Clone basicblock's dominator tree and, if available, /// dominance info. It is expected that basic block is already cloned. static void CloneDominatorInfo(BasicBlock *BB, - DenseMap &VMap, + ValueMap &VMap, DominatorTree *DT, DominanceFrontier *DF) { assert (DT && "DominatorTree is not available"); - DenseMap::iterator BI = VMap.find(BB); + ValueMap::iterator BI = VMap.find(BB); assert (BI != VMap.end() && "BasicBlock clone is missing"); BasicBlock *NewBB = cast(BI->second); @@ -43,7 +42,7 @@ // NewBB's dominator is either BB's dominator or BB's dominator's clone. BasicBlock *NewBBDom = BBDom; - DenseMap::iterator BBDomI = VMap.find(BBDom); + ValueMap::iterator BBDomI = VMap.find(BBDom); if (BBDomI != VMap.end()) { NewBBDom = cast(BBDomI->second); if (!DT->getNode(NewBBDom)) @@ -60,7 +59,7 @@ for (DominanceFrontier::DomSetType::iterator I = S.begin(), E = S.end(); I != E; ++I) { BasicBlock *DB = *I; - DenseMap::iterator IDM = VMap.find(DB); + ValueMap::iterator IDM = VMap.find(DB); if (IDM != VMap.end()) NewDFSet.insert(cast(IDM->second)); else @@ -74,7 +73,7 @@ /// CloneLoop - Clone Loop. Clone dominator info. Populate VMap /// using old blocks to new blocks mapping. Loop *llvm::CloneLoop(Loop *OrigL, LPPassManager *LPM, LoopInfo *LI, - DenseMap &VMap, Pass *P) { + ValueMap &VMap, Pass *P) { DominatorTree *DT = NULL; DominanceFrontier *DF = NULL; @@ -135,7 +134,7 @@ for (unsigned index = 0, num_ops = Insn->getNumOperands(); index != num_ops; ++index) { Value *Op = Insn->getOperand(index); - DenseMap::iterator OpItr = VMap.find(Op); + ValueMap::iterator OpItr = VMap.find(Op); if (OpItr != VMap.end()) Insn->setOperand(index, OpItr->second); } Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Wed Jun 23 19:33:28 2010 @@ -169,7 +169,7 @@ /// some edges of the callgraph may remain. static void UpdateCallGraphAfterInlining(CallSite CS, Function::iterator FirstNewBlock, - DenseMap &VMap, + ValueMap &VMap, InlineFunctionInfo &IFI) { CallGraph &CG = *IFI.CG; const Function *Caller = CS.getInstruction()->getParent()->getParent(); @@ -192,7 +192,7 @@ for (; I != E; ++I) { const Value *OrigCall = I->first; - DenseMap::iterator VMI = VMap.find(OrigCall); + ValueMap::iterator VMI = VMap.find(OrigCall); // Only copy the edge if the call was inlined! if (VMI == VMap.end() || VMI->second == 0) continue; @@ -286,7 +286,7 @@ Function::iterator FirstNewBlock; { // Scope to destroy VMap after cloning. - DenseMap VMap; + ValueMap VMap; assert(CalledFunc->arg_size() == CS.arg_size() && "No varargs calls can be inlined!"); Modified: llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp Wed Jun 23 19:33:28 2010 @@ -39,10 +39,10 @@ /// RemapInstruction - Convert the instruction operands from referencing the /// current values into those specified by VMap. static inline void RemapInstruction(Instruction *I, - DenseMap &VMap) { + ValueMap &VMap) { for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) { Value *Op = I->getOperand(op); - DenseMap::iterator It = VMap.find(Op); + ValueMap::iterator It = VMap.find(Op); if (It != VMap.end()) I->setOperand(op, It->second); } @@ -183,7 +183,7 @@ // For the first iteration of the loop, we should use the precloned values for // PHI nodes. Insert associations now. - typedef DenseMap ValueToValueMapTy; + typedef ValueMap ValueToValueMapTy; ValueToValueMapTy LastValueMap; std::vector OrigPHINode; for (BasicBlock::iterator I = Header->begin(); isa(I); ++I) { Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.h?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/ValueMapper.h (original) +++ llvm/trunk/lib/Transforms/Utils/ValueMapper.h Wed Jun 23 19:33:28 2010 @@ -15,12 +15,12 @@ #ifndef VALUEMAPPER_H #define VALUEMAPPER_H -#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/ValueMap.h" namespace llvm { class Value; class Instruction; - typedef DenseMap ValueToValueMapTy; + typedef ValueMap ValueToValueMapTy; Value *MapValue(const Value *V, ValueToValueMapTy &VM); void RemapInstruction(Instruction *I, ValueToValueMapTy &VM); Modified: llvm/trunk/tools/bugpoint/BugDriver.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.h?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/BugDriver.h (original) +++ llvm/trunk/tools/bugpoint/BugDriver.h Wed Jun 23 19:33:28 2010 @@ -16,7 +16,7 @@ #ifndef BUGDRIVER_H #define BUGDRIVER_H -#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/ValueMap.h" #include #include @@ -325,7 +325,7 @@ /// module, split the functions OUT of the specified module, and place them in /// the new module. Module *SplitFunctionsOutOfModule(Module *M, const std::vector &F, - DenseMap &ValueMap); + ValueMap &VMap); } // End llvm namespace Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CrashDebugger.cpp?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original) +++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Wed Jun 23 19:33:28 2010 @@ -130,14 +130,14 @@ ReduceCrashingGlobalVariables::TestGlobalVariables( std::vector &GVs) { // Clone the program to try hacking it apart... - DenseMap ValueMap; - Module *M = CloneModule(BD.getProgram(), ValueMap); + ValueMap VMap; + Module *M = CloneModule(BD.getProgram(), VMap); // Convert list to set for fast lookup... std::set GVSet; for (unsigned i = 0, e = GVs.size(); i != e; ++i) { - GlobalVariable* CMGV = cast(ValueMap[GVs[i]]); + GlobalVariable* CMGV = cast(VMap[GVs[i]]); assert(CMGV && "Global Variable not in module?!"); GVSet.insert(CMGV); } @@ -204,13 +204,13 @@ return false; // Clone the program to try hacking it apart... - DenseMap ValueMap; - Module *M = CloneModule(BD.getProgram(), ValueMap); + ValueMap VMap; + Module *M = CloneModule(BD.getProgram(), VMap); // Convert list to set for fast lookup... std::set Functions; for (unsigned i = 0, e = Funcs.size(); i != e; ++i) { - Function *CMF = cast(ValueMap[Funcs[i]]); + Function *CMF = cast(VMap[Funcs[i]]); assert(CMF && "Function not in module?!"); assert(CMF->getFunctionType() == Funcs[i]->getFunctionType() && "wrong ty"); assert(CMF->getName() == Funcs[i]->getName() && "wrong name"); @@ -270,13 +270,13 @@ bool ReduceCrashingBlocks::TestBlocks(std::vector &BBs) { // Clone the program to try hacking it apart... - DenseMap ValueMap; - Module *M = CloneModule(BD.getProgram(), ValueMap); + ValueMap VMap; + Module *M = CloneModule(BD.getProgram(), VMap); // Convert list to set for fast lookup... SmallPtrSet Blocks; for (unsigned i = 0, e = BBs.size(); i != e; ++i) - Blocks.insert(cast(ValueMap[BBs[i]])); + Blocks.insert(cast(VMap[BBs[i]])); outs() << "Checking for crash with only these blocks:"; unsigned NumPrint = Blocks.size(); @@ -371,14 +371,14 @@ bool ReduceCrashingInstructions::TestInsts(std::vector &Insts) { // Clone the program to try hacking it apart... - DenseMap ValueMap; - Module *M = CloneModule(BD.getProgram(), ValueMap); + ValueMap VMap; + Module *M = CloneModule(BD.getProgram(), VMap); // Convert list to set for fast lookup... SmallPtrSet Instructions; for (unsigned i = 0, e = Insts.size(); i != e; ++i) { assert(!isa(Insts[i])); - Instructions.insert(cast(ValueMap[Insts[i]])); + Instructions.insert(cast(VMap[Insts[i]])); } outs() << "Checking for crash with only " << Instructions.size(); Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original) +++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Wed Jun 23 19:33:28 2010 @@ -201,7 +201,7 @@ /// static ctors/dtors, we need to add an llvm.global_[cd]tors global to M2, and /// prune appropriate entries out of M1s list. static void SplitStaticCtorDtor(const char *GlobalName, Module *M1, Module *M2, - DenseMap ValueMap) { + ValueMap VMap) { GlobalVariable *GV = M1->getNamedGlobal(GlobalName); if (!GV || GV->isDeclaration() || GV->hasLocalLinkage() || !GV->use_empty()) return; @@ -229,7 +229,7 @@ M1Tors.push_back(std::make_pair(F, Priority)); else { // Map to M2's version of the function. - F = cast(ValueMap[F]); + F = cast(VMap[F]); M2Tors.push_back(std::make_pair(F, Priority)); } } @@ -264,7 +264,7 @@ Module * llvm::SplitFunctionsOutOfModule(Module *M, const std::vector &F, - DenseMap &ValueMap) { + ValueMap &VMap) { // Make sure functions & globals are all external so that linkage // between the two modules will work. for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) @@ -276,8 +276,8 @@ I->setLinkage(GlobalValue::ExternalLinkage); } - DenseMap NewValueMap; - Module *New = CloneModule(M, NewValueMap); + ValueMap NewVMap; + Module *New = CloneModule(M, NewVMap); // Make sure global initializers exist only in the safe module (CBE->.so) for (Module::global_iterator I = New->global_begin(), E = New->global_end(); @@ -287,11 +287,11 @@ // Remove the Test functions from the Safe module std::set TestFunctions; for (unsigned i = 0, e = F.size(); i != e; ++i) { - Function *TNOF = cast(ValueMap[F[i]]); + Function *TNOF = cast(VMap[F[i]]); DEBUG(errs() << "Removing function "); DEBUG(WriteAsOperand(errs(), TNOF, false)); DEBUG(errs() << "\n"); - TestFunctions.insert(cast(NewValueMap[TNOF])); + TestFunctions.insert(cast(NewVMap[TNOF])); DeleteFunctionBody(TNOF); // Function is now external in this module! } @@ -304,8 +304,8 @@ // Make sure that there is a global ctor/dtor array in both halves of the // module if they both have static ctor/dtor functions. - SplitStaticCtorDtor("llvm.global_ctors", M, New, NewValueMap); - SplitStaticCtorDtor("llvm.global_dtors", M, New, NewValueMap); + SplitStaticCtorDtor("llvm.global_ctors", M, New, NewVMap); + SplitStaticCtorDtor("llvm.global_dtors", M, New, NewVMap); return New; } Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=106706&r1=106705&r2=106706&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original) +++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Wed Jun 23 19:33:28 2010 @@ -251,10 +251,10 @@ outs() << '\n'; // Split the module into the two halves of the program we want. - DenseMap ValueMap; - Module *ToNotOptimize = CloneModule(BD.getProgram(), ValueMap); + ValueMap VMap; + Module *ToNotOptimize = CloneModule(BD.getProgram(), VMap); Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize, Funcs, - ValueMap); + VMap); // Run the predicate, note that the predicate will delete both input modules. return TestFn(BD, ToOptimize, ToNotOptimize, Error); @@ -285,11 +285,11 @@ while (1) { if (BugpointIsInterrupted) return MadeChange; - DenseMap ValueMap; - Module *ToNotOptimize = CloneModule(BD.getProgram(), ValueMap); + ValueMap VMap; + Module *ToNotOptimize = CloneModule(BD.getProgram(), VMap); Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize, MiscompiledFunctions, - ValueMap); + VMap); Module *ToOptimizeLoopExtracted = BD.ExtractLoop(ToOptimize); if (!ToOptimizeLoopExtracted) { // If the loop extractor crashed or if there were no extractible loops, @@ -448,11 +448,11 @@ outs() << '\n'; // Split the module into the two halves of the program we want. - DenseMap ValueMap; - Module *ToNotOptimize = CloneModule(BD.getProgram(), ValueMap); + ValueMap VMap; + Module *ToNotOptimize = CloneModule(BD.getProgram(), VMap); Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize, FunctionsBeingTested, - ValueMap); + VMap); // Try the extraction. If it doesn't work, then the block extractor crashed // or something, in which case bugpoint can't chase down this possibility. @@ -505,11 +505,11 @@ return false; } - DenseMap ValueMap; - Module *ProgClone = CloneModule(BD.getProgram(), ValueMap); + ValueMap VMap; + Module *ProgClone = CloneModule(BD.getProgram(), VMap); Module *ToExtract = SplitFunctionsOutOfModule(ProgClone, MiscompiledFunctions, - ValueMap); + VMap); Module *Extracted = BD.ExtractMappedBlocksFromModule(Blocks, ToExtract); if (Extracted == 0) { // Weird, extraction should have worked. @@ -687,11 +687,11 @@ // Output a bunch of bitcode files for the user... outs() << "Outputting reduced bitcode files which expose the problem:\n"; - DenseMap ValueMap; - Module *ToNotOptimize = CloneModule(getProgram(), ValueMap); + ValueMap VMap; + Module *ToNotOptimize = CloneModule(getProgram(), VMap); Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize, MiscompiledFunctions, - ValueMap); + VMap); outs() << " Non-optimized portion: "; ToNotOptimize = swapProgramIn(ToNotOptimize); @@ -960,9 +960,9 @@ return true; // Split the module into the two halves of the program we want. - DenseMap ValueMap; - Module *ToNotCodeGen = CloneModule(getProgram(), ValueMap); - Module *ToCodeGen = SplitFunctionsOutOfModule(ToNotCodeGen, Funcs, ValueMap); + ValueMap VMap; + Module *ToNotCodeGen = CloneModule(getProgram(), VMap); + Module *ToCodeGen = SplitFunctionsOutOfModule(ToNotCodeGen, Funcs, VMap); // Condition the modules CleanupAndPrepareModules(*this, ToCodeGen, ToNotCodeGen); From ggreif at gmail.com Wed Jun 23 19:44:01 2010 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 24 Jun 2010 00:44:01 -0000 Subject: [llvm-commits] [llvm] r106707 - in /llvm/trunk/lib/Transforms: InstCombine/InstCombineShifts.cpp Scalar/CodeGenPrepare.cpp Scalar/TailRecursionElimination.cpp Message-ID: <20100624004401.E06052A6C12C@llvm.org> Author: ggreif Date: Wed Jun 23 19:44:01 2010 New Revision: 106707 URL: http://llvm.org/viewvc/llvm-project?rev=106707&view=rev Log: use ArgOperand API Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp?rev=106707&r1=106706&r2=106707&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp (original) +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineShifts.cpp Wed Jun 23 19:44:01 2010 @@ -404,7 +404,7 @@ isPowerOf2_32(BitWidth) && Log2_32(BitWidth) == Op1C->getZExtValue()){ bool isCtPop = II->getIntrinsicID() == Intrinsic::ctpop; Constant *RHS = ConstantInt::getSigned(Op0->getType(), isCtPop ? -1:0); - Value *Cmp = Builder->CreateICmpEQ(II->getOperand(1), RHS); + Value *Cmp = Builder->CreateICmpEQ(II->getArgOperand(0), RHS); return new ZExtInst(Cmp, II->getType()); } } Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=106707&r1=106706&r2=106707&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Wed Jun 23 19:44:01 2010 @@ -559,7 +559,7 @@ // Lower all uses of llvm.objectsize.* IntrinsicInst *II = dyn_cast(CI); if (II && II->getIntrinsicID() == Intrinsic::objectsize) { - bool Min = (cast(II->getOperand(2))->getZExtValue() == 1); + bool Min = (cast(II->getArgOperand(1))->getZExtValue() == 1); const Type *ReturnTy = CI->getType(); Constant *RetVal = ConstantInt::get(ReturnTy, Min ? 0 : -1ULL); CI->replaceAllUsesWith(RetVal); Modified: llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp?rev=106707&r1=106706&r2=106707&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp Wed Jun 23 19:44:01 2010 @@ -253,7 +253,7 @@ // If we are passing this argument into call as the corresponding // argument operand, then the argument is dynamically constant. // Otherwise, we cannot transform this function safely. - if (CI->getOperand(ArgNo+1) == Arg) + if (CI->getArgOperand(ArgNo) == Arg) return true; } @@ -455,7 +455,7 @@ // required PHI nodes, add entries into the PHI node for the actual // parameters passed into the tail-recursive call. for (unsigned i = 0, e = CI->getNumOperands()-1; i != e; ++i) - ArgumentPHIs[i]->addIncoming(CI->getOperand(i+1), BB); + ArgumentPHIs[i]->addIncoming(CI->getArgOperand(i), BB); // If we are introducing an accumulator variable to eliminate the recursion, // do so now. Note that we _know_ that no subsequent tail recursion From ggreif at gmail.com Wed Jun 23 19:48:48 2010 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 24 Jun 2010 00:48:48 -0000 Subject: [llvm-commits] [llvm] r106709 - /llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp Message-ID: <20100624004849.019FF2A6C12C@llvm.org> Author: ggreif Date: Wed Jun 23 19:48:48 2010 New Revision: 106709 URL: http://llvm.org/viewvc/llvm-project?rev=106709&view=rev Log: use getNumArgOperands Modified: llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp Modified: llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp?rev=106709&r1=106708&r2=106709&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailRecursionElimination.cpp Wed Jun 23 19:48:48 2010 @@ -454,7 +454,7 @@ // Ok, now that we know we have a pseudo-entry block WITH all of the // required PHI nodes, add entries into the PHI node for the actual // parameters passed into the tail-recursive call. - for (unsigned i = 0, e = CI->getNumOperands()-1; i != e; ++i) + for (unsigned i = 0, e = CI->getNumArgOperands(); i != e; ++i) ArgumentPHIs[i]->addIncoming(CI->getArgOperand(i), BB); // If we are introducing an accumulator variable to eliminate the recursion, From stoklund at 2pi.dk Wed Jun 23 19:52:22 2010 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Thu, 24 Jun 2010 00:52:22 -0000 Subject: [llvm-commits] [llvm] r106710 - in /llvm/trunk: include/llvm/CodeGen/LiveIntervalAnalysis.h include/llvm/CodeGen/RegisterCoalescer.h lib/CodeGen/LiveIntervalAnalysis.cpp lib/CodeGen/RegisterCoalescer.cpp lib/CodeGen/SimpleRegisterCoalescing.cpp lib/CodeGen/SimpleRegisterCoalescing.h test/CodeGen/ARM/vget_lane.ll Message-ID: <20100624005222.E7F642A6C12C@llvm.org> Author: stoklund Date: Wed Jun 23 19:52:22 2010 New Revision: 106710 URL: http://llvm.org/viewvc/llvm-project?rev=106710&view=rev Log: Revert "Replace a big gob of old coalescer logic with the new CoalescerPair class." Whiny buildbots. Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h llvm/trunk/test/CodeGen/ARM/vget_lane.ll Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=106710&r1=106709&r2=106710&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Wed Jun 23 19:52:22 2010 @@ -133,9 +133,10 @@ bool conflictsWithPhysReg(const LiveInterval &li, VirtRegMap &vrm, unsigned reg); - /// conflictsWithAliasRef - Similar to conflictsWithPhysRegRef except - /// it checks for alias uses and defs. - bool conflictsWithAliasRef(LiveInterval &li, unsigned Reg, + /// conflictsWithSubPhysRegRef - Similar to conflictsWithPhysRegRef except + /// it checks for sub-register reference and it can check use as well. + bool conflictsWithSubPhysRegRef(LiveInterval &li, unsigned Reg, + bool CheckUse, SmallPtrSet &JoinedCopies); // Interval creation Modified: llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h?rev=106710&r1=106709&r2=106710&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h (original) +++ llvm/trunk/include/llvm/CodeGen/RegisterCoalescer.h Wed Jun 23 19:52:22 2010 @@ -165,15 +165,9 @@ /// virtual register. unsigned subIdx_; - /// origDstReg_ - dstReg_ without subreg adjustments. - unsigned origDstReg_; - /// partial_ - True when the original copy was a partial subregister copy. bool partial_; - /// crossClass_ - True when both regs are virtual, and newRC is constrained. - bool crossClass_; - /// flipped_ - True when DstReg and SrcReg are reversed from the oriignal copy /// instruction. bool flipped_; @@ -192,8 +186,7 @@ public: CoalescerPair(const TargetInstrInfo &tii, const TargetRegisterInfo &tri) : tii_(tii), tri_(tri), dstReg_(0), srcReg_(0), subIdx_(0), - origDstReg_(0), partial_(false), crossClass_(false), flipped_(false), - newRC_(0) {} + partial_(false), flipped_(false), newRC_(0) {} /// setRegisters - set registers to match the copy instruction MI. Return /// false if MI is not a coalescable copy instruction. @@ -214,9 +207,6 @@ /// full register, but was a subreg operation. bool isPartial() const { return partial_; } - /// isCrossClass - Return true if DstReg is virtual and NewRC is a smaller register class than DstReg's. - bool isCrossClass() const { return crossClass_; } - /// isFlipped - Return true when getSrcReg is the register being defined by /// the original copy instruction. bool isFlipped() const { return flipped_; } @@ -232,10 +222,6 @@ /// coalesced into, or 0. unsigned getSubIdx() const { return subIdx_; } - /// getOrigDstReg - Return DstReg as it appeared in the original copy - /// instruction before any subreg adjustments. - unsigned getOrigDstReg() const { return isPhys() ? origDstReg_ : dstReg_; } - /// getNewRC - Return the register class of the coalesced register. const TargetRegisterClass *getNewRC() const { return newRC_; } }; Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=106710&r1=106709&r2=106710&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Jun 23 19:52:22 2010 @@ -218,7 +218,10 @@ return false; } -bool LiveIntervals::conflictsWithAliasRef(LiveInterval &li, unsigned Reg, +/// conflictsWithSubPhysRegRef - Similar to conflictsWithPhysRegRef except +/// it checks for sub-register reference and it can check use as well. +bool LiveIntervals::conflictsWithSubPhysRegRef(LiveInterval &li, + unsigned Reg, bool CheckUse, SmallPtrSet &JoinedCopies) { for (LiveInterval::Ranges::const_iterator I = li.ranges.begin(), E = li.ranges.end(); I != E; ++I) { @@ -236,11 +239,12 @@ MachineOperand& MO = MI->getOperand(i); if (!MO.isReg()) continue; + if (MO.isUse() && !CheckUse) + continue; unsigned PhysReg = MO.getReg(); - if (PhysReg == 0 || PhysReg == Reg || - TargetRegisterInfo::isVirtualRegister(PhysReg)) + if (PhysReg == 0 || TargetRegisterInfo::isVirtualRegister(PhysReg)) continue; - if (tri_->regsOverlap(Reg, PhysReg)) + if (tri_->isSubRegister(Reg, PhysReg)) return true; } } @@ -1280,7 +1284,6 @@ continue; SlotIndex KillIdx = VNI->kills[j]; - assert(getInstructionFromIndex(KillIdx) && "Dangling kill"); if (KillIdx > Idx && KillIdx <= End) return true; } Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=106710&r1=106709&r2=106710&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original) +++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Wed Jun 23 19:52:22 2010 @@ -63,7 +63,7 @@ bool CoalescerPair::setRegisters(const MachineInstr *MI) { srcReg_ = dstReg_ = subIdx_ = 0; newRC_ = 0; - flipped_ = crossClass_ = false; + flipped_ = false; unsigned Src, Dst, SrcSub, DstSub; if (!isMoveInstr(MI, Src, Dst, SrcSub, DstSub)) @@ -78,7 +78,6 @@ std::swap(SrcSub, DstSub); flipped_ = true; } - origDstReg_ = Dst; const MachineRegisterInfo &MRI = MI->getParent()->getParent()->getRegInfo(); @@ -101,19 +100,11 @@ } else { // Both registers are virtual. - // Both registers have subreg indices. - if (SrcSub && DstSub) { - // For now we only handle the case of identical indices in commensurate - // registers: Dreg:ssub_1 + Dreg:ssub_1 -> Dreg - // FIXME: Handle Qreg:ssub_3 + Dreg:ssub_1 as QReg:dsub_1 + Dreg. - if (SrcSub != DstSub) - return false; - const TargetRegisterClass *SrcRC = MRI.getRegClass(Src); - const TargetRegisterClass *DstRC = MRI.getRegClass(Dst); - if (!getCommonSubClass(DstRC, SrcRC)) - return false; + // Identical sub to sub. + if (SrcSub == DstSub) SrcSub = DstSub = 0; - } + else if (SrcSub && DstSub) + return false; // FIXME: Qreg:ssub_3 + Dreg:ssub_1 => QReg:dsub_1 + Dreg. // There can be no SrcSub. if (SrcSub) { @@ -133,7 +124,6 @@ newRC_ = getCommonSubClass(DstRC, SrcRC); if (!newRC_) return false; - crossClass_ = newRC_ != DstRC || newRC_ != SrcRC; } // Check our invariants assert(TargetRegisterInfo::isVirtualRegister(Src) && "Src must be virtual"); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=106710&r1=106709&r2=106710&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Wed Jun 23 19:52:22 2010 @@ -783,11 +783,14 @@ /// being updated is not zero, make sure to set it to the correct physical /// subregister. void -SimpleRegisterCoalescing::UpdateRegDefsUses(const CoalescerPair &CP) { - bool DstIsPhys = CP.isPhys(); - unsigned SrcReg = CP.getSrcReg(); - unsigned DstReg = CP.getDstReg(); - unsigned SubIdx = CP.getSubIdx(); +SimpleRegisterCoalescing::UpdateRegDefsUses(unsigned SrcReg, unsigned DstReg, + unsigned SubIdx) { + bool DstIsPhys = TargetRegisterInfo::isPhysicalRegister(DstReg); + if (DstIsPhys && SubIdx) { + // Figure out the real physical register we are updating with. + DstReg = tri_->getSubReg(DstReg, SubIdx); + SubIdx = 0; + } // Collect all the instructions using SrcReg. SmallPtrSet Instrs; @@ -1011,6 +1014,25 @@ return removeIntervalIfEmpty(li, li_, tri_); } +/// CanCoalesceWithImpDef - Returns true if the specified copy instruction +/// from an implicit def to another register can be coalesced away. +bool SimpleRegisterCoalescing::CanCoalesceWithImpDef(MachineInstr *CopyMI, + LiveInterval &li, + LiveInterval &ImpLi) const{ + if (!CopyMI->killsRegister(ImpLi.reg)) + return false; + // Make sure this is the only use. + for (MachineRegisterInfo::use_iterator UI = mri_->use_begin(ImpLi.reg), + UE = mri_->use_end(); UI != UE;) { + MachineInstr *UseMI = &*UI; + ++UI; + if (CopyMI == UseMI || JoinedCopies.count(UseMI)) + continue; + return false; + } + return true; +} + /// isWinToJoinCrossClass - Return true if it's profitable to coalesce /// two virtual registers from different register classes. @@ -1197,6 +1219,17 @@ return true; } +/// getRegAllocPreference - Return register allocation preference register. +/// +static unsigned getRegAllocPreference(unsigned Reg, MachineFunction &MF, + MachineRegisterInfo *MRI, + const TargetRegisterInfo *TRI) { + if (TargetRegisterInfo::isPhysicalRegister(Reg)) + return 0; + std::pair Hint = MRI->getRegAllocationHint(Reg); + return TRI->ResolveRegAllocHint(Hint.first, Hint.second, MF); +} + /// JoinCopy - Attempt to join intervals corresponding to SrcReg/DstReg, /// which are the src/dst of the copy instruction CopyMI. This returns true /// if the copy was successfully coalesced away. If it is not currently @@ -1211,131 +1244,393 @@ DEBUG(dbgs() << li_->getInstructionIndex(CopyMI) << '\t' << *CopyMI); + unsigned SrcReg, DstReg, SrcSubIdx = 0, DstSubIdx = 0; + bool isExtSubReg = CopyMI->isExtractSubreg(); + bool isInsSubReg = CopyMI->isInsertSubreg(); + bool isSubRegToReg = CopyMI->isSubregToReg(); + unsigned SubIdx = 0; + if (isExtSubReg) { + DstReg = CopyMI->getOperand(0).getReg(); + DstSubIdx = CopyMI->getOperand(0).getSubReg(); + SrcReg = CopyMI->getOperand(1).getReg(); + SrcSubIdx = CopyMI->getOperand(2).getImm(); + } else if (isInsSubReg || isSubRegToReg) { + DstReg = CopyMI->getOperand(0).getReg(); + DstSubIdx = CopyMI->getOperand(3).getImm(); + SrcReg = CopyMI->getOperand(2).getReg(); + SrcSubIdx = CopyMI->getOperand(2).getSubReg(); + if (SrcSubIdx && SrcSubIdx != DstSubIdx) { + // r1025 = INSERT_SUBREG r1025, r1024<2>, 2 Then r1024 has already been + // coalesced to a larger register so the subreg indices cancel out. + DEBUG(dbgs() << "\tSource of insert_subreg or subreg_to_reg is already " + "coalesced to another register.\n"); + return false; // Not coalescable. + } + } else if (tii_->isMoveInstr(*CopyMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx)) { + if (SrcSubIdx && DstSubIdx && SrcSubIdx != DstSubIdx) { + // e.g. %reg16404:1 = MOV8rr %reg16412:2 + Again = true; + return false; // Not coalescable. + } + } else { + llvm_unreachable("Unrecognized copy instruction!"); + } + + // If they are already joined we continue. + if (SrcReg == DstReg) { + DEBUG(dbgs() << "\tCopy already coalesced.\n"); + return false; // Not coalescable. + } + CoalescerPair CP(*tii_, *tri_); if (!CP.setRegisters(CopyMI)) { DEBUG(dbgs() << "\tNot coalescable.\n"); return false; } - // If they are already joined we continue. - if (CP.getSrcReg() == CP.getDstReg()) { - DEBUG(dbgs() << "\tCopy already coalesced.\n"); + bool SrcIsPhys = TargetRegisterInfo::isPhysicalRegister(SrcReg); + bool DstIsPhys = TargetRegisterInfo::isPhysicalRegister(DstReg); + + // If they are both physical registers, we cannot join them. + if (SrcIsPhys && DstIsPhys) { + DEBUG(dbgs() << "\tCan not coalesce physregs.\n"); + return false; // Not coalescable. + } + + // We only join virtual registers with allocatable physical registers. + if (SrcIsPhys && !allocatableRegs_[SrcReg]) { + DEBUG(dbgs() << "\tSrc reg is unallocatable physreg.\n"); + return false; // Not coalescable. + } + if (DstIsPhys && !allocatableRegs_[DstReg]) { + DEBUG(dbgs() << "\tDst reg is unallocatable physreg.\n"); return false; // Not coalescable. } - DEBUG(dbgs() << "\tConsidering merging %reg" << CP.getSrcReg()); + // We cannot handle dual subreg indices and mismatched classes at the same + // time. + if (SrcSubIdx && DstSubIdx && differingRegisterClasses(SrcReg, DstReg)) { + DEBUG(dbgs() << "\tCannot handle subreg indices and mismatched classes.\n"); + return false; + } - // Enforce policies. - if (CP.isPhys()) { - DEBUG(dbgs() <<" with physreg %" << tri_->getName(CP.getDstReg()) << "\n"); - // Only coalesce to allocatable physreg. - if (!allocatableRegs_[CP.getDstReg()]) { - DEBUG(dbgs() << "\tRegister is an unallocatable physreg.\n"); - return false; // Not coalescable. + // Check that a physical source register is compatible with dst regclass + if (SrcIsPhys) { + unsigned SrcSubReg = SrcSubIdx ? + tri_->getSubReg(SrcReg, SrcSubIdx) : SrcReg; + const TargetRegisterClass *DstRC = mri_->getRegClass(DstReg); + const TargetRegisterClass *DstSubRC = DstRC; + if (DstSubIdx) + DstSubRC = DstRC->getSubRegisterRegClass(DstSubIdx); + assert(DstSubRC && "Illegal subregister index"); + if (!DstSubRC->contains(SrcSubReg)) { + DEBUG(dbgs() << "\tIncompatible destination regclass: " + << "none of the super-registers of " + << tri_->getName(SrcSubReg) << " are in " + << DstSubRC->getName() << ".\n"); + return false; // Not coalescable. } - } else { - DEBUG({ - dbgs() << " with reg%" << CP.getDstReg(); - if (CP.getSubIdx()) - dbgs() << ":" << tri_->getSubRegIndexName(CP.getSubIdx()); - dbgs() << " to " << CP.getNewRC()->getName() << "\n"; - }); + } + + // Check that a physical dst register is compatible with source regclass + if (DstIsPhys) { + unsigned DstSubReg = DstSubIdx ? + tri_->getSubReg(DstReg, DstSubIdx) : DstReg; + const TargetRegisterClass *SrcRC = mri_->getRegClass(SrcReg); + const TargetRegisterClass *SrcSubRC = SrcRC; + if (SrcSubIdx) + SrcSubRC = SrcRC->getSubRegisterRegClass(SrcSubIdx); + assert(SrcSubRC && "Illegal subregister index"); + if (!SrcSubRC->contains(DstSubReg)) { + DEBUG(dbgs() << "\tIncompatible source regclass: " + << "none of the super-registers of " + << tri_->getName(DstSubReg) << " are in " + << SrcSubRC->getName() << ".\n"); + (void)DstSubReg; + return false; // Not coalescable. + } + } + + // Should be non-null only when coalescing to a sub-register class. + bool CrossRC = false; + const TargetRegisterClass *SrcRC= SrcIsPhys ? 0 : mri_->getRegClass(SrcReg); + const TargetRegisterClass *DstRC= DstIsPhys ? 0 : mri_->getRegClass(DstReg); + const TargetRegisterClass *NewRC = NULL; + unsigned RealDstReg = 0; + unsigned RealSrcReg = 0; + if (isExtSubReg || isInsSubReg || isSubRegToReg) { + SubIdx = CopyMI->getOperand(isExtSubReg ? 2 : 3).getImm(); + if (SrcIsPhys && isExtSubReg) { + // r1024 = EXTRACT_SUBREG EAX, 0 then r1024 is really going to be + // coalesced with AX. + unsigned DstSubIdx = CopyMI->getOperand(0).getSubReg(); + if (DstSubIdx) { + // r1024<2> = EXTRACT_SUBREG EAX, 2. Then r1024 has already been + // coalesced to a larger register so the subreg indices cancel out. + if (DstSubIdx != SubIdx) { + DEBUG(dbgs() << "\t Sub-register indices mismatch.\n"); + return false; // Not coalescable. + } + } else + SrcReg = tri_->getSubReg(SrcReg, SubIdx); + SubIdx = 0; + } else if (DstIsPhys && (isInsSubReg || isSubRegToReg)) { + // EAX = INSERT_SUBREG EAX, r1024, 0 + unsigned SrcSubIdx = CopyMI->getOperand(2).getSubReg(); + if (SrcSubIdx) { + // EAX = INSERT_SUBREG EAX, r1024<2>, 2 Then r1024 has already been + // coalesced to a larger register so the subreg indices cancel out. + if (SrcSubIdx != SubIdx) { + DEBUG(dbgs() << "\t Sub-register indices mismatch.\n"); + return false; // Not coalescable. + } + } else + DstReg = tri_->getSubReg(DstReg, SubIdx); + SubIdx = 0; + } else if ((DstIsPhys && isExtSubReg) || + (SrcIsPhys && (isInsSubReg || isSubRegToReg))) { + if (!isSubRegToReg && CopyMI->getOperand(1).getSubReg()) { + DEBUG(dbgs() << "\tSrc of extract_subreg already coalesced with reg" + << " of a super-class.\n"); + return false; // Not coalescable. + } + + // FIXME: The following checks are somewhat conservative. Perhaps a better + // way to implement this is to treat this as coalescing a vr with the + // super physical register. + if (isExtSubReg) { + if (!CanJoinExtractSubRegToPhysReg(DstReg, SrcReg, SubIdx, RealDstReg)) + return false; // Not coalescable + } else { + if (!CanJoinInsertSubRegToPhysReg(DstReg, SrcReg, SubIdx, RealSrcReg)) + return false; // Not coalescable + } + SubIdx = 0; + } else { + unsigned OldSubIdx = isExtSubReg ? CopyMI->getOperand(0).getSubReg() + : CopyMI->getOperand(2).getSubReg(); + if (OldSubIdx) { + if (OldSubIdx == SubIdx && !differingRegisterClasses(SrcReg, DstReg)) + // r1024<2> = EXTRACT_SUBREG r1025, 2. Then r1024 has already been + // coalesced to a larger register so the subreg indices cancel out. + // Also check if the other larger register is of the same register + // class as the would be resulting register. + SubIdx = 0; + else { + DEBUG(dbgs() << "\t Sub-register indices mismatch.\n"); + return false; // Not coalescable. + } + } + if (SubIdx) { + if (!DstIsPhys && !SrcIsPhys) { + if (isInsSubReg || isSubRegToReg) { + NewRC = tri_->getMatchingSuperRegClass(DstRC, SrcRC, SubIdx); + } else // extract_subreg { + NewRC = tri_->getMatchingSuperRegClass(SrcRC, DstRC, SubIdx); + } + if (!NewRC) { + DEBUG(dbgs() << "\t Conflicting sub-register indices.\n"); + return false; // Not coalescable + } - // Avoid constraining virtual register regclass too much. - if (CP.isCrossClass()) { - if (DisableCrossClassJoin) { - DEBUG(dbgs() << "\tCross-class joins disabled.\n"); + if (!isWinToJoinCrossClass(SrcReg, DstReg, SrcRC, DstRC, NewRC)) { + DEBUG(dbgs() << "\tAvoid coalescing to constrained register class: " + << SrcRC->getName() << "/" + << DstRC->getName() << " -> " + << NewRC->getName() << ".\n"); + Again = true; // May be possible to coalesce later. + return false; + } + } + } + } else if (differingRegisterClasses(SrcReg, DstReg)) { + if (DisableCrossClassJoin) + return false; + CrossRC = true; + + // FIXME: What if the result of a EXTRACT_SUBREG is then coalesced + // with another? If it's the resulting destination register, then + // the subidx must be propagated to uses (but only those defined + // by the EXTRACT_SUBREG). If it's being coalesced into another + // register, it should be safe because register is assumed to have + // the register class of the super-register. + + // Process moves where one of the registers have a sub-register index. + MachineOperand *DstMO = CopyMI->findRegisterDefOperand(DstReg); + MachineOperand *SrcMO = CopyMI->findRegisterUseOperand(SrcReg); + SubIdx = DstMO->getSubReg(); + if (SubIdx) { + if (SrcMO->getSubReg()) + // FIXME: can we handle this? return false; + // This is not an insert_subreg but it looks like one. + // e.g. %reg1024:4 = MOV32rr %EAX + isInsSubReg = true; + if (SrcIsPhys) { + if (!CanJoinInsertSubRegToPhysReg(DstReg, SrcReg, SubIdx, RealSrcReg)) + return false; // Not coalescable + SubIdx = 0; + } + } else { + SubIdx = SrcMO->getSubReg(); + if (SubIdx) { + // This is not a extract_subreg but it looks like one. + // e.g. %cl = MOV16rr %reg1024:1 + isExtSubReg = true; + if (DstIsPhys) { + if (!CanJoinExtractSubRegToPhysReg(DstReg, SrcReg, SubIdx,RealDstReg)) + return false; // Not coalescable + SubIdx = 0; + } + } + } + + // Now determine the register class of the joined register. + if (!SrcIsPhys && !DstIsPhys) { + if (isExtSubReg) { + NewRC = + SubIdx ? tri_->getMatchingSuperRegClass(SrcRC, DstRC, SubIdx) : SrcRC; + } else if (isInsSubReg) { + NewRC = + SubIdx ? tri_->getMatchingSuperRegClass(DstRC, SrcRC, SubIdx) : DstRC; + } else { + NewRC = getCommonSubClass(SrcRC, DstRC); } - if (!isWinToJoinCrossClass(CP.getSrcReg(), CP.getDstReg(), - mri_->getRegClass(CP.getSrcReg()), - mri_->getRegClass(CP.getDstReg()), - CP.getNewRC())) { + + if (!NewRC) { + DEBUG(dbgs() << "\tDisjoint regclasses: " + << SrcRC->getName() << ", " + << DstRC->getName() << ".\n"); + return false; // Not coalescable. + } + + // If we are joining two virtual registers and the resulting register + // class is more restrictive (fewer register, smaller size). Check if it's + // worth doing the merge. + if (!isWinToJoinCrossClass(SrcReg, DstReg, SrcRC, DstRC, NewRC)) { DEBUG(dbgs() << "\tAvoid coalescing to constrained register class: " - << CP.getNewRC()->getName() << ".\n"); + << SrcRC->getName() << "/" + << DstRC->getName() << " -> " + << NewRC->getName() << ".\n"); + // Allow the coalescer to try again in case either side gets coalesced to + // a physical register that's compatible with the other side. e.g. + // r1024 = MOV32to32_ r1025 + // But later r1024 is assigned EAX then r1025 may be coalesced with EAX. Again = true; // May be possible to coalesce later. return false; } } + } - // When possible, let DstReg be the larger interval. - if (!CP.getSubIdx() && li_->getInterval(CP.getSrcReg()).ranges.size() > - li_->getInterval(CP.getDstReg()).ranges.size()) - CP.flip(); - } - - // We need to be careful about coalescing a source physical register with a - // virtual register. Once the coalescing is done, it cannot be broken and - // these are not spillable! If the destination interval uses are far away, - // think twice about coalescing them! - // FIXME: Why are we skipping this test for partial copies? - // CodeGen/X86/phys_subreg_coalesce-3.ll needs it. - if (!CP.isPartial() && CP.isPhys()) { - LiveInterval &JoinVInt = li_->getInterval(CP.getSrcReg()); - - // Don't join with physregs that have a ridiculous number of live - // ranges. The data structure performance is really bad when that - // happens. - if (li_->hasInterval(CP.getDstReg()) && - li_->getInterval(CP.getDstReg()).ranges.size() > 1000) { - mri_->setRegAllocationHint(CP.getSrcReg(), 0, CP.getDstReg()); - ++numAborts; - DEBUG(dbgs() - << "\tPhysical register live interval too complicated, abort!\n"); - return false; - } + // Will it create illegal extract_subreg / insert_subreg? + if (SrcIsPhys && HasIncompatibleSubRegDefUse(CopyMI, DstReg, SrcReg)) + return false; + if (DstIsPhys && HasIncompatibleSubRegDefUse(CopyMI, SrcReg, DstReg)) + return false; - const TargetRegisterClass *RC = mri_->getRegClass(CP.getSrcReg()); - unsigned Threshold = allocatableRCRegs_[RC].count() * 2; - unsigned Length = li_->getApproximateInstructionCount(JoinVInt); - if (Length > Threshold && - std::distance(mri_->use_nodbg_begin(CP.getSrcReg()), - mri_->use_nodbg_end()) * Threshold < Length) { - // Before giving up coalescing, if definition of source is defined by - // trivial computation, try rematerializing it. - if (!CP.isFlipped() && - ReMaterializeTrivialDef(JoinVInt, CP.getDstReg(), 0, CopyMI)) - return true; + LiveInterval &SrcInt = li_->getInterval(SrcReg); + LiveInterval &DstInt = li_->getInterval(DstReg); + assert(SrcInt.reg == SrcReg && DstInt.reg == DstReg && + "Register mapping is horribly broken!"); - mri_->setRegAllocationHint(CP.getSrcReg(), 0, CP.getDstReg()); - ++numAborts; - DEBUG(dbgs() << "\tMay tie down a physical register, abort!\n"); - Again = true; // May be possible to coalesce later. - return false; - } - } + DEBUG({ + dbgs() << "\t\tInspecting "; + if (SrcRC) dbgs() << SrcRC->getName() << ": "; + SrcInt.print(dbgs(), tri_); + dbgs() << "\n\t\t and "; + if (DstRC) dbgs() << DstRC->getName() << ": "; + DstInt.print(dbgs(), tri_); + dbgs() << "\n"; + }); - // We may need the source interval after JoinIntervals has destroyed it. + // Save a copy of the virtual register live interval. We'll manually + // merge this into the "real" physical register live interval this is + // coalesced with. OwningPtr SavedLI; - if (CP.getOrigDstReg() != CP.getDstReg()) - SavedLI.reset(li_->dupInterval(&li_->getInterval(CP.getSrcReg()))); + if (RealDstReg) + SavedLI.reset(li_->dupInterval(&SrcInt)); + else if (RealSrcReg) + SavedLI.reset(li_->dupInterval(&DstInt)); + + if (!isExtSubReg && !isInsSubReg && !isSubRegToReg) { + // Check if it is necessary to propagate "isDead" property. + MachineOperand *mopd = CopyMI->findRegisterDefOperand(DstReg, false); + bool isDead = mopd->isDead(); + + // We need to be careful about coalescing a source physical register with a + // virtual register. Once the coalescing is done, it cannot be broken and + // these are not spillable! If the destination interval uses are far away, + // think twice about coalescing them! + if (!isDead && (SrcIsPhys || DstIsPhys)) { + // If the virtual register live interval is long but it has low use + // density, do not join them, instead mark the physical register as its + // allocation preference. + LiveInterval &JoinVInt = SrcIsPhys ? DstInt : SrcInt; + LiveInterval &JoinPInt = SrcIsPhys ? SrcInt : DstInt; + unsigned JoinVReg = SrcIsPhys ? DstReg : SrcReg; + unsigned JoinPReg = SrcIsPhys ? SrcReg : DstReg; + + // Don't join with physregs that have a ridiculous number of live + // ranges. The data structure performance is really bad when that + // happens. + if (JoinPInt.ranges.size() > 1000) { + mri_->setRegAllocationHint(JoinVInt.reg, 0, JoinPReg); + ++numAborts; + DEBUG(dbgs() + << "\tPhysical register live interval too complicated, abort!\n"); + return false; + } + + const TargetRegisterClass *RC = mri_->getRegClass(JoinVReg); + unsigned Threshold = allocatableRCRegs_[RC].count() * 2; + unsigned Length = li_->getApproximateInstructionCount(JoinVInt); + if (Length > Threshold && + std::distance(mri_->use_nodbg_begin(JoinVReg), + mri_->use_nodbg_end()) * Threshold < Length) { + // Before giving up coalescing, if definition of source is defined by + // trivial computation, try rematerializing it. + if (ReMaterializeTrivialDef(SrcInt, DstReg, DstSubIdx, CopyMI)) + return true; + + mri_->setRegAllocationHint(JoinVInt.reg, 0, JoinPReg); + ++numAborts; + DEBUG(dbgs() << "\tMay tie down a physical register, abort!\n"); + Again = true; // May be possible to coalesce later. + return false; + } + } + } // Okay, attempt to join these two intervals. On failure, this returns false. // Otherwise, if one of the intervals being joined is a physreg, this method // always canonicalizes DstInt to be it. The output "SrcInt" will not have // been modified, so we can use this information below to update aliases. - if (!JoinIntervals(CP)) { + bool Swapped = false; + // If SrcInt is implicitly defined, it's safe to coalesce. + if (SrcInt.empty()) { + if (!CanCoalesceWithImpDef(CopyMI, DstInt, SrcInt)) { + // Only coalesce an empty interval (defined by implicit_def) with + // another interval which has a valno defined by the CopyMI and the CopyMI + // is a kill of the implicit def. + DEBUG(dbgs() << "\tNot profitable!\n"); + return false; + } + } else if (!JoinIntervals(DstInt, SrcInt, Swapped, CP)) { // Coalescing failed. // If definition of source is defined by trivial computation, try // rematerializing it. - if (!CP.isFlipped() && - ReMaterializeTrivialDef(li_->getInterval(CP.getSrcReg()), - CP.getDstReg(), 0, CopyMI)) + if (!isExtSubReg && !isInsSubReg && !isSubRegToReg && + ReMaterializeTrivialDef(SrcInt, DstReg, DstSubIdx, CopyMI)) return true; // If we can eliminate the copy without merging the live ranges, do so now. - if (!CP.isPartial()) { - LiveInterval *UseInt = &li_->getInterval(CP.getSrcReg()); - LiveInterval *DefInt = &li_->getInterval(CP.getDstReg()); - if (CP.isFlipped()) - std::swap(UseInt, DefInt); - if (AdjustCopiesBackFrom(*UseInt, *DefInt, CopyMI) || - RemoveCopyByCommutingDef(*UseInt, *DefInt, CopyMI)) { - JoinedCopies.insert(CopyMI); - DEBUG(dbgs() << "\tTrivial!\n"); - return true; - } + if (!isExtSubReg && !isInsSubReg && !isSubRegToReg && + (AdjustCopiesBackFrom(SrcInt, DstInt, CopyMI) || + RemoveCopyByCommutingDef(SrcInt, DstInt, CopyMI))) { + JoinedCopies.insert(CopyMI); + DEBUG(dbgs() << "\tTrivial!\n"); + return true; } // Otherwise, we are unable to join the intervals. @@ -1344,15 +1639,25 @@ return false; } - if (CP.isPhys()) { + LiveInterval *ResSrcInt = &SrcInt; + LiveInterval *ResDstInt = &DstInt; + if (Swapped) { + std::swap(SrcReg, DstReg); + std::swap(ResSrcInt, ResDstInt); + } + assert(TargetRegisterInfo::isVirtualRegister(SrcReg) && + "LiveInterval::join didn't work right!"); + + // If we're about to merge live ranges into a physical register live interval, + // we have to update any aliased register's live ranges to indicate that they + // have clobbered values for this range. + if (TargetRegisterInfo::isPhysicalRegister(DstReg)) { // If this is a extract_subreg where dst is a physical register, e.g. // cl = EXTRACT_SUBREG reg1024, 1 // then create and update the actual physical register allocated to RHS. - unsigned LargerDstReg = CP.getDstReg(); - if (CP.getOrigDstReg() != CP.getDstReg()) { - if (tri_->isSubRegister(CP.getOrigDstReg(), LargerDstReg)) - LargerDstReg = CP.getOrigDstReg(); - LiveInterval &RealInt = li_->getOrCreateInterval(CP.getDstReg()); + if (RealDstReg || RealSrcReg) { + LiveInterval &RealInt = + li_->getOrCreateInterval(RealDstReg ? RealDstReg : RealSrcReg); for (LiveInterval::const_vni_iterator I = SavedLI->vni_begin(), E = SavedLI->vni_end(); I != E; ++I) { const VNInfo *ValNo = *I; @@ -1364,45 +1669,56 @@ RealInt.MergeValueInAsValue(*SavedLI, ValNo, NewValNo); } RealInt.weight += SavedLI->weight; + DstReg = RealDstReg ? RealDstReg : RealSrcReg; } // Update the liveintervals of sub-registers. - LiveInterval &LargerInt = li_->getInterval(LargerDstReg); - for (const unsigned *AS = tri_->getSubRegisters(LargerDstReg); *AS; ++AS) { - LiveInterval &SRI = li_->getOrCreateInterval(*AS); - SRI.MergeInClobberRanges(*li_, LargerInt, li_->getVNInfoAllocator()); - DEBUG({ - dbgs() << "\t\tsubreg: "; SRI.print(dbgs(), tri_); dbgs() << "\n"; - }); + for (const unsigned *AS = tri_->getSubRegisters(DstReg); *AS; ++AS) + li_->getOrCreateInterval(*AS).MergeInClobberRanges(*li_, *ResSrcInt, + li_->getVNInfoAllocator()); + } + + // If this is a EXTRACT_SUBREG, make sure the result of coalescing is the + // larger super-register. + if ((isExtSubReg || isInsSubReg || isSubRegToReg) && + !SrcIsPhys && !DstIsPhys) { + if ((isExtSubReg && !Swapped) || + ((isInsSubReg || isSubRegToReg) && Swapped)) { + ResSrcInt->Copy(*ResDstInt, mri_, li_->getVNInfoAllocator()); + std::swap(SrcReg, DstReg); + std::swap(ResSrcInt, ResDstInt); } } // Coalescing to a virtual register that is of a sub-register class of the // other. Make sure the resulting register is set to the right register class. - if (CP.isCrossClass()) { + if (CrossRC) ++numCrossRCs; - mri_->setRegClass(CP.getDstReg(), CP.getNewRC()); - } + + // This may happen even if it's cross-rc coalescing. e.g. + // %reg1026 = SUBREG_TO_REG 0, %reg1037, 4 + // reg1026 -> GR64, reg1037 -> GR32_ABCD. The resulting register will have to + // be allocate a register from GR64_ABCD. + if (NewRC) + mri_->setRegClass(DstReg, NewRC); // Remember to delete the copy instruction. JoinedCopies.insert(CopyMI); - UpdateRegDefsUses(CP); + UpdateRegDefsUses(SrcReg, DstReg, SubIdx); // If we have extended the live range of a physical register, make sure we // update live-in lists as well. - if (CP.isPhys()) { + if (TargetRegisterInfo::isPhysicalRegister(DstReg)) { + const LiveInterval &VRegInterval = li_->getInterval(SrcReg); SmallVector BlockSeq; - // JoinIntervals invalidates the VNInfos in SrcInt, but we only need the - // ranges for this, and they are preserved. - LiveInterval &SrcInt = li_->getInterval(CP.getSrcReg()); - for (LiveInterval::const_iterator I = SrcInt.begin(), E = SrcInt.end(); - I != E; ++I ) { + for (LiveInterval::const_iterator I = VRegInterval.begin(), + E = VRegInterval.end(); I != E; ++I ) { li_->findLiveInMBBs(I->start, I->end, BlockSeq); for (unsigned idx = 0, size = BlockSeq.size(); idx != size; ++idx) { MachineBasicBlock &block = *BlockSeq[idx]; - if (!block.isLiveIn(CP.getDstReg())) - block.addLiveIn(CP.getDstReg()); + if (!block.isLiveIn(DstReg)) + block.addLiveIn(DstReg); } BlockSeq.clear(); } @@ -1410,17 +1726,32 @@ // SrcReg is guarateed to be the register whose live interval that is // being merged. - li_->removeInterval(CP.getSrcReg()); + li_->removeInterval(SrcReg); // Update regalloc hint. - tri_->UpdateRegAllocHint(CP.getSrcReg(), CP.getDstReg(), *mf_); + tri_->UpdateRegAllocHint(SrcReg, DstReg, *mf_); + + // Manually deleted the live interval copy. + if (SavedLI) { + SavedLI->clear(); + SavedLI.reset(); + } + + // If resulting interval has a preference that no longer fits because of subreg + // coalescing, just clear the preference. + unsigned Preference = getRegAllocPreference(ResDstInt->reg, *mf_, mri_, tri_); + if (Preference && (isExtSubReg || isInsSubReg || isSubRegToReg) && + TargetRegisterInfo::isVirtualRegister(ResDstInt->reg)) { + const TargetRegisterClass *RC = mri_->getRegClass(ResDstInt->reg); + if (!RC->contains(Preference)) + mri_->setRegAllocationHint(ResDstInt->reg, 0, 0); + } DEBUG({ - LiveInterval &DstInt = li_->getInterval(CP.getDstReg()); - dbgs() << "\tJoined. Result = "; - DstInt.print(dbgs(), tri_); - dbgs() << "\n"; - }); + dbgs() << "\t\tJoined. Result = "; + ResDstInt->print(dbgs(), tri_); + dbgs() << "\n"; + }); ++numJoins; return true; @@ -1478,24 +1809,26 @@ } /// JoinIntervals - Attempt to join these two intervals. On failure, this -/// returns false. -bool SimpleRegisterCoalescing::JoinIntervals(CoalescerPair &CP) { - LiveInterval &RHS = li_->getInterval(CP.getSrcReg()); - DEBUG({ dbgs() << "\t\tRHS = "; RHS.print(dbgs(), tri_); dbgs() << "\n"; }); - - // FIXME: Join into CP.getDstReg instead of CP.getOrigDstReg. - // When looking at - // %reg2000 = EXTRACT_SUBREG %EAX, sub_16bit - // we really want to join %reg2000 with %AX ( = CP.getDstReg). We are actually - // joining into %EAX ( = CP.getOrigDstReg) because it is guaranteed to have an - // existing live interval, and we are better equipped to handle interference. - // JoinCopy cleans up the mess by taking a copy of RHS before calling here, - // and merging that copy into CP.getDstReg after. +/// returns false. Otherwise, if one of the intervals being joined is a +/// physreg, this method always canonicalizes LHS to be it. The output +/// "RHS" will not have been modified, so we can use this information +/// below to update aliases. +bool +SimpleRegisterCoalescing::JoinIntervals(LiveInterval &LHS, LiveInterval &RHS, + bool &Swapped, CoalescerPair &CP) { + // Compute the final value assignment, assuming that the live ranges can be + // coalesced. + SmallVector LHSValNoAssignments; + SmallVector RHSValNoAssignments; + DenseMap LHSValsDefinedFromRHS; + DenseMap RHSValsDefinedFromLHS; + SmallVector NewVNInfo; // If a live interval is a physical register, conservatively check if any // of its sub-registers is overlapping the live interval of the virtual // register. If so, do not coalesce. - if (CP.isPhys() && *tri_->getSubRegisters(CP.getOrigDstReg())) { + if (TargetRegisterInfo::isPhysicalRegister(LHS.reg) && + *tri_->getSubRegisters(LHS.reg)) { // If it's coalescing a virtual register to a physical register, estimate // its live interval length. This is the *cost* of scanning an entire live // interval. If the cost is low, we'll do an exhaustive check instead. @@ -1515,11 +1848,10 @@ li_->intervalIsInOneMBB(RHS) && li_->getApproximateInstructionCount(RHS) <= 10) { // Perform a more exhaustive check for some common cases. - if (li_->conflictsWithAliasRef(RHS, CP.getOrigDstReg(), JoinedCopies)) + if (li_->conflictsWithSubPhysRegRef(RHS, LHS.reg, true, JoinedCopies)) return false; } else { - for (const unsigned* SR = tri_->getAliasSet(CP.getOrigDstReg()); *SR; - ++SR) + for (const unsigned* SR = tri_->getSubRegisters(LHS.reg); *SR; ++SR) if (li_->hasInterval(*SR) && RHS.overlaps(li_->getInterval(*SR))) { DEBUG({ dbgs() << "\tInterfere with sub-register "; @@ -1528,19 +1860,25 @@ return false; } } + } else if (TargetRegisterInfo::isPhysicalRegister(RHS.reg) && + *tri_->getSubRegisters(RHS.reg)) { + if (LHS.containsOneValue() && + li_->getApproximateInstructionCount(LHS) <= 10) { + // Perform a more exhaustive check for some common cases. + if (li_->conflictsWithSubPhysRegRef(LHS, RHS.reg, false, JoinedCopies)) + return false; + } else { + for (const unsigned* SR = tri_->getSubRegisters(RHS.reg); *SR; ++SR) + if (li_->hasInterval(*SR) && LHS.overlaps(li_->getInterval(*SR))) { + DEBUG({ + dbgs() << "\tInterfere with sub-register "; + li_->getInterval(*SR).print(dbgs(), tri_); + }); + return false; + } + } } - // Compute the final value assignment, assuming that the live ranges can be - // coalesced. - SmallVector LHSValNoAssignments; - SmallVector RHSValNoAssignments; - DenseMap LHSValsDefinedFromRHS; - DenseMap RHSValsDefinedFromLHS; - SmallVector NewVNInfo; - - LiveInterval &LHS = li_->getInterval(CP.getOrigDstReg()); - DEBUG({ dbgs() << "\t\tLHS = "; LHS.print(dbgs(), tri_); dbgs() << "\n"; }); - // Loop over the value numbers of the LHS, seeing if any are defined from // the RHS. for (LiveInterval::vni_iterator i = LHS.vni_begin(), e = LHS.vni_end(); @@ -1629,17 +1967,15 @@ LiveInterval::const_iterator JE = RHS.end(); // Skip ahead until the first place of potential sharing. - if (I != IE && J != JE) { - if (I->start < J->start) { - I = std::upper_bound(I, IE, J->start); - if (I != LHS.begin()) --I; - } else if (J->start < I->start) { - J = std::upper_bound(J, JE, I->start); - if (J != RHS.begin()) --J; - } + if (I->start < J->start) { + I = std::upper_bound(I, IE, J->start); + if (I != LHS.begin()) --I; + } else if (J->start < I->start) { + J = std::upper_bound(J, JE, I->start); + if (J != RHS.begin()) --J; } - while (I != IE && J != JE) { + while (1) { // Determine if these two live ranges overlap. bool Overlaps; if (I->start < J->start) { @@ -1661,10 +1997,13 @@ return false; } - if (I->end < J->end) + if (I->end < J->end) { ++I; - else + if (I == IE) break; + } else { ++J; + if (J == JE) break; + } } // Update kill info. Some live ranges are extended due to copy coalescing. @@ -1689,15 +2028,19 @@ LHS.addKills(NewVNInfo[RHSValID], VNI->kills); } - if (LHSValNoAssignments.empty()) - LHSValNoAssignments.push_back(-1); - if (RHSValNoAssignments.empty()) - RHSValNoAssignments.push_back(-1); - // If we get here, we know that we can coalesce the live ranges. Ask the // intervals to coalesce themselves now. - LHS.join(RHS, &LHSValNoAssignments[0], &RHSValNoAssignments[0], NewVNInfo, - mri_); + if ((RHS.ranges.size() > LHS.ranges.size() && + TargetRegisterInfo::isVirtualRegister(LHS.reg)) || + TargetRegisterInfo::isPhysicalRegister(RHS.reg)) { + RHS.join(LHS, &RHSValNoAssignments[0], &LHSValNoAssignments[0], NewVNInfo, + mri_); + Swapped = true; + } else { + LHS.join(RHS, &LHSValNoAssignments[0], &RHSValNoAssignments[0], NewVNInfo, + mri_); + Swapped = false; + } return true; } @@ -1977,8 +2320,8 @@ if (!tii_->isMoveInstr(*MI, SrcReg, DstReg, SrcSubIdx, DstSubIdx)) { assert((MI->isExtractSubreg() || MI->isInsertSubreg() || MI->isSubregToReg()) && "Unrecognized copy instruction"); - SrcReg = MI->getOperand(MI->isSubregToReg() ? 2 : 1).getReg(); - if (TargetRegisterInfo::isPhysicalRegister(SrcReg)) + DstReg = MI->getOperand(0).getReg(); + if (TargetRegisterInfo::isPhysicalRegister(DstReg)) // Do not delete extract_subreg, insert_subreg of physical // registers unless the definition is dead. e.g. // %DO = INSERT_SUBREG %D0, %S0, 1 @@ -1987,7 +2330,7 @@ DoDelete = false; } if (MI->allDefsAreDead()) { - LiveInterval &li = li_->getInterval(SrcReg); + LiveInterval &li = li_->getInterval(DstReg); if (!ShortenDeadCopySrcLiveRange(li, MI)) ShortenDeadCopyLiveRange(li, MI); DoDelete = true; @@ -2045,11 +2388,6 @@ if (MI->registerDefIsDead(DstReg)) { if (!ShortenDeadCopySrcLiveRange(RegInt, MI)) ShortenDeadCopyLiveRange(RegInt, MI); - } else { - // If a value is killed here remove the marker. - SlotIndex UseIdx = li_->getInstructionIndex(MI).getUseIndex(); - if (const LiveRange *LR = RegInt.getLiveRangeContaining(UseIdx)) - LR->valno->removeKill(UseIdx.getDefIndex()); } } li_->RemoveMachineInstrFromMaps(MI); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h?rev=106710&r1=106709&r2=106710&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h Wed Jun 23 19:52:22 2010 @@ -105,11 +105,14 @@ /// possible to coalesce this interval, but it may be possible if other /// things get coalesced, then it returns true by reference in 'Again'. bool JoinCopy(CopyRec &TheCopy, bool &Again); - + /// JoinIntervals - Attempt to join these two intervals. On failure, this - /// returns false. The output "SrcInt" will not have been modified, so we can - /// use this information below to update aliases. - bool JoinIntervals(CoalescerPair &CP); + /// returns false. Otherwise, if one of the intervals being joined is a + /// physreg, this method always canonicalizes DestInt to be it. The output + /// "SrcInt" will not have been modified, so we can use this information + /// below to update aliases. + bool JoinIntervals(LiveInterval &LHS, LiveInterval &RHS, bool &Swapped, + CoalescerPair &CP); /// Return true if the two specified registers belong to different register /// classes. The registers may be either phys or virt regs. @@ -146,6 +149,11 @@ bool ReMaterializeTrivialDef(LiveInterval &SrcInt, unsigned DstReg, unsigned DstSubIdx, MachineInstr *CopyMI); + /// CanCoalesceWithImpDef - Returns true if the specified copy instruction + /// from an implicit def to another register can be coalesced away. + bool CanCoalesceWithImpDef(MachineInstr *CopyMI, + LiveInterval &li, LiveInterval &ImpLi) const; + /// isWinToJoinCrossClass - Return true if it's profitable to coalesce /// two virtual registers from different register classes. bool isWinToJoinCrossClass(unsigned SrcReg, @@ -178,7 +186,7 @@ /// physical register and the existing subregister number of the def / use /// being updated is not zero, make sure to set it to the correct physical /// subregister. - void UpdateRegDefsUses(const CoalescerPair &CP); + void UpdateRegDefsUses(unsigned SrcReg, unsigned DstReg, unsigned SubIdx); /// ShortenDeadCopyLiveRange - Shorten a live range defined by a dead copy. /// Return true if live interval is removed. Modified: llvm/trunk/test/CodeGen/ARM/vget_lane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vget_lane.ll?rev=106710&r1=106709&r2=106710&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vget_lane.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vget_lane.ll Wed Jun 23 19:52:22 2010 @@ -204,8 +204,8 @@ define arm_aapcs_vfpcc <2 x float> @test_vset_lanef32(float %arg0_float32_t, <2 x float> %arg1_float32x2_t) nounwind { ;CHECK: test_vset_lanef32: -;CHECK: vmov.f32 s3, s0 -;CHECK: vmov.f64 d0, d1 +;CHECK: vmov.f32 +;CHECK: vmov.f32 entry: %0 = insertelement <2 x float> %arg1_float32x2_t, float %arg0_float32_t, i32 1 ; <<2 x float>> [#uses=1] ret <2 x float> %0 From espindola at google.com Wed Jun 23 20:19:57 2010 From: espindola at google.com (Rafael Espindola) Date: Wed, 23 Jun 2010 21:19:57 -0400 Subject: [llvm-commits] [llvm-gcc-4.2] r106696 - in /llvm-gcc-4.2/trunk/gcc: configure configure.ac In-Reply-To: <20100623233440.AFBBA2A6C12C@llvm.org> References: <20100623233440.AFBBA2A6C12C@llvm.org> Message-ID: > -# Generated by GNU Autoconf 2.60. > +# Generated by GNU Autoconf 2.61. Is this intentional? Cheers, Rafael From echristo at apple.com Wed Jun 23 20:28:09 2010 From: echristo at apple.com (Eric Christopher) Date: Wed, 23 Jun 2010 18:28:09 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r106696 - in /llvm-gcc-4.2/trunk/gcc: configure configure.ac In-Reply-To: References: <20100623233440.AFBBA2A6C12C@llvm.org> Message-ID: <867A8A92-EBAA-42AF-BC1E-CEA6A06DC3F5@apple.com> On Jun 23, 2010, at 6:19 PM, Rafael Espindola wrote: >> -# Generated by GNU Autoconf 2.60. >> +# Generated by GNU Autoconf 2.61. > > Is this intentional? Not really, no - I noticed after I committed. I can fix it if it breaks anyone though. -eric From echristo at apple.com Wed Jun 23 20:41:35 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 24 Jun 2010 01:41:35 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r106711 - /llvm-gcc-4.2/trunk/gcc/Makefile.in Message-ID: <20100624014135.453902A6C12C@llvm.org> Author: echristo Date: Wed Jun 23 20:41:35 2010 New Revision: 106711 URL: http://llvm.org/viewvc/llvm-project?rev=106711&view=rev Log: Add a little hack to ensure that libllvmgcc.dylib links against the correct libraries. Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/Makefile.in?rev=106711&r1=106710&r2=106711&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/Makefile.in (original) +++ llvm-gcc-4.2/trunk/gcc/Makefile.in Wed Jun 23 20:41:35 2010 @@ -1246,7 +1246,7 @@ $(ALL_CXXFLAGS) $(ALL_CPPFLAGS)) libllvmgcc$(LLVM_STAGE).dylib: llvm-linker-hack.cpp $(LLVMLIBFILES) echo $(LLVMLIBFILES) - $(CXX) $(DYLIB_COMPILE_FLAGS) $(INCLUDES) -o $@ \ + $(CXX) $(DYLIB_COMPILE_FLAGS) $(INCLUDES) $(LIBS) -o $@ \ $< $(LLVMLIBFILES) -dynamiclib -single_module \ -compatibility_version 1.0.0 -current_version 1.0.0 \ -install_name @executable_path/$@ \ From echristo at apple.com Wed Jun 23 20:44:19 2010 From: echristo at apple.com (Eric Christopher) Date: Thu, 24 Jun 2010 01:44:19 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r106712 - /llvm-gcc-4.2/trunk/gcc/configure Message-ID: <20100624014419.C2C6B2A6C12C@llvm.org> Author: echristo Date: Wed Jun 23 20:44:19 2010 New Revision: 106712 URL: http://llvm.org/viewvc/llvm-project?rev=106712&view=rev Log: Regenerate using autoconf 2.60. Modified: llvm-gcc-4.2/trunk/gcc/configure Modified: llvm-gcc-4.2/trunk/gcc/configure URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/configure?rev=106712&r1=106711&r2=106712&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/configure (original) +++ llvm-gcc-4.2/trunk/gcc/configure Wed Jun 23 20:44:19 2010 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61. +# Generated by GNU Autoconf 2.60. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -10,8 +10,7 @@ ## M4sh Initialization. ## ## --------------------- ## -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh +# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -20,13 +19,10 @@ alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi - - +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh # PATH needs CR @@ -219,7 +215,7 @@ else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. @@ -237,6 +233,7 @@ # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF +# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -245,12 +242,10 @@ alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi - +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh : _ASEOF @@ -258,6 +253,7 @@ CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF +# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -266,12 +262,10 @@ alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi - +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh : (as_func_return () { @@ -518,28 +512,19 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' + as_executable_p=: fi -as_executable_p=$as_test_x +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -580,36 +565,36 @@ # Factoring default headers for most tests. ac_includes_default="\ #include -#ifdef HAVE_SYS_TYPES_H +#if HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_STAT_H +#if HAVE_SYS_STAT_H # include #endif -#ifdef STDC_HEADERS +#if STDC_HEADERS # include # include #else -# ifdef HAVE_STDLIB_H +# if HAVE_STDLIB_H # include # endif #endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H # include #endif -#ifdef HAVE_INTTYPES_H +#if HAVE_INTTYPES_H # include #endif -#ifdef HAVE_STDINT_H +#if HAVE_STDINT_H # include #endif -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H # include #endif" @@ -843,7 +828,6 @@ CC CFLAGS LDFLAGS -LIBS CPPFLAGS CPP GMPLIBS @@ -953,10 +937,10 @@ -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) @@ -972,10 +956,10 @@ -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ @@ -1169,19 +1153,19 @@ -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + ac_package=`echo $ac_package| sed 's/-/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + ac_package=`echo $ac_package | sed 's/-/_/g'` eval with_$ac_package=no ;; --x) @@ -1516,7 +1500,6 @@ CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor @@ -1587,7 +1570,7 @@ if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.61 +generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -1601,7 +1584,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -2480,7 +2463,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2520,7 +2503,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2577,7 +2560,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2618,7 +2601,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2676,7 +2659,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2720,7 +2703,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2861,7 +2844,7 @@ # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. -for ac_file in $ac_files '' +for ac_file in $ac_files do test -f "$ac_file" || continue case $ac_file in @@ -2889,12 +2872,6 @@ test "$ac_cv_exeext" = no && ac_cv_exeext= else - ac_file='' -fi - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2906,6 +2883,8 @@ fi ac_exeext=$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. @@ -3083,10 +3062,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 @@ -3141,10 +3137,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 @@ -3179,10 +3192,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 @@ -3218,10 +3248,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 @@ -3337,10 +3384,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 @@ -3473,7 +3537,7 @@ else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi -rm -f -r core conftest* +rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then @@ -3578,10 +3642,17 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 @@ -3615,10 +3686,17 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else @@ -3683,10 +3761,17 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 @@ -3720,10 +3805,17 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else @@ -3790,10 +3882,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 @@ -3850,7 +3959,7 @@ for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -3932,7 +4041,7 @@ for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -4028,10 +4137,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 @@ -4059,7 +4185,7 @@ else ac_cv_header_stdc=no fi -rm -f -r conftest* +rm -f conftest* fi @@ -4080,7 +4206,7 @@ else ac_cv_header_stdc=no fi -rm -f -r conftest* +rm -f conftest* fi @@ -4207,10 +4333,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 @@ -4271,10 +4414,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_void_p=yes else echo "$as_me: failed program was:" >&5 @@ -4288,15 +4448,16 @@ { echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 echo "${ECHO_T}$ac_cv_type_void_p" >&6; } -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of void *" >&5 echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + if test "$ac_cv_type_void_p" = yes; then + # The cast to long int works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4306,7 +4467,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; + typedef void * ac__type_sizeof_; int main () { @@ -4330,10 +4491,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4343,7 +4521,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; + typedef void * ac__type_sizeof_; int main () { @@ -4367,10 +4545,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -4397,7 +4592,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; + typedef void * ac__type_sizeof_; int main () { @@ -4421,20 +4616,37 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; + typedef void * ac__type_sizeof_; int main () { @@ -4458,10 +4670,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -4498,7 +4727,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; + typedef void * ac__type_sizeof_; int main () { @@ -4522,10 +4751,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 @@ -4538,15 +4784,11 @@ done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; -'') if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_void_p=0 - fi ;; + { (exit 77); exit 77; }; } ;; esac else cat >conftest.$ac_ext <<_ACEOF @@ -4556,7 +4798,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; + typedef void * ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -4615,25 +4857,21 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } - else - ac_cv_sizeof_void_p=0 - fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val +else + ac_cv_sizeof_void_p=0 +fi fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } - - - cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF @@ -4676,10 +4914,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 @@ -4693,15 +4948,16 @@ { echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 echo "${ECHO_T}$ac_cv_type_short" >&6; } -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of short" >&5 echo $ECHO_N "checking size of short... $ECHO_C" >&6; } if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + if test "$ac_cv_type_short" = yes; then + # The cast to long int works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4711,7 +4967,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; int main () { @@ -4735,10 +4991,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4748,7 +5021,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; int main () { @@ -4772,10 +5045,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 @@ -4802,7 +5092,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; + typedef short ac__type_sizeof_; int main () { @@ -4826,10 +5116,27 @@ rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try