oota-llvm.git
12 years agoJust like in regular escape analysis, loads and stores through
Dan Gohman [Mon, 13 Feb 2012 22:57:02 +0000 (22:57 +0000)]
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

12 years agoThreadSanitizer, a race detector. First LLVM commit.
Kostya Serebryany [Mon, 13 Feb 2012 22:50:51 +0000 (22:50 +0000)]
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

12 years agov2f16 is a floating point type. Add symbolic floating point type ranges to prevent...
Owen Anderson [Mon, 13 Feb 2012 21:47:20 +0000 (21:47 +0000)]
v2f16 is a floating point type.  Add symbolic floating point type ranges to prevent this kind of issue in the future.

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

12 years agoLiveIntervalAnalysis does not depend on MachineLoopInfo.
Andrew Trick [Mon, 13 Feb 2012 20:44:42 +0000 (20:44 +0000)]
LiveIntervalAnalysis does not depend on MachineLoopInfo.

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

12 years agoadd LLVM_VERSION_MAJOR and _MINOR defines
Dylan Noblesmith [Mon, 13 Feb 2012 18:48:10 +0000 (18:48 +0000)]
add LLVM_VERSION_MAJOR and _MINOR defines

This is useful for clients that want to maintain compatibility
across multiple releases of LLVM. Currently users like Klee and
Mesa all have to roll their own 'parse llvm-config --version
output and generate defines' solution.

Also reuse the new macros so that version information is less
redundant/likely to fall out of sync again in the future.

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

12 years agoCheck regmask interference for -join-physregs.
Jakob Stoklund Olesen [Mon, 13 Feb 2012 18:17:04 +0000 (18:17 +0000)]
Check regmask interference for -join-physregs.

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

12 years agoRemove empty directories.
Benjamin Kramer [Mon, 13 Feb 2012 16:40:26 +0000 (16:40 +0000)]
Remove empty directories.

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

12 years agoFix a bug in DAGCombine for the optimization of BUILD_VECTOR. We cant generate a...
Nadav Rotem [Mon, 13 Feb 2012 12:42:26 +0000 (12:42 +0000)]
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

12 years agoRemove duplicate code in this header file which seemed to undergo a copy/paste fiasco.
Ahmed Charles [Mon, 13 Feb 2012 09:45:36 +0000 (09:45 +0000)]
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

12 years agoStill more vector_shuffle pattern removal.
Craig Topper [Mon, 13 Feb 2012 07:23:41 +0000 (07:23 +0000)]
Still more vector_shuffle pattern removal.

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

12 years agoFix various issues (or do cleanups) found by enabling certain MSVC warnings.
Ahmed Charles [Mon, 13 Feb 2012 06:30:56 +0000 (06:30 +0000)]
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

12 years agoRemove more vector_shuffle patterns for unpack. These should be target specific nodes...
Craig Topper [Mon, 13 Feb 2012 05:48:49 +0000 (05:48 +0000)]
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

12 years agoRecommit r150328. Previous test failures should be fixed by r150360.
Craig Topper [Mon, 13 Feb 2012 05:10:10 +0000 (05:10 +0000)]
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

12 years agoRevert accidental commit of a pruned testcase from r150360.
Craig Topper [Mon, 13 Feb 2012 04:33:33 +0000 (04:33 +0000)]
Revert accidental commit of a pruned testcase from r150360.

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

12 years agoUpdate CanXFormVExtractWithShuffleIntoLoad to ensure bitcasts of loads only have...
Craig Topper [Mon, 13 Feb 2012 04:30:38 +0000 (04:30 +0000)]
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

12 years agoRevert r150328, "Remove more vector_shuffle patterns."
NAKAMURA Takumi [Mon, 13 Feb 2012 00:10:15 +0000 (00:10 +0000)]
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

12 years agoFixed bug when custom lowering DEC64m on x86.
Pete Cooper [Mon, 13 Feb 2012 00:10:03 +0000 (00:10 +0000)]
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

12 years agoThis patch addresses the problem of poor code generation for the zext
Nadav Rotem [Sun, 12 Feb 2012 15:05:31 +0000 (15:05 +0000)]
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

12 years agoStringSwitchify the rest of Triple.cpp.
Benjamin Kramer [Sun, 12 Feb 2012 10:56:52 +0000 (10:56 +0000)]
StringSwitchify the rest of Triple.cpp.

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

12 years agoSwitch a bunch of manual if-chains to use StringSwitch. Clean them up in
Chandler Carruth [Sun, 12 Feb 2012 09:27:38 +0000 (09:27 +0000)]
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

12 years agoRemove more vector_shuffle patterns.
Craig Topper [Sun, 12 Feb 2012 08:14:35 +0000 (08:14 +0000)]
Remove more vector_shuffle patterns.

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

12 years agoExpose the ELFObjectFile class directly in the Object/ELF.h header, similarly
Eli Bendersky [Sun, 12 Feb 2012 06:12:10 +0000 (06:12 +0000)]
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

12 years agoHandle InvokeInst in EvaluateBlock. Don't try to support exceptions, it's just
Nick Lewycky [Sun, 12 Feb 2012 05:09:35 +0000 (05:09 +0000)]
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

12 years agofalse is totally null!
Nick Lewycky [Sun, 12 Feb 2012 02:17:18 +0000 (02:17 +0000)]
false is totally null!

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

12 years agoRemove redundant getAnalysis<> calls in GlobalOpt. Add a few Itanium ABI calls
Nick Lewycky [Sun, 12 Feb 2012 02:15:20 +0000 (02:15 +0000)]
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

12 years agoPass TargetData and TargetLibraryInfo through to the constant folder. Fixes a
Nick Lewycky [Sun, 12 Feb 2012 01:13:18 +0000 (01:13 +0000)]
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

12 years agoRemove more vector_shuffle patterns.
Craig Topper [Sun, 12 Feb 2012 01:07:34 +0000 (01:07 +0000)]
Remove more vector_shuffle patterns.

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

12 years agoFix function name in comment to match actual name. Fix comments that are using
Nick Lewycky [Sun, 12 Feb 2012 00:52:26 +0000 (00:52 +0000)]
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

12 years agoDon't traverse the PHI nodes twice. No functionality change!
Nick Lewycky [Sun, 12 Feb 2012 00:47:24 +0000 (00:47 +0000)]
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

12 years agoRemove more vector_shuffle patterns.
Craig Topper [Sat, 11 Feb 2012 23:31:01 +0000 (23:31 +0000)]
Remove more vector_shuffle patterns.

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

12 years agoAdd support for implicit TLS model used with MS VC runtime.
Anton Korobeynikov [Sat, 11 Feb 2012 17:26:53 +0000 (17:26 +0000)]
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

12 years agoDon't mix declarations and code.
Benjamin Kramer [Sat, 11 Feb 2012 16:01:02 +0000 (16:01 +0000)]
Don't mix declarations and code.

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

12 years agoMake the EDis tables const.
Benjamin Kramer [Sat, 11 Feb 2012 14:51:07 +0000 (14:51 +0000)]
Make the EDis tables const.

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

12 years agoReuse the enum names from X86Desc in the X86Disassembler.
Benjamin Kramer [Sat, 11 Feb 2012 14:50:54 +0000 (14:50 +0000)]
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

12 years agoDocument the new module flags.
Bill Wendling [Sat, 11 Feb 2012 11:59:36 +0000 (11:59 +0000)]
Document the new module flags.

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

12 years ago[WIP] Initial code for module flags.
Bill Wendling [Sat, 11 Feb 2012 11:38:06 +0000 (11:38 +0000)]
[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

12 years agoRemove some patterns for matching vector_shuffle instructions since vector_shuffles...
Craig Topper [Sat, 11 Feb 2012 07:43:35 +0000 (07:43 +0000)]
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

12 years agoAdd TargetPassConfig hooks for scheduling/bundling.
Andrew Trick [Sat, 11 Feb 2012 07:11:32 +0000 (07:11 +0000)]
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

12 years agocomment
Andrew Trick [Sat, 11 Feb 2012 07:11:29 +0000 (07:11 +0000)]
comment

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

12 years agoFix shuffle lowering code to stop creating temporary DAG nodes to do shuffle mask...
Craig Topper [Sat, 11 Feb 2012 06:24:48 +0000 (06:24 +0000)]
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

12 years agoAllow Post-RA LICM to hoist reserved register reads.
Jakob Stoklund Olesen [Sat, 11 Feb 2012 00:44:19 +0000 (00:44 +0000)]
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

12 years agoHandle register masks in local live range splitting.
Jakob Stoklund Olesen [Sat, 11 Feb 2012 00:42:18 +0000 (00:42 +0000)]
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

12 years agoDon't read PreRegAlloc before it is initialized.
Jakob Stoklund Olesen [Sat, 11 Feb 2012 00:40:36 +0000 (00:40 +0000)]
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

12 years agoRevert r150222, as the clang driver now handles this properly.
Jim Grosbach [Fri, 10 Feb 2012 20:38:46 +0000 (20:38 +0000)]
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

12 years agoClean up comment.
Jakob Stoklund Olesen [Fri, 10 Feb 2012 19:27:34 +0000 (19:27 +0000)]
Clean up comment.

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

12 years agoAdd a static MachineOperand::clobbersPhysReg().
Jakob Stoklund Olesen [Fri, 10 Feb 2012 19:23:53 +0000 (19:23 +0000)]
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

12 years agoAdd register mask support to InterferenceCache.
Jakob Stoklund Olesen [Fri, 10 Feb 2012 18:58:34 +0000 (18:58 +0000)]
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

12 years agoRemove unused variable.
Jakob Stoklund Olesen [Fri, 10 Feb 2012 18:52:15 +0000 (18:52 +0000)]
Remove unused variable.

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

12 years agoAdded description of invariant.load metadata to LangRef. It was added to the compile...
Pete Cooper [Fri, 10 Feb 2012 18:13:54 +0000 (18:13 +0000)]
Added description of invariant.load metadata to LangRef.  It was added to the compiler in r144100

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

12 years agoMake valgrind happy.
Jason W Kim [Fri, 10 Feb 2012 16:07:59 +0000 (16:07 +0000)]
Make valgrind happy.

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

12 years agoUpdate BBVectorize to use aliasesUnknownInst.
Hal Finkel [Fri, 10 Feb 2012 15:52:40 +0000 (15:52 +0000)]
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

12 years agoHave AliasSet::aliasesUnknownInst use pointer TBAA info when available
Hal Finkel [Fri, 10 Feb 2012 15:52:39 +0000 (15:52 +0000)]
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

12 years agoMake aliasesPointer and aliasesUnknownInst public members of AliasSet.
Hal Finkel [Fri, 10 Feb 2012 15:52:37 +0000 (15:52 +0000)]
Make aliasesPointer and aliasesUnknownInst public members of AliasSet.

These query functions are safe for external use and, furthermore,
are the only way to make queries against the "unknown instructions" array.
BBVectorize will use these functions.

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

12 years agoFix PR11948: the result type of an icmp may be a vector of boolean -
Duncan Sands [Fri, 10 Feb 2012 14:31:24 +0000 (14:31 +0000)]
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

12 years agoRevert commit 149912 (lattner) and add a testcase that shows the problem (which
Duncan Sands [Fri, 10 Feb 2012 14:26:42 +0000 (14:26 +0000)]
Revert commit 149912 (lattner) and add a testcase that shows the problem (which
is that patterns no longer match for vectors of booleans, because you only get
ConstantDataVector when the vector element type is i8, i16, etc, not when it is
i1).  Original commit message:
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@150246 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPut instruction names into an indexed string table on the side, removing a pointer...
Benjamin Kramer [Fri, 10 Feb 2012 13:18:44 +0000 (13:18 +0000)]
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

12 years agocomment grammar
Andrew Trick [Fri, 10 Feb 2012 07:08:25 +0000 (07:08 +0000)]
comment grammar

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

12 years agoupdate --enable-targets list
Jia Liu [Fri, 10 Feb 2012 04:58:24 +0000 (04:58 +0000)]
update --enable-targets list

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

12 years agounnecessary include
Andrew Trick [Fri, 10 Feb 2012 04:10:44 +0000 (04:10 +0000)]
unnecessary include

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

12 years agoPTX no longer needs to provide its own backend.
Andrew Trick [Fri, 10 Feb 2012 04:10:40 +0000 (04:10 +0000)]
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

12 years agoRegAlloc superpass: includes phi elimination, coalescing, and scheduling.
Andrew Trick [Fri, 10 Feb 2012 04:10:36 +0000 (04:10 +0000)]
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

12 years agowhitespace
Andrew Trick [Fri, 10 Feb 2012 04:10:26 +0000 (04:10 +0000)]
whitespace

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

12 years agoRemove unused 'isAlias' parameter.
Lang Hames [Fri, 10 Feb 2012 03:19:36 +0000 (03:19 +0000)]
Remove unused 'isAlias' parameter.

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

12 years agoARM on darwin, v6 implies the presence of VFP for the assembler.
Jim Grosbach [Fri, 10 Feb 2012 02:21:49 +0000 (02:21 +0000)]
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

12 years agoConstrain the regmask search space for local live ranges.
Jakob Stoklund Olesen [Fri, 10 Feb 2012 01:31:31 +0000 (01:31 +0000)]
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

12 years agoCache basic block boundaries for faster RegMaskSlots access.
Jakob Stoklund Olesen [Fri, 10 Feb 2012 01:26:29 +0000 (01:26 +0000)]
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

12 years agoOptimize LiveIntervals::intervalIsInOneMBB().
Jakob Stoklund Olesen [Fri, 10 Feb 2012 01:23:55 +0000 (01:23 +0000)]
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

12 years agoCache iterators. Some of these are expensive to create.
Benjamin Kramer [Fri, 10 Feb 2012 00:28:31 +0000 (00:28 +0000)]
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

12 years agoChange default error_code ctor to a 'named ctor' so it's more self-documenting.
David Blaikie [Thu, 9 Feb 2012 19:24:12 +0000 (19:24 +0000)]
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

12 years agoAdd register mask support to RAGreedy.
Jakob Stoklund Olesen [Thu, 9 Feb 2012 18:25:05 +0000 (18:25 +0000)]
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

12 years agoNow subprogram descriptors are not collected by llvm.dbg.sp NamedMDNode. Update docum...
Devang Patel [Thu, 9 Feb 2012 17:34:01 +0000 (17:34 +0000)]
Now subprogram descriptors are not collected by llvm.dbg.sp NamedMDNode. Update document to reflect this change.

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

12 years agoTweak comment readability and grammar.
Benjamin Kramer [Thu, 9 Feb 2012 16:28:15 +0000 (16:28 +0000)]
Tweak comment readability and grammar.

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

12 years agoTest for commit access.
Sirish Pande [Thu, 9 Feb 2012 15:20:33 +0000 (15:20 +0000)]
Test for commit access.

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

12 years agoGlobalOpt: Be more aggressive about elminating side-effect free static dtors.
Benjamin Kramer [Thu, 9 Feb 2012 14:26:06 +0000 (14:26 +0000)]
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

12 years agoStore just the SimpleValueType in the generated VT tables for each register class...
Benjamin Kramer [Thu, 9 Feb 2012 12:35:37 +0000 (12:35 +0000)]
Store just the SimpleValueType in the generated VT tables for each register class, eliminating static ctors.

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

12 years agoMove the Name field in MCInstrDesc to the end, saving 8 bytes of padding per entry...
Benjamin Kramer [Thu, 9 Feb 2012 11:25:09 +0000 (11:25 +0000)]
Move the Name field in MCInstrDesc to the end, saving 8 bytes of padding per entry on x86_64.

No change on i386.

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

12 years agoTeach the MC and disassembler about SoftFail, and hook it up to UNPREDICTABLE on...
James Molloy [Thu, 9 Feb 2012 10:56:31 +0000 (10:56 +0000)]
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

12 years agoMore tweaks to get the size of the X86 disassembler tables down.
Craig Topper [Thu, 9 Feb 2012 08:58:07 +0000 (08:58 +0000)]
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

12 years agoFlatten some of the arrays in the X86 disassembler tables to reduce space needed...
Craig Topper [Thu, 9 Feb 2012 07:45:30 +0000 (07:45 +0000)]
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

12 years agoPreserve physreg kills in MachineBasicBlock::SplitCriticalEdge.
Lang Hames [Thu, 9 Feb 2012 05:59:36 +0000 (05:59 +0000)]
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

12 years agotest/CodeGen/X86/atom-lea-sp.ll: Add explicit -mtriple=i686-linux.
NAKAMURA Takumi [Thu, 9 Feb 2012 05:12:58 +0000 (05:12 +0000)]
test/CodeGen/X86/atom-lea-sp.ll: Add explicit -mtriple=i686-linux.

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

12 years agoFix kill flags when moving instructions using LiveIntervals::moveInstr(...).
Lang Hames [Thu, 9 Feb 2012 04:45:38 +0000 (04:45 +0000)]
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

12 years agoRemove assertion. Not all use operands are reads.
Lang Hames [Thu, 9 Feb 2012 04:39:48 +0000 (04:39 +0000)]
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

12 years agoImprove TargetPassConfig. No intended functionality.
Andrew Trick [Thu, 9 Feb 2012 00:40:55 +0000 (00:40 +0000)]
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

12 years agocomment
Andrew Trick [Thu, 9 Feb 2012 00:40:52 +0000 (00:40 +0000)]
comment

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

12 years agoRemove static initializer from DataStream.cpp
David Blaikie [Thu, 9 Feb 2012 00:29:19 +0000 (00:29 +0000)]
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

12 years agoErase dead copies that are clobbered by a call.
Jakob Stoklund Olesen [Thu, 9 Feb 2012 00:19:08 +0000 (00:19 +0000)]
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

12 years agoHandle register masks when searching for EFLAGS clobbers.
Jakob Stoklund Olesen [Thu, 9 Feb 2012 00:17:22 +0000 (00:17 +0000)]
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

12 years agoNever delete instructions that define reserved registers.
Jakob Stoklund Olesen [Thu, 9 Feb 2012 00:15:39 +0000 (00:15 +0000)]
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

12 years agoHandle register masks in MachineCopyPropagation.
Jakob Stoklund Olesen [Wed, 8 Feb 2012 22:37:35 +0000 (22:37 +0000)]
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

12 years agoCommit Andy Zhang's test for the lea patch.
Evan Cheng [Wed, 8 Feb 2012 22:33:17 +0000 (22:33 +0000)]
Commit Andy Zhang's test for the lea patch.

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

12 years agofix broken link
Chris Lattner [Wed, 8 Feb 2012 22:20:00 +0000 (22:20 +0000)]
fix broken link

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

12 years ago[asan] unpoison the stack before every noreturn call. Fixes asan issue 37. llvm part
Kostya Serebryany [Wed, 8 Feb 2012 21:36:17 +0000 (21:36 +0000)]
[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

12 years agoCodegen pass definition cleanup. No functionality.
Andrew Trick [Wed, 8 Feb 2012 21:23:13 +0000 (21:23 +0000)]
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

12 years agoMove pass configuration out of pass constructors: MachineLICM.
Andrew Trick [Wed, 8 Feb 2012 21:23:03 +0000 (21:23 +0000)]
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

12 years agowhitespace
Andrew Trick [Wed, 8 Feb 2012 21:23:00 +0000 (21:23 +0000)]
whitespace

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

12 years agoMove pass configuration out of pass constructors: StackSlotColoring.
Andrew Trick [Wed, 8 Feb 2012 21:22:57 +0000 (21:22 +0000)]
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

12 years agoMove pass configuration out of pass constructors: PostRAScheduler.
Andrew Trick [Wed, 8 Feb 2012 21:22:53 +0000 (21:22 +0000)]
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

12 years agoMove pass configuration out of pass constructors: BranchFolderPass
Andrew Trick [Wed, 8 Feb 2012 21:22:48 +0000 (21:22 +0000)]
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

12 years agowhitespace
Andrew Trick [Wed, 8 Feb 2012 21:22:43 +0000 (21:22 +0000)]
whitespace

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