oota-llvm.git
12 years agoAdd a test for the Objective-C garbage collection metadata stuff.
Bill Wendling [Wed, 15 Feb 2012 22:44:10 +0000 (22:44 +0000)]
Add a test for the Objective-C garbage collection metadata stuff.

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

12 years agoModify the code that emits the module flags to use the new module flags accessor
Bill Wendling [Wed, 15 Feb 2012 22:36:15 +0000 (22:36 +0000)]
Modify the code that emits the module flags to use the new module flags accessor
method. This allows the target lowering code to not have to deal with MDNodes.

Also, avoid leaking memory like a sieve by not creating a global variable for
the image info section, but just emitting the code directly.

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

12 years agoAdd a module flags accessor method which returns the flags in a vector.
Bill Wendling [Wed, 15 Feb 2012 22:34:20 +0000 (22:34 +0000)]
Add a module flags accessor method which returns the flags in a vector.

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

12 years agoAdd function for computing the edit distance of two arrays.
Kaelyn Uhrain [Wed, 15 Feb 2012 22:13:07 +0000 (22:13 +0000)]
Add function for computing the edit distance of two arrays.

Accomplished by moving the body of StringRef::edit_distance into
a separate function that accepts two ArrayRefs, and making
StringRef::edit_distance a wrapper around the new function.

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

12 years agoDon't expose DefaultVLIWScheduler
Andrew Trick [Wed, 15 Feb 2012 22:06:21 +0000 (22:06 +0000)]
Don't expose DefaultVLIWScheduler

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

12 years agoutils: Kill NewNightlyTest.pl, which has been replaced by LNT (as far as I know).
Daniel Dunbar [Wed, 15 Feb 2012 19:24:11 +0000 (19:24 +0000)]
utils: Kill NewNightlyTest.pl, which has been replaced by LNT (as far as I know).

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

12 years agoRemove overly conservative assert.
Lang Hames [Wed, 15 Feb 2012 19:04:53 +0000 (19:04 +0000)]
Remove overly conservative assert.

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

12 years agoGeneric "VLIW" packetizer based on a DFA generated from target itinerary.
Andrew Trick [Wed, 15 Feb 2012 18:55:14 +0000 (18:55 +0000)]
Generic "VLIW" packetizer based on a DFA generated from target itinerary.

Patch by Sundeep!

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

12 years agoOptimize redundant sign extends and negation of predicates.
Sirish Pande [Wed, 15 Feb 2012 18:52:27 +0000 (18:52 +0000)]
Optimize redundant sign extends and negation of predicates.

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

12 years agoRevert "Replacing HexagonOptimizeSZExtends with HexagonPeephole."
Eric Christopher [Wed, 15 Feb 2012 18:34:25 +0000 (18:34 +0000)]
Revert "Replacing HexagonOptimizeSZExtends with HexagonPeephole."

This reverts commit 1656806a944bbd23e98c6e578810fe02495ab741.

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

12 years agoRevert "Optimize redundant sign extends and negation of predicates"
Eric Christopher [Wed, 15 Feb 2012 18:32:25 +0000 (18:32 +0000)]
Revert "Optimize redundant sign extends and negation of predicates"
as it's breaking the build.

This reverts commit 11241abca5e2a313412fed594bb9d9fa2a2057fb.

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

12 years agoReplacing HexagonOptimizeSZExtends with HexagonPeephole.
Sirish Pande [Wed, 15 Feb 2012 18:31:35 +0000 (18:31 +0000)]
Replacing HexagonOptimizeSZExtends with HexagonPeephole.

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

12 years agoOptimize redundant sign extends and negation of predicates
Sirish Pande [Wed, 15 Feb 2012 18:22:18 +0000 (18:22 +0000)]
Optimize redundant sign extends and negation of predicates

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

12 years agoAdd braces to if clause to make symmetric with associate else clause.
Chad Rosier [Wed, 15 Feb 2012 17:36:21 +0000 (17:36 +0000)]
Add braces to if clause to make symmetric with associate else clause.

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

12 years agoFor ELF, also call fixSymbolsInTLSFixups() on expressions passed to EmitValue (litera...
David Meyer [Wed, 15 Feb 2012 15:09:06 +0000 (15:09 +0000)]
For ELF, also call fixSymbolsInTLSFixups() on expressions passed to EmitValue (literal values). Previously only called on expressions in instructions. New test cases added to tls.s, tls-i386.s. Resolves PR11981.

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

12 years agoStrip the pointer casts from the constants here.
Bill Wendling [Wed, 15 Feb 2012 09:14:08 +0000 (09:14 +0000)]
Strip the pointer casts from the constants here.

The c'tor list is stored as a list of 'void ()*'s, so all of the functions are
bitcast to that. However, the dyn_cast doesn't automagically look through
bitcasts. Do that for it.
<rdar://problem/10813350>

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

12 years agoAdd a way to replace a field inside a metadata node. This can be
Eric Christopher [Wed, 15 Feb 2012 09:09:29 +0000 (09:09 +0000)]
Add a way to replace a field inside a metadata node. This can be
used to incrementally update a created node without needing a
temporary node and RAUW.

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

12 years agoRevert r150565 again. Appears to be a stage2 failure with dragonegg.
Andrew Trick [Wed, 15 Feb 2012 07:57:03 +0000 (07:57 +0000)]
Revert r150565 again. Appears to be a stage2 failure with dragonegg.

I'll put MachineLICM back before PEI. All my arm/x86 benchmarks look good, but buildbots don't like it.

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

12 years agoReapply r150565 with the typo fix properly merged.
Andrew Trick [Wed, 15 Feb 2012 05:43:27 +0000 (05:43 +0000)]
Reapply r150565 with the typo fix properly merged.

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

12 years agoreverting r150565. Premature push.
Andrew Trick [Wed, 15 Feb 2012 05:22:12 +0000 (05:22 +0000)]
reverting r150565. Premature push.

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

12 years agoMove PostRAMachineLICM into MachineLateOptimization. It now runs after PEI!
Andrew Trick [Wed, 15 Feb 2012 05:13:47 +0000 (05:13 +0000)]
Move PostRAMachineLICM into MachineLateOptimization. It now runs after PEI!

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

12 years agoAdd a check to make sure we don't assign slot indexes for instructions inside bundles.
Lang Hames [Wed, 15 Feb 2012 04:33:48 +0000 (04:33 +0000)]
Add a check to make sure we don't assign slot indexes for instructions inside bundles.

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

12 years agoAllow CodeGen (llc) command line options to work as expected.
Andrew Trick [Wed, 15 Feb 2012 03:21:51 +0000 (03:21 +0000)]
Allow CodeGen (llc) command line options to work as expected.

The llc command line options for enabling/disabling passes are local to CodeGen/Passes.cpp. This patch associates those options with standard pass IDs so they work regardless of how the target configures the passes.

A target has two ways of overriding standard passes:
1) Redefine the pass pipeline (override TargetPassConfig::add%Stage)
2) Replace or suppress individiual passes with TargetPassConfig::substitutePass.

In both cases, the command line options associated with the pass override the target default.

For example, say a target wants to disable machine instruction scheduling by default:

- The target calls disablePass(MachineSchedulerID) but otherwise does not override any TargetPassConfig methods.

- Without any llc options, no scheduler is run.

- With -enable-misched, the standard machine scheduler is run and honors the -misched=... flag to select the scheduler variant, which may be used for performance evaluation or testing.

Sorry overridePass is ugly. I haven't thought of a better way without replacing the cl::opt framework. I hope to do that one day...

I haven't figured out why CodeGen uses char& for pass IDs. AnalysisID is much easier to use and less bug prone. I'm using it wherever I can for internal implementation. Maybe later we can change the global pass ID definitions as well.

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

12 years agoAdded TargetPassConfig::disablePass/substitutePass as a general mechanism to override...
Andrew Trick [Wed, 15 Feb 2012 03:21:47 +0000 (03:21 +0000)]
Added TargetPassConfig::disablePass/substitutePass as a general mechanism to override specific passes.

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

12 years agocomment
Andrew Trick [Wed, 15 Feb 2012 03:21:43 +0000 (03:21 +0000)]
comment

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

12 years agoDon't emit live ranges for physregs live-ins that are dead.
Lang Hames [Wed, 15 Feb 2012 01:31:10 +0000 (01:31 +0000)]
Don't emit live ranges for physregs live-ins that are dead.

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

12 years agoDisentangle moving a machine instr from updating LiveIntervals.
Lang Hames [Wed, 15 Feb 2012 01:23:52 +0000 (01:23 +0000)]
Disentangle moving a machine instr from updating LiveIntervals.

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

12 years agoAdded hook to let targets custom lower splitting of illegal vectors
Pete Cooper [Wed, 15 Feb 2012 00:55:31 +0000 (00:55 +0000)]
Added hook to let targets custom lower splitting of illegal vectors

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

12 years agoUse a temporary variable, rather then a series of redundant calls.
Chad Rosier [Wed, 15 Feb 2012 00:36:26 +0000 (00:36 +0000)]
Use a temporary variable, rather then a series of redundant calls.

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

12 years agoStop custom lowering forr x86 DEC64m from happening if the load in the lowered sequen...
Pete Cooper [Wed, 15 Feb 2012 00:33:37 +0000 (00:33 +0000)]
Stop custom lowering forr x86 DEC64m from happening if the load in the lowered sequence has more than 1 user

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

12 years agoUse a temporary variable, rather then a series of redundant calls.
Chad Rosier [Wed, 15 Feb 2012 00:23:55 +0000 (00:23 +0000)]
Use a temporary variable, rather then a series of redundant calls.

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

12 years agoFix global live range splitting regmask accuracy.
Jakob Stoklund Olesen [Tue, 14 Feb 2012 23:53:23 +0000 (23:53 +0000)]
Fix global live range splitting regmask accuracy.

Pretend that regmask interference ends at the 'dead' slot, even when
there is other interference ending at the 'reg' slot of the same
instruction.

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

12 years agoFix details in local live range splitting with regmasks.
Jakob Stoklund Olesen [Tue, 14 Feb 2012 23:51:27 +0000 (23:51 +0000)]
Fix details in local live range splitting with regmasks.

Perform all comparisons at instruction granularity, and make sure
register masks on uses count in both gaps.

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

12 years agoHandle regmasks in findRegisterDefOperandIdx().
Jakob Stoklund Olesen [Tue, 14 Feb 2012 23:49:37 +0000 (23:49 +0000)]
Handle regmasks in findRegisterDefOperandIdx().

Only accept register masks when looking for an 'overlapping' def. When
Overlap is not set, the function searches for a proper definition of
Reg.

This means MI->modifiesRegister() considers register masks, but
MI->definesRegister() doesn't.

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

12 years agoUse the proper clobber check in handleLiveInRegister().
Jakob Stoklund Olesen [Tue, 14 Feb 2012 23:46:24 +0000 (23:46 +0000)]
Use the proper clobber check in handleLiveInRegister().

When a physreg is live in to a basic block, look for any instruction in
the block that clobbers the physreg.

The instruction doesn't have to properly redefine the register, any
overlapping clobber is OK.

This slightly changes live ranges when compiling with register masks.

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

12 years agoDump live intervals in numerical order.
Jakob Stoklund Olesen [Tue, 14 Feb 2012 23:46:21 +0000 (23:46 +0000)]
Dump live intervals in numerical order.

The old DenseMap hashed order was very confusing.

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

12 years agoDon't create a new copy of reserved regs - we already have one handy.
Lang Hames [Tue, 14 Feb 2012 23:06:12 +0000 (23:06 +0000)]
Don't create a new copy of reserved regs - we already have one handy.

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

12 years agoRemove unnecessary assignment to temporary, ResultReg.
Chad Rosier [Tue, 14 Feb 2012 22:29:48 +0000 (22:29 +0000)]
Remove unnecessary assignment to temporary, ResultReg.

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

12 years agoSilence the new -Wempty-body warning. It appeared because the next statement
Dmitri Gribenko [Tue, 14 Feb 2012 22:17:14 +0000 (22:17 +0000)]
Silence the new -Wempty-body warning.  It appeared because the next statement
after the `for(...) ;' has more indentation than for itself.

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

12 years agoUsing the new external-linkage warning recently added instead of disabling all return...
Aaron Ballman [Tue, 14 Feb 2012 21:44:03 +0000 (21:44 +0000)]
Using the new external-linkage warning recently added instead of disabling all return type warnings.

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

12 years agoFixing warning due to the new "UTD return type in extern 'C'".
Aaron Ballman [Tue, 14 Feb 2012 21:29:32 +0000 (21:29 +0000)]
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

12 years agoAdd code to the target lowering object file module to handle module flags.
Bill Wendling [Tue, 14 Feb 2012 21:28:13 +0000 (21:28 +0000)]
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

12 years agoUpdate MachineVerifier to check the new physreg live-in rules.
Lang Hames [Tue, 14 Feb 2012 19:17:48 +0000 (19:17 +0000)]
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

12 years agoTighten physical register invariants: Allocatable physical registers can
Lang Hames [Tue, 14 Feb 2012 18:51:53 +0000 (18:51 +0000)]
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

12 years agoFix PR12000. Some vector operations may use scalar operands with types
Nadav Rotem [Tue, 14 Feb 2012 13:06:32 +0000 (13:06 +0000)]
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

12 years agoTurn push_back loops into append/insert.
Benjamin Kramer [Tue, 14 Feb 2012 10:29:27 +0000 (10:29 +0000)]
Turn push_back loops into append/insert.

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

12 years agoChange error tests to coincide with message changes.
Bill Wendling [Tue, 14 Feb 2012 09:29:21 +0000 (09:29 +0000)]
Change error tests to coincide with message changes.

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

12 years agoCapitalize messages so that they appear nicely with the linker's error messages.
Bill Wendling [Tue, 14 Feb 2012 09:13:54 +0000 (09:13 +0000)]
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

12 years agoMove old movl vector_shuffle patterns. Not needed anymore since vector_shuffles shoul...
Craig Topper [Tue, 14 Feb 2012 08:14:53 +0000 (08:14 +0000)]
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

12 years agoRename getExceptionAddressRegister() to getExceptionPointerRegister() for consistency...
Lang Hames [Tue, 14 Feb 2012 04:45:49 +0000 (04:45 +0000)]
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

12 years agoUse convenience function for consistency.
Lang Hames [Tue, 14 Feb 2012 03:04:29 +0000 (03:04 +0000)]
Use convenience function for consistency.

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

12 years ago[tsan] fix compiler warnings
Kostya Serebryany [Tue, 14 Feb 2012 00:52:07 +0000 (00:52 +0000)]
[tsan] fix compiler warnings

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

12 years agoThird time's the charm...?
Lang Hames [Tue, 14 Feb 2012 00:34:30 +0000 (00:34 +0000)]
Third time's the charm...?

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

12 years agoUnswap swap operands, partially reducing confusion.
Lang Hames [Tue, 14 Feb 2012 00:17:12 +0000 (00:17 +0000)]
Unswap swap operands, partially reducing confusion.

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

12 years ago[asan] fix asan-vs-gvn.ll test (it did not actually check much before this change)
Kostya Serebryany [Tue, 14 Feb 2012 00:02:35 +0000 (00:02 +0000)]
[asan] fix asan-vs-gvn.ll test (it did not actually check much before this change)

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

12 years agoAdd simplifyLoopLatch to LoopRotate pass.
Andrew Trick [Tue, 14 Feb 2012 00:00:23 +0000 (00:00 +0000)]
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

12 years agowhitespace
Andrew Trick [Tue, 14 Feb 2012 00:00:19 +0000 (00:00 +0000)]
whitespace

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

12 years agoDon't reserve the R0 and R1 registers here. We don't use these registers, and
Bill Wendling [Mon, 13 Feb 2012 23:47:16 +0000 (23:47 +0000)]
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

12 years agoDon't recalculate the size of the vector each time through the loop.
Bill Wendling [Mon, 13 Feb 2012 23:45:26 +0000 (23:45 +0000)]
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

12 years agoMake operands for VSWP read-modify-write.
Lang Hames [Mon, 13 Feb 2012 23:37:19 +0000 (23:37 +0000)]
Make operands for VSWP read-modify-write.

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

12 years agoAdd register mask support to ScheduleDAGRRList.
Jakob Stoklund Olesen [Mon, 13 Feb 2012 23:25:24 +0000 (23:25 +0000)]
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

12 years agoCheck against umin while converting fcmp into an icmp.
Devang Patel [Mon, 13 Feb 2012 23:05:18 +0000 (23:05 +0000)]
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

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