oota-llvm.git
12 years agoRemove MipsMCSymbolRefExpr.
Akira Hatanaka [Tue, 15 Nov 2011 18:20:08 +0000 (18:20 +0000)]
Remove MipsMCSymbolRefExpr.

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

12 years agoARM parsing datatype suffix variants for register-writeback VLD1/VST1 instructions.
Jim Grosbach [Tue, 15 Nov 2011 17:49:59 +0000 (17:49 +0000)]
ARM parsing datatype suffix variants for register-writeback VLD1/VST1 instructions.

rdar://10435076

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

12 years agoTidy up. 80 columns.
Jim Grosbach [Tue, 15 Nov 2011 16:46:22 +0000 (16:46 +0000)]
Tidy up. 80 columns.

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

12 years agoRemove all remaining uses of Value::getNameStr().
Benjamin Kramer [Tue, 15 Nov 2011 16:27:03 +0000 (16:27 +0000)]
Remove all remaining uses of Value::getNameStr().

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

12 years agoTwinify GraphWriter a little bit.
Benjamin Kramer [Tue, 15 Nov 2011 16:26:38 +0000 (16:26 +0000)]
Twinify GraphWriter a little bit.

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

12 years agoCheck all overlaps when looking for used registers.
Jakob Stoklund Olesen [Tue, 15 Nov 2011 08:20:43 +0000 (08:20 +0000)]
Check all overlaps when looking for used registers.

A function using any RC alias is enough to enable the ExeDepsFix pass.

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

12 years agoMake use of MachinePointerInfo::getFixedStack.
Jay Foad [Tue, 15 Nov 2011 07:51:13 +0000 (07:51 +0000)]
Make use of MachinePointerInfo::getFixedStack.

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

12 years agoRemove some unnecessary includes of PseudoSourceValue.h.
Jay Foad [Tue, 15 Nov 2011 07:50:46 +0000 (07:50 +0000)]
Remove some unnecessary includes of PseudoSourceValue.h.

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

12 years agoFix typo in comment.
Jay Foad [Tue, 15 Nov 2011 07:50:05 +0000 (07:50 +0000)]
Fix typo in comment.

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

12 years agoMake use of MachinePointerInfo::getFixedStack. This removes all mention
Jay Foad [Tue, 15 Nov 2011 07:34:52 +0000 (07:34 +0000)]
Make use of MachinePointerInfo::getFixedStack. This removes all mention
of PseudoSourceValue from lib/Target/.

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

12 years agoRemove some unnecessary includes of PseudoSourceValue.h.
Jay Foad [Tue, 15 Nov 2011 07:24:32 +0000 (07:24 +0000)]
Remove some unnecessary includes of PseudoSourceValue.h.

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

12 years agoRevert r144611 and r144613.
Jakob Stoklund Olesen [Tue, 15 Nov 2011 07:13:03 +0000 (07:13 +0000)]
Revert r144611 and r144613.

These tests are actually correct, clang was miscompiling ExeDepsFix::processUses.

Evan fixed the miscompilation in r144628.

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

12 years agoFix PR11370 for real. Prevents converting 256-bit FP instruction to AVX2 256-bit...
Craig Topper [Tue, 15 Nov 2011 06:39:01 +0000 (06:39 +0000)]
Fix PR11370 for real. Prevents converting 256-bit FP instruction to AVX2 256-bit integer instructions when AVX2 isn't enabled.

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

12 years agoSet SeenStore to true to prevent loads from being moved; also eliminates a non-determ...
Evan Cheng [Tue, 15 Nov 2011 06:26:51 +0000 (06:26 +0000)]
Set SeenStore to true to prevent loads from being moved; also eliminates a non-deterministic behavior.

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

12 years agoRather than trying to use the loop block sequence *or* the function
Chandler Carruth [Tue, 15 Nov 2011 06:26:43 +0000 (06:26 +0000)]
Rather than trying to use the loop block sequence *or* the function
block sequence when recovering from unanalyzable control flow
constructs, *always* use the function sequence. I'm not sure why I ever
went down the path of trying to use the loop sequence, it is
fundamentally not the correct sequence to use. We're trying to preserve
the incoming layout in the cases of unreasonable control flow, and that
is only encoded at the function level. We already have a filter to
select *exactly* the sub-set of blocks within the function that we're
trying to form into a chain.

The resulting code layout is also significantly better because of this.
In several places we were ending up with completely unreasonable control
flow constructs due to the ordering chosen by the loop structure for its
internal storage. This change removes a completely wasteful vector of
basic blocks, saving memory allocation in the common case even though it
costs us CPU in the fairly rare case of unnatural loops. Finally, it
fixes the latest crasher reduced out of GCC's single source. Thanks
again to Benjamin Kramer for the reduction, my bugpoint skills failed at
it.

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

12 years agoProperly qualify AVX2 specific parts of execution dependency table. Also enable conve...
Craig Topper [Tue, 15 Nov 2011 05:55:35 +0000 (05:55 +0000)]
Properly qualify AVX2 specific parts of execution dependency table. Also enable converting between 256-bit PS/PD operations when AVX1 is enabled. Fixes PR11370.

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

12 years agoinclude/llvm/Support/Compiler.h: Invalidate LLVM_ATTRIBUTE_WEAK on cygming for now.
NAKAMURA Takumi [Tue, 15 Nov 2011 05:24:26 +0000 (05:24 +0000)]
include/llvm/Support/Compiler.h: Invalidate LLVM_ATTRIBUTE_WEAK on cygming for now.

It triggers generating insane executables with both binutils-2.19.1(msysgit) and 2.22.51.20111013(cygwin).

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

12 years agoReally fix test.
Jakob Stoklund Olesen [Tue, 15 Nov 2011 03:17:01 +0000 (03:17 +0000)]
Really fix test.

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

12 years agoAllow for depencendy-breaking instructions before cvt*.
Jakob Stoklund Olesen [Tue, 15 Nov 2011 02:29:48 +0000 (02:29 +0000)]
Allow for depencendy-breaking instructions before cvt*.

This should unbreak clang-x86_64-darwin10-RA, but I can't actually
reproduce the failure.

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

12 years agoAdd vmov.f32 to materialize f32 immediate splats which cannot be handled by
Evan Cheng [Tue, 15 Nov 2011 02:12:34 +0000 (02:12 +0000)]
Add vmov.f32 to materialize f32 immediate splats which cannot be handled by
integer variants. rdar://10437054

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

12 years agoARM parsing datatype suffix variants for fixed-writeback VLD1/VST1 instructions.
Jim Grosbach [Tue, 15 Nov 2011 01:46:57 +0000 (01:46 +0000)]
ARM parsing datatype suffix variants for fixed-writeback VLD1/VST1 instructions.

rdar://10435076

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

12 years agoMove WEAK marking to the declaration.
Nick Lewycky [Tue, 15 Nov 2011 01:23:22 +0000 (01:23 +0000)]
Move WEAK marking to the declaration.

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

12 years agoBreak false dependencies before partial register updates.
Jakob Stoklund Olesen [Tue, 15 Nov 2011 01:15:30 +0000 (01:15 +0000)]
Break false dependencies before partial register updates.

Two new TargetInstrInfo hooks lets the target tell ExecutionDepsFix
about instructions with partial register updates causing false unwanted
dependencies.

The ExecutionDepsFix pass will break the false dependencies if the
updated register was written in the previoius N instructions.

The small loop added to sse-domains.ll runs twice as fast with
dependency-breaking instructions inserted.

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

12 years agoTrack register ages more accurately.
Jakob Stoklund Olesen [Tue, 15 Nov 2011 01:15:25 +0000 (01:15 +0000)]
Track register ages more accurately.

Keep track of the last instruction to define each register individually
instead of per DomainValue.  This lets us track more accurately when a
register was last written.

Also track register ages across basic blocks.  When entering a new
basic block, use the least stale predecessor def as a worst case
estimate for register age.

The register age is used to arbitrate between conflicting domains. The
most recently defined register wins.

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

12 years agoAdd ObjCPropertyDebugInfo.html
Devang Patel [Tue, 15 Nov 2011 01:14:37 +0000 (01:14 +0000)]
Add ObjCPropertyDebugInfo.html

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

12 years agoDocument debug info support for objective-c properties.
Devang Patel [Tue, 15 Nov 2011 01:11:58 +0000 (01:11 +0000)]
Document debug info support  for objective-c properties.

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

12 years agoTidy up. Formatting.
Jim Grosbach [Tue, 15 Nov 2011 01:05:12 +0000 (01:05 +0000)]
Tidy up. Formatting.

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

12 years agoFix linking for some users who already have tsan enabled code and are trying to
Nick Lewycky [Tue, 15 Nov 2011 00:14:04 +0000 (00:14 +0000)]
Fix linking for some users who already have tsan enabled code and are trying to
link it against llvm code, by making our definitions weak. "Some users."

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

12 years agoARM parsing datatype suffix variants for non-writeback VST1 instructions.
Jim Grosbach [Mon, 14 Nov 2011 23:43:46 +0000 (23:43 +0000)]
ARM parsing datatype suffix variants for non-writeback VST1 instructions.

rdar://10435076

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

12 years agoARM parsing datatype suffix variants for non-writeback VLD1 instructions.
Jim Grosbach [Mon, 14 Nov 2011 23:32:59 +0000 (23:32 +0000)]
ARM parsing datatype suffix variants for non-writeback VLD1 instructions.

rdar://10435076

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

12 years agoAdd explanatory comment.
Jim Grosbach [Mon, 14 Nov 2011 23:21:09 +0000 (23:21 +0000)]
Add explanatory comment.

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

12 years agoSplit out the plain '.{8|16|32|64}' suffix handling.
Jim Grosbach [Mon, 14 Nov 2011 23:20:14 +0000 (23:20 +0000)]
Split out the plain '.{8|16|32|64}' suffix handling.

Make it easier to deal with aliases for instructions that do require a suffix
but accept more specific variants of the same size.

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

12 years agoARM parsing optional datatype suffix for VAND/VEOR/VORR instructions.
Jim Grosbach [Mon, 14 Nov 2011 23:11:19 +0000 (23:11 +0000)]
ARM parsing optional datatype suffix for VAND/VEOR/VORR instructions.

rdar://10435076

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

12 years agoSupporting inline memmove isn't going to be worthwhile. The only way to avoid
Chad Rosier [Mon, 14 Nov 2011 23:04:09 +0000 (23:04 +0000)]
Supporting inline memmove isn't going to be worthwhile.  The only way to avoid
violating a dependency is to emit all loads prior to stores.  This would likely
cause a great deal of spillage offsetting any potential gains.

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

12 years agoARM VLDR/VSTR instructions don't need a size suffix.
Jim Grosbach [Mon, 14 Nov 2011 23:03:21 +0000 (23:03 +0000)]
ARM VLDR/VSTR instructions don't need a size suffix.

Canonicallize on the non-suffixed form, but continue to accept assembly that
has any correctly sized type suffix.

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

12 years agoRefactor capture tracking (which already had a couple flags for whether returns
Nick Lewycky [Mon, 14 Nov 2011 22:49:42 +0000 (22:49 +0000)]
Refactor capture tracking (which already had a couple flags for whether returns
and stores capture) to permit the caller to see each capture point and decide
whether to continue looking.

Use this inside memdep to do an analysis that basicaa won't do. This lets us
solve another devirtualization case, fixing PR8908!

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

12 years agoAdd newline to end of file. Thanks, Eli.
Chad Rosier [Mon, 14 Nov 2011 22:48:33 +0000 (22:48 +0000)]
Add newline to end of file.  Thanks, Eli.

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

12 years agoAdd support for inlining small memcpys.
Chad Rosier [Mon, 14 Nov 2011 22:46:17 +0000 (22:46 +0000)]
Add support for inlining small memcpys.
rdar://10412592

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

12 years agoFix a performance regression from r144565. Positive offsets were being lowered
Chad Rosier [Mon, 14 Nov 2011 22:34:48 +0000 (22:34 +0000)]
Fix a performance regression from r144565. Positive offsets were being lowered
into registers, rather then encoded directly in the load/store.

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

12 years agoARM assembly parsing type suffix options for VLDR/VSTR.
Jim Grosbach [Mon, 14 Nov 2011 22:28:39 +0000 (22:28 +0000)]
ARM assembly parsing type suffix options for VLDR/VSTR.

rdar://10435076

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

12 years agoFix Windows build, don't try to #include <pthread.h> when we know it's not
Nick Lewycky [Mon, 14 Nov 2011 22:10:23 +0000 (22:10 +0000)]
Fix Windows build, don't try to #include <pthread.h> when we know it's not
available.

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

12 years agoAvoid dereferencing off the beginning of lists.
Evan Cheng [Mon, 14 Nov 2011 21:11:15 +0000 (21:11 +0000)]
Avoid dereferencing off the beginning of lists.

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

12 years agoAt -O0, multiple uses of a virtual registers in the same BB are being marked
Evan Cheng [Mon, 14 Nov 2011 21:02:09 +0000 (21:02 +0000)]
At -O0, multiple uses of a virtual registers in the same BB are being marked
"kill". This looks like a bug upstream. Since that's going to take some time
to understand, loosen the assertion and disable the optimization when
multiple kills are seen.

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

12 years agoAdd support for tsan annotations (thread sanitizer, a valgrind-based tool).
Nick Lewycky [Mon, 14 Nov 2011 20:50:16 +0000 (20:50 +0000)]
Add support for tsan annotations (thread sanitizer, a valgrind-based tool).
These annotations are disabled entirely when either ENABLE_THREADS is off, or
building a release build. When enabled, they add calls to functions with no
statements to ManagedStatic's getters.

Use these annotations to inform tsan that the race used inside ManagedStatic
initialization is actually benign. Thanks to Kostya Serebryany for helping
write this patch!

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

12 years agoAdd a missing pattern for X86ISD::MOVLPD. rdar://10436044
Evan Cheng [Mon, 14 Nov 2011 20:35:52 +0000 (20:35 +0000)]
Add a missing pattern for X86ISD::MOVLPD. rdar://10436044

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

12 years agoAdd support for Thumb load/stores with negative offsets.
Chad Rosier [Mon, 14 Nov 2011 20:22:27 +0000 (20:22 +0000)]
Add support for Thumb load/stores with negative offsets.
rdar://10412592

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

12 years agoUnbreak Release builds.
Benjamin Kramer [Mon, 14 Nov 2011 19:51:48 +0000 (19:51 +0000)]
Unbreak Release builds.

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

12 years agoTeach two-address pass to re-schedule two-address instructions (or the kill
Evan Cheng [Mon, 14 Nov 2011 19:48:55 +0000 (19:48 +0000)]
Teach two-address pass to re-schedule two-address instructions (or the kill
instructions of the two-address operands) in order to avoid inserting copies.
This fixes the few regressions introduced when the two-address hack was
disabled (without regressing the improvements).
rdar://10422688

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

12 years agoChanged SSE4/AVX <2 x i64> extract and insert ops to be Custom lowered
Pete Cooper [Mon, 14 Nov 2011 19:38:42 +0000 (19:38 +0000)]
Changed SSE4/AVX <2 x i64> extract and insert ops to be Custom lowered

Constant idx case is still done in tablegen but other cases are then expanded

Fixes <rdar://problem/10435460>

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

12 years agoFold ConstantVector::isAllOnesValue into Constant::isAllOnesValue and simplify it.
Benjamin Kramer [Mon, 14 Nov 2011 19:12:20 +0000 (19:12 +0000)]
Fold ConstantVector::isAllOnesValue into Constant::isAllOnesValue and simplify it.

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

12 years ago32-to-64-bit extended load.
Akira Hatanaka [Mon, 14 Nov 2011 19:06:14 +0000 (19:06 +0000)]
32-to-64-bit extended load.

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

12 years agoAnalyzeCallOperands function for N32/64.
Akira Hatanaka [Mon, 14 Nov 2011 19:02:54 +0000 (19:02 +0000)]
AnalyzeCallOperands function for N32/64.

N32/64 places all variable arguments in integer registers (or on stack),
regardless of their types, but follows calling convention of non-vaarg function
when it handles fixed arguments.

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

12 years agoModify LowerFormalArguments to correctly handle vaarg arguments for Mips64.
Akira Hatanaka [Mon, 14 Nov 2011 19:01:09 +0000 (19:01 +0000)]
Modify LowerFormalArguments to correctly handle vaarg arguments for Mips64.

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

12 years agoPTX: Let LLVM use loads/stores for all mem* intrinsics, instead of relying on custom...
Justin Holewinski [Mon, 14 Nov 2011 18:58:20 +0000 (18:58 +0000)]
PTX: Let LLVM use loads/stores for all mem* intrinsics, instead of relying on custom implementations.

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

12 years agoAdd release notes for the MicroBlaze backend.
Wesley Peck [Mon, 14 Nov 2011 18:56:41 +0000 (18:56 +0000)]
Add release notes for the MicroBlaze backend.

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

12 years agoRemove variable that keeps the size of area used to save byval or variable
Akira Hatanaka [Mon, 14 Nov 2011 18:56:20 +0000 (18:56 +0000)]
Remove variable that keeps the size of area used to save byval or variable
argument registers on the callee's stack frame, along with functions that set
and get it.

It is not necessary to add the size of this area when computing stack size in
emitPrologue, since it has already been accounted for in
PEI::calculateFrameObjectOffsets.

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

12 years agoFix early-clobber handling in shrinkToUses.
Jakob Stoklund Olesen [Mon, 14 Nov 2011 18:45:38 +0000 (18:45 +0000)]
Fix early-clobber handling in shrinkToUses.

I broke this in r144515, it affected most ARM testers.

<rdar://problem/10441389>

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

12 years agoDisable generation of compact unwind encodings. <rdar://problem/10441578>
Bob Wilson [Mon, 14 Nov 2011 18:21:07 +0000 (18:21 +0000)]
Disable generation of compact unwind encodings.  <rdar://problem/10441578>

This still seems to be causing some failures.  It needs more testing before
it gets enabled again.

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

12 years agoDelete stale comment.
Jakob Stoklund Olesen [Mon, 14 Nov 2011 18:03:05 +0000 (18:03 +0000)]
Delete stale comment.

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

12 years agoTidy up. 80 column.
Jim Grosbach [Mon, 14 Nov 2011 17:52:47 +0000 (17:52 +0000)]
Tidy up. 80 column.

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

12 years agoMake headers standalone.
Benjamin Kramer [Mon, 14 Nov 2011 17:45:03 +0000 (17:45 +0000)]
Make headers standalone.

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

12 years agoMake headers standalone, move a virtual method out of line.
Benjamin Kramer [Mon, 14 Nov 2011 17:22:45 +0000 (17:22 +0000)]
Make headers standalone, move a virtual method out of line.

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

12 years agobuild/Make: Switch over to using llvm-config-2 for dependencies one more (hopefully...
Daniel Dunbar [Mon, 14 Nov 2011 17:17:45 +0000 (17:17 +0000)]
build/Make: Switch over to using llvm-config-2 for dependencies one more (hopefully last) time, now that it also builds as a build tool.

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

12 years agoIt helps to deallocate memory as well as allocate it. =] This actually
Chandler Carruth [Mon, 14 Nov 2011 10:57:23 +0000 (10:57 +0000)]
It helps to deallocate memory as well as allocate it. =] This actually
cleans up all the chains allocated during the processing of each
function so that for very large inputs we don't just grow memory usage
without bound.

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

12 years agoRemove an over-eager assert that was firing on one of the ARM regression
Chandler Carruth [Mon, 14 Nov 2011 10:55:53 +0000 (10:55 +0000)]
Remove an over-eager assert that was firing on one of the ARM regression
tests when I forcibly enabled block placement.

It is apparantly possible for an unanalyzable block to fallthrough to
a non-loop block. I don't actually beleive this is correct, I believe
that 'canFallThrough' is returning true needlessly for the code
construct, and I've left a bit of a FIXME on the verification code to
try to track down why this is coming up.

Anyways, removing the assert doesn't degrade the correctness of the algorithm.

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

12 years agoBegin chipping away at one of the biggest quadratic-ish behaviors in
Chandler Carruth [Mon, 14 Nov 2011 09:46:33 +0000 (09:46 +0000)]
Begin chipping away at one of the biggest quadratic-ish behaviors in
this pass. We're leaving already merged blocks on the worklist, and
scanning them again and again only to determine each time through that
indeed they aren't viable. We can instead remove them once we're going
to have to scan the worklist. This is the easy way to implement removing
them. If this remains on the profile (as I somewhat suspect it will), we
can get a lot more clever here, as the worklist's order is essentially
irrelevant. We can use swapping and fold the two loops to reduce
overhead even when there are many blocks on the worklist but only a few
of them are removed.

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

12 years agoUnder the hood, MBPI is doing a linear scan of every successor every
Chandler Carruth [Mon, 14 Nov 2011 09:12:57 +0000 (09:12 +0000)]
Under the hood, MBPI is doing a linear scan of every successor every
time it is queried to compute the probability of a single successor.
This makes computing the probability of every successor of a block in
sequence... really really slow. ;] This switches to a linear walk of the
successors rather than a quadratic one. One of several quadratic
behaviors slowing this pass down.

I'm not really thrilled with moving the sum code into the public
interface of MBPI, but I don't (at the moment) have ideas for a better
interface. My direction I'm thinking in for a better interface is to
have MBPI actually retain much more state and make *all* of these
queries cheap. That's a lot of work, and would require invasive changes.
Until then, this seems like the least bad (ie, least quadratic)
solution. Suggestions welcome.

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

12 years agoAdd clang_complete to release notes
Tobias Grosser [Mon, 14 Nov 2011 09:09:26 +0000 (09:09 +0000)]
Add clang_complete to release notes

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

12 years agoAdd Polly to release notes
Tobias Grosser [Mon, 14 Nov 2011 09:09:23 +0000 (09:09 +0000)]
Add Polly to release notes

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

12 years agoReuse the logic in getEdgeProbability within getHotSucc in order to
Chandler Carruth [Mon, 14 Nov 2011 08:55:59 +0000 (08:55 +0000)]
Reuse the logic in getEdgeProbability within getHotSucc in order to
correctly handle blocks whose successor weights sum to more than
UINT32_MAX. This is slightly less efficient, but the entire thing is
already linear on the number of successors. Calling it within any hot
routine is a mistake, and indeed no one is calling it. It also
simplifies the code.

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

12 years agoFix an overflow bug in MachineBranchProbabilityInfo. This pass relied on
Chandler Carruth [Mon, 14 Nov 2011 08:50:16 +0000 (08:50 +0000)]
Fix an overflow bug in MachineBranchProbabilityInfo. This pass relied on
the sum of the edge weights not overflowing uint32, and crashed when
they did. This is generally safe as BranchProbabilityInfo tries to
provide this guarantee. However, the CFG can get modified during codegen
in a way that grows the *sum* of the edge weights. This doesn't seem
unreasonable (imagine just adding more blocks all with the default
weight of 16), but it is hard to come up with a case that actually
triggers 32-bit overflow. Fortuately, the single-source GCC build is
good at this. The solution isn't very pretty, but its no worse than the
previous code. We're already summing all of the edge weights on each
query, we can sum them, check for an overflow, compute a scale, and sum
them again.

I've included a *greatly* reduced test case out of the GCC source that
triggers it. It's a pretty lame test, as it clearly is just barely
triggering the overflow. I'd like to have something that is much more
definitive, but I don't understand the fundamental pattern that triggers
an explosion in the edge weight sums.

The buggy code is duplicated within this file. I'll colapse them into
a single implementation in a subsequent commit.

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

12 years agoAdd AVX2 version of instructions to load folding tables. Also add a bunch of missing...
Craig Topper [Mon, 14 Nov 2011 08:07:55 +0000 (08:07 +0000)]
Add AVX2 version of instructions to load folding tables. Also add a bunch of missing SSE/AVX instructions.

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

12 years agoAdd a cautionary note to this API. It was not at all obvious to me how
Chandler Carruth [Mon, 14 Nov 2011 06:51:49 +0000 (06:51 +0000)]
Add a cautionary note to this API. It was not at all obvious to me how
expensive the most useful interface to this analysis is.

Fun story -- it's also not correct. That's getting fixed in another
patch.

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

12 years agoAdd neverHasSideEffects, mayLoad, and mayStore to many patternless SSE/AVX instructio...
Craig Topper [Mon, 14 Nov 2011 06:46:21 +0000 (06:46 +0000)]
Add neverHasSideEffects, mayLoad, and mayStore to many patternless SSE/AVX instructions. Remove MMX check from LowerVECTOR_SHUFFLE since MMX vector types won't go through it anyway.

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

12 years agoAdd support for ARM halfword load/stores and signed byte loads with negative
Chad Rosier [Mon, 14 Nov 2011 04:09:28 +0000 (04:09 +0000)]
Add support for ARM halfword load/stores and signed byte loads with negative
offsets.
rdar://10412592

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

12 years agoUse getVNInfoBefore() when it makes sense.
Jakob Stoklund Olesen [Mon, 14 Nov 2011 01:39:36 +0000 (01:39 +0000)]
Use getVNInfoBefore() when it makes sense.

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

12 years agoTeach machine block placement to cope with unnatural loops. These don't
Chandler Carruth [Mon, 14 Nov 2011 00:00:35 +0000 (00:00 +0000)]
Teach machine block placement to cope with unnatural loops. These don't
get loop info structures associated with them, and so we need some way
to make forward progress selecting and placing basic blocks. The
technique used here is pretty brutal -- it just scans the list of blocks
looking for the first unplaced candidate. It keeps placing blocks like
this until the CFG becomes tractable.

The cost is somewhat unfortunate, it requires allocating a vector of all
basic block pointers eagerly. I have some ideas about how to simplify
and optimize this, but I'm trying to get the logic correct first.

Thanks to Benjamin Kramer for the reduced test case out of GCC. Sadly
there are other bugs that GCC is tickling that I'm reducing and working
on now.

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

12 years agoUse kill slots instead of the previous slot in shrinkToUses.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 23:53:25 +0000 (23:53 +0000)]
Use kill slots instead of the previous slot in shrinkToUses.

It's more natural to use the actual end points.

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

12 years agoCleanup some 80-columns violations and poor formatting. These snuck by
Chandler Carruth [Sun, 13 Nov 2011 22:50:09 +0000 (22:50 +0000)]
Cleanup some 80-columns violations and poor formatting. These snuck by
when I was reading through the code for style.

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

12 years agoTerminate all dead defs at the dead slot instead of the 'next' slot.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 22:42:13 +0000 (22:42 +0000)]
Terminate all dead defs at the dead slot instead of the 'next' slot.

This makes no difference for normal defs, but early clobber dead defs
now look like:

  [Slot_EarlyClobber; Slot_Dead)

instead of:

  [Slot_EarlyClobber; Slot_Register).

Live ranges for normal dead defs look like:

  [Slot_Register; Slot_Dead)

as before.

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

12 years agoFix comment for LegalizeTypeAction enum.
Craig Topper [Sun, 13 Nov 2011 22:11:24 +0000 (22:11 +0000)]
Fix comment for LegalizeTypeAction enum.

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

12 years agoSimplify early clobber slots a bit.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 22:05:42 +0000 (22:05 +0000)]
Simplify early clobber slots a bit.

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

12 years agoEnhance the assertion mechanisms in place to make it easier to catch
Chandler Carruth [Sun, 13 Nov 2011 21:39:51 +0000 (21:39 +0000)]
Enhance the assertion mechanisms in place to make it easier to catch
when we fail to place all the blocks of a loop. Currently this is
happening for unnatural loops, and this logic helps more immediately
point to the problem.

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

12 years agoRename SlotIndexes to match how they are used.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 20:45:27 +0000 (20:45 +0000)]
Rename SlotIndexes to match how they are used.

The old naming scheme (load/use/def/store) can be traced back to an old
linear scan article, but the names don't match how slots are actually
used.

The load and store slots are not needed after the deferred spill code
insertion framework was deleted.

The use and def slots don't make any sense because we are using
half-open intervals as is customary in C code, but the names suggest
closed intervals.  In reality, these slots were used to distinguish
early-clobber defs from normal defs.

The new naming scheme also has 4 slots, but the names match how the
slots are really used.  This is a purely mechanical renaming, but some
of the code makes a lot more sense now.

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

12 years agoAdd BLSI, BLSMSK, and BLSR to getTargetNodeName.
Craig Topper [Sun, 13 Nov 2011 17:31:07 +0000 (17:31 +0000)]
Add BLSI, BLSMSK, and BLSR to getTargetNodeName.

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

12 years agoTeach MBP to force-merge layout successors for blocks with unanalyzable
Chandler Carruth [Sun, 13 Nov 2011 12:17:28 +0000 (12:17 +0000)]
Teach MBP to force-merge layout successors for blocks with unanalyzable
branches that also may involve fallthrough. In the case of blocks with
no fallthrough, we can still re-order the blocks profitably. For example
instruction decoding will in some cases continue past an indirect jump,
making laying out its most likely successor there profitable.

Note, no test case. I don't know how to write a test case that exercises
this logic, but it matches the described desired semantics in
discussions with Jakob and others. If anyone has a nice example of IR
that will trigger this, that would be lovely.

Also note, there are still assertion failures in real world code with
this. I'm digging into those next, now that I know this isn't the cause.

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

12 years agoHoist another gross nested loop into a helper method.
Chandler Carruth [Sun, 13 Nov 2011 11:42:26 +0000 (11:42 +0000)]
Hoist another gross nested loop into a helper method.

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

12 years agoAdd a missing doxygen comment for a helper method.
Chandler Carruth [Sun, 13 Nov 2011 11:34:55 +0000 (11:34 +0000)]
Add a missing doxygen comment for a helper method.

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

12 years agoHoist a nested loop into its own method.
Chandler Carruth [Sun, 13 Nov 2011 11:34:53 +0000 (11:34 +0000)]
Hoist a nested loop into its own method.

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

12 years agoRewrite #3 of machine block placement. This is based somewhat on the
Chandler Carruth [Sun, 13 Nov 2011 11:20:44 +0000 (11:20 +0000)]
Rewrite #3 of machine block placement. This is based somewhat on the
second algorithm, but only loosely. It is more heavily based on the last
discussion I had with Andy. It continues to walk from the inner-most
loop outward, but there is a key difference. With this algorithm we
ensure that as we visit each loop, the entire loop is merged into
a single chain. At the end, the entire function is treated as a "loop",
and merged into a single chain. This chain forms the desired sequence of
blocks within the function. Switching to a single algorithm removes my
biggest problem with the previous approaches -- they had different
behavior depending on which system triggered the layout. Now there is
exactly one algorithm and one basis for the decision making.

The other key difference is how the chain is formed. This is based
heavily on the idea Andy mentioned of keeping a worklist of blocks that
are viable layout successors based on the CFG. Having this set allows us
to consistently select the best layout successor for each block. It is
expensive though.

The code here remains very rough. There is a lot that needs to be done
to clean up the code, and to make the runtime cost of this pass much
lower. Very much WIP, but this was a giant chunk of code and I'd rather
folks see it sooner than later. Everything remains behind a flag of
course.

I've added a couple of tests to exercise the issues that this iteration
was motivated by: loop structure preservation. I've also fixed one test
that was exhibiting the broken behavior of the previous version.

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

12 years agoThe order in which the predicate is added differs between Thumb and ARM mode. Fix...
Chad Rosier [Sun, 13 Nov 2011 09:44:21 +0000 (09:44 +0000)]
The order in which the predicate is added differs between Thumb and ARM mode.  Fix predicate when in ARM mode and restore SelectIntrinsicCall.

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

12 years agoTemporarily disable SelectIntrinsicCall when in ARM mode. This is causing failures.
Chad Rosier [Sun, 13 Nov 2011 05:14:43 +0000 (05:14 +0000)]
Temporarily disable SelectIntrinsicCall when in ARM mode. This is causing failures.

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

12 years agoFix comments.
Chad Rosier [Sun, 13 Nov 2011 04:25:02 +0000 (04:25 +0000)]
Fix comments.

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

12 years agoAdd support for emitting both signed- and zero-extend loads. Fix
Chad Rosier [Sun, 13 Nov 2011 02:23:59 +0000 (02:23 +0000)]
Add support for emitting both signed- and zero-extend loads.  Fix
SimplifyAddress to handle either a 12-bit unsigned offset or the ARM +/-imm8
offsets (addressing mode 3).  This enables a load followed by an integer
extend to be folded into a single load.

For example:
ldrb r1, [r0]       ldrb r1, [r0]
uxtb r2, r1     =>
mov  r3, r2         mov  r3, r1

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

12 years agoPrune more RALinScan. RALinScan was also here!
NAKAMURA Takumi [Sun, 13 Nov 2011 01:33:10 +0000 (01:33 +0000)]
Prune more RALinScan. RALinScan was also here!

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

12 years agoMore dead code elimination in VirtRegMap.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 01:23:34 +0000 (01:23 +0000)]
More dead code elimination in VirtRegMap.

This thing is looking a lot like a virtual register map now.

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

12 years agoStop tracking spill slot uses in VirtRegMap.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 01:23:30 +0000 (01:23 +0000)]
Stop tracking spill slot uses in VirtRegMap.

Nobody cared, StackSlotColoring scans the instructions to find used stack
slots.

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

12 years agoRemove dead code and data from VirtRegMap.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 01:02:04 +0000 (01:02 +0000)]
Remove dead code and data from VirtRegMap.

Most of this stuff was supporting the old deferred spill code insertion
mechanism.  Modern spillers just edit machine code in place.

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

12 years agoStop tracking unused registers in VirtRegMap.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 00:39:45 +0000 (00:39 +0000)]
Stop tracking unused registers in VirtRegMap.

The information was only used by the register allocator in
StackSlotColoring.

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

12 years agoRemove the -color-ss-with-regs option.
Jakob Stoklund Olesen [Sun, 13 Nov 2011 00:31:23 +0000 (00:31 +0000)]
Remove the -color-ss-with-regs option.

It was off by default.

The new register allocators don't have the problems that made it
necessary to reallocate registers during stack slot coloring.

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