1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
Commit Graph

158047 Commits

Author SHA1 Message Date
Matthias Braun
ddd8ed6709 MachineFunction: Return reference from getFunction(); NFC
The Function can never be nullptr so we can return a reference.

llvm-svn: 320884
2017-12-15 22:22:58 +00:00
Matthias Braun
79f7444667 MachineFunction: Slight refactoring; NFC
Slight cleanup/refactor in preparation for upcoming commit.

llvm-svn: 320882
2017-12-15 22:22:46 +00:00
Matthias Braun
8ea9ca15b9 MachineModuleInfo: Remove unused function; NFC
Remove the unused setModule() function; it would be dangerous if someone
actually used it as it wouldn't reset/recompute various other module
related data.

llvm-svn: 320881
2017-12-15 22:22:42 +00:00
Galina Kistanova
a5e5c83140 Fixed the gcc 'enumeral and non-enumeral type in conditional expression [-Werror=extra]' warning introduced by r320750
llvm-svn: 320868
2017-12-15 22:15:29 +00:00
Krzysztof Parzyszek
78458472fe [Hexagon] Remove recursion in visitUsesOf, replace with use queue
This is primarily to reduce stack usage, but ordering the use queue
according to the position in the code (earlier instructions visited
before later ones) reduces the number of unnecessary bottoms due to
visiting instructions out of order, e.g.
  %reg1 = copy %reg0
  %reg2 = copy %reg0
  %reg3 = and %reg1, %reg2
Here, reg3 should be known to be same as reg0-2, but if reg3 is
evaluated after reg1 is updated, but before reg2 is updated, the two
inputs to the and will appear different, causing reg3 to become
bottom.

llvm-svn: 320866
2017-12-15 21:34:05 +00:00
Krzysztof Parzyszek
3942dc3e0b [Hexagon] Handle concat_vectors of all allowed HVX types
llvm-svn: 320865
2017-12-15 21:23:12 +00:00
Craig Topper
a3727ddda8 [X86] Use AND32ri8 instead of AND64ri8 in Asan code in EmitCallAsanReport for 32-bit mode.
This seemed to work due to a quirk in the X86 MC encoder that didn't emit a REX byte that the AND64ri8 implies when in 32-bit mode. This made the encoding the same as AND32ri8. I tried to add an assert to catch the dropped REX prefix that caught this.

llvm-svn: 320864
2017-12-15 21:18:06 +00:00
Craig Topper
f9a1af6191 [X86] In LowerVectorCTPOP use ISD::ZERO_EXTEND/ISD::TRUNCATE instead of the target specific nodes.
The target independent nodes will get legalized to the target specific nodes by their own legalization process. Someday I'd like to stop using a target specific for zero extends and truncates of legal types so the less places we reference the target specific opcode the better.

llvm-svn: 320863
2017-12-15 21:18:05 +00:00
Craig Topper
666643abe8 [X86] Remove unnecessary TODO.
When I wrote it I thought we were missing a potential optimization for KNL. But investigating further shows that for KNL we still do the optimal thing by widening to v4f32 and then using special isel patterns to widen again to zmm a register.

llvm-svn: 320862
2017-12-15 20:57:18 +00:00
Vitaly Buka
781f47298a [LTO] Remove unused RegularLTOState::HasModule
llvm-svn: 320859
2017-12-15 20:50:25 +00:00
Jun Bum Lim
24cf82d710 Re-commit : [LICM] Allow sinking when foldable in loop
This recommits r320823 reverted due to the test failure in sink-foldable.ll and
an unused variable. Added "REQUIRES: aarch64-registered-target" in the test
and removed unused variable.

Original commit message:

  Continue trying to sink an instruction if its users in the loop is foldable.
  This will allow the instruction to be folded in the loop by decoupling it from
  the user outside of the loop.

  Reviewers: hfinkel, majnemer, davidxl, efriedma, danielcdh, bmakam, mcrosier

  Reviewed By: hfinkel

  Subscribers: javed.absar, bmakam, mcrosier, llvm-commits

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

llvm-svn: 320858
2017-12-15 20:33:24 +00:00
Paul Robinson
4289a81c30 Revert "[DWARFv5] Dump an MD5 checksum in the line-table header."
Unit test fails on some bots.

llvm-svn: 320857
2017-12-15 20:29:25 +00:00
Jake Ehrlich
0521b66914 [llvm-objcopy] Reformat everything using clang-format -i
Overtime some non-clang formatted code has creeped into llvm-objcopy. This
patch fixes all of that.

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

llvm-svn: 320856
2017-12-15 20:17:55 +00:00
Krzysztof Parzyszek
0c8998d812 [Hexagon] Fix operand-swapping PatFrag for atomic stores
PatFrag now has the atomicity information stored as bit fields. They
need to be copied to the new PatFrag.

llvm-svn: 320855
2017-12-15 20:13:57 +00:00
Paul Robinson
4c3912754b [DWARFv5] Dump an MD5 checksum in the line-table header.
Adds missing support for DW_FORM_data16.

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

llvm-svn: 320852
2017-12-15 19:52:34 +00:00
Craig Topper
35e52ac78b [X86] Remove assert in X86MCCodeEmitter.cpp that was added in r320830.
It seems to be failing real code which is concerning, but we were silently getting away with it. I'll investigate further.

llvm-svn: 320850
2017-12-15 19:38:14 +00:00
Craig Topper
4dc94be4ae [SelectionDAG][X86] Fix insert_vector_elt lowering for v32i1/v64i1 with non-constant index
Summary:
Currently we don't handle v32i1/v64i1 insert_vector_elt correctly as we fail to look at the number of elements closely and assume it can only be v16i1 or v8i1.

We also can't type legalize v64i1 insert_vector_elt correctly on KNL due to the type not being byte addressable as required by the legalizing through memory accesses path requires.

For the first issue, the patch now tries to pick a 512-bit register with the correct number of elements and promotes to that.

For the second issue, we now extend the vector to a byte addressable type, do the stores to memory, load the two halves, and then truncate the halves back to the original type. Technically since we changed the type, we may not need two loads, but actually checking that is more work and for the v64i1 case we do need them.

Reviewers: RKSimon, delena, spatel, zvi

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 320849
2017-12-15 19:35:22 +00:00
Sean Fertile
320902744c [Memcpy Loop Lowering] Insert loop BB inbetween the split BB.
The original memcpy expansion inserted the loop basic block inbetween
the 2 new basic blocks created by splitting the original block the memcpy
call was in. This commit makes the new memcpy expansion do the same to keep the
layout of the IR matching between the old and new implementations.

Differential Review: https://reviews.llvm.org/D41197

llvm-svn: 320848
2017-12-15 19:29:12 +00:00
Craig Topper
bcd219f726 [X86] Add 'Requires<[In64BitMode]>' to a bunch of instructions that only have memory and immediate operands.
The asm parser wasn't preventing these from being accepted in 32-bit mode. Instructions that use a GR64 register are protected by the parser rejecting the register in 32-bit mode.

llvm-svn: 320846
2017-12-15 19:01:51 +00:00
Craig Topper
a391f74022 [X86] Change BNDLDX to use anymem instead of i64mem for itsmemory operand.
This instruction doesn't access memory. It juse use a similar looking memory encoding. Don't require Intel syntax to put "qword ptr" in front of it.

llvm-svn: 320845
2017-12-15 19:01:50 +00:00
Craig Topper
6903cc801b [X86] Remove the 'Requires' In64BitMode/Not64BitMode from the LWP instructions.
These aren't doing anything due to a top level "let Predicates =". I think the GR32/GR64 register class protects these anyway.

llvm-svn: 320844
2017-12-15 19:01:49 +00:00
Craig Topper
ffe67cc107 [X86] Remove the 'Requires<[In64BitMode]>' from SHSTK instructions.
This has no effect due to a top level "let Predicates =" around the instructions. But its also not required because the GR64 usage in the instruction guarantees it can never match.

llvm-svn: 320843
2017-12-15 19:01:48 +00:00
Sanjay Patel
3cec993869 [TargetLibraryInfo] fix documentation comment; NFC
llvm-svn: 320842
2017-12-15 18:54:29 +00:00
Sanjay Patel
94438a8948 [CodeGen] fix documentation comments; NFC
llvm-svn: 320840
2017-12-15 18:34:45 +00:00
Evandro Menezes
5f52e60bd6 [AArch64] Fix typo in the ASIMD instruction optimization pass
Fix typo in the representative instruction replacement.

Also, fix formatting and reword some comments.

llvm-svn: 320839
2017-12-15 18:26:54 +00:00
Sanjay Patel
0dc93c8fbf fix typo in comment and remove inaccurate comment; NFC
llvm-svn: 320838
2017-12-15 18:25:13 +00:00
Andrew V. Tischenko
bc531d1325 Fix for bug PR35549 - Repeated schedule comments.
Differential Revision: https://reviews.llvm.org/D40960

llvm-svn: 320837
2017-12-15 18:13:05 +00:00
Jun Bum Lim
7c392dfa6d Revert "Re-commit : [LICM] Allow sinking when foldable in loop"
This reverts commit r320833.

llvm-svn: 320836
2017-12-15 18:12:49 +00:00
Sanjay Patel
22efd2df90 [CodeGen] fix documentation comments; NFC
llvm-svn: 320835
2017-12-15 18:09:33 +00:00
Jun Bum Lim
519a2b93ba Re-commit : [LICM] Allow sinking when foldable in loop
This recommit r320823 after fixing a test failure.

 Original commit message:

    Continue trying to sink an instruction if its users in the loop is foldable.
    This will allow the instruction to be folded in the loop by decoupling it from
    the user outside of the loop.

    Reviewers: hfinkel, majnemer, davidxl, efriedma, danielcdh, bmakam, mcrosier

    Reviewed By: hfinkel

    Subscribers: javed.absar, bmakam, mcrosier, llvm-commits

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

llvm-svn: 320833
2017-12-15 17:58:59 +00:00
Michael Trent
6fc9db117d Updated llvm-objdump to display local relocations in Mach-O binaries
Summary:
llvm-objdump's Mach-O parser was updated in r306037 to display external
relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O
parser to display local relocations for MH_PRELOAD files. When used with
the -macho option relocations will be displayed in a historical format.

All tests are passing for llvm, clang, and lld. llvm-objdump builds without
compiler warnings.

rdar://35778019

Reviewers: enderby

Reviewed By: enderby

Subscribers: llvm-commits

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

llvm-svn: 320832
2017-12-15 17:57:40 +00:00
Craig Topper
cd0ce7740e [X86] Fix XSAVE64 and similar instructions to not be allowed by the assembler in 32-bit mode.
There was a top level "let Predicates =" in the .td file that was overriding the Requires on each instruction.

I've added an assert to the code emitter to catch more cases like this. I'm sure this isn't the only place where the right predicates aren't being applied. This assert already found that we don't block btq/btsq/btrq in 32-bit mode.

llvm-svn: 320830
2017-12-15 17:22:58 +00:00
Jun Bum Lim
73c93a79ad Revert "[LICM] Allow sinking when foldable in loop"
This reverts commit r320823.

llvm-svn: 320828
2017-12-15 16:35:09 +00:00
Francis Visoiu Mistrih
7802b89265 [CodeGen] Print stack object references as %(fixed-)stack.0 in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`%stack.0` instead of `<fi#0>`, and `%fixed-stack.0` instead of
`<fi#-4>` (supposing there are 4 fixed stack objects).

Only debug syntax is affected.

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

llvm-svn: 320827
2017-12-15 16:33:45 +00:00
Eugene Leviant
cdd4b18b3c [ThinLTO] Disallow multiple prevailing defs
https://reviews.llvm.org/D41291

llvm-svn: 320825
2017-12-15 16:27:33 +00:00
Craig Topper
5e10face9a [X86] Widen (v2i32 (fp_to_uint v2f64)) to (v8i32 (fp_to_uint v8f64)) during legalization if we have AVX512F, but not VLX. NFC
Previously we widened it using isel patterns.

llvm-svn: 320824
2017-12-15 16:22:20 +00:00
Jun Bum Lim
90fc6f69f0 [LICM] Allow sinking when foldable in loop
Summary:
Continue trying to sink an instruction if its users in the loop is foldable.
This will allow the instruction to be folded in the loop by decoupling it from
the user outside of the loop.

Reviewers: hfinkel, majnemer, davidxl, efriedma, danielcdh, bmakam, mcrosier

Reviewed By: hfinkel

Subscribers: javed.absar, bmakam, mcrosier, llvm-commits

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

llvm-svn: 320823
2017-12-15 16:09:54 +00:00
Sam Parker
f4a19eea78 [ARM] Some DAG combine tests
Add some more and and shift load combine tests.

llvm-svn: 320822
2017-12-15 15:30:39 +00:00
Francis Visoiu Mistrih
bd3f69f6b1 [MIR] Add support for missing CFI directives
The following CFI directives are suported by MC but not by MIR:

* .cfi_rel_offset
* .cfi_adjust_cfa_offset
* .cfi_escape
* .cfi_remember_state
* .cfi_restore_state
* .cfi_undefined
* .cfi_register
* .cfi_window_save

Add support for printing, parsing and update tests.

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

llvm-svn: 320819
2017-12-15 15:17:18 +00:00
Simon Pilgrim
4b22f7886a [X86] Add RTM schedule tests
llvm-svn: 320815
2017-12-15 14:37:28 +00:00
Haicheng Wu
0ed2e869a0 [InlineCost] Find repeated loads in the callee
SROA analysis of InlineCost can figure out that some stores can be removed
after inlining and then the repeated loads clobbered by these stores are also
free.  This patch finds these clobbered loads and adjust the inline cost
accordingly.

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

llvm-svn: 320814
2017-12-15 14:34:41 +00:00
Simon Pilgrim
6fa2026a01 [X86] Add MWAITX/MONITORX schedule tests
llvm-svn: 320812
2017-12-15 14:22:15 +00:00
Nemanja Ivanovic
0ca59cb96b Fix the second build bot break introduced by r320791.
llvm-svn: 320811
2017-12-15 14:17:45 +00:00
Simon Pilgrim
516085b70e [X86] Add XOP schedule tests
llvm-svn: 320810
2017-12-15 14:02:35 +00:00
Nemanja Ivanovic
66ad73880d Fix code causing fallthrough warnings in the PPC back end.
llvm-svn: 320806
2017-12-15 11:47:48 +00:00
Simon Pilgrim
0079585c96 [X86] Add AVX512 VPOPCNTDQ schedule tests
Demonstrates how to perform full coverage avx512 schedule tests

llvm-svn: 320805
2017-12-15 11:32:31 +00:00
Alex Bradbury
cd50d0adde [RISCV] Change shift amount operand of RVC shift instructions to uimmlog2xlennonzero
c.slli/c.srli/c.srai allow a 5-bit shift in RV32C and a 6-bit shift in RV64C.
This patch adds uimmlog2xlennonzero to reflect this constraint as well as
tests.

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

Patch by Shiva Chen.

llvm-svn: 320799
2017-12-15 10:20:51 +00:00
Nemanja Ivanovic
de6e44ad7c Fix the build bot break introduced by r320791.
llvm-svn: 320798
2017-12-15 09:51:34 +00:00
Alex Bradbury
af453b57a3 [RISCV] Enable emission of alias instructions by default
This patch switches the default for -riscv-no-aliases to false
and updates all affected MC and CodeGen tests. As recommended in
D41071, MC tests use the canonical instructions and the CodeGen
tests use the aliases.

Additionally, for the f and d instructions with rounding mode,
the tests for the aliased versions are moved and tightened such
that they can actually detect if alias emission is enabled.
(see D40902 for context)

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

Patch by Mario Werner.

llvm-svn: 320797
2017-12-15 09:47:01 +00:00
Fedor Sergeev
9146e8f676 [PM] port Rewrite Statepoints For GC to the new pass manager.
Summary:
The port is nearly straightforward.
The only complication is related to the analyses handling,
since one of the analyses used in this module pass is domtree,
which is a function analysis. That requires asking for the results
of each function and disallows a single interface for run-on-module
pass action.

Decided to copy-paste the main body of this pass.
Most of its code is requesting analyses anyway, so not that much
of a copy-paste.

The rest of the code movement is to transform all the implementation
helper functions like stripNonValidData into non-member statics.

Extended all the related LLVM tests with new-pass-manager use.
No failures.

Reviewers: sanjoy, anna, reames

Reviewed By: anna

Subscribers: skatkov, llvm-commits

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

llvm-svn: 320796
2017-12-15 09:32:11 +00:00