1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

110055 Commits

Author SHA1 Message Date
Colin LeMahieu
4a42d4abd9 [Hexagon] Replacing cmp* instructions with ones that contain encoding bits.
llvm-svn: 222771
2014-11-25 18:20:52 +00:00
Colin LeMahieu
d1d75bedac Cleaning out google tests from MC.
llvm-svn: 222770
2014-11-25 18:03:08 +00:00
Hans Wennborg
333795bf71 LazyValueInfo: Actually re-visit partially solved block-values in solveBlockValue()
If solveBlockValue() needs results from predecessors that are not already
computed, it returns false with the intention of resuming when the dependencies
have been resolved. However, the computation would never be resumed since an
'overdefined' result had been placed in the cache, preventing any further
computation.

The point of placing the 'overdefined' result in the cache seems to have been
to break cycles, but we can check for that when inserting work items in the
BlockValue stack instead. This makes the "stop and resume" mechanism of
solveBlockValue() work as intended, unlocking more analysis.

Using this patch shaves 120 KB off a 64-bit Chromium build on Linux.

I benchmarked compiling bzip2.c at -O2 but couldn't measure any difference in
compile time.

Tests by Jiangning Liu from r215343 / PR21238, Pete Cooper, and me.

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

llvm-svn: 222768
2014-11-25 17:23:05 +00:00
Joerg Sonnenberger
0740338c61 Small model and JIT generally don't go well with each other.
On LP64 platforms, it will work or not depending on the choosen memory
layout, so neither PASS nor XFAIL is appropiate.
As UNSUPPORTED as per-test target doesn't exist (yet), remove the test
instead to unbreak the builds.

llvm-svn: 222767
2014-11-25 17:14:22 +00:00
Rafael Espindola
6791ceb3c6 Set the body of a new struct as soon as it is created.
This changes the order in which different types are passed to get, but
one order is not inherently better than the other.

The main motivation is that this simplifies linkDefinedTypeBodies now that
it is only linking "real" opaque types. It is also means that we only have to
call it once and that we don't need getImpl.

A small change in behavior is that we don't copy type names when resolving
opaque types. This is an improvement IMHO, but it can be added back if
desired. A test is included with the new behavior.

llvm-svn: 222764
2014-11-25 15:33:40 +00:00
Evgeniy Stepanov
930e5bcfb5 [msan] Annotate zlib functions for MemorySanitizer.
Mark destination buffer in zlib::compress and zlib::decompress as fully
initialized.

When building LLVM with system zlib and MemorySanitizer instrumentation,
MSan does not observe memory writes in zlib code and erroneously considers
zlib output buffers as uninitialized, resulting in false use-of-uninitialized
memory reports. This change helps MSan understand the state of that memory
and prevents such reports.

llvm-svn: 222763
2014-11-25 15:24:07 +00:00
Rafael Espindola
004800f30f Misc style fixes. NFC.
This just reduces the noise in the next patch.

llvm-svn: 222761
2014-11-25 14:35:53 +00:00
Joerg Sonnenberger
829c958371 Reapply 222538 and update tests to explicitly request small code model
and PIC:

Allow FDE references outside the +/-2GB range supported by PC relative
offsets for code models other than small/medium. For JIT application,
memory layout is less controlled and can result in truncations
otherwise.

Patch from Akos Kiss.

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

llvm-svn: 222760
2014-11-25 13:37:55 +00:00
Joerg Sonnenberger
6dd10513e3 Mark as explicit failing on x86-64 -- small memory model doesn't agree
with default address selections.

llvm-svn: 222759
2014-11-25 13:28:56 +00:00
Rafael Espindola
4e69143a49 Remove a bit of duplicated code.
Exactly the same checks are present in areTypesIsomorphic.

This might have been a premature performance optimization. I cannot reproduce
any slowdown with this patch.

llvm-svn: 222758
2014-11-25 13:19:46 +00:00
Chandler Carruth
5a24aaefeb Revert r222746: That commit did not update any tests and caused two R600
tests to start failing.

Original commit log: R600/SI: Disable commutativity for MIN/MAX_LEGACY

llvm-svn: 222753
2014-11-25 10:50:41 +00:00
Zoran Jovanovic
c3664f6f8a [mips][micromips] Use call instructions with short delay slots
Differential Revision: http://reviews.llvm.org/D6338

llvm-svn: 222752
2014-11-25 10:50:00 +00:00
Chandler Carruth
6264bc6537 [InstCombine] Change LLVM To canonicalize toward the value type being
stored rather than the pointer type.

This change is analogous to r220138 which changed the canonicalization
for loads. The rationale is the same: memory does not have a type,
operations (and thus the values they produce) have a type. We should
match that type as closely as possible rather than reading some form of
semantics into the pointer type.

With this change, loads and stores should no longer be made with
nonsensical types for the values that tehy load and store. This is
particularly important when trying to match specific loaded and stored
types in the process of doing other instcombines, which is what led me
down this twisty maze of miscanonicalization.

I've put quite some effort into looking through IR to find places where
LLVM's optimizer was being unreasonably conservative in the face of
mismatched load and store types, however it is possible (let's say,
likely!) I have missed some. If you see regressions here, or from
r220138, the likely cause is some part of LLVM failing to cope with load
and store types differing. Test cases appreciated, it is important that
we root all of these out of LLVM.

llvm-svn: 222748
2014-11-25 10:09:51 +00:00
Marek Olsak
c593ef1ab1 R600/SI: Disable commutativity for MIN/MAX_LEGACY
llvm-svn: 222746
2014-11-25 09:49:23 +00:00
Charlie Turner
af447286fc Correctly handle Tag_CPU_arch_profile.
Fix ARMAttributeParser::CPU_arch_profile so that it doesn't switch on the value
'0' as a legal value of this build attribute.

Change-Id: Ie05a08900a82bb10b78c841b437df747ce3bb38e
llvm-svn: 222743
2014-11-25 09:30:09 +00:00
Suyog Sarda
cbd1299080 Change the test case file to use FileCheck instead of grep. NFC.
Change by Ankur Garg.

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

llvm-svn: 222740
2014-11-25 08:44:56 +00:00
Chandler Carruth
7feb19d89c Revert r220349 to re-instate r220277 with a fix for PR21330 -- quite
clearly only exactly equal width ptrtoint and inttoptr casts are no-op
casts, it says so right there in the langref. Make the code agree.

Original log from r220277:
Teach the load analysis to allow finding available values which require
inttoptr or ptrtoint cast provided there is datalayout available.
Eventually, the datalayout can just be required but in practice it will
always be there today.

To go with the ability to expose available values requiring a ptrtoint
or inttoptr cast, helpers are added to perform one of these three casts.

These smarts are necessary to finish canonicalizing loads and stores to
the operational type requirements without regressing fundamental
combines.

I've added some test cases. These should actually improve as the load
combining and store combining improves, but they may fundamentally be
highlighting some missing combines for select in addition to exercising
the specific added logic to load analysis.

llvm-svn: 222739
2014-11-25 08:20:27 +00:00
Matt Arsenault
14d278bdec R600/SI: Fix allocating flat_scr_lo / flat_scr_hi
Only the super register flat_scr was marked as reserved,
so in some cases with high register usage it would still
try to allocate the subregisters.

llvm-svn: 222737
2014-11-25 07:53:06 +00:00
David Majnemer
a4a80e242b Forgot to add a file for r222734
llvm-svn: 222736
2014-11-25 07:45:56 +00:00
David Majnemer
3f7ae9c4d6 COFF: Add back an assertion that is superseded by r222124
llvm-svn: 222735
2014-11-25 07:43:14 +00:00
David Majnemer
705e1231b2 COFF: Add another test for r222124
llvm-svn: 222734
2014-11-25 07:42:36 +00:00
Rafael Espindola
4b6af9d891 Use a range loop. NFC.
llvm-svn: 222730
2014-11-25 06:16:27 +00:00
Rafael Espindola
81e0387f70 Style fix: don't indent inside a namemespace.
llvm-svn: 222729
2014-11-25 06:11:24 +00:00
Rafael Espindola
edb5344434 Remove a nested anonymous namespace.
llvm-svn: 222728
2014-11-25 06:07:51 +00:00
Rafael Espindola
34bccf8e6c Fix overly aggressive type merging.
If we find out that two types are *not* isomorphic, we learn nothing about
opaque sub types in both the source and destination.

llvm-svn: 222727
2014-11-25 05:59:24 +00:00
Simon Atanasyan
b1231365ea [Object][Mips] Return address of MIPS symbol with cleared microMIPS indicator bit
llvm-svn: 222726
2014-11-25 05:57:55 +00:00
Rafael Espindola
906b92c9d0 Link the type of aliases.
They are not more or less "well typed" than GlobalVariables.

llvm-svn: 222725
2014-11-25 04:43:59 +00:00
Rafael Espindola
2f4773263d Don't repeat name in comment or duplicate comment. NFC.
llvm-svn: 222724
2014-11-25 04:28:31 +00:00
Rafael Espindola
654b3a4863 Use range loops. NFC.
llvm-svn: 222723
2014-11-25 04:26:19 +00:00
Juergen Ributzka
c90ddb75a2 [FastISel][AArch64] Fix and extend the tbz/tbnz pattern matching.
The pattern matching failed to recognize all instances of "-1", because when
comparing against "-1" we didn't use an APInt of the same bitwidth.

This commit fixes this and also adds inverse versions of the conditon to catch
more cases.

llvm-svn: 222722
2014-11-25 04:16:15 +00:00
Rafael Espindola
690ff4c264 Add an interesting test that we already get right. NFC.
llvm-svn: 222720
2014-11-25 03:47:57 +00:00
David Majnemer
4e5c0f46f5 InstSimplify: Handle some simple tautological comparisons
This handles cases where we are comparing a masked value against itself.
The analysis could be further improved by making it recursive but such
expense is not currently justified.

llvm-svn: 222716
2014-11-25 02:55:48 +00:00
David Blaikie
de835e646d Revert "unique_ptrify LLVMContextImpl::CAZConstants"
Missed the complexities of how these elements are destroyed.

This reverts commit r222714.

llvm-svn: 222715
2014-11-25 02:26:22 +00:00
David Blaikie
14dc3c5b02 unique_ptrify LLVMContextImpl::CAZConstants
llvm-svn: 222714
2014-11-25 02:13:54 +00:00
Hal Finkel
d19aa4cdf8 [PowerPC] Add the 'attn' instruction
The attn instruction is not part of the Power ISA, but is documented in the A2
user manual, and is accepted by the GNU assembler for the A2 and the POWER4+.
Reported as part of PR21650.

llvm-svn: 222712
2014-11-25 00:30:11 +00:00
Hal Finkel
515f6e50f5 [PowerPC] Implement combineRepeatedFPDivisors
This does not matter on newer cores (where we can use reciprocal estimates in
fast-math mode anyway), but for older cores this allows us to generate better
fast-math code where we have multiple FDIVs with a common divisor.

llvm-svn: 222710
2014-11-24 23:45:21 +00:00
Philip Reames
f22f53238c Factor check for the assume intrinsic out of checks in computeKnownBitsFromAssume
We were matching against the assume intrinsic in every check.  Since we know that it must be an assume, this is just wasted work.  Somewhat surprisingly, matching an intrinsic id is actually relatively expensive.  It devolves to a string construction and comparison in Function::isIntrinsic.

I originally spotted this because it showed up in a performance profile of my compiler.  I've since discovered a separate issue which seems to be the actual root cause, but this is minor perf goodness regardless.  

I'm likely to follow up with another change to factor out the comparison matching.  There's no need to match the compare instruction in every single one of the tests.

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

llvm-svn: 222709
2014-11-24 23:44:28 +00:00
Philip Reames
83a1682665 Incorporate review comments from r221742
This change implements the comment and style changes Sean requested during post commit review with r221742.  Sorry for the delay.

llvm-svn: 222707
2014-11-24 23:24:24 +00:00
Matt Arsenault
454e837bd2 Bug 21610: Canonicalize min/max fcmp selects to use ordered comparisons
llvm-svn: 222705
2014-11-24 23:15:18 +00:00
Matt Arsenault
ae1a2b7c22 Convert test to FileCheck and use CHECK-LABEL
llvm-svn: 222704
2014-11-24 23:03:17 +00:00
Philip Reames
754fe149f7 Clarify wording in the LangRef around !invariant.load
Clarify the wording around !invariant.load to properly reflect the semantics of such loads with respect to control dependence and location lifetime.  To the best of my knowledge, the revised wording respects the actual implementation and understanding of issues involved highlighted in the recent 'Optimization hints for "constant" loads' thread on LLVMDev.  

In particular, I'm aiming for the following results:
- To clarify that an invariant.load can fault and must respect control dependence.  In particular, it is not sound to unconditionally pull an invariant load out of a loop if that loop would potentially never execute.  
- To clarify that the invariant nature of a given pointer does not preclude the modification of that location through a pointer which is unrelated to the load operand.  In particular, initializing a location and then passing a pointer through an opaque intrinsic which produces a new unrelated pointer, should behave as expected provided that the intrinsic is memory dependent on the initializing store.  
- To clarify that storing a value to an invariant location is defined.  It can not, for example, be considered unreachable.  The value stored can be assumed to be equal to the value of any previous (or following!) invariant load, but the store itself is defined.  

I recommend that anyone interested in using !invariant.load, or optimizing for them, read over the discussion in the review thread.  A number of motivating examples are discussed.

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

llvm-svn: 222700
2014-11-24 22:32:43 +00:00
Rafael Espindola
9584ebd5dc Add a disable-output option to the gold plugin.
This corresponds to the opt option and is handy for profiling.

llvm-svn: 222687
2014-11-24 21:18:14 +00:00
Rafael Espindola
ed91a36cd8 Remove the unused FindUsedTypes pass.
It was dead since r134829.

llvm-svn: 222684
2014-11-24 20:53:26 +00:00
Rafael Espindola
5cee6ee598 Add and use Type::subtypes. NFC.
llvm-svn: 222682
2014-11-24 20:44:36 +00:00
Rafael Espindola
c8934bcfb9 Pass the .ll files to llvm-link directly. NFC.
llvm-svn: 222681
2014-11-24 20:35:59 +00:00
Sergey Dmitrouk
3881f8ff0b Correct path to regression tests in ExtendingLLVM
llvm-svn: 222678
2014-11-24 19:40:07 +00:00
Chad Rosier
17cb0c630f [AArch64] Fix clobber computation in A57LoadBalancing pass.
Extremely difficult to reproduce, so no test case included.
PR21637

llvm-svn: 222677
2014-11-24 18:57:58 +00:00
Colin LeMahieu
c450f360d3 Removing unused variable.
llvm-svn: 222676
2014-11-24 18:55:32 +00:00
Kostya Serebryany
cb8f8175c9 [asan/coverage] change the way asan coverage instrumentation is done: instead of setting the guard to 1 in the generated code, pass the pointer to guard to __sanitizer_cov and set it there. No user-visible functionality change expected
llvm-svn: 222675
2014-11-24 18:49:53 +00:00
Ulrich Weigand
24b899d017 [PowerPC] Fix PR 21652 - copy st_other bits on symbol assignment
When processing an assignment in the integrated assembler that sets
a symbol to the value of another symbol, we need to copy the st_other
bits that encode the local entry point offset.

Modeled after MipsTargetELFStreamer::emitAssignment handling of the
ELF::STO_MIPS_MICROMIPS flag.

llvm-svn: 222672
2014-11-24 18:09:47 +00:00