Commit Graph

15065 Commits

Author SHA1 Message Date
Andrew Trick
11e4329154 Add pass printer passes in the right place.
The pass pointer should never be referenced after sending it to
schedulePass(), which may delete the pass. To fix this bug I had to
clean up the design leading to more goodness.

You may notice now that any non-analysis pass is printed. So things like loop-simplify and lcssa show up, while target lib, target data, alias analysis do not show up. Normally, analysis don't mutate the IR, but you can now check this by using both -print-after and -print-before. The effects of analysis will now show up in between the two.

The llc path is still in bad shape. But I'll be improving it in my next checkin. Meanwhile, print-machineinstrs still works the same way. With print-before/after, many llc passes that were not printed before now are, some of these should be converted to analysis. A few very important passes, isel and scheduler, are not properly initialized, so not printed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149480 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 07:16:20 +00:00
Andrew Trick
19c51a9b3e whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149479 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 07:16:17 +00:00
Argyrios Kyrtzidis
91766fe066 Revert Chris' commits up to r149348 that started causing VMCoreTests unit test to fail.
These are:

r149348
r149351
r149352
r149354
r149356
r149357
r149361
r149362
r149364
r149365

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149470 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 04:51:17 +00:00
Hal Finkel
de5e5ec304 Add a basic-block autovectorization pass.
This is the initial checkin of the basic-block autovectorization pass along with some supporting vectorization infrastructure.
Special thanks to everyone who helped review this code over the last several months (especially Tobias Grosser).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149468 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 03:51:43 +00:00
Bob Wilson
bda59fdd71 Add Triple::getMacOSXVersion to replace crufty code in the clang driver.
This new function provides a way to get the Mac OS X version number from
either generic "darwin" triples of macosx triples.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149438 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 22:32:29 +00:00
Manuel Klimek
41aa108f74 RefCountedBaseVPTR needs the IntrusiveRefCntPtrInfo as friend,
now that this handles the release / retain calls.

Adds a regression test for that bug (which is a compile-time
regression) and for the last two changes to the IntrusiveRefCntPtr,
especially tests for the memory leak due to copy construction of the
ref-counted object and ensuring that the traits are used for release /
retain calls.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149411 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 19:58:34 +00:00
Jim Grosbach
57cae881e2 Tidy up. Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149408 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 19:47:32 +00:00
Devang Patel
0db58bfece Add assembler dialect attribute in asm parser which lets target specific asm parser change dialect on the fly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149396 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 18:14:05 +00:00
Craig Topper
cac50c5ab8 Remove pcmpgt/pcmpeq intrinsics as clang is not using them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149367 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 06:52:44 +00:00
Chris Lattner
6a89228fac eliminate the "string" form of ConstantArray::get, using
ConstantDataArray::getString instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149365 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 06:18:43 +00:00
Chris Lattner
f98743a49d remove commented-out code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149364 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 06:17:26 +00:00
Chris Lattner
1b2f643753 with recent changes, ConstantArray is never a "string". Remove the associated
methods and constant fold the clients to false.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149362 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 06:05:00 +00:00
Chris Lattner
f0e1053a63 remove the last vestiges of llvm::GetConstantStringInfo, in CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149356 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 05:09:17 +00:00
Chandler Carruth
6f72ac4799 Add various coarse bit-width architecture predicates to llvm::Triple.
These are very useful for frontends and other utilities reasoning about
or selecting between triples.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149353 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 04:52:32 +00:00
Chris Lattner
3ef9cfef13 Change ConstantArray::get to form a ConstantDataArray when possible,
kicking in the big win of ConstantDataArray.  As part of this, change
the implementation of GetConstantStringInfo in ValueTracking to work
with ConstantDataArray (and not ConstantArray) making it dramatically,
amazingly, more efficient in the process and renaming it to 
getConstantStringInfo.

This keeps around a GetConstantStringInfo entrypoint that (grossly)
forwards to getConstantStringInfo and constructs the std::string 
required, but existing clients should move over to 
getConstantStringInfo instead.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149351 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 04:42:22 +00:00
Bill Wendling
efd564fbd6 Remove the now-dead llvm.eh.exception and llvm.eh.selector intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149331 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 01:58:48 +00:00
Bill Wendling
9a5c0e8d93 Remove the eh.exception and eh.selector intrinsics. Also remove a hack to copy
over the catch information. The catch information is now tacked to the invoke
instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149326 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 01:46:13 +00:00
Ted Kremenek
97cf71a517 Relax constructor for IntrusiveRefCntPtr to not be explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149309 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 00:57:08 +00:00
Ted Kremenek
0004d86704 Use traits for IntrusiveRefCntPtr to determine how to increment/decrement a reference count.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149308 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 00:57:04 +00:00
Bill Wendling
7750c3fc9f Add a constified getLandingPad() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149303 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 00:26:24 +00:00
Chris Lattner
8cf27efe40 Various improvements suggested by Duncan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149255 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 18:19:30 +00:00
Craig Topper
b9a2d6ff38 Add GCCBuiltin declarations for cmpsd/cmpss/cmppd/cmpps to allow custom code to be removed from clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149234 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 08:33:36 +00:00
Talin
babd5980d8 DenseMap::find_as() and unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149229 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 06:55:43 +00:00
Chris Lattner
57af41e78c initialize the Next field to null
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149217 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 01:17:43 +00:00
Chris Lattner
d408f06048 Add bitcode reader and writer support for ConstantDataAggregate, which
should be feature complete now.  Lets see if it works.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149215 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-30 00:51:16 +00:00
Chandler Carruth
f95b2dafc9 Cleanup the organization of some methods in llvm::Triple and provide
a better doxyment group for convenience predicates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149211 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 23:09:12 +00:00
Douglas Gregor
95fa4005f5 Move Clang's file-level locking facility over to LLVM's support
library, since it doesn't really have anything to do with Clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149203 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 20:15:10 +00:00
Jakob Stoklund Olesen
9f946a24d9 Fix some scavenger performance issues.
- Don't call malloc+free in the very hot forward().
- Don't call isTiedToDefOperand().
- Don't create BitVector temporaries.
- Merge DeadRegs into KillRegs.
- Eliminate the early clobber checks, they were irrelevant to scavenging.
- Remove unnecessary code from -Asserts builds.

This speeds up ARM PEI by 3.4x and overall llc -O0 codegen time by 11%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149189 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 01:29:28 +00:00
Jakob Stoklund Olesen
19de016955 Add a BitVector::reset(BitVector&) method.
The alternative LHS &= ~RHS is way too slow because it creates a
temporary that calls malloc/free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149187 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 01:29:22 +00:00
Rafael Espindola
04594aeffa Add r149110 back with a fix for when the vector and the int have the same
width.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149151 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 23:33:07 +00:00
Lang Hames
907cc8f38d Add a "moveInstr" method to LiveIntervals. This can be used to move instructions
around within a basic block while maintaining live-intervals.

Updated ScheduleTopDownLive in MachineScheduler.cpp to use the moveInstr API
when reordering MIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149147 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 22:36:19 +00:00
Jim Grosbach
a21bb20f59 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149137 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 18:35:03 +00:00
Jim Grosbach
ebd4c05c3c Better diagnostic for malformed .org assembly directive.
Provide source line number information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149101 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 00:37:08 +00:00
Jim Grosbach
82f4ce5081 Add simple support for keeping MCFixup source information.
Can be used to issue more user friendly diagnostics for faulty
relocation constructs and such.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149092 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 23:20:11 +00:00
Jim Grosbach
3662e5ce70 Add SourceMgr to MCContext for backend diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149090 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 23:20:05 +00:00
Chris Lattner
6b0dc92043 progress making the world safe to ConstantDataVector. While
we're at it, allow PatternMatch's "neg" pattern to match integer
vector negations, and enhance ComputeNumSigned bits to handle
shl of vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149082 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 21:37:55 +00:00
Chris Lattner
5b676ce793 tidy up forward declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149078 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 20:44:57 +00:00
Jakob Stoklund Olesen
1a96c91431 Clear kill flags before propagating a copy.
The live range of the source register may be extended when a redundant
copy is eliminated. Make sure any kill flags between the two copies are
cleared.

This fixes PR11765.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149069 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 17:52:15 +00:00
James Molloy
34982576a4 Add support for the R_ARM_TARGET1 relocation, which should be given to relocations applied to all C++ constructors and destructors.
This enables the linker to match concrete relocation types (absolute or relative) with whatever library or C++ support code is being linked against.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149057 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 09:25:43 +00:00
Chris Lattner
56243b89e7 eliminate the Constant::getVectorElements method. There are better (and
more robust) ways to do what it was doing now.  Also, add static methods
for decoding a ShuffleVector mask.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149028 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 02:51:13 +00:00
Chris Lattner
e150e2df42 Add a ConstantDataVector::getSplatValue() method, for parity with
ConstantVector.  Fix some outright bugs in the implementation of
ConstantArray and Constant struct, which would cause us to not make
one big UndefValue when asking for an array/struct with all undef
elements.  Enhance Constant::isAllOnesValue to work with
ConstantDataVector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149021 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 02:31:22 +00:00
Chris Lattner
27984e67f7 add StructType helpers too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149000 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 00:06:44 +00:00
Chris Lattner
6e3abaa77f Ok, break down and add some cast<>'ing helper methods to the Type class
to reduce the number of cast<>'s we have.  This allows someone to use
things like Ty->getVectorNumElements() instead of 
cast<VectorType>(Ty)->getNumElements() when you know that a type is a
vector.

It would be a great general cleanup to move the codebase to use these,
I will do so in the code I'm touching.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148999 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 00:01:10 +00:00
Chris Lattner
83694a984c add some helper methods to ShuffleVectorInst and enhance its
"isValidOperands" and "getMaskValue" methods to allow 
ConstantDataSequential.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148998 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 23:49:49 +00:00
Anton Korobeynikov
4a99f59aef Properly emit ctors / dtors with priorities into desired sections
and let linker handle the rest.

This finally fixes PR5329



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148990 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 22:24:19 +00:00
Evan Cheng
a15c9d84de Update hasProperty comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148936 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 07:38:48 +00:00
Chris Lattner
3d5ed2250e constify some methods and add a new Constant::getAggregateElement
helper method for the common operation of extracting an element
out of a constant aggregate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148931 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 06:16:32 +00:00
Chris Lattner
3c2c954e0b reapply r148901 with a crucial fix.
"Introduce a new ConstantVector::getSplat constructor function to 
simplify a really common case."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148924 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 05:19:54 +00:00
Craig Topper
bce73e0a8c Remove AVX 256-bit unaligned load intrinsics. 128-bit versions had been removed a while ago.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148922 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 04:42:03 +00:00
Argyrios Kyrtzidis
1ab525e857 Revert r148901 because it crashes llvm tests.
Original log:
    Introduce a new ConstantVector::getSplat constructor function to
    simplify a really common case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148906 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25 02:42:41 +00:00