Commit Graph

40770 Commits

Author SHA1 Message Date
Evan Cheng
c120af4567 Add missing null check reported by Amaury Pouly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 02:39:45 +00:00
Bruno Cardoso Lopes
fcfcca1d9b Add AVX movmsk 256-bit intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110648 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 02:34:56 +00:00
Bruno Cardoso Lopes
405f11b300 Support AVX 256-bit load and store intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 01:43:16 +00:00
Devang Patel
9fa539ce33 Do not include file static variable in pubnames list.
Refactor and simplify code to avoid redundant checks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 01:37:23 +00:00
Chris Lattner
60e72d9ebc remove code setting rw locks to PTHREAD_PROCESS_PRIVATE, which
is the default.  Patch by NAKAMURA Takumi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 00:34:06 +00:00
Bruno Cardoso Lopes
6719784148 Patterns to match AVX cmp instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110633 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 00:13:20 +00:00
Jakob Stoklund Olesen
df30cf9e61 Transpose the calculation of spill weights such that we are calculating one
register at a time. This turns out to be slightly faster than iterating over
instructions, but more importantly, it allows us to compute spill weights for
new registers created after the spill weight pass has run.

Also compute the allocation hint at the same time as the spill weight. This
allows us to use the spill weight as a cost metric for copies, and choose the
most profitable hint if there is more than one possibility.

The new hints provide a very small (< 0.1%) but universal code size improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 00:02:26 +00:00
Bruno Cardoso Lopes
533a7df02d Add matching patterns for vblend AVX intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110630 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 00:02:05 +00:00
Bill Wendling
6cdb1abe4e Merge the OptimizeExts and OptimizeCmps passes into one PeepholeOptimizer
pass. This pass should expand with all of the small, fine-grained optimization
passes to reduce compile time and increase happiment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110627 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 23:59:04 +00:00
Devang Patel
02ecdefbe4 Undo accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110623 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 23:28:52 +00:00
Devang Patel
450b793a04 Simplify. Avoid redundant checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 23:26:06 +00:00
Eric Christopher
5cb33a384f Wording.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110618 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 22:52:47 +00:00
Kevin Enderby
b07ce60981 Next bit of support for the dwarf .file directive. This patch takes the
previously collected info from the .file directives and outputs the encoded
bytes for it.  For now this is only in the Mach-O streamer but at some point
will move to a more generic place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110617 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 22:52:14 +00:00
Evan Cheng
b000d683c8 ARMBaseRegisterInfo::hasFP() has been broken for a while now. :-(
This will always be false before PEI:
(DisableFramePointerElim(MF) && MFI->adjustsStack())
Which means it's going to make r11 available as a general purpose register even
if -disable-fp-elim is specified. It's working on Darwin only because r7 is
always reserved. But it's obviously broken for other targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 22:32:45 +00:00
Bruno Cardoso Lopes
93f6c1ec6e Add VCVTPD2PS, VCVTPS2DQ, VCVTPS2PDY, VCVTTPD2DQY, VCVTTPS2DQ and VCVTPD2DQ 256-bit conversion intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110608 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 21:51:56 +00:00
Devang Patel
2739896cdd Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110607 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 21:39:24 +00:00
Bruno Cardoso Lopes
8468157278 Add patterns to AVX conversions instructions. Do that instead of declaring more intructions whenever is possible, more coming
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110605 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 21:24:59 +00:00
Nick Lewycky
3221834f8a Fix a use after free error caught by the valgrind builders.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110601 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 21:03:28 +00:00
Devang Patel
8bd11de33e Refactoring. Update DbgVarible to handle queries itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110600 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 21:01:39 +00:00
Owen Anderson
2f3ffb80fa Add ConstantRange information to the debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110598 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 20:50:46 +00:00
Eli Friedman
4fffb345ed PR7853: fix a silly mistake introduced in r101899, and add a test to make sure
it doesn't regress again.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 20:49:43 +00:00
Oscar Fuentes
4951870e04 CMake: eliminated unnecessary target_link_libraries.
Next time the build is broken due to wrong library dependencies, just
try building again (if you are on some Unix and are building all LLVM
targets) or ask someone to commit the regenerated LLVMLibDeps.cmake.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110593 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 20:33:08 +00:00
Devang Patel
8162574aaa It is ok, and convenient, to pass descriptors by value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110590 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 20:20:05 +00:00
Jakob Stoklund Olesen
e4b9c4f187 A REG_SEQUENCE instruction may use the same register twice.
If we are emitting COPY instructions for the REG_SEQUENCE, make sure the kill
flag goes on the last COPY. Otherwise we may be using a killed register.

<rdar://problem/8287792>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 20:19:16 +00:00
Evan Cheng
9de1ac267e Explicitly initialize SlowFPBrcc and Pref32BitThumb to false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110587 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 19:19:36 +00:00
Devang Patel
e03161c28e Rename a method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110586 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 18:51:29 +00:00
Evan Cheng
e44be63816 Change -prefer-32bit-thumb to attribute -mattr=+32bit instead to disable more 32-bit to 16-bit optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110584 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 18:35:19 +00:00
Bruno Cardoso Lopes
ad4910429c Memory version of vcvtdq2pd intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110582 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 18:20:14 +00:00
Bruno Cardoso Lopes
251871ca66 Patterns to match vinsert, vbroadcast, vmovmask and vcvtdq2pd AVX intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110580 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 18:03:43 +00:00
Evan Cheng
e8846feaa1 Add an option to disable 32 -> 16-bit Thumb2 size reduction pass for experimentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110579 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 17:16:10 +00:00
Kalle Raiskila
99534bb81a Have SPU handle halfvec stores aligned by 8 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110576 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 16:33:00 +00:00
Michael J. Spencer
c1f354dcb8 MC/MachO: Fix possible null pointer dereference.
Discovered by Microsoft Visual Studio 2010 Code Analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 15:28:05 +00:00
Nick Lewycky
1f74ad7614 Stop the JIT from refusing to work just because the program it was compiled into
was built with -static.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-09 07:20:20 +00:00
Nick Lewycky
b1e4eebec0 Add optimization to Target/README.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110543 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 07:04:25 +00:00
Nick Lewycky
1bb580a3aa Reject unrepresentable pointer types in intrinsics. Fixes PR7316.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110541 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 06:12:09 +00:00
Bill Wendling
c98af3370f Use the "isCompare" machine instruction attribute instead of calling the
relatively expensive comparison analyzer on each instruction. Also rename the
comparison analyzer method to something more in line with what it actually does.

This pass is will eventually be folded into the Machine CSE pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110539 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 05:04:59 +00:00
Nick Lewycky
be04fdeb6c Do more to modernize MergeFunctions. Refactor in response to Chris' code review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 05:04:23 +00:00
Eric Christopher
371e5774c7 Fix a couple of warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 00:00:34 +00:00
Benjamin Kramer
fff0f11989 Roll back my last two commits, valgrind complains.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110518 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 13:27:41 +00:00
Benjamin Kramer
933b16e665 Kill rarely used std::sort.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110516 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 12:37:00 +00:00
Owen Anderson
0aede9e2a8 Remove layering violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110505 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 06:01:13 +00:00
Owen Anderson
9773e45a1e Add an inverse() method to ConstantRange.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110504 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 05:47:46 +00:00
Dan Gohman
4afefdec65 More #include cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110499 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 01:18:18 +00:00
Dan Gohman
12376a8df6 Oops, check in this file too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 01:04:15 +00:00
Dan Gohman
11112e0d7b Tidy some #includes and forward-declarations, and move the C binding code
out of PassManager.cpp and into Core.cpp with the rest of the C binding code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 00:43:20 +00:00
Owen Anderson
634bab148c Add a convenience constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 00:42:06 +00:00
Dale Johannesen
7f6eb639bd Use sdmem and sse_load_f64 (etc.) for the vector
form of CMPSD (etc.)  Matching a 128-bit memory
operand is wrong, the instruction uses only 64 bits
(same as ADDSD etc.)  8193553.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110491 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 00:33:42 +00:00
Owen Anderson
5015b3417f Don't attempt the PRE inline asm calls, since we don't value number them yet. Fixes PR7835.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 00:20:35 +00:00
Jakob Stoklund Olesen
5eb308b944 Lazily defer duplicating the live interval we are splitting until we know it is
necessary.

Sometimes, live range splitting doesn't shrink the current interval, but simply
changes some instructions to use a new interval. That makes the original more
suitable for spilling. In this case, we don't need to duplicate the original.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110481 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 22:17:33 +00:00
Bruno Cardoso Lopes
4945dd8314 Patterns to match AVX 256-bit vzero intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 22:10:01 +00:00
Dan Gohman
60493c3f4f Eliminate PromoteMemoryToRegisterID; just use addPreserved("mem2reg")
instead, as an example of what this looks like.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 21:48:06 +00:00
Bruno Cardoso Lopes
bd2d90f5a5 Patterns to match AVX 256-bit permutation intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110468 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 20:03:27 +00:00
Jim Grosbach
5b02901e91 Cleanup comment wording
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110466 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:59:07 +00:00
Jim Grosbach
206bc14fbf Remove empty processFunctionBeforeFrameFinalized(). The default
implementation of the function is equivalent, so no need to provide
the target-specific version until/unless it needs to do something.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:57:24 +00:00
Jakob Stoklund Olesen
6d108e2cb5 Keep the MachiuneFunctionPass pointer around. It is useful for verification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110464 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:47:06 +00:00
Jakob Stoklund Olesen
23436597a8 Add LiveInterval::RenumberValues - Garbage collection for VNInfos.
After heavy editing of a live interval, it is much easier to simply renumber the
live values instead of trying to keep track of the unused ones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:46:59 +00:00
Owen Anderson
90c579de5a Reapply r110396, with fixes to appease the Linux buildbot gods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:33:48 +00:00
Dan Gohman
e26a7b5e21 Implement a proper getModRefInfo for va_arg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:24:38 +00:00
Dan Gohman
b9db52dcbc Be more conservative in the face of volatile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110456 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:11:28 +00:00
Dan Gohman
9b8639c9bd Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110455 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:10:45 +00:00
Jakob Stoklund Olesen
58e1248dd2 Add more verification of LiveIntervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:04:19 +00:00
Jakob Stoklund Olesen
b85f5388a9 Fix swapped COPY operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110453 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:04:17 +00:00
Jakob Stoklund Olesen
775aa22da2 Don't try to verify LiveIntervals for physical registers.
When a physical register is in use, some alias of that register has a live
interval with a relevant live range. That is the sad state of intervals after
physreg coalescing of subregs, and it is good enough for correct register
allocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110452 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:04:14 +00:00
Rafael Espindola
55e9587469 Fix eabi calling convention when a 64 bit value shadows r3.
Without this what was happening was:

* R3 is not marked as "used"
* ARM backend thinks it has to save it to the stack because of vaarg
* Offset computation correctly ignores it
* Offsets are wrong

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110446 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 15:35:32 +00:00
Nick Lewycky
e52e9d6045 Fix uninitialized variable warning.
Also move 'default' case next to a real case to help compiler optimize in
non-Debug builds.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110435 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 07:43:46 +00:00
Nick Lewycky
c9dcbed6a3 Work in progress, cleaning up MergeFuncs.
Further clean up the comparison function by removing overly generalized
"domains".
Remove all understanding of ELF aliases and simplify folding code and comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110434 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 07:21:30 +00:00
Ted Kremenek
9040c2d910 Update CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 04:05:21 +00:00
Bruno Cardoso Lopes
9c3806461c Patterns to match AVX 256-bit horizontal arithmetic intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110427 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 02:10:30 +00:00
Bruno Cardoso Lopes
9c09f16a53 Patterns to match AVX 256-bit arithmetic intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110425 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 01:52:29 +00:00
Bill Wendling
e4ddbdfd3c Add the Optimize Compares pass (disabled by default).
This pass tries to remove comparison instructions when possible. For instance,
if you have this code:

   sub r1, 1
   cmp r1, 0
   bz  L1

and "sub" either sets the same flag as the "cmp" instruction or could be
converted to set the same flag, then we can eliminate the "cmp" instruction all
together. This is a important for ARM where the ALU instructions could set the
CPSR flag, but need a special suffix ('s') to do so.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110423 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 01:32:48 +00:00
Dan Gohman
6ce9d8b0ed Move all the logic for function attributes and call attributes out of the
AliasAnalysis base class and into BasicAliasAnalyais. This avoids confusion
about where such logic is happening when there are other AliasAnalysis
implementations present.

Move the logic for translating two-callsite getModRefInfo queries into
other AliasAnalysis queries out of BasicAliasAnalysis and into the
AliasAnalysis base class, as it is useful for other AliasAnalysis
implementations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110421 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 01:25:49 +00:00
Owen Anderson
e6a4a36096 Fix botched revert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 00:36:20 +00:00
Devang Patel
31defcf234 While emitting DBG_VALUE for registers spilled at the end of a block do not use location of MBB->end(). If a block does not have terminator then incoming iterator points to end().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110411 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 00:26:18 +00:00
Owen Anderson
1f74590e9d Revert r110396 to fix buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 00:23:35 +00:00
Eric Christopher
e74a088d92 Add an option to always emit realignment code for a particular module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110404 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:57:43 +00:00
Jakob Stoklund Olesen
f67202c94d Be more aggressive about removing joined physreg copies.
When a joined COPY changes subreg liveness, we keep it around as a KILL,
otherwise it is safe to delete.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110403 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:51:28 +00:00
Jakob Stoklund Olesen
c910c8d2fa Don't verify LiveVariables if LiveIntervals is available.
LiveVariables becomes horribly wrong while the coalescer is running, but the
analysis is not zapped until after the coalescer pass has run. This causes tons
of false reports when calling verify form the coalescer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110402 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:51:26 +00:00
Dan Gohman
5eeb19d189 Fix 80-column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110401 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:48:14 +00:00
Owen Anderson
9ccaf53ada Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:42:04 +00:00
Dan Gohman
7365c091f9 Remove IntrWriteMem, as it's the default. Rename IntrWriteArgMem
to IntrReadWriteArgMem, as it's for reading as well as writing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:36:21 +00:00
Bruno Cardoso Lopes
ac09835a22 Support very basic (doesn't include ABI support in the front-end, varags, ...) 256-bit argument passing and return for AVX
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110394 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:35:51 +00:00
Dan Gohman
130073904f Implement AccessesArguments checking in the two-callsite form
of BasicAA::getModRefInfo. This allows BasicAA to say that two
memset calls to non-aliasing memory locations don't interfere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110393 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:34:50 +00:00
Dan Gohman
0c3f3358df Yes, we can do better, but this is not the place for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110391 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:23:32 +00:00
Owen Anderson
5be2e78fa1 Add the beginnings of infrastructure for range tracking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110388 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 22:59:19 +00:00
Jakob Stoklund Olesen
1fe9c34d3f Add basic verification of LiveIntervals.
We verify that the LiveInterval is live at uses and defs, and that all
instructions have a SlotIndex.

Stuff we don't check yet:

- Is the LiveInterval minimal?
- Do all defs correspond to instructions or phis?
- Do all defs dominate all their live ranges?
- Are all live ranges continually reachable from their def?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 22:32:21 +00:00
Owen Anderson
f35b08db50 Give JumpThreading+LVI a long-form cl::opt so that it's easier to toggle the default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110384 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 22:11:31 +00:00
Owen Anderson
db78d73d96 Split the tag and value members of LVILatticeVal in preparation for expanding the lattice to something that won't fit in two bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110383 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 22:10:46 +00:00
Dan Gohman
5fa417c790 Fix memdep's code for reasoning about dependences between two calls. A Ref
response from getModRefInfo is not useful here. Instead, check for identical
calls only in the NoModRef case.

Reapply r110270, and strengthen it to compensate for the memdep changes.
When both calls are readonly, there is no dependence between them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110382 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 22:09:15 +00:00
Gabor Greif
3ecf355c7a remove the private hack from CallInst, it was not supposed to hit the branch anyway
as a positive consequence the CallSite::getCallee() methods now can be rewritten to be
a bit more efficient

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 21:25:49 +00:00
Eric Christopher
505656c6a2 Handle the memory barrier pseudo that goes to nothing for the JIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110371 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 20:04:36 +00:00
Eric Christopher
da93b2cb8f Set hasSideEffects on the 64-bit no-sse memory barrier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110369 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 19:54:59 +00:00
Jim Grosbach
e3ede5e2e4 For local variables in functions with a frame pointer, use FP as a base
register for local access when it's closer to the stack slot being refererenced
than the stack pointer. Make sure to take into account any argument frame
SP adjustments that are in affect at the time.

rdar://8256090


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 19:27:37 +00:00
Bob Wilson
751aaf8ac5 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 19:00:21 +00:00
Jakob Stoklund Olesen
73cf709a08 Remove double-def checking from MachineVerifier, so a register does not have to
be killed before being redefined.

These checks are usually disabled, and usually fail when enabled. We de facto
allow live registers to be redefined without a kill, the corresponding
assertions in RegScavenger were removed long ago.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110362 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 18:59:59 +00:00
Bob Wilson
a1d410d512 Add an ARM RSCrr instruction for disassembly only.
Partial fix for PR7792.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 18:59:36 +00:00
Eric Christopher
280f96c508 Be a little bit more specific about target for the memory barrier
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110360 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 18:36:20 +00:00
Eric Christopher
c34ea3770e Handle the pseudo in MCInstLower.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110359 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 18:34:30 +00:00
Bob Wilson
cff7178844 Add an ARM RSBrr instruction for disassembly only.
Partial fix for PR7792.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110358 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 18:23:43 +00:00
Jakob Stoklund Olesen
a330d4c3ea Avoid using a live std::multimap iterator while editing the map. It looks like
we sometimes compare singular iterators, reported by ENABLE_EXPENSIVE_CHECKS.
This fixes PR7825.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110355 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 18:12:19 +00:00
Chandler Carruth
a7da3ac14a Silence a GCC warning about && and || without explicit parentheses. This
preserves the existing behavior, as it seems a concious choice to allow RS to
be null and BigStack marked true.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 03:04:21 +00:00
Dan Gohman
34fa82f7e8 Revert r110270 for now. It appears to uncover a memdep bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110293 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 00:43:10 +00:00
Bob Wilson
1d9125a6ff ARM "rrx" shift operands do not have an immediate. PR7790.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110292 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 00:34:42 +00:00
Dan Gohman
907857d746 The trouble with testing for "ModRef" and "NoModRef" is that
one is a suffix of the other, and FileCheck accepts superstrings.
Adjust the output to avoid this problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110280 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 23:37:55 +00:00
Bill Wendling
af33b7b4a7 The lower invoke pass needs to have unreachable code elimination run after it
because it could create such things. This fixes a MingW buildbot test failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110279 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 23:36:02 +00:00
Eric Christopher
b6729dc0ef Make x86-64 membarriers work without sse and clean up some of the
uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110274 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 23:03:04 +00:00
Dan Gohman
3dcc91ee8c The two-callsite form of AliasAnalysis::getModRefInfo is documented
to return Ref if the left callsite only reads memory read or written
by the right callsite; fix BasicAliasAnalysis to implement this.

Add AliasAnalysisEvaluator support for testing the two-callsite
form of getModRefInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 22:56:29 +00:00
Jim Grosbach
abf7bdffd6 and back in. false alarm on the tests from another unrelated local change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 22:46:09 +00:00
Eli Friedman
7752442bfa PR7814: Truncates cannot be ignored for signed comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 22:40:58 +00:00
Devang Patel
59135f49e1 Implement target specific getDebugValueLocation().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110267 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 22:39:39 +00:00
Jakob Stoklund Olesen
1a0f91b7c5 Coalesce stack slot accesses that arise when spilling both sides of a COPY.
This helps avoid silly code:

    %R0<def = LOAD <fi#5>
    STORE <fi#5>, %R0<kill>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110266 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 22:35:11 +00:00
Jim Grosbach
87c0175cce oops. revert for a moment to clean up tests first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110259 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 22:12:43 +00:00
Jim Grosbach
936ed5424c Reserve a stack slot if the function adjusts the stack but doesn't
simplify the call frame pseudo instructions. In that situation, the
calculations for estimating the stack size will be way off, leading to
not having an emergency spill slot when we need one. It should be possible
to be more precise about tracking the adjustment values, but not really
necessary for correctness. Upcoming cleanups for PEI in general will
render that moot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110258 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 22:10:15 +00:00
Jakob Stoklund Olesen
7536f72a97 Checkpoint SplitKit progress.
We are now at a point where we can split around simple single-entry, single-exit
loops, although still with some bugs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110257 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 22:08:39 +00:00
Devang Patel
40e0bad331 Implement target specific getDebugValueLocation().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110256 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 22:07:50 +00:00
Devang Patel
5573a7da29 Use location entry only of the location described by DBG_VALUE is valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110255 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 22:07:27 +00:00
Bill Wendling
2464d618c0 The EH prepare passes really want to be the last passes run before code-gen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 21:44:13 +00:00
Torok Edwin
0e3a1a8f8f Use indirect calls in PowerPC JIT.
See PR5201. There is no way to know if direct calls will be within the allowed
range for BL. Hence emit all calls as indirect when in JIT mode.
Without this long-running applications will fail to JIT on PowerPC with a
relocation failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110246 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 20:47:44 +00:00
Devang Patel
a54e0cca4b Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 20:32:36 +00:00
Dan Gohman
ddd3a8899a Fix a minor bug which resulted in intermediate calculations
using wider types than are necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110241 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 19:52:50 +00:00
Dan Gohman
9f6a6862be Change this llvm_unreachable to report_fatal_error, since it can
be triggered by valid, if dubious, IR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 18:51:09 +00:00
Devang Patel
459a36bd34 While spilling live registers at the end of block check whether they are used by DBG_VALUE machine instructions or not. If a spilled register is used by DBG_VALUE machine instruction then insert a new DBG_VALUE machine instruction to encode variable's new location on stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110235 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 18:42:02 +00:00
Devang Patel
b2cf5816f9 If a variable is spilled by code generator then use DW_OP_fbreg to describe its location on stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110234 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 18:40:52 +00:00
Owen Anderson
b57e6558c7 Experiments show that we can safely increase our unrolling threshold without unduly impacting code size, particularly
since unrolling is not enabled at -Os.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110233 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 18:32:46 +00:00
Dale Johannesen
a54db0c485 Remove switch for disabling ARM tail calls. They
seem to be working correctly.  No functional change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110226 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 18:07:17 +00:00
Devang Patel
5c1d941f00 Add DEBUG message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110224 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 18:06:05 +00:00
Dan Gohman
4eaee28e34 Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 17:43:57 +00:00
Benjamin Kramer
56d23947ca Enable COFF writer on mingw32 and cygwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110200 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 15:32:40 +00:00
Kalle Raiskila
bc2697cca0 Make SPU backend handle insertelement and
store for "half vectors"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110198 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 13:59:48 +00:00
Benjamin Kramer
c575283675 Print an error message when someone tries -integrated-as on an unsupported target.
- The COFF backend doesn't support MingW/Cygwin at the moment, it'll report an
  error, but it's still much better than random assertions from the MachO backend.
- We want to make ELF the default eventually, it's what the majority of targets use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110197 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 13:16:30 +00:00
Torok Edwin
e89652ccad Add a missing function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 11:42:45 +00:00
Gabor Greif
ac27ec0f5b by Alexander Herz:
"The CWriter::GetValueName() method does not check if a value as an alias 
and emits the alias name which will never be defined in the output .c 
file (so the output file fails to compile). This can happen if you have 
multiple inheritance with several destructors defined by clang (...D0Ev, 
...D1Ev, ...D2Ev)."

-- applied with minor tweaks. Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110194 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 10:00:52 +00:00
Dan Gohman
d98af0a5b8 Eliminate unnecessary empty string literals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110183 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 01:39:08 +00:00
Dan Gohman
2511bd06de Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110181 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 01:16:35 +00:00
Dan Gohman
5825545553 Don't print the filename twice in file-not-found errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110179 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 01:13:48 +00:00
Bob Wilson
67b453b0d1 Combine NEON VABD (absolute difference) intrinsics with ADDs to make VABA
(absolute difference with accumulate) intrinsics.  Radar 8228576.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 00:12:08 +00:00
Dan Gohman
a41af344c2 Remove PointerAccessInfo, which nothing was using.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 23:08:10 +00:00
Chris Lattner
656f6800b2 fix a win64 encoding problem, patch by Cameron Esfahani!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 22:49:22 +00:00
Dan Gohman
79fca6fea8 Thread const correctness through a bunch of AliasAnalysis interfaces and
eliminate several const_casts.

Make CallSite implicitly convertible to ImmutableCallSite.

Rename the getModRefBehavior for intrinsic IDs to
getIntrinsicModRefBehavior to avoid overload ambiguity with CallSite,
which happens to be implicitly convertible to bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 21:48:53 +00:00
Nate Begeman
d1fb583128 Add support for getting & setting the FPSCR application register on ARM when VFP is enabled.
Add support for using the FPSCR in conjunction with the vcvtr instruction, for controlling fp to int rounding.
Add support for the FLT_ROUNDS_ node now that the FPSCR is exposed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110152 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 21:31:55 +00:00
Dan Gohman
6fc24467e9 The singular of "indices" is "index".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 20:23:52 +00:00
Dan Gohman
17f647d332 Delete an unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 20:20:56 +00:00
Dan Gohman
0fd353376b Make instcombine set explicit alignments on load or store
instructions with alignment 0, so that subsequent passes don't
need to bother checking the TargetData ABI size manually.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 18:20:32 +00:00
Oscar Fuentes
efb59d28c5 CMake: Change somme target library names:
XCore->XCoreGen
PIC16->PIC16CodeGen

After updating your working copy, the first build will fail because it
is using the old library dependencies. Start the build again and it
will work fine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110127 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 17:40:31 +00:00
Dan Gohman
14a498a486 Make AliasAnalysis::getModRefInfo conservative in the face of volatility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 17:27:43 +00:00
Jakob Stoklund Olesen
bae696956b Oops. Don't normalize spill weights twice.
When the normalizeSpillWeights function was introduced, I forgot to remove this
normalization.

This change could affect register allocation. Hopefully for the better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 17:21:16 +00:00
Chris Lattner
2359e5193a avoid undefined behavior negating minint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 16:57:03 +00:00
Dan Gohman
84b8ad321b Fix a typo Devang noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110115 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 16:48:31 +00:00
Chris Lattner
e211cd83f0 avoid undef behavior on minint, fixing PR7783.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110114 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 16:41:24 +00:00
Peter Collingbourne
3bababf880 Add an atomic lowering pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 16:19:16 +00:00
Dan Gohman
795e70e431 Use unary + instead of a separate local variable for working
around std::min vs static const friction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110112 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 16:15:50 +00:00
Michael J. Spencer
237f8fe5df MC: Fix symbol fragment offsets in COFF.
Patch by Cameron Esfahani!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 05:02:46 +00:00
Michael J. Spencer
a69494ee5e Revert "MC: Fix symbol fragment offsets in COFF."
This reverts commit r110100

Wrong path caps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 04:53:28 +00:00
Michael J. Spencer
ab3de49c48 MC: Add time travel support to COFF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 04:43:33 +00:00
Michael J. Spencer
ef1f8c3cc3 MC: Fix symbol fragment offsets in COFF.
Patch by Cameron Esfahani!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 04:43:24 +00:00
Michael J. Spencer
4473b37018 Fix CMake build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 02:38:20 +00:00
Dan Gohman
ef1cfac9e5 Introduce a symbolic constant for ~0u for use with AliasAnalysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 01:03:11 +00:00
Dan Gohman
847a84efd2 Add a convenient form of AliasAnalysis::alias for the case where the sizes
are unknown.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 00:56:30 +00:00
Dan Gohman
ab37f50838 Make SCEVUnknown a CallbackVH, so that it can be notified directly
of Value deletions and RAUWs, instead of relying on ScalarEvolution's
Scalars map being notified, as that's complicated at best, and
insufficient in general.

This means SCEVUnknown needs a non-trivial destructor, so introduce
a mechanism to allow ScalarEvolution to locate all the SCEVUnknowns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:49:30 +00:00
Dan Gohman
c182cb5784 Sketch up a preliminary Type-Based Alias Analysis implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:11:01 +00:00
Dan Gohman
dacfc5d37f Fix visitInvokeInst to call visitTerminatorInst, and remove
a redundant check from checkInstruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110076 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:09:14 +00:00
Dan Gohman
3768091407 Add Verifier logic for indirectbr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110075 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:08:33 +00:00
Dan Gohman
a8afb2a623 Add a lint check for indirectbr with no successors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:06:43 +00:00
Devang Patel
5b164b5a5c Add explicit constructors. Patch by Renato Golin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 22:51:46 +00:00
Bill Wendling
94e4008fba Early exit and reduce indentation. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110069 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 22:06:08 +00:00
Dan Gohman
811edc1f1a Fix namespace polution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 18:50:06 +00:00
Devang Patel
e9a1ccaf80 Free DbgScope created for dead functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 17:32:15 +00:00
Kalle Raiskila
e1c9159f63 More SPU v2f32 stuff added: insertelement and shuffle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 11:22:10 +00:00
Kalle Raiskila
c9fda996fc Add preliminary v2f32 support for SPU. Like with v2i32, we just
duplicate the instructions and operate on half vectors. 

Also reorder code in SPUInstrInfo.td for better coherency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 10:25:47 +00:00
Owen Anderson
61378363b7 Re-apply the infamous r108614, with a fix pointed out by Dirk Steinke.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 09:32:13 +00:00
Kalle Raiskila
82fe467ca5 Add preliminary v2i32 support for SPU backend. As there are no
such registers in SPU, this support boils down to "emulating" 
them by duplicating instructions on the general purpose registers. 

This adds the most basic operations on v2i32: passing parameters,
addition, subtraction, multiplication and a few others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110035 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 08:54:39 +00:00
Oscar Fuentes
ee56c42168 Prefix next' iterator operation with llvm::'.
Fixes potential ambiguity problems on VS 2010.

Patch by nobled!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 06:00:15 +00:00
Daniel Dunbar
44c7486c63 Fix a -Wreorder warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110022 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 05:43:46 +00:00
Nick Lewycky
78d4330fd8 Work in progress.
Start cleaning up MergeFunctions to look more like the rest of LLVM. The
primary change here is to move the methods responsible for comparison into the
new FunctionComparator object. Some comments added. There's more to do.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 05:23:03 +00:00
Eli Friedman
1d17d199a4 PR7586: Make sure we don't claim that unknown bits are actually known in the
ISD::AND case of TargetLowering::SimplifyDemandedBits.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 04:42:25 +00:00
Eli Friedman
e3837014d6 PR7781: Fix incorrect shifting in PPCTargetLowering::LowerBUILD_VECTOR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109998 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 00:18:19 +00:00
Eli Friedman
348e02600e PR7774: Fix undefined shifts in Alpha backend. As a bonus, this actually
improves the generated code in some cases.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109985 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-01 21:13:28 +00:00
Benjamin Kramer
ad2b04c07f Preallocate vector, avoid unnecessary vector growth.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109971 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-01 11:43:26 +00:00
Bill Wendling
57dba1cf53 Reference the personalities. Don't copy them into a new vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109966 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-01 01:34:21 +00:00
Daniel Dunbar
425f634917 Silence some -Asserts uninitialized variable warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-31 21:08:54 +00:00
Daniel Dunbar
10b173a1e7 Speculatively revert r108614, "Another attempt at getting the clang self-host to
like my instcombine patch.", in an attempt to fix Clang i386 bootstrap.
 - Also PR7719.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109953 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-31 19:51:11 +00:00
Michael J. Spencer
0cd1ee2308 MC: Remove HasAbsolutizedSet from WindowsX86AsmBackend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109949 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-31 07:21:44 +00:00
Bob Wilson
d4d188e502 Move newlines before inline jumptables from the asm strings in .td files to
the jtblock_operand print methods.  This avoids extra newlines in the
disassembler's output.  PR7757.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-31 06:28:10 +00:00
Michael J. Spencer
e2195d8b35 Add relax all support to the COFF object streamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-31 06:22:29 +00:00
Bob Wilson
98e1479575 Add support for disassembling VMVN (immediate) instructions. PR7747.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109946 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-31 05:57:44 +00:00
Rafael Espindola
d720670393 The BlockExtractorPass() constructor was not reading the BlockFile and that was
exactly what bugpoint expected it to do.

There was also only one user of
BlockExtractorPass(const std::vector<BasicBlock*> &B), so just remove it and
make BlockExtractorPass read BlockFile.

This fixes bugpoint's block extraction.

Nick, please review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109936 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-31 00:32:17 +00:00
Owen Anderson
7f9cb744f2 Add an initial implementation of PHI translation for LazyValueInfo. This involves rolling back some
of my earlier data structure improvements until I can ensure that there are no iterator invalidation problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109935 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 23:59:40 +00:00
Evan Cheng
a2c519bd0b Add -disable-shifter-op to disable isel of shifter ops. On Cortex-a9 the shifts cost extra instructions so it might be better to emit them separately to take advantage of dual-issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 23:33:54 +00:00
Bob Wilson
70a4e3c532 Add a check in the ARM disassembler for NEON instructions that would
reference registers past the end of the NEON register file, and report them
as invalid instead of asserting when trying to print them.  PR7746.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109933 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 23:27:59 +00:00
Dale Johannesen
38cb1381b5 PPC doesn't supported VLA with large alignment. This was
formerly rejected by the FE, so asserted in the BE; now the FE only
warns, so we treat it as a legitimate fatal error in PPC BE.
This means the test for the feature won't pass, so it's xfail'd.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109892 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 21:09:48 +00:00
Dan Gohman
e16829b401 Move MaximumAlignment to be a member of the Value class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109891 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 21:07:05 +00:00
Owen Anderson
81881bcd35 Revert my last two patches to LVI, which recent changes have exposed a miscompilation in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 20:56:07 +00:00
Nick Lewycky
39a383124b Add missing newline to debug statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109886 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 20:27:01 +00:00
Bob Wilson
63db594559 Add the __TEXT,__StaticInit section to the list of sections emitted at the
beginning on ARM Darwin assembly files so that it won't be placed after
debug sections.  Radar 8252813.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 19:55:47 +00:00
Bruno Cardoso Lopes
98f985607b Support all 128-bit AVX vector intrinsics. Most part of them I already
declared during the addition of the assembler support, the additional
changes are:
- Add missing intrinsics
- Move all SSE conversion instructions in X86InstInfo64.td to the SSE.td file.
- Duplicate some patterns to AVX mode.
- Step into PCMPEST/PCMPIST custom inserter and add AVX versions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109878 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 19:54:33 +00:00
Bruno Cardoso Lopes
5b7dab83e9 Fix typo!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109877 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 19:41:24 +00:00
Daniel Dunbar
0ecdb6f3d8 MC: Initialize MCFragment::Offset, noticed by Cameron Esfahani.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109875 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 18:32:09 +00:00
Daniel Dunbar
63cc2e1982 Fix -Wmissing-field-initializers warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109872 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 17:49:04 +00:00
Eli Friedman
ad78a88711 Fix for bug reported by Evzen Muller on llvm-commits: make sure to correctly
check the range of the constant when optimizing a comparison between a
constant and a sign_extend_inreg node.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 06:44:31 +00:00
Jim Grosbach
6ccfc507dc Many Thumb2 instructions can reference the full ARM register set (i.e.,
have 4 bits per register in the operand encoding), but have undefined
behavior when the operand value is 13 or 15 (SP and PC, respectively).
The trivial coalescer in linear scan sometimes will merge a copy from
SP into a subsequent instruction which uses the copy, and if that
instruction cannot legally reference SP, we get bad code such as:
  mls r0,r9,r0,sp
instead of:
  mov r2, sp
  mls r0, r9, r0, r2

This patch adds a new register class for use by Thumb2 that excludes
the problematic registers (SP and PC) and is used instead of GPR
for those operands which cannot legally reference PC or SP. The
trivial coalescer explicitly requires that the register class
of the destination for the COPY instruction contain the source
register for the COPY to be considered for coalescing. This prevents
errant instructions like that above.

PR7499




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 02:41:01 +00:00
Nate Begeman
0e0a20eb38 Add builtins for ssat/usat, similar to RealView's __ssat and __usat intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109813 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 22:48:09 +00:00
Bob Wilson
3d5792a5aa Refactor ARM-specific DAG combining in preparation for adding some more
transformations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 20:34:14 +00:00
Dale Johannesen
f630c712b1 Implement vector constants which are splat of
integers with mov + vdup.  8003375.  This is
currently disabled by default because LICM will
not hoist a VDUP, so it pessimizes the code if
the construct occurs inside a loop (8248029).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109799 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 20:10:08 +00:00
Bob Wilson
fb13b95162 Don't assert on an unrecognized BrMiscFrm instruction.
PR7745.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 18:29:28 +00:00
Eli Friedman
618898e933 PR7750: !CExpr->isNullValue() only properly computes whether CExpr is nonnull
if CExpr is a ConstantInt.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109773 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 18:03:33 +00:00
Nate Begeman
692433bc2d Add intrinsics __builtin_arm_qadd & __builtin_arm_qsub to allow access to the QADD & QSUB instructions.
Behave identically to __qadd & __qsub RealView instruction intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109770 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 17:56:55 +00:00
Benjamin Kramer
1abcd06856 Plug the remaining MC leaks by giving MCObjectStreamer/MCAsmStreamer ownership of the TargetAsmBackend and the MCCodeEmitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 17:48:06 +00:00
Dale Johannesen
c46a5f20c5 Comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109765 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 17:45:24 +00:00
Jakob Stoklund Olesen
b2eeed7464 Revert r109652, and remove the offending assert in loadRegFromStackSlot instead.
We do sometimes load from a too small stack slot when dealing with x86 arguments
(varargs and smaller-than-32-bit args). It looks like we know what we are doing
in those cases, so I am going to remove the assert instead of artifically
enlarging stack slot sizes.

The assert in storeRegToStackSlot stays in. We don't want to write beyond the
bounds of a stack slot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109764 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 17:42:27 +00:00
Daniel Dunbar
a685582048 CrashRecovery: Use ThreadLocal::erase() instead of set(0).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 15:24:21 +00:00
Benjamin Kramer
3bce5adb32 Stop leaking std::strings in GetDwarfFile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 13:53:19 +00:00
Benjamin Kramer
808ecfce6a COFFObjectWriter: Don't leak COFFSymbols and COFFSections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109745 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 11:57:59 +00:00
Daniel Dunbar
dade28ee4e Make sure to include config.h, to pickup LLVM_ON_WIN32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109721 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 01:52:04 +00:00
Daniel Dunbar
56491303a6 MC: Destroy Macro instances.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109720 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 01:51:55 +00:00
Eric Christopher
e6cbfa6b09 Speculatively revert r109705 since it seems to be causing some build bot
angst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109718 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 01:25:38 +00:00
Daniel Dunbar
d9082dfd9a CrashRecoveryContext: Add a simple POSIX implementation.
- This works, but won't handle crashes on stack overflow, or signals delivered
   to a thread other than the one that crashed. The latter is particular annoying
   on Darwin, because SIGABRT tends to go to the main thread.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109717 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 01:21:47 +00:00
Jakob Stoklund Olesen
4bd94f7bbe Fix a bug in the -regalloc=fast handling of exotic two-address instruction with
multiple defs, like t2LDRSB_POST.

The first def could accidentally steal the physreg that the second, tied def was
required to be allocated to.

Now, the tied use-def is treated more like an early clobber, and the physreg is
reserved before allocating the other defs.

This would never be a problem when the tied def was the only def which is the
usual case.

This fixes MallocBench/gs for thumb2 -O0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109715 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 00:52:19 +00:00
Dan Gohman
c6743207e2 Factor out some of the code for updating old SCEVUnknown values, and
extend it to handle the case where multiple RAUWs affect a single
SCEVUnknown.

Add a ScalarEvolution unittest to test for this situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 00:17:55 +00:00
Owen Anderson
e2fb451dbb Pass the queried value by argument rather than in a member, in preparation for supporting PHI translation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109701 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 23:50:08 +00:00
Jim Grosbach
542f642684 ARM mode version of r109693. Remove incorrect substitution pattern for UXTB16. It wrongly assumed the input shift was actually a rotate. rdar://8240138
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109696 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 23:25:44 +00:00
Jim Grosbach
7946494ceb Remove incorrect substitution pattern for UXTB16. It wrongly assumed the input shift was actually a rotate. rdar://8240138
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109693 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 23:17:45 +00:00
Jim Grosbach
f0d7e36691 Remove dead prototype
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 23:16:12 +00:00
Gabor Greif
7d3056b160 simplify by using CallSite constructors; virtually eliminates CallSite::get from the tree
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109687 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 22:50:26 +00:00
Owen Anderson
826c148aa5 Add an erase() method to llvm::ThreadLocal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 22:49:43 +00:00
Owen Anderson
9da5c997c0 Get rid of LVIQuery as a distinct data structure, so that we don't have to initialize a new set of maps on every query.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109679 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 22:07:25 +00:00
Dan Gohman
6bbe671e1c Make GlobalValue alignment consistent with load, store, and alloca
alignment, fixing silent truncation of alignment values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109653 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:56:48 +00:00
Jakob Stoklund Olesen
4c010ec851 Create a fixed stack object for varargs that is as large as any register.
The size of this object isn't used for anything - technically it is of variable
size.

This avoids a false positive from the assert in
X86InstrInfo::loadRegFromStackSlot, and fixes PR7735.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109652 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:55:38 +00:00
Kevin Enderby
7cbf73a73f Added first bit of support for the dwarf .file directive. This patch collects
the info from the .file directive and makes file and directory tables that
will eventually be put out as part of the dwarf info in the output file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:55:35 +00:00
Daniel Dunbar
329878f4dd RegionInfo: Make sure to free cached nodes; Tobias, please check!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:28:50 +00:00
Daniel Dunbar
36880e704f MC: Put back the MCFragment vtable, so subclasses are destroyed properly (duh).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:28:45 +00:00
Dan Gohman
138aa2a82b Define a maximum supported alignment value for load, store, and
alloca instructions (constrained by their internal encoding),
and add error checking for it. Fix an instcombine bug which
generated huge alignment values (null is infinitely aligned).
This fixes undefined behavior noticed by John Regehr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:12:04 +00:00
Jakob Stoklund Olesen
a0c5bf19bf Print out the regclass of any virtual registers used by a machine instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109608 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 18:35:46 +00:00
Douglas Gregor
c19d865474 Unbreak my CMake build, say you'll compile for me again...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109598 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 17:17:46 +00:00
Dan Gohman
6d3b922670 Fix this code to avoid decrementing an iterator past the beginning
of a std::vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 17:15:36 +00:00
Dan Gohman
33591af872 When user code intentionally dereferences null, the alignment of the
dereference is theoretically infinite. Put a cap on the computed
alignment to avoid overflow, noticed by John Regehr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109596 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 17:14:23 +00:00
Dan Gohman
67d0498d53 Do GEP offset calculations with unsigned math rather than signed math
to avoid undefined behavior on overflow, noticed by John Regehr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109594 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 17:11:36 +00:00
Gabor Greif
f5e13095fa simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 15:52:43 +00:00
Daniel Dunbar
a309dac868 Support: Add CrashRecoveryContext helper object.
- Designed as a simple wrapper to allow clients to attempt to catch crashes
   (memory errors, assertion violations, etc.) and do some kind of recovery.

 - Currently doesn't actually attempt to catch crashes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109586 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 15:40:20 +00:00
Gabor Greif
5d4b32ef96 simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109585 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 15:31:37 +00:00
Gabor Greif
d09475c226 use Value* constructor of CallSite to create potentially improper site, and test that
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109581 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 14:28:18 +00:00
Gabor Greif
ce4a62639f use Value* constructor of CallSite to create potentially improper site, and test that
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109580 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 12:35:54 +00:00
Gabor Greif
3737984e95 use Value* constructor of CallSite to create potentially improper site
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109579 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 12:19:46 +00:00
Gabor Greif
30ae792f06 simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109578 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 10:57:28 +00:00
Gabor Greif
b0686ea808 simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 10:46:09 +00:00
Dan Gohman
81f9121cda Make SCEVCallbackVH::allUsesReplacedWith update the old SCEVUnknown
object, as it may still be referenced by SCEVs not cleaned up by the
use list traversal.

Also, in ScalarEvolution::forgetValue, only check for a SCEVUnknown
object for the original value, not for any value in the use list,
because other SCEVUnknown values aren't necessary obsolete at that
point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 01:09:07 +00:00
Dan Gohman
59846aced2 Make SCEVCallbackVH::allUsesReplacedWith unconditionally delete
the old value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109567 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 00:28:25 +00:00
Nate Begeman
51409214d7 Implement a vectorized algorithm for <16 x i8> << <16 x i8>
This is about 4x faster and smaller than the existing scalarization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109566 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 00:21:48 +00:00
Owen Anderson
9a65dc9968 Rearrange several datastructures in LazyValueInfo to improve compile time.
This is still not perfect, but better than it was before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 23:58:11 +00:00
Gabor Greif
b344a346f1 reintroduce original (asserting) semantics of CallSite(Instruction *II)
add instead a CallSite(Value* V) constructor that is consistent with ImmutableCallSize
and use that one in client code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 22:53:28 +00:00
Nate Begeman
bdcb5afb77 ~40% faster vector shl <4 x i32> on SSE 4.1 Larger improvements for smaller types coming in future patches.
For:

define <2 x i64> @shl(<4 x i32> %r, <4 x i32> %a) nounwind readnone ssp {
entry:
  %shl = shl <4 x i32> %r, %a                     ; <<4 x i32>> [#uses=1]
  %tmp2 = bitcast <4 x i32> %shl to <2 x i64>     ; <<2 x i64>> [#uses=1]
  ret <2 x i64> %tmp2
}

We get:

_shl:                                   ## @shl
	pslld	$23, %xmm1
	paddd	LCPI0_0, %xmm1
	cvttps2dq	%xmm1, %xmm1
	pmulld	%xmm1, %xmm0
	ret

Instead of:

_shl:                                   ## @shl
	pshufd	$3, %xmm0, %xmm2
	movd	%xmm2, %eax
	pshufd	$3, %xmm1, %xmm2
	movd	%xmm2, %ecx
	shll	%cl, %eax
	movd	%eax, %xmm2
	pshufd	$1, %xmm0, %xmm3
	movd	%xmm3, %eax
	pshufd	$1, %xmm1, %xmm3
	movd	%xmm3, %ecx
	shll	%cl, %eax
	movd	%eax, %xmm3
	punpckldq	%xmm2, %xmm3
	movd	%xmm0, %eax
	movd	%xmm1, %ecx
	shll	%cl, %eax
	movd	%eax, %xmm2
	movhlps	%xmm0, %xmm0
	movd	%xmm0, %eax
	movhlps	%xmm1, %xmm1
	movd	%xmm1, %ecx
	shll	%cl, %eax
	movd	%eax, %xmm0
	punpckldq	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	punpckldq	%xmm3, %xmm0
	ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109549 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 22:37:06 +00:00
Gabor Greif
622b7cf147 recommit simplification (originally r109504, backed out in r109508) now that problem in CallSiteBase is fixed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 22:02:00 +00:00