Chandler Carruth [Thu, 1 Nov 2012 11:16:47 +0000 (11:16 +0000)]
Normalize the API and doxygen comments for the ptrtoint instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167227
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 1 Nov 2012 10:59:30 +0000 (10:59 +0000)]
Remove a weird static helper from the GEP instruction and just directly
compute the address space in the one place it was used.
Also write the getPointerAddressSpace member in terms of the
getPointerOperandType member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167226
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 1 Nov 2012 10:46:54 +0000 (10:46 +0000)]
As I'm going to be touching several comments in this file, update the
'@brief' doxygen markup to the now standard '\brief' markup form, in
conformance with the coding standards. This will let me continue to
write new comments in this form without making things inconsistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167225
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 1 Nov 2012 10:26:36 +0000 (10:26 +0000)]
Add a test case for PR14233.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167224
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 1 Nov 2012 09:37:49 +0000 (09:37 +0000)]
Teach Type::getPointerAddressSpace to look through pointer vectors
politely and document this feature.
This simple API extension then allows us to write all of the
Instructions' address space query methods much more simply. No
functionality change intended here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167223
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 1 Nov 2012 09:14:31 +0000 (09:14 +0000)]
Revert the majority of the next patch in the address space series:
r165941: Resubmit the changes to llvm core to update the functions to
support different pointer sizes on a per address space basis.
Despite this commit log, this change primarily changed stuff outside of
VMCore, and those changes do not carry any tests for correctness (or
even plausibility), and we have consistently found questionable or flat
out incorrect cases in these changes. Most of them are probably correct,
but we need to devise a system that makes it more clear when we have
handled the address space concerns correctly, and ideally each pass that
gets updated would receive an accompanying test case that exercises that
pass specificaly w.r.t. alternate address spaces.
However, from this commit, I have retained the new C API entry points.
Those were an orthogonal change that probably should have been split
apart, but they seem entirely good.
In several places the changes were very obvious cleanups with no actual
multiple address space code added; these I have not reverted when
I spotted them.
In a few other places there were merge conflicts due to a cleaner
solution being implemented later, often not using address spaces at all.
In those cases, I've preserved the new code which isn't address space
dependent.
This is part of my ongoing effort to clean out the partial address space
code which carries high risk and low test coverage, and not likely to be
finished before the 3.2 release looms closer. Duncan and I would both
like to see the above issues addressed before we return to these
changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167222
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 1 Nov 2012 08:07:29 +0000 (08:07 +0000)]
Revert the series of commits starting with r166578 which introduced the
getIntPtrType support for multiple address spaces via a pointer type,
and also introduced a crasher bug in the constant folder reported in
PR14233.
These commits also contained several problems that should really be
addressed before they are re-committed. I have avoided reverting various
cleanups to the DataLayout APIs that are reasonable to have moving
forward in order to reduce the amount of churn, and minimize the number
of commits that were reverted. I've also manually updated merge
conflicts and manually arranged for the getIntPtrType function to stay
in DataLayout and to be defined in a plausible way after this revert.
Thanks to Duncan for working through this exact strategy with me, and
Nick Lewycky for tracking down the really annoying crasher this
triggered. (Test case to follow in its own commit.)
After discussing with Duncan extensively, and based on a note from
Micah, I'm going to continue to back out some more of the more
problematic patches in this series in order to ensure we go into the
LLVM 3.2 branch with a reasonable story here. I'll send a note to
llvmdev explaining what's going on and why.
Summary of reverted revisions:
r166634: Fix a compiler warning with an unused variable.
r166607: Add some cleanup to the DataLayout changes requested by
Chandler.
r166596: Revert "Back out r166591, not sure why this made it through
since I cancelled the command. Bleh, sorry about this!
r166591: Delete a directory that wasn't supposed to be checked in yet.
r166578: Add in support for getIntPtrType to get the pointer type based
on the address space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167221
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 1 Nov 2012 06:26:34 +0000 (06:26 +0000)]
BBVectorize: Account for internal shuffle costs
When target costs are available, use them to account for the costs of
shuffles on internal edges of the DAG of candidate pairs.
Because the shuffle costs here are currently for only the internal edges,
the current target cost model is trivial, and the chain depth requirement
is still in place, I don't yet have an easy test
case. Nevertheless, by looking at the debug output, it does seem to do the right
think to the effective "size" of each DAG of candidate pairs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167217
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Thu, 1 Nov 2012 03:47:50 +0000 (03:47 +0000)]
Cleanup another place redundant SP maintained
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167209
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 1 Nov 2012 02:13:50 +0000 (02:13 +0000)]
[CMake] Add llvm-mcmarkup to check-llvm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167208
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 1 Nov 2012 02:13:45 +0000 (02:13 +0000)]
test/CodeGen/X86/fp-fast.ll: Add +avx.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167207
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 1 Nov 2012 02:00:53 +0000 (02:00 +0000)]
Add a few more simple fast-math constant propagations and cancellations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167200
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 1 Nov 2012 01:15:43 +0000 (01:15 +0000)]
Exploit the new identity composition in composeSubRegIndices().
The static compose() function in RegisterCoalescer was doing the exact
same thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167198
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Staszak [Thu, 1 Nov 2012 01:10:43 +0000 (01:10 +0000)]
Don't insert and erase load instruction. Simply create (new) and delete it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167196
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Thu, 1 Nov 2012 00:46:04 +0000 (00:46 +0000)]
Streamlined memory manager hierarchy for MCJIT and RuntimeDyld.
Patch by Ashok Thirumurthi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167192
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 1 Nov 2012 00:34:09 +0000 (00:34 +0000)]
[Support] Fix StrError on Windows to actually return the error string...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167191
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 1 Nov 2012 00:32:10 +0000 (00:32 +0000)]
Generate a table-driven version of TRI::composeSubRegIndices().
Explicitly allow composition of null sub-register indices, and handle
that common case in an inlinable stub.
Use a compressed table implementation instead of the previous nested
switches which generated pretty bad code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167190
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Thu, 1 Nov 2012 00:17:11 +0000 (00:17 +0000)]
Fixed format strings to avoid pointer truncation during 64-bit debugging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167185
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Wed, 31 Oct 2012 23:24:13 +0000 (23:24 +0000)]
MC: Simple example parser for MC assembly markup.
Nothing fancy, just a simple demonstration parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167181
91177308-0d34-0410-b5e6-
96231b3b80d8
Shuxin Yang [Wed, 31 Oct 2012 23:11:48 +0000 (23:11 +0000)]
(For X86) Enhancement to add-carray/sub-borrow (adc/sbb) optimization.
The adc/sbb optimization is to able to convert following expression
into a single adc/sbb instruction:
(ult) ... = x + 1 // where the ult is unsigned-less-than comparison
(ult) ... = x - 1
This change is to flip the "x >u y" (i.e. ugt comparison) in order
to expose the adc/sbb opportunity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167180
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 31 Oct 2012 21:40:39 +0000 (21:40 +0000)]
LoopVectorize: Preserve NSW, NUW and IsExact flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167174
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 31 Oct 2012 20:52:26 +0000 (20:52 +0000)]
Fix a bug in the cost calculation of vector casts. Detect situations where bitcasts cost zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167170
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Wed, 31 Oct 2012 20:37:14 +0000 (20:37 +0000)]
Mark code, not data, as executable in lli RemoteTarget simulator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167164
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 31 Oct 2012 18:52:25 +0000 (18:52 +0000)]
Remove Triple::getArchTypeForDarwinArchName. I lives on the clang driver now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167157
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 31 Oct 2012 18:37:55 +0000 (18:37 +0000)]
[mips] Set isAsCheapAsAMove flag on ADDiu and DADDiu, which enables
re-materialization of immediate loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167153
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Wed, 31 Oct 2012 17:44:16 +0000 (17:44 +0000)]
MCJIT unit test: add calls to ensure that instruction caches are properly invalidated before code execution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167146
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Wed, 31 Oct 2012 17:41:51 +0000 (17:41 +0000)]
Port lli bug fix from r166920 to MCJIT unit test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167145
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Wed, 31 Oct 2012 17:35:12 +0000 (17:35 +0000)]
Commit access test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167144
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Wed, 31 Oct 2012 17:25:31 +0000 (17:25 +0000)]
Remove stale documentation about tail duplicaton IR pass
We no longer have a tail duplication pass that runs on LLVM IR. It was removed
in 3.0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167140
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 31 Oct 2012 17:25:23 +0000 (17:25 +0000)]
Test case for r167039. Check that tail-call optimization is disabled for
mips16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167139
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Wed, 31 Oct 2012 16:41:07 +0000 (16:41 +0000)]
Fix typo in CodeGenerator doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167137
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 31 Oct 2012 16:30:03 +0000 (16:30 +0000)]
LCSSA: Try to recover compile time regressions due to SCEV updates.
- Use value handle tricks to communicate use replacements instead of forgetLoop, this is a lot faster.
- Move the "big hammer" out of the main loop so it's not called for every instruction.
This should recover most (if not all) compile time regressions introduced by this code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167136
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 31 Oct 2012 16:22:16 +0000 (16:22 +0000)]
Put the threshold magic number in a variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167134
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Wed, 31 Oct 2012 16:18:02 +0000 (16:18 +0000)]
Disable all old-JIT unit tests on PowerPC.
These tests were all failing since the old JIT doesn't work
for PowerPC (any more), and there are no plans to attempt to
fix it again (instead, work focuses on MCJIT).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167133
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 31 Oct 2012 16:15:25 +0000 (16:15 +0000)]
Remove fixme about unreachable cases from SwitchToLookupTable
SimplifyCFG will have removed those cases for us.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167132
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 31 Oct 2012 16:14:06 +0000 (16:14 +0000)]
Remove enum values since they are not used anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167131
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 31 Oct 2012 15:31:09 +0000 (15:31 +0000)]
Address Duncan's comments on r167121.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167130
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 31 Oct 2012 15:17:07 +0000 (15:17 +0000)]
BBVectorize: Choose pair ordering to minimize shuffles
BBVectorize would, except for loads and stores, always fuse instructions
so that the first instruction (in the current source order) would always
represent the low part of the input vectors and the second instruction
would always represent the high part. This lead to too many shuffles
being produced because sometimes the opposite order produces fewer of them.
With this change, BBVectorize tracks the kind of pair connections that form
the DAG of candidate pairs, and uses that information to reorder the pairs to
avoid excess shuffles. Using this information, a future commit will be able
to add VTTI-based shuffle costs to the pair selection procedure. Importantly,
the number of remaining shuffles can now be estimated during pair selection.
There are some trivial instruction reorderings in the test cases, and one
simple additional test where we certainly want to do a reordering to
avoid an unnecessary shuffle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167122
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 31 Oct 2012 15:14:39 +0000 (15:14 +0000)]
Address Duncan's comments on r167115
- Use 0 instead of NULL
- Helper function for "dyn_cast, else lookup in the constant pool".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167121
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Wed, 31 Oct 2012 14:58:26 +0000 (14:58 +0000)]
instcombine: Migrate strto* optimizations
This patch migrates the strto* optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167119
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 31 Oct 2012 14:36:48 +0000 (14:36 +0000)]
Fix false -> NULL conversion from r167115 spotted by Benjamin Kramer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167117
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 31 Oct 2012 13:45:49 +0000 (13:45 +0000)]
Replace some instances of UniqueVector with SetVector, which is slightly cheaper.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167116
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 31 Oct 2012 13:42:45 +0000 (13:42 +0000)]
Do simple constant propagation in lookup table formation for switches
By propagating the value for the switch condition, LLVM can now build
lookup tables for code such as:
switch (x) {
case 1: return 5;
case 2: return 42;
case 3: case 4: case 5:
return x - 123;
default:
return 123;
}
Given that x is known for each case, "x - 123" becomes a constant for
cases 3, 4, and 5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167115
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 31 Oct 2012 11:25:32 +0000 (11:25 +0000)]
Fix a couple of comment typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167113
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 31 Oct 2012 10:01:29 +0000 (10:01 +0000)]
LCSSA: Add a workaround for another nasty SCEV cache invalidation issue.
I'm not entirely happy with this solution, but I don't see a smarter way currently.
Fixes PR14214.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167112
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Wed, 31 Oct 2012 09:50:01 +0000 (09:50 +0000)]
Add IRBuilderBase::getIntPtrTy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167111
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 31 Oct 2012 09:20:38 +0000 (09:20 +0000)]
DependenceAnalysis: Don't crash if there is no constant operand.
This makes the code match the comments. Resolves a crash in loop idiom (PR14219).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167110
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Wed, 31 Oct 2012 09:10:56 +0000 (09:10 +0000)]
Add support for ARM segment types PT_ARM_ARCHEXT, PT_ARM_EXIDX and PT_ARM_UNWIND.
Patch by Pete Chou!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167109
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Wed, 31 Oct 2012 09:07:37 +0000 (09:07 +0000)]
Add support for Cortex-A15 host recognition.
No testcase, as this is only testable on a C-A15 board.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167108
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Wed, 31 Oct 2012 05:21:10 +0000 (05:21 +0000)]
Implement ADJCALLSTACKUP and ADJCALLSTACKDOWN
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167107
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 31 Oct 2012 04:59:46 +0000 (04:59 +0000)]
Add scalar forms of FMA4 VFNMSUB/VFNMADD to folding tables. Patch from Cameron McInally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167106
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Wed, 31 Oct 2012 04:29:58 +0000 (04:29 +0000)]
instcombine: Migrate strpbrk optimizations
This patch migrates the strpbrk optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167105
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Wed, 31 Oct 2012 04:14:09 +0000 (04:14 +0000)]
Clean up redundant SP register maintained in X86 TLI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167104
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Wed, 31 Oct 2012 03:33:06 +0000 (03:33 +0000)]
instcombine: Migrate strlen optimizations
This patch migrates the strlen optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167103
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Wed, 31 Oct 2012 03:33:00 +0000 (03:33 +0000)]
instcombine: Migrate strncpy optimizations
This patch migrates the strncpy optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167102
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 31 Oct 2012 03:31:07 +0000 (03:31 +0000)]
LoopVectorize: Do not vectorize loops with tiny constant trip counts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167101
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Wed, 31 Oct 2012 01:15:05 +0000 (01:15 +0000)]
This patch addresses an ABI compatibility issue with empty aggregate
parameters. Examples of these are:
struct { } a;
union { } b[256];
int a[0];
An empty aggregate has an address, although dereferencing that address is
pointless. When passed as a parameter, an empty aggregate does not consume
a protocol register, nor does it consume a doubleword in the parameter save
area. Passing an empty aggregate by reference passes an address just as
for any other aggregate. Returning an empty aggregate uses GPR3 as a hidden
address of the return value location, just as for any other aggregate.
The patch modifies PPCTargetLowering::LowerFormalArguments_64SVR4 and
PPCTargetLowering::LowerCall_64SVR4 to properly skip empty aggregate
parameters passed by value. The handling of return values and by-reference
parameters was already correct.
Built on powerpc64-unknown-linux-gnu and tested with no new regressions.
A test case is included to test proper handling of empty aggregate
parameters on both sides of the function call protocol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167090
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 31 Oct 2012 00:56:01 +0000 (00:56 +0000)]
Change signature of function RAFast::spillAll to avoid conversion between
type MachineInstr* and MachineBasicBlock::iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167088
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 31 Oct 2012 00:54:26 +0000 (00:54 +0000)]
xlc supports __attribute__((aligned(x))), use it.
Patch by Kai.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167087
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 31 Oct 2012 00:50:52 +0000 (00:50 +0000)]
Check that iterator I is not the end iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167086
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 31 Oct 2012 00:46:18 +0000 (00:46 +0000)]
Add extra declarations of hash_value needed to build llvm with xlc 12.1.
Patch by Kai!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167085
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 31 Oct 2012 00:45:26 +0000 (00:45 +0000)]
Add support for loops that don't start with Zero.
This is important for loops in the LAPACK test-suite.
These loops start at 1 because they are auto-converted from fortran.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167084
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Wed, 31 Oct 2012 00:20:56 +0000 (00:20 +0000)]
instcombine: Migrate stpcpy optimizations
This patch migrates the stpcpy optimizations from the simplify-libcalls
pass into the instcombine library call simplifier. Note that the
__stpcpy_chk simplifications were migrated in a previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167083
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Wed, 31 Oct 2012 00:20:51 +0000 (00:20 +0000)]
instcombine: Split out the __stpcpy_chk simplifications from StrCpyChkOpt
r166198 migrated the strcpy optimization to instcombine. The strcpy
simplifier that was migrated from Transforms/Scalar/SimplifyLibCalls.cpp
was also doing some __strcpy_chk simplifications. Those fortified
simplifications were migrated as well, but introduced a bug in the
__stpcpy_chk simplifier in the process. This happened because the
__strcpy_chk and __stpcpy_chk simplifiers were both mapped to StrCpyChkOpt
which was updated with simplifications that worked for __strcpy_chk, but
not __stpcpy_chk.
This patch fixes the problem by adding proper test coverage and creating a
new simplifier for __stpcpy_chk (instead of sharing one with __strcpy_chk).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167082
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 30 Oct 2012 23:53:59 +0000 (23:53 +0000)]
X86 SSE: update rsqrtss and rcpss to use two source operands and
the first source operand is tied to the destination operand.
This is to accurately model the corresponding instructions where the upper
bits are unmodified.
rdar://
12558838
PR14221
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167064
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Tue, 30 Oct 2012 22:21:55 +0000 (22:21 +0000)]
Fix regression in old-style JIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167057
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 30 Oct 2012 22:15:38 +0000 (22:15 +0000)]
X86 MMX: optimize transfer from mmx to i32
We used to generate a store (movq) + a load.
Now we use movd.
rdar://
9946746
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167056
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 30 Oct 2012 22:06:26 +0000 (22:06 +0000)]
Add documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167055
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 30 Oct 2012 21:36:43 +0000 (21:36 +0000)]
Reformat and 80-column this. It's not strictly conforming
yet, but it's better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167053
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 30 Oct 2012 20:52:40 +0000 (20:52 +0000)]
Fix PR14212: For some strange reason I treated vectors differently from
integers in that the code to handle split alloca-wide integer loads or
stores doesn't come first. It should, for the same reasons as with
integers, and the PR attests to that. Also had to fix a busted assert in
that this test case also covers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167051
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 30 Oct 2012 20:39:19 +0000 (20:39 +0000)]
[inline asm] Get the mayLoad/mayStore directly from the MIOp_ExtraInfo operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167050
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 30 Oct 2012 20:17:37 +0000 (20:17 +0000)]
BBVectorize: Cache fixed-order pairs instead of recomputing pointer info.
Instead of recomputing relative pointer information just prior to fusing,
cache this information (which also needs to be computed during the
candidate-pair selection process). This cuts down on the total number of
SE queries made, and also is a necessary intermediate step on the road toward
including shuffle costs in the pair selection procedure.
No functionality change is intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167049
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 30 Oct 2012 20:16:31 +0000 (20:16 +0000)]
[mips] Allow tail-call optimization for vararg functions and functions which
use the caller's stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167048
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 30 Oct 2012 20:01:12 +0000 (20:01 +0000)]
Add a comment for r167040.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167046
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 30 Oct 2012 19:49:39 +0000 (19:49 +0000)]
LoopIdiom: Fix a serious missed optimization: we only turned top-level loops into memmove.
Thanks to Preston Briggs for catching this!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167045
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 30 Oct 2012 19:47:37 +0000 (19:47 +0000)]
BBVectorize: Fix a small bug introduced in r167042.
We need to make sure that we take the correct load/store alignment
when the inputs are flipped.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167044
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 30 Oct 2012 19:37:25 +0000 (19:37 +0000)]
Add code for saving formal argument information to MipsFunctionInfo. This
information will be used by IsEligibleForTailCallOptimization to determine
whether a call can be tail-call optimized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167043
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 30 Oct 2012 19:35:29 +0000 (19:35 +0000)]
BBVectorize: Simplify how input swapping is handled.
Stop propagating the FlipMemInputs variable into the routines that
create the replacement instructions. Instead, just flip the arguments
of those routines. This allows for some associated cleanup (not all
of which is done here). No functionality change is intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167042
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 30 Oct 2012 19:23:25 +0000 (19:23 +0000)]
Add definition of function MipsTargetLowering::passArgOnStack which emits nodes
for passing a function call argument on a stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167041
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 30 Oct 2012 19:11:54 +0000 (19:11 +0000)]
[inline asm] Implement mayLoad and mayStore for inline assembly. In general,
the MachineInstr MayLoad/MayLoad flags are based on the tablegen implementation.
For inline assembly, however, we need to compute these based on the constraints.
Revert r166929 as this is no longer needed, but leave the test case in place.
rdar://
12033048 and PR13504
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167040
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 30 Oct 2012 19:07:58 +0000 (19:07 +0000)]
Do not do tail-call optimization if target is mips16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167039
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 30 Oct 2012 18:55:49 +0000 (18:55 +0000)]
BBVectorize: Don't make calls to SE when the result is unused.
SE was being called during the instruction-fusion process (when the result
is unreliable, and thus ignored). No functionality change is intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167037
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 30 Oct 2012 18:37:43 +0000 (18:37 +0000)]
80-col
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167036
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 30 Oct 2012 18:36:45 +0000 (18:36 +0000)]
LoopVectorize: Add support for write-only loops when the write destination is a single pointer.
Speedup SciMark by 1%
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167035
91177308-0d34-0410-b5e6-
96231b3b80d8
Adhemerval Zanella [Tue, 30 Oct 2012 18:29:42 +0000 (18:29 +0000)]
PowerPC: Expand FSRQT for vector types
This patch expands FSQRT for floating point vector types when altivec is
used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167034
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 30 Oct 2012 18:12:36 +0000 (18:12 +0000)]
LoopVectorize: Fix a bug in the initialization of reduction variables. AND needs to start at all-one
while XOR, and OR need to start at zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167032
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Tue, 30 Oct 2012 18:07:58 +0000 (18:07 +0000)]
Set %defaultjit to use MCJIT for PowerPC targets.
Update Transforms/LICM/2003-12-11-SinkingToPHI.ll test to use
%defaultjit as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167031
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 30 Oct 2012 17:51:02 +0000 (17:51 +0000)]
Fix grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167029
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Tue, 30 Oct 2012 17:33:39 +0000 (17:33 +0000)]
Enable ELF machine type to be specified explicitly in X86 backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167027
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Tue, 30 Oct 2012 16:32:52 +0000 (16:32 +0000)]
Change ForceSizeOpt attribute into MinSize attribute
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167020
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Tue, 30 Oct 2012 16:03:32 +0000 (16:03 +0000)]
Fix isEliminableCastPair to work correctly in the presence of pointers
with different sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167018
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Tue, 30 Oct 2012 15:11:52 +0000 (15:11 +0000)]
switch_to_lookup_table.ll: Remove some unnecessary lines, comments,
function attributes, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167016
91177308-0d34-0410-b5e6-
96231b3b80d8
Adhemerval Zanella [Tue, 30 Oct 2012 13:50:19 +0000 (13:50 +0000)]
PowerPC: More support for Altivec compare operations
This patch adds more support for vector type comparisons using altivec.
It adds correct support for v16i8, v8i16, v4i32, and v4f32 vector
types for comparison operators ==, !=, >, >=, <, and <=.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167015
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Tue, 30 Oct 2012 13:38:54 +0000 (13:38 +0000)]
Add a helper for telling whether a type is a pointer or vector of pointer type.
Simplify the implementation of the corresponding integer and float functions and
move them inline while there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167014
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Tue, 30 Oct 2012 12:33:18 +0000 (12:33 +0000)]
Enable some additional constant folding for PPCDoubleDouble.
This fixes Clang :: CodeGen/complex-builtints.c on PowerPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167013
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Tue, 30 Oct 2012 11:23:25 +0000 (11:23 +0000)]
Use TargetTransformInfo to control switch-to-lookup table transformation
When the switch-to-lookup tables transform landed in SimplifyCFG, it
was pointed out that this could be inappropriate for some targets.
Since there was no way at the time for the pass to know anything about
the target, an awkward reverse-transform was added in CodeGenPrepare
that turned lookup tables back into switches for some targets.
This patch uses the new TargetTransformInfo to determine if a
switch should be transformed, and removes
CodeGenPrepare::ConvertLoadToSwitch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167011
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 30 Oct 2012 02:41:57 +0000 (02:41 +0000)]
Remove an invalid assert in TargetTransformImpl
getCastInstrCost had an assert prohibiting scalar to vector casts. Such casts,
however, are allowed. This should make the vectorizer buildbot happier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166998
91177308-0d34-0410-b5e6-
96231b3b80d8
Sid Manning [Tue, 30 Oct 2012 02:26:15 +0000 (02:26 +0000)]
* Add e_flags enum for Hexagon
* Add Hexagon specific section indexes for small data
- Reviewed by Michael Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166997
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Tue, 30 Oct 2012 01:04:51 +0000 (01:04 +0000)]
ARM: Better disassembly for pc-relative LDR.
When the operand is a plain immediate rather than a label, print it
as [pc, #imm] like we do for the Thumb2 wide encoding variant.
rdar://
12154503
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166991
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Tue, 30 Oct 2012 00:54:49 +0000 (00:54 +0000)]
Change mips16 delay slot jumps to non delay slot forms by default.
We will make them delay slot forms if there is something that can be
placed in the delay slot during a separate pass. Mips16 extended instructions
cannot be placed in delay slots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166990
91177308-0d34-0410-b5e6-
96231b3b80d8