oota-llvm.git
15 years agoMake Unix.h:MakeErrMsg separate the prefix and errno string, so we get:
Daniel Dunbar [Mon, 20 Apr 2009 20:50:13 +0000 (20:50 +0000)]
Make Unix.h:MakeErrMsg separate the prefix and errno string, so we get:

  clang: error: unable to make temporary file: /etc/cc: can't make
  unique filename: Permission denied

instead of

  clang: error: unable to make temporary file: /etc/cc: can't make
  unique filenamePermission denied

for example.

Also, audited the uses of MakeErrMsg to make the prefix strings
consistent (not end with newline/punctuation/space/": ").

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69626 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove unused variable.
Daniel Dunbar [Mon, 20 Apr 2009 20:34:38 +0000 (20:34 +0000)]
Remove unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69624 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove duplicated AddLiveIn function from X86 and ARM backends to be a method
Bob Wilson [Mon, 20 Apr 2009 18:36:57 +0000 (18:36 +0000)]
Move duplicated AddLiveIn function from X86 and ARM backends to be a method
in the MachineFunction class, renaming it to addLiveIn for consistency with
the same method in MachineBasicBlock.  Thanks for Anton for suggesting this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69615 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMatch C backend only if it explicitly requested.
Devang Patel [Mon, 20 Apr 2009 18:07:22 +0000 (18:07 +0000)]
Match C backend only if it explicitly requested.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69613 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove clang since its conditionally there already.
Tanya Lattner [Mon, 20 Apr 2009 17:48:16 +0000 (17:48 +0000)]
Remove clang since its conditionally there already.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69610 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevise my previous change 68996 as suggested by Duncan.
Bob Wilson [Mon, 20 Apr 2009 17:27:09 +0000 (17:27 +0000)]
Revise my previous change 68996 as suggested by Duncan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69607 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago- Remove an arbitrary spill weight tweak that should not have been there.
Evan Cheng [Mon, 20 Apr 2009 17:23:48 +0000 (17:23 +0000)]
- Remove an arbitrary spill weight tweak that should not have been there.
- Find more reloads from SS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69606 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEmit the auto variables of a function into a different section than parameters.
Sanjiv Gupta [Mon, 20 Apr 2009 16:59:35 +0000 (16:59 +0000)]
Emit the auto variables of a function into a different section than parameters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69605 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIt's not necessary for PrintModulePass to flush the output streams
Dan Gohman [Mon, 20 Apr 2009 16:26:25 +0000 (16:26 +0000)]
It's not necessary for PrintModulePass to flush the output streams
now that errs() is properly non-buffered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69602 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse .empty() instead of .size().
Dan Gohman [Mon, 20 Apr 2009 16:19:02 +0000 (16:19 +0000)]
Use .empty() instead of .size().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69599 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't discard an AssemblyAnnotationWriter when writing GlobalValues,
Dan Gohman [Mon, 20 Apr 2009 16:10:33 +0000 (16:10 +0000)]
Don't discard an AssemblyAnnotationWriter when writing GlobalValues,
which include Functions, where it can be quite useful to use an
AssemblyAnnotationWriter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69598 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThese bitfields were being miscompiled on some
Duncan Sands [Mon, 20 Apr 2009 16:03:21 +0000 (16:03 +0000)]
These bitfields were being miscompiled on some
64 bit platforms when building with optimization.
So replace them by a hand-coded implementation.
This fixes PR3822.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69597 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement operator<<(raw_ostream &OS, const Type &T).
Dan Gohman [Mon, 20 Apr 2009 15:55:38 +0000 (15:55 +0000)]
Implement operator<<(raw_ostream &OS, const Type &T).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69596 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdded a linearscan register allocation optimization. When the register allocator...
Evan Cheng [Mon, 20 Apr 2009 08:01:12 +0000 (08:01 +0000)]
Added a linearscan register allocation optimization. When the register allocator spill an interval with multiple uses in the same basic block, it creates a different virtual register for each of the reloads. e.g.

%reg1498<def> = MOV32rm %reg1024, 1, %reg0, 12, %reg0, Mem:LD(4,4) [sunkaddr39 + 0]
        %reg1506<def> = MOV32rm %reg1024, 1, %reg0, 8, %reg0, Mem:LD(4,4) [sunkaddr42 + 0]
        %reg1486<def> = MOV32rr %reg1506
        %reg1486<def> = XOR32rr %reg1486, %reg1498, %EFLAGS<imp-def,dead>
        %reg1510<def> = MOV32rm %reg1024, 1, %reg0, 4, %reg0, Mem:LD(4,4) [sunkaddr45 + 0]

=>

        %reg1498<def> = MOV32rm %reg2036, 1, %reg0, 12, %reg0, Mem:LD(4,4) [sunkaddr39 + 0]
        %reg1506<def> = MOV32rm %reg2037, 1, %reg0, 8, %reg0, Mem:LD(4,4) [sunkaddr42 + 0]
        %reg1486<def> = MOV32rr %reg1506
        %reg1486<def> = XOR32rr %reg1486, %reg1498, %EFLAGS<imp-def,dead>
        %reg1510<def> = MOV32rm %reg2038, 1, %reg0, 4, %reg0, Mem:LD(4,4) [sunkaddr45 + 0]

From linearscan's point of view, each of reg2036, 2037, and 2038 are separate registers, each is "killed" after a single use. The reloaded register is available and it's often clobbered right away. e.g. In thise case reg1498 is allocated EAX while reg2036 is allocated RAX. This means we end up with multiple reloads from the same stack slot in the same basic block.

Now linearscan recognize there are other reloads from same SS in the same BB. So it'll "downgrade" RAX (and its aliases) after reg2036 is allocated until the next reload (reg2037) is done. This greatly increase the likihood reloads from SS are reused.

This speeds up sha1 from OpenSSL by 5.8%. It is also an across the board win for SPEC2000 and 2006.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69585 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake all raw_ostreams support the tell() function.
Douglas Gregor [Mon, 20 Apr 2009 07:34:17 +0000 (07:34 +0000)]
Make all raw_ostreams support the tell() function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69583 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoBefore trying to introduce/eliminate cast/ext/trunc to make indices type as
Sanjiv Gupta [Mon, 20 Apr 2009 06:05:54 +0000 (06:05 +0000)]
Before trying to introduce/eliminate cast/ext/trunc to make indices type as
pointer type, make sure that the pointer size is a valid sequential index type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69574 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse an AssertingVH to detect the case where the Function was deleted but
Nick Lewycky [Sun, 19 Apr 2009 18:32:03 +0000 (18:32 +0000)]
Use an AssertingVH to detect the case where the Function was deleted but
freeMachineCodeForFunction was never called.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69531 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix missing text in doxygen documentation.
Nick Lewycky [Sun, 19 Apr 2009 18:20:21 +0000 (18:20 +0000)]
Fix missing text in doxygen documentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69529 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoNow that BUILD_VECTOR operands are allowed to be
Duncan Sands [Sun, 19 Apr 2009 06:40:30 +0000 (06:40 +0000)]
Now that BUILD_VECTOR operands are allowed to be
bigger than the vector element type, turn checking
of the operand type back on again, appropriately
adjusted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69516 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove the SimpleTy enumerated type field from the MVT
Duncan Sands [Sun, 19 Apr 2009 06:23:05 +0000 (06:23 +0000)]
Remove the SimpleTy enumerated type field from the MVT
value type union: this field was causing problems for
some compilers on 64 bit systems, presumably because
SimpleTy is 32 bits wide while the other fields are
64 bits wide.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69515 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd some assertions.
Mikhail Glushenkov [Sun, 19 Apr 2009 00:22:35 +0000 (00:22 +0000)]
Add some assertions.

Fixes segfaults in some corner cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69494 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevert 69474 and 69475. They are causing failures during a bootstrap on Darwin.
Bill Wendling [Sat, 18 Apr 2009 21:45:27 +0000 (21:45 +0000)]
Revert 69474 and 69475. They are causing failures during a bootstrap on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69478 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoReconfigure.
Mikhail Glushenkov [Sat, 18 Apr 2009 20:55:55 +0000 (20:55 +0000)]
Reconfigure.

Turns out that doing this by hand is easier than using autoreconf:-).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69475 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a configure check for llvm-gcc (reapply).
Mikhail Glushenkov [Sat, 18 Apr 2009 20:55:28 +0000 (20:55 +0000)]
Add a configure check for llvm-gcc (reapply).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69474 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agotestcase for PR3898
Chris Lattner [Sat, 18 Apr 2009 20:49:22 +0000 (20:49 +0000)]
testcase for PR3898

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69473 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PR3898, which manifests as failures on are an Xcore,
Chris Lattner [Sat, 18 Apr 2009 20:48:07 +0000 (20:48 +0000)]
Fix PR3898, which manifests as failures on are an Xcore,
patch by Jakob Stoklund Olesen!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69472 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't try to make BUILD_VECTOR operands have the same
Duncan Sands [Sat, 18 Apr 2009 20:16:54 +0000 (20:16 +0000)]
Don't try to make BUILD_VECTOR operands have the same
type as the vector element type: allow them to be of
a wider integer type than the element type all the way
through the system, and not just as far as LegalizeDAG.
This should be safe because it used to be this way
(the old type legalizer would produce such nodes), so
backends should be able to handle it.  In fact only
targets which have legal vector types with an illegal
promoted element type will ever see this (eg: <4 x i16>
on ppc).  This fixes a regression with the new type
legalizer (vec_splat.ll).  Also, treat SCALAR_TO_VECTOR
the same as BUILD_VECTOR.  After all, it is just a
special case of BUILD_VECTOR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69467 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGeneralize to support more ARM types.
Nick Lewycky [Sat, 18 Apr 2009 18:11:26 +0000 (18:11 +0000)]
Generalize to support more ARM types.

Configure was not actually regenerated, but the change last time only touched
this one line, so I'm being lazy and cheating by fixing it manually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69453 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a ScalarEvolution::getCouldNotCompute() function, and use it
Dan Gohman [Sat, 18 Apr 2009 17:58:19 +0000 (17:58 +0000)]
Add a ScalarEvolution::getCouldNotCompute() function, and use it
instead of allocating and leaking new SCEVCouldNotCompute objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69452 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore const qualifiers.
Dan Gohman [Sat, 18 Apr 2009 17:57:20 +0000 (17:57 +0000)]
More const qualifiers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69451 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse more const qualifiers with SCEV interfaces.
Dan Gohman [Sat, 18 Apr 2009 17:56:28 +0000 (17:56 +0000)]
Use more const qualifiers with SCEV interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69450 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRegenerate.
Nick Lewycky [Sat, 18 Apr 2009 15:41:38 +0000 (15:41 +0000)]
Regenerate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69447 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDetect beagleboard as ARM. The $target is "armv7l".
Nick Lewycky [Sat, 18 Apr 2009 15:34:25 +0000 (15:34 +0000)]
Detect beagleboard as ARM. The $target is "armv7l".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69446 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake it clearer that llvm-gcc is not needed for
Duncan Sands [Sat, 18 Apr 2009 12:40:19 +0000 (12:40 +0000)]
Make it clearer that llvm-gcc is not needed for
building llvm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69441 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTemporarily revert r69438 and r69439. These were causing failures during a
Bill Wendling [Sat, 18 Apr 2009 11:20:33 +0000 (11:20 +0000)]
Temporarily revert r69438 and r69439. These were causing failures during a
release build of llvm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69440 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRegenerate.
Mikhail Glushenkov [Sat, 18 Apr 2009 09:59:26 +0000 (09:59 +0000)]
Regenerate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69439 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a configure check for llvm-gcc.
Mikhail Glushenkov [Sat, 18 Apr 2009 09:57:58 +0000 (09:57 +0000)]
Add a configure check for llvm-gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69438 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a new LiveInterval::overlaps(). It checks if the live interval overlaps a range...
Evan Cheng [Sat, 18 Apr 2009 08:52:15 +0000 (08:52 +0000)]
Add a new LiveInterval::overlaps(). It checks if the live interval overlaps a range specified by [Start, End).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69434 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixed a few 64 bit cases in X86InstrInfo::commuteInstruction
Mon P Wang [Sat, 18 Apr 2009 05:16:01 +0000 (05:16 +0000)]
Fixed a few 64 bit cases in  X86InstrInfo::commuteInstruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69417 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdjust XFAIL syntax, maybe that will help. The other
Dale Johannesen [Sat, 18 Apr 2009 02:01:23 +0000 (02:01 +0000)]
Adjust XFAIL syntax, maybe that will help.  The other
way worked for me...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69414 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agopatch 69408 breaks this by removing the opportunity
Dale Johannesen [Sat, 18 Apr 2009 00:11:50 +0000 (00:11 +0000)]
patch 69408 breaks this by removing the opportunity
for the optimization it's testing to kick in (although
it improves the code, getting rid of all spills).
I don't understand the optimization well enough to
rescue the test, so XFAILing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69409 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoInline asm's were still introducing bogus dependencies;
Dale Johannesen [Sat, 18 Apr 2009 00:09:40 +0000 (00:09 +0000)]
Inline asm's were still introducing bogus dependencies;
my earlier patch to this code only fixed half of it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69408 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove trailing whitespace
Jim Grosbach [Fri, 17 Apr 2009 23:30:55 +0000 (23:30 +0000)]
remove trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69402 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRecommit r69335 and r69336. These were not causing problems.
Bill Wendling [Fri, 17 Apr 2009 22:40:38 +0000 (22:40 +0000)]
Recommit r69335 and r69336. These were not causing problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69394 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove the AddLiveIn function definition closer to its uses.
Bob Wilson [Fri, 17 Apr 2009 20:42:34 +0000 (20:42 +0000)]
Move the AddLiveIn function definition closer to its uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69382 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRearrange code to reduce indentation.
Bob Wilson [Fri, 17 Apr 2009 20:40:45 +0000 (20:40 +0000)]
Rearrange code to reduce indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69381 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRename file to have the correct suffix.
Bob Wilson [Fri, 17 Apr 2009 20:40:20 +0000 (20:40 +0000)]
Rename file to have the correct suffix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69380 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoClean up formatting, remove trailing whitespace, fix comment typos and
Bob Wilson [Fri, 17 Apr 2009 20:35:10 +0000 (20:35 +0000)]
Clean up formatting, remove trailing whitespace, fix comment typos and
punctuation.  No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69378 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDelete an unused field.
Dan Gohman [Fri, 17 Apr 2009 20:03:31 +0000 (20:03 +0000)]
Delete an unused field.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69375 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse CallConvLower.h and TableGen descriptions of the calling conventions
Bob Wilson [Fri, 17 Apr 2009 19:07:39 +0000 (19:07 +0000)]
Use CallConvLower.h and TableGen descriptions of the calling conventions
for ARM.  Patch by Sandeep Patel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69371 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate information on canadian cross builds
Jim Grosbach [Fri, 17 Apr 2009 17:25:16 +0000 (17:25 +0000)]
Update information on canadian cross builds

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69358 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse a safer iterator interface and get rid of std C++ library misuse.
David Greene [Fri, 17 Apr 2009 14:56:18 +0000 (14:56 +0000)]
Use a safer iterator interface and get rid of std C++ library misuse.
This fixes a --enable-expensive-checks problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69353 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRegenerate configure.
David Greene [Fri, 17 Apr 2009 14:50:39 +0000 (14:50 +0000)]
Regenerate configure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69352 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a --enable-profiling option to configure to build Debug+Profile and
David Greene [Fri, 17 Apr 2009 14:49:22 +0000 (14:49 +0000)]
Add a --enable-profiling option to configure to build Debug+Profile and
Opt+Profile tools.  Now we can profile any kind of flavor we build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69351 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFor general dynamic TLS access we must use
Rafael Espindola [Fri, 17 Apr 2009 14:35:58 +0000 (14:35 +0000)]
For general dynamic TLS access we must use

leaq foo@TLSGD(%rip), %rdi

as part of the instruction sequence. Using a register other than %rdi and then
copying it to %rdi is not valid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69350 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevert r69335 and r69336. They were causing build failures.
Bill Wendling [Fri, 17 Apr 2009 04:19:22 +0000 (04:19 +0000)]
Revert r69335 and r69336. They were causing build failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69347 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't create ConstantInts with pointer type. This fixes a
Dan Gohman [Fri, 17 Apr 2009 02:02:52 +0000 (02:02 +0000)]
Don't create ConstantInts with pointer type. This fixes a
regression in 403.gcc in PIC_CODEGEN=1 and DISABLE_LTO=1
mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69344 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTeach spiller to unfold instructions which modref spill slot when a scratch
Evan Cheng [Fri, 17 Apr 2009 01:29:40 +0000 (01:29 +0000)]
Teach spiller to unfold instructions which modref spill slot when a scratch
register is available and when it's profitable.

e.g.
     xorq  %r12<kill>, %r13
     addq  %rax, -184(%rbp)
     addq  %r13, -184(%rbp)
==>
     xorq  %r12<kill>, %r13
     movq  -184(%rbp), %r12
     addq  %rax, %r12
     addq  %r13, %r12
     movq  %r12, -184(%rbp)

Two more instructions, but fewer memory accesses. It can also open up
opportunities for more optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69341 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMOV8rr_NOREX is a "Move" instruction. This doesn't currently
Dan Gohman [Fri, 17 Apr 2009 00:45:17 +0000 (00:45 +0000)]
MOV8rr_NOREX is a "Move" instruction. This doesn't currently
matter, because this instruction isn't generated until after
things that care.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69336 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't use MOV8rr_NOREX on x86-32. It doesn't actually hurt anything at
Dan Gohman [Fri, 17 Apr 2009 00:43:09 +0000 (00:43 +0000)]
Don't use MOV8rr_NOREX on x86-32. It doesn't actually hurt anything at
present, but it's inconsistent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69335 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix some failures in targets on available_externally functions,
Chris Lattner [Fri, 17 Apr 2009 00:26:12 +0000 (00:26 +0000)]
Fix some failures in targets on available_externally functions,
this fixes a crash on CodeGen/Generic/externally_available.ll
on ppc hosts.  Thanks to Nicholas L for pointing this out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69333 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse TargetData::getTypeSizeInBits instead of getPrimitiveSizeInBits()
Dan Gohman [Thu, 16 Apr 2009 22:35:57 +0000 (22:35 +0000)]
Use TargetData::getTypeSizeInBits instead of getPrimitiveSizeInBits()
to get the correct answer for pointer types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69321 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PR3994: LLVMMatchType arguments do not refer to absolute return value
Bob Wilson [Thu, 16 Apr 2009 21:51:05 +0000 (21:51 +0000)]
Fix PR3994: LLVMMatchType arguments do not refer to absolute return value
and argument positions but only to the overloaded intrinsic parameters.
Keep a separate list of these overloaded parameters in CodeGenTarget.cpp
so they can be resolved easily.  Remove assertions from IntrinsicEmitter.cpp:
they were harmless but confusing, and the assertions elsewhere in TableGen
will catch any incorrect values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69316 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake sure to unlock keymgr if the JIT is created and destroyed, all
Chris Lattner [Thu, 16 Apr 2009 21:47:59 +0000 (21:47 +0000)]
make sure to unlock keymgr if the JIT is created and destroyed, all
locks must be matched with unlocks.  Also, use calloc to allocate the
block so that it is properly zero'd.  Thanks to Nick Kledzik for
tracking this down.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69314 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a comment to describe LLVMMatchType.
Bob Wilson [Thu, 16 Apr 2009 21:46:42 +0000 (21:46 +0000)]
Add a comment to describe LLVMMatchType.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69313 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix for PR3944: make mem2reg O(N) instead of O(N^2) in the number of
Eli Friedman [Thu, 16 Apr 2009 21:40:28 +0000 (21:40 +0000)]
Fix for PR3944: make mem2reg O(N) instead of O(N^2) in the number of
incoming edges for a block with many predecessors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69312 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHandle a pointer type correctly in SCEVExpander::visitAddRecExpr.
Dan Gohman [Thu, 16 Apr 2009 21:34:54 +0000 (21:34 +0000)]
Handle a pointer type correctly in SCEVExpander::visitAddRecExpr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69310 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIn the list-burr's pseudo two-addr dependency heuristics, don't
Dan Gohman [Thu, 16 Apr 2009 20:59:02 +0000 (20:59 +0000)]
In the list-burr's pseudo two-addr dependency heuristics, don't
add dependencies on nodes with exactly one successor which is a
COPY_TO_REGCLASS node. In the case that the copy is coalesced
away, the dependence should be on the user of the copy, rather
than the copy itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69309 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHandle SUBREG_TO_REG instructions with the same heuristics
Dan Gohman [Thu, 16 Apr 2009 20:57:10 +0000 (20:57 +0000)]
Handle SUBREG_TO_REG instructions with the same heuristics
as INSERT_SUBREG instructions in the list-burr scheduler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69308 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix a bug with inttoptr/ptrtoint casts where the pointer has a different
Dan Gohman [Thu, 16 Apr 2009 19:25:55 +0000 (19:25 +0000)]
Fix a bug with inttoptr/ptrtoint casts where the pointer has a different
size from the integer, requiring zero extension or truncation. Don't
create ZExtInsts with pointer types. This fixes a regression in
consumer-jpeg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69307 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDo not treat beginning of inlined scope as beginning of normal function scope if...
Devang Patel [Thu, 16 Apr 2009 17:55:30 +0000 (17:55 +0000)]
Do not treat beginning of inlined scope as beginning of normal function scope if the location info is missing.

Insetad of doing ...
if (inlined_subroutine && known_location)
  DW_TAG_inline_subroutine
else
  DW_TAG_subprogram

do

if (inlined_subroutine) {
 if (known_location)
   DW_TAG_inline_subroutine
} else {
 DW_TAG_subprogram
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69300 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMinor code simplifications. Don't attempt LSR on theoretical
Dan Gohman [Thu, 16 Apr 2009 16:49:48 +0000 (16:49 +0000)]
Minor code simplifications. Don't attempt LSR on theoretical
targets with pointers larger than 64 bits, due to the code not
yet being APInt clean.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69296 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoLSR is no longer a GEP optimizer. It is now an IV expression
Dan Gohman [Thu, 16 Apr 2009 16:46:01 +0000 (16:46 +0000)]
LSR is no longer a GEP optimizer. It is now an IV expression
optimizer, which just happen to frequently involve optimizing GEPs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69295 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix SCEVExpander::visitSMaxExpr and SCEVExpander::visitUMaxExpr to
Dan Gohman [Thu, 16 Apr 2009 16:15:25 +0000 (16:15 +0000)]
Fix SCEVExpander::visitSMaxExpr and SCEVExpander::visitUMaxExpr to
not create ICmpInsts with operands of different types. This fixes
a regression in Applications/d/make_dparser.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69294 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTeach SCEVExpander::InsertCastOfTo to avoid creating inttoptr-of-ptrtoint
Dan Gohman [Thu, 16 Apr 2009 15:52:57 +0000 (15:52 +0000)]
Teach SCEVExpander::InsertCastOfTo to avoid creating inttoptr-of-ptrtoint
and ptrtoint-of-inttoptr expressions. This fixes a regression in 300.twolf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69293 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse ConstantExpr::getIntToPtr instead of SCEVExpander::InsertCastOfTo,
Dan Gohman [Thu, 16 Apr 2009 15:48:38 +0000 (15:48 +0000)]
Use ConstantExpr::getIntToPtr instead of SCEVExpander::InsertCastOfTo,
since the operand is always a constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69291 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse a SCEV expression cast instead of immediately inserting a
Dan Gohman [Thu, 16 Apr 2009 15:47:35 +0000 (15:47 +0000)]
Use a SCEV expression cast instead of immediately inserting a
new instruction with SCEVExpander::InsertCastOfTo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69290 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRecord line number at the beginning of a func.start.
Devang Patel [Thu, 16 Apr 2009 15:07:09 +0000 (15:07 +0000)]
Record line number at the beginning of a func.start.

This line was accidently lost yesterday.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69286 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix PR3995. A scale must be 1, 2, 4 or 8.
Rafael Espindola [Thu, 16 Apr 2009 12:34:53 +0000 (12:34 +0000)]
fix PR3995. A scale must be 1, 2, 4 or 8.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69284 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoprove diagnostic -> group mapping information.
Chris Lattner [Thu, 16 Apr 2009 05:52:18 +0000 (05:52 +0000)]
prove diagnostic -> group mapping information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69270 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoExpand GEPs in ScalarEvolution expressions. SCEV expressions can now
Dan Gohman [Thu, 16 Apr 2009 03:18:22 +0000 (03:18 +0000)]
Expand GEPs in ScalarEvolution expressions. SCEV expressions can now
have pointer types, though in contrast to C pointer types, SCEV
addition is never implicitly scaled. This not only eliminates the
need for special code like IndVars' EliminatePointerRecurrence
and LSR's own GEP expansion code, it also does a better job because
it lets the normal optimizations handle pointer expressions just
like integer expressions.

Also, since LLVM IR GEPs can't directly index into multi-dimensional
VLAs, moving the GEP analysis out of client code and into the SCEV
framework makes it easier for clients to handle multi-dimensional
VLAs the same way as other arrays.

Some existing regression tests show improved optimization.
test/CodeGen/ARM/2007-03-13-InstrSched.ll in particular improved to
the point where if-conversion started kicking in; I turned it off
for this test to preserve the intent of the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69258 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoencode subgroups into the clang .inc file. -Wall now works!
Chris Lattner [Thu, 16 Apr 2009 03:16:12 +0000 (03:16 +0000)]
encode subgroups into the clang .inc file.  -Wall now works!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69257 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIn -fast mode do what FastISel does.
Devang Patel [Thu, 16 Apr 2009 02:33:41 +0000 (02:33 +0000)]
In -fast mode do what FastISel does.
This code could use some refactoring help!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69254 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIf FastISel is run and it has known DebugLoc then use it.
Devang Patel [Thu, 16 Apr 2009 01:33:10 +0000 (01:33 +0000)]
If FastISel is run and it has known DebugLoc then use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69253 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIf location where the function was inlined is not know then do not emit debug info...
Devang Patel [Thu, 16 Apr 2009 01:31:54 +0000 (01:31 +0000)]
If location where the function was inlined is not know then do not emit debug info describing inlinied region.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69252 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agostart producing subgroup info.
Chris Lattner [Thu, 16 Apr 2009 00:53:25 +0000 (00:53 +0000)]
start producing subgroup info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69249 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAnother testcase for IV shortening.
Dale Johannesen [Thu, 16 Apr 2009 00:45:21 +0000 (00:45 +0000)]
Another testcase for IV shortening.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69247 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEliminate zext over (iv | const) or (signed iv),
Dale Johannesen [Wed, 15 Apr 2009 23:31:51 +0000 (23:31 +0000)]
Eliminate zext over (iv | const) or (signed iv),
and sext over (iv | const), if a longer iv is
available.  Allow expressions to have more than
one zext/sext parent.  All from OpenSSL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69241 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake sure that empty diag groups get known by clang.
Chris Lattner [Wed, 15 Apr 2009 22:33:02 +0000 (22:33 +0000)]
make sure that empty diag groups get known by clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69235 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimplement support for writing out diagnostic group tables.
Chris Lattner [Wed, 15 Apr 2009 20:55:08 +0000 (20:55 +0000)]
implement support for writing out diagnostic group tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69219 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agos/RootDbgScope/FunctionDbgScope/g
Devang Patel [Wed, 15 Apr 2009 20:41:31 +0000 (20:41 +0000)]
s/RootDbgScope/FunctionDbgScope/g

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69216 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEliminate zext over (iv & const) or ((iv+const)&const)
Dale Johannesen [Wed, 15 Apr 2009 20:41:02 +0000 (20:41 +0000)]
Eliminate zext over (iv & const) or ((iv+const)&const)
if a longer iv is available.  These subscript forms are
not common; they're a bottleneck in OpenSSL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69215 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agouse UppercaseString instead of EmitAllCaps
Chris Lattner [Wed, 15 Apr 2009 20:16:12 +0000 (20:16 +0000)]
use UppercaseString instead of EmitAllCaps

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69213 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agouse escape string.
Chris Lattner [Wed, 15 Apr 2009 20:13:18 +0000 (20:13 +0000)]
use escape string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69212 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoteach EscapeString and UnescapeString to handle ".
Chris Lattner [Wed, 15 Apr 2009 20:12:52 +0000 (20:12 +0000)]
teach EscapeString and UnescapeString to handle ".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69211 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd DISubprogram is not null check.
Devang Patel [Wed, 15 Apr 2009 20:11:08 +0000 (20:11 +0000)]
Add DISubprogram is not null check.
This fixes test/CodeGen//2009-01-21-invalid-debug-info.m test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69210 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGeneralize one of the SelectionDAG::ReplaceAllUsesWith overloads
Dan Gohman [Wed, 15 Apr 2009 20:06:30 +0000 (20:06 +0000)]
Generalize one of the SelectionDAG::ReplaceAllUsesWith overloads
to support replacing a node with another that has a superset of
the result types. Use this instead of calling
ReplaceAllUsesOfValueWith for each value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69209 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename -gen-clang-diags-options -> -gen-clang-diag-groups
Chris Lattner [Wed, 15 Apr 2009 20:02:32 +0000 (20:02 +0000)]
rename -gen-clang-diags-options -> -gen-clang-diag-groups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69208 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomove clang-specific makefile goop to clang makefile.
Chris Lattner [Wed, 15 Apr 2009 19:57:42 +0000 (19:57 +0000)]
move clang-specific makefile goop to clang makefile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69206 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix 80-column violations.
Dan Gohman [Wed, 15 Apr 2009 19:48:57 +0000 (19:48 +0000)]
Fix 80-column violations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69204 91177308-0d34-0410-b5e6-96231b3b80d8