Commit Graph

53070 Commits

Author SHA1 Message Date
Aaron Ballman
da32e46936 Fixing warning due to the new "UTD return type in extern 'C'".
Patch by Matt Johnson

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150508 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 21:29:32 +00:00
Bill Wendling
b464d3ff72 Add code to the target lowering object file module to handle module flags.
The MachO back-end needs to emit the garbage collection flags specified in the
module flags. This is a WIP, so the front-end hasn't been modified to emit these
flags just yet. Documentation and front-end switching to occur soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150507 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 21:28:13 +00:00
Lang Hames
03698deb25 Update MachineVerifier to check the new physreg live-in rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150496 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 19:17:48 +00:00
Lang Hames
342c64c904 Tighten physical register invariants: Allocatable physical registers can
only be live in to a block if it is the function entry point or a landing pad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150494 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 18:51:53 +00:00
Nadav Rotem
8b7c3d0ee4 Fix PR12000. Some vector operations may use scalar operands with types
that are greater than the vector element type. For example BUILD_VECTOR
of type <1 x i1> with a constant i8 operand.
This patch fixes the assertion.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150477 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 13:06:32 +00:00
Benjamin Kramer
fc52a52323 Turn push_back loops into append/insert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150471 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 10:29:27 +00:00
Bill Wendling
75b3d68867 Capitalize messages so that they appear nicely with the linker's error messages.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150466 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 09:13:54 +00:00
Craig Topper
233a64846e Move old movl vector_shuffle patterns. Not needed anymore since vector_shuffles shouldn't reach isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150462 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 08:14:53 +00:00
Lang Hames
0796134bde Rename getExceptionAddressRegister() to getExceptionPointerRegister() for consistency with setExceptionPointerRegister(...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150460 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 04:45:49 +00:00
Lang Hames
cd339b71ff Use convenience function for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150457 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 03:04:29 +00:00
Kostya Serebryany
3eccaa6625 [tsan] fix compiler warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150449 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 00:52:07 +00:00
Lang Hames
1a4cb1caf0 Third time's the charm...?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150447 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 00:34:30 +00:00
Lang Hames
6b0e9d97fa Unswap swap operands, partially reducing confusion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150444 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 00:17:12 +00:00
Andrew Trick
f6629ab847 Add simplifyLoopLatch to LoopRotate pass.
This folds a simple loop tail into a loop latch. It covers the common (in fortran) case of postincrement loops. It's a "free" way to expose this type of loop to downstream loop optimizations that bail out on non-canonical loops (getLoopLatch is a heavily used check).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150439 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 00:00:23 +00:00
Andrew Trick
c3a825b76c whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150438 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-14 00:00:19 +00:00
Bill Wendling
bdf9db6f49 Don't reserve the R0 and R1 registers here. We don't use these registers, and
marking them as "live-in" into a BB ruins some invariants that the back-end
tries to maintain.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150437 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 23:47:16 +00:00
Bill Wendling
150a371569 Don't recalculate the size of the vector each time through the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150436 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 23:45:26 +00:00
Lang Hames
2cc494b963 Make operands for VSWP read-modify-write.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150433 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 23:37:19 +00:00
Jakob Stoklund Olesen
16a7ff3165 Add register mask support to ScheduleDAGRRList.
The scheduler will sometimes check the implicit-def list on instructions
to properly handle pre-colored DAG edges.

Also check any register mask operands for physreg clobbers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150428 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 23:25:24 +00:00
Devang Patel
a2e0f6b643 Check against umin while converting fcmp into an icmp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150425 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 23:05:18 +00:00
Dan Gohman
a3b08d68bd Just like in regular escape analysis, loads and stores through
(but not of) a block pointer do not cause the block pointer to
escape. This fixes rdar://10803830.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150424 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 22:57:02 +00:00
Kostya Serebryany
60ebb1947f ThreadSanitizer, a race detector. First LLVM commit.
Clang patch (flags) will follow shortly.
The run-time library will also follow, but not immediately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150423 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 22:50:51 +00:00
Andrew Trick
d35576b3c0 LiveIntervalAnalysis does not depend on MachineLoopInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150411 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 20:44:42 +00:00
Jakob Stoklund Olesen
3ed4dee530 Check regmask interference for -join-physregs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150404 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 18:17:04 +00:00
Nadav Rotem
0877fdf30b Fix a bug in DAGCombine for the optimization of BUILD_VECTOR. We cant generate a shuffle node from two vectors of different types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150383 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 12:42:26 +00:00
Ahmed Charles
4a5d7e300e Remove duplicate code in this header file which seemed to undergo a copy/paste fiasco.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150369 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 09:45:36 +00:00
Craig Topper
7505626acd Still more vector_shuffle pattern removal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150365 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 07:23:41 +00:00
Ahmed Charles
b83a67e1e3 Fix various issues (or do cleanups) found by enabling certain MSVC warnings.
- Use unsigned literals when the desired result is unsigned. This mostly allows unsigned/signed mismatch warnings to be less noisy even if they aren't on by default.
- Remove misplaced llvm_unreachable.
- Add static to a declaration of a function on MSVC x86 only.
- Change some instances of calling a static function through a variable to simply calling that function while removing the unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150364 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 06:30:56 +00:00
Craig Topper
4eaca023dc Remove more vector_shuffle patterns for unpack. These should be target specific nodes when they get to isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150363 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 05:48:49 +00:00
Craig Topper
3b17bf9a7c Recommit r150328. Previous test failures should be fixed by r150360.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150362 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 05:10:10 +00:00
Craig Topper
2dcd718c13 Update CanXFormVExtractWithShuffleIntoLoad to ensure bitcasts of loads only have one use. Matches DAGCombiner and prevents vector_shuffles from reaching isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150360 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 04:30:38 +00:00
NAKAMURA Takumi
7f42e9886e Revert r150328, "Remove more vector_shuffle patterns."
It caused 3 failures on pre-penryn and non-x86(generic) hosts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150357 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 00:10:15 +00:00
Pete Cooper
ce3900849a Fixed bug when custom lowering DEC64m on x86.
If the DEC node had more than one user, it was doing this lowering but
leaving the original DEC node around and so decrementing twice.

Fixes PR11964.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150356 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-13 00:10:03 +00:00
Nadav Rotem
2ee746b87d This patch addresses the problem of poor code generation for the zext
v8i8 -> v8i32 on AVX machines. The codegen often scalarizes ANY_EXTEND nodes.
The DAGCombiner has two optimizations that can mitigate the problem. First,
if all of the operands of a BUILD_VECTOR node are extracted from an ZEXT/ANYEXT
nodes, then it is possible to create a new simplified BUILD_VECTOR which uses
UNDEFS/ZERO values to eliminate the scalar ZEXT/ANYEXT nodes.
Second, another dag combine optimization lowers BUILD_VECTOR into a shuffle
vector instruction.

In the case of zext v8i8->v8i32 on AVX, a value in an XMM register is to be
shuffled into a wide YMM register.

This patch modifes the second optimization and allows the creation of
shuffle vectors even when the newly generated vector and the original vector
from which we extract the values are of different types.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150340 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 15:05:31 +00:00
Benjamin Kramer
61c2c128f7 StringSwitchify the rest of Triple.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150332 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 10:56:52 +00:00
Chandler Carruth
06accdade8 Switch a bunch of manual if-chains to use StringSwitch. Clean them up in
the process. Some of these are still a bit gross.

Still, this cuts 80 some lines out of this ridiculous file. ;]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150331 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 09:27:38 +00:00
Craig Topper
cc9231a05d Remove more vector_shuffle patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150328 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 08:14:35 +00:00
Eli Bendersky
f4eff4baeb Expose the ELFObjectFile class directly in the Object/ELF.h header, similarly
to what's done for MachO and COFF. This allows advanced uses of the class to
be implemented outside the Object library. In particular, the DyldELFObject
subclass is now moved into its logical home - ExecutionEngine/RuntimeDyld.

This patch was reviewed by Michael Spencer.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150327 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 06:12:10 +00:00
Nick Lewycky
132bd9ce56 Handle InvokeInst in EvaluateBlock. Don't try to support exceptions, it's just
that no optz'ns have run yet to convert invokes to calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150326 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 05:09:35 +00:00
Nick Lewycky
6f160d3d78 false is totally null!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150324 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 02:17:18 +00:00
Nick Lewycky
6a7df9aae6 Remove redundant getAnalysis<> calls in GlobalOpt. Add a few Itanium ABI calls
to TargetLibraryInfo and use one of them in GlobalOpt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150323 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 02:15:20 +00:00
Nick Lewycky
6a577f82ba Pass TargetData and TargetLibraryInfo through to the constant folder. Fixes a
few fixme's when TLI was added.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150322 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 01:13:18 +00:00
Craig Topper
26f927951b Remove more vector_shuffle patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150321 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 01:07:34 +00:00
Nick Lewycky
db292a6f7f Fix function name in comment to match actual name. Fix comments that are using
doxy-style on local variables to not do so. Fix one 80-col violation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150320 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 00:52:26 +00:00
Nick Lewycky
8e4ba6b954 Don't traverse the PHI nodes twice. No functionality change!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150319 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-12 00:47:24 +00:00
Craig Topper
1f2fa99b2a Remove more vector_shuffle patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150314 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 23:31:01 +00:00
Anton Korobeynikov
d4a19b6a72 Add support for implicit TLS model used with MS VC runtime.
Patch by Kai Nacke!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150307 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 17:26:53 +00:00
Benjamin Kramer
6b30274e27 Don't mix declarations and code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150305 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 16:01:02 +00:00
Benjamin Kramer
88b6fc06db Make the EDis tables const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150304 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 14:51:07 +00:00
Benjamin Kramer
953362cdfb Reuse the enum names from X86Desc in the X86Disassembler.
This requires some gymnastics to make it available for C code. Remove the names
from the disassembler tables, making them relocation free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150303 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 14:50:54 +00:00
Bill Wendling
d34cb1e09f [WIP] Initial code for module flags.
Module flags are key-value pairs associated with the module. They include a
'behavior' value, indicating how module flags react when mergine two
files. Normally, it's just the union of the two module flags. But if two module
flags have the same key, then the resulting flags are dictated by the behaviors.

Allowable behaviors are:

     Error
       Emits an error if two values disagree.

     Warning
       Emits a warning if two values disagree.

     Require
       Emits an error when the specified value is not present
       or doesn't have the specified value. It is an error for
       two (or more) llvm.module.flags with the same ID to have
       the Require behavior but different values. There may be
       multiple Require flags per ID.

     Override
       Uses the specified value if the two values disagree. It
       is an error for two (or more) llvm.module.flags with the
       same ID to have the Override behavior but different
       values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150300 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 11:38:06 +00:00
Craig Topper
a819c397e7 Remove some patterns for matching vector_shuffle instructions since vector_shuffles should be custom lowered before isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150299 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 07:43:35 +00:00
Andrew Trick
746f24b732 Add TargetPassConfig hooks for scheduling/bundling.
In case the MachineScheduling pass I'm working on doesn't work well
for another target, they can completely override it. This also adds a
hook immediately after the RegAlloc pass to cleanup immediately after
vregs go away. We may want to fold it into the postRA hook later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150298 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 07:11:32 +00:00
Craig Topper
39a9e485f2 Fix shuffle lowering code to stop creating temporary DAG nodes to do shuffle mask checks on. This seemed to be confusing things such that vector_shuffle ops to got through to iselection. This is another step towards removing the vector_shuffle handling patterns from isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150296 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 06:24:48 +00:00
Jakob Stoklund Olesen
5637379000 Allow Post-RA LICM to hoist reserved register reads.
When using register masks, registers like %rip are clobbered by the
register mask. LICM should still be able to hoist instructions reading
%rip from a loop containing calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150288 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 00:44:19 +00:00
Jakob Stoklund Olesen
a6d513f474 Handle register masks in local live range splitting.
Again the goal is to produce identical assembly with register mask
operands enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150287 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 00:42:18 +00:00
Jakob Stoklund Olesen
fd3d4cf0ef Don't read PreRegAlloc before it is initialized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150286 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11 00:40:36 +00:00
Jim Grosbach
f06dfa7860 Revert r150222, as the clang driver now handles this properly.
Now that the clang driver passes the CPU and feature information to
the backend when processing assembly files (150273), this isn't necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150274 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 20:38:46 +00:00
Jakob Stoklund Olesen
938200859e Add a static MachineOperand::clobbersPhysReg().
It can be necessary to detach a register mask pointer from its
MachineOperand. This method is convenient for checking clobbered
physregs on a detached bitmask pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150261 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 19:23:53 +00:00
Jakob Stoklund Olesen
6ef7da0197 Add register mask support to InterferenceCache.
This makes global live range splitting behave identically with and
without register mask operands.

This is not necessarily the best way of using register masks for live
range splitting.  It would be more efficient to first split global live
ranges around calls (i.e., register masks), and reserve the fine grained
per-physreg interference guidance for global live ranges that do not
cross calls.

For now the goal is to produce identical assembly when enabling register
masks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150259 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 18:58:34 +00:00
Jakob Stoklund Olesen
3bf7a1cc3c Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150258 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 18:52:15 +00:00
Jason W Kim
1de886c1fa Make valgrind happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150251 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 16:07:59 +00:00
Hal Finkel
38a7f22445 Update BBVectorize to use aliasesUnknownInst.
This allows BBVectorize to check the "unknown instruction" list in the
alias sets. This is important to prevent instruction fusing from reordering
function calls. Resolves PR11920.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150250 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 15:52:40 +00:00
Hal Finkel
ce0dd7314b Have AliasSet::aliasesUnknownInst use pointer TBAA info when available
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150249 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 15:52:39 +00:00
Duncan Sands
aa97bb54f0 Fix PR11948: the result type of an icmp may be a vector of boolean -
don't assume it is a boolean.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150247 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 14:31:24 +00:00
Benjamin Kramer
c667ba69ac Put instruction names into an indexed string table on the side, removing a pointer from MCInstrDesc.
Make them accessible through MCInstrInfo. They are only used for debugging purposes so this doesn't
have an impact on performance. X86MCTargetDesc.o goes from 630K to 461K on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150245 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 13:18:44 +00:00
Andrew Trick
06efdd238e comment grammar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150233 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 07:08:25 +00:00
Andrew Trick
4a5f3cd6ca unnecessary include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150228 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 04:10:44 +00:00
Andrew Trick
1e9bcb3b1f PTX no longer needs to provide its own backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150227 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 04:10:40 +00:00
Andrew Trick
8dd26253f5 RegAlloc superpass: includes phi elimination, coalescing, and scheduling.
Creates a configurable regalloc pipeline.

Ensure specific llc options do what they say and nothing more: -reglloc=... has no effect other than selecting the allocator pass itself. This patch introduces a new umbrella flag, "-optimize-regalloc", to enable/disable the optimizing regalloc "superpass". This allows for example testing coalscing and scheduling under -O0 or vice-versa.

When a CodeGen pass requires the MachineFunction to have a particular property, we need to explicitly define that property so it can be directly queried rather than naming a specific Pass. For example, to check for SSA, use MRI->isSSA, not addRequired<PHIElimination>.

CodeGen transformation passes are never "required" as an analysis

ProcessImplicitDefs does not require LiveVariables.

We have a plan to massively simplify some of the early passes within the regalloc superpass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150226 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 04:10:36 +00:00
Andrew Trick
16f72dd686 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150225 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 04:10:26 +00:00
Lang Hames
4465b6f6b2 Remove unused 'isAlias' parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150224 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 03:19:36 +00:00
Jim Grosbach
e009860049 ARM on darwin, v6 implies the presence of VFP for the assembler.
rdar://10838899

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150222 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 02:21:49 +00:00
Jakob Stoklund Olesen
9f10ac63a3 Constrain the regmask search space for local live ranges.
When checking a local live range for interference, restrict the binary
search to the single block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150220 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 01:31:31 +00:00
Jakob Stoklund Olesen
34e85d0307 Cache basic block boundaries for faster RegMaskSlots access.
Provide API to get a list of register mask slots and bits in a basic
block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150219 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 01:26:29 +00:00
Jakob Stoklund Olesen
ebf2750a70 Optimize LiveIntervals::intervalIsInOneMBB().
No looping and binary searches necessary.

Return a pointer to the containing block instead of just a bool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150218 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 01:23:55 +00:00
Benjamin Kramer
f378f5fae3 Cache iterators. Some of these are expensive to create.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150214 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-10 00:28:31 +00:00
David Blaikie
58604cd944 Change default error_code ctor to a 'named ctor' so it's more self-documenting.
Unify default construction of error_code uses on this idiom so that users don't
feel compelled to make static globals for naming convenience. (unfortunately I
couldn't make the original ctor private as some APIs don't return their result,
instead using an out parameter (that makes sense to default construct) - which
is a bit of a pity. I did, however, find/fix some cases of unnecessary default
construction of error_code before I hit the unfixable cases)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150197 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 19:24:12 +00:00
Jakob Stoklund Olesen
e7c2c15b0c Add register mask support to RAGreedy.
This only adds the interference checks required for correctness.
We still need to take advantage of register masks for the
interference driven live range splitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150191 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 18:25:05 +00:00
Benjamin Kramer
c1322a13b5 Tweak comment readability and grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150183 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 16:28:15 +00:00
Sirish Pande
b9f69a41fc Test for commit access.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150178 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 15:20:33 +00:00
Benjamin Kramer
d469274743 GlobalOpt: Be more aggressive about elminating side-effect free static dtors.
GlobalOpt runs early in the pipeline (before inlining) and complex class
hierarchies often introduce bitcasts or GEPs which weren't optimized away.
Teach it to ignore side-effect free instructions instead of depending on
other passes to remove them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150174 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 14:26:06 +00:00
James Molloy
3015dfb7d7 Teach the MC and disassembler about SoftFail, and hook it up to UNPREDICTABLE on ARM. Wire this to tBLX in order to provide test coverage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150169 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 10:56:31 +00:00
Craig Topper
f41ab77847 More tweaks to get the size of the X86 disassembler tables down.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150167 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 08:58:07 +00:00
Craig Topper
ce8f4c58d8 Flatten some of the arrays in the X86 disassembler tables to reduce space needed to store pointers on 64-bit hosts and reduce relocations needed at startup. Part of PR11953.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150161 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 07:45:30 +00:00
Lang Hames
72a043f9d6 Preserve physreg kills in MachineBasicBlock::SplitCriticalEdge.
Failure to preserve kills was causing LiveIntervals to miss some EFLAGS live
ranges. Unfortunately I've been unable to reduce a good test case yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150152 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 05:59:36 +00:00
Lang Hames
fb08b90bf4 Fix kill flags when moving instructions using LiveIntervals::moveInstr(...).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150150 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 04:45:38 +00:00
Lang Hames
394d712711 Remove assertion. Not all use operands are reads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150149 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 04:39:48 +00:00
Andrew Trick
f7b96311d2 Improve TargetPassConfig. No intended functionality.
Split CodeGen into stages.
Distinguish between optimization and correctness.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150122 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 00:40:55 +00:00
Andrew Trick
78b2961f4d comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150121 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 00:40:52 +00:00
David Blaikie
4eebfb8b39 Remove static initializer from DataStream.cpp
If someone would prefer a clear name for the 'success' error_value we could
come up with one - potentially just a 'named constructor' style
'error_value::success()' to make this expression more self-documenting. If
I see this come up in other cases I'll certainly consider it.

One step along the way to resolving PR11944.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150120 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 00:29:19 +00:00
Jakob Stoklund Olesen
f56ce53124 Erase dead copies that are clobbered by a call.
This does make a difference, at least when using RABasic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150118 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 00:19:08 +00:00
Jakob Stoklund Olesen
450b3850ce Handle register masks when searching for EFLAGS clobbers.
Calls clobber the flags, but when using register masks there is no
EFLAGS<imp-def> operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150117 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 00:17:22 +00:00
Jakob Stoklund Olesen
39284d191a Never delete instructions that define reserved registers.
I think this was already the intention, but DeadMachineInstructionElim
was accidentally tracking the liveness of reserved registers. Now,
instructions with reserved defs are never deleted.

This prevents the call stack adjustment instructions from getting
deleted when enabling register masks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150116 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-09 00:15:39 +00:00
Jakob Stoklund Olesen
a8fc171b3f Handle register masks in MachineCopyPropagation.
For simplicity, treat calls with register masks as basic block
boundaries.  This means we can't copy propagate callee-saved registers
across calls, but I don't think that is a big deal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150108 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 22:37:35 +00:00
Kostya Serebryany
95e3cf44a9 [asan] unpoison the stack before every noreturn call. Fixes asan issue 37. llvm part
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150102 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 21:36:17 +00:00
Andrew Trick
1dd8c8560d Codegen pass definition cleanup. No functionality.
Moving toward a uniform style of pass definition to allow easier target configuration.
Globally declare Pass ID.
Globally declare pass initializer.
Use INITIALIZE_PASS consistently.
Add a call to the initializer from CodeGen.cpp.
Remove redundant "createPass" functions and "getPassName" methods.

While cleaning up declarations, cleaned up comments (sorry for large diff).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150100 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 21:23:13 +00:00
Andrew Trick
9d41bd5c78 Move pass configuration out of pass constructors: MachineLICM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150099 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 21:23:03 +00:00
Andrew Trick
9f17cf625d whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150098 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 21:23:00 +00:00
Andrew Trick
32986572bf Move pass configuration out of pass constructors: StackSlotColoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150097 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 21:22:57 +00:00
Andrew Trick
c7d081b594 Move pass configuration out of pass constructors: PostRAScheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150096 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 21:22:53 +00:00
Andrew Trick
61f1e3db43 Move pass configuration out of pass constructors: BranchFolderPass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150095 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 21:22:48 +00:00
Andrew Trick
1df91b0e54 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150094 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 21:22:43 +00:00
Andrew Trick
ffea03f216 Added TargetPassConfig::setOpt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150093 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 21:22:39 +00:00
Andrew Trick
ebe18ef5c2 Added Pass::createPass(ID) to handle pass configuration by ID
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150092 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 21:22:34 +00:00
Andrew Trick
d2a7bedbc9 Move pass configuration out of pass constructors: TailDuplicate::PreRegAlloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150091 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 21:22:30 +00:00
Jakob Stoklund Olesen
a94e635cec Add Register mask support to RABasic.
When a virtual register is live across a call, limit the search space to
call-preserved registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150081 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 18:54:35 +00:00
Brendon Cahoon
c635ebdb1a Use TSFlag bit to describe instruction properties.
Creating the isPredicated TSFlag enables the code
to use the property defined in the instruction format
instead of using a large switch statement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150078 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 18:25:47 +00:00
Jakob Stoklund Olesen
3fd3a840c5 Keep track of register masks in LiveIntervalAnalysis.
Build an ordered vector of register mask operands (i.e., calls) when
computing live intervals. Provide a checkRegMaskInterference() function
that computes a bit mask of usable registers for a live range.

This is a quick way of determining of a live range crosses any calls,
and restricting it to the callee saved registers if it does.
Previously, we had to discover call clobbers for each candidate register
independently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150077 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 17:33:45 +00:00
Duncan Sands
8c160548ce Use Use::set rather than finding the operand number of the use
and setting that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150074 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 14:10:53 +00:00
Benjamin Kramer
80fd2a1972 PathV2: Remove static StringRef ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150071 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 13:13:47 +00:00
Elena Demikhovsky
f602040c49 Fixed a bug in printing "cmp" pseudo ops.
> This IR code
> %res = call <8 x float> @llvm.x86.avx.cmp.ps.256(<8 x float> %a0, <8 x float> %a1, i8 14)
> fails with assertion:
>
> llc: X86ATTInstPrinter.cpp:62: void llvm::X86ATTInstPrinter::printSSECC(const llvm::MCInst*, unsigned int, llvm::raw_ostream&): Assertion `0 && "Invalid ssecc argument!"' failed.
> 0  llc             0x0000000001355803
> 1  llc             0x0000000001355dc9
> 2  libpthread.so.0 0x00007f79a30575d0
> 3  libc.so.6       0x00007f79a23a1945 gsignal + 53
> 4  libc.so.6       0x00007f79a23a2f21 abort + 385
> 5  libc.so.6       0x00007f79a239a810 __assert_fail + 240
> 6  llc             0x00000000011858d5 llvm::X86ATTInstPrinter::printSSECC(llvm::MCInst const*, unsigned int, llvm::raw_ostream&) + 119

I added the full testing for all possible pseudo-ops of cmp.
I extended X86AsmPrinter.cpp and X86IntelInstPrinter.cpp.

You'l also see lines alignments (unrelated to this fix) in X86IselLowering.cpp from my previous check-in.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150068 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 08:37:26 +00:00
Craig Topper
bc0e4bf754 Remove a couple unneeded intrinsic patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150067 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 08:29:30 +00:00
Craig Topper
5a313bb7e8 Remove GCC builtins for vpermilp* intrinsics as clang no longer needs them. Custom lower the intrinsics to the vpermilp target specific node and remove intrinsic patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150060 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 06:36:57 +00:00
Chad Rosier
743e19983e [fast-isel] Add support for SUBs with non-legal types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150047 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 02:45:44 +00:00
Chad Rosier
6fde875621 [fast-isel] Add support for ORs with non-legal types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150045 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 02:29:21 +00:00
Andrew Trick
99a7a13f4a Added MachineInstr::isBundled() to check if an instruction is part of a bundle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150044 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 02:17:25 +00:00
Andrew Trick
291411c7a1 misched: bug in debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150043 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 02:17:21 +00:00
Andrew Trick
ea4312722b stale comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150041 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 02:17:16 +00:00
Eric Christopher
4fe3457292 Add support for a temporary forward decl type. We want this so we
can rauw forward declarations if we decide to emit the full type.

Part of rdar://10809898

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150024 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 00:22:26 +00:00
Devang Patel
9f99721a18 Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150022 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08 00:17:07 +00:00
Chad Rosier
60c8fa6bb9 [fast-isel] Add support for indirect branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150014 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 23:56:08 +00:00
Devang Patel
30d409ca09 Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150012 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 23:33:58 +00:00
Evan Cheng
de1df103b9 Use LEA to adjust stack ptr for Atom. Patch by Andy Zhang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150008 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 22:50:41 +00:00
David Blaikie
ebba0558c8 Correct use of const in ParseCommandLineOptions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149999 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 19:36:01 +00:00
Evan Cheng
4ee1c5cf6c Do not fold ADD / SUB into load / store (to form pre-indexed, post-indexed
load / store) if the ADD / SUB has a live definition of CPSR.

Bug reported by David Meyer. Alas, no test case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149970 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 07:09:28 +00:00
Craig Topper
dbd98a4b1b Add instruction selection for 256-bit VPSHUFD and 128-bit VPERMILPS/VPERMILPD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149968 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 06:28:42 +00:00
Craig Topper
858143816d Convert assert(0) to llvm_unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149967 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 05:05:23 +00:00
Craig Topper
bc2198133a Convert assert(0) to llvm_unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149961 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 02:50:20 +00:00
Bill Wendling
c5de7fea7b Cache the sizes of vectors instead of calculating them all over the place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149954 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 01:48:12 +00:00
Bill Wendling
a7a3f04eb9 Reserve space in these vectors to prevent having to grow the array too
much. This gets us an addition 0.9% on 445.gobmk.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149952 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 01:27:51 +00:00
Derek Schuff
eb446511ce Fix win32 build breakage from bitcode streaming patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149941 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07 00:28:46 +00:00
Chad Rosier
3901c3e750 [fast-isel] Add support for ADDs with non-legal types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149934 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 23:50:07 +00:00
Andrew Trick
25600cf50d Expose TargetPassConfig to PEI Pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149927 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 22:51:18 +00:00
Andrew Trick
6939fde29c Add TargetPassConfig to the PassManager for use inside passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149926 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 22:51:15 +00:00
Kostya Serebryany
0ca032b03d The patch resolves the conflict between AddressSanitizer and load widening (GVN).
The problem initially reported by Mozilla folks (http://code.google.com/p/address-sanitizer/issues/detail?id=20),
but it also prevents us from enabling LLVM bootstrap with AddressSanitizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149925 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 22:48:56 +00:00
Nick Lewycky
44ebf8b033 Fix comment-rulers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149922 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 22:41:47 +00:00
Jakob Stoklund Olesen
fb5d511c0d Don't explicitly renumber slot indices.
We have automatic local renumbering now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149920 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 22:37:56 +00:00
Derek Schuff
2ea93875b2 Enable streaming of bitcode
This CL delays reading of function bodies from initial parse until
materialization, allowing overlap of compilation with bitcode download.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149918 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 22:30:29 +00:00
Chris Lattner
7302d80490 Remove some dead code and tidy things up now that vectors use ConstantDataVector
instead of always using ConstantVector.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149912 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 21:56:39 +00:00
Jakob Stoklund Olesen
602cb9d9f2 Make sure a reserved register has a live interval before merging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149910 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 21:52:18 +00:00
Bill Wendling
8833ef03b9 [unwind removal] Remove all of the code for the dead 'unwind' instruction. There
were no 'unwind' instructions being generated before this, so this is in effect
a no-op.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149906 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 21:44:22 +00:00
Bill Wendling
3e9719e1f3 [unwind removal] Don't write out the dead 'unwind' instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149905 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 21:30:37 +00:00
Bill Wendling
aa5abe88d6 [unwind removal] We no longer have 'unwind' instructions being generated, so
remove the code that handles them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149901 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 21:16:41 +00:00
Bill Wendling
0f96817d01 'unwind' is a keyword, not an instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149898 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 21:02:43 +00:00
Bill Wendling
e185fada9b [unwind removal] Remove the 'unwind' instruction parsing bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149897 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 20:50:27 +00:00
Chandler Carruth
7d5a289f2d Introduce helpers to compute the 32-bit varaints and 64-bit variants of
some architectures. These are useful for interacting with multiarch or
bi-arch GCC (or GCC-based) toolchains.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149895 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 20:46:33 +00:00
Derek Schuff
fccf0623ee Test commit; also removes some trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149887 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 19:03:04 +00:00
Devang Patel
6588abf377 DebugInfo: Provide a new hook to encode relationship between a property and an ivar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149874 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 17:49:43 +00:00
Benjamin Kramer
699ddcbcb3 X86: Don't call malloc for 4 bits. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149866 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 12:06:18 +00:00
Benjamin Kramer
7ba962fe4a Make helper static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149865 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 11:28:19 +00:00
Benjamin Kramer
f3fd7ee415 Hexagon: Remove forbidden iostream includes (it introduces static initializers)
Reorder includes while at it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149863 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 10:19:29 +00:00
Nick Lewycky
da82fd411e Split part of EvaluateFunction into a new EvaluateBlock method. No functionality
change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149861 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 08:24:44 +00:00
Craig Topper
aae875c27c Move some llvm_unreachable's from r149849 out of switch statements to satisfy -Wcovered-switch-default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149860 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 08:17:43 +00:00
Craig Topper
d156dc11f9 Add shuffle decoding support for 256-bit pshufd. Merge vpermilp* and pshufd decoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149859 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 07:17:51 +00:00
Sebastian Pop
1230ad6e8c fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149857 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 05:29:32 +00:00
Sebastian Pop
41a2600f6a fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149856 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 05:29:29 +00:00
Craig Topper
50bee42b54 Convert assert(0) to llvm_unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149849 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 22:14:15 +00:00
Talin
2cb395eae7 Efficient Constant Uniquing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149848 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 20:54:10 +00:00
Nick Lewycky
fad4d40f37 Teach GlobalOpt to handle atomic accesses to globals.
* Most of the transforms come through intact by having each transformed load or
store copy the ordering and synchronization scope of the original.
 * The transform that turns a global only accessed in main() into an alloca
(since main is non-recursive) with a store of the initial value uses an
unordered store, since it's guaranteed to be the first thing to happen in main.
(Threads may have started before main (!) but they can't have the address of a
function local before the point in the entry block we insert our code.)
 * The heap-SRoA transforms are disabled in the face of atomic operations. This
can probably be improved; it seems odd to have atomic accesses to an alloca
that doesn't have its address taken.

AnalyzeGlobal keeps track of the strongest ordering found in any use of the
global. This is more information than we need right now, but it's cheap to
compute and likely to be useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149847 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 19:56:38 +00:00
Evan Cheng
dc7c716a1c DefinesPredicate should only look for def operands. Patch by Ludwig Meier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149846 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 19:55:04 +00:00
Nick Lewycky
bc384a1feb Clean up some whitespace and comments. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149845 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 19:48:37 +00:00
Duncan Sands
c4fd448712 Neaten up this method. Check that if there is only one
predecessor then it's Src.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149843 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 19:43:37 +00:00
Duncan Sands
23f612113a Remove dead test: this was already checked and handled a few lines
above.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149841 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 19:30:06 +00:00
Duncan Sands
87ba3f122b Fix a thinko pointed out by Eli and the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149839 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 18:56:50 +00:00
Duncan Sands
33756f96d7 Reduce the number of dom queries made by GVN's conditional propagation
logic by half: isOnlyReachableViaThisEdge was trying to be clever and
handle the case of a branch to a basic block which is contained in a
loop.  This costs a domtree lookup and is completely useless due to
GVN's position in the pass pipeline: all loops have preheaders at this
point, which means it is enough for isOnlyReachableViaThisEdge to check
that Dst has only one predecessor.  (I checked this theoretical argument
by running over the entire nightly testsuite, and indeed it is so!).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149838 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 18:25:50 +00:00
Duncan Sands
68e20223a7 Reduce the number of non-trivial domtree queries by about 1% when
compiling sqlite3, by only doing dom queries after the cheap check
rather than interleaved with it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149836 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 15:50:43 +00:00
Duncan Sands
5b8a1db7ea Persuade GCC that there is nothing worth warning about here (there isn't).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149834 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 14:20:11 +00:00
Duncan Sands
853066a32a Don't initialize CV in terms of itself! Spotted by GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149833 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 14:16:09 +00:00
Duncan Sands
408a25c583 Explain to the compiler why TargetAddr is not used uninitialized later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149832 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 14:14:35 +00:00
Nadav Rotem
cc870a8f93 Add additional documentation to the extract-and-trunc dagcombine optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149823 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 11:39:23 +00:00
Craig Topper
5e25ee8a1f Convert assert(0) to llvm_unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149816 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 08:31:47 +00:00
Chandler Carruth
69f44692bf Begin fleshing out more convenience predicates in llvm::Triple and
convert at least one client over to use them. Subsequent patches both to
LLVM and Clang will try to convert more people over to a common set of
predicates.

This round of predicates is focused on OS-categorization predicates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149815 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 08:26:40 +00:00
Craig Topper
655b8de7b2 Convert assert(0) to llvm_unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149814 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 07:21:30 +00:00
David Blaikie
0b2500c504 Simplify contains tests using 'count'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149813 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 06:35:36 +00:00
NAKAMURA Takumi
5c05f2b99e BBVectorize.cpp: Get rid of comparision to bool to fix a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149810 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 05:47:51 +00:00
Craig Topper
6d1263acb9 Convert assert(0) to llvm_unreachable in X86 Target directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149809 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 05:38:58 +00:00
Craig Topper
abb94d0687 Convert some assert(0) in default of switch statements to llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149808 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 03:43:23 +00:00
Craig Topper
5b209e84f4 Add target specific node for PMULUDQ. Change patterns to use it and custom lower intrinsics to it. Use it instead of intrinsic to handle 64-bit vector multiplies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149807 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 03:14:49 +00:00
Chris Lattner
2237f84735 Improve the bitcode reader's handling of constant strings to use
ConstantDataArray::getString direction, instead of "boxing" each
byte into a ConstantInt and using ConstantArray::get.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149805 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 02:41:35 +00:00
Chris Lattner
18c7f80b3e reapply the patches reverted in r149470 that reenable ConstantDataArray,
but with a critical fix to the SelectionDAG code that optimizes copies
from strings into immediate stores: the previous code was stopping reading
string data at the first nul.  Address this by adding a new argument to
llvm::getConstantStringInfo, preserving the behavior before the patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149800 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 02:29:43 +00:00
Craig Topper
eea723fe02 Remove most of the intrinsics for XOP VPCMOV instruction. They all aliased to the same instruction with different types. This would be better accomplished with casts in the not yet created xopintrin.h header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149795 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 00:55:56 +00:00
Sean Callanan
3f4f34c7ba Modified the Enhanced Disassembler to create and
cache disassemblers according to the string value
of the target triple, not according to the enum
of the triple CPU.  The reason for this is that
certain attributes of the instruction set are not
reflected in the enum, but only in the string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149773 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 07:45:35 +00:00
Jakob Stoklund Olesen
0aad7d274d Drop the REDEF_BY_EC VNInfo flag.
A live range that has an early clobber tied redef now looks like a
normal tied redef, except the early clobber def uses the early clobber
slot.

This is enough to handle any strange interference problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149769 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 05:51:25 +00:00
Jakob Stoklund Olesen
7e899cbb91 Correctly terminate a physreg redefined by an early clobber.
I don't have a test that fails because of this, but a test case like
CodeGen/X86/2009-12-01-EarlyClobberBug.ll exposes the problem.  EAX is
redefined by a tied early clobber operand on inline asm, and the live
range should look like this:

  %EAX,inf = [48r,64e:0)[64e,80r:1)  0@48r 1@64e

Previously, the two values got merged:

  %EAX,inf = [48r,80r:0)  0@48r

With this bug fixed, the REDEF_BY_EC VNInfo flag is no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149768 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 05:41:20 +00:00
Nick Lewycky
c0dc1b7f97 Fix a leak!
Andy, in a previous commit you made this into an ImmutablePass so that you could
add it to the PassManager, then in the next commit you left it a Pass but
removed the code that added it to the PM. If you do add it to the PM then the PM
should take care of deleting it, but it's also true that nothing in codegen
needs this object to exist after it's done its work here. It's not clear to me
which design you want; this should likely either cease to be a Pass or be added
to the PM where other parts of CodeGen will request it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149765 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 05:26:17 +00:00
Jakob Stoklund Olesen
3b1088a2cc Don't store COPY pointers in VNInfo.
If a value is defined by a COPY, that instuction can easily and cheaply
be found by getInstructionFromIndex(VNI->def).

This reduces the size of VNInfo from 24 to 16 bytes, and improves
llc compile time by 3%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149763 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 05:20:49 +00:00
Hal Finkel
edc8db87dc Boost the effective chain depth of loads and stores.
By default, boost the chain depth contribution of loads and stores. This will allow a load/store pair to vectorize even when it would not otherwise be long enough to satisfy the chain depth requirement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149761 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 04:14:04 +00:00
Qirun Zhang
fd4b8e2bac remove the blank line from previous ci.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149758 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 03:18:47 +00:00
Qirun Zhang
940fbd6d66 test commit.
add a blank line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149757 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 03:15:26 +00:00
Andrew Trick
061efcfb3e TargetPassConfig: confine the MC configuration to TargetMachine.
Passes prior to instructon selection are now split into separate configurable stages.
Header dependencies are simplified.
The bulk of this diff is simply removal of the silly DisableVerify flags.

Sorry for the target header churn. Attempting to stabilize them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149754 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 02:56:59 +00:00
Andrew Trick
d542265401 Move TargetPassConfig implementation into Passes.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149753 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 02:56:48 +00:00
Andrew Trick
7461334084 Make TargetPassConfig an ImmutablePass so CodeGenPasses can query options
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149752 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 02:56:45 +00:00
Dylan Noblesmith
069df954a1 Object: avoid undefined behavior when bounds-checking
Don't form an out of bounds pointer just to test if it
would be out of bounds.

Also perform the same bounds checking for all the previous
mapped structures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149750 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 02:41:39 +00:00
Devang Patel
9e11eb1ddb Emit new property tag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149737 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 01:30:32 +00:00
Devang Patel
0df823461d Update llvm debug version to support new structure and tag for Objective-C property's debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149736 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 01:30:01 +00:00
Devang Patel
1ea02d467a Introduce DIObjCProperty. This will be used to encode objective-c property.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149732 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 00:59:25 +00:00
Chad Rosier
2f2d1d7ec0 [fast-isel] HandlePHINodesInSuccessorBlocks() can promite i8 and i16 types too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149730 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04 00:39:19 +00:00
Devang Patel
36b24b0dfa Add new tag and an attribute to support debug info for objective-c property.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149724 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-03 23:57:08 +00:00
Jakob Stoklund Olesen
9119b039d4 Trim headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149722 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-03 23:51:15 +00:00