Walter Erquinigo [Thu, 26 Mar 2020 22:33:12 +0000 (15:33 -0700)]
[lldb-vscode] fix breakpoint result ordering
Summary:
The DAP specifies the following for the SetBreakpoints request:
The breakpoints returned are in the same order as the elements of the 'breakpoints' arguments
This was not followed, as lldb-vscode was returning the breakpoints in a different order, because they were first stored into a map, and then traversed. Of course, maps normally don't preserve ordering.
See this log I captured:
-->
{"command":"setBreakpoints",
"arguments":{
"source":{
"name":"main.cpp",
"path":"/Users/wallace/fbsource/xplat/sand/test-projects/buck-cpp/main.cpp"
},
"lines":[6,10,11],
"breakpoints":[{"line":6},{"line":10},{"line":11}],
"sourceModified":false
},
"type":"request",
"seq":3
}
<--
{"body":{
"breakpoints":[
{"id":1, "line":11,"source":{"name":"main.cpp","path":"xplat/sand/test-projects/buck-cpp/main.cpp"},"verified":true},
{"id":2,"line":6,"source":{"name":"main.cpp","path":"xplat/sand/test-projects/buck-cpp/main.cpp"},"verified":true},
{"id":3,"line":10,"source":{"name":"main.cpp","path":"xplat/sand/test-projects/buck-cpp/main.cpp"},"verified":true}]},
"command":"setBreakpoints",
"request_seq":3,
"seq":0,
"success":true,
"type":"response"
}
As you can see, the order was not respected. This was causing the IDE not to be able to disable/enable breakpoints by clicking on them in the breakpoint view in the lower corner of the Debug tab.
This diff fixes the ordering problem. The traversal + querying was done very fast in O(nlogn) time. I'm keeping the same complexity.
I also updated a couple of tests to account for the ordering.
Reviewers: clayborg, aadsm, kusmour, labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D76891
Louis Dionne [Fri, 27 Mar 2020 15:33:00 +0000 (11:33 -0400)]
[libc++] Use braces around %file_dependencies substitution
This one was left out from a previous commit.
Sam Parker [Fri, 27 Mar 2020 13:58:50 +0000 (13:58 +0000)]
[ARM][LowOverheadLoops] DoubleWidthResult instructions canGenerateZeros
Given that some instructions generate wider result elements than
their inputs, flag them as being able to generate non zeros in the
false lanes.
Differential Revision: https://reviews.llvm.org/D76766
Alexey Bataev [Fri, 27 Mar 2020 15:16:44 +0000 (11:16 -0400)]
Revert "[OPENMP50]Add basic support for inscan reduction modifier."
This reverts commit
36ed0ceec7d3b0bff9de462d4f4f544d4b5285e4 to fix a
crash in scan_messages.cpp test.
Alexandre Ganea [Fri, 27 Mar 2020 15:22:51 +0000 (11:22 -0400)]
Louis Dionne [Fri, 27 Mar 2020 13:50:31 +0000 (09:50 -0400)]
[libc++] NFC: Simplify substitutions by using lit recursive substitutions
Since lit supports expanding substitutions recursively, we can define
substitutions in terms of other substitutions. This allows us to simplify
how libc++ substitutions are defined.
This doesn't change the substitutions at all, it only makes them simpler
to define.
Simon Pilgrim [Fri, 27 Mar 2020 14:41:29 +0000 (14:41 +0000)]
[InstCombine][X86] Add repeated ops demanded elts tests for SSE intrinsics (PR24523)
Simon Pilgrim [Fri, 27 Mar 2020 14:29:43 +0000 (14:29 +0000)]
[InstCombine][X86] Regenerate SSE2 tests
Alexey Bataev [Thu, 26 Mar 2020 19:58:02 +0000 (15:58 -0400)]
[OPENMP50]Add basic support for inscan reduction modifier.
Added basic support (parsing/sema checks) for the inscan modifier in the
reduction clauses.
Louis Dionne [Fri, 27 Mar 2020 14:04:13 +0000 (10:04 -0400)]
[libc++/libc++abi] Properly delimit lit substitutions
lit is not very clever when it performs substitution on RUN lines. It
simply looks for a match anywhere in the line (without tokenization)
and replaces it by the expansion. This means that a RUN line containing
e.g. `-verify-ignore-unexpected=note` wouod be expanded to
`-verify-ignore-unexpected=<substitution for not>e`, which is
surprising and nonsensical.
It also means that something like `%compile_module` could be expanded
to `<substitution-for-%compile>_module` or to the correct substitution,
depending on the order in which substitutions are evaluated by lit.
To avoid such problems, it is a good habit to delimit custom substitutions
with some token. This commit does that for all substitutions used in the
libc++ and libc++abi test suites.
Yannic Bonenberger [Fri, 27 Mar 2020 14:24:10 +0000 (10:24 -0400)]
Simplify implementation of Type::isXXXType(); NFC
Alexandre Ganea [Fri, 27 Mar 2020 14:20:39 +0000 (10:20 -0400)]
[ThinLTO] Allow usage of all hardware threads in the system
Before this patch, it wasn't possible to extend the ThinLTO threads to all SMT/CMT threads in the system. Only one thread per core was allowed, instructed by usage of llvm::heavyweight_hardware_concurrency() in the ThinLTO code. Any number passed to the LLD flag /opt:lldltojobs=..., or any other ThinLTO-specific flag, was previously interpreted in the context of llvm::heavyweight_hardware_concurrency(), which means SMT disabled.
One can now say in LLD:
/opt:lldltojobs=0 -- Use one std::thread / hardware core in the system (no SMT). Default value if flag not specified.
/opt:lldltojobs=N -- Limit usage to N threads, regardless of usage of heavyweight_hardware_concurrency().
/opt:lldltojobs=all -- Use all hardware threads in the system. Equivalent to /opt:lldltojobs=$(nproc) on Linux and /opt:lldltojobs=%NUMBER_OF_PROCESSORS% on Windows. When an affinity mask is set for the process, threads will be created only for the cores selected by the mask.
When N > number-of-hardware-threads-in-the-system, the threads in the thread pool will be dispatched equally on all CPU sockets (tested only on Windows).
When N <= number-of-hardware-threads-on-a-CPU-socket, the threads will remain on the CPU socket where the process started (only on Windows).
Differential Revision: https://reviews.llvm.org/D75153
Louis Dionne [Fri, 27 Mar 2020 14:07:58 +0000 (10:07 -0400)]
[libc++] Remove unused lit substitutions
Marcel Koester [Tue, 3 Mar 2020 09:33:16 +0000 (10:33 +0100)]
[mlir] Extended Dominance analysis with a function to find the nearest common dominator of two given blocks.
The Dominance analysis currently misses a utility function to find the nearest common dominator of two given blocks. This is required for a huge variety of different control-flow analyses and transformations. This commit adds this function and moves the getNode function from DominanceInfo to DominanceInfoBase, as it also works for post dominators.
Differential Revision: https://reviews.llvm.org/D75507
Sam Parker [Fri, 27 Mar 2020 13:38:54 +0000 (13:38 +0000)]
[ARM][MVE] Add DoubleWidthResult flag
Add a flag for those instructions which read from the top/bottom
halves of their inputs and produce a vector of results with double
width elements.
Differential Revision: https://reviews.llvm.org/D76762
Kirstóf Umann [Fri, 27 Mar 2020 13:29:31 +0000 (14:29 +0100)]
[analyzer][NFC] Change LangOptions to CheckerManager in the shouldRegister* functions
Some checkers may not only depend on language options but also analyzer options.
To make this possible this patch changes the parameter of the shouldRegister*
function to CheckerManager to be able to query the analyzer options when
deciding whether the checker should be registered.
Differential Revision: https://reviews.llvm.org/D75271
Louis Dionne [Thu, 26 Mar 2020 15:04:24 +0000 (11:04 -0400)]
[lit] NFC: Move the flaky test logic to _runShTest
This minor refactoring allows reducing the amount of processing that
is duplicated when we re-run a flaky test. It also has the nice
side effect that libc++'s current test format supports flaky .sh.cpp
tests, because those are built on top of _runShTest, not executeShTest.
Louis Dionne [Sat, 14 Mar 2020 16:09:52 +0000 (12:09 -0400)]
[lit] Recursively expand substitutions
This allows defining substitutions in terms of other substitutions. For
example, a %build substitution could be defined in terms of a %cxx
substitution as '%cxx %s -o %t.exe' and the script would be properly
expanded.
Differential Revision: https://reviews.llvm.org/D76178
Sjoerd Meijer [Fri, 27 Mar 2020 12:52:03 +0000 (12:52 +0000)]
[LV] Refactor widenIntOrFpInduction. NFC.
This untangles the logic in widenIntOrFpInduction in order to make more
explicit and visible how exactly the induction variable is lowered.
Differential Revision: https://reviews.llvm.org/D76686
Guillaume Chatelet [Fri, 27 Mar 2020 10:09:22 +0000 (10:09 +0000)]
[Alignment] Fix overaligning bug
Summary:
This was discovered while converting to Align type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76914
Kirstóf Umann [Fri, 27 Mar 2020 11:35:08 +0000 (12:35 +0100)]
[analyzer][MallocChecker] Fix that kfree only takes a single argument
Exactly what it says on the tin!
https://www.kernel.org/doc/htmldocs/kernel-api/API-kfree.html
Differential Revision: https://reviews.llvm.org/D76917
Simon Pilgrim [Fri, 27 Mar 2020 10:49:36 +0000 (10:49 +0000)]
Revert rGa3c715e9788d829031989b0a5ea4eb43c7288be9 "Twine - fix uninitialized variable warnings. NFCI."
@dblaikie noticed that this may interfere with msan analysis
Simon Pilgrim [Fri, 27 Mar 2020 10:45:47 +0000 (10:45 +0000)]
Revert rG6ff1ea3244c543ad24fc99c7f4979db2f2078593 "Fix "use of uninitialized variable" static analyzer warning. NFCI."
@dblaikie noticed that this may interfere with msan analysis
Stephan Herhut [Thu, 26 Mar 2020 11:12:06 +0000 (12:12 +0100)]
[MLIR][LLVM] Make index type bitwidth configurable.
This change adds a new option to the StandardToLLVM lowering to configure
the bitwidth of the index type independently of the target architecture's
pointer size.
Differential revision: https://reviews.llvm.org/D76353
Jonas Paulsson [Fri, 27 Mar 2020 11:31:48 +0000 (12:31 +0100)]
[SystemZ] Fix typos in comments.
David Green [Fri, 27 Mar 2020 07:24:15 +0000 (07:24 +0000)]
[ARM] Fix MVE VCMPr f16 pattern
This patterns seemed to be using the f32 instruction, not f16. Fix it to
use the correct one.
Differential Revision: https://reviews.llvm.org/D76841
Denis Khalikov [Tue, 24 Mar 2020 12:13:59 +0000 (15:13 +0300)]
[mlir][vulkan-runner] Add support for 2D memref.
Summary:
This patch adds support for 2D memref in mlir-vulkan-runner.
Differential Revision: https://reviews.llvm.org/D76737
Georgii Rymar [Tue, 24 Mar 2020 14:26:52 +0000 (17:26 +0300)]
[llvm-readobj] - Fix a crash when DT_STRTAB is broken.
We might have a crash scenario when we have an invalid DT_STRTAB value
that is larger than the file size. I've added a test case to demonstrate.
Differential revision: https://reviews.llvm.org/D76706
Alex Zinenko [Fri, 27 Mar 2020 10:14:44 +0000 (11:14 +0100)]
[mlir] StandardToLLVM: use template aliases instead of dummy classes
Multiple operation conversions from the Standard dialect to the LLVM dialect
are trivial one-to-one conversions that use only the pattern defined in base
utility classes such as OneToOneConvertToLLVMPattern and
VectorConvertToLLVMPattern. Use template aliases ("using" declarations) instead
of creating derived classes without new functionality.
Hans Wennborg [Wed, 25 Mar 2020 16:20:06 +0000 (17:20 +0100)]
clang-format: Fix pointer alignment for overloaded operators (PR45107)
This fixes a regression from D69573 which broke the following example:
$ echo 'operator C<T>*();' | bin/clang-format --style=Chromium
operator C<T> *();
(There should be no space before the asterisk.)
It seems the problem is in TokenAnnotator::spaceRequiredBetween(),
which only looked at the token to the left of the * to see if it was a
type or not. That code only handled simple types or identifiers, not
templates or qualified types. This patch addresses that.
Differential revision: https://reviews.llvm.org/D76850
Mikael Holmen [Fri, 27 Mar 2020 09:12:11 +0000 (10:12 +0100)]
Fix TBAA for unsigned fixed-point types
Summary:
Unsigned types can alias the corresponding signed types. I don't see
that this is explicitly mentioned in the Embedded-C specification, but
I think it should work the same as for the integer types.
Patch by: materi
Reviewers: ebevhan, leonardchan
Reviewed By: leonardchan
Subscribers: kosarev, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76856
Guillaume Chatelet [Thu, 26 Mar 2020 15:58:11 +0000 (15:58 +0000)]
[Alignment][NFC] Update MachineMemOperand implementation to use MaybeAlign
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Reviewed By: courbet
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76625
Fangrui Song [Fri, 27 Mar 2020 07:17:56 +0000 (00:17 -0700)]
[MCInstPrinter] Add parameter `Address` to printCustomAliasOperand. NFC
Follow-up of D72172 and llvmorg-11-init-6896-gb3cc5dcef0f.
Johannes Doerfert [Tue, 25 Feb 2020 22:04:06 +0000 (14:04 -0800)]
[OpenMP] `omp begin/end declare variant` - part 2, sema ("+CG")
This is the second part loosely extracted from D71179 and cleaned up.
This patch provides semantic analysis support for `omp begin/end declare
variant`, mostly as defined in OpenMP technical report 8 (TR8) [0].
The sema handling makes code generation obsolete as we generate "the
right" calls that can just be handled as usual. This handling also
applies to the existing, albeit problematic, `omp declare variant
support`. As a consequence a lot of unneeded code generation and
complexity is removed.
A major purpose of this patch is to provide proper `math.h`/`cmath`
support for OpenMP target offloading. See PR42061, PR42798, PR42799. The
current code was developed with this feature in mind, see [1].
The logic is as follows:
If we have seen a `#pragma omp begin declare variant match(<SELECTOR>)`
but not the corresponding `end declare variant`, and we find a function
definition we will:
1) Create a function declaration for the definition we were about to generate.
2) Create a function definition but with a mangled name (according to
`<SELECTOR>`).
3) Annotate the declaration with the `OMPDeclareVariantAttr`, the same
one used already for `omp declare variant`, using and the mangled
function definition as specialization for the context defined by
`<SELECTOR>`.
When a call is created we inspect it. If the target has an
`OMPDeclareVariantAttr` attribute we try to specialize the call. To this
end, all variants are checked, the best applicable one is picked and a
new call to the specialization is created. The new call is used instead
of the original one to the base function. To keep the AST printing and
tooling possible we utilize the PseudoObjectExpr. The original call is
the syntactic expression, the specialized call is the semantic
expression.
[0] https://www.openmp.org/wp-content/uploads/openmp-TR8.pdf
[1] https://reviews.llvm.org/D61399#change-496lQkg0mhRN
Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim, aaron.ballman
Subscribers: bollu, guansong, openmp-commits, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75779
Johannes Doerfert [Fri, 21 Feb 2020 01:50:47 +0000 (19:50 -0600)]
[OpenMP] `omp begin/end declare variant` - part 1, parsing
This is the first part extracted from D71179 and cleaned up.
This patch provides parsing support for `omp begin/end declare variant`,
as defined in OpenMP technical report 8 (TR8) [0].
A major purpose of this patch is to provide proper math.h/cmath support
for OpenMP target offloading. See PR42061, PR42798, PR42799. The current
code was developed with this feature in mind, see [1].
[0] https://www.openmp.org/wp-content/uploads/openmp-TR8.pdf
[1] https://reviews.llvm.org/D61399#change-496lQkg0mhRN
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D74941
Johannes Doerfert [Thu, 26 Mar 2020 00:33:48 +0000 (19:33 -0500)]
[OpenMP][NFC] Open `llvm` and `llvm::omp` namespace in OpenMPClause.cpp
Johannes Doerfert [Fri, 21 Feb 2020 19:48:56 +0000 (13:48 -0600)]
[OpenMP][NFC] Outline common functionality (skipUntilPragmaOpenMPEnd)
The same code was repeated multiple times, we put it in a function now.
Fangrui Song [Fri, 27 Mar 2020 06:55:43 +0000 (23:55 -0700)]
[MCInstPrinter] Add parameter `Address` to MCInstPrinter::printAliasInstr. NFC
Follow-up of D72172.
Shengchen Kan [Tue, 17 Mar 2020 14:35:46 +0000 (22:35 +0800)]
[X86][MC] Fix the bug for prefix padding support
Summary:
There is a tiny logic error of D75300, making branch is not
correctly aligned with option -x86-pad-max-prefix-size
Reviewers: reames, MaskRay, craig.topper, LuoYuanke, jyknight
Reviewed By: reames
Subscribers: hiraditya, llvm-commits, annita.zhang
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76285
Kai Luo [Fri, 27 Mar 2020 05:28:34 +0000 (05:28 +0000)]
[PowerPC] Fix test for PR45297 to adapt build without asserts. NFC.
Kai Luo [Fri, 27 Mar 2020 03:30:33 +0000 (03:30 +0000)]
[PowerPC] Enhance test for PR45297. NFC.
Uday Bondhugula [Thu, 26 Mar 2020 16:18:53 +0000 (21:48 +0530)]
[MLIR][NFC] drop some unnecessary includes
Drop unnecessary includes
Differential Revision: https://reviews.llvm.org/D76898
Juneyoung Lee [Tue, 24 Mar 2020 14:57:40 +0000 (23:57 +0900)]
[DAGCombine] Add basic optimizations for FREEZE in SelDag
Summary: This patch is the first effort to adding basic optimizations for FREEZE in SelDag.
Reviewers: spatel, lebedev.ri
Reviewed By: spatel
Subscribers: xbolva00, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76707
David Blaikie [Fri, 27 Mar 2020 03:09:14 +0000 (20:09 -0700)]
Use llvm_unreachable after a fully covered/always-returning switch
David Blaikie [Thu, 26 Mar 2020 20:47:34 +0000 (13:47 -0700)]
Make llvm::function_ref's operator bool explicit
This can avoid all sorts of mistakes with implicit conversion
(indirectly) to int, etc. I'm quite surprise there aren't any things to
fixup with this - but I guess most uses of function_ref aren't
optional/nullable.
Zakk Chen [Tue, 24 Mar 2020 16:42:22 +0000 (09:42 -0700)]
Fix typo, targetFeature should be lowercase.
this fixing also enable llc -mattr=+cpuhelp
Reviewers: ziangwan, kongyi
Reviewed By: kongyi
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76757
Kai Wang [Thu, 26 Mar 2020 01:39:46 +0000 (09:39 +0800)]
[NFC] Clang format for the ELF header and ARM build attributes.
Differential Revision: https://reviews.llvm.org/D76819
Leonard Chan [Thu, 26 Mar 2020 23:39:03 +0000 (16:39 -0700)]
Move setBugReportMsg() out from under a conditional
Fixes a build break with LLVM_ENABLE_BACKTRACES=OFF.
Differential Revision: https://reviews.llvm.org/D76893
Cyndy Ishida [Thu, 26 Mar 2020 23:29:21 +0000 (16:29 -0700)]
[llvm][TextAPI/MachO] silence clang-tidy warnings, NFC
* applies only to tests
Dan Gohman [Sat, 21 Dec 2019 05:44:24 +0000 (21:44 -0800)]
[WebAssembly] Support wasm exports with zero-length names.
Zero-length strings are valid export names in WebAssembly, so allow
users to specify them.
Differential Revision: https://reviews.llvm.org/D71793
Dan Gohman [Sun, 24 Nov 2019 15:27:54 +0000 (07:27 -0800)]
[WebAssembly] Fix the order of destructors in the LowerGlobalDtors pass.
Fix the LowerGlobalDtors pass to run destructors in the same order as the
regular LLVM destructor lowering -- in reverse order. Adjacent
destructors with the same associated object are grouped, but destructors
are not reordered based on associated objects.
Differential Revision: https://reviews.llvm.org/D70685
Douglas Yung [Thu, 26 Mar 2020 22:45:40 +0000 (15:45 -0700)]
Make PS4 use -fno-use-init-array only as the ABI does not support .init_array.
Reviewed by Paul Robinson
Sid Manning [Tue, 3 Mar 2020 14:19:59 +0000 (08:19 -0600)]
[Hexagon] Add support for Linux/Musl ABI (part 2)
A continuation of https://reviews.llvm.org/D72701. This
adds support needed in clang.
Differential Revision: https://reviews.llvm.org/D75638
Stanislav Mekhanoshin [Wed, 25 Mar 2020 19:57:44 +0000 (12:57 -0700)]
[AMDGPU] Propagate amdgpu-waves-per-eu to callees
Differential Revision: https://reviews.llvm.org/D76868
Alexey Bataev [Thu, 26 Mar 2020 21:12:45 +0000 (17:12 -0400)]
[OPENMP50]Fix the checks for the nesting of scan directives.
Fixed the check for the orhaned scan directives and improved checks for
parallel for and parallel for simd directives.
Paolo Severini [Thu, 26 Mar 2020 21:26:31 +0000 (14:26 -0700)]
[lld][Wasm] Wasm-ld emits invalid .debug_ranges entries for non-live symbols
When the debug info contains a relocation against a dead symbol, wasm-ld
may emit spurious range-list terminator entries (entries with Start==0
and End==0). This change fixes this by emitting the WasmRelocation
Addend as End value for a non-live symbol.
Reviewed by: sbc100, dblaikie
Differential Revision: https://reviews.llvm.org/D74781
LLVM GN Syncbot [Thu, 26 Mar 2020 21:10:45 +0000 (21:10 +0000)]
[gn build] Port
9f7d4150b9e
Craig Topper [Thu, 26 Mar 2020 18:09:08 +0000 (11:09 -0700)]
[X86] Move combineLoopMAddPattern and combineLoopSADPattern to an IR pass before SelecitonDAG.
These transforms rely on a vector reduction flag on the SDNode
set by SelectionDAGBuilder. This flag exists because SelectionDAG
can't see across basic blocks so SelectionDAGBuilder is looking
across and saving the info. X86 is the only target that uses this
flag currently. By removing the X86 code we can remove the flag
and the SelectionDAGBuilder code.
This pass adds a dedicated IR pass for X86 that looks across the
blocks and transforms the IR into a form that the X86 SelectionDAG
can finish.
An advantage of this new approach is that we can enhance it to
shrink the phi nodes and final reduction tree based on the zeroes
that we need to concatenate to bring the partially reduced
reduction back up to the original width.
Differential Revision: https://reviews.llvm.org/D76649
Sam Clegg [Thu, 19 Mar 2020 22:20:49 +0000 (15:20 -0700)]
[clang] Allow -DDEFAULT_SYSROOT to be a relative path
In this case we interpret the path as relative the clang driver binary.
This allows SDKs to be built that include clang along with a custom
sysroot without requiring users to specify --sysroot to point to the
directory where they installed the SDK.
See https://github.com/WebAssembly/wasi-sdk/issues/58
Differential Revision: https://reviews.llvm.org/D76653
Simon Pilgrim [Thu, 26 Mar 2020 20:46:11 +0000 (20:46 +0000)]
[X86] Prefer PACKUS(AND(),AND()) to SHUFFLE(PSHUFB(),PSHUFB()) on all targets
Extends rG9d1721ce3926 to support AVX2+ targets.
Jay Foad [Thu, 26 Mar 2020 14:58:31 +0000 (14:58 +0000)]
[AMDGPU] Rename overloaded getMaxWavesPerEU to getWavesPerEUForWorkGroup
Summary: I think Max in the name was misleading. NFC.
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76860
Jay Foad [Thu, 26 Mar 2020 13:44:07 +0000 (13:44 +0000)]
[AMDGPU] Remove getMaxWavesPerCU in favour of getWavesPerWorkGroup.
Summary:
These methods were identical. I chose to remove getMaxWavesPerCU because
I think Max in the name was misleading. NFC.
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76859
Derek Schuff [Wed, 25 Mar 2020 17:35:12 +0000 (10:35 -0700)]
[WEbAssembly] Clear frame base vreg in explicit-locals when stack pointer is dead
Having an alloca in a function causes the stack pointer to be generated in the
prolog, but if it's unused other than for debug info, explicit-locals will drop
it and not allocate a local. In this case we need to reset the FrameBaseVreg.
Differential Revision: https://reviews.llvm.org/D76784
Simon Pilgrim [Thu, 26 Mar 2020 19:59:37 +0000 (19:59 +0000)]
[X86] lowerV16I8Shuffle - create v8i16 mask for PACKUS(AND(),AND()) patterns.
We can improve computeKnownBits results by avoiding excess bitcasts.
For this pattern we were doing:
(v16i8 PACKUS(v8i16 BITCAST(v16i8 AND(V1, MASK)), v8i16 BITCAST(v16i8 AND(V2, MASK))))
By performing the MASK/AND with a v8i16 type and bitcasting V1/V2 directly we can help computeKnownBits see that the mask is clearing the upper bits and allows shuffle combining to peek through later on.
This will be necessary to extend rG9d1721ce3926 to AVX2+ targets in a future patch.
Alexey Bataev [Thu, 26 Mar 2020 19:47:50 +0000 (15:47 -0400)]
Revert "[OPENMP50]Add basic support for inscan reduction modifier."
This reverts commit
8099e0fe82ce78c15bc6c4cf52caca5b6fbe28f5 to fix the
problems with the Windows-based buildbots.
Luís Marques [Thu, 26 Mar 2020 19:54:29 +0000 (19:54 +0000)]
[sanitizer][RISCV] Implement SignalContext::GetWriteFlag for RISC-V
This patch follows the approach also used for MIPS, where we decode the
offending instruction to determine if the fault was caused by a read or
write operation, as that seems to be the only relevant information we have
in the signal context structure to determine that.
Differential Revision: https://reviews.llvm.org/D75168
diggerlin [Thu, 26 Mar 2020 19:46:52 +0000 (15:46 -0400)]
[AIX] discard the label in the csect of function description and use qualname for linkage
SUMMARY:
SUMMARY
for a source file "test.c"
void foo() {};
llc will generate assembly code as (assembly patch)
.globl foo
.globl .foo
.csect foo[DS]
foo:
.long .foo
.long TOC[TC0]
.long 0
and symbol table as (xcoff object file)
[4] m 0x00000004 .data 1 unamex foo
[5] a4 0x0000000c 0 0 SD DS 0 0
[6] m 0x00000004 .data 1 extern foo
[7] a4 0x00000004 0 0 LD DS 0 0
After first patch, the assembly will be as
.globl foo[DS] # -- Begin function foo
.globl .foo
.align 2
.csect foo[DS]
.long .foo
.long TOC[TC0]
.long 0
and symbol table will as
[6] m 0x00000004 .data 1 extern foo
[7] a4 0x00000004 0 0 DS DS 0 0
Change the code for the assembly path and xcoff objectfile patch for llc.
Reviewers: Jason Liu
Subscribers: wuzish, nemanjai, hiraditya
Differential Revision: https://reviews.llvm.org/D76162
Jon Chesterfield [Thu, 26 Mar 2020 19:07:31 +0000 (19:07 +0000)]
[libomptarget] Add missing elf_end call in elf_common.c
Summary:
[libomptarget] Add missing elf_end call in elf_common.c
Noticed when reviewing D76843.
Reviewers: simoll, jdoerfert, efocht, AndreyChurbanov, grokos, manorom
Reviewed By: grokos
Subscribers: openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D76874
Alexey Bataev [Wed, 25 Mar 2020 21:14:07 +0000 (17:14 -0400)]
[OPENMP50]Add basic support for inscan reduction modifier.
Added basic support (parsing/sema checks) for the inscan modifier in the
reduction clauses.
Michael Liao [Sat, 7 Mar 2020 06:49:58 +0000 (01:49 -0500)]
[cuda][hip] Add CUDA builtin surface/texture reference support.
Summary:
- Even though the bindless surface/texture interfaces are promoted,
there are still code using surface/texture references. For example,
[PR#26400](https://bugs.llvm.org/show_bug.cgi?id=26400) reports the
compilation issue for code using `tex2D` with texture references. For
better compatibility, this patch proposes the support of
surface/texture references.
- Due to the absent documentation and magic headers, it's believed that
`nvcc` does use builtins for texture support. From the limited NVVM
documentation[^nvvm] and NVPTX backend texture/surface related
tests[^test], it's believed that surface/texture references are
supported by replacing their reference types, which are annotated with
`device_builtin_surface_type`/`device_builtin_texture_type`, with the
corresponding handle-like object types, `cudaSurfaceObject_t` or
`cudaTextureObject_t`, in the device-side compilation. On the host
side, that global handle variables are registered and will be
established and updated later when corresponding binding/unbinding
APIs are called[^bind]. Surface/texture references are most like
device global variables but represented in different types on the host
and device sides.
- In this patch, the following changes are proposed to support that
behavior:
+ Refine `device_builtin_surface_type` and
`device_builtin_texture_type` attributes to be applied on `Type`
decl only to check whether a variable is of the surface/texture
reference type.
+ Add hooks in code generation to replace that reference types with
the correponding object types as well as all accesses to them. In
particular, `nvvm.texsurf.handle.internal` should be used to load
object handles from global reference variables[^texsurf] as well as
metadata annotations.
+ Generate host-side registration with proper template argument
parsing.
---
[^nvvm]: https://docs.nvidia.com/cuda/pdf/NVVM_IR_Specification.pdf
[^test]: https://raw.githubusercontent.com/llvm/llvm-project/master/llvm/test/CodeGen/NVPTX/tex-read-cuda.ll
[^bind]: See section 3.2.11.1.2 ``Texture reference API` in [CUDA C Programming Guide](https://docs.nvidia.com/cuda/pdf/CUDA_C_Programming_Guide.pdf).
[^texsurf]: According to NVVM IR, `nvvm.texsurf.handle` should be used. But, the current backend doesn't have that supported. We may revise that later.
Reviewers: tra, rjmccall, yaxunl, a.sidorin
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76365
Scott Linder [Tue, 24 Mar 2020 21:24:49 +0000 (17:24 -0400)]
[AMDGPU] Fix PC register mapping in wave32 mode
Summary:
The PC_32 DWARF register is for a 32-bit process address space which we
don't implement in AMDGCN; another way of putting this is that the size
of the PC register is not a function of the wavefront size. If we ever
implement a 32-bit process address space we will need to add two more
DwarfFlavours i.e. we will need to represent the product of (wave32,
wave64) x (64-bit address space, 32-bit address space).
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76732
David Blaikie [Thu, 26 Mar 2020 18:32:15 +0000 (11:32 -0700)]
Roll otherwise unused subexpressions into an assertion
Sanjay Patel [Wed, 25 Mar 2020 18:29:12 +0000 (14:29 -0400)]
[InstCombine] add shuffle-with-bitcast-operand tests; NFC
Sterling Augustine [Thu, 26 Mar 2020 01:09:25 +0000 (18:09 -0700)]
Correctly handle using foo = std::foo inside namespaces.
Summary:
The gdb pretty printer misprints variables declared via
using declarations of the form:
namespace foo {
using string_view = std::string_view;
string_view bar;
}
This change fixes that, by deferring the decision to ignore
types not inside std until after desugaring.
Reviewers: #libc!
Subscribers: broadwaylamb, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D76816
Guillaume Chatelet [Thu, 26 Mar 2020 17:51:25 +0000 (17:51 +0000)]
[Alignment][NFC] Use llvmTargetFrameLowering::getStackAlign
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Reviewed By: courbet
Subscribers: wuzish, arsenm, jyknight, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, fedor.sergeev, jrtc27, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76613
Jonathan Roelofs [Wed, 25 Mar 2020 20:50:16 +0000 (14:50 -0600)]
[InstCombine] Fix Incorrect fold of ashr+xor -> lshr w/ vectors
Fixes https://bugs.llvm.org/show_bug.cgi?id=43665
Jinsong Ji [Thu, 26 Mar 2020 18:05:34 +0000 (18:05 +0000)]
[docs][Phabricator] git migration related update
1.Add instructions to update author when committing other's patch
We have updated DeveloperPolicy to show how to change author in
https://reviews.llvm.org/D72468
We should also update Phabricator page to include such infomation,
in case people follow the steps here and forget to update author info.
2. Replace `git llvm push` with `git push`
Reviewed By: probinson
Differential Revision: https://reviews.llvm.org/D76718
Heejin Ahn [Thu, 26 Mar 2020 04:48:37 +0000 (21:48 -0700)]
[WebAssembly] Add test for event section order change
Summary:
This adds a test for D76752. Now the global section comes after the
event section, and this change makes sure it is satisfied.
Reviewers: sbc100, tlively
Reviewed By: tlively
Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76823
Marius Brehler [Thu, 26 Mar 2020 16:25:19 +0000 (09:25 -0700)]
[mlir] Rename CMake target MLIRQuantOps to MLIRQuant
With commit 4d60f47 VectorOps was renamed to Vector and the naming of
the CMake target was adjusted. With commit 363dd3f QuantOps was
renamed to Quant, but the naming of the CMake target is left
untouched. This renames the CMake target.
Dan Liew [Wed, 25 Mar 2020 02:39:44 +0000 (19:39 -0700)]
[ASan] Fix issue where system log buffer was not cleared after reporting an issue.
Summary:
When ASan reports an issue the contents of the system log buffer
(`error_message_buffer`) get flushed to the system log (via
`LogFullErrorReport()`). After this happens the buffer is not cleared
but this is usually fine because the process usually exits soon after
reporting the issue.
However, when ASan runs in `halt_on_error=0` mode execution continues
without clearing the buffer. This leads to problems if more ASan
issues are found and reported.
1. Duplicate ASan reports in the system log. The Nth (start counting from 1)
ASan report will be duplicated (M - N) times in the system log if M is the
number of ASan issues reported.
2. Lost ASan reports. Given a sufficient
number of reports the buffer will fill up and consequently cannot be appended
to. This means reports can be lost.
The fix here is to reset `error_message_buffer_pos` to 0 which
effectively clears the system log buffer.
A test case is included but unfortunately it is Darwin specific because
querying the system log is an OS specific activity.
rdar://problem/
55986279
Reviewers: kubamracek, yln, vitalybuka, kcc, filcab
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D76749
Sean Silva [Tue, 24 Mar 2020 22:13:31 +0000 (15:13 -0700)]
Allow IndexType inside tensors.
It's common in many dialects to use tensors to themselves hold tensor shapes (for example, the shape is itself the result of some non-trivial calculation). Currently, such dialects have to use `tensor<?xi64>` or worse (like allowing either i32 or i64 tensors to represent shapes). `tensor<?xindex>` is the natural type to represent this, but is currently disallowed. This patch allows it.
Differential Revision: https://reviews.llvm.org/D76726
Sam McCall [Thu, 26 Mar 2020 17:42:40 +0000 (18:42 +0100)]
Test that would have caught recovery-expr crashes in
0788acbccbec. NFC
Alex Zinenko [Thu, 26 Mar 2020 17:09:26 +0000 (18:09 +0100)]
[mlir] StandardToLLVM: clean up conversion patterns for vector operations
Summary:
Provide a public VectorConvertToLLVMPattern utility class to implement
conversions with automatic unrolling of operation on multidimensional vectors
to lists of operations on single-dimensional vectors when lowering to the LLVM
dialect. Drop the template-based check on the number of operands since the
actual implementation does not depend on the operand number anymore. This check
only creates spurious concepts (UnaryOpLowering, BinaryOpLowering, etc).
Differential Revision: https://reviews.llvm.org/D76865
Alex Zinenko [Thu, 26 Mar 2020 17:08:57 +0000 (18:08 +0100)]
[mlir] StandardToLLVM: make one-to-one convresion pattern publicly available
Summary:
The Standard-to-LLVM dialect convresion has a set of utility classes that
simplify conversions, including patterns that provide one-to-one conversion
operation conversion with optional result packing. Expose these classes in a
public header so that conversions other than Standard-to-LLVM (e.g. vectors, or
LLVM-based intrinsics) could also use them. Since the patterns are implemented
as class templates and in order to keep the code size limited, keep the
implementation private by resorting to op identifiers instead of template-based
builders.
Differential Revision: https://reviews.llvm.org/D76864
Louis Dionne [Thu, 26 Mar 2020 17:14:51 +0000 (13:14 -0400)]
[libc++abi] Remove unused lit feature
Mitch Phillips [Thu, 26 Mar 2020 17:09:57 +0000 (10:09 -0700)]
[GWP-ASan] Use functions in backtrace test, not line numbers.
Summary:
There's no unwinding functionality on Android that allows for line
numbers to be retrieved in-process. As a result, we can't have
this backtrace test run on Android.
Cleanup the test to use optnone functions instead, which is more stable
than line numbers anyway.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: #sanitizers, morehouse, cferris
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D76807
Jonas Devlieghere [Thu, 26 Mar 2020 16:51:04 +0000 (09:51 -0700)]
[lldb/CMake] Fix `install` for multi-configuration generators.
For multi-generator builds like MSVC and Xcode, the install source and
destination of the lldb-python-scripts target contains configuration
dependent paths and therefore need to be substituted.
Differential revision: https://reviews.llvm.org/D76827
Kirstóf Umann [Thu, 26 Mar 2020 16:27:13 +0000 (17:27 +0100)]
[analyzer] Add the Preprocessor to CheckerManager
Matt Arsenault [Thu, 26 Mar 2020 15:51:25 +0000 (11:51 -0400)]
CUDA: Fix broken test run lines
There was a misisng space between the -march and --cuda-gpu-arch
arguments, so --cuda-gpu-arch wasn't actually being parsed. I'm not
sure what the intent of the sm_10 run lines were, but they error as an
unsupported architecture. Switch these to something else.
Jay Foad [Thu, 26 Mar 2020 13:39:51 +0000 (13:39 +0000)]
[AMDGPU] Make use of divideCeil. NFC.
Jay Foad [Thu, 26 Mar 2020 13:10:05 +0000 (13:10 +0000)]
[AMDGPU] Remove unused methods. NFC.
Fangrui Song [Thu, 26 Mar 2020 16:07:37 +0000 (09:07 -0700)]
[llvm-objdump] Fix typo. NFC
Kirstóf Umann [Thu, 26 Mar 2020 16:03:37 +0000 (17:03 +0100)]
Make a windows buildbot happy
Justin Hibbits [Tue, 24 Mar 2020 01:09:45 +0000 (20:09 -0500)]
[PowerPC]: Don't allow r0 as a target for LD_GOT_TPREL_L/32
Summary:
The linker is free to relax this (relocation R_PPC_GOT_TPREL16) against
R_PPC_TLS, if it sees fit (initial exec to local exec). If r0 is used,
this can generate execution-invalid code (converts to 'addi %rX, %r0,
FOO, which translates in PPC-lingo to li %rX, FOO). Forbid this
instead.
This fixes static binaries using locales on FreeBSD/powerpc
(tested on FreeBSD/powerpcspe).
Reviewed By: nemanjai
Differential Revision: https://reviews.llvm.org/D76662
Anton Kolesov [Thu, 26 Mar 2020 15:48:04 +0000 (18:48 +0300)]
[lldb-vscode] Convert launch_info and attach_info to local variables
Those fields inside of the global variable can be local variables because
they are used in only inside of one function: request_launch for launch_info
and request_attach for attach_info.
To avoid confusion an already existing local variable attach_info of
request_attach has been renamed to better reflect its purpose.
Differential Revision: https://reviews.llvm.org/D76593
Simon Pilgrim [Thu, 26 Mar 2020 14:39:46 +0000 (14:39 +0000)]
[X86][SSE] Prefer PACKUS(AND(),AND()) to SHUFFLE(PSHUFB(),PSHUFB()) on pre-AVX2 targets
As discussed on PR31443, we should be trying to use PACKUS for binary truncation patterns to reduce the number of shuffles.
The plan is to support AVX2+ targets once we've worked around PR45315 - we fail to peek through a VBROADCAST_LOAD mask to recognise zero upper bits in a PACKUS pattern.
We should also be able to add support for v8i16 and possibly 256/512-bit vectors as well.
Fangrui Song [Mon, 23 Mar 2020 06:03:09 +0000 (23:03 -0700)]
[PPCInstPrinter] Change printBranchOperand(calltarget) to print the target address in hexadecimal form
```
// llvm-objdump -d output (before)
0: bl .-4
4: bl .+0
8: bl .+4
// llvm-objdump -d output (after) ; GNU objdump -d
0: bl 0xfffffffc / bl 0xfffffffffffffffc
4: bl 0x4
8: bl 0xc
```
Many Operand's are not annotated as OPERAND_PCREL.
They are not affected (e.g. `b .+
67108860`). I plan to fix them in future patches.
Modified test/tools/llvm-objdump/ELF/PowerPC/branch-offset.s to test
address space wraparound for powerpc32 and powerpc64.
Reviewed By: sfertile, jhenderson
Differential Revision: https://reviews.llvm.org/D76591
James Henderson [Thu, 26 Mar 2020 14:14:50 +0000 (14:14 +0000)]
[lld][ELF] Fix error message
The error previously talked about a "section header" but was actually
referring to a program header.
Reviewed by: grimar, MaskRay
Differential Revision: https://reviews.llvm.org/D76846
Fangrui Song [Sun, 22 Mar 2020 22:03:10 +0000 (15:03 -0700)]
[X86InstPrinter] Change printPCRelImm to print the target address in hexadecimal form
```
// llvm-objdump -d output (before)
400000: e8 0b 00 00 00 callq 11
400005: e8 0b 00 00 00 callq 11
// llvm-objdump -d output (after)
400000: e8 0b 00 00 00 callq 0x400010
400005: e8 0b 00 00 00 callq 0x400015
// GNU objdump -d. The lack of 0x is not ideal because the result cannot be re-assembled
400000: e8 0b 00 00 00 callq 400010
400005: e8 0b 00 00 00 callq 400015
```
In llvm-objdump, we pass the address of the next MCInst. Ideally we
should just thread the address of the current address, unfortunately we
cannot call X86MCCodeEmitter::encodeInstruction (X86MCCodeEmitter
requires MCInstrInfo and MCContext) to get the length of the MCInst.
MCInstPrinter::printInst has other callers (e.g llvm-mc -filetype=asm, llvm-mca) which set Address to 0.
They leave MCInstPrinter::PrintBranchImmAsAddress as false and this change is a no-op for them.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D76580
Haojian Wu [Thu, 26 Mar 2020 15:07:50 +0000 (16:07 +0100)]
Revert "[AST] Build recovery expressions by default for C++."
This reverts commit
0788acbccbec094903a3425ffe5a98f8d55cbd64.
This reverts commit
c2d7a1f79cedfc9fcb518596aa839da4de0adb69: Revert "[clangd] Add test for FindTarget+RecoveryExpr (which already works). NFC"
It causes a crash on invalid code:
class X {
decltype(unresolved()) foo;
};
constexpr int s = sizeof(X);