Andrew Kaylor [Fri, 2 Nov 2012 19:45:23 +0000 (19:45 +0000)]
Change resolveRelocation parameters so the relocations can find placeholder values in the original object buffer.
Some ELF relocations require adding the a value to the original contents of the object buffer at the specified location. In order to properly handle multiple applications of a relocation, the RuntimeDyld code should be grabbing the original value from the object buffer and writing a new value into the loaded section buffer. This patch changes the parameters passed to resolveRelocations to accommodate this need.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167304
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Fri, 2 Nov 2012 18:06:51 +0000 (18:06 +0000)]
Documentation: fix typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167302
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Fri, 2 Nov 2012 12:20:34 +0000 (12:20 +0000)]
Fix whitespaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167295
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 2 Nov 2012 09:02:37 +0000 (09:02 +0000)]
Enable the assertion in getIntPtrType (I've audited all users of this method and
they are now all correct; hopefully the buildbots will agree!).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167289
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 2 Nov 2012 08:40:24 +0000 (08:40 +0000)]
Add a testcase to loop-idiom to cover PR14241 when we start handling
strided loops again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167287
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 2 Nov 2012 08:33:25 +0000 (08:33 +0000)]
Revert the switch of loop-idiom to use the new dependence analysis.
The new analysis is not yet ready for prime time. It has a *critical*
flawed assumption, and some troubling shortages of testing. Until it's
been hammered into better shape, let's stick with the working code. This
should be easy to revert itself when the analysis is ready.
Fixes PR14241, a miscompile of any memcpy-able loop which uses a pointer
as the induction mechanism. If you have been seeing miscompiles in this
revision range, you really want to test with this backed out. The
results of this miscompile are a bit subtle as they can lead to
downstream passes concluding things are impossible which are in fact
possible.
Thanks to David Blaikie for the majority of the reduction of this
miscompile. I'll be checking in the test case in a non-revert commit.
Revesions reverted here:
r167045: LoopIdiom: Fix a serious missed optimization: we only turned
top-level loops into memmove.
r166877: LoopIdiom: Add checks to avoid turning memmove into an infinite
loop.
r166875: LoopIdiom: Recognize memmove loops.
r166874: LoopIdiom: Replace custom dependence analysis with
DependenceAnalysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167286
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 2 Nov 2012 07:49:32 +0000 (07:49 +0000)]
Fix an obvious typo that causes an assertion failure when running
test/Transforms/GVN/rle.ll if the (currently disabled) check for a
pointer type in getIntPtrType is turned on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167285
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 2 Nov 2012 05:24:00 +0000 (05:24 +0000)]
Fix sign compare warning. Patch by Mahesha HS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167282
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 2 Nov 2012 01:32:02 +0000 (01:32 +0000)]
libprofile/CommonProfiling.c: Fix according to C89.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167272
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Fri, 2 Nov 2012 01:10:15 +0000 (01:10 +0000)]
PGO: allows the profile data file name to be specified by the LLVMPROF_OUTPUT
environment variable.
This allows parallel make for profiling code, without it there are file
collisions as each parallel run uses the default file name.
There is already code in the runtime library to specify the output file name
via the command line, but this only works for programs which already process
argc/argv. This patch builds on that support.
Patch by Alastair Murray.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167269
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Thu, 1 Nov 2012 23:49:58 +0000 (23:49 +0000)]
OutputArg: added an index of the original argument to match the change to
InputArg in r165616.
This will enable us to get the actual type for both InputArg and OutputArg.
rdar://
9932559
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167265
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 1 Nov 2012 21:57:27 +0000 (21:57 +0000)]
BBVectorize: Commit the rest of the test-case change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167257
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 1 Nov 2012 21:50:12 +0000 (21:50 +0000)]
BBVectorize: Use target costs for incoming and outgoing values instead of the depth heuristic.
When target cost information is available, compute explicit costs of inserting and
extracting values from vectors. At this point, all costs are estimated using the
target information, and the chain-depth heuristic is not needed. As a result, it is now, by
default, disabled when using target costs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167256
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Thu, 1 Nov 2012 19:49:21 +0000 (19:49 +0000)]
Fixed format string to avoid pointer truncation during 64-bit debugging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167247
91177308-0d34-0410-b5e6-
96231b3b80d8
Pranav Bhandarkar [Thu, 1 Nov 2012 19:13:23 +0000 (19:13 +0000)]
Use the relationship models infrastructure to add two relations - getPredOpcode
and getPredNewOpcode. The first relates non predicated instructions with their
predicated forms and the second relates predicated instructions with their
predicate-new forms.
Patch by Jyotsna Verma!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167243
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 1 Nov 2012 17:31:35 +0000 (17:31 +0000)]
Add support for generating dwarf debugging info with assembly files
run through the 'C' preprocessor. That is pick up the file name
and line numbers from the cpp hash file line comments for the
dwarf file and line numbers tables.
rdar://
9275556
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167237
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 1 Nov 2012 14:28:51 +0000 (14:28 +0000)]
llvm/test/lit.cfg: Don't use mcjit to ppc32 yet, not ready.
Unsupported CPU type!
UNREACHABLE executed at llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:553!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167231
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 1 Nov 2012 13:42:40 +0000 (13:42 +0000)]
[asan] don't instrument globals that we've created ourselves (reduces the binary size a bit)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167230
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 1 Nov 2012 11:25:55 +0000 (11:25 +0000)]
Add a getAddressSpace method to the GEP instruction to mirror that of
the inttoptr instruction. The conceptual model here is that
'getAddressSpace' refers to the address space of this instruction's
type. It just happens that for GEPs, that is always the same as the
pointer operand's address space. We want both names so that access
patterns can be consistent between different instruction types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167229
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 1 Nov 2012 11:25:28 +0000 (11:25 +0000)]
Add some consistent doxygen comments for the address space helpers.
These clarify that the methods called 'getPointerAddressSpace' apply to
the pointer *operand* of the instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167228
91177308-0d34-0410-b5e6-
96231b3b80d8
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