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

121797 Commits

Author SHA1 Message Date
JF Bastien
298f59c2b7 [MergeFuncs] Fix bug in merging GetElementPointers
GetElementPointers must have the first argument's type compared
for structural equivalence. Previously the code erroneously compared the
pointer's type, but this code was dead because all pointer types (of the
same address space) are the same. The pointee must be compared instead
(using the type stored in the GEP, not from the pointer type which will
be erased anyway).

Author: jrkoenig
Reviewers: dschuff, nlewycky, jfb
Subscribers: nlewycky, llvm-commits
Differential revision: http://reviews.llvm.org/D12820

llvm-svn: 247570
2015-09-14 15:37:48 +00:00
John Brawn
2b184463e4 [ARM] Extract shifts out of multiply-by-constant
Turning (op x (mul y k)) into (op x (lsl (mul y k>>n) n)) is beneficial when
we can do the lsl as a shifted operand and the resulting multiply constant is
simpler to generate.

Do this by doing the transformation when trying to select a shifted operand,
as that ensures that it actually turns out better (the alternative would be to
do it in PreprocessISelDAG, but we don't know for sure there if extracting the
shift would allow a shifted operand to be used).

Differential Revision: http://reviews.llvm.org/D12196

llvm-svn: 247569
2015-09-14 15:19:41 +00:00
NAKAMURA Takumi
b3420e402b Reformat partially.
llvm-svn: 247557
2015-09-14 12:51:53 +00:00
NAKAMURA Takumi
7da5b0abd1 Reformat blank lines.
llvm-svn: 247556
2015-09-14 12:51:47 +00:00
NAKAMURA Takumi
7dd2a194d3 Revert part of r247553, "[CMake] Reformat CLANG_TEST_DEPS." It was accidental commit.
llvm-svn: 247555
2015-09-14 12:51:01 +00:00
NAKAMURA Takumi
5b68ab085b [CMake] Reformat CLANG_TEST_DEPS.
llvm-svn: 247553
2015-09-14 12:41:53 +00:00
Simon Atanasyan
776c0c3757 [mips] Remove redundant nested-name-specifier. NFC
llvm-svn: 247547
2015-09-14 11:18:22 +00:00
Simon Atanasyan
b24f71de67 [mips] Save a copy of MipsABIInfo in the MipsTargetStreamer to escape a dangling pointer
The MipsTargetELFStreamer can receive ABI info from many sources. For example,
from the MipsAsmParser instance. Lifetime of the MipsAsmParser can be shorter
than MipsTargetELFStreamer's lifetime. In that case we get a dangling pointer
to MipsABIInfo.

Differential Revision: http://reviews.llvm.org/D12805

llvm-svn: 247546
2015-09-14 11:18:03 +00:00
NAKAMURA Takumi
bea74e4271 Whitespace.
llvm-svn: 247543
2015-09-14 11:14:39 +00:00
NAKAMURA Takumi
3164656806 GlobalsAAResult: Try to fix crash.
DeletionCallbackHandle holds GAR in its creation. It assumes;

  - It is registered as CallbackVH. It should not be moved in its life.
  - Its parent, GAR, may be moved.

To move list<DeletionCallbackHandle> GlobalsAAResult::Handles,
GAR must be updated with the destination in GlobalsAAResult(&&).

llvm-svn: 247534
2015-09-14 06:16:44 +00:00
Craig Topper
ca55ea025a [TableGen] Use range-based for loops and make a helper function static. NFC
llvm-svn: 247529
2015-09-13 18:01:25 +00:00
Craig Topper
3a8a37d8ce [TableGen] Simplify some code by using StringRef::find instead of std::find. NFC
llvm-svn: 247528
2015-09-13 18:01:20 +00:00
Craig Topper
6f1d03be7a [TableGen] Use 'size_t' instead of 'unsigned' to better match the argument types of addAsmOperand. NFC
llvm-svn: 247527
2015-09-13 18:01:09 +00:00
Simon Pilgrim
0b2a131879 [X86][MMX] Added shuffle decodes for MMX/3DNow! shuffles.
Added shuffle decodes for MMX PUNPCK + PSHUFW shuffles.
Added shuffle decodes for 3DNow! PSWAPD shuffles.

llvm-svn: 247526
2015-09-13 11:28:45 +00:00
Chandler Carruth
bcbc41fdb2 [FunctionAttrs] Move the malloc-like test to a static helper function
that could be used from a new pass manager. This one makes particular
sense as a static helper as it doesn't even need TLI.

llvm-svn: 247525
2015-09-13 08:23:27 +00:00
Chandler Carruth
55bf36b635 [FunctionAttrs] Factor the logic to test for a known non-null return out
of a method and into a re-usable static helper. We can potentially use
this function from the implementation of a new pass manager oriented
version of the pass. Also add some better documentation of exactly what
the semantic model of this routine is (it isn't trivial) and use a more
modern naming convention for it.

llvm-svn: 247524
2015-09-13 08:17:14 +00:00
Elena Demikhovsky
07a6c5ce5d AVX-512: Fixed a bug in OR/XOR operations for 512-bit FP values on KNL.
KNL does not have VXORPS, VORPS for 512-bit values.
I use integer VPXOR, VPOR that actually do the same.

X86ISD::FXOR/FOR are generated as a result of FSUB combining.

Differential Revision: http://reviews.llvm.org/D12753

llvm-svn: 247523
2015-09-13 08:15:15 +00:00
Chandler Carruth
fd5bcc53a3 [FunctionAttrs] Make the per-function attribute inference a boring
static function rather than a method. It just needed access to
TargetLibraryInfo, and this way it can be easily reused between the
current FunctionAttrs implementation and any port for the new pass
manager.

llvm-svn: 247522
2015-09-13 08:03:23 +00:00
Chandler Carruth
3fa570d0fb [FunctionAttrs] Collect utility functions as static helpers rather than
methods. They don't need anything from the class anyways.

Also, collect the declarations into the private section of the pass.

llvm-svn: 247521
2015-09-13 07:50:43 +00:00
Chandler Carruth
5d5fff4806 Clean up doxygen comments in FunctionAttrs, promoting some non-doxygen
comments, deleting duplicate comments, moving comments to consistently
live on the definition since these are all really internal routines,
etc. NFC.

llvm-svn: 247520
2015-09-13 06:57:25 +00:00
Chandler Carruth
a49c1a1040 Do some spring cleaning on FunctionAttrs.cpp with clang-format prior to
other refactorings and cleanups here.

llvm-svn: 247519
2015-09-13 06:47:20 +00:00
Davide Italiano
c7827d8603 [llvm-mc] More meaningful error if input file doesn't exist.
Before we just printed on stderr the program name. Now at least we
print the name of the file that doesn't exist. There's probably room
for improvement of error handling in llvm-mc (and the tools in general),
but still this is a step forward.

llvm-svn: 247518
2015-09-13 04:09:40 +00:00
Sanjay Patel
21adf9726f [x86] enable machine combiner reassociations for 128-bit vector logical integer insts (2nd try)
The changes in:
test/CodeGen/X86/machine-cp.ll
are just due to scheduling differences after some logic instructions were reassociated.

llvm-svn: 247516
2015-09-12 19:47:50 +00:00
Ahmed Bougacha
a00199c5e1 [CodeGen] Fix AtomicExpand invalidation issue caused by r247429.
llvm-svn: 247514
2015-09-12 18:51:23 +00:00
Simon Pilgrim
17901f3024 [X86] Renamed lowerVectorShuffleAsUnpack NFCI.
Renamed to lowerVectorShuffleAsPermuteAndUnpack to make it clear that it lowers to more than just a UNPCK instruction.

llvm-svn: 247513
2015-09-12 18:26:47 +00:00
Joerg Sonnenberger
47dcb457f4 Don't use bashism/kshism of test ==. From Kamil Rytarowski.
Differential Revision: http://reviews.llvm.org/D12642

llvm-svn: 247512
2015-09-12 16:30:32 +00:00
Simon Pilgrim
56e6eab0db [X86] Moved lowerVectorShuffleWithUNPCK earlier to make reuse easier. NFCI.
llvm-svn: 247511
2015-09-12 16:03:06 +00:00
Simon Pilgrim
a01d635ac0 [X86] Added i1 vector sextload tests
llvm-svn: 247509
2015-09-12 15:36:41 +00:00
Simon Pilgrim
2c099943ec [X86][FMA] Refreshed fma tests
llvm-svn: 247508
2015-09-12 15:33:05 +00:00
Sanjay Patel
9965d5f476 revert r247506; need to verify changes in existing tests
llvm-svn: 247507
2015-09-12 15:27:31 +00:00
Sanjay Patel
8f3e510d08 [x86] enable machine combiner reassociations for 128-bit vector logical integer insts
llvm-svn: 247506
2015-09-12 14:58:04 +00:00
Simon Pilgrim
2793fdef03 Fixed unused variable warning.
llvm-svn: 247505
2015-09-12 14:00:17 +00:00
Simon Pilgrim
4f410cc25c [InstCombine] CVTPH2PS Vector Demanded Elements + Constant Folding
Improved InstCombine support for CVTPH2PS (F16C half 2 float conversion):

<4 x float> @llvm.x86.vcvtph2ps.128(<8 x i16>) - only uses the bottom 4 i16 elements for the conversion.

Added constant folding support.

Differential Revision: http://reviews.llvm.org/D12731

llvm-svn: 247504
2015-09-12 13:39:53 +00:00
Simon Pilgrim
6598ecb8a6 [X86][SSE] Use general sext IR for (v)pmovsx stack folding tests
llvm-svn: 247502
2015-09-12 11:45:24 +00:00
Chandler Carruth
fac09e6d0b [PM] Port SROA to the new pass manager.
In some ways this is a very boring port to the new pass manager as there
are no interesting analyses or dependencies or other oddities.

However, this does introduce the first good example of a transformation
pass with non-trivial state porting to the new pass manager. I've tried
to carve out patterns here to replicate elsewhere, and would appreciate
comments on whether folks like these patterns:

- A common need in the new pass manager is to effectively lift the pass
  class and some of its state into a public header file. Prior to this,
  LLVM used anonymous namespaces to provide "module private" types and
  utilities, but that doesn't scale to cases where a public header file
  is needed and the new pass manager will exacerbate that. The pattern
  I've adopted here is to use the namespace-cased-name of the core pass
  (what would be a module if we had them) as a module-private namespace.
  Then utility and other code can be declared and defined in this
  namespace. At some point in the future, we could even have
  (conditionally compiled) code that used modules features when
  available to do the same basic thing.

- I've split the actual pass run method in two in order to expose
  a private method usable by the old pass manager to wrap the new class
  with a minimum of duplicated code. I actually looked at a bunch of
  ways to automate or generate these, but they are all quite terrible
  IMO. The fundamental need is to extract the set of analyses which need
  to cross this interface boundary, and that will end up being too
  unpredictable to effectively encapsulate IMO. This is also
  a relatively small amount of boiler plate that will live a relatively
  short time, so I'm not too worried about the fact that it is boiler
  plate.

The rest of the patch is totally boring but results in a massive diff
(sorry). It just moves code around and removes or adds qualifiers to
reflect the new name and nesting structure.

Differential Revision: http://reviews.llvm.org/D12773

llvm-svn: 247501
2015-09-12 09:09:14 +00:00
Larisse Voufo
758e77398a Clean up: Refactoring the hardcoded value of 6 for FindAvailableLoadedValue()'s parameter MaxInstsToScan.
llvm-svn: 247497
2015-09-12 01:41:55 +00:00
Bruce Mitchener
9ad7a63fa9 Fix typos.
Summary: This fixes a variety of typos in docs, code and headers.

Subscribers: jholewinski, sanjoy, arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D12626

llvm-svn: 247495
2015-09-12 01:17:08 +00:00
Hal Finkel
2e86d35273 Move asserts from PHINode::addIncoming to PHINode::setIncoming*
We had asserts in PHINode::addIncoming to check that the value types matched
the type of the PHI, and that the associated BB was not null. These did not
catch, however, later uses of setIncomingValue and setIncomingBlock (which are
called by addIncoming as well). Moving the asserts to PHINode::setIncoming*
provides better coverage. NFC.

llvm-svn: 247492
2015-09-12 00:08:21 +00:00
Adrian Prantl
32ca4a4c61 dsymutil: Factor out the relocation handling into a RelocationManager (NFC)
llvm-svn: 247490
2015-09-11 23:45:30 +00:00
Davide Italiano
471a22e6d3 [MC] Fix style bugs introduced in r247471. Reported by Rafael Espindola.
llvm-svn: 247483
2015-09-11 22:04:21 +00:00
Davide Italiano
72e67d3a24 [MC] Don't crash on division by zero.
Differential Revision:	http://reviews.llvm.org/D12776

llvm-svn: 247471
2015-09-11 20:47:35 +00:00
Yunzhong Gao
15919ad6d1 Add a non-exiting diagnostic handler for LTO.
This is in order to give LTO clients a chance to do some clean-up before
terminating the process.

llvm-svn: 247461
2015-09-11 20:01:53 +00:00
Sanjay Patel
ca619ceee9 typo; NFC
llvm-svn: 247454
2015-09-11 19:29:18 +00:00
Akira Hatanaka
a71c14303e Use function attribute "stackrealign" to decide whether stack
realignment should be forced.

With this commit, we can now force stack realignment when doing LTO and
do so on a per-function basis. Also, add a new cl::opt option
"stackrealign" to CommandFlags.h which is used to force stack
realignment via llc's command line.

Out-of-tree projects currently using -force-align-stack to force stack
realignment should make changes to attach the attribute to the functions
in the IR.

Differential Revision: http://reviews.llvm.org/D11814

llvm-svn: 247450
2015-09-11 18:54:38 +00:00
Chris Bieneman
dbbe591414 [CMake] [Darwin] Need to set lto_library on CMAKE_MODULE_LINKER_FLAGS as well
This is a follow-on to r247308.

llvm-svn: 247443
2015-09-11 18:39:19 +00:00
David Majnemer
3ea3b025ac [X86] Make sure startproc/endproc are paired
We used different conditions to determine if we should emit startproc vs
endproc.  Use the same condition to ensure that they will always be
paired.

This fixes PR24374.

llvm-svn: 247435
2015-09-11 17:34:34 +00:00
Reid Kleckner
5caec8e071 [IR] Print the label operands of a catchpad like an invoke
The rest of the EH pads are fine, since they have at most one label and
take fewer operands for the personality.

Old catchpad vs. new:
  %5 = catchpad [i8* bitcast (i32 ()* @"\01?filt$0@0@main@@" to i8*)] to label %__except.ret.10 unwind label %catchendblock.9
-----
  %5 = catchpad [i8* bitcast (i32 ()* @"\01?filt$0@0@main@@" to i8*)]
          to label %__except.ret.10 unwind label %catchendblock.9

llvm-svn: 247433
2015-09-11 17:27:52 +00:00
Ahmed Bougacha
3d9f4e715f [CodeGen] Refactor TLI/AtomicExpand interface to make LLSC explicit.
We used to have this magic "hasLoadLinkedStoreConditional()" callback,
which really meant two things:
- expand cmpxchg (to ll/sc).
- expand atomic loads using ll/sc (rather than cmpxchg).

Remove it, and, instead, introduce explicit callbacks:
- bool shouldExpandAtomicCmpXchgInIR(inst)
- AtomicExpansionKind shouldExpandAtomicLoadInIR(inst)

Differential Revision: http://reviews.llvm.org/D12557

llvm-svn: 247429
2015-09-11 17:08:28 +00:00
Ahmed Bougacha
aa999c6622 [CodeGen] Rename AtomicRMWExpansionKind to AtomicExpansionKind.
This lets us generalize its usage to the other atomic instructions.

llvm-svn: 247428
2015-09-11 17:08:17 +00:00
NAKAMURA Takumi
bbd5296cc7 [PR24785] Appease MSC18 to tweak optimizations.
This brings a warning.

  cl : Command line warning D9035: option 'Og-' has been deprecated and will be removed in a future release

We should resolve PR11951 to remove this tweak.

llvm-svn: 247427
2015-09-11 17:08:02 +00:00