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

164400 Commits

Author SHA1 Message Date
Krzysztof Parzyszek
bf9bd5a28e [Hexagon] Mark HVX vector predicate bitwise ops as legal, add patterns
llvm-svn: 332525
2018-05-16 21:00:24 +00:00
Simon Pilgrim
86e2a59391 [X86][SSE] Reduce instruction/register usages for v4i32 vector shifts (PR37441)
As suggested by Fabian on PR37441, use PSHUFLW to extend shift amount types for use with PSRAD/PSRLD to reduce register pressure.

Some of this ideally would be done by combineTargetShuffle but its tricky to do as most of the shuffles are sharing inputs.

Differential Revision: https://reviews.llvm.org/D46959

llvm-svn: 332524
2018-05-16 20:52:52 +00:00
Konstantin Zhuravlyov
deea84a15a AMDGPU : Recalculate SGPRs when trap handler is supported
Differential Revision: https://reviews.llvm.org/D29911

llvm-svn: 332523
2018-05-16 20:47:48 +00:00
Eric Christopher
f4a05c6e9f Fix small grammar-o.
llvm-svn: 332522
2018-05-16 20:34:00 +00:00
Eric Christopher
a54c0a1a0f Fix up a misleading format warning.
llvm-svn: 332521
2018-05-16 20:33:59 +00:00
Sam Clegg
121ec28f09 [WebAssembly] MC: Ensure that FUNCTION_OFFSET relocations are always against function symbols.
The getAtom() method wasn't doing what we needed in all cases. We want
the symbols for the function which defines that section. We can compute
this easily enough and we know that we have at most one function in each
section.

Once this lands I will revert rL331412 which is no longer needed.

Fixes PR37409

Differential Revision: https://reviews.llvm.org/D46970

llvm-svn: 332517
2018-05-16 20:09:05 +00:00
Eli Friedman
e346f11594 [MachineOutliner] Don't save/restore LR for tail calls.
The cost computation assumes we do this correctly, but the actual
lowering was wrong.

Differential Revision: https://reviews.llvm.org/D46923

llvm-svn: 332514
2018-05-16 19:49:01 +00:00
Simon Pilgrim
d75a67d7db [X86] Fix typo in instregex for CVTSI642SDrr
llvm-svn: 332510
2018-05-16 18:31:17 +00:00
Greg Clayton
b78abbe289 Fix llvm::sys::path::remove_dots() to return "." instead of an empty path.
Differential Revision: https://reviews.llvm.org/D46887

llvm-svn: 332508
2018-05-16 18:25:51 +00:00
Roman Lebedev
8f67a027ed [Timers] TimerGroup: add constructor from StringMap<TimeRecord>
Summary:
This is needed for the continuation of D46504,
to be able to store the timings.

Reviewers: george.karpenkov, NoQ, alexfh, sbenza

Reviewed By: alexfh

Subscribers: llvm-commits, cfe-commits

Differential Revision: https://reviews.llvm.org/D46939

llvm-svn: 332506
2018-05-16 18:16:01 +00:00
Roman Lebedev
e01f705d97 [Timers] TimerGroup: make printJSONValues() method public
Summary:
This is needed for the continuation of D46504,
to be able to store the timings.

Reviewers: george.karpenkov, NoQ, alexfh, sbenza

Reviewed By: alexfh

Subscribers: llvm-commits, cfe-commits

Differential Revision: https://reviews.llvm.org/D46938

llvm-svn: 332505
2018-05-16 18:15:56 +00:00
Roman Lebedev
1624a13637 [Timers] TimerGroup::printJSONValue(): print doubles with no precision loss
Summary:
Although this is not stricly required, i would very much prefer
not to have known random precision losses along the way.

Reviewers: george.karpenkov, NoQ, alexfh, sbenza

Reviewed By: george.karpenkov

Subscribers: llvm-commits, cfe-commits

Differential Revision: https://reviews.llvm.org/D46937

llvm-svn: 332504
2018-05-16 18:15:51 +00:00
Roman Lebedev
37b62c0229 [Timers] TimerGroup::printJSONValues(): print mem timer with .mem suffix
Summary: We have just used `.sys` suffix for the previous timer, this is clearly a typo

Reviewers: george.karpenkov, NoQ, alexfh, sbenza

Reviewed By: alexfh

Subscribers: llvm-commits, cfe-commits

Differential Revision: https://reviews.llvm.org/D46936

llvm-svn: 332503
2018-05-16 18:15:47 +00:00
Sanjay Patel
c2895027ce [x86] preserve test intent by removing undef
We need to clean up the DAG floating-point undef logic.
This process is similar to how we handled integer undef
logic in D43141. 

And as we did there, I'm trying to reduce the patch by 
changing tests that would probably become meaningless
once we make those fixes.

llvm-svn: 332501
2018-05-16 17:58:50 +00:00
Sanjay Patel
62db9829ad [x86] preserve test intent by removing undef
We need to clean up the DAG floating-point undef logic.
This process is similar to how we handled integer undef
logic in D43141. 

And as we did there, I'm trying to reduce the patch by 
changing tests that would probably become meaningless
once we make those fixes.

llvm-svn: 332500
2018-05-16 17:58:08 +00:00
Sanjay Patel
34eb717eeb [x86] preserve test intent by removing undef
We need to clean up the DAG floating-point undef logic.
This process is similar to how we handled integer undef
logic in D43141. 

And as we did there, I'm trying to reduce the patch by 
changing tests that would probably become meaningless
once we make those fixes.

llvm-svn: 332499
2018-05-16 17:57:35 +00:00
Craig Topper
96a6129527 [X86][AVX512DQ] Use packed instructions for scalar FP<->i64 conversions on 32-bit targets
As i64 types are not legal on 32-bit targets, insert these into a suitable zero vector and use the packed vXi64<->FP conversion instructions instead.

Fixes PR3163.

Differential Revision: https://reviews.llvm.org/D43441

llvm-svn: 332498
2018-05-16 17:40:07 +00:00
Vedant Kumar
461c82a649 [Debugify] Tighten up the test for -debugify-each, NFC
In post-commit review for r332416, Paul Robinson pointed out that the
test for -debugify-each is not checking what it needs to.

This commit tightens up the test.

llvm-svn: 332497
2018-05-16 17:30:58 +00:00
JF Bastien
63c381f336 Signal handling should be signal-safe
Summary:
Before this patch, signal handling wasn't signal safe. This leads to real-world
crashes. It used ManagedStatic inside of signals, this can allocate and can lead
to unexpected state when a signal occurs during llvm_shutdown (because
llvm_shutdown destroys the ManagedStatic). It also used cl::opt without custom
backing storage. Some de-allocation was performed as well. Acquiring a lock in a
signal handler is also a great way to deadlock.

We can't just disable signals on llvm_shutdown because the signals might do
useful work during that shutdown. We also can't just disable llvm_shutdown for
programs (instead of library uses of clang) because we'd have to then mark the
pointers as not leaked and make sure all the ManagedStatic uses are OK to leak
and remain so.

Move all of the code to lock-free datastructures instead, and avoid having any
of them in an inconsistent state. I'm not trying to be fancy, I'm not using any
explicit memory order because this code isn't hot. The only purpose of the
atomics is to guarantee that a signal firing on the same or a different thread
doesn't see an inconsistent state and crash. In some cases we might miss some
state (for example, we might fail to delete a temporary file), but that's fine.

Note that I haven't touched any of the backtrace support despite it not
technically being totally signal-safe. When that code is called we know
something bad is up and we don't expect to continue execution, so calling
something that e.g. sets errno is the least of our problems.

A similar patch should be applied to lib/Support/Windows/Signals.inc, but that
can be done separately.

Fix r332428 which I reverted in r332429. I originally used double-wide CAS
because I was lazy, but some platforms use a runtime function for that which
thankfully failed to link (it would have been bad for signal handlers
otherwise). I use a separate flag to guard the data instead.

<rdar://problem/28010281>

Reviewers: dexonsmith

Subscribers: steven_wu, llvm-commits
llvm-svn: 332496
2018-05-16 17:25:35 +00:00
Matt Davis
78d832622d [llvm-mca] Move the RegisterFile class into its own translation unit. NFC
Summary: This change will help us turn the DispatchUnit into its own stage.

Reviewers: andreadb, RKSimon, courbet

Reviewed By: andreadb, courbet

Subscribers: mgorny, tschuett, gbedwell, llvm-commits

Differential Revision: https://reviews.llvm.org/D46916

llvm-svn: 332493
2018-05-16 17:07:08 +00:00
Nirav Dave
3660c0db1a [DAG] Prune cycle check in store merge.
As part of merging stores we check that fusing the nodes does not
cause a cycle due to one candidate store being indirectly dependent on
another store (this may happen via chained memory copies). This is
done by searching if a store is a predecessor to another store's
value.

Prune the search at the candidate search's root node which is a
predecessor to all candidate stores. This reduces the
size of the subgraph searched in large basic blocks.

Reviewers: jyknight

Subscribers: llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D46955

llvm-svn: 332490
2018-05-16 16:48:20 +00:00
Nirav Dave
20da29f1dc [DAG] Defer merge store cycle checking to just before merge. NFCI.
llvm-svn: 332489
2018-05-16 16:47:54 +00:00
Nico Weber
a5ef8dbacb Give shared modules in unittests the platform-native extension, make PipSqueak a MODULE
As far as I can tell from revision history, there's no good reason to call
these files .so instead of .dll in Windows, so use the normal extension.

Also change PipSquak from SHARED to MODULE -- it's never passed to
target_link_libraries() and only loaded via dlopen(), so MODULE is more
appropriate. This makes it possible to delete a workaround for SHARED ldflags
being not quite right as well.

No intended behavior change.
https://reviews.llvm.org/D46898

llvm-svn: 332487
2018-05-16 16:29:05 +00:00
Sanjay Patel
6ed8ed1147 [x86] add run with unsafe global param; NFC
llvm-svn: 332486
2018-05-16 16:23:41 +00:00
Tony Tye
cb55d3e580 [AMDGPU] Change llvm.debugtrap to be a debug breakpoint that can resume execution.
No longer require the queue pointer to be passed in in fixed SGPRs.

Differential Revision: https://reviews.llvm.org/D46769

llvm-svn: 332485
2018-05-16 16:19:34 +00:00
Sanjay Patel
711729b1d3 [x86] add tests for DAG FP undef operands; NFC
llvm-svn: 332484
2018-05-16 16:16:48 +00:00
Sander de Smalen
2e093c9ca4 [AArch64][SVE] Improve diagnostics for vectors with incorrect element-size.
For regular SVE vector operands, this patch introduces a more
sensible diagnostic when the vector has a wrong suffix (e.g. z0.s vs z0.b).

For example:
  add z0.s, z1.s, z2.b      -> invalid element width
               ^_____^
               mismatch

For the vector-with-shift/extend (e.g. z0.s, uxtw #2) this patch takes
a slightly different approach and instead returns a 'invalid operand'
if the element size is not as expected. This is because the diagnostics
are more specificied to suggest using the right shift/extend suffix. This
is a trade-off not to introduce more operand classes and still provide
useful diagnostics for LD1 and PRF instructions.

For example:
  ld1w z1.s, p0/z, [x0, z0.s] -> invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw)'
  ld1w z1.d, p0/z, [x0, z0.s] -> invalid operand
          ^________________^
               mismatch

For gather prefetches, both 'z0.s' and 'z0.d' would be allowed:
  prfw #0, p0, [x0, z0.s]   -> invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw) #2'
  prfw #0, p0, [x0, z0.d]   -> invalid shift/extend specified, expected 'z[0..31].d, (lsl|uxtw|sxtw) #2'

Without this change, the diagnostic would unnecessarily suggest a
different element size:
  prfw #0, p0, [x0, z0.s]   -> invalid shift/extend specified, expected 'z[0..31].d, (lsl|uxtw|sxtw) #2'

Reviewers: SjoerdMeijer, aemerson, fhahn, samparker, javed.absar

Reviewed By: SjoerdMeijer

Differential Revision: https://reviews.llvm.org/D46688

llvm-svn: 332483
2018-05-16 15:45:17 +00:00
Sirish Pande
f2ba0203b0 [AArch64] Gangup loads and stores for pairing.
Keep loads and stores together (target defines how many loads
and stores to gang up), such that it will help in pairing
and vectorization.

Differential Revision https://reviews.llvm.org/D46477

llvm-svn: 332482
2018-05-16 15:36:52 +00:00
Sanjay Patel
57f6c9317c [InstCombine] allow more binop (shuffle X), C transforms
The canonicalization was restricted to shuffle masks with
a 1-to-1 mapping to the constant vector, but that disqualifies
the common splat pattern. This is part of solving PR37463:
https://bugs.llvm.org/show_bug.cgi?id=37463

llvm-svn: 332479
2018-05-16 15:15:22 +00:00
Teresa Johnson
abbed81733 [ThinLTO] Make llvm-lto module ID numbering consistent with linkers
The module ID numbering typically starts at 0 (in both the new and old
LTO APIs, used by linkers). Make llvm-lto consistent with that.

Split out of D46699.

llvm-svn: 332476
2018-05-16 14:58:14 +00:00
Teresa Johnson
83c34b486e [ThinLTO] Add const qualifier to a couple of flag getter methods
Split these minor fixes out of D46699.

llvm-svn: 332475
2018-05-16 14:56:02 +00:00
Sander de Smalen
3667e06eb4 [AArch64][SVE] Asm: Support for gather PRF prefetch instructions
Reviewers: rengolin, fhahn, samparker, SjoerdMeijer, javed.absar

Reviewed By: SjoerdMeijer

Differential Revision: https://reviews.llvm.org/D46686

llvm-svn: 332472
2018-05-16 14:16:01 +00:00
Andrea Di Biagio
5b328a4e1c [llvm-mca] Move definitions in FetchStage.cpp inside namespace mca. NFC
Also, get rid of a redundant include in FetchStage.h and FetchStage.cpp.

llvm-svn: 332468
2018-05-16 13:38:17 +00:00
Krzysztof Pszeniczny
b3b8ba7506 [BasicAA] Fix handling of invariant group launders
Summary:
A recent patch ([[ https://reviews.llvm.org/rL331587 | rL331587 ]]) to Capture Tracking taught it that the `launder_invariant_group` intrinsic captures its argument only by returning it. Unfortunately, BasicAA still considered every call instruction as a possible escape source and hence concluded that the result of a `launder_invariant_group` call cannot alias any local non-escaping value. This led to [[ https://bugs.llvm.org/show_bug.cgi?id=37458 | bug 37458 ]].

This patch updates the relevant check for escape sources in BasicAA.

Reviewers: Prazek, kuhar, rsmith, hfinkel, sanjoy, xbolva00

Reviewed By: hfinkel, xbolva00

Subscribers: JDevlieghere, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D46900

llvm-svn: 332466
2018-05-16 13:16:54 +00:00
Simon Dardis
9d04a30d9d [mips] Simplify some of the predicate scopes for (negative) multiply add/sub instructions (NFCI)
llvm-svn: 332464
2018-05-16 12:44:27 +00:00
Simon Dardis
80419bb14e [mips] Join existing scopes for DecoderNamespace (NFCI)
llvm-svn: 332462
2018-05-16 12:37:04 +00:00
Andrea Di Biagio
857c92f90f [llvm-mca] Fix perf regression after r332390.
Revision 332390 introduced a FetchStage class in llvm-mca.
By design, FetchStage owns all the instructions in-flight in the OoO Backend.

Before this change, new instructions were added to a DenseMap indexed by
instruction id. The problem with using a DenseMap is that elements are not
ordered by key. This was causing a massive slow down in method
FetchStage::postExecute(), which searches for instructions retired that can be
deleted.

This patch replaces the DenseMap with a std::map ordered by instruction index.
At the end of every cycle, we search for the first instruction which is not
marked as "retired", and we remove all the previous instructions before it.
This works well because instructions are retired in-order.

Before this patch, a debug build of llvm-mca (on my Ryzen linux machine) took
~8.0 seconds to simulate 3000 iterations of a x86 dot-product (a `vmulps,
vpermilps, vaddps, vpermilps, vaddps` sequence). With this patch, it now takes
~0.8s to run all the 3000 iterations.

llvm-svn: 332461
2018-05-16 12:33:09 +00:00
Clement Courbet
6bd6bd1791 [llvm-exegesis] Fix unused variable warning in release mode.
llvm-svn: 332455
2018-05-16 11:49:15 +00:00
Matt Arsenault
7dd12ffd85 AMDGPU: Custom lower v4i16/v4f16 vector operations
Avoids stack access.

Also handle extract hi elt pattern from truncate + shift
to avoid a couple test regressions.

llvm-svn: 332453
2018-05-16 11:47:30 +00:00
David Bolvansky
24dda2d3d2 [SimplifyLibcalls] Replace locked IO with unlocked IO
Summary: If file stream arg is not captured and source is fopen, we could replace IO calls by unlocked IO ("_unlocked" function variants) to gain better speed,

Reviewers: efriedma, RKSimon, spatel, sanjoy, hfinkel, majnemer, lebedev.ri, rja

Reviewed By: rja

Subscribers: rja, srhines, efriedma, lebedev.ri, llvm-commits

Differential Revision: https://reviews.llvm.org/D45736

llvm-svn: 332452
2018-05-16 11:39:52 +00:00
Simon Pilgrim
d39d2a9256 [X86] Split WriteCvtI2F/WriteCvtF2I into I<->F32 and I<->F64 scheduler classes
A lot of the models still have too many InstRW overrides for these new classes - this needs cleaning up but I wanted to get the classes in first

llvm-svn: 332451
2018-05-16 10:53:45 +00:00
David Green
9e75510744 [LoopUnroll] Split out simplify code after Unroll into a new function. NFC
So that it can be shared with other passes that may end up doing the same
thing.

Differential Revision: https://reviews.llvm.org/D45874

llvm-svn: 332450
2018-05-16 10:41:58 +00:00
Amara Emerson
ba73b15d7a [GlobalISel][IRTranslator] Split aggregates during IR translation.
We currently handle all aggregates by creating one large LLT, and letting the
legalizer deal with splitting them up. However using this approach means that
we can't support big endian code correctly.

This patch changes the way that the IRTranslator deals with aggregate values,
by splitting them up into their constituent element values. To do this, parts
of the translator need to be modified to deal with multiple VRegs for a single
Value.

A new Value to VReg mapper is introduced to help keep compile time under
control, currently there is no measurable impact on CTMark despite the extra
code being generated in some cases.

Patch is based on the original work of Tim Northover.

Differential Revision: https://reviews.llvm.org/D46018

llvm-svn: 332449
2018-05-16 10:32:02 +00:00
Andrea Di Biagio
b7bc832f44 [llvm-mca] Regenerate tests after r332381 and r332361. NFC
llvm-svn: 332447
2018-05-16 10:12:06 +00:00
Simon Dardis
99178a8a52 [mips] Add support for isBranchOffsetInRange and use it for MipsLongBranch
Add support for this target hook, covering MIPS, microMIPS and MIPSR6, along
with some tests. Also add missing getOppositeBranchOpc() cases exposed by the
tests.

Reviewers: atanasyan, abeserminji, smaksimovic

Differential Revision: https://reviews.llvm.org/D46794

llvm-svn: 332446
2018-05-16 10:03:05 +00:00
Clement Courbet
333ade66d9 [llvm-exegesis] Add a flag to output analysis csv to a file.
Reviewers: gchatelet

Subscribers: llvm-commits, tschuett

Differential Revision: https://reviews.llvm.org/D46931

llvm-svn: 332445
2018-05-16 09:50:04 +00:00
Peter Smith
c69d5b5cbb [AArch64] Support "S" inline assembler constraint
This patch re-introduces the "S" inline assembler constraint. This matches
an absolute symbolic address or a label reference. The primary use case is

asm("adrp %0, %1\n\t"
    "add %0, %0, :lo12:%1" : "=r"(addr) : "S"(&var));

I say re-introduces as it seems like "S" was implemented in the original
AArch64 backend, but it looks like it wasn't carried forward to the merged
backend. The original implementation had A and L modifiers that could be
used to print ":lo12:" to the string. It looks like gcc doesn't use these
and :lo12: is expected to be written in the inline assembly string so I've
not implemented A and L. Clang already supports the S modifier.

Fixes PR37180

Differential Revision: https://reviews.llvm.org/D46745

llvm-svn: 332444
2018-05-16 09:33:25 +00:00
Andrea Di Biagio
38049fdba1 [llvm-mca] Remove redundant includes in Stage.h.
This patch also makes Stage::isReady() a const method.

No functional change.

llvm-svn: 332443
2018-05-16 09:24:38 +00:00
Sander de Smalen
aaacb56f16 [AArch64][SVE] Asm: Support for structured LD2, LD3 and LD4 (scalar+scalar) load instructions.
Reviewers: rengolin, fhahn, samparker, SjoerdMeijer, javed.absar

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D46679

llvm-svn: 332442
2018-05-16 09:16:20 +00:00
Clement Courbet
3c993bb482 Fix unused variable warning in r332437.
llvm-svn: 332441
2018-05-16 09:10:04 +00:00