Clement Courbet [Thu, 29 Oct 2020 10:48:43 +0000 (11:48 +0100)]
[llvm-exegesis] Do not try to assign random registers twice.
Doing a random assignment assigns both tested (forward) and back-to-back
(backward) instructions.
When none of the tested instruction and back-to-back instruction have
implicit aliasing, we're currently trying to do a random register
asignment twice.
Fix this (see PR26418).
Differential Revision: https://reviews.llvm.org/D90380
Adam Balogh [Thu, 15 Oct 2020 13:07:48 +0000 (15:07 +0200)]
[ADT] Fix for ImmutableMapRef
The `Root` member of `ImmutableMapRef` was changed recently from a plain
pointer to `IntrusiveRefCntPtr`. However, the `Profile` member function
was not adjusted. This results in comilation error whenever the
`Profile` method is used on an `ImmutableMapRef`. This patch fixes this
issue and also adds unit tests for `ImmutableMapRef`.
Differential Revision: https://reviews.llvm.org/D89486
Georgii Rymar [Thu, 29 Oct 2020 08:55:00 +0000 (11:55 +0300)]
[yaml2obj][test] - Merge strtab-implicit-sections-*.yaml into strtab-implicit-sections.yaml and improve testing of .shstrtab
This creates `strtab-implicit-sections.yaml` and merges 2 `strtab-implicit-sections*` tests into it.
I've also added a few tests for `.shstrtab` section related to section flags.
With that we have a single place where we can test implicit string table sections and
the `.shstrtab` section in particular.
Differential revision: https://reviews.llvm.org/D90372
Simon Pilgrim [Wed, 28 Oct 2020 16:17:45 +0000 (16:17 +0000)]
[InstCombine] Add select+funnel-shift test patterns
dfukalov [Tue, 27 Oct 2020 15:17:38 +0000 (18:17 +0300)]
[MIR] Fix out of bounds access in MIRPrinter.
Fixes: SWDEV-256460
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D90239
Max Kazantsev [Thu, 29 Oct 2020 11:09:31 +0000 (18:09 +0700)]
[NFC][SCEV] Use generic predicate checkers to simplify code
Jay Foad [Thu, 29 Oct 2020 10:55:16 +0000 (10:55 +0000)]
[AMDGPU] Simplify insertNoops functions. NFC.
Alok Kumar Sharma [Thu, 29 Oct 2020 10:38:51 +0000 (16:08 +0530)]
[DebugInfo] [NFCI] Adding a missed out line in support for DW_TAG_generic_subrange.
This commit adds a missed out line in earlier commit for DW_TAG_generic_subrange.
Previous commit ID:
a6dd01afa3d5902203d04a72e0b478078f796a35
Differential Revision: https://reviews.llvm.org/D89218
Thanks markus for pointing this out.
Florian Hahn [Thu, 29 Oct 2020 09:30:37 +0000 (09:30 +0000)]
[SCEV] Match 'zext (trunc A to iB) to iY' as URem.
URem operations with constant power-of-2 second operands are modeled as
such. This patch on its own has very little impact (e.g. no changes in
CodeGen for MultiSource/SPEC2000/SPEC2006 on X86 -O3 -flto), but I'll
soon post follow-up patches that make use of it to more accurately
determine the trip multiple.
Reviewed By: mkazantsev
Differential Revision: https://reviews.llvm.org/D89821
Max Kazantsev [Thu, 29 Oct 2020 10:34:58 +0000 (17:34 +0700)]
[NFC] Add some new util functions to ICmpInst
Tres Popp [Thu, 29 Oct 2020 10:01:05 +0000 (11:01 +0100)]
[mlir] Reorder shape assuming bufferization.
The previous ordering continued to use the original assuming after
replacing it which is not allowed. Now, inline the region from the old
into the new before the replacement.
Differential Revision: https://reviews.llvm.org/D90375
Georgii Rymar [Wed, 28 Oct 2020 12:05:35 +0000 (15:05 +0300)]
[yaml2obj][test] - Merge dynsymtab-shlink.yaml to dynsym-section.yaml
This simplifies the dynsymtab-shlink.yaml test (with use of macros)
and merges it into the dynsym-section.yaml test.
Differential revision: https://reviews.llvm.org/D90301
Krasimir Georgiev [Thu, 29 Oct 2020 10:27:54 +0000 (11:27 +0100)]
clang-format: Add a consumer to diagnostics engine
Contributed by dmikis (Kirill Dmitrenko)!
Otherwise problems like trying to format readonly file in-place led to crashes.
I've added reviewers by looking at `git blame` and other reviews to the changed file, so may have missed someone.
Reviewed By: krasimir
Differential Revision: https://reviews.llvm.org/D90121
Kazushi (Jam) Marukawa [Wed, 28 Oct 2020 11:13:45 +0000 (20:13 +0900)]
[VE] Add missing vector regression test
I forgot to add a regression test for VMAXX instruction when I added
it. So, I'm adding it now.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D90356
Kazushi (Jam) Marukawa [Wed, 28 Oct 2020 11:11:40 +0000 (20:11 +0900)]
[VE] Add vector control instructions
Add LVL/SVL/SMVL/LVIX isntructions. Add regression tests too.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D90355
David Spickett [Tue, 27 Oct 2020 11:55:27 +0000 (11:55 +0000)]
[lldb] Correct --help output for qemu rootfs script
It was printing "Usage:" twice.
Reviewed By: omjavaid
Differential Revision: https://reviews.llvm.org/D90225
David Zarzycki [Thu, 29 Oct 2020 09:53:47 +0000 (05:53 -0400)]
[lldb] Unbreak the build after a recent PowerPC change
40dd4d5233d9f81705a24d91b48d2620e487b89d introduced two new types.
Max Kazantsev [Thu, 29 Oct 2020 09:29:45 +0000 (16:29 +0700)]
[SCEV][NFC] Use general predicate checkers in monotonicity check
This makes the code more compact and readable.
Georgii Rymar [Wed, 28 Oct 2020 10:34:28 +0000 (13:34 +0300)]
[yaml2obj] - Improve handling of SectionHeaderTable::NoHeaders flag.
When `NoHeaders` is set, we still have following issues:
1) We emit the `.shstrtab` implicit section of size 1 (empty string table).
2) We still align the start of the section header table, what affects the output size.
3) We still write section header table bytes.
This patch fixes all of these issues.
Differential revision: https://reviews.llvm.org/D90295
David Green [Thu, 29 Oct 2020 09:13:23 +0000 (09:13 +0000)]
[InterleaveAccess] Recognise Interleave loads through binary operations
Instcombine will currently sink identical shuffles though vector binary
operations. This is probably generally useful, but can break up the code
pattern we use to represent an interleaving load group. This patch
reverses that in the InterleaveAccessPass to re-recognise the pattern of
shuffles sunk past binary operations and folds them back if an
interleave group can be created.
Differential Revision: https://reviews.llvm.org/D89489
Sam McCall [Tue, 27 Oct 2020 09:58:34 +0000 (10:58 +0100)]
[CMake] Support inter-proto dependencies in generate_protos.
Differential Revision: https://reviews.llvm.org/D90215
Max Kazantsev [Thu, 29 Oct 2020 08:27:21 +0000 (15:27 +0700)]
[NFC][SCEV] Refactor monotonic predicate checks to return enums instead of bools
This patch gets rid of output parameter which is not needed for most users
and prepares this API for further refactoring.
Sam McCall [Fri, 9 Oct 2020 13:17:26 +0000 (15:17 +0200)]
[clangd] Support CodeActionParams.only
Differential Revision: https://reviews.llvm.org/D89126
Vitaly Buka [Thu, 29 Oct 2020 08:09:39 +0000 (01:09 -0700)]
Revert "[NFC][TSAN] Logs to debug test script on bot"
Done with debugging. Script didn't work because of low limit on open
files on the bot.
This reverts commit
220293da53b5049ded67b1a251bd85069fa068e7.
Christian Sigg [Thu, 29 Oct 2020 07:17:27 +0000 (08:17 +0100)]
[mlir][gpu] Fix leaked stream and module when lowering gpu.launch_func to runtime calls.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D90370
Georgii Rymar [Wed, 28 Oct 2020 15:11:28 +0000 (18:11 +0300)]
[llvm-objdump][test] - Stop using precompiled binary in MachO/disassemble-g-dsym.test
This removes Inputs/libbogus11.a
Initially I've removed it in D90013, but had to restore it, because BB found this
test is using it.
I've updated the test to use YAMLs, added comment and one more possible error check.
Differential revision: https://reviews.llvm.org/D90312
Cameron Finucane [Thu, 29 Oct 2020 06:47:38 +0000 (23:47 -0700)]
[libFuzzer] Remove InterruptHandler from Fuchsia implementation
As implemented, the `InterruptHandler` thread was spinning trying to
`select()` on a null "stdin", wasting a significant amount of CPU for no
benefit. As Fuchsia does not have a native concept of stdin (or POSIX
signals), this commit simply removes this feature entirely.
Reviewed By: aarongreen
Differential Revision: https://reviews.llvm.org/D89266
Fangrui Song [Thu, 29 Oct 2020 06:58:31 +0000 (23:58 -0700)]
[Reassociate][test] Delete improper -NOT patterns to work with -enable-new-pm=1
The two tests rely on LegacyInlinerBase::doFinalization to remove
Function::isDefTriviallyDead() functions. The new PM does not have the behavior.
The -NEXT patterns checking the emptiness are actually sufficient.
Note, reassociate-deadinst.ll has become stale - it no longer catches
the problem r285380 intended. Unfortunately it is difficult to craft a
new test because it is actually pretty difficult to break it with
`MadeChange = true;` all over the file.
Serge Pavlov [Fri, 23 Oct 2020 11:36:16 +0000 (18:36 +0700)]
[FPEnv] Tests for rounding properties of constant evalution
These are moved from D88498.
Differential Revision: https://reviews.llvm.org/D90026
Fangrui Song [Thu, 29 Oct 2020 05:58:20 +0000 (22:58 -0700)]
[opt] Pin -stats-json & -opt-bisect-limit tests to -enable-new-pm=0
-stats-json requires `TimeReagion PassTimer(getPassTimer(...))` in the legacy
PM. The loss of functionality is not critical because we have the similar -time-passes.
Johannes Doerfert [Thu, 29 Oct 2020 05:38:40 +0000 (00:38 -0500)]
[Attributor][NFC] Rerun update test script
Johannes Doerfert [Thu, 29 Oct 2020 05:13:27 +0000 (00:13 -0500)]
[Attributor][FIX] Properly promote arguments pointers to arrays
When we promote pointer arguments we did compute a wrong offset and use
a wrong type for the array case.
Bug reported and reduced by Whitney Tsang <whitneyt@ca.ibm.com>.
River Riddle [Thu, 29 Oct 2020 05:00:55 +0000 (22:00 -0700)]
[mlir][SymbolTable] Small optimization to walking symbol references
* Check region count for unknown symbol tables first, as it is a faster check
* Add an accessor to MutableDictionaryAttr to get the internal dictionary without creating a new one if it is empty. This avoids an otherwise unnecessary lookup of an MLIRContext.
River Riddle [Thu, 29 Oct 2020 04:48:48 +0000 (21:48 -0700)]
[mlir][Inliner] Add a `wouldBeCloned` flag to each of the `isLegalToInline` hooks.
Often times the legality of inlining can change depending on if the callable is going to be inlined in-place, or cloned. For example, some operations are not allowed to be duplicated and can only be inlined if the original callable will cease to exist afterwards. The new `wouldBeCloned` flag allows for dialects to hook into this when determining legality.
Differential Revision: https://reviews.llvm.org/D90360
River Riddle [Thu, 29 Oct 2020 04:48:38 +0000 (21:48 -0700)]
[mlir][Inliner] Add a new hook for checking if it is legal to inline a callable into a call
In certain situations it isn't legal to inline a call operation, but this isn't something that is possible(at least not easily) to prevent with the current hooks. This revision adds a new hook so that dialects with call operations that shouldn't be inlined can prevent it.
Differential Revision: https://reviews.llvm.org/D90359
Ben Shi [Thu, 29 Oct 2020 03:49:21 +0000 (11:49 +0800)]
[NFC][clang][AVR] Add more devices
Reviewed By: dylanmckay
Differential Revision: https://reviews.llvm.org/D88352
Ben Shi [Thu, 29 Oct 2020 02:54:17 +0000 (10:54 +0800)]
[NFC][AVR] Improve device list
Reviewed By: dylanmckay
https://reviews.llvm.org/D87968
Fangrui Song [Thu, 29 Oct 2020 02:11:19 +0000 (19:11 -0700)]
[Debugify] Move global namespace functions into llvm::
Also move exportDebugifyStats from tools/opt to Debugify.cpp
Vedant Kumar [Thu, 29 Oct 2020 01:55:46 +0000 (18:55 -0700)]
Revert "[DebugInfo] Fix legacy ZExt emission when FromBits >= 64 (PR47927)"
This reverts commit
99053462216cf835eb3ae063942c618d9609de87.
It breaks the compiler-rt build, see https://reviews.llvm.org/D89838
Vedant Kumar [Thu, 29 Oct 2020 01:55:37 +0000 (18:55 -0700)]
Revert "[DebugInfo] Shorten legacy [s|z]ext dwarf expressions"
This reverts commit
2ce36ebca544dd71075a7818ff4070da5667603b. It depends
on https://reviews.llvm.org/D89838, which needs to be reverted.
Mircea Trofin [Wed, 28 Oct 2020 00:22:30 +0000 (17:22 -0700)]
[ThinLTO] Fix .llvmcmd emission
llvm::EmbedBitcodeInModule needs (what used to be called) EmbedMarker
set, in order to emit .llvmcmd. EmbedMarker is really about embedding the
command line, so renamed the parameter accordingly, too.
This was not caught at test because the check-prefix was incorrect, but
FileCheck does not report that when multiple prefixes are provided. A
separate patch will address that.
Differential Revision: https://reviews.llvm.org/D90278
Derek Schuff [Thu, 29 Oct 2020 00:15:58 +0000 (17:15 -0700)]
[WebAssembly] Add support for DWARF type units
Since Wasm comdat sections work similarly to ELF, we can use that mechanism
to eliminate duplicate dwarf type information in the same way.
Differential Revision: https://reviews.llvm.org/D88603
Haruki Imai [Thu, 29 Oct 2020 00:05:32 +0000 (17:05 -0700)]
[mlir] Convert raw data in dense element attributes for big-endian machines.
This patch fixes a bug [[ https://bugs.llvm.org/show_bug.cgi?id=46091 | 46091 ]]
Raw data for the `dense-element attribute` is written in little endian (LE) format.
This commit converts the format to big endian (BE) in ʻAttribute Parser` on the
BE machine. Also, when outputting on a BE machine, the BE format is converted
to LE in "AsmPrinter".
Differential Revision: https://reviews.llvm.org/D80695
River Riddle [Wed, 28 Oct 2020 23:46:38 +0000 (16:46 -0700)]
[mlir] Optimize the parsing of ElementsAttr hex strings
This revision optimizes the parsing of hex strings by using the checked variant of llvm::fromHex, and adding a specialized method to Token for extracting hex strings. This leads a large decrease in compile time when parsing large hex constants (one example: 2.6 seconds -> 370 miliseconds)
Differential Revision: https://reviews.llvm.org/D90266
River Riddle [Wed, 28 Oct 2020 23:46:31 +0000 (16:46 -0700)]
[llvm][StringExtras] Use a lookup table for `hexDigitValue`
This method is at the core of the conversion from hex to binary, and using a lookup table great improves the compile time of hex conversions.
Context: In MLIR we use hex strings to represent very large constants in the textual format of the IR. These changes lead to a large decrease in compile time when parsing these constants (>1 second -> 350 miliseconds).
Differential Revision: https://reviews.llvm.org/D90320
River Riddle [Wed, 28 Oct 2020 23:46:25 +0000 (16:46 -0700)]
[llvm][StringExtras] Add a fail-able version of `fromHex`
This revision adds a fail-able/checked version of `fromHex` that fails when the input string contains a non-hex character. This removes the need for users to have a separate check for if the string contains all hex digits. This becomes very costly for large hex strings given that checking if a string contains only hex digits is effectively the same as just converting it in the first place.
Context: In MLIR we use hex strings to represent very large constants in the textual format of the IR. These changes lead to a large decrease in compile time when parsing these constants (2 seconds -> 1 second).
Differential Revision: https://reviews.llvm.org/D90265
Jonas Devlieghere [Wed, 28 Oct 2020 23:22:15 +0000 (16:22 -0700)]
Revert "[AppleObjCRuntimeV2] Force lazily allocated class names to be resolved."
We're no longer convinced that this is needed and we have no test
coverage to disprove that. Backing out of this change until we're
convinced otherwise.
Kazushi (Jam) Marukawa [Wed, 28 Oct 2020 04:00:21 +0000 (13:00 +0900)]
[VE] Add vector mask operation instructions
Add VFMK/VFMS/VFMF/ANDM/ORM/XORM/EQVM/NNDM/NEGM/PCVM/LZVM/TOVM
isntructions. Add regression tests too. Also add new patterns
to parse VFMK/VFMS/VFMF mnemonics.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D90297
Amy Huang [Tue, 27 Oct 2020 18:35:57 +0000 (11:35 -0700)]
Recommit "[CodeView] Emit static data members as S_CONSTANTs."
We used to only emit static const data members in CodeView as
S_CONSTANTS when they were used; this patch makes it so they are always emitted.
This changes CodeViewDebug.cpp to find the static const members from the
class debug info instead of creating DIGlobalVariables in the IR
whenever a static const data member is used.
Bug: https://bugs.llvm.org/show_bug.cgi?id=47580
Differential Revision: https://reviews.llvm.org/D89072
This reverts commit
504615353f31136dd6bf7a971b6c236fd70582be.
Austin Kerbow [Wed, 28 Oct 2020 21:38:41 +0000 (14:38 -0700)]
[AMDGPU] Add Reset function to GCNHazardRecognizer
Reset the tracked emitted instructions when starting scheduling on a new
region.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D90347
Mehdi Amini [Wed, 28 Oct 2020 23:28:36 +0000 (23:28 +0000)]
Make the post-commit review expectations more explicit with respect to revert
See http://lists.llvm.org/pipermail/llvm-dev/2016-March/096529.html for
context.
Reviewed By: silvas, rengolin, echristo, dexonsmith, gribozavr2
Differential Revision: https://reviews.llvm.org/D89995
Christopher Di Bella [Wed, 28 Oct 2020 23:16:17 +0000 (16:16 -0700)]
[Sema] adds basic -Wfree-nonheap-object functionality
Checks to make sure that stdlib's (std::)free is being appropriately
used. Presently checks for the following misuses:
- free(&stack_object)
- free(stack_array)
Differential Revision: https://reviews.llvm.org/D89988
Duncan P. N. Exon Smith [Tue, 20 Oct 2020 22:53:51 +0000 (18:53 -0400)]
ModuleManager: Simplify lookupModuleFile by only setting the out parameter once, NFC
Differential Revision: https://reviews.llvm.org/D89835
Gaurav Jain [Wed, 28 Oct 2020 17:37:15 +0000 (10:37 -0700)]
[NFC] Use [MC]Register in CSE & LICM
Differential Revision: https://reviews.llvm.org/D90327
Peter Collingbourne [Tue, 20 Oct 2020 21:36:34 +0000 (14:36 -0700)]
Reland "hwasan: Disable operator {new,delete} interceptors when interceptors are disabled."
There was a discrepancy in the gn build which is now fixed.
Differential Revision: https://reviews.llvm.org/D89827
Peter Collingbourne [Wed, 28 Oct 2020 22:41:44 +0000 (15:41 -0700)]
gn build: Define HWASAN_WITH_INTERCEPTORS=1 for hwasan_new_delete.cpp as well.
Duncan P. N. Exon Smith [Wed, 28 Oct 2020 22:39:14 +0000 (18:39 -0400)]
Fix includes in llvm/Support/FileSystem/UniqueID.h after
23ed570af1cc165afea1b70a533a4a39d6656501
Not sure why this worked for me, but some of the bots pointed out I
copied the wrong includes from FileSystem.h in
23ed570af1cc165afea1b70a533a4a39d6656501. Fixed.
Aaron Puchert [Wed, 28 Oct 2020 22:29:41 +0000 (23:29 +0100)]
[Sema] Let getters assert that trailing return type exists, NFCI
This was requested in the review of D90129.
Aaron Puchert [Wed, 28 Oct 2020 22:23:09 +0000 (23:23 +0100)]
Better source location for -Wignored-qualifiers on trailing return types
We collect the source location of a trailing return type in the parser,
improving the location for regular functions and providing a location
for lambdas, where previously there was none.
Fixes PR47732.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D90129
Keith Smiley [Wed, 28 Oct 2020 21:56:03 +0000 (14:56 -0700)]
[llvm-install-name-tool] Quote passed rpath args in error messages
This diff refactors error reporting to make it more clear
what arguments were passed to llvm-install-name-tool.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D90080
Craig Disselkoen [Wed, 28 Oct 2020 20:48:22 +0000 (16:48 -0400)]
C API: support scalable vectors
This adds support for scalable vector types in the C API and in
llvm-c-test, and also adds a test to ensure that llvm-c-test can properly
roundtrip operations involving scalable vectors.
While creating this diff, I discovered that the C API cannot properly roundtrip
_constant expressions_ involving shufflevector / scalable vectors, but that
seems to be a separate enough issue that I plan to address it in a future diff
(unless reviewers feel it should be addressed here).
Differential Revision: https://reviews.llvm.org/D89816
Kostya Kortchinsky [Mon, 26 Oct 2020 21:54:22 +0000 (14:54 -0700)]
[GWP-ASan] Abstract the thread local variables access
In a similar fashion to D87420 for Scudo, this CL introduces a way to
get thread local variables via a platform-specific reserved TLS slot,
since Fuchsia doesn't support ELF TLS from the libc itself.
If needing to use this, a platform will have to define
`GWP_ASAN_HAS_PLATFORM_TLS_SLOT` and provide `gwp_asan_platform_tls_slot.h`
which will define a `uint64_t *getPlatformGwpAsanTlsSlot()` function
that will return the TLS word of storage.
I snuck in a couple of cleanup items as well, moving some static
functions to anonymous namespace for consistency.
Differential Revision: https://reviews.llvm.org/D90195
Jay Foad [Tue, 27 Oct 2020 12:29:11 +0000 (12:29 +0000)]
[AMDGPU] Allow some modifiers on VOP3B instructions
V_DIV_SCALE_F32/F64 are VOP3B encoded so they can't use the ABS src
modifier, but they can still use NEG and the usual output modifiers.
This partially reverts
3b99f12a4e6f "AMDGPU: Remove modifiers from v_div_scale_*".
Differential Revision: https://reviews.llvm.org/D90296
Florian Hahn [Wed, 28 Oct 2020 21:49:33 +0000 (21:49 +0000)]
[InstCombine] Do not introduce bitcasts for swifterror arguments.
The following constraints hold for swifterror values:
A swifterror value (either the parameter or the alloca) can only
be loaded and stored from, or used as a swifterror argument.
This patch updates instcombine to not try to convert a bitcast of a
function into a bitcast of a swifterror argument.
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D90258
Jay Foad [Wed, 28 Oct 2020 16:00:59 +0000 (16:00 +0000)]
[AMDGPU] Fix double space in disassembly of SDWA instructions with vcc
Differential Revision: https://reviews.llvm.org/D90317
Jay Foad [Wed, 28 Oct 2020 16:12:21 +0000 (16:12 +0000)]
[TableGen] Treat reg as isolated in reg$foo (but not in ${foo}reg)
D9844 fixed a problem where the ss suffix in the AsmString "cmp${cc}ss"
was recognised as the X86 SS register, by only recognising a token as a
register name if it is "isolated", i.e. surrounded by separator
characters.
In the AMDGPU backend there are many operands like $clamp which expand
to an optional string " clamp" including the preceding space, so we want
to have AsmStrings including sequences like "vcc$clamp" where vcc is a
register name.
This patch relaxes the rules for an isolated token, to say that it's OK
if the token is immediately followed by a '$'.
Differential Revision: https://reviews.llvm.org/D90315
Florian Hahn [Wed, 28 Oct 2020 21:20:52 +0000 (21:20 +0000)]
[AArch64] Improve lowering of insert_vector_elt with 0.0 consts.
When moving +0.0 into a float vector, we can use to vi*gpr variants of
INS.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D90176
Austin Kerbow [Wed, 28 Oct 2020 19:22:23 +0000 (12:22 -0700)]
[AMDGPU] Fix inserting combined s_nop in bundles
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D90334
Philip Reames [Wed, 28 Oct 2020 21:29:03 +0000 (14:29 -0700)]
[Deref] Use maximum trip count instead of exact trip count
When trying to prove that a memory access touches only dereferenceable memory across all iterations of a loop, use the maximum exit count rather than an exact one. In many cases we can't prove exact exit counts whereas we can prove an upper bound.
The test included is for a single exit loop with a min(C,V) exit count, but the true motivation is support for multiple exits loops. It's just really hard to write a test case for multiple exits because the vectorizer (the primary user of this API), bails far before this. For multiple exits, this allows a mix of analyzeable and unanalyzable exits when only analyzeable exits are needed to prove deref.
Richard Smith [Wed, 28 Oct 2020 21:27:38 +0000 (14:27 -0700)]
PR48002: Fix injection of elaborated-type-specifiers within local
classes into the enclosing block scope.
We weren't properly detecting whether the name would be injected into a
block scope in the case where it was lexically declared in a local
class.
Sean Silva [Mon, 26 Oct 2020 23:46:54 +0000 (16:46 -0700)]
[mlir] Properly handle recursive bufferization for scf.for/scf.if
This fixes a subtle issue, described in the comment starting with
"Clone the op without the regions and inline the regions from the old op",
which prevented this conversion from working on non-trivial examples.
Differential Revision: https://reviews.llvm.org/D90203
Michael Park [Mon, 26 Oct 2020 16:34:22 +0000 (12:34 -0400)]
[libc++] Re-apply the switch-based std::variant implementation
This commit is a mass re-application of the following commits:
7d15ece79c16dc3237fc514ff56a69e3d58fbd39
e0ec7a02064968c7df11713689107148b4efb993
02197f7e50b938f8167b17b89bdf7c55feff4339
a175a96517c5d9dc05ba13a6481b1b031a53a22f
Those were temporarily reverted in
057028ed391f8, and never re-applied.
Re-committed by @ldionne (author edited for credit).
Differential Revision: https://reviews.llvm.org/D90168
Louis Dionne [Thu, 22 Oct 2020 20:34:19 +0000 (16:34 -0400)]
[llvm-lit] Improve the error message when make_paths_relative() fails
Previously, if make_paths_relative() failed due to some reason, it would
happily keep going and set the ${out_pathlist} to the standard output
of the command, which would be the empty string if the command failed.
This can lead to issues that are difficult to diagnose, since the calling
code will usually try to keep going with a variable that was set to the
empty string.
Differential Revision: https://reviews.llvm.org/D89985
LLVM GN Syncbot [Wed, 28 Oct 2020 20:46:36 +0000 (20:46 +0000)]
[gn build] Port
23ed570af1c
Alexander Belyaev [Wed, 28 Oct 2020 20:40:17 +0000 (21:40 +0100)]
[mlir] Use OpBuilderDAG for MemRefReinterpretCastOp.
Duncan P. N. Exon Smith [Fri, 16 Oct 2020 20:37:14 +0000 (16:37 -0400)]
Split out llvm/Support/FileSystem/UniqueID.h and clang/Basic/FileEntry.h, NFC
Split `FileEntry` and `FileEntryRef` out into a new file
`clang/Basic/FileEntry.h`. This allows current users of a
forward-declared `FileEntry` to transition to `FileEntryRef` without
adding more includers of `FileManager.h`.
Also split `UniqueID` out to llvm/Support/FileSystem/UniqueID.h, so
`FileEntry.h` doesn't need to include all of `FileSystem.h` for just
that type.
Differential Revision: https://reviews.llvm.org/D89761
Dávid Bolvanský [Wed, 28 Oct 2020 20:23:13 +0000 (21:23 +0100)]
[MemLoc] Adjust memccpy support in MemoryLocation::getForArgument
Use LocationSize::upperBound instead of precise since we only know an upper bound on the number of bytes read/written.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D89885
Alexander Belyaev [Wed, 28 Oct 2020 20:08:58 +0000 (21:08 +0100)]
[mlir] Convert memref_reshape to memref_reinterpret_cast.
Differential Revision: https://reviews.llvm.org/D90235
Adrian Prantl [Wed, 28 Oct 2020 19:26:44 +0000 (12:26 -0700)]
[DebugInfo] Expose Fortran array debug info attributes through DIBuilder.
The support of a few debug info attributes specifically for Fortran
arrays have been added to LLVM recently, but there's no way to take
advantage of them through DIBuilder. This patch extends
DIBuilder::createArrayType to enable the settings of those attributes.
Patch by Chih-Ping Chen!
Differential Review: https://reviews.llvm.org/D90323
Alok Kumar Sharma [Wed, 28 Oct 2020 14:24:39 +0000 (19:54 +0530)]
[DebugInfo] Support for DW_TAG_generic_subrange
This is needed to support fortran assumed rank arrays which
have runtime rank.
Summary:
Fortran assumed rank arrays have dynamic rank. DWARF TAG
DW_TAG_generic_subrange is needed to support that.
Testing:
unit test cases added (hand-written)
check llvm
check debug-info
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D89218
Arthur Eubanks [Tue, 27 Oct 2020 22:47:59 +0000 (15:47 -0700)]
[test] Make bt_order_by_weight in switch.ll more robust
Branch weights are not represented internally linearly with the value in
the IR. In its current state the test happened to pass, but the branch
weights for 0,3,6 and 2,5,8,9 were not actually equal.
$ opt -passes='print<branch-prob>'
shows that the sum of the branch probabilities going to bb0 and bb2 were not the same.
Printing analysis results of BPI for function 'bt_order_by_weight':
---- Branch Probabilities ----
edge entry -> bb0 probability is 0x00000003 / 0x80000000 = 0.00%
edge entry -> bb2 probability is 0x00000004 / 0x80000000 = 0.00%
with this change:
Printing analysis results of BPI for function 'bt_order_by_weight':
---- Branch Probabilities ----
edge entry -> bb0 probability is 0x00000004 / 0x80000000 = 0.00%
edge entry -> bb2 probability is 0x00000004 / 0x80000000 = 0.00%
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D90273
Shilei Tian [Wed, 28 Oct 2020 19:53:20 +0000 (15:53 -0400)]
[Clang][OpenMP] Added the support for target data nowait
Previously we added support for target nowait, but target data nowait
has not been supported yet. In this patch, target data nowait will also be
wrapped into a task.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D90099
Florian Hahn [Wed, 28 Oct 2020 19:48:20 +0000 (19:48 +0000)]
[AArch64] Use DUP for BUILD_VECTOR with few different elements.
If most elements of BUILD_VECTOR are the same, with a few different
elements, it is better to use DUP for the common elements and
INSERT_VECTOR_ELT for the different elements.
Currently this transform is guarded quite restrictively to only trigger
in clearly beneficial cases.
With D90176, the lowering for patterns originating from code like
` float32x4_t y = {a,a,a,0};` (common in 3D apps) are lowered even
better (unnecessary fmov is removed).
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D90233
YAMAMOTO Takashi [Wed, 28 Oct 2020 19:40:16 +0000 (15:40 -0400)]
[libc++] Fix a few warnings
Found during a NuttX porting effort.
But these changes are not directly relevant to NuttX.
Differential Revision: https://reviews.llvm.org/D90139
Mircea Trofin [Wed, 28 Oct 2020 19:08:26 +0000 (12:08 -0700)]
[NFC][ThinLTO] Change command line passing to EmbedBitcodeInModule
Changing to pass by ref - less null checks to worry about.
Differential Revision: https://reviews.llvm.org/D90330
Aditya Nandakumar [Wed, 28 Oct 2020 19:13:35 +0000 (12:13 -0700)]
[GISel]: Few InsertVecElt combines
https://reviews.llvm.org/D88060
This adds the following combines
1) build_vector formation from insert_vec_elts
2) insert_vec_elts (build_vector) -> build_vector
Louis Dionne [Wed, 28 Oct 2020 19:04:39 +0000 (15:04 -0400)]
[libc++] Refactor tests to remove uses of std::rand()
This allows running these tests on systems that do not support std::rand().
Sam McCall [Mon, 12 Oct 2020 14:07:15 +0000 (16:07 +0200)]
[clangd] Go-to-definition from non-renaming alias is unambiguous.
It's not helpful to show the alias itself as an option.
This fixes a regression accepted in
f24649b77d856157c64841457dcc4f70530d607c.
Differential Revision: https://reviews.llvm.org/D89238
Mircea Trofin [Tue, 27 Oct 2020 21:30:18 +0000 (14:30 -0700)]
[NFC] Use Register in RegisterPressure APIs
Some related changes as well.
Differential Revision: https://reviews.llvm.org/D90268
Valentin Clement [Wed, 28 Oct 2020 19:11:47 +0000 (15:11 -0400)]
[openmp][openacc] Check for duplicate clauses for directive
Check for duplicate clauses associated with directive. Clauses can appear only once
in the 4 lists associated with each directive (allowedClauses, allowedOnceClauses,
allowedExclusiveClauses, requiredClauses). Duplicates were already present (removed with this
patch) or were introduce in new patches by mistake (D89861).
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D90241
Anton Afanasyev [Wed, 28 Oct 2020 19:07:43 +0000 (22:07 +0300)]
[SLP][Test] Precommit test case for PR47629. NFC.
Vedant Kumar [Wed, 28 Oct 2020 18:50:52 +0000 (11:50 -0700)]
[lldb] Delete lldb/utils/test
These utilities aren't useful any more -- delete them as a cleanup.
Discussion:
http://lists.llvm.org/pipermail/lldb-dev/2020-October/016536.html
Vedant Kumar [Wed, 21 Oct 2020 16:22:13 +0000 (09:22 -0700)]
[DebugInfo] Shorten legacy [s|z]ext dwarf expressions
Take advantage of the emitConstu helper to emit slightly shorter dwarf
expressions to implement legacy [s|z]ext operations.
Vedant Kumar [Wed, 21 Oct 2020 00:08:07 +0000 (17:08 -0700)]
[DebugInfo] Fix legacy ZExt emission when FromBits >= 64 (PR47927)
Fix an out-of-bounds shift in emitLegacyZExt by using a slightly more
complicated dwarf expression to create the zext mask.
This addresses a UBSan diagnostic seen when compiling compiler-rt
(llvm.org/PR47927).
rdar://
70307714
Differential Revision: https://reviews.llvm.org/D89838
Kazuaki Ishizaki [Wed, 28 Oct 2020 19:03:15 +0000 (04:03 +0900)]
[mlir] NFC: fix trivial typos
fix typos in comments and documents
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D90089
Vitaly Buka [Wed, 28 Oct 2020 18:39:01 +0000 (11:39 -0700)]
[NFC][TSAN] Logs to debug test script on bot
Sanjay Patel [Wed, 28 Oct 2020 18:31:13 +0000 (14:31 -0400)]
[CostModel][x86] remove cost-kind predicate for intrinsic costs
We model cost as number of instructions / uops, so it does not
make sense to treat size/blended costs any differently than
throughput.
Nick Desaulniers [Wed, 28 Oct 2020 18:13:14 +0000 (11:13 -0700)]
[clang][ToolChains] explicitly return LangOptions::StackProtectorMode
Make the virtual method Toolchain::GetDefaultStackProtectorLevel()
return an explict enum value rather than an integral constant. This
makes the code subjectively easier to read, and should help prevent bugs
that may (or may never) arise from changing the enum values. Previously,
these were just kept in sync via a comment, which is brittle. The trade
off is including a additional header in a few new places. It is not
necessary, but in my opinion helps the readability.
Split off from https://reviews.llvm.org/D90194 to help cut down on lines
changed in code review.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D90271
Baptiste Saleil [Wed, 28 Oct 2020 18:14:48 +0000 (13:14 -0500)]
[Clang][PowerPC] Add __vector_pair and __vector_quad types
Define the __vector_pair and __vector_quad types that are used to manipulate
the new accumulator registers introduced by MMA on PowerPC. Because these two
types are specific to PowerPC, they are defined in a separate new file so it
will be easier to add other PowerPC specific types if we need to in the future.
Differential Revision: https://reviews.llvm.org/D81508
Sanjay Patel [Wed, 28 Oct 2020 17:23:22 +0000 (13:23 -0400)]
[CostModel] remove cost-kind predicate for funnel shift costs
Completing the series of FIXME removals for special-case intrinsics:
50dfa19cc799
f2c25c70791d
c963bde0152a
01ea93d85d6e
This one looks quite different than the others. The size/blended
cost is still potentially very far off from the throughput cost,
but this is hopefully not worse on the whole. It looks like the
underlying costs for the expanded shift/logic have their own
cost-kind limitations. Also, we are not asking the target if
it has a legal funnel shift op, so we just assume that the
intrinsic gets expanded.