oota-llvm.git
15 years agoImplement multiclass inheritance.
David Greene [Wed, 22 Apr 2009 16:42:54 +0000 (16:42 +0000)]
Implement multiclass inheritance.

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

15 years agoSimplify trivial cast-of-cast SCEVs.
Dan Gohman [Wed, 22 Apr 2009 16:20:48 +0000 (16:20 +0000)]
Simplify trivial cast-of-cast SCEVs.

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

15 years agoSCEVExpander's InsertCastOfTo knows how to move existing cast
Dan Gohman [Wed, 22 Apr 2009 16:11:16 +0000 (16:11 +0000)]
SCEVExpander's InsertCastOfTo knows how to move existing cast
instructions in order to avoid inserting new ones. However, if
the cast instruction is the SCEVExpander's InsertPt, this
causes subsequently emitted instructions to be inserted near
the cast, and not at the location of the original insert point.
Fix this by adjusting the insert point in such cases.
This fixes PR4009.

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

15 years agoUse BasicBlock::iterator instead of Instruction* for insert points,
Dan Gohman [Wed, 22 Apr 2009 16:05:50 +0000 (16:05 +0000)]
Use BasicBlock::iterator instead of Instruction* for insert points,
to better handle inserting instructions at the end of a block.

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

15 years agoMake SCEVExpanders private methods private, instead of protected.
Dan Gohman [Wed, 22 Apr 2009 16:00:36 +0000 (16:00 +0000)]
Make SCEVExpanders private methods private, instead of protected.

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

15 years agoUse CloneModule's ValueMap in more places, instead of looking
Dan Gohman [Wed, 22 Apr 2009 15:57:18 +0000 (15:57 +0000)]
Use CloneModule's ValueMap in more places, instead of looking
up functions by name.

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

15 years agoISD::ADD_PARTS is gone; use ISD::SMUL_LOHI as an example instead.
Dan Gohman [Wed, 22 Apr 2009 15:55:31 +0000 (15:55 +0000)]
ISD::ADD_PARTS is gone; use ISD::SMUL_LOHI as an example instead.

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

15 years agoMake the function begin label start after ther data pointer.
Sanjiv Gupta [Wed, 22 Apr 2009 12:02:36 +0000 (12:02 +0000)]
Make the function begin label start after ther data pointer.
The address of data frame for function can be obtained by subtracting 2 from the function begin label.

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

15 years agoThese tests are x86 specific.
Duncan Sands [Wed, 22 Apr 2009 10:39:51 +0000 (10:39 +0000)]
These tests are x86 specific.

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

15 years agoReal fix for PR3549, by using caching for predecessor counts in addition to the prede...
Owen Anderson [Wed, 22 Apr 2009 08:50:12 +0000 (08:50 +0000)]
Real fix for PR3549, by using caching for predecessor counts in addition to the predecessors themselves.  This halves the time
to optimize the testcase, beyond what my previous patch did.

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

15 years agoAdd caching of predecessor counts as well as predecessors themselves.
Owen Anderson [Wed, 22 Apr 2009 08:46:33 +0000 (08:46 +0000)]
Add caching of predecessor counts as well as predecessors themselves.

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

15 years agoUse PredIteratorCache in LCSSA, which gives a 37% overall speedup on the testcase...
Owen Anderson [Wed, 22 Apr 2009 08:09:13 +0000 (08:09 +0000)]
Use PredIteratorCache in LCSSA, which gives a 37% overall speedup on the testcase from PR3549.  More improvements to come.

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

15 years agoFix for PR3946, in which SmallVector could behave strangely in corner cases.
Owen Anderson [Wed, 22 Apr 2009 07:16:54 +0000 (07:16 +0000)]
Fix for PR3946, in which SmallVector could behave strangely in corner cases.

Patch by Peter Johnson.

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

15 years agouse predicate instead of hand-rolled loop
Chris Lattner [Tue, 21 Apr 2009 23:37:18 +0000 (23:37 +0000)]
use predicate instead of hand-rolled loop

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

15 years agoDe-pImpl-ify ScalarEvolution. The pImpl pattern doesn't provide much
Dan Gohman [Tue, 21 Apr 2009 23:15:49 +0000 (23:15 +0000)]
De-pImpl-ify ScalarEvolution. The pImpl pattern doesn't provide much
practical benefit in the case of ScalarEvolution, and it's otherwise
a nuisance.

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

15 years agoIt has finally happened. Spiller is now using live interval info.
Evan Cheng [Tue, 21 Apr 2009 22:46:52 +0000 (22:46 +0000)]
It has finally happened. Spiller is now using live interval info.

This fixes a very subtle bug. vr defined by an implicit_def is allowed overlap with any register since it doesn't actually modify anything. However, if it's used as a two-address use, its live range can be extended and it can be spilled. The spiller must take care not to emit a reload for the vn number that's defined by the implicit_def. This is both a correctness and performance issue.

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

15 years agoWhen turning (ashr(shl(x, n), n)) into sext(trunc(x)), the width of the
Dan Gohman [Tue, 21 Apr 2009 20:18:36 +0000 (20:18 +0000)]
When turning (ashr(shl(x, n), n)) into sext(trunc(x)), the width of the
type to truncate to should be the number of bits of the value that are
preserved, not the number that are clobbered with sign-extension.
This fixes regressions in ldecod.

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

15 years agoSupport --with-llvmgccdir and friends in llvmc, take 2.
Mikhail Glushenkov [Tue, 21 Apr 2009 19:46:10 +0000 (19:46 +0000)]
Support --with-llvmgccdir and friends in llvmc, take 2.

Should now work when building with objdir != srcdir and when llvm-gcc is not
available.

Thanks to Duncan Sands for testing and advice!

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

15 years agoTest case for revision 69683.
Devang Patel [Tue, 21 Apr 2009 17:21:01 +0000 (17:21 +0000)]
Test case for revision 69683.

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

15 years agofix a crash on a pointless but valid zero-length memset, rdar://6808691
Chris Lattner [Tue, 21 Apr 2009 16:52:12 +0000 (16:52 +0000)]
fix a crash on a pointless but valid zero-length memset, rdar://6808691

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

15 years agoSilence warnings.
Anton Korobeynikov [Tue, 21 Apr 2009 16:04:56 +0000 (16:04 +0000)]
Silence warnings.

Patch by Jay Foad!

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

15 years agoDrop obsolete reference to __eprintf.
Anton Korobeynikov [Tue, 21 Apr 2009 16:04:41 +0000 (16:04 +0000)]
Drop obsolete reference to __eprintf.

Patch by Jay Foad!

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

15 years ago'The "or die" is intended to catch the case where nm returned a
Anton Korobeynikov [Tue, 21 Apr 2009 16:04:14 +0000 (16:04 +0000)]
'The "or die" is intended to catch the case where nm returned a
non-zero exit status, so nm will already have printed some error
messages.'

Patch by Jay Foad!

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

15 years agoGet rid of what looks like a copy-and-pasted typo.
Duncan Sands [Tue, 21 Apr 2009 09:44:39 +0000 (09:44 +0000)]
Get rid of what looks like a copy-and-pasted typo.
Spotted by gcc-4.5.

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

15 years agoTLS_addr64 and TLS_addr32 define RDI and EAX. They don't use them.
Rafael Espindola [Tue, 21 Apr 2009 08:22:09 +0000 (08:22 +0000)]
TLS_addr64 and TLS_addr32 define RDI and EAX. They don't use them.
This fixes PR4002.

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

15 years agoHandle direct aggregate type arguments.
Sanjiv Gupta [Tue, 21 Apr 2009 05:54:51 +0000 (05:54 +0000)]
Handle direct aggregate type arguments.

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

15 years agoTeach ScalarEvolution how to recognize zext-inreg and sext-inreg,
Dan Gohman [Tue, 21 Apr 2009 02:26:00 +0000 (02:26 +0000)]
Teach ScalarEvolution how to recognize zext-inreg and sext-inreg,
as they appear in LLVM IR. This isn't particularly interesting
on its own; this is just setting up some infrastructure.

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

15 years agoThis FIXME is fixed, now that SCEV understands pointers.
Dan Gohman [Tue, 21 Apr 2009 01:41:18 +0000 (01:41 +0000)]
This FIXME is fixed, now that SCEV understands pointers.

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

15 years agoFactor out a common base class from SCEVTruncateExpr, SCEVZeroExtendExpr,
Dan Gohman [Tue, 21 Apr 2009 01:25:57 +0000 (01:25 +0000)]
Factor out a common base class from SCEVTruncateExpr, SCEVZeroExtendExpr,
and SCEVSignExtendExpr.

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

15 years agoUsage getAnalysisToUpdate for TargetData, per PR760.
Dan Gohman [Tue, 21 Apr 2009 01:11:19 +0000 (01:11 +0000)]
Usage getAnalysisToUpdate for TargetData, per PR760.

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

15 years agoIntroduce encapsulation for ScalarEvolution's TargetData object, and refactor
Dan Gohman [Tue, 21 Apr 2009 01:07:12 +0000 (01:07 +0000)]
Introduce encapsulation for ScalarEvolution's TargetData object, and refactor
the code to minimize dependencies on TargetData.

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

15 years agoMove some assertion checks so they can do more complete checking.
Dan Gohman [Tue, 21 Apr 2009 00:55:22 +0000 (00:55 +0000)]
Move some assertion checks so they can do more complete checking.

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

15 years agoConvert ScalarEvolution to use raw_ostream instead of OStream.
Dan Gohman [Tue, 21 Apr 2009 00:47:46 +0000 (00:47 +0000)]
Convert ScalarEvolution to use raw_ostream instead of OStream.

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

15 years agoFix Visual Studio 2008 build failure.
Devang Patel [Tue, 21 Apr 2009 00:08:56 +0000 (00:08 +0000)]
Fix Visual Studio 2008 build failure.
Patch by Marius Wachtler

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

15 years agoMake X86's copyRegToReg able to handle copies to and from subclasses.
Dan Gohman [Mon, 20 Apr 2009 22:54:34 +0000 (22:54 +0000)]
Make X86's copyRegToReg able to handle copies to and from subclasses.
This makes the extra copyRegToReg calls in ScheduleDAGSDNodesEmit.cpp
unnecessary. Derived from a patch by Jakob Stoklund Olesen.

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

15 years agoSimplify this code. getConstant knows how to make
Dan Gohman [Mon, 20 Apr 2009 22:51:43 +0000 (22:51 +0000)]
Simplify this code. getConstant knows how to make
broadcasted vector constants.

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

15 years agoNo, we are not avoiding -O3, just -fstrict-aliasing.
Evan Cheng [Mon, 20 Apr 2009 22:49:59 +0000 (22:49 +0000)]
No, we are not avoiding -O3, just -fstrict-aliasing.

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

15 years agoAdjust loop size estimate for full unrolling;
Dale Johannesen [Mon, 20 Apr 2009 22:19:33 +0000 (22:19 +0000)]
Adjust loop size estimate for full unrolling;
GEP's don't usually become instructions.

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

15 years agoOne Mac OS X, just build with -O3 but without -fstrict-aliasing (which is kinda broken).
Evan Cheng [Mon, 20 Apr 2009 22:16:40 +0000 (22:16 +0000)]
One Mac OS X, just build with -O3 but without -fstrict-aliasing (which is kinda broken).

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

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