Joel Jones [Thu, 24 May 2012 04:38:50 +0000 (04:38 +0000)]
Reflect that tblgen is now llvm-tblgen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157371
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 24 May 2012 04:22:05 +0000 (04:22 +0000)]
Mark a couple arrays as static and const. Use array_lengthof instead of sizeof/sizeof.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157369
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 24 May 2012 04:11:15 +0000 (04:11 +0000)]
Mark a static array as const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157368
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 24 May 2012 03:59:11 +0000 (03:59 +0000)]
Mark a static table as const. Shrink opcode size in static tables to uint16_t. Simplify loop iterating over one of those tables. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157367
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 23 May 2012 23:45:10 +0000 (23:45 +0000)]
Tidy up naming for consistency and other cleanup. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157358
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 23 May 2012 23:42:23 +0000 (23:42 +0000)]
Add a test case for global live range splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157357
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 23 May 2012 22:37:27 +0000 (22:37 +0000)]
Add a last resort tryInstructionSplit() to RAGreedy.
Live ranges with a constrained register class may benefit from splitting
around individual uses. It allows the remaining live range to use a
larger register class where it may allocate. This is like spilling to a
different register class.
This is only attempted on constrained register classes.
<rdar://problem/
11438902>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157354
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 23 May 2012 22:12:50 +0000 (22:12 +0000)]
Forgot to reverse conditional.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157349
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 23 May 2012 22:09:50 +0000 (22:09 +0000)]
Reduce indentation by early detection of 'continue'. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157348
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolas Geoffray [Wed, 23 May 2012 20:34:19 +0000 (20:34 +0000)]
llvm-ld does not exist anymore, use llvm-link instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157342
91177308-0d34-0410-b5e6-
96231b3b80d8
Kaelyn Uhrain [Wed, 23 May 2012 20:21:36 +0000 (20:21 +0000)]
Fix typo in flag to opt, and also a CHECK-NEXT that doesn't follow a
CHECK. The latter error was hidden by the former, and the test harness
used by e.g. "make check" silently ignored that opt was printing an
error message about an unknown flag instead of running on the test file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157341
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 23 May 2012 20:21:06 +0000 (20:21 +0000)]
Correctly deal with identity copies in RegisterCoalescer.
Now that the coalescer keeps live intervals and machine code in sync at
all times, it needs to deal with identity copies differently.
When merging two virtual registers, all identity copies are removed
right away. This means that other identity copies must come from
somewhere else, and they are going to have a value number.
Deal with such copies by merging the value numbers before erasing the
copy instruction. Otherwise, we leave dangling value numbers in the live
interval.
This fixes PR12927.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157340
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 23 May 2012 18:42:02 +0000 (18:42 +0000)]
Fix how CMake appends -m32 to linker command-lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157337
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 23 May 2012 18:38:57 +0000 (18:38 +0000)]
[arm-fast-isel] Add support for non-global callee.
Patch by Jush Lu <jush.msn@gmail.com>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157336
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Wed, 23 May 2012 16:24:52 +0000 (16:24 +0000)]
BoundsChecking: add a couple of simple tests and fix a bug in branch emition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157329
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Wed, 23 May 2012 15:19:39 +0000 (15:19 +0000)]
revert r156383: removal of TYPE_CODE_FUNCTION_OLD
Apparently LLVM only stopped emitting this after LLVM 3.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157325
91177308-0d34-0410-b5e6-
96231b3b80d8
Patrik Hägglund [Wed, 23 May 2012 13:42:57 +0000 (13:42 +0000)]
Fix the inliner so that the optsize function attribute don't alter the
inline threshold if the global inline threshold is lower (as for -Oz).
Reviewed by Chandler Carruth and Bill Wendling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157323
91177308-0d34-0410-b5e6-
96231b3b80d8
Patrik Hägglund [Wed, 23 May 2012 12:34:56 +0000 (12:34 +0000)]
Fixed typo in r156905.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157320
91177308-0d34-0410-b5e6-
96231b3b80d8
Patrik Hägglund [Wed, 23 May 2012 12:12:58 +0000 (12:12 +0000)]
Small fix for the debug output from PBQP (PR12822).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157319
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Wed, 23 May 2012 11:52:12 +0000 (11:52 +0000)]
Use zero-based shadow by default on Android.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157317
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Wed, 23 May 2012 08:18:26 +0000 (08:18 +0000)]
PR1255(case ranges) related changes in Local Transformations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157315
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 23 May 2012 05:44:51 +0000 (05:44 +0000)]
Tidy up spacing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157313
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 May 2012 05:19:18 +0000 (05:19 +0000)]
small refinement to r157218 to save a tiny amount of table size in the common
case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157312
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 23 May 2012 03:59:53 +0000 (03:59 +0000)]
Fix indentation of wrapped line for readability. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157309
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 23 May 2012 00:09:20 +0000 (00:09 +0000)]
Add support for C++11 enum classes in llvm.
Part of rdar://
11496790
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157303
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Tue, 22 May 2012 22:02:19 +0000 (22:02 +0000)]
address some of John Criswell's comments
teach computeAllocSize about realloc, reallocf, and valloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157298
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 22 May 2012 21:47:02 +0000 (21:47 +0000)]
ARMDisassembler.cpp: Fix utf8 char in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157292
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 22 May 2012 18:45:24 +0000 (18:45 +0000)]
Untabify and 80-col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157274
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 22 May 2012 18:45:18 +0000 (18:45 +0000)]
Formatting consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157273
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 22 May 2012 18:20:28 +0000 (18:20 +0000)]
Also compute TopoSigs in synthetic register classes.
CodeGenRegisterClass has two constructors. Both need to compute the
TopoSigs BitVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157271
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Tue, 22 May 2012 17:40:46 +0000 (17:40 +0000)]
hopefully fix the CMake build. sorry for breakage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157264
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Tue, 22 May 2012 17:39:59 +0000 (17:39 +0000)]
LSR fix: add a missing phi check during IV hoisting.
Fixes PR12898: SCEVExpander crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157263
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Tue, 22 May 2012 17:19:09 +0000 (17:19 +0000)]
add a new pass to instrument loads and stores for run-time bounds checking
move EmitGEPOffset from InstCombine to Transforms/Utils/Local.h
(a draft of this) patch reviewed by Andrew, thanks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157261
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Tue, 22 May 2012 15:25:31 +0000 (15:25 +0000)]
revert my previous patches that introduced an additional parameter to the objectsize intrinsic.
After a lot of discussion, we realized it's not the best option for run-time bounds checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157255
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 22 May 2012 14:52:12 +0000 (14:52 +0000)]
Only erase virtregs with no uses left.
Also make sure registers aren't erased twice if the dead def mentions
the register twice.
This fixes PR12911.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157254
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Tue, 22 May 2012 14:17:53 +0000 (14:17 +0000)]
Fix PR12858, a crash due to GVN's PRE not fully removing an instruction from the
leader table. That's because it wasn't expecting instructions to turn up as
leader for a value number that is not its own, but equality propagation could
create this situation. One solution is to have the leader table use a WeakVH
but this slows down GVN by about 5%. Instead just have equality propagation not
add instructions to the leader table, only constants and arguments. In theory
this might cause GVN to run more (each time it changes something it runs again)
but it doesn't seem to occur enough to cause a slow down.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157251
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 22 May 2012 06:09:38 +0000 (06:09 +0000)]
Fix constant used for pshufb mask when lowering v16i8 shuffles. Bug introduced in r157043. Fixes PR12908.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157236
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 22 May 2012 03:10:09 +0000 (03:10 +0000)]
This patch adds a predicate to existing mips32 and mips64 so that those
instruction encodings can be excluded during mips16 processing.
This revision fixes the issue raised by Jim Grosbach.
bool hasStandardEncoding() const { return !inMips16Mode(); }
When micromips is added it will be
bool StandardEncoding() const { return !inMips16Mode()&& !inMicroMipsMode(); }
No additional testing is needed other than to assure that there is no regression
from this patch.
Patch by Reed Kotler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157234
91177308-0d34-0410-b5e6-
96231b3b80d8
Nuno Lopes [Tue, 22 May 2012 01:09:48 +0000 (01:09 +0000)]
fix the quotient returned by sdivrem() for the case when LHS is negative and RHS is positive
based on a patch by Preston Briggs, with some modifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157231
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Mon, 21 May 2012 23:50:00 +0000 (23:50 +0000)]
FileCheck'ize test, and add a bit to test for r157221.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157222
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Mon, 21 May 2012 23:34:42 +0000 (23:34 +0000)]
ARM: .end_data_region mismatch in Thumb2.
32-bit offset jump tables just use real branch instructions and so aren't
marked as data regions. We were still emitting the .end_data_region
marker though, which assert()ed.
rdar://
11499158
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157221
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 21 May 2012 23:21:28 +0000 (23:21 +0000)]
Added address space qualifier to intrinsic PointerType arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157218
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 21 May 2012 22:39:20 +0000 (22:39 +0000)]
Fix use of an unitialized value in the LegalizeOps expansion for ISD::SUB. No in-tree targets exercise this path.
Patch by Micah Villmow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157215
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Mon, 21 May 2012 17:57:17 +0000 (17:57 +0000)]
Thumb2: RSB source register should be rGRP not GPRnopc.
t2RSB defined the operand correctly, but tRSBS didn't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157200
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 21 May 2012 17:41:28 +0000 (17:41 +0000)]
Mark an unreachable region of code with llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157197
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 21 May 2012 17:13:41 +0000 (17:13 +0000)]
Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157195
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 21 May 2012 16:57:17 +0000 (16:57 +0000)]
Make it so that the MArch, MCPU, MAttrs passed to EngineBuilder are actually used.
Patch by Jose Fonseca.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157191
91177308-0d34-0410-b5e6-
96231b3b80d8
Patrik Hägglund [Mon, 21 May 2012 13:18:06 +0000 (13:18 +0000)]
test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157184
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Mon, 21 May 2012 10:44:40 +0000 (10:44 +0000)]
PR1255 (case ranges: work with ConstantRangesSet instead of ConstantInt) related changes for Execution and Verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157183
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 21 May 2012 06:40:16 +0000 (06:40 +0000)]
Allow 256-bit shuffles to still be split even if only half of the shuffle comes from two 128-bit pieces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157175
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Mon, 21 May 2012 03:11:23 +0000 (03:11 +0000)]
Give a small negative bias to giant edge bundles.
This helps compile time when the greedy register allocator splits live
ranges in giant functions. Without the bias, we would try to grow
regions through the giant edge bundles, usually to find out that the
region became too big and expensive.
If a live range has many uses in blocks near the giant bundle, the small
negative bias doesn't make a big difference, and we still consider
regions including the giant edge bundle.
Giant edge bundles are usually connected to landing pads or indirect
branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157174
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 21:41:05 +0000 (21:41 +0000)]
Clear kill flags on the fly when joining intervals.
With physreg joining out of the way, it is easy to recognize the
instructions that need their kill flags cleared while testing for
interference.
This allows us to skip the final scan of all instructions for an 11%
speedup of the coalescer pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157169
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sun, 20 May 2012 20:30:47 +0000 (20:30 +0000)]
Add RPO to the lexicon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157166
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 18:43:00 +0000 (18:43 +0000)]
Make the global base reg GR32_NOSP.
It can sometimes be used in addressing modes that don't support %ESP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157165
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 18:42:55 +0000 (18:42 +0000)]
Constrain regclasses in PeepholeOptimizer.
It can be necessary to restrict to a sub-class before accessing
sub-registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157164
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 18:42:51 +0000 (18:42 +0000)]
Constrain register classes in TailDup.
When rewriting operands, make sure the new registers have a compatible
register class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157163
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Sun, 20 May 2012 18:36:15 +0000 (18:36 +0000)]
When legalising shifts, do not pre-build a list of operands which
may be RAUW'd by the recursive call to LegalizeOps; instead, retrieve
the other operands when calling UpdateNodeOperands. Fixes PR12889.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157162
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 20 May 2012 18:10:42 +0000 (18:10 +0000)]
Emit memcmp directly from the StringMatcherEmitter.
There should be no difference in the resulting binary, given a sufficiently
smart compiler. However we already had compiler timeouts on the generated
code in Intrinsics.gen, this hopefully makes the lives of slow buildbots a
little easier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157161
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 20 May 2012 17:24:08 +0000 (17:24 +0000)]
Plug a leak when using MCJIT.
Found by valgrind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157160
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 20 May 2012 17:11:24 +0000 (17:11 +0000)]
Add a missing PPC 64-bit stwu pattern.
This seems to fix the remaining compile-time failures on PPC64 when
compiling with -enable-ppc-preinc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157159
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 20 May 2012 11:24:27 +0000 (11:24 +0000)]
Use TargetMachine's register info instead of creating a new one and leaking it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157155
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 06:38:47 +0000 (06:38 +0000)]
Use the right register class for LDRrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157152
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 06:38:42 +0000 (06:38 +0000)]
Transfer memory operands to the right instruction.
They need to go on the PICLDR as the verifier points out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157151
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 06:38:37 +0000 (06:38 +0000)]
Properly constrain register classes for sub-registers.
Not all GR64 registers have sub_8bit sub-registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157150
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 06:38:32 +0000 (06:38 +0000)]
Properly constrain register classes in 2-addr.
X86 has 2-addr instructions with different constraints on the tied def
and use operands. One is GR32, one is GR32_NOSP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157149
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 05:28:53 +0000 (05:28 +0000)]
Missed a push_back in r157147.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157148
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 04:52:48 +0000 (04:52 +0000)]
Avoid deleting extra copies when RegistersDefinedFromSameValue is true.
This function adds copies to be erased to DupCopies, avoid also adding
them to DeadCopies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157147
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 03:57:12 +0000 (03:57 +0000)]
Fix build bots.
Avoid looking at the operands of a potentially erased instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157146
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 02:54:52 +0000 (02:54 +0000)]
LiveRangeQuery simplifies shrinkToUses().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157145
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 02:44:38 +0000 (02:44 +0000)]
Use LiveRangeQuery in ScheduleDAGInstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157144
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 02:44:36 +0000 (02:44 +0000)]
Eliminate some uses of struct LiveRange.
That struct ought to be a LiveInterval implementation detail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157143
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 02:44:33 +0000 (02:44 +0000)]
Use LiveRangeQuery instead of getLiveRangeContaining().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157142
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sun, 20 May 2012 02:44:30 +0000 (02:44 +0000)]
Add a LiveRangeQuery class.
This class is meant to be the primary interface for examining a live
range in the vicinity on a given instruction. It avoids all the messy
dealings with iterators and early clobbers.
This is a more abstract interface to live ranges, hiding the
implementation as a vector of segments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157141
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Sun, 20 May 2012 01:32:09 +0000 (01:32 +0000)]
Do not pass an invalid domtree to SimplifyInstruction from
LoopUnswitch. Fixes PR12887.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157140
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 23:59:27 +0000 (23:59 +0000)]
Simplify overlap check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157137
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 23:34:59 +0000 (23:34 +0000)]
Fix 12892.
Dead code elimination during coalescing could cause a virtual register
to be split into connected components. The following rewriting would be
confused about the already joined copies present in the code, but
without a corresponding value number in the live range.
Erase all joined copies instantly when joining intervals such that the
MI and LiveInterval representations are always in sync.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157135
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Sat, 19 May 2012 22:52:10 +0000 (22:52 +0000)]
Do not eliminate allocas whose alignment exceeds that of the
copied-in constant, as a subsequent user may rely on over alignment.
Fixes PR12885.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157134
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sat, 19 May 2012 21:52:55 +0000 (21:52 +0000)]
Add a FIXME about access to negative stack-pointer offsets on PPC32.
The current code will generate a prologue which starts with something like:
mflr 0
stw 31, -4(1)
stw 0, 4(1)
stwu 1, -16(1)
But under the PPC32 SVR4 ABI, access to negative offsets from R1 is not allowed.
This was pointed out by Peter Bergner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157133
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 21:02:31 +0000 (21:02 +0000)]
Remove the late DCE in RegisterCoalescer.
Dead code and joined copies are now eliminated on the fly, and there is
no need for a post pass.
This makes the coalescer work like other modern register allocator
passes: Code is changed on the fly, there is no pending list of changes
to be committed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157132
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 20:54:07 +0000 (20:54 +0000)]
Erase joined copies immediately.
The late dead code elimination is no longer necessary.
The test changes are cause by a register hint that can be either %rdi or
%rax. The choice depends on the use list order, which this patch changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157131
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 20:54:03 +0000 (20:54 +0000)]
Fix an ancient bug in removeCopyByCommutingDef().
Before rewriting uses of one value in A to register B, check that there
are no tied uses. That would require multiple A values to be rewritten.
This bug can't bite in the current version of the code for a fairly
subtle reason: A tied use would have caused 2-addr to insert a copy
before the use. If the copy has been coalesced, it will be found by the
same loop changed by this patch, and the optimization is aborted.
This was exposed by 400.perlbench and lua after applying a patch that
deletes joined copies aggressively.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157130
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Sat, 19 May 2012 20:30:08 +0000 (20:30 +0000)]
On Haswell, perfer storing YMM registers using a single instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157129
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Sat, 19 May 2012 19:57:37 +0000 (19:57 +0000)]
Add support for additional in-reg vbroadcast patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157127
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 19 May 2012 19:32:11 +0000 (19:32 +0000)]
Disambiguate call to operator==.
clang++ and msvc happily had no problem with it but g++ refuses to compile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157126
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 19:25:00 +0000 (19:25 +0000)]
Collect inflatable virtual registers on the fly.
There is no reason to defer the collection of virtual registers whose
register class may be replaced with a larger class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157125
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 19 May 2012 19:15:32 +0000 (19:15 +0000)]
ValueMap: Use DenseMap's find_as mechanism to reduce use list churn.
Otherwise just looking up a value in the map requires creating a VH, adding it to the use lists and destroying it again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157124
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 19 May 2012 19:15:25 +0000 (19:15 +0000)]
Move CallbackVHs dtor inline, it can be devirtualized in many cases. Move the other virtual methods out of line as they are only called from within Value.cpp anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157123
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 19 May 2012 19:14:18 +0000 (19:14 +0000)]
Tidy up some spacing and inconsistent use of pre/post increment. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157122
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 19 May 2012 16:44:12 +0000 (16:44 +0000)]
Remove extra semicolons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157118
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 19 May 2012 13:28:54 +0000 (13:28 +0000)]
Provide move semantics for TinyPtrVector and for DenseMap's rehash function.
This makes DenseMap<..., TinyPtrVector<...>> as cheap as it always should've been!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157113
91177308-0d34-0410-b5e6-
96231b3b80d8
Stepan Dyatkovskiy [Sat, 19 May 2012 13:14:30 +0000 (13:14 +0000)]
Ordinary PR1255 patch: DifferenceEngine and CPPBackend adopted to the new SwitchInst methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157112
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 19 May 2012 08:28:17 +0000 (08:28 +0000)]
Copy some AVX support from MCJIT to JIT. Maybe will fix PR12748.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157109
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 05:25:59 +0000 (05:25 +0000)]
Eliminate dead code after remat.
This will remove the original def once it has no more uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157104
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 05:25:56 +0000 (05:25 +0000)]
Don't remat during updateRegDefsUses().
Remaining virtreg->physreg copies were rematerialized during
updateRegDefsUses(), but we already do the same thing in joinCopy() when
visiting the physreg copy instruction.
Eliminate the preserveSrcInt argument to reMaterializeTrivialDef(). It
is now always true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157103
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 05:25:53 +0000 (05:25 +0000)]
Immediately erase trivially useless copies.
There is no need for these instructions to stick around since they are
known to be not dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157102
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 05:25:50 +0000 (05:25 +0000)]
Run proper recursive dead code elimination during coalescing.
Dead copies cause problems because they are trivial to coalesce, but
removing them gived the live range a dangling end point. This patch
enables full dead code elimination which trims live ranges to their uses
so end points don't dangle.
DCE may erase multiple instructions. Put the pointers in an ErasedInstrs
set so we never risk visiting erased instructions in the work list.
There isn't supposed to be any dead copies entering RegisterCoalescer,
but they do slip by as evidenced by test/CodeGen/X86/coalescer-dce.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157101
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Sat, 19 May 2012 05:25:46 +0000 (05:25 +0000)]
Allow LiveRangeEdit to be created with a NULL parent.
The dead code elimination with callbacks is still useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157100
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 19 May 2012 01:36:37 +0000 (01:36 +0000)]
Actually support DW_TAG_rvalue_reference_type that we were trying
to generate out of the front end.
rdar://
11479676
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157094
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 19 May 2012 00:51:56 +0000 (00:51 +0000)]
Add support for the 'd' mips inline asm output modifier.
Patch by Jack Carter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157093
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Sat, 19 May 2012 00:48:25 +0000 (00:48 +0000)]
SCEV: Add MarkPendingLoopPredicates to avoid recursive isImpliedCond.
getUDivExpr attempts to simplify by checking for overflow.
isLoopEntryGuardedByCond then evaluates the loop predicate which
may lead to the same getUDivExpr causing endless recursion.
Fixes PR12868: clang 3.2 segmentation fault.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157092
91177308-0d34-0410-b5e6-
96231b3b80d8