oota-llvm.git
11 years agoInclude all the fields so we can correctly emit DW_TAG_structure_type for C++ structs.
David Blaikie [Fri, 2 Nov 2012 23:33:23 +0000 (23:33 +0000)]
Include all the fields so we can correctly emit DW_TAG_structure_type for C++ structs.

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

11 years agoAdd a stub for the x86 cost model impl. Implement a basic cost rule for inserting...
Nadav Rotem [Fri, 2 Nov 2012 23:27:16 +0000 (23:27 +0000)]
Add a stub for the x86 cost model impl. Implement a basic cost rule for inserting/extracting from XMM registers.

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

11 years agoRemove empty directory
Nadav Rotem [Fri, 2 Nov 2012 22:35:50 +0000 (22:35 +0000)]
Remove empty directory

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

11 years agoCostModel: add support for Vector Insert and Extract.
Nadav Rotem [Fri, 2 Nov 2012 22:31:56 +0000 (22:31 +0000)]
CostModel: add support for Vector Insert and Extract.

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

11 years agoremove empty directories
Chris Lattner [Fri, 2 Nov 2012 22:29:53 +0000 (22:29 +0000)]
remove empty directories

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

11 years ago[mips] Fix disassembler test cases.
Akira Hatanaka [Fri, 2 Nov 2012 22:20:10 +0000 (22:20 +0000)]
[mips] Fix disassembler test cases.

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

11 years agoAdd a cost model analysis that allows us to estimate the cost of IR-level instructions.
Nadav Rotem [Fri, 2 Nov 2012 21:48:17 +0000 (21:48 +0000)]
Add a cost model analysis that allows us to estimate the cost of IR-level instructions.

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

11 years agoScalar Bitcasts and Truncs are usually free
Nadav Rotem [Fri, 2 Nov 2012 21:47:47 +0000 (21:47 +0000)]
Scalar Bitcasts and Truncs are usually free

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

11 years ago[mips] Fix bug in test case. Disable machine LICM to prevent instruction from
Akira Hatanaka [Fri, 2 Nov 2012 21:46:42 +0000 (21:46 +0000)]
[mips] Fix bug in test case. Disable machine LICM to prevent instruction from
being moved out of a basic block.

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

11 years agoVext Lowering was missing opportunities
Quentin Colombet [Fri, 2 Nov 2012 21:32:17 +0000 (21:32 +0000)]
Vext Lowering was missing opportunities

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

11 years ago[mips] Use register number instead of name to print register $AT.
Akira Hatanaka [Fri, 2 Nov 2012 21:26:03 +0000 (21:26 +0000)]
[mips] Use register number instead of name to print register $AT.

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

11 years ago[mips] Add function MipsFrameLowering::estimateStackSize.
Akira Hatanaka [Fri, 2 Nov 2012 21:10:22 +0000 (21:10 +0000)]
[mips] Add function MipsFrameLowering::estimateStackSize.

This function estimates stack size and will be called before
PrologEpilogInserter scans the callee-saved registers.

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

11 years ago[mips] Add member field MipsFunctionInfo::IncomingArgSize which holds the size
Akira Hatanaka [Fri, 2 Nov 2012 21:03:58 +0000 (21:03 +0000)]
[mips] Add member field MipsFunctionInfo::IncomingArgSize which holds the size
of the incoming argument area.

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

11 years agoFix a build problem with xlc. The error message was
Rafael Espindola [Fri, 2 Nov 2012 20:57:36 +0000 (20:57 +0000)]
Fix a build problem with xlc. The error message was

"../llvm-git/utils/TableGen/CodeGenSchedule.cpp", line 1594.12: 1540-0218 (S) The call does not match any parameter list for "operator+".
"../llvm-git/include/llvm/ADT/STLExtras.h", line 130.1: 1540-1283 (I) "template <class _Iterator, class Func> llvm::operator+(mapped_iterator<_Iterator,Func>::difference_type, const mapped_iterator<_Iterator,Func> &)" is not a viable candidate.

Patch by Kai.

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

11 years ago[mips] Delete MipsFunctionInfo::EmitNOAT. Unconditionally print directive
Akira Hatanaka [Fri, 2 Nov 2012 20:56:25 +0000 (20:56 +0000)]
[mips] Delete MipsFunctionInfo::EmitNOAT. Unconditionally print directive
"set .noat" so that the assembler doesn't issue warnings when register $AT is
used.

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

11 years agoXLC supports the same atomic functions as GCC, use them.
Rafael Espindola [Fri, 2 Nov 2012 20:54:45 +0000 (20:54 +0000)]
XLC supports the same atomic functions as GCC, use them.
Patch by Kai.

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

11 years agoChange resolveRelocation parameters so the relocations can find placeholder values...
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

11 years agoDocumentation: fix typos.
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

11 years agoFix whitespaces
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

11 years agoEnable the assertion in getIntPtrType (I've audited all users of this method and
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

11 years agoAdd a testcase to loop-idiom to cover PR14241 when we start handling
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

11 years agoRevert the switch of loop-idiom to use the new dependence analysis.
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

11 years agoFix an obvious typo that causes an assertion failure when running
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

11 years agoFix sign compare warning. Patch by Mahesha HS.
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

11 years agolibprofile/CommonProfiling.c: Fix according to C89.
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

11 years agoPGO: allows the profile data file name to be specified by the LLVMPROF_OUTPUT
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

11 years agoOutputArg: added an index of the original argument to match the change to
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

11 years agoBBVectorize: Commit the rest of the test-case change.
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

11 years agoBBVectorize: Use target costs for incoming and outgoing values instead of the depth...
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

11 years agoFixed format string to avoid pointer truncation during 64-bit debugging.
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

11 years agoUse the relationship models infrastructure to add two relations - getPredOpcode
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

11 years agoAdd support for generating dwarf debugging info with assembly files
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

11 years agollvm/test/lit.cfg: Don't use mcjit to ppc32 yet, not ready.
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

11 years ago[asan] don't instrument globals that we've created ourselves (reduces the binary...
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

11 years agoAdd a getAddressSpace method to the GEP instruction to mirror that of
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

11 years agoAdd some consistent doxygen comments for the address space helpers.
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

11 years agoNormalize the API and doxygen comments for the ptrtoint instruction.
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

11 years agoRemove a weird static helper from the GEP instruction and just directly
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

11 years agoAs I'm going to be touching several comments in this file, update the
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

11 years agoAdd a test case for PR14233.
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

11 years agoTeach Type::getPointerAddressSpace to look through pointer vectors
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

11 years agoRevert the majority of the next patch in the address space series:
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

11 years agoRevert the series of commits starting with r166578 which introduced the
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

11 years agoBBVectorize: Account for internal shuffle costs
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

11 years agoCleanup another place redundant SP maintained
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

11 years ago[CMake] Add llvm-mcmarkup to check-llvm.
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

11 years agotest/CodeGen/X86/fp-fast.ll: Add +avx.
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

11 years agoAdd a few more simple fast-math constant propagations and cancellations.
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

11 years agoExploit the new identity composition in composeSubRegIndices().
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

11 years agoDon't insert and erase load instruction. Simply create (new) and delete it.
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

11 years agoStreamlined memory manager hierarchy for MCJIT and RuntimeDyld.
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

11 years ago[Support] Fix StrError on Windows to actually return the error string...
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

11 years agoGenerate a table-driven version of TRI::composeSubRegIndices().
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

11 years agoFixed format strings to avoid pointer truncation during 64-bit debugging.
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

11 years agoMC: Simple example parser for MC assembly markup.
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

11 years ago(For X86) Enhancement to add-carray/sub-borrow (adc/sbb) optimization.
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

11 years agoLoopVectorize: Preserve NSW, NUW and IsExact flags.
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

11 years agoFix a bug in the cost calculation of vector casts. Detect situations where bitcasts...
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

11 years agoMark code, not data, as executable in lli RemoteTarget simulator.
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

11 years agoRemove Triple::getArchTypeForDarwinArchName. I lives on the clang driver now.
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

11 years ago[mips] Set isAsCheapAsAMove flag on ADDiu and DADDiu, which enables
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

11 years agoMCJIT unit test: add calls to ensure that instruction caches are properly invalidated...
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

11 years agoPort lli bug fix from r166920 to MCJIT unit test.
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

11 years agoCommit access test.
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

11 years agoRemove stale documentation about tail duplicaton IR pass
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

11 years agoTest case for r167039. Check that tail-call optimization is disabled for
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

11 years agoFix typo in CodeGenerator doc
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

11 years agoLCSSA: Try to recover compile time regressions due to SCEV updates.
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

11 years agoPut the threshold magic number in a variable.
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

11 years agoDisable all old-JIT unit tests on PowerPC.
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

11 years agoRemove fixme about unreachable cases from SwitchToLookupTable
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

11 years agoRemove enum values since they are not used anymore.
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

11 years agoAddress Duncan's comments on r167121.
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

11 years agoBBVectorize: Choose pair ordering to minimize shuffles
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

11 years agoAddress Duncan's comments on r167115
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

11 years agoinstcombine: Migrate strto* optimizations
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

11 years agoFix false -> NULL conversion from r167115 spotted by Benjamin Kramer.
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

11 years agoReplace some instances of UniqueVector with SetVector, which is slightly cheaper.
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

11 years agoDo simple constant propagation in lookup table formation for switches
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

11 years agoFix a couple of comment typos.
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

11 years agoLCSSA: Add a workaround for another nasty SCEV cache invalidation issue.
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

11 years agoAdd IRBuilderBase::getIntPtrTy.
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

11 years agoDependenceAnalysis: Don't crash if there is no constant operand.
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

11 years agoAdd support for ARM segment types PT_ARM_ARCHEXT, PT_ARM_EXIDX and PT_ARM_UNWIND.
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

11 years agoAdd support for Cortex-A15 host recognition.
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

11 years agoImplement ADJCALLSTACKUP and ADJCALLSTACKDOWN
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

11 years agoAdd scalar forms of FMA4 VFNMSUB/VFNMADD to folding tables. Patch from Cameron McInally.
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

11 years agoinstcombine: Migrate strpbrk optimizations
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

11 years agoClean up redundant SP register maintained in X86 TLI
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

11 years agoinstcombine: Migrate strlen optimizations
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

11 years agoinstcombine: Migrate strncpy optimizations
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

11 years agoLoopVectorize: Do not vectorize loops with tiny constant trip counts.
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

11 years agoThis patch addresses an ABI compatibility issue with empty aggregate
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

11 years agoChange signature of function RAFast::spillAll to avoid conversion between
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

11 years agoxlc supports __attribute__((aligned(x))), use it.
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

11 years agoCheck that iterator I is not the end iterator.
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

11 years agoAdd extra declarations of hash_value needed to build llvm with xlc 12.1.
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

11 years agoAdd support for loops that don't start with Zero.
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

11 years agoinstcombine: Migrate stpcpy optimizations
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

11 years agoinstcombine: Split out the __stpcpy_chk simplifications from StrCpyChkOpt
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