Roman Lebedev [Tue, 14 Jul 2020 07:41:51 +0000 (10:41 +0300)]
[NFCI][InstCombine] Move store merging from `visitStoreInst()` into `visitUnconditionalBranchInst()`
Summary:
As @nikic is pointing out in https://bugs.llvm.org/show_bug.cgi?id=46680#c5,
InstCombine should not have forward instruction scans,
so let's move this transform into the proper place.
This is pretty much NFCI.
Reviewers: nikic, spatel
Reviewed By: nikic
Subscribers: hiraditya, llvm-commits, nikic
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83670
David Sherwood [Thu, 9 Jul 2020 09:16:32 +0000 (10:16 +0100)]
[SVE][CodeGen] Add README for SVE-related warnings in tests
I have added a new file:
llvm/test/CodeGen/AArch64/README
that describes what to do in the event one of the SVE codegen tests
fails the warnings check. In addition, I've added comments to all
the relevant SVE tests pointing users at the README file.
Differential Revision: https://reviews.llvm.org/D83467
Kirill Bobyrev [Tue, 14 Jul 2020 07:28:38 +0000 (09:28 +0200)]
[clangd] Implement textDocument/foldingRange
Summary:
This patch introduces basic textDocument/foldingRange support. It relies on
textDocument/documentSymbols to collect all symbols and uses takes ranges
to create folds.
The next steps for textDocument/foldingRange support would be:
* Implementing FoldingRangeClientCapabilities and respecting respect client
preferences
* Specifying folding range kind
* Migrating from DocumentSymbol implementation to custom RecursiveASTVisitor flow that will allow more flexibility
* Supporting more folding range types: comments, PP conditional regions, includes and other code regions (e.g. public/private/protected sections of classes, control flow statement bodies)
Tested: (Neo)Vim (coc-clangd) and VSCode.
Related issue: https://github.com/clangd/clangd/issues/310
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: nridge, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82436
David Sherwood [Wed, 8 Jul 2020 07:47:06 +0000 (08:47 +0100)]
[SVE] Fix implicit TypeSize->uint64_t conversion getCastInstrCost
In getCastInstrCost() when comparing different sizes for src and
dst types we should be using the TypeSize comparison operators
instead of relying upon TypeSize being converted a uin64_t.
Previously this meant we were dropping the scalable property and
treating fixed and scalable vector types the same.
Differential Revision: https://reviews.llvm.org/D83461
David Sherwood [Fri, 10 Jul 2020 16:22:10 +0000 (17:22 +0100)]
[SVE][CodeGen] Fix implicit TypeSize->uint64_t conversion in TransformFPLoadStorePair
In DAGCombiner::TransformFPLoadStorePair we were dropping the scalable
property of TypeSize when trying to create an integer type of equivalent
size. In fact, this optimisation makes no sense for scalable types
since we don't know the size at compile time. I have changed the code
to bail out when encountering scalable type sizes.
I've added a test to
llvm/test/CodeGen/AArch64/sve-fp.ll
that exercises this code path. The test already emits an error if it
encounters warnings due to implicit TypeSize->uint64_t conversions.
Differential Revision: https://reviews.llvm.org/D83572
Carl Ritson [Tue, 14 Jul 2020 06:31:10 +0000 (15:31 +0900)]
[AMDGPU][NFC] Tidy sgpr-control-flow.ll whitespace
Pre-commit clean up for D83641.
Djordje Todorovic [Tue, 14 Jul 2020 06:49:01 +0000 (08:49 +0200)]
[deadargelim] Attach dbg info to the insert/extractvalue instructions
Attach DbgLoc on insertvalue/extractvalue instructions created by
DeadArgumentElimination.
This fixes the PR46350.
Differential Revision: https://reviews.llvm.org/D81939
Carl Ritson [Tue, 14 Jul 2020 03:22:46 +0000 (12:22 +0900)]
[AMDGPU] Propagate dead flag during pre-RA exec mask optimizations
Preserve SCC dead flags in SIOptimizeExecMaskingPreRA.
This helps with removing redundant s_andn2 instructions later.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D83637
Amy Kwan [Mon, 13 Jul 2020 22:37:02 +0000 (17:37 -0500)]
[PowerPC][Power10] Implement Test LSB by Byte Builtins in LLVM/Clang
This patch implements builtins for the Test LSB by Byte instruction introduced
in Power10.
Differential Revision: https://reviews.llvm.org/D82431
Amara Emerson [Wed, 17 Jun 2020 18:55:53 +0000 (11:55 -0700)]
[AArch64][GlobalISel] Add post-legalize combine for sext_inreg(trunc(sextload)) -> copy
On AArch64 we generate redundant G_SEXTs or G_SEXT_INREGs because of this.
Differential Revision: https://reviews.llvm.org/D81993
Xing GUO [Tue, 14 Jul 2020 02:55:34 +0000 (10:55 +0800)]
[DWARFYAML] Replace Is64bit with Is64BitAddrSize. NFC.
Is64bit is ambiguous. In this patch, we replace it with Is64BitAddrSize
to make it clearer.
Kai Luo [Mon, 13 Jul 2020 04:55:28 +0000 (04:55 +0000)]
[PowerPC] Generate CFI directives when probing in prologue
Add missing CFI directives when probing in prologue if
`stack-clash-protection` is enabled.
Differential Revision: https://reviews.llvm.org/D83276
Valentin Clement [Tue, 14 Jul 2020 02:35:19 +0000 (22:35 -0400)]
Revert "[flang][openacc] OpenACC 3.0 parser"
This reverts commit
65049d16100af360674659fb56e8f9bec96a0836.
Buildbot failure clang-ppc64le-rhel
Valentin Clement [Tue, 14 Jul 2020 02:22:47 +0000 (22:22 -0400)]
Add LINK_COMPONENTS Support
Jameson Nash [Wed, 6 Nov 2019 17:01:57 +0000 (12:01 -0500)]
[GVN] teach ConstantFolding correct handling of non-integral addrspace casts
Here we teach the ConstantFolding analysis pass that it is not legal to
replace a load of a bitcast constant (having a non-integral addrspace)
with a bitcast of the value of that constant (with a different
non-integral addrspace).
But also teach it that certain bit patterns are always known and
convertable (a fact it already uses elsewhere). This required us to also
fix a globalopt test, since, after this change, LLVM is able to realize
that the test actually is a valid transform (NULL is always a known
bit-pattern) and so it doesn't need to emit the failure remarks for it.
Also simplify some of the negative tests for transforms by avoiding a
type change in their bitcast, and add positive versions of the same
tests, to show that they otherwise should work.
Differential Revision: https://reviews.llvm.org/D59730
Jameson Nash [Wed, 6 Nov 2019 17:00:36 +0000 (12:00 -0500)]
[VNCoercion] avoid creating bitcast for zero offsets [NFCI]
This could previously make it more complicated for ConstantFolding
later, leading to a higher likelyhood it would have to reject the
expression, even though zero seems like probably the common case here.
Differential Revision: https://reviews.llvm.org/D59730
Jameson Nash [Wed, 6 Nov 2019 16:47:40 +0000 (11:47 -0500)]
[GVN] add early exit to ConstantFoldLoadThroughBitcast [NFC]
And adds some additional test coverage to ensure later commits don't
introduce regressions.
Differential Revision: https://reviews.llvm.org/D59730
zuojian lin [Tue, 14 Jul 2020 01:28:00 +0000 (18:28 -0700)]
Fix undefined behavior in DWARF emission
Caused by uninitialized load of llvm::DwarfDebug::PrevCU:
llvm::DwarfCompileUnit::addRange () at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:276
llvm::DwarfDebug::endFunctionImpl () at ../lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1586
llvm::DebugHandlerBase::endFunction () at ../lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp:319
llvm::AsmPrinter::EmitFunctionBody () at ../lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1230
llvm::ARMAsmPrinter::runOnMachineFunction () at ../lib/Target/ARM/ARMAsmPrinter.cpp:161
Most of the DebugInfo tests under `LLVM_LIT_ARGS:STRING=-sv --vg` prior to this fix, and pass with the fix applied.
Reviewed By: aprantl, dblaikie
Differential Revision: https://reviews.llvm.org/D81631
Walter Erquinigo [Tue, 14 Jul 2020 01:26:41 +0000 (18:26 -0700)]
[lldb-vscode] Fix TestVSCode_setBreakpoints
It was failing because some module events had empty UUID, and that was not handled correctly.
The diff that added that logic is https://reviews.llvm.org/D82477
clementval [Tue, 14 Jul 2020 01:06:22 +0000 (21:06 -0400)]
[flang][openacc] Add Support library for error handling
Walter Erquinigo [Tue, 14 Jul 2020 00:55:24 +0000 (17:55 -0700)]
[lldb-vscode] Fix TestVSCode_module
This test was added in https://reviews.llvm.org/D82477 and needs to wait a little bit before fetching some information.
Valentin Clement [Tue, 14 Jul 2020 00:11:52 +0000 (20:11 -0400)]
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
Gui Andrade [Tue, 30 Jun 2020 22:34:43 +0000 (22:34 +0000)]
[MSAN] Implement experimental vector reduction intrinsics
Implement llvm.experimental.vector.{add,mul,or,and,...}.
An IR test is included but no C test for lack of good way to
get the compiler to emit these.
Differential Revision: https://reviews.llvm.org/D82920
Mircea Trofin [Mon, 13 Jul 2020 23:58:16 +0000 (16:58 -0700)]
[llvm][NFC] Removed unused CHECKs in a ml test
The CHECKs are now in Inputs/test-module.ll
Richard Smith [Mon, 13 Jul 2020 23:54:39 +0000 (16:54 -0700)]
Basic support for flexible array members in constant evaluation.
We don't allow runtime-sized flexible array members, nor initialization
of flexible array members, but it seems reasonable to support the most
basic case where the flexible array member is empty.
Fangrui Song [Mon, 13 Jul 2020 23:57:06 +0000 (16:57 -0700)]
[PowerPC] Fix combineVectorShuffle regression after D77448
Commit
1fed131660b2 assumed that NewShuffle (shuffle vector
canonicalization result) will always be ShuffleVectorSDNode, which may
be false (it may be a BITCAST node):
```
...
t12: v4i32 = scalar_to_vector t2
t15: v16i8 = bitcast t12 # LHS
t17: v16i8 = vector_shuffle<u,u,u,u,u,u,u,u,0,1,2,3,u,u,u,u> t15, undef:v16i8 # SVN
```
Reviewed By: #powerpc, nemanjai
Differential Revision: https://reviews.llvm.org/D83617
Ryan Prichard [Fri, 19 Jun 2020 06:47:18 +0000 (23:47 -0700)]
[builtins][ARM] Replace call_apsr.S with inline asm
The %arm_call_apsr expansion doesn't work when config.clang is a clang
driver defaulting to a non-ARM arch. Rather than fix it, replace
call_apsr.S with inline asm in call_apsr.h, which also resolves the
FIXME added in D31259.
Maybe the `__attribute__((noinline,pcs("aapcs")))` attributes are
unnecessary on the static functions, but I was unsure what liberty the
compiler had to insert instructions that modified the condition codes,
so it seemed helpful.
Differential Revision: https://reviews.llvm.org/D82147
Ryan Prichard [Fri, 19 Jun 2020 06:53:49 +0000 (23:53 -0700)]
[compiler-rt][Android] Stop using detect_target_arch
For Android only, compiler-rt used detect_target_arch to select the
architecture to target. detect_target_arch was added in Sept 2014
(SVN r218605). At that time, compiler-rt selected the default arch
using ${LLVM_NATIVE_ARCH}, which seems to have been the host
architecture and therefore not suitable for cross-compilation.
The compiler-rt build system was refactored in Sept 2015 (SVN r247094
and SVN r247099) to use COMPILER_RT_DEFAULT_TARGET_TRIPLE to control
the target arch rather than LLVM_NATIVE_ARCH. This approach is simpler
and also works for Android cross-compilation, so remove the
detect_target_arch function.
Android targets i686, but compiler-rt seems to identify 32-bit x86 as
"i386". For Android, we were previously calling add_default_target_arch
with i386, and calling add_default_target_arch with i686 does not build
anything. i686 is not listed in builtin-config-ix.cmake,
ALL_BUILTIN_SUPPORTED_ARCH.
Differential Revision: https://reviews.llvm.org/D82148
Ryan Prichard [Fri, 19 Jun 2020 06:59:36 +0000 (23:59 -0700)]
[builtins] Cleanup generic-file filtering
Split filter_builtin_sources into two functions:
- filter_builtin_sources that removes generic files when an
arch-specific file is selected.
- darwin_filter_builtin_sources that implements the EXCLUDE/INCLUDE
lists (using the files in lib/builtins/Darwin-excludes).
darwin_filter_builtin_sources delegates to filter_builtin_sources.
Previously, lib/builtins/CMakeLists.txt had a number of calls to
filter_builtin_sources (with a confusing/broken use of the
`excluded_list` parameter), as well as a redundant arch-vs-generic
filtering for the non-Apple code path at the end of the file. Replace
all of this with a single call to filter_builtin_sources.
Remove i686_SOURCES. Previously, this list contained only the
arch-specific files common to 32-bit and 64-bit x86, which is a strange
set. Normally the ${ARCH}_SOURCES list contains everything needed for
the arch. "i686" isn't in ALL_BUILTIN_SUPPORTED_ARCH.
NFCI, but i686_SOURCES won't be defined, and the order of files in
${arch}_SOURCES lists will change.
Differential Revision: https://reviews.llvm.org/D82151
Ryan Prichard [Fri, 19 Jun 2020 07:00:24 +0000 (00:00 -0700)]
[builtins][Android] Define HAS_80_BIT_LONG_DOUBLE to 0
Android 32-bit x86 uses a 64-bit long double.
Android 64-bit x86 uses a 128-bit quad-precision long double.
Differential Revision: https://reviews.llvm.org/D82152
LLVM GN Syncbot [Mon, 13 Jul 2020 23:39:28 +0000 (23:39 +0000)]
[gn build] Port
caf395ee8c2
Stephen Hines [Mon, 13 Jul 2020 23:35:54 +0000 (16:35 -0700)]
Fix a missing update that C compiles default to gnu17.
https://reviews.llvm.org/D75383 switched the C default to gnu17, but
missed this instance.
Differential Revision: https://reviews.llvm.org/D83726
Gui Andrade [Tue, 9 Jun 2020 16:54:02 +0000 (16:54 +0000)]
MemorySanitizer: If a field is marked noundef, check init at call site
Adds LLVM option to control eager checking under -msan-eager-checks.
This change depends on the noundef keyword to determining cases where it
it sound to check these shadows, and falls back to passing shadows
values by TLS.
Checking at call boundaries enforces undefined behavior rules with
passing uninitialized arguments by value.
Differential Revision: https://reviews.llvm.org/D81699
Mircea Trofin [Mon, 13 Jul 2020 23:29:19 +0000 (16:29 -0700)]
[llvm][NFC] ML InlineAdvisor: Factored CHECKs in common test
The CHECKs are going to be shared with the development mode test
Mircea Trofin [Mon, 13 Jul 2020 21:12:32 +0000 (14:12 -0700)]
Reapply "[llvm] Native size estimator for training -Oz inliner"
This reverts commit
9908a3b9f521c954cbf6adcec35b14b2f6c8da49.
The fix was to exclude the content of TFUtils.h (automatically
included in the LLVM_Analysis module, when LLVM_ENABLE_MODULES is enabled).
Differential Revision: https://reviews.llvm.org/D82817
Lang Hames [Mon, 13 Jul 2020 23:10:45 +0000 (16:10 -0700)]
[ORC] Fix typo in parameter name.
Gui Andrade [Mon, 13 Jul 2020 23:17:58 +0000 (23:17 +0000)]
[Sanitizers] Ensure clock_getcpuclockid interceptor <= 80 chars
Tyker [Mon, 13 Jul 2020 22:52:37 +0000 (00:52 +0200)]
[AssumeBundles] Use operand bundles to encode alignment assumptions
Summary:
NOTE: There is a mailing list discussion on this: http://lists.llvm.org/pipermail/llvm-dev/2019-December/137632.html
Complemantary to the assumption outliner prototype in D71692, this patch
shows how we could simplify the code emitted for an alignemnt
assumption. The generated code is smaller, less fragile, and it makes it
easier to recognize the additional use as a "assumption use".
As mentioned in D71692 and on the mailing list, we could adopt this
scheme, and similar schemes for other patterns, without adopting the
assumption outlining.
Reviewers: hfinkel, xbolva00, lebedev.ri, nikic, rjmccall, spatel, jdoerfert, sstefan1
Reviewed By: jdoerfert
Subscribers: thopre, yamauchi, kuter, fhahn, merge_guards_bot, hiraditya, bollu, rkruppe, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D71739
Eric Christopher [Mon, 13 Jul 2020 23:03:10 +0000 (16:03 -0700)]
Fold the opt size check into the assert to silence an unused variable warning.
Kiran Chandramohan [Mon, 13 Jul 2020 22:13:04 +0000 (23:13 +0100)]
Lowering of OpenMP Parallel operation to LLVM IR 1/n
This patch introduces lowering of the OpenMP parallel operation to LLVM
IR using the OpenMPIRBuilder.
Functions topologicalSort and connectPhiNodes are generalised so that
they work with operations also. connectPhiNodes is also made static.
Lowering works for a parallel region with multiple blocks. Clauses and
arguments of the OpenMP operation are not handled.
Reviewed By: rriddle, anchu-rajendran
Differential Revision: https://reviews.llvm.org/D81660
Vedant Kumar [Mon, 13 Jul 2020 22:40:05 +0000 (15:40 -0700)]
Update ubsan_interface.inc for D71491
This should address the bot failure here:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/66309/
Dokyung Song [Mon, 13 Jul 2020 21:56:02 +0000 (21:56 +0000)]
[compiler-rt] Fix compiler warnings and runtime errors in sanitizer RT strxfrm(_l) test cases.
Summary: Fixed an implicit definition warning by including <string.h>. Also fixed run-time assertions that the return value of strxfrm_l calls is less than the buffer size by increasing the size of the referenced buffer.
Reviewers: morehouse
Reviewed By: morehouse
Subscribers: dberris, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D83593
Gui Andrade [Tue, 7 Jul 2020 21:21:13 +0000 (21:21 +0000)]
[InstCombine] Erase attribute lists for simplified libcalls
Currently, a transformation like pow(2.0, x) -> exp2(x) copies the pow
attribute list verbatim and applies it to exp2. This works out fine
when the attribute list is empty, but when it isn't clang may error due
due to the mismatch.
The source function and destination don't necessarily have anything
to do with one another, attribute-wise. So it makes sense to remove
the attribute lists (this is similar to what IPO does in this
situation).
This was discovered after implementing the `noundef` param attribute.
Differential Revision: https://reviews.llvm.org/D82820
Vedant Kumar [Mon, 13 Jul 2020 22:17:03 +0000 (15:17 -0700)]
Revert "[InstCombine] Drop debug loc in TryToSinkInstruction (reland)"
This reverts commit
9649c2095f07a392bc2b2a93b5bd6c4c9bf5ba34. See
discussion on the llvm-commits thread: if it's OK to preserve the
location when sinking a call, it's probably OK to always preserve the
location.
Vedant Kumar [Mon, 13 Jul 2020 22:15:34 +0000 (15:15 -0700)]
Check output in test/CodeGen/Generic/MIRStripDebug/no-metadata-present.mir, NFC
Jinsong Ji [Mon, 13 Jul 2020 21:19:18 +0000 (21:19 +0000)]
[compiler-rt][MSAN][test] Update buffersize for UTF-8 to C convert
This is exposed by https://reviews.llvm.org/D83486.
When the host is UTF8, we may get n >10, causing assert failure.
Increase the buffersize to support UTF-8 to C conversion.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D83719
Gui Andrade [Mon, 29 Jun 2020 23:56:01 +0000 (23:56 +0000)]
[Sanitizers] Implement getcpuclockid interceptor
Differential Revision: https://reviews.llvm.org/D83000
Vedant Kumar [Fri, 13 Dec 2019 20:59:40 +0000 (12:59 -0800)]
[ubsan] Check implicit casts in ObjC for-in statements
Check that the implicit cast from `id` used to construct the element
variable in an ObjC for-in statement is valid.
This check is included as part of a new `objc-cast` sanitizer, outside
of the main 'undefined' group, as (IIUC) the behavior it's checking for
is not technically UB.
The check can be extended to cover other kinds of invalid casts in ObjC.
Partially addresses: rdar://
12903059, rdar://9542496
Differential Revision: https://reviews.llvm.org/D71491
Benjamin Kramer [Mon, 13 Jul 2020 21:50:00 +0000 (23:50 +0200)]
[analyzer] Inline StringSet that's defined in a header
That's just asking for ODR violations. Also drop a call to lower()
that's not needed.
Vedant Kumar [Mon, 13 Jul 2020 21:38:31 +0000 (14:38 -0700)]
[debugify] Add targeted test for 2fa656c, NFC
https://reviews.llvm.org/D78411 introduced test changes which relied on
the ability to strip debugify metadata even if module-level metadata is
missing. This introduces a more targeted test for that ability.
Quentin Colombet [Mon, 13 Jul 2020 21:37:21 +0000 (14:37 -0700)]
[MC/AsmParser] layout-interdependency.s depends on having a proper triple
Fix the requirements for that test.
NFC
Nicolas Vasilache [Mon, 13 Jul 2020 15:04:09 +0000 (11:04 -0400)]
[mlir] Add alignment attribute to LLVM memory ops and use in vector.transfer
Summary: The native alignment may generally not be used when lowering a vector.transfer to the underlying load/store operation. This revision fixes the unmasked load/store alignment to match that of the masked path.
Differential Revision: https://reviews.llvm.org/D83684
Nikita Popov [Fri, 19 Jun 2020 18:25:33 +0000 (20:25 +0200)]
[ADT] Specialize std::swap() for SetVector
This is intended to address a compile-time regression from
1eddce4177cfddc86d4696b758904443b0b4f193. A SmallPtrSet was
replaced with a SetVector there, which had an unexpected large
compile-time impact. It turns out that this structure is getting
swapped a lot, and previously this used an optimized std::swap()
specialization for SmallPtrSet. Now it ends up using the default,
triple-move based implementation, which is much more expensive.
This patch (partly) addresses the issue by specializing std::swap()
for SetVector.
Differential Revision: https://reviews.llvm.org/D82230
Walter Erquinigo [Mon, 13 Jul 2020 19:10:49 +0000 (12:10 -0700)]
Retry ""[lldb-vscode] Fix TestVSCode_module""
Original commit
c60216db15132401ff60c08ccef899321f63b6b6.
The test can only run on Darwin because of how it was setup, so I'm
enforcing that.
Summary:
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Jonas Devlieghere [Mon, 13 Jul 2020 20:44:01 +0000 (13:44 -0700)]
[lldb] Remove unused argument (NFC)
Nobody is writing to the stream so there's no point in passing it
around.
Rahul Joshi [Mon, 13 Jul 2020 18:20:27 +0000 (11:20 -0700)]
[MLIR] Change ODS collective params build method to provide an empty default value for named attributes
- Provide default value for `ArrayRef<NamedAttribute> attributes` parameter of
the collective params build method.
- Change the `genSeparateArgParamBuilder` function to not generate build methods
that may be ambiguous with the new collective params build method.
- This change should help eliminate passing empty NamedAttribue ArrayRef when the
collective params build method is used
- Extend op-decl.td unit test to make sure the ambiguous build methods are not
generated.
Differential Revision: https://reviews.llvm.org/D83517
AlexisPerry [Mon, 13 Jul 2020 16:32:12 +0000 (10:32 -0600)]
[flang] Extended the flang driver options to include gfortran equivalents to pgf90 specific options.
Summary: Added gfortran equivalents of pgf90's -Mfixed, -Mfree, -Mextend, -Mstandard, -Munlimited and also added -fdefault-double-8
Reviewers: sscalpone, richard.barton.arm, DavidTruby, clementval, jdoerfert
Reviewed By: sscalpone, richard.barton.arm
Subscribers: sstefan1, llvm-commits, flang-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83687
Thomas Raoux [Mon, 13 Jul 2020 20:24:27 +0000 (13:24 -0700)]
[mlir] Support operations with multiple results in slicing
Right now slicing would assert if an operation with multiple results is in the
slice.
Differential Revision: https://reviews.llvm.org/D83627
LLVM GN Syncbot [Mon, 13 Jul 2020 20:18:59 +0000 (20:18 +0000)]
[gn build] Port
9908a3b9f52
Lei Zhang [Sun, 12 Jul 2020 17:03:23 +0000 (13:03 -0400)]
[mlir][StandardToSPIRV] Fix conversion for signed remainder
Per the Vulkan's SPIR-V environment spec, "for the OpSRem and OpSMod
instructions, if either operand is negative the result is undefined."
So we cannot directly use spv.SRem/spv.SMod if either operand can be
negative. Emulate it via spv.UMod.
Because the emulation uses spv.SNegate, this commit also defines
spv.SNegate.
Differential Revision: https://reviews.llvm.org/D83679
Davide Italiano [Mon, 13 Jul 2020 19:59:16 +0000 (12:59 -0700)]
Revert "[llvm] Native size estimator for training -Oz inliner"
This reverts commit
83080a294ad7d145d758821bcf4354ad0cb7d299 as
it breaks the macOS modules build.
Adrian Prantl [Mon, 13 Jul 2020 20:09:53 +0000 (13:09 -0700)]
Add a decorator to skip tests when running under Rosetta
This allows skipping a test when running the testsuite on macOS under
the Rosetta translation layer.
Differential Revision: https://reviews.llvm.org/D83600
Martin Storsjö [Mon, 13 Jul 2020 19:47:31 +0000 (22:47 +0300)]
[lldb] Fix a CMake warning typo. NFC.
Lang Hames [Mon, 13 Jul 2020 19:37:18 +0000 (12:37 -0700)]
[ORC] Remove a spurious reinterpret_cast.
Mircea Trofin [Mon, 13 Jul 2020 19:14:21 +0000 (12:14 -0700)]
[llvm][NFC] Factored the default inlining advice
This is in preparation for the 'development' mode advisor. We currently
want to track what the default policy's decision would have been, this
refactoring makes it easier to do that.
Tim Keith [Mon, 13 Jul 2020 19:19:17 +0000 (12:19 -0700)]
[flang] Use octal escapes for character literals in modfiles
Character literals can be formatted using octal or hex escapes for
non-ascii characters. This is so that the program can be unparsed for
either pgf90 or gfortran to compile. But modfiles should not be affected
by that -- they should be consistent.
This changes causes modfiles to always have character literals formatted
with octal escapes.
Differential Revision: https://reviews.llvm.org/D83703
Nikita Popov [Sat, 11 Jul 2020 20:48:26 +0000 (22:48 +0200)]
[PredicateInfo] Place predicate info after assume
Place the ssa.copy instructions for assumes after the assume,
instead of before it. Both options are valid, but placing them
afterwards prevents assumes from being replaced with assume(true).
This fixes https://bugs.llvm.org/show_bug.cgi?id=37541 in NewGVN
and will avoid a similar issue in SCCP when we handle more
predicate infos.
Differential Revision: https://reviews.llvm.org/D83631
Nikita Popov [Mon, 13 Jul 2020 19:05:47 +0000 (21:05 +0200)]
[NewGVN] Separate passing assume tests (NFC)
Result might not be exactly the same as under GVN, but all the
desired transforms are made.
Nikita Popov [Mon, 13 Jul 2020 18:48:12 +0000 (20:48 +0200)]
[NewGVN] Rename xfail tests (NFC)
Add an -xfail.ll suffix to tests marked XFAIL, so these files can
be split into passing and failing parts.
Lang Hames [Mon, 13 Jul 2020 18:21:40 +0000 (11:21 -0700)]
[JITLink] Apply MSVCPError workaround to
a1fc26030a42.
Hopefully this will get the Windows bots building again.
Matt Arsenault [Sun, 12 Jul 2020 18:03:23 +0000 (14:03 -0400)]
GlobalISel: Define equivalent nodes for saturating add/sub
Matt Arsenault [Sun, 12 Jul 2020 20:11:53 +0000 (16:11 -0400)]
GlobalISel: Implement fewerElementsVector for saturating add/sub
Matt Arsenault [Sun, 12 Jul 2020 17:58:53 +0000 (13:58 -0400)]
GlobalISel: Implement widenScalar for saturating add/sub
Add a placeholder legality rule for AMDGPU until the rest of the
actions are handled.
Matt Arsenault [Sun, 12 Jul 2020 16:49:04 +0000 (12:49 -0400)]
AMDGPU/GlobalISel: Add baseline add/sub sat legalization tests
Sam McCall [Mon, 13 Jul 2020 18:44:03 +0000 (20:44 +0200)]
[clangd] Remove const_cast. NFC
Lei Zhang [Mon, 13 Jul 2020 18:40:04 +0000 (14:40 -0400)]
[NFC] Remove unused header include
Differential Revision: https://reviews.llvm.org/D83706
serge-sans-paille [Thu, 9 Jul 2020 07:56:26 +0000 (09:56 +0200)]
Fix HexagonGenExtract return status
Differential Revision: https://reviews.llvm.org/D83460
Arthur Eubanks [Mon, 13 Jul 2020 18:10:56 +0000 (11:10 -0700)]
[NewPM][opt] Translate -foo-analysis to require<foo-analysis>
Fixes 53 check-llvm tests under NPM.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D83633
LLVM GN Syncbot [Mon, 13 Jul 2020 18:10:37 +0000 (18:10 +0000)]
[gn build] Port
fdb69539bcd
Jan Korous [Wed, 8 Jul 2020 22:16:21 +0000 (15:16 -0700)]
[AST] Fix potential nullptr dereference in Expr::HasSideEffects
Array returned by LambdaExpr::capture_inits() can contain nullptrs.
Differential Revision: https://reviews.llvm.org/D83438
Matt Arsenault [Sun, 12 Jul 2020 21:22:15 +0000 (17:22 -0400)]
AMDGPU/GlobalISel: Add tests for 96-bit add/sub/mul
I almost regressed these, so add tests for them.
Mircea Trofin [Mon, 13 Jul 2020 17:59:55 +0000 (10:59 -0700)]
[llvm][NFC] ML Policies: changed the saved_model protobuf to text
Also compacted the checkpoints (variables) to one file (plus the index).
This reduces the binary model files to just the variables and their
index. The index is very small. The variables are serialized float
arrays. When updated through training, the changes are very likely
unlocalized, so there's very little value in them being anything else
than binary.
Matt Arsenault [Mon, 13 Jul 2020 17:14:29 +0000 (13:14 -0400)]
TableGen/GlobalISel: Emit enum names for reg class ID instead of value
This was emitting the raw value for the reg class ID with a comment
for the actual class name. Switch to emitting the qualified enum name
instead, which obviates the need for the comment and also helps keep
the lit tests on the emitter output more stable.
Matt Arsenault [Mon, 13 Jul 2020 14:39:13 +0000 (10:39 -0400)]
RISCV: Avoid GlobalISel build break in a future patch
The GlobalISelEmitter is stricter about matching timm instruction
outputs to timm inputs (although in an accidental sort of way that
doesn't hit a proper import failure error). Also, apparently no
intrinsic patterns were importing since the ID enum declaration was
missing.
Louis Dionne [Mon, 13 Jul 2020 15:53:48 +0000 (11:53 -0400)]
[libc++] Implement P0551
Make sure we satisfy the requirements added by P0551, and add tests to
enforce that.
Hiroshi Yamauchi [Tue, 7 Jul 2020 18:01:35 +0000 (11:01 -0700)]
[PGO][PGSO] Add profile guided size optimization to X86ISelDAGToDAG.
Differential Revision: https://reviews.llvm.org/D83331
LLVM GN Syncbot [Mon, 13 Jul 2020 17:19:05 +0000 (17:19 +0000)]
[gn build] Port
83080a294ad
Lang Hames [Mon, 13 Jul 2020 04:56:45 +0000 (21:56 -0700)]
[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.
Lang Hames [Mon, 13 Jul 2020 04:49:17 +0000 (21:49 -0700)]
[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.
Mircea Trofin [Mon, 29 Jun 2020 18:37:06 +0000 (11:37 -0700)]
[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
Hiroshi Yamauchi [Tue, 7 Jul 2020 17:19:54 +0000 (10:19 -0700)]
[PGO][PGSO] Add profile guided size optimization to the X86 LEA fixup.
Differential Revision: https://reviews.llvm.org/D83330
Sanjay Patel [Mon, 13 Jul 2020 15:35:38 +0000 (11:35 -0400)]
[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.
Sanjay Patel [Mon, 13 Jul 2020 15:23:45 +0000 (11:23 -0400)]
[x86] add tests for bswap/rotate; NFC
Pavel Iliin [Mon, 13 Jul 2020 11:37:59 +0000 (12:37 +0100)]
[ARM][NFC] More detailed vbsl checks in ARM & Thumb2 tests.
stevewan [Mon, 13 Jul 2020 15:58:22 +0000 (11:58 -0400)]
[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
Pavel Labath [Mon, 13 Jul 2020 15:15:25 +0000 (17:15 +0200)]
[ADT] Make Load(AP)IntFromMemory pointer argument const
The function does not modify this memory.
Sanne Wouda [Mon, 13 Jul 2020 15:09:41 +0000 (16:09 +0100)]
Fix llvm-test-suite failure introduced by D82550/D83122
Apparently, isIndirectCall does not imply that getCalledFunction will be non-null
David Truby [Mon, 13 Jul 2020 15:07:22 +0000 (16:07 +0100)]
[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
Alexey Bataev [Thu, 9 Jul 2020 12:34:06 +0000 (08:34 -0400)]
[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
Eric Astor [Mon, 13 Jul 2020 14:47:30 +0000 (10:47 -0400)]
[ms] [llvm-ml] Restore omitted changes requested by reviewer