Commit Graph

45954 Commits

Author SHA1 Message Date
Bob Wilson f8b85477ae 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.

llvm-svn: 69615
2009-04-20 18:36:57 +00:00
Devang Patel 958d5eb032 Match C backend only if it explicitly requested.
llvm-svn: 69613
2009-04-20 18:07:22 +00:00
Tanya Lattner a1eeaff125 Remove clang since its conditionally there already.
llvm-svn: 69610
2009-04-20 17:48:16 +00:00
Bob Wilson da188ebbbd Revise my previous change 68996 as suggested by Duncan.
llvm-svn: 69607
2009-04-20 17:27:09 +00:00
Evan Cheng 5dd2e29b67 - Remove an arbitrary spill weight tweak that should not have been there.
- Find more reloads from SS.

llvm-svn: 69606
2009-04-20 17:23:48 +00:00
Sanjiv Gupta 0fcc019d36 Emit the auto variables of a function into a different section than parameters.
llvm-svn: 69605
2009-04-20 16:59:35 +00:00
Dan Gohman f7db87f2dc It's not necessary for PrintModulePass to flush the output streams
now that errs() is properly non-buffered.

llvm-svn: 69602
2009-04-20 16:26:25 +00:00
Dan Gohman 59ceb59f5b Use .empty() instead of .size().
llvm-svn: 69599
2009-04-20 16:19:02 +00:00
Dan Gohman 6c7a485c19 Don't discard an AssemblyAnnotationWriter when writing GlobalValues,
which include Functions, where it can be quite useful to use an
AssemblyAnnotationWriter.

llvm-svn: 69598
2009-04-20 16:10:33 +00:00
Duncan Sands 0c58fa5080 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.

llvm-svn: 69597
2009-04-20 16:03:21 +00:00
Dan Gohman 5fe6b530a5 Implement operator<<(raw_ostream &OS, const Type &T).
llvm-svn: 69596
2009-04-20 15:55:38 +00:00
Evan Cheng d67efaa847 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.

llvm-svn: 69585
2009-04-20 08:01:12 +00:00
Douglas Gregor b231e5791e Make all raw_ostreams support the tell() function.
llvm-svn: 69583
2009-04-20 07:34:17 +00:00
Sanjiv Gupta 428d490332 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.

llvm-svn: 69574
2009-04-20 06:05:54 +00:00
Nick Lewycky 0575dbb692 Use an AssertingVH to detect the case where the Function was deleted but
freeMachineCodeForFunction was never called.

llvm-svn: 69531
2009-04-19 18:32:03 +00:00
Nick Lewycky fc5571337e Fix missing text in doxygen documentation.
llvm-svn: 69529
2009-04-19 18:20:21 +00:00
Duncan Sands f2e7133d34 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.

llvm-svn: 69516
2009-04-19 06:40:30 +00:00
Duncan Sands 3da896d861 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.

llvm-svn: 69515
2009-04-19 06:23:05 +00:00
Mikhail Glushenkov c48ede23bd Add some assertions.
Fixes segfaults in some corner cases.

llvm-svn: 69494
2009-04-19 00:22:35 +00:00
Bill Wendling 4d10aae8c2 Revert 69474 and 69475. They are causing failures during a bootstrap on Darwin.
llvm-svn: 69478
2009-04-18 21:45:27 +00:00
Mikhail Glushenkov d497a8bae1 Reconfigure.
Turns out that doing this by hand is easier than using autoreconf:-).

llvm-svn: 69475
2009-04-18 20:55:55 +00:00
Mikhail Glushenkov 73e9e021f1 Add a configure check for llvm-gcc (reapply).
llvm-svn: 69474
2009-04-18 20:55:28 +00:00
Chris Lattner 1e7da23983 testcase for PR3898
llvm-svn: 69473
2009-04-18 20:49:22 +00:00
Chris Lattner 7b01e66443 Fix PR3898, which manifests as failures on are an Xcore,
patch by Jakob Stoklund Olesen!

llvm-svn: 69472
2009-04-18 20:48:07 +00:00
Duncan Sands e4ff21ba4b 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.

llvm-svn: 69467
2009-04-18 20:16:54 +00:00
Nick Lewycky 13590cb204 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.

llvm-svn: 69453
2009-04-18 18:11:26 +00:00
Dan Gohman 31efa3098f Add a ScalarEvolution::getCouldNotCompute() function, and use it
instead of allocating and leaking new SCEVCouldNotCompute objects.

llvm-svn: 69452
2009-04-18 17:58:19 +00:00
Dan Gohman 927e90c716 More const qualifiers.
llvm-svn: 69451
2009-04-18 17:57:20 +00:00
Dan Gohman 056857aa21 Use more const qualifiers with SCEV interfaces.
llvm-svn: 69450
2009-04-18 17:56:28 +00:00
Nick Lewycky 19fac3cf3c Regenerate.
llvm-svn: 69447
2009-04-18 15:41:38 +00:00
Nick Lewycky 3a33c705ef Detect beagleboard as ARM. The $target is "armv7l".
llvm-svn: 69446
2009-04-18 15:34:25 +00:00
Duncan Sands 10961cd40a Make it clearer that llvm-gcc is not needed for
building llvm.

llvm-svn: 69441
2009-04-18 12:40:19 +00:00
Bill Wendling 02b47d9958 Temporarily revert r69438 and r69439. These were causing failures during a
release build of llvm.

llvm-svn: 69440
2009-04-18 11:20:33 +00:00
Mikhail Glushenkov 4308aa5272 Regenerate.
llvm-svn: 69439
2009-04-18 09:59:26 +00:00
Mikhail Glushenkov e078105a89 Add a configure check for llvm-gcc.
llvm-svn: 69438
2009-04-18 09:57:58 +00:00
Evan Cheng b685be0c1e Add a new LiveInterval::overlaps(). It checks if the live interval overlaps a range specified by [Start, End).
llvm-svn: 69434
2009-04-18 08:52:15 +00:00
Mon P Wang 6c8bcf9da1 Fixed a few 64 bit cases in X86InstrInfo::commuteInstruction
llvm-svn: 69417
2009-04-18 05:16:01 +00:00
Dale Johannesen 2f6263fea3 Adjust XFAIL syntax, maybe that will help. The other
way worked for me...

llvm-svn: 69414
2009-04-18 02:01:23 +00:00
Dale Johannesen e34fb6b5ce 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.

llvm-svn: 69409
2009-04-18 00:11:50 +00:00
Dale Johannesen ad968ee286 Inline asm's were still introducing bogus dependencies;
my earlier patch to this code only fixed half of it.

llvm-svn: 69408
2009-04-18 00:09:40 +00:00
Jim Grosbach 8d62763779 remove trailing whitespace
llvm-svn: 69402
2009-04-17 23:30:55 +00:00
Bill Wendling 06684350c4 Recommit r69335 and r69336. These were not causing problems.
llvm-svn: 69394
2009-04-17 22:40:38 +00:00
Bob Wilson b0b10f8bf6 Move the AddLiveIn function definition closer to its uses.
llvm-svn: 69382
2009-04-17 20:42:34 +00:00
Bob Wilson deeaf70dad Rearrange code to reduce indentation.
llvm-svn: 69381
2009-04-17 20:40:45 +00:00
Bob Wilson 9c1ec76084 Rename file to have the correct suffix.
llvm-svn: 69380
2009-04-17 20:40:20 +00:00
Bob Wilson ea09d4aca8 Clean up formatting, remove trailing whitespace, fix comment typos and
punctuation.  No functional changes.

llvm-svn: 69378
2009-04-17 20:35:10 +00:00
Dan Gohman b47514dfe8 Delete an unused field.
llvm-svn: 69375
2009-04-17 20:03:31 +00:00
Bob Wilson a4c2290e5f Use CallConvLower.h and TableGen descriptions of the calling conventions
for ARM.  Patch by Sandeep Patel.

llvm-svn: 69371
2009-04-17 19:07:39 +00:00
Jim Grosbach 7da1b90597 Update information on canadian cross builds
llvm-svn: 69358
2009-04-17 17:25:16 +00:00
David Greene 22fa407ed7 Use a safer iterator interface and get rid of std C++ library misuse.
This fixes a --enable-expensive-checks problem.

llvm-svn: 69353
2009-04-17 14:56:18 +00:00