1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
Commit Graph

188355 Commits

Author SHA1 Message Date
Tim Renouf
40ace5d825 AMDGPU: Fixed indeterminate map iteration in SIPeepholeSDWA
Differential Revision: https://reviews.llvm.org/D70783

Change-Id: Ic26f915a4acb4c00ecefa9d09d7c24cec370ed06
2019-12-02 12:08:49 +00:00
Mark Murray
52c5090d68 [ARM][MVE][Intrinsics] Add VMINQ/VMAXQ/VMINNMQ/VMAXNMQ intrinsics.
Summary: Add VMINQ/VMAXQ/VMINNMQ/VMAXNMQ intrinsics and their predicated versions. Add unit tests.

Subscribers: kristof.beyls, hiraditya, dmgreen, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D70829
2019-12-02 11:18:53 +00:00
Alex Richardson
403861bb1a [update_cc_test_checks.py] Handle extern "C" and namespaces
Summary:
My change to use the clang AST JSON dump did not handle functions declared
inside scopes other than the root TranslationUnitDecl. After this change
update_cc_test_checks.py also works for C++ test cases that use extern "C"
and namespaces.

Reviewers: MaskRay

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70389
2019-12-02 11:06:31 +00:00
Alex Richardson
3ab7b9b96f [UpdateTestChecks] Share the code to parse RUN: lines between all scripts
Summary:
This commit also introduces a common.debug() function to avoid many
`if args.verbose:` statements. Depends on D70428.

Reviewers: xbolva00, MaskRay, jdoerfert

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70432
2019-12-02 11:06:30 +00:00
David Green
c693d7c877 [ARM] Remove VHADD patterns
These instructions do not work quite like I expected them to. They
perform the addition and then shift in a higher precision integer, so do
not match up with the patterns that we added.

For example with s8s, adding 100 and 100 should wrap leaving the shift
to work on a negative number. VHADD will instead do the arithmetic in
higher precision, giving 100 overall. The vhadd gives a "better" result,
but not one that matches up with the input.

I am just removing the patterns here. We might be able to re-add them in
the future by checking for wrap flags or changing bitwidths. But for the
moment just remove them to remove the problem cases.
2019-12-02 10:38:14 +00:00
Wang, Pengfei
bc5e31e993 [X86] Add initialization of MXCSR in llvm-exegesis
Summary: This patch is used to initialize the new added register MXCSR.

Reviewers: craig.topper, RKSimon

Subscribers: tschuett, courbet, llvm-commits, LiuChen3

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70874
2019-12-02 18:19:32 +08:00
Bjorn Pettersson
3b0861bc13 [InstCombine] Fix big-endian miscompile of (bitcast (zext/trunc (bitcast)))
Summary:
optimizeVectorResize is rewriting patterns like:
  %1 = bitcast vector %src to integer
  %2 = trunc/zext %1
  %dst = bitcast %2 to vector

Since bitcasting between integer an vector types gives
different integer values depending on endianness, we need
to take endianness into account. As it happens the old
implementation only produced the correct result for little
endian targets.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=44178

Reviewers: spatel, lattner, lebedev.ri

Reviewed By: spatel, lebedev.ri

Subscribers: lebedev.ri, hiraditya, uabelho, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70844
2019-12-02 11:05:25 +01:00
Georgii Rymar
1ce68f67b9 [llvm-readelf/llvm-readobj] - Check the version of SHT_GNU_verneed section entries.
It is a follow-up for D70826 and it is similar to D70810.

SHT_GNU_verneed contains the following fields:
`vn_version`: Version of structure. This value is currently set to 1, and will be reset
if the versioning implementation is incompatibly altered.
(https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/symversion.html)

We should check it for correctness.

Differential revision: https://reviews.llvm.org/D70842
2019-12-02 12:57:23 +03:00
Lang Hames
2134d2b597 [ORC] Add a runAsMain utility function to ExecutionUtils.
The runAsMain function takes a pointer to a function with a standard C main
signature, int(*)(int, char*[]), and invokes it using the given arguments and
program name. The arguments are copied into writable temporary storage as
required by the C and C++ specifications, so runAsMain safe to use when calling
main functions that modify their arguments in-place.

This patch also uses the new runAsMain function to replace hand-rolled versions
in lli, llvm-jitlink, and the SpeculativeJIT example.
2019-12-02 01:52:52 -08:00
Lang Hames
a7131050a1 [ExecutionEngine] Add a jitTargetAddressToFunction utility function.
jitTargetAddressToFunction takes a JITTargetAddress and returns a pointer of
the given function pointer type suitable for calling to invoke the function
at the target address.

jitTargetAddressToFunction currently behaves the same as
jitTargetAddressToPointer, but in the near future will be updated to perform
pointer signing on architectures that require it (e.g. arm64e). For this
reason it should always be preferred when generating callable pointers for
JIT'd functions.
2019-12-02 01:52:52 -08:00
Lang Hames
436a4a17bb [Orc] Add setters for target options and features to JITTargetMachineBuilder.
Also remove redundant feature initialization steps from the detectHost method.
2019-12-02 01:52:51 -08:00
Georgii Rymar
7c3b5b40df [llvm-readobj/llvm-readelf] - Reimplement dumping of the SHT_GNU_verneed section.
This is similar to D70495, but for SHT_GNU_verneed section.
It solves the same problems: different implementations, lack of error reporting
and no test coverage.

DIfferential revision: https://reviews.llvm.org/D70826
2019-12-02 12:27:31 +03:00
Anton Afanasyev
0f6025a55a [NFC] Precommit test showing SROA loses !tbaa.struct metadata
This issue impacts llvm.org/pr42022
2019-12-02 11:48:01 +03:00
Matt Arsenault
ae2f642f3a Fix broken comment phrasing and indentation 2019-12-02 12:23:20 +05:30
Austin Kerbow
0a6fa0d41a AMDGPU/GlobalISel: Add AGPR bank and RegBankSelect mfma intrinsics
Differential Revision: https://reviews.llvm.org/D70871
2019-12-01 22:15:48 -08:00
Daniil Suchkov
b3ab5c02bd [SCEV] Make SCEV verification available from command line with new PM
New pass manager doesn't use verifyAnalysis, so currently there is no
way to call SCEV verification from command line when new PM is used.
This patch adds a pass that allows you to do that.

Reviewers: reames, fhahn, sanjoy.google, nikic

Reviewed By: fhahn

Subscribers: hiraditya, javed.absar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70423
2019-12-02 13:08:20 +07:00
Florian Hahn
975db73f36 Revert "[Examples] Add IRTransformations directory to examples."
This breaks LLVMExports.cmake in some build configurations.

PR44197

This reverts commits ceb72d07b004af9c428c4a3c73a98ea97d49a713
                     7d0b1d77b3d4d47df477519fd1bf099b3df6f899.
2019-12-01 22:20:20 +00:00
Craig Topper
a8fa2d0431 [X86][InstCombine] Move non-X86 specific instcombine test from test/CodeGen/X86/ to test/Transforms/InstCombine/ 2019-12-01 10:31:04 -08:00
Craig Topper
138f90f979 [X86][InstCombine] Move instcombine test from test/CodeGen/X86 to test/Transforms/InstCombine/ and replace grep with FileCheck 2019-12-01 10:31:04 -08:00
Nuno Lopes
80ca55c2ca remove UB from test by making GV alignment explicit 2019-12-01 15:16:31 +00:00
Craig Topper
94443cba4d [X86] Add floating point execution domain to comi/ucomi/cvtss2si/cvtsd2si/cvttss2si/cvttsd2si/cvtsi2ss/cvtsi2sd instructions. 2019-11-30 11:26:28 -08:00
David Green
96f38f701a [InstCombine] Expand usub_sat patterns to handle constants
The constants come through as add %x, -C, not a sub as would be
expected. They need some extra matchers to canonicalise them towards
usub_sat.

Differential Revision: https://reviews.llvm.org/D69514
2019-11-30 16:58:01 +00:00
David Green
1124b16706 [InstCombine] Adjust usub_sat fold one use checks
This adjusts the one use checks in the the usub_sat fold code to not
increase instruction count, but otherwise do the fold. Reviewed as a
part of D69514.
2019-11-30 16:58:00 +00:00
David Green
89aabb1f79 [InstCombine] More usub_sat tests. NFC. 2019-11-30 16:58:00 +00:00
Hans Wennborg
d1a0d3a9b4 Revert 651f07908a1 "[AArch64] Don't combine callee-save and local stack adjustment when optimizing for size"
This caused asserts (and perhaps also miscompiles) while building for Windows
on AArch64. See the discussion on D68530 for details and reproducer.

Reverting until this can be investigated and fixed.

> For arm64, D18619 introduced the ability to combine bumping the stack pointer
> upfront in case it needs to be bumped for both the callee-save area as well as
> the local stack area.
>
> That diff already remarks that "This change can cause an increase in
> instructions", but argues that even when that happens, it should be still be a
> performance benefit because the number of micro-ops is reduced.
>
> We have observed that this code-size increase can be significant in practice.
> This diff disables combining stack bumping for methods that are marked as
> optimize-for-size.
>
> Example of a prologue with the behavior before this diff (combining stack bumping when possible):
>   sub        sp, sp, #0x40
>   stp        d9, d8, [sp, #0x10]
>   stp        x20, x19, [sp, #0x20]
>   stp        x29, x30, [sp, #0x30]
>   add        x29, sp, #0x30
>   [... compute x8 somehow ...]
>   stp        x0, x8, [sp]
>
> And after this  diff, if the method is marked as optimize-for-size:
>   stp        d9, d8, [sp, #-0x30]!
>   stp        x20, x19, [sp, #0x10]
>   stp        x29, x30, [sp, #0x20]
>   add        x29, sp, #0x20
>   [... compute x8 somehow ...]
>   stp        x0, x8, [sp, #-0x10]!
>
> Note that without combining the stack bump there are two auto-decrements,
> nicely folded into the stp instructions, whereas otherwise there is a single
> sub sp, ... instruction, but not folded.
>
> Patch by Nikolai Tillmann!
>
> Differential Revision: https://reviews.llvm.org/D68530
2019-11-30 14:20:11 +01:00
Dmitri Gribenko
edae6ad635 Updated the OCaml/bitwriter.ml test for OCaml 4.06+
Since OCaml 4.02 (released in 2014), strings and bytes are different
types, but up until OCaml 4.06, the compiler defaulted to a
compatibility mode "unsafe-string". OCaml 4.06 flips the default to
"safe-string", breaking the test.

This change should be compatible with OCaml 4.02+, but is only truly
necessary for OCaml 4.06+.

For more information, see:

https://caml.inria.fr/pub/docs/manual-ocaml/libref/String.html
https://ocaml.org/releases/4.02.html
2019-11-30 13:35:23 +01:00
Hans Wennborg
0c2616b1a5 Fix a typo. 2019-11-30 13:23:49 +01:00
Sean Fertile
5409609083 [PowerPC][AIX] Add support for lowering int/float/double formal arguments.
This patch adds LowerFormalArguments_AIX, support is added for lowering
int, float, and double formal arguments into general purpose and
floating point registers only.

The aix calling convention testcase have been redone to test for caller
and callee functionality in the same lit test.

Patch by Zarko Todorovski!

Differential Revision: https://reviews.llvm.org/D69578
2019-11-29 12:46:53 -05:00
Carey Williams
0f73b0ec78 Revert "[ARM] Allocatable Global Register Variables for ARM"
This reverts commit 2d739f98d8a53e38bf9faa88cdb6b0c2a363fb77.
2019-11-29 17:01:05 +00:00
Carey Williams
85671c3fae Revert "[NFC] Fix test reserve_global_reg.ll after 2d739f9"
This reverts commit aea7578fade2563cb5ea60548914667b515c457a.
2019-11-29 17:00:55 +00:00
Bjorn Pettersson
5f68488e9b [InstCombine] Run the cast.ll test a twice, now also testing little endian. NFC
Some tests in test/Transforms/InstCombine/cast.ll depend on
endianness. Added a second run line to run the tests with both
big and little endian. In the past we only compiled for big
endian, and then it was hard to see if any big endian bugfixes
would impact the little endian result etc.
2019-11-29 13:24:13 +01:00
Victor Campos
ed84de5a0e [ARM] Fix instruction selection for ARMISD::CMOV with f16 type
Summary:
In the cases where the CMOV (f16) SDNode is used with condition codes
LT, LE, VC or NE, it is successfully selected into a VSEL instruction.

In the remaining cases, however, instruction selection fails since VSEL
does not support other condition codes.

This patch handles such cases by using the single-precision version of
the VMOV instruction.

Reviewers: ostannard, dmgreen

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70667
2019-11-29 10:40:37 +00:00
Georgii Rymar
be65c77bc5 [llvm-readelf][test] - Update comment in elf-verdef-invalid.test. NFC.
It was suggested to change it during review of D70810,
but I've forgotten to update it before commit.
2019-11-29 11:38:27 +03:00
Georgii Rymar
ca244599d2 [llvm-readelf/llvm-readobj] - Check version of SHT_GNU_verdef section entries when dumping.
Elfxx_Verdef contains the following field:

vd_version
Version revision. This field shall be set to 1.
(https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/symversion.html)

Our code should check the struct version for correctness. This patch does that.
(This will help to simplify or eliminate ELFDumper<ELFT>::LoadVersionDefs() which
has it's own logic to parse version definitions for no reason. It checks the
struct version currently).

Differential revision: https://reviews.llvm.org/D70810
2019-11-29 11:09:56 +03:00
Georgii Rymar
de6e418176 [yaml2obj] - Add a way to describe content of the SHT_GNU_verneed section with "Content".
There is no way to set raw content for SHT_GNU_verneed section.
This patch implements it.

Differential revision: https://reviews.llvm.org/D70816
2019-11-29 10:50:00 +03:00
Hideto Ueno
76778c133a [Attributor] Deduce dereferenceable based on accessed bytes map
Summary:
This patch introduces the deduction based on load/store instructions whose pointer operand is a non-inbounds GEP instruction.
For example if we have,
```
void f(int *u){
 u[0] = 0;
 u[1] = 1;
 u[2] = 2;
}
```
then u must be dereferenceable(12).

This patch is inspired by D64258

Reviewers: jdoerfert, spatel, hfinkel, RKSimon, sstefan1, xbolva00, dtemirbulatov

Reviewed By: jdoerfert

Subscribers: jfb, lebedev.ri, xbolva00, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70714
2019-11-29 06:55:58 +00:00
Hideto Ueno
2192bca4d8 [Attributor] Remove dereferenceable_or_null when nonull is present
Summary: This patch prevents the simultaneous presence of `dereferenceable` and `dereferenceable_or_null` attribute

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70789
2019-11-29 06:45:07 +00:00
Fangrui Song
5c162bc608 [PassInstrumentation] Remove excess newline for the new pass manager
This also removes excess newline for the legacy pass manager when -filter-print-funcs is specified.
2019-11-28 17:20:17 -08:00
Nico Weber
0809ea774a gn build: Add a toggle for building against the commandline tools SDK on macOS 2019-11-28 19:30:34 -05:00
Craig Topper
0ff9ac548e [LegalizeTypes] Add strict FP support to SoftenFloatRes_FP_ROUND. Fix mistake in SoftenFloatRes_FP_EXTEND.
These will be needed for ARM fp-instrinsics.ll which is currently
XFAILed.

One of the getOperand calls in SoftenFloatRes_FP_EXTEND was not
taking strict FP into account. It only affected the call
to setTypeListBeforeSoften which only has an effect on some targets.
2019-11-28 15:32:09 -08:00
Craig Topper
ca54ba8b3d [LegalizeTypes] In SoftenFloatRes_FNEG, always generate integer arithmetic, never fall back to using fsub.
We would previously fallback if the type wasn't f32/f64/f128. But
I don't think any of the other floating point types ever go through
the softening code anyway. So this code is dead.
2019-11-28 15:30:34 -08:00
Craig Topper
e4ff7d71d1 [LegalizeTypes] Use SoftenFloatRes_Unary in SoftenFloatRes_FCBRT to reduce code.
We don't have a STRICT_CBRT ISD opcode, but we can still
use SoftenFloatRes_Unary to simplify some code.
2019-11-28 15:30:34 -08:00
Amaury Séchet
34d8014eff [DAGCombiner] Peek through vector concats when trying to combine shuffles.
Summary: This combine showed up as needed when exploring the regression when processing the DAG in topological order.

Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68195
2019-11-28 23:57:29 +01:00
Fangrui Song
74bf63b903 [LegacyPassManager] Simplify FunctionPass::assignPassManager
And make it clear the parameter PreferredType is unused for FunctionPass.
2019-11-28 14:06:55 -08:00
Fangrui Song
ecb21ccee0 [LegacyPassManager] Simplify PMStack pop 2019-11-28 13:48:26 -08:00
Lang Hames
ded5c52882 [ORC][JITLink] Add support for weak references, and improve handling of static
libraries.

This patch substantially updates ORCv2's lookup API in order to support weak
references, and to better support static archives. Key changes:

-- Each symbol being looked for is now associated with a SymbolLookupFlags
   value. If the associated value is SymbolLookupFlags::RequiredSymbol then
   the symbol must be defined in one of the JITDylibs being searched (or be
   able to be generated in one of these JITDylibs via an attached definition
   generator) or the lookup will fail with an error. If the associated value is
   SymbolLookupFlags::WeaklyReferencedSymbol then the symbol is permitted to be
   undefined, in which case it will simply not appear in the resulting
   SymbolMap if the rest of the lookup succeeds.

   Since lookup now requires these flags for each symbol, the lookup method now
   takes an instance of a new SymbolLookupSet type rather than a SymbolNameSet.
   SymbolLookupSet is a vector-backed set of (name, flags) pairs. Clients are
   responsible for ensuring that the set property (i.e. unique elements) holds,
   though this is usually simple and SymbolLookupSet provides convenience
   methods to support this.

-- Lookups now have an associated LookupKind value, which is either
   LookupKind::Static or LookupKind::DLSym. Definition generators can inspect
   the lookup kind when determining whether or not to generate new definitions.
   The StaticLibraryDefinitionGenerator is updated to only pull in new objects
   from the archive if the lookup kind is Static. This allows lookup to be
   re-used to emulate dlsym for JIT'd symbols without pulling in new objects
   from archives (which would not happen in a normal dlsym call).

-- JITLink is updated to allow externals to be assigned weak linkage, and
   weak externals now use the SymbolLookupFlags::WeaklyReferencedSymbol value
   for lookups. Unresolved weak references will be assigned the default value of
   zero.

Since this patch was modifying the lookup API anyway, it alo replaces all of the
"MatchNonExported" boolean arguments with a "JITDylibLookupFlags" enum for
readability. If a JITDylib's associated value is
JITDylibLookupFlags::MatchExportedSymbolsOnly then the lookup will only
match against exported (non-hidden) symbols in that JITDylib. If a JITDylib's
associated value is JITDylibLookupFlags::MatchAllSymbols then the lookup will
match against any symbol defined in the JITDylib.
2019-11-28 13:30:49 -08:00
Florian Hahn
ed39c36dcf [IVDescriptors] Skip FOR where we have multiple sink points for now.
This fixes a crash with instructions where multiple operands are
first-order-recurrences.
2019-11-28 22:18:47 +01:00
Austin Kerbow
2457c35fc1 AMDGPU: Reuse carry out register during FI elimination
Summary:
Pre gfx9 we need to scavenge a 64-bit SGPR to use as the carry out for an Add.
If only one SGPR was available this crashed when trying to scavenge another
32bit SGPR to materialize the offset.

Instead, reuse a 32-bit SGPR from the carry out as the offset register.

Also prefer to use vcc for the unused carry out when it is available.

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70614
2019-11-28 10:13:48 -08:00
Simon Tatham
253a2a5ce1 [AArch64][v8.3a] Don't emit LDRA '[xN]!' alias in disassembly.
Summary:
In rG643ac6c0420b, the syntax `ldraa x1, [x0]!` was added as an alias
for `ldraa x1, [x0, #0]!`. That syntax is less obvious in meaning, and
also will not be accepted by assemblers that haven't been updated yet.
So it would be better not to emit it as the preferred disassembly for
that instruction.

This change lowers the EmitPriority of the new alias so that the more
explicit syntax `[x0, #0]!` is preferred by the disassembler. The new
syntax is still accepted by the assembler.

Reviewers: ab, ostannard

Reviewed By: ostannard

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70813
2019-11-28 15:31:59 +00:00
David Stuttard
2aeb434e30 AMDGPU: Fix lit test checks with dag option
Summary:
I was seeing some failures on a test with slightly different instruction
ordering. Adding in some DAG directives solved the issue.

Change-Id: If5a3d3969055fb19279943bd45161bb70a3dabce

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70531
2019-11-28 10:01:06 +00:00