1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

86368 Commits

Author SHA1 Message Date
Chandler Carruth
35dcbee3b9 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.

llvm-svn: 167226
2012-11-01 10:59:30 +00:00
Chandler Carruth
82306aeb7e 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.

llvm-svn: 167225
2012-11-01 10:46:54 +00:00
Chandler Carruth
6410ac7263 Add a test case for PR14233.
llvm-svn: 167224
2012-11-01 10:26:36 +00:00
Chandler Carruth
07e0dbea87 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.

llvm-svn: 167223
2012-11-01 09:37:49 +00:00
Chandler Carruth
0a6b99ee2b 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.

llvm-svn: 167222
2012-11-01 09:14:31 +00:00
Chandler Carruth
76f7f4a33e 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.
llvm-svn: 167221
2012-11-01 08:07:29 +00:00
Hal Finkel
5463245540 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.

llvm-svn: 167217
2012-11-01 06:26:34 +00:00
Michael Liao
677865ac64 Cleanup another place redundant SP maintained
llvm-svn: 167209
2012-11-01 03:47:50 +00:00
NAKAMURA Takumi
f12f8c13ef [CMake] Add llvm-mcmarkup to check-llvm.
llvm-svn: 167208
2012-11-01 02:13:50 +00:00
NAKAMURA Takumi
e2c67c353f test/CodeGen/X86/fp-fast.ll: Add +avx.
llvm-svn: 167207
2012-11-01 02:13:45 +00:00
Owen Anderson
8f66d7107c Add a few more simple fast-math constant propagations and cancellations.
llvm-svn: 167200
2012-11-01 02:00:53 +00:00
Jakob Stoklund Olesen
88f83a03e9 Exploit the new identity composition in composeSubRegIndices().
The static compose() function in RegisterCoalescer was doing the exact
same thing.

llvm-svn: 167198
2012-11-01 01:15:43 +00:00
Jakub Staszak
131641627b Don't insert and erase load instruction. Simply create (new) and delete it.
llvm-svn: 167196
2012-11-01 01:10:43 +00:00
Andrew Kaylor
33e910f445 Streamlined memory manager hierarchy for MCJIT and RuntimeDyld.
Patch by Ashok Thirumurthi

llvm-svn: 167192
2012-11-01 00:46:04 +00:00
Michael J. Spencer
cfb51565fa [Support] Fix StrError on Windows to actually return the error string...
llvm-svn: 167191
2012-11-01 00:34:09 +00:00
Jakob Stoklund Olesen
4498c89d5f 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.

llvm-svn: 167190
2012-11-01 00:32:10 +00:00
Andrew Kaylor
17a434c0ae Fixed format strings to avoid pointer truncation during 64-bit debugging.
llvm-svn: 167185
2012-11-01 00:17:11 +00:00
Jim Grosbach
ca24351f26 MC: Simple example parser for MC assembly markup.
Nothing fancy, just a simple demonstration parser.

llvm-svn: 167181
2012-10-31 23:24:13 +00:00
Shuxin Yang
4762eb1825 (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.

llvm-svn: 167180
2012-10-31 23:11:48 +00:00
Nadav Rotem
0a30b41020 LoopVectorize: Preserve NSW, NUW and IsExact flags.
llvm-svn: 167174
2012-10-31 21:40:39 +00:00
Nadav Rotem
e3083d1688 Fix a bug in the cost calculation of vector casts. Detect situations where bitcasts cost zero.
llvm-svn: 167170
2012-10-31 20:52:26 +00:00
Andrew Kaylor
776c73fc9d Mark code, not data, as executable in lli RemoteTarget simulator.
llvm-svn: 167164
2012-10-31 20:37:14 +00:00
Rafael Espindola
6ec1315705 Remove Triple::getArchTypeForDarwinArchName. I lives on the clang driver now.
llvm-svn: 167157
2012-10-31 18:52:25 +00:00
Akira Hatanaka
245eaafd42 [mips] Set isAsCheapAsAMove flag on ADDiu and DADDiu, which enables
re-materialization of immediate loads.

llvm-svn: 167153
2012-10-31 18:37:55 +00:00
Amara Emerson
efb5b4e564 MCJIT unit test: add calls to ensure that instruction caches are properly invalidated before code execution.
llvm-svn: 167146
2012-10-31 17:44:16 +00:00
Amara Emerson
a42e54ebd4 Port lli bug fix from r166920 to MCJIT unit test.
llvm-svn: 167145
2012-10-31 17:41:51 +00:00
Amara Emerson
6abdedd25e Commit access test.
llvm-svn: 167144
2012-10-31 17:35:12 +00:00
Arnold Schwaighofer
1eee45a5ec 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.

llvm-svn: 167140
2012-10-31 17:25:31 +00:00
Akira Hatanaka
6632837f2e Test case for r167039. Check that tail-call optimization is disabled for
mips16.

llvm-svn: 167139
2012-10-31 17:25:23 +00:00
Eli Bendersky
6454200600 Fix typo in CodeGenerator doc
llvm-svn: 167137
2012-10-31 16:41:07 +00:00
Benjamin Kramer
ed81d2236e 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.

llvm-svn: 167136
2012-10-31 16:30:03 +00:00
Nadav Rotem
c0528d8ea7 Put the threshold magic number in a variable.
llvm-svn: 167134
2012-10-31 16:22:16 +00:00
Ulrich Weigand
d3685b18a9 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).

llvm-svn: 167133
2012-10-31 16:18:02 +00:00
Hans Wennborg
4c6d01059c Remove fixme about unreachable cases from SwitchToLookupTable
SimplifyCFG will have removed those cases for us.

llvm-svn: 167132
2012-10-31 16:15:25 +00:00
Nadav Rotem
6319d757df Remove enum values since they are not used anymore.
llvm-svn: 167131
2012-10-31 16:14:06 +00:00
Hans Wennborg
cbd5d3ec7f Address Duncan's comments on r167121.
llvm-svn: 167130
2012-10-31 15:31:09 +00:00
Hal Finkel
d1fc849359 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.

llvm-svn: 167122
2012-10-31 15:17:07 +00:00
Hans Wennborg
fcabedaf7a Address Duncan's comments on r167115
- Use 0 instead of NULL
 - Helper function for "dyn_cast, else lookup in the constant pool".

llvm-svn: 167121
2012-10-31 15:14:39 +00:00
Meador Inge
ccbf761437 instcombine: Migrate strto* optimizations
This patch migrates the strto* optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167119
2012-10-31 14:58:26 +00:00
Hans Wennborg
39a7eef3d9 Fix false -> NULL conversion from r167115 spotted by Benjamin Kramer.
llvm-svn: 167117
2012-10-31 14:36:48 +00:00
Benjamin Kramer
83badeb894 Replace some instances of UniqueVector with SetVector, which is slightly cheaper.
No functionality change.

llvm-svn: 167116
2012-10-31 13:45:49 +00:00
Hans Wennborg
d162380e59 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.

llvm-svn: 167115
2012-10-31 13:42:45 +00:00
Benjamin Kramer
a4a27417ec Fix a couple of comment typos.
llvm-svn: 167113
2012-10-31 11:25:32 +00:00
Benjamin Kramer
6cd4d55f5b 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.

llvm-svn: 167112
2012-10-31 10:01:29 +00:00
Evgeniy Stepanov
00759553de Add IRBuilderBase::getIntPtrTy.
llvm-svn: 167111
2012-10-31 09:50:01 +00:00
Benjamin Kramer
f6b2bc4c9a DependenceAnalysis: Don't crash if there is no constant operand.
This makes the code match the comments. Resolves a crash in loop idiom (PR14219).

llvm-svn: 167110
2012-10-31 09:20:38 +00:00
James Molloy
6fc0b51b3a Add support for ARM segment types PT_ARM_ARCHEXT, PT_ARM_EXIDX and PT_ARM_UNWIND.
Patch by Pete Chou!

llvm-svn: 167109
2012-10-31 09:10:56 +00:00
James Molloy
8f05183ca1 Add support for Cortex-A15 host recognition.
No testcase, as this is only testable on a C-A15 board.

llvm-svn: 167108
2012-10-31 09:07:37 +00:00
Reed Kotler
82a7f09a30 Implement ADJCALLSTACKUP and ADJCALLSTACKDOWN
llvm-svn: 167107
2012-10-31 05:21:10 +00:00
Craig Topper
d7d1914a7d Add scalar forms of FMA4 VFNMSUB/VFNMADD to folding tables. Patch from Cameron McInally.
llvm-svn: 167106
2012-10-31 04:59:46 +00:00