Commit Graph

360204 Commits

Author SHA1 Message Date
LLVM GN Syncbot 44899ed659 [gn build] Port 83080a294a 2020-07-13 17:19:05 +00:00
Lang Hames fb7ef0bb0b [ORC] Generalize emit re-entry, stub, etc. APIs for working addr != link addr.
This patch generalizes the APIs for writing re-entry blocks, trampolines and
stubs to allow their final linked address to differ from the address of
their initial working memory. This will allow these routines to be used with
JITLinkMemoryManagers, which will in turn allow for unification of code paths
for in-process and cross-process lazy JITing.
2020-07-13 10:15:10 -07:00
Lang Hames a1fc26030a [JITLink] Add a synchronous version of finalize for convenience.
This will be used by upcoming patches that implement indirection utils
(reentry, reentry trampolines, and stubs) on top of
JITLinkMemoryManager to unify in-process and cross-process lazy
compilation support.
2020-07-13 10:15:10 -07:00
Mircea Trofin 83080a294a [llvm] Native size estimator for training -Oz inliner
Summary:
This is an experimental ML-based native size estimator, necessary for
computing partial rewards during -Oz inliner policy training. Data
extraction for model training will be provided in a separate patch.

RFC: http://lists.llvm.org/pipermail/llvm-dev/2020-April/140763.html

Reviewers: davidxl, jdoerfert

Subscribers: mgorny, hiraditya, mgrang, arphaman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82817
2020-07-13 10:13:56 -07:00
Hiroshi Yamauchi 153a0b8906 [PGO][PGSO] Add profile guided size optimization to the X86 LEA fixup.
Differential Revision: https://reviews.llvm.org/D83330
2020-07-13 09:46:22 -07:00
Sanjay Patel 8779b11410 [DAGCombiner] rot i16 X, 8 --> bswap X
We have this generic transform in IR (instcombine),
but as shown in PR41098:
http://bugs.llvm.org/PR41098
...the pattern may emerge in codegen too.

x86 has a potential refinement/reversal opportunity here,
but that should come later or needs a target hook to
avoid the transform. Converting to bswap is the more
specific form, so we should use it if it is available.
2020-07-13 12:01:53 -04:00
Sanjay Patel 69fff1fc49 [x86] add tests for bswap/rotate; NFC 2020-07-13 12:01:53 -04:00
Pavel Iliin 8f7d3430b7 [ARM][NFC] More detailed vbsl checks in ARM & Thumb2 tests. 2020-07-13 17:00:43 +01:00
stevewan a7e9c5a39f [llvm-ar][test][AIX] Unsupport error-opening-directory.test on AIX
Summary:
The test fails on AIX as it allows open() and read() on a directory. This patch adds `# UNSUPPORTED:
system-aix` to the test to prevent it from running on AIX.

Reviewers: sameerarora101, daltenty, ShuhongL, hubert.reinterpretcast, MaskRay, smeenai, alexshap

Reviewed By: sameerarora101, hubert.reinterpretcast, MaskRay, smeenai

Subscribers: MaskRay, rupprecht, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83579
2020-07-13 12:00:07 -04:00
Pavel Labath a2552f76ac [ADT] Make Load(AP)IntFromMemory pointer argument const
The function does not modify this memory.
2020-07-13 17:32:54 +02:00
Sanne Wouda 4d3e8dc215 Fix llvm-test-suite failure introduced by D82550/D83122
Apparently, isIndirectCall does not imply that getCalledFunction will be non-null
2020-07-13 16:14:22 +01:00
David Truby 4121172239 [flang][openmp] libc++ unordered_map build fix in flang openmp static analysis
Simply move the include of unordered_map from the .cpp file to the .h file
2020-07-13 16:08:24 +01:00
Alexey Bataev 7075c056e9 [OPENMP]Fix compiler crash for target data directive without actual target codegen.
Summary:
Need to privatize addresses of the captured variables when trying to
emit the body of the target data directive in no target codegen mode.

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, cfe-commits, sstefan1, caomhin

Tags: #clang

Differential Revision: https://reviews.llvm.org/D83478
2020-07-13 10:52:24 -04:00
Eric Astor 3aabfa2808 [ms] [llvm-ml] Restore omitted changes requested by reviewer 2020-07-13 10:49:19 -04:00
Pavel Labath 1847f4dd75 [lldb/Utility] Rewrite Scalar::SetValueFromCString
The function's reliance on host types meant that it was needlessly
complicated, and did not handle the newer (wider) types. Rewrite it in
terms of APInt/APFloat functions to save code and improve functionality.
2020-07-13 16:44:42 +02:00
Eric Astor f08e8b6d7c [ms] [llvm-ml] Add support for MASM STRUCT casting field accessors: (<TYPE> PTR <value>).<field>
Summary:
Add support for MASM STRUCT casting field accessors: (<TYPE> PTR <value>).<field>

Since these are operands, we add them to X86AsmParser. If/when we extend MASM support to other architectures (e.g., ARM), we will need similar changes there as well.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D83346
2020-07-13 10:40:47 -04:00
Jinsong Ji 835c1f9f40 [compiler-rt][CMake] Pass down LLVM_LIT_ARGS in runtime build
We should also pass down the LLVM_LIT_ARGS in runtime build mode,
so that the runtime tests can be well controlled as well.

We actually passed this down in clang/runtime/CMakeLists.txt
But not for calls from llvm/runtime/CMakeLists.txt.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D83565
2020-07-13 14:38:06 +00:00
Eric Astor 7f85e98082 [ms] [llvm-ml] Fix MASM support for nested unnamed STRUCTs and UNIONs
Summary: Fix MASM support for nested unnamed STRUCTs and UNIONs

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D83345
2020-07-13 10:36:56 -04:00
Eric Astor 4cdea5faf9 [ms] [llvm-ml] Improve MASM STRUCT field accessor support
Summary:
Adds support for several accessors:
- `[<identifier>.<struct name>].<field>`
- `[<identifier>.<struct name>.<field>].<subfield>` (where `field` has already-defined STRUCT type)
- `[<variable>.<field>].<subfield>` (where `field` has already-defined STRUCT type)

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D83344
2020-07-13 10:34:30 -04:00
Pavel Labath a5803765d8 [lldb/dotest] Remove the "xunit" result formatter
Summary:
My understanding is that this was added to make dotest interact well
with the GreenDragon bots, back when dotest was the main test driver.
Now that everything goes through lit (which has its own xunit
formatter), it seems largely irrelevant.

There are more cleanups that can be done after removing this be done
here, but this should be enough to test the waters.

Reviewers: JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D83545
2020-07-13 16:33:38 +02:00
Sanne Wouda 13fec93a77 [NFC] rename to reflect F is not necessarily an Intrinsic 2020-07-13 15:28:46 +01:00
Sanne Wouda 7b84045565 [SLPVectorizer] handle vectorizeable library functions
Teaches the SLPVectorizer to use vectorized library functions for
non-intrinsic calls.

This already worked for intrinsics that have vectorized library
functions, thanks to D75878, but schedules with library functions with a
vector variant were being rejected early.

-   assume that there are no load/store dependencies between lib
    functions with a vector variant; this would otherwise prevent the
    bundle from becoming "ready"

-   check during legalization that the vector variant can be used

-   fix-up where we previously assumed that a call would be an intrinsic

Differential Revision: https://reviews.llvm.org/D82550
2020-07-13 15:28:46 +01:00
Sanne Wouda e909f6bc48 Pre-commit tests
Prepare to land D82550
2020-07-13 15:28:46 +01:00
Sanne Wouda 2e58004fe1 Fix crash when getVFABIMappings is called with an indirect call instruction
Differential Revision: https://reviews.llvm.org/D83122
2020-07-13 15:28:46 +01:00
Georgii Rymar 725412f1f5 [yaml2obj] - Refactor header-sh-fields.yaml test.
This refines the test to use macros. It is needed for
a follow-up change that adds a functionality to
override more fields.

Also, it is just cleaner to test each key separately.

Differential revision: https://reviews.llvm.org/D83481
2020-07-13 16:12:22 +03:00
Raphael Isemann f3b3689c04 [lldb][NFC] Refactor instruction dumping out of DumpDataExtractor 2020-07-13 15:03:40 +02:00
Kirill Bobyrev d7d1af3916
[clangd] Fix DocumentSymbol ranges
Summary:
DocumentSymbol ranges were not previously tested and, as a result, had invalid
end location. This patch addresses the issue.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D83668
2020-07-13 15:02:53 +02:00
Sanjay Patel 2df46a5743 [DAGCombiner] allow load/store merging if pairs can be rotated into place
This carves out an exception for a pair of consecutive loads that are
reversed from the consecutive order of a pair of stores. All of the
existing profitability/legality checks for the memops remain between
the 2 altered hunks of code.

This should give us the same x86 base-case asm that gcc gets in
PR41098 and PR44895:
http://bugs.llvm.org/PR41098
http://bugs.llvm.org/PR44895

I think we are missing a potential subsequent conversion to use "movbe"
if the target supports that. That might be similar to what AArch64
would use to get "rev16".

Differential Revision: https://reviews.llvm.org/D83567
2020-07-13 08:57:00 -04:00
Sanjay Patel f1bbf3acb4 Revert "[DAGCombiner] allow load/store merging if pairs can be rotated into place"
This reverts commit 591a3af5c7.
The commit message was cut off and failed to include the review citation.
2020-07-13 08:55:29 -04:00
Sanjay Patel 591a3af5c7 [DAGCombiner] allow load/store merging if pairs can be rotated into place
This carves out an exception for a pair of consecutive loads that are
reversed from the consecutive order of a pair of stores. All of the
existing profitability/legality checks for the memops remain between
the 2 altered hunks of code.

This should give us the same x86 base-case asm that gcc gets in
PR41098 and PR44895:i
http://bugs.llvm.org/PR41098
http://bugs.llvm.org/PR44895

I think we are missing a potential subsequent conversion to use "movbe"
if the target supports that. That might be similar to what AArch64
would use to get "rev16".

Differential Revision:
2020-07-13 08:53:06 -04:00
Sjoerd Meijer 595270ae39 [ARM][MVE] Refactor option -disable-mve-tail-predication
This refactors option -disable-mve-tail-predication to take different arguments
so that we have 1 option to control tail-predication rather than several
different ones.

This is also a prep step for D82953, in which we want to reject reductions
unless that is requested with this option.

Differential Revision: https://reviews.llvm.org/D83133
2020-07-13 13:40:33 +01:00
Balazs Benics d96a47c616 [analyzer] ctu-on-demand-parsing tests: replace linux -> system-linux
Differential Revision: https://reviews.llvm.org/D83555
2020-07-13 14:29:47 +02:00
Georgii Rymar fbb6c9df28 [LLD][ELF] - Fix the test after llvm-readelf output change.
An issue for llvm-readelf was fixed in
https://reviews.llvm.org/rG84a170178c4431b7536c83ff0e5ce80774d08df6

Now it produce no output for this test.
2020-07-13 15:18:30 +03:00
Hans Wennborg e73d0b5719 [COFF] Error on unexpected .pdata size
Previously, lld would crash if the .pdata size was not an even multiple
of the expected .pdata entry size. This makes it error gracefully instead.

(We hit this in Chromium due to an assembler problem: https://crbug.com/1101577)

Differential revision: https://reviews.llvm.org/D83479
2020-07-13 13:38:39 +02:00
Mirko Brkusanin 38998cfa9c [AMDGPU][GlobalISel] Fix subregister index for EXEC register in selectBallot.
Temporarily remove subregister for EXEC in selectBallot added in
https://reviews.llvm.org/D83214 to fix failures on expensive checks buildbot.
2020-07-13 13:35:34 +02:00
Georgii Rymar 84a170178c [llvm-readobj] - Add a generic test for --dyn-relocations and fix an issue.
We have an issue currently: --dyn-relocations always prints the following
relocation header when dumping `DynPLTRelRegion`:

"Offset  Info  Type Symbol's Value  Symbol's Name + Addend"

I.e. even for an empty object, --dyn-relocations still prints this.
It is a easy to fix bug, but we have no dedicated test case for this option.
(we have a dynamic-reloc-no-section-headers.test, which has a slightly different purpose).

This patch adds a test and fixes the behavior.

Differential revision: https://reviews.llvm.org/D83387
2020-07-13 14:22:03 +03:00
Raphael Isemann aa933d82f8 [lldb][NFC] Early-exit in DWARFASTParserClang::ParseSingleMember
This patch just early-exits after the 'if (num_attributes > 0)' check.
2020-07-13 13:21:12 +02:00
Paul Walker 319a97b5e2 [SVE] Ensure fixed length vector fptrunc operations bigger than NEON are not considered legal.
Differential Revision: https://reviews.llvm.org/D83568
2020-07-13 11:16:30 +00:00
Raphael Isemann 60cbbb306d [lldb][NFC] Remove misleading class_language variable in DWARFASTParserClang
There is a local 'class_language' veriable in DWARFASTParserClang which is named
as if it is related to the 'class_language' member of ParsedDWARFTypeAttributes.
However, it actually only has two possible enum values: 'ObjC' (which means the
current record is a Objective-C class) or 'Unknown' (which covers all other
cases).

This is confusing for the reader and also lead to some strange code where we
have several comparisons against the value "ObjC_plus_plus" (which is always
false).

This replaces the variable with either a const bool variable (if there are
multiple checks for that condition in a function) or a direct call to the
TypeSystemClang utility method for checking if it's a Objective-C
Object/Interface type.
2020-07-13 13:10:12 +02:00
Andre Vieira c051312eb2 [libc][benchmark] Add display option to render.py3
Differential Revision: https://reviews.llvm.org/D83380
2020-07-13 12:09:14 +01:00
Ben Dunbobbin 6bda276f93 [LLD][ELF][Windows] small improvement to D82567
Bail early if there is no existing output file to be overwritten.

Differential Revision: https://reviews.llvm.org/D83272
2020-07-13 12:02:20 +01:00
Georgii Rymar af16a45683 [LLD][ELF] - Allow relocation sections to appear before their target sections.
It allows handling cases when we have SHT_REL[A] sections before target
sections in objects.

This fixes https://bugs.llvm.org/show_bug.cgi?id=46632

which says: "Normally it is not what compilers would emit. We have to support it,
because some custom tools might want to use this feature, which is not restricted by ELF gABI"

Differential revision: https://reviews.llvm.org/D83469
2020-07-13 13:59:54 +03:00
Anastasia Stulova 6050c156ab [OpenCL] Defer addr space deduction for dependent type.
This patch removes deduction of address spaces in parsing
for types that depend on template parameter even if an
address space is already known. Deducing it early interferes
with template instantiation/specialization logic that uses
source address space where address space is not present.

Address space deduction for templates is therefore fully
moved to the template instantiation/specialization phase.

Patch by Ole Strohm (olestrohm)!

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82781
2020-07-13 11:44:38 +01:00
Benjamin Kramer 3bffe6022c [mlir][VectorOps] Lower vector.fma to llvm.fmuladd instead of llvm.fma
Summary:
These are semantically equivalent, but fmuladd allows decaying the op
into fmul+fadd if there is no fma instruction available. llvm.fma lowers
to scalar calls to libm fmaf, which is a lot slower.

Reviewers: nicolasvasilache, aartbik, ftynse

Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes

Tags: #mlir

Differential Revision: https://reviews.llvm.org/D83666
2020-07-13 12:26:03 +02:00
Mirko Brkusanin ce23e54162 [AMDGPU][GlobalISel] Select llvm.amdgcn.ballot
Select ballot intrinsic for GlobalISel.

Differential Revision: https://reviews.llvm.org/D83214
2020-07-13 12:14:43 +02:00
Haojian Wu 1d3d9c7b58 [clang] Include type specifiers in typo correction when checking isCXXDeclarationSpecifiers.
- add more tests (the test added in 2f448467e4 is weak);
- improve the `MyTemplate<type_typo, int>();` case, with this patch, typo correction
  suggests the type decl, and no regressions found.

Differential Revision: https://reviews.llvm.org/D83025
2020-07-13 12:05:09 +02:00
Kerry McLaughlin afcc9a81d2 [SVE][Codegen] Add a helper function for pointer increment logic
Summary:
Helper used when splitting load & store operations to calculate
the pointer + offset for the high half of the split

Reviewers: efriedma, sdesmalen, david-arm

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83577
2020-07-13 10:53:40 +01:00
Haojian Wu 6ac9e589f8 [clang][RecoveryExpr] Clarify the dependence-bits documentation.
The expr dependent-bits described that the expression somehow
depends on a template paramter.

With RecoveryExpr, we have generalized it to "the expression depends on
a template parameter, or an error".  This patch updates/cleanups all related
comments of dependence-bits.

Differential Revision: https://reviews.llvm.org/D83213
2020-07-13 11:32:32 +02:00
Haojian Wu 26cf6c1513 [clangd] Add metrics for recovery-expr type propagation.
Differential Revision: https://reviews.llvm.org/D83657
2020-07-13 11:26:45 +02:00
Ella Ma e124062bf3 Fix bad doxygen result for class clang::ento::CallEvent and its derived classes
Summary: Fix bug https://bugs.llvm.org/show_bug.cgi?id=44753. This
patch is a workaround of a Doxygen bug, so that it can correctly
generate documents for class clang::ento::CallEvent and its derived
classes.

Differential Revision: https://reviews.llvm.org/D82356
2020-07-13 12:25:26 +03:00