1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
Commit Graph

200317 Commits

Author SHA1 Message Date
Luofan Chen
3d9095e7da [Attributor] [WIP] Track AA dependency using dependency graph
Summary: This patch added dependency graph to the attributor so that we can dump the dependencies between AAs more easily. We can also apply general graph algorithms to the graph, making it easier for us to create deep wrappers.

Reviewers: jdoerfert, sstefan1, uenoku, homerdin, baziotis

Reviewed By: jdoerfert

Subscribers: jfb, okura, mgrang, kuter, lebedev.ri, hiraditya, uenoku, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78861
2020-07-15 10:21:49 +08:00
LLVM GN Syncbot
137ffe83dc [gn build] Port 0750757e80c 2020-07-15 02:13:43 +00:00
Luofan Chen
9759b5d56c [Attributor] Unittest for Attributor
Summary: This patch introduces basic unittest interface for the Attributor and a simple test case for casting.

Reviewers: jdoerfert, sstefan1, uenoku, homerdin, baziotis

Reviewed By: jdoerfert

Subscribers: mgorny, uenoku, kuter, okura, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83754
2020-07-15 10:12:39 +08:00
Carl Ritson
6d27d1e4b3 [AMDGPU] Apply pre-emit s_cbranch_vcc optimation to more patterns
Add handling of s_andn2 and mask of 0.
This eliminates redundant instructions from uniform control flow.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D83641
2020-07-15 11:02:35 +09:00
Luofan Chen
33bfce2dc8 [Attributor] Create getter function for the ID of the abstract attribute
Summary: The `getIdAddr()` function returns the address of the ID of the abstract attribute

Reviewers: jdoerfert, sstefan1, uenoku, homerdin, baziotis

Reviewed By: jdoerfert

Subscribers: okura, hiraditya, uenoku, kuter, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83172
2020-07-15 09:55:18 +08:00
Craig Topper
a8838d73c2 [IR] Add a few asserts to provide a better failure signature if you try to create a load/store/alloca with no alignment or insertion position
If no alignment is specified we try to find the datalayout by using the insert position to get the module so we can get the datalayout. But if those are null, then we deference a null pointer.

This patch adds asserts to make the failure a little more obvious than just seg faulting.

Differential Revision: https://reviews.llvm.org/D83829
2020-07-14 18:47:44 -07:00
Richard Smith
cc9b585279 Make LazyCallThroughManager destructor virtual rather than arranging for
all clients to delete it via the correct dynamic type.
2020-07-14 18:41:07 -07:00
Valentin Clement
713d228254 [flang] Fix out-of-tree build with missing acc_gen target
This pacth fix out-of-tree build of Flang after the introduction of acc_gen.

Reviewed By: sscalpone

Differential Revision: https://reviews.llvm.org/D83835
2020-07-14 20:50:43 -04:00
Valentin Clement
fb91f4c9e0 [flang][openacc] Semantic checks for OpenACC 3.0 clauses validity
Summary: This patch adds semantic checking for the OpenACC 3.0 clauses validity.

Reviewers: sscalpone, tskeith, klausler, ichoyjx, DavidTruby, jdoerfert

Reviewed By: tskeith, klausler

Subscribers: mgorny, llvm-commits

Tags: #llvm, #flang

Differential Revision: https://reviews.llvm.org/D83807
2020-07-14 20:44:35 -04:00
Nico Weber
750e5616cb [gn build] (manually) merge c1e2f73c 2020-07-14 20:43:59 -04:00
Richard Smith
f972afbec0 Fix undefined behavior due to deleting an object with a non-virtual
destructor via a pointer of the wrong static type.

This caused crashes during deallocation in C++14 builds when using a
deallocator whose sized delete requires the size argument to be correct.

Also make the LazyCallThroughManager destructor protected to catch this
sort of bug in the future.
2020-07-14 17:17:20 -07:00
Richard Smith
89011f91be Fix test that was accidentally adding the llvm-as binary into an
IR archive.
2020-07-14 17:07:40 -07:00
Matt Arsenault
c9724bc34a AMDGPU: Add @LINE to assembler error test checks
It was basically impossible to figure out where the failure point was
2020-07-14 18:37:50 -04:00
Christopher Tetreault
a62cddadeb [SVE] Make cstfp_pred_ty and cst_pred_ty work with scalable splats
Reviewers: efriedma, lebedev.ri, fhahn, c-rhodes, david-arm

Reviewed By: efriedma, david-arm

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83001
2020-07-14 14:20:39 -07:00
Mircea Trofin
788f9832ab [llvm][NFC] expose LLVM_HAVE_TF_API through llvm-config.h
Summary:
This allows users of the llvm library discover whether llvm was built
with the tensorflow c API dependency, which helps if using the TFUtils
wrapper, for example.

We don't do the same for the LLVM_HAVE_TF_AOT flag, because that does
not expose any API.

Reviewers: mehdi_amini, davidxl

Subscribers: mgorny, aaron.ballman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83746
2020-07-14 14:09:35 -07:00
Tyker
22ce905555 Fix tests after 16f777f4217cfcdcf6ddce8eb1e3525a65563c43 2020-07-14 22:52:26 +02:00
Louis Dionne
6ac4774c26 [libc++] Automatically detect whether RTTI is enabled
Instead of detecting it automatically but also allowing for the setting
to be specified explicitly, always detect whether exceptions are enabled
based on whether -fno-rtti (or equivalent) is used. It's less confusing
to have a single way of tweaking that knob.

This change follows the lead of 71d88cebfb42.
2020-07-14 16:51:37 -04:00
Fangrui Song
5044eeb2f2 [MC] Support .reloc sym+constant, *, *
For `.reloc offset, *, *`, currently offset can be a constant or symbol.
This patch makes it support any expression which can be folded to sym+constant.

Reviewed By: stefanp

Differential Revision: https://reviews.llvm.org/D83751
2020-07-14 13:44:00 -07:00
Giorgis Georgakoudis
f60a7e942d [CallGraph] Ignore callback uses
Summary:
Ignore callback uses when adding a callback function
in the CallGraph. Callback functions are typically
created when outlining, e.g. for OpenMP, so they have
internal scope and linkage. They should not be added
to the ExternalCallingNode since they are only callable
by the specified caller function at creation time.

A CGSCC pass, such as OpenMPOpt, may need to update
the CallGraph by adding a new outlined callback function.
Without ignoring callback uses, adding breaks CGSCC
pass restrictions and results to a broken CallGraph.

Reviewers: jdoerfert

Subscribers: hiraditya, sstefan1, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83370
2020-07-14 13:08:49 -07:00
Krzysztof Pszeniczny
8fd1e853a6 Call Frame Information (CFI) Handling for Basic Block Sections
This patch handles CFI with basic block sections, which unlike DebugInfo does
not support ranges. The DWARF standard explicitly requires emitting separate
CFI Frame Descriptor Entries for each contiguous fragment of a function. Thus,
the CFI information for all callee-saved registers (possibly including the
frame pointer, if necessary) have to be emitted along with redefining the
Call Frame Address (CFA), viz. where the current frame starts.

CFI directives are emitted in FDE’s in the object file with a low_pc, high_pc
specification. So, a single FDE must point to a contiguous code region unlike
debug info which has the support for ranges. This is what complicates CFI for
basic block sections.

Now, what happens when we start placing individual basic blocks in unique
sections:

* Basic block sections allow the linker to randomly reorder basic blocks in the
address space such that a given basic block can become non-contiguous with the
original function.
* The different basic block sections can no longer share the cfi_startproc and
cfi_endproc directives. So, each basic block section should emit this
independently.
* Each (cfi_startproc, cfi_endproc) directive will result in a new FDE that
caters to that basic block section.
* Now, this basic block section needs to duplicate the information from the
entry block to compute the CFA as it is an independent entity. It cannot refer
to the FDE of the original function and hence must duplicate all the stuff that
is needed to compute the CFA on its own.
* We are working on a de-duplication patch that can share common information in
FDEs in a CIE (Common Information Entry) and we will present this as a follow up
patch. This can significantly reduce the duplication overhead and is
particularly useful when several basic block sections are created.
* The CFI directives are emitted similarly for registers that are pushed onto
the stack, like callee saved registers in the prologue. There are cfi
directives that emit how to retrieve the value of the register at that point
when the push happened. This has to be duplicated too in a basic block that is
floated as a separate section.

Differential Revision: https://reviews.llvm.org/D79978
2020-07-14 12:54:12 -07:00
Tyker
518722cd87 [NFC] Add debug and stat counters to assume queries and assume builder
Summary:
Add debug counter and stats counter to assume queries and assume builder
here is the collected stats on a build of check-llvm + check-clang.
  "assume-builder.NumAssumeBuilt": 2720879,
  "assume-builder.NumAssumesMerged": 761396,
  "assume-builder.NumAssumesRemoved": 1576212,
  "assume-builder.NumBundlesInAssumes": 6518809,
  "assume-queries.NumAssumeQueries": 85566380,
  "assume-queries.NumUsefullAssumeQueries": 2727360,
the NumUsefullAssumeQueries stat is actually pessimistic because in a few places queries
ask to keep providing information to try to get better information. and this isn't counted
as a usefull query evem tho it can be usefull

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83506
2020-07-14 21:49:14 +02:00
Jan Sjodin
1e6d1b7612 llvm-link: Add support for archive files as inputs
This patch adds support for archive files as inputs to llvm-link. One
of the use-cases is for OpenMP, where device specific libraries need
to be extracted from libraries containing bundled object files. The
clang-offload-bundler will support extracting these archives, which
will be passed into llvm-link, see https://reviews.llvm.org/D80816.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D81109
2020-07-14 15:30:59 -04:00
Teresa Johnson
6794d96976 Restore "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP"
This restores commit 80d0a137a5aba6998fadb764f1e11cb901aae233, and the
follow on fix in 873c0d0786dcf22f4af39f65df824917f70f2170, with a new
fix for test failures after a 2-stage clang bootstrap, and a more robust
fix for the Chromium build failure that an earlier version partially
fixed. See also discussion on D75201.

Reviewers: evgeny777

Subscribers: mehdi_amini, Prazek, hiraditya, steven_wu, dexonsmith, arphaman, davidxl, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D73242
2020-07-14 12:16:57 -07:00
Sjoerd Meijer
1a682582ae [Matrix] Intrinsic descriptions
This changes the matrix load/store intrinsic definitions to load/store from/to
a pointer, and not from/to a pointer to a vector, as discussed in D83477.

This also includes the recommit of "[Matrix] Tighten LangRef definitions and
Verifier checks" which adds improved language reference descriptions of the
matrix intrinsics and verifier checks.

Differential Revision: https://reviews.llvm.org/D83785
2020-07-14 19:58:16 +01:00
Valentin Clement
dfb82bf336 [flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.

Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby

Reviewed By: klausler

Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits

Tags: #llvm, #flang

Differential Revision: https://reviews.llvm.org/D83649
2020-07-14 14:29:40 -04:00
Matt Arsenault
908ef3f208 TableGen/GlobalISel: Partially fix nontrivial, custom predicates
Currently custom code predicates can only really be used for
contextless checks tied to a single instruction (e.g. check the def
for hasOneUse). If you do want to inspect the input instructions in
the source pattern, you cannot without re-verifying the opcode and
type checks implied by the patterns, since this check was emitted
before any operand constraints. Really, these are pattern level
predicates that implicitly depend on the instruction and operand
checks.

Introduce a filtering function so the custom predicate is emitted
last. I'm not sure this is the most elegant solution. It seems like
this is really a different thing from the InstructionMatcher/IPM_
predicate kinds. I initially tried keeping this in a separate
predicate list, but that also seemed awkward.

This only half fixes the problem I'm trying to solve. The AMDGPU
pattern I'm attempting to port also uses the PredicateCodeUsesOperands
feature to allow checks on the source operands when the input pattern
is commuted. Really the emitter should reject the pattern since it
doesn't handle this case, but at this point it would be more
productive to just implement this.
2020-07-14 14:26:51 -04:00
Lang Hames
55f9c4d2ce [ORC] Don't take ownership of the trampoline pool in LazyReexportsManager.
LazyReexportsManager instances use the trampoline pool, but they don't need to
own it. Keeping TrampolinePool ownership separate allows re-use of the
trampoline pool by other clients.
2020-07-14 10:56:45 -07:00
Richard Barton
3d5f62147e [lit] Prevent hang when lit sees non-ASCII characters
As per discussion in D69207, have lit ignore UnicodeDecodeErrors
when running with python 2 in an ASCII shell.

Differential Revision: https://reviews.llvm.org/D82754
2020-07-14 18:41:15 +01:00
Logan Smith
25adca40ab [NFC] Add 'override' keyword where missing in include/ and lib/.
This fixes warnings raised by Clang's new -Wsuggest-override, in preparation for enabling that warning in the LLVM build. This patch also removes the virtual keyword where redundant, but only in places where doing so improves consistency within a given file. It also removes a couple unnecessary virtual destructor declarations in derived classes where the destructor inherited from the base class is already virtual.

Differential Revision: https://reviews.llvm.org/D83709
2020-07-14 09:47:29 -07:00
Shuhong Liu
705268c433 [AIX] Remove diff -a option on llvm-cov.test
Summary:
llvm-cov.test generates .gcov files and compared with target
sample files. Since the files do not contain any binary data
(files are plain ASCII texts), remove -a from diff. And this
fix will the error on AIX since the default diff tool on AIX
does not support -a option.

Reviewers: hubert.reinterpretcast, daltenty, stevewan

Subscribers: llvm-commits

Tags: #LLVM

Differential Revision: https://reviews.llvm.org/D83711
2020-07-14 12:24:36 -04:00
Michael Kruse
186e2229e8 [docs] Update llvm.loop metadata documentation.
Loop metadata nodes do not adhere to the documented property:

(a) LoopIDs are not unique: Any pass that duplicates IR will do it
    including its metadata (e.g. LoopVersioning) such that multiple
    loops are linked with the same LoopID. There is even a test case
    (Transforms/LoopUnroll/unroll-pragmas-disabled.ll) for multiple
    loops with the same LoopID.

(b) LoopIDs are not persistent: Adding or removing an item from a LoopID
    can only be done by creating a new MDNode and assigning it to the
    loop's branch(es). Passes such as LoopUnroll (llvm.loop.unroll.disable)
    and LoopVectorize (llvm.loop.isvectorized) use this to mark loops to
    not be transformed multiple times or to avoid that a LoopVersioned
    original loop is transformed.

Update the documentation according to how llvm.loop is used in practice.

Differential Revision: https://reviews.llvm.org/D55290
2020-07-14 11:03:57 -05:00
Sanjay Patel
7363126966 [ValueTracking] fix library to intrinsic mapping to respect 'nobuiltin' attribute
This is another problem raised in:
http://bugs.llvm.org/PR46627
2020-07-14 10:04:24 -04:00
Sanjay Patel
b78cee1e03 [InstSimplify] add test with nobuiltin attribute (PR46627); NFC 2020-07-14 10:04:24 -04:00
Simon Tatham
38ef31c22c [utils] New script check_ninja_deps.py
Summary:
This can be run after a ninja-based build, and analyzes the ninja
build files and dependency database to spot any missing dependencies
in the build scripts.

I wrote it in the course of investigating D82659, and it seems likely
to be useful again.

Reviewers: thakis, chandlerc, theraven

Reviewed By: thakis

Subscribers: riccibruno, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83032
2020-07-14 14:54:08 +01:00
Jay Foad
50dc80680e [AMDGPU] Simplify AMDGPUSubtarget::getWavesPerEU. NFC. 2020-07-14 14:20:02 +01:00
Roger Ferrer Ibanez
2ec487ff11 [RISCV] Fix isStoreToStackSlot
Because of the layout of stores (that don't have a destination operand)
this check is exactly the same as the one in
RISCVInstrInfo::isLoadFromStackSlot.

Differential Revision: https://reviews.llvm.org/D81805
2020-07-14 12:36:42 +00:00
Roger Ferrer Ibanez
46d2fe7736 [NFC][RISCV] Test for D81805
New test to show the changes after D81805 is committed.

Differential Revision: https://reviews.llvm.org/D83750
2020-07-14 12:35:31 +00:00
serge-sans-paille
60b8e53e04 Revert "[SCEV][IndVarSimplify] insert point should not be block front."
This reverts commit f1efb8bb4ba0584a9b994f3404a2c62920ce6652.

Reverted because it doesn't correctly update the pass return status, see

http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-debian/builds/9441/steps/test-check-all/logs/FAIL%3A%20LLVM%3A%3Awiden-i32-i8ptr.ll
2020-07-14 14:24:26 +02:00
Georgii Rymar
3772cb06fd [yaml2obj] - Refine handling of the NoHeaders key.
Imagine we have an YAML description for some object and we want to
produce 2 outputs: with and without the section header.
A natural way to do it would look like:

```
--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_REL
  Machine: EM_X86_64
Sections:
...
SectionHeaderTable:
  NoHeaders: [[NOHEADERS]]

```
But currently, we do not distinguish between no `NoHeaders` key case
and `NoHeaders == false`. Because of this we can't simply specify
`NOHEADERS = false`, as tool starts to complain.

With this patch the behavior changed. When we have:

```
SectionHeaderTable:
  NoHeaders: false

```
it is the same as we have no `SectionHeaderTable` at all.
(`NoHeaders` key still can't be used with `Sections/Excluded` keys)

Differential revision: https://reviews.llvm.org/D83672
2020-07-14 15:09:06 +03:00
Sanjay Patel
fb296b0512 [ValueTracking] fix miscompile in maxnum case of cannotBeOrderedLessThanZeroImpl (PR46627)
A miscompile with -0.0 is shown in:
http://bugs.llvm.org/PR46627

This is because maxnum(-0.0, +0.0) does not specify a fixed result:
http://llvm.org/docs/LangRef.html#llvm-maxnum-intrinsic

So we need to tighten the constraints for when it is ok to say the
result of maxnum is positive (including +0.0).

Differential Revision: https://reviews.llvm.org/D83601
2020-07-14 08:08:09 -04:00
Sanjay Patel
f2a9875362 [InstCombine][InstSimplify] add tests for sign of maxnum; NFC
More coverage for D83601.
2020-07-14 08:08:09 -04:00
Georgii Rymar
14dff304c5 [test/Object][llvm-objdump] - llvm-objdump: don't abort() when the e_phoff field is invalid and refine testing.
llvm-objdump currently calls report_fatal_error() when the e_phoff field is invalid.

This is tested by elf-invalid-phdr.test which has the following issues:
1) It uses a precompiled object.
2) it could be a part of invalid.test.
3) It tests the Object lib, but we have no separate test for llvm-objdump.

This patch addresses issues mentioned.

Differential revision: https://reviews.llvm.org/D83559
2020-07-14 14:45:18 +03:00
Georgii Rymar
3e8c0f5b9f [llvm-readobj] - Stop using unwrapOrError() for all program_headers() calls.
program_headers() returns the list of program headers. This change allows
to continue attempt of dumping when something is wrong with program headers.

Differential revision: https://reviews.llvm.org/D83554
2020-07-14 14:16:57 +03:00
Paul Walker
0e29ab3acf [SelectionDAG] Prevent warnings when extracting fixed length vector from scalable.
ComputeNumSignBits and computeKnownBits both trigger "Scalable flag
may be dropped" warnings when a fixed length vector is extracted
from a scalable vector.  This patch assumes nothing about the
demanded elements thus matching the behaviour when extracting a
scalable vector from a scalable vector.

Differential Revision: https://reviews.llvm.org/D83642
2020-07-14 11:12:56 +00:00
Xing GUO
e826440223 [DWARFYAML] Add support for emitting value forms of strx, addrx, etc.
This patch adds support for emitting value forms of DW_FORM_strx,
DW_FORM_addrx, DW_FORM_loclistx and DW_FORM_rnglistx.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D83749
2020-07-14 19:10:15 +08:00
Georgii Rymar
90742a774c [yaml2obj] - Add a syntax to override e_phoff, e_phentsize and e_phnum fields.
This adds `EPhOff`, `EPhEntSize` and `EPhNum` keys.
Will be useful for creating broken objects for testing llvm-readelf.

Differential revision: https://reviews.llvm.org/D83482
2020-07-14 13:16:19 +03:00
Sam Elliott
b7817d916f Revert "[RISCV] Avoid Splitting MBB in RISCVExpandPseudo"
This reverts commit 97106f9d80f6ba1bf5eafbd5a6f88d72913ec5a1.

This is based on feedback from https://reviews.llvm.org/D82988#2147105
2020-07-14 11:15:01 +01:00
Sam Parker
3a3181b7a3 [NFC][ARM] Add SimplifyCFG tests 2020-07-14 11:10:11 +01:00
Victor Campos
87198b73e9 [AArch64][AsmParser] Add rcpc support in .arch_extension
AArch64 does not support enabling rcpc via .arch_extension in assembly.
GCC, on the other hand, does.

This patch adds 'rcpc' as a valid value to .arch_extension handling.

Differential Revision: https://reviews.llvm.org/D83685
2020-07-14 10:57:11 +01:00
LLVM GN Syncbot
fe0b46e2d5 [gn build] Port dd6faf13d8e 2020-07-14 09:36:07 +00:00