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.
Sam McCall [Mon, 19 Oct 2020 14:29:04 +0000 (16:29 +0200)]
[clangd] Don't offer to expand auto in structured binding declarations.
auto must be used for the code to parse.
Differential Revision: https://reviews.llvm.org/D89700
Mehdi Amini [Wed, 28 Oct 2020 05:57:17 +0000 (05:57 +0000)]
Add a `mlirModuleGetBody()` accessor to the C API and bind it in Python
Getting the body of a Module is a common need which justifies a
dedicated accessor instead of forcing users to go through the
region->blocks->front unwrapping manually.
Differential Revision: https://reviews.llvm.org/D90287
Fangrui Song [Wed, 28 Oct 2020 17:52:58 +0000 (10:52 -0700)]
[llvm-mc] Drop unneeded dependency on CodeGen
Spot by Craig Topper.
Dylan McKay [Wed, 28 Oct 2020 16:44:01 +0000 (05:44 +1300)]
[AVR][clang] Pass the address of the data section to the linker for ATmega328
This patch modifies the Clang AVR toolchain so that it always passes
the '-Tdata=0x800100' to the linker for ATmega328 devices. This matches
AVR-GCC behaviour, and also corresponds to the address of the start of
the data section in data space according to the ATmega328 datasheet.
Without this, clang does not produce a valid ATmega328 binary.
When targeting all non-ATmega328 chips, a warning will be emitted due to
the fact that proper handling for the chips data section address is
not yet implemented.
I've held off adding other microcontrollers for now, mostly because the
AVR toolchain logic is smeared across LLVM core TableGen files, and two Clang
libraries. The 'family detection' logic is also only implemented for
ATmega328 at the moment, for similar reasons.
In the future, I aim to write an RFC to llvm-dev to find a better way
for LLVM to expose target-specific details such as these to compiler
frontends.
Differential Revision: https://reviews.llvm.org/D86629
Tom Weaver [Wed, 28 Oct 2020 17:33:29 +0000 (17:33 +0000)]
[debuginfo-tests][dexter] add requires lldb to two tests
both deferred_globals.cpp namespace.cpp require lldb in order to run and will
fail if it's not available.
add the required lines to the top of the tests.
Kadir Cetinkaya [Wed, 28 Oct 2020 16:32:29 +0000 (17:32 +0100)]
[clangd] Fix a null dereference in tests.
Thomas Lively [Wed, 28 Oct 2020 17:22:43 +0000 (10:22 -0700)]
[WebAssembly] Fix incorrectly named target builtin
Rename __builtin_wasm_q15mulr_saturate_s_i8x16 to
__builtin_wasm_q15mulr_saturate_s_i16x8, fixing the implied lane interpretation
of the result.
Jay Foad [Wed, 28 Oct 2020 17:15:02 +0000 (17:15 +0000)]
[AMDGPU] Use -strict-whitespace for GFX8 and GFX9 disassembler tests
Heejin Ahn [Wed, 28 Oct 2020 10:34:31 +0000 (03:34 -0700)]
[WebAssembly] Clang-format builtins generation (NFC)
Differential Revision: https://reviews.llvm.org/D90294
Thomas Lively [Wed, 28 Oct 2020 16:38:59 +0000 (09:38 -0700)]
[WebAssembly] Prototype extending multiplication SIMD instructions
As proposed in https://github.com/WebAssembly/simd/pull/376. This commit
implements new builtin functions and intrinsics for these instructions, but does
not yet add them to wasm_simd128.h because they have not yet been merged to the
proposal. These are the first instructions with opcodes greater than 0xff, so
this commit updates the MC layer and disassembler to handle that correctly.
Differential Revision: https://reviews.llvm.org/D90253
Paul C. Anagnostopoulos [Fri, 23 Oct 2020 21:02:39 +0000 (17:02 -0400)]
[TableGen] [AMDGPU] Add !sub operator for subtraction
Use it in the AMDGPU target to eliminate !add(value1, !mul(value2, -1))
Differential Revision: https://reviews.llvm.org/D90107
Matt Arsenault [Fri, 23 Oct 2020 19:45:43 +0000 (15:45 -0400)]
RegAlloc: Clear isSSA
The MIR parser may infer SSA, so -run-pass=regallocgreedy would hit a
verifier error after multiple vreg defs are added.
Sebastian Neubauer [Wed, 28 Oct 2020 15:50:40 +0000 (16:50 +0100)]
[AMDGPU] Precommit tests for D89388 and D89399, NFC
Fangrui Song [Tue, 27 Oct 2020 16:30:10 +0000 (09:30 -0700)]
[ELF] -r: don't crash when a non-SHF_LINK_ORDER orphan is added before a SHF_LINK_ORDER orphan
Fixes https://github.com/ClangBuiltLinux/linux/issues/1186
If a non-SHF_LINK_ORDER orphan is added first, `firstIsec->flags & SHF_LINK_ORDER`
will be zero and we currently assert when calling `getLinkOrderDep`.
Reviewed By: grimar
Differential Revision: https://reviews.llvm.org/D90200
Simon Pilgrim [Wed, 28 Oct 2020 15:50:32 +0000 (15:50 +0000)]
[X86] Fix cpu name typos
As discussed on PR26418 rGea84dc9500df incorrectly set the knl cpuname to tremont (and missed out the tremont cpuname entirely).
Nathan James [Wed, 28 Oct 2020 15:49:50 +0000 (15:49 +0000)]
[clang-tidy][NFC] IdentifierNaming: Remove unnecessary string allocations
Remove the need to heap allocate a string for each style option lookup while reading or writing options.p
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D90244
Simon Pilgrim [Wed, 28 Oct 2020 15:46:49 +0000 (15:46 +0000)]
Fix Wdocumentation unknown parameter warnings. NFCI.
This seems to due to a bad merge by rG156e8b37024a
Ulrich Weigand [Wed, 28 Oct 2020 13:19:36 +0000 (14:19 +0100)]
[compiler-rt][SystemZ] Skip fuzzer/full-coverage.test
This test is currently marked as XFAIL on s390x, but it is randomly
passing, causing build bot issues. Setting as UNSUPPORTED for now.
Simon Pilgrim [Wed, 28 Oct 2020 15:38:18 +0000 (15:38 +0000)]
[Syntax] Add missing default constructor for ConstChildIterator
MSVC was complaining as it couldn't see the Base::ChildIteratorBase default constructor.
Florian Hahn [Wed, 28 Oct 2020 14:54:12 +0000 (14:54 +0000)]
[AArch64] Extend vector insertion test cases.
Also re-generate the check lines using update_llc_test_checks.py.
Jay Foad [Wed, 28 Oct 2020 14:51:47 +0000 (14:51 +0000)]
[AMDGPU] Use -strict-whitespace for GFX10 disassembler tests
This is in preparation for fixing some spurious double spaces in the
disassembly.
Djordje Todorovic [Wed, 28 Oct 2020 14:18:14 +0000 (07:18 -0700)]
[NFC][IntrRefLDV] Improve the Value printing
Basically, this just improves the dump of the Value stored within a location.
If the defining instruction number is zero, it means it is "live-in".
Before the patch:
ESI --> bb 0 inst 0 loc ESI
After:
ESI --> Value{bb: 0, inst: live-in, loc: ESI}
This is an NFC.
Differential Revision: https://reviews.llvm.org/D90309
JonChesterfield [Wed, 28 Oct 2020 14:22:27 +0000 (14:22 +0000)]
[libomptarget][nvptx] Undef, weak shared variables
[libomptarget][nvptx] Undef, weak shared variables
Shared variables on nvptx, and LDS on amdgcn, are uninitialized at
the start of kernel execution. Therefore create the variables with
undef instead of zeros, motivated in part by the amdgcn back end
rejecting LDS+initializer.
Common is zero initialized, which seems incompatible with shared. Thus
change them to weak, following the direction of
https://reviews.llvm.org/rG7b3eabdcd215
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D90248
Nabeel Omer [Wed, 28 Oct 2020 14:21:40 +0000 (14:21 +0000)]
[debuginfo-tests][dexter] Add two new debug experience tests
deferred_globals.cpp: Verify that debug information for a local variable does
not hide a global definition that has the same name
namespace.cpp: Ensure that the debug information for a global variable
includes namespace information.
Differential Revision: https://reviews.llvm.org/D89462
Author: Nabeel Omer <nabeel.omer@sony.com>
Georgii Rymar [Wed, 28 Oct 2020 14:04:08 +0000 (17:04 +0300)]
[yamls2obj][test] - Make the Archives/regular.yaml test stricter.
In rG6d656c9691d4 I had to relax the check from
`CONTENT: 21 3c 61 72 63 68 3e 0a 12{{$}}`
to
`CONTENT: 21 3c 61 72 63 68 3e 0a 12`
to fix the FreeBSD bot quickly: http://lab.llvm.org:8011/#/builders/28/builds/547
It turns out that "od" prints a trailing white space on FreeBSD, that is
why EOL mark ({{$}}) can't be used. But we still want to check the output size.
This patch adds a check of output size with "wc -c", similar to how it is done
below in the same test. This restores the original strictness.
Louis Dionne [Wed, 28 Oct 2020 13:26:56 +0000 (09:26 -0400)]
[libc++] Move the #error message for no localization to <locale.h>
<locale.h> is lower level than <__locale>, so that's where we want the
error to live for systems that don't provide localization support.
Louis Dionne [Wed, 28 Oct 2020 13:24:51 +0000 (09:24 -0400)]
[libc++] Remove <clocale> from some system_error tests
The explicit call to `std::setlocale(LC_ALL, "C")` isn't required, since
the Standard already says the equivalent of this call is performed on
program startup.
Georgii Rymar [Wed, 28 Oct 2020 13:42:38 +0000 (16:42 +0300)]
[obj2yaml][test] - Replace llvm-ar with yaml2obj in Archives/regular.yaml to fix BB.
Seems that llvm-ar has a different behavior on MAC and BB fails: http://45.33.8.238/mac/22696/log.txt
This replaces llvm-ar with yaml2obj.
Paul C. Anagnostopoulos [Wed, 28 Oct 2020 13:30:10 +0000 (09:30 -0400)]
[TableGen] Command description file requires a hyphen in document title.
Georgii Rymar [Wed, 28 Oct 2020 13:17:46 +0000 (16:17 +0300)]
[yaml2obj][test] - Try to fix Archives/regular.yaml to fix BB.
It was added in D89949.
FreeBSD bot fails: http://lab.llvm.org:8011/#/builders/28/builds/547
LLVM GN Syncbot [Wed, 28 Oct 2020 13:16:58 +0000 (13:16 +0000)]
[gn build] Port
23c8da25ef7
Qingyi Liu [Wed, 28 Oct 2020 13:06:45 +0000 (14:06 +0100)]
MLIR: add SinOp Lowering to __nv_sinf and __nv_sin
Added lowering rule from `SinOp` to `__nv_sinf` and `__nv_sin`
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D90147
Florian Hahn [Wed, 28 Oct 2020 13:06:42 +0000 (13:06 +0000)]
[llvm-reduce] Add reduction for aliases.
This patch adds a new reduction pass that tries to remove aliases.
It runs early, as most of those likely can be removed up-front in
practice.
This substantially improves llvm-reduce for IR generated by the swift
compiler, which can generate a lot of aliases which lead to lots of
invalid reductions.
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D90260
Paul C. Anagnostopoulos [Sat, 24 Oct 2020 15:08:22 +0000 (11:08 -0400)]
[TableGen] Update xxx-tblgen command document.
Add a few cross-references among TableGen documents.
Differential Revision: https://reviews.llvm.org/D90186
Add cross-references between TableGen documents.
Benjamin Kramer [Wed, 28 Oct 2020 12:55:43 +0000 (13:55 +0100)]
[openmp] Use front() instead of *begin() to not hide bugs when CurTypes is empty.
Benjamin Kramer [Wed, 28 Oct 2020 12:54:00 +0000 (13:54 +0100)]
Revert "[OpenMP] Add Passing in Original Declaration Names To Mapper API"
This reverts commit
d981c7b7581efc3ef378709042100e75da0185a0 and
a87d7b3d448a16e416d1980b9d6aea99e4c9900b. Test fails under msan.
Georgii Rymar [Wed, 28 Oct 2020 12:56:34 +0000 (15:56 +0300)]
[llvm-objdump] - Restore Inputs/libbogus11.a input to fix BB.
The libbogus11.a archive was removed by D90013.
But it is used by another test: llvm-objdump\MachO\disassemble-g-dsym.test
BB failture:
http://lab.llvm.org:8011/#/builders/109/builds/1450
Jay Foad [Wed, 28 Oct 2020 12:56:42 +0000 (12:56 +0000)]
[AMDGPU] Omit needless string concatenations. NFC.
Georgii Rymar [Fri, 23 Oct 2020 06:38:20 +0000 (09:38 +0300)]
[llvm-objdump] - Rewrite malformed-archives.test to use YAML descriptions.
Currently the test uses 14 precompiled binaries. With the functionality
implemented in D89949, it is possible to remove them and use YAMLs instead.
Differential revision: https://reviews.llvm.org/D90013
LLVM GN Syncbot [Wed, 28 Oct 2020 12:31:40 +0000 (12:31 +0000)]
[gn build] Port
47369e194a4
Lei Zhang [Wed, 28 Oct 2020 12:28:51 +0000 (08:28 -0400)]
[mlir] NFC: small fixes to LinalgTilingOptions API
This commit changes to use plain values instead of references.
We need to copy it anyway. References forbid using temporary
values generated from expressions.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D90277
Georgii Rymar [Tue, 20 Oct 2020 12:12:28 +0000 (15:12 +0300)]
[yaml2obj][obj2yaml] - Teach tools to work with regular archives.
This teaches obj2yaml to dump valid regular (not thin) archives.
This also teaches yaml2obj to recognize archives YAML descriptions,
what allows to craft all different kinds of archives (valid and broken ones).
Differential revision: https://reviews.llvm.org/D89949
Simon Pilgrim [Wed, 28 Oct 2020 12:02:50 +0000 (12:02 +0000)]
[DAG] Move canFoldInAddressingMode before foldBinOpIntoSelect. NFC.
Reduces the diff in D90113.
Simon Pilgrim [Wed, 28 Oct 2020 11:38:15 +0000 (11:38 +0000)]
[X86] Regenerate bool-vector tests. NFCI.
Merge prefixes where possible, use 'X86' instead of 'X32' (which we try to only use for gnux32 triple tests).
Florian Hahn [Wed, 28 Oct 2020 12:03:46 +0000 (12:03 +0000)]
[llvm-reduce] Extend test to also use special globals.
David Zarzycki [Wed, 28 Oct 2020 11:44:54 +0000 (07:44 -0400)]
[x86 testing] NFC: remove a few needless vector popcnt tests
The removed tests are handled by optimization passes before code gen and
therefore are just a distraction when making code gen changes that may
(as a side effect) reimplement earlier optimization work as a side effect.
Specifically, the following tests where removed:
ult_0_v* -> false
ult_1_v* -> x == 0
ugt_0_v* -> x != 0
ult_{size-of-element-plus-one}_v* -> true
ugt_{size-of-element}_v* -> false
ult_{size-of-element}_v* -> x != mask
ugt_{size-of-element-minus-one}_v* -> x == mask
Max Kazantsev [Wed, 28 Oct 2020 10:37:20 +0000 (17:37 +0700)]
Return "[IndVars] Remove monotonic checks with unknown exit count"
This reverts commit
e038b60d9169733367393f733058f0ff23c28d3f.
This reverts commit
a0d84d80315d0c725b5efcd889928bad1171ba56.
This revert was a mistake. The reason of the failures was
"Use uint64_t for branch weights instead of uint32_t"
Differential Revision: https://reviews.llvm.org/D87832
Sam McCall [Fri, 23 Oct 2020 10:23:29 +0000 (12:23 +0200)]
[Syntax] Add iterators over children of syntax trees.
This gives us slightly nicer syntax (foreach) for idioms currently expressed
as a loop, and the option to use range algorithms where it makes sense
(e.g. llvm::all_of et al encapsulate the needed flow control in a useful way).
It's also a building block for iteration over filtered views (e.g. iterate over
all Stmt children, with the right type):
for (const Statement &S : filter<Statement>(N.children()))
...
I realize the recent direction has been mostly towards strongly-typed
node-specific facilities, but I think it's important we have convenient
generic facilities too.
Differential Revision: https://reviews.llvm.org/D90023
Georgii Rymar [Tue, 27 Oct 2020 11:38:02 +0000 (14:38 +0300)]
[yaml2obj] - Support the "Offset" key for the .dynsym section.
Our "implicit" sections are handled separately from regular ones.
It turns out that the "Offset" key is not handled properly for them.
Perhaps we can generalize handling in one place, but before doing that I'd like
to add support and test cases for each implicit section.
(I need this particular single change to unblock another patch that is already on review,
and I guess doing it independently for each section will be cleaner, see below).
In this patch I've removed `explicit-dynsym-no-dynstr.yaml` to `dynsym-section.yaml`
and added the new test into. In a follow-up we probably might want
to merge 2 another existent `dynsymtab-*.yaml` tests into it too.
Differential revision: https://reviews.llvm.org/D90224
Florian Hahn [Wed, 28 Oct 2020 11:01:25 +0000 (11:01 +0000)]
[DSE] Use walker to skip noalias stores between current & clobber def.
Instead of getting the defining access we should be able to use
getClobberingMemoryAccess to skip non-aliasing MemoryDefs. No additional
checks should be needed, because we only remove the starting def if it
matches the defining access of the load. All we need to worry about is
that there are no (may)alias stores between the starting def and the
load and getClobberingMemoryAccess should guarantee that.
Partly fixes PR47887.
This improves the number of redundant stores removed in some cases
(numbers below for MultiSource, SPEC2000, SPEC2006 on X86 with -flto
-O3).
Same hash: 226 (filtered out)
Remaining: 11
Metric: dse.NumRedundantStores
Program base patch1 diff
test-suite...:: External/Povray/povray.test 1.00 5.00 400.0%
test-suite...chmarks/MallocBench/gs/gs.test 1.00 3.00 200.0%
test-suite...0/253.perlbmk/253.perlbmk.test 21.00 37.00 76.2%
test-suite...0.perlbench/400.perlbench.test 24.00 37.00 54.2%
test-suite.../Applications/SPASS/SPASS.test 3.00 4.00 33.3%
test-suite...006/453.povray/453.povray.test 15.00 18.00 20.0%
test-suite...T2006/445.gobmk/445.gobmk.test 27.00 29.00 7.4%
test-suite.../CINT2006/403.gcc/403.gcc.test 136.00 137.00 0.7%
test-suite.../CINT2000/176.gcc/176.gcc.test 6.00 6.00 0.0%
test-suite.../Benchmarks/Bullet/bullet.test NaN 3.00 nan%
test-suite.../Benchmarks/Ptrdist/bc/bc.test NaN 1.00 nan%
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D89647
Kazushi (Jam) Marukawa [Wed, 28 Oct 2020 03:51:48 +0000 (12:51 +0900)]
[VE] Add vector merger operation instructions
Add VMRG/VSHF/VCP/VEX isntructions. Add regression tests too.
Also add new patterns to parse new UImm4 oeprand.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D90292
David Zarzycki [Wed, 28 Oct 2020 10:14:54 +0000 (06:14 -0400)]
[testing] Add missing REQUIRES: asserts
Kazushi (Jam) Marukawa [Tue, 27 Oct 2020 17:40:04 +0000 (02:40 +0900)]
[VE] Add vector iterative operation instructions
Add VFIA/VFIS/VFIM/VFIAM/VFISM/VFIMA/VFIMS isntructions.
Add regression tests too.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D90252
Clement Courbet [Wed, 28 Oct 2020 09:51:50 +0000 (10:51 +0100)]
[llvm-exegesis][doc] Remove old FIXME.
This was fixed in a previous commit, the previous line in the
documentation explains how to proceed.
Kazushi (Jam) Marukawa [Mon, 26 Oct 2020 09:03:43 +0000 (18:03 +0900)]
[VE][NFC] Fix typo in comment
Kazushi (Jam) Marukawa [Sat, 24 Oct 2020 13:00:15 +0000 (22:00 +0900)]
[VE] Specify to expand BRIND and BR_JT
BRIND and BR_JT are not implmented yet, so expand them atm.
Add regression tests too.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D90283
Clement Courbet [Wed, 28 Oct 2020 08:26:29 +0000 (09:26 +0100)]
[llvm-exegesis] Do not silently fail on unknown instruction encoding formats.
The addition of TILELOADD instructions with a new encoding format
triggered a hard abort instead of proper error reporting due to the use
of `llvm_unreachable` for actually reachable code.
Properly report an error when the encoding format is unknown.
Differential Revision: https://reviews.llvm.org/D90289
Max Kazantsev [Wed, 28 Oct 2020 06:28:39 +0000 (13:28 +0700)]
Re-enable "[SCEV] Prove implications of different type via truncation"
When we need to prove implication of expressions of different type width,
the default strategy is to widen everything to wider type and prove in this
type. This does not interact well with AddRecs with negative steps and
unsigned predicates: such AddRec will likely not have a `nuw` flag, and its
`zext` to wider type will not be an AddRec. In contraty, `trunc` of an AddRec
in some cases can easily be proved to be an `AddRec` too.
This patch introduces an alternative way to handling implications of different
type widths. If we can prove that wider type values actually fit in the narrow type,
we truncate them and prove the implication in narrow type.
The return was due to revert of underlying patch that this one depends on.
Unit test temporarily disabled because the required logic in SCEV is switched
off due to compile time reasons.
Differential Revision: https://reviews.llvm.org/D89548
David Green [Wed, 28 Oct 2020 08:15:37 +0000 (08:15 +0000)]
[AArch64] Remove AArch64ISD::NOT, use vnot instead
vnot (xor -1) should be equivalent to the AArch64 specific AArch64ISD::NOT
node, but allow more folding thanks to all the target independent
optimizations. Specifically this allows select(icmp ne, x, y) to
become "cmeq; bsl y, x" as opposed to needing to convert the predicate
with "cmeq; mvn; bsl x, y"
Unfortunately there is a regression in a cmtst test, but the code it
selected from was already non-canonical, with instcombine preferring to
use an eq predicate instead. Plus the more common case of icmp ne is
improved.
Differential Revision: https://reviews.llvm.org/D90126
David Green [Wed, 28 Oct 2020 08:00:05 +0000 (08:00 +0000)]
[AArch64] Additional Interleaving Access test. NFC
Clement Courbet [Wed, 28 Oct 2020 07:15:58 +0000 (08:15 +0100)]
[llvm-exegesis] Update doc.
We don't need an external script to scan all opcodes anymore, just use
`-opcode-index=-1`.
Vitaly Buka [Wed, 28 Oct 2020 07:39:58 +0000 (00:39 -0700)]
[NFC][Sanitizer] format sanitizer_platform_interceptors.h
Vitaly Buka [Wed, 28 Oct 2020 07:38:50 +0000 (00:38 -0700)]
[NFC][Asan] Fix cpplint warning in test
Vitaly Buka [Wed, 28 Oct 2020 07:32:44 +0000 (00:32 -0700)]
[NFC][Asan] Fix cpplint warnings in tests
Vitaly Buka [Wed, 28 Oct 2020 06:46:36 +0000 (23:46 -0700)]
[NFC][UBSAN] Try to re-enable tests on IOS
Looks like the reason they were disabled is the same as for Android
and it's fixed by
776a15d8aecad2768f1391092099e9b173b8148b
Vitaly Buka [Wed, 28 Oct 2020 06:42:41 +0000 (23:42 -0700)]
[NFC][UBSAN] Remove XFAIL from fixed tests
Luqman Aden [Wed, 28 Oct 2020 06:18:26 +0000 (23:18 -0700)]
Rename EHPersonality::MSVC_Win64SEH to EHPersonality::MSVC_TableSEH. NFC.
The types of SEH aren't x86(-32) vs x64 but rather stack-based exception chaining
vs table-based exception handling. x86-32 is the only arch for which Windows
uses the former. 32-bit ARM would use what is called Win64SEH today, which
is a bit confusing so instead let's just rename it to be a bit more clear.
Reviewed By: compnerd, rnk
Differential Revision: https://reviews.llvm.org/D90117
Max Kazantsev [Wed, 28 Oct 2020 05:39:41 +0000 (12:39 +0700)]
[SCEV] Re-enable "Use nw flag and symbolic iteration count to sharpen ranges of AddRecs", attempt 3
We can sharpen the range of a AddRec if we know that it does not
self-wrap and know the symbolic iteration count in the loop. If we can
evaluate the value of AddRec on the last iteration and prove that at least
one its intermediate value lies between start and end, then no-wrap flag
allows us to conclude that all of them also lie between start and end. So
the estimate of range can be improved to union of ranges of start and end.
Switched off by default, can be turned on by flag.
Differential Revision: https://reviews.llvm.org/D89381
Reviewed By: lebedev.ri, nikic
Johannes Doerfert [Wed, 28 Oct 2020 04:50:00 +0000 (23:50 -0500)]
[OpenMP][CUDA][FIX] Use the new `remquo` overload only for OpenMP
CUDA buildbots complained about a redefinition when I landed D89971.
This is odd and I fail to understand where in the CUDA headers the other
definition is supposed to be. For now, given that CUDA doesn't need the
overload (AFAIKT), we simply restrict it to the OpenMP mode.
Kazu Hirata [Wed, 28 Oct 2020 04:33:05 +0000 (21:33 -0700)]
[JumpThreading] Rename thread-prob-3.ll to thread-prob-1.ll (NFC)
I just removed thread-prob-{1,2}.ll in
b2f05fae80b0c1a307a9e257157a0d70e6623eb8, so I am removing
thread-prob-3.ll to thread-prob-1.ll.
Kazu Hirata [Wed, 28 Oct 2020 04:12:54 +0000 (21:12 -0700)]
[JumpThreading] Remove extraneous calls to setEdgeProbability
This patch removes extraneous calls to setEdgeProbability introduced
in
c91487769d80487eba1712a7a172a1c8977a9b4f.
The follow-up patch,
a7b662d0f4098371b96ce4446fb0eba79b0b649f, has
since fixed BranchProbabilityInfo::eraseBlock, so we don't need to
worry about getting stale values from getEdgeProbability.
Also, since getEdgeProbability(BB, BB->getSingleSuccessor()) returns
edge probability 1/1 by default for BB with exactly one successor
edge, we don't need to explicitly call setEdgeProbability.
This patch introduces almost no functional change, but we do end up
reducing debug messages from setEdgeProbability.
Differential Revision: https://reviews.llvm.org/D90284
Mitch Phillips [Wed, 28 Oct 2020 03:34:48 +0000 (20:34 -0700)]
Revert "[DebugInfo] Expose Fortran array debug info attributes through DIBuilder."
This reverts commit
5b3bf8b453b8cc00efd5269009a1e63c4442a30e.
This caused a regression in the ASan buildbot. See comments at
https://reviews.llvm.org/D89817 for more information.
Mitch Phillips [Wed, 28 Oct 2020 00:58:41 +0000 (17:58 -0700)]
Revert "[ADT] Fix for ImmutableMapRef"
This reverts commit
a6336eab0c507b665dda63fa9db1292a2cdee409.
This commit broke check-llvm under ASan:
See http://lab.llvm.org:8011/#/builders/5/builds/446 for more details.
Alok Kumar Sharma [Sat, 17 Oct 2020 09:21:27 +0000 (14:51 +0530)]
[NFC] [LLParser] Renaming LLParser routines to comply LLVM coding style
For any newly added parse function, clang-tidy complains. New parse
functions are implicitly defined by a macro "Parse##CLASS(N, IsDistinct)".
Now this macro and exising function definitions are corrected (lower case
first character). Some other variable/function names are also corrected
to comply LLVM coding style.
Reviewed By: djtodoro
Differential Revision: https://reviews.llvm.org/D90243
Carl Ritson [Wed, 28 Oct 2020 02:42:24 +0000 (11:42 +0900)]
[AMDGPU] Fix insert of SIPreAllocateWWMRegs in FastRegAlloc
SIPreAllocateWWMRegs was being inserted after RegisterCoalescer
but this pass does not exist during FastAlloc so pre-allocation
pass was never being run.
Insert pre-allocation after TwoAddressInstructionPass instead.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D90236
Johannes Doerfert [Sat, 10 Oct 2020 14:59:09 +0000 (09:59 -0500)]
[Attributor] Finalize the CGUpdater after each SCC
This matches the new PM model.
Johannes Doerfert [Sat, 10 Oct 2020 15:04:47 +0000 (10:04 -0500)]
[Attributor][NFC] Introduce a debug counter for `AA::manifest`
This will simplify debugging and tracking down problems.
Johannes Doerfert [Sat, 10 Oct 2020 14:58:25 +0000 (09:58 -0500)]
[Attributor][NFC] Print the right value in debug output
Johannes Doerfert [Thu, 10 Sep 2020 05:03:32 +0000 (00:03 -0500)]
[Attributor][FIX] Delete all unreachable static functions
Before we used to only mark unreachable static functions as dead if all
uses were known dead. Now we optimistically assume uses to be dead until
proven otherwise.
Johannes Doerfert [Sat, 10 Oct 2020 15:06:03 +0000 (10:06 -0500)]
[Attributor][FIX] Do not attach range metadata to the wrong Instruction
If we are looking at a call site argument it might be a load or call
which is in a different context than the call site argument. We cannot
simply use the call site argument range for the call or load.
Bug reported and reduced by Whitney Tsang <whitneyt@ca.ibm.com>.
Johannes Doerfert [Sat, 10 Oct 2020 14:41:42 +0000 (09:41 -0500)]
[Attributor][NFC] Clang-format
Johannes Doerfert [Sat, 10 Oct 2020 14:41:18 +0000 (09:41 -0500)]
[Attributor][NFC] Hoist call out of a lambda
The call is not free, unsure if this is needed but it does not make it
worse either.
Johannes Doerfert [Sat, 10 Oct 2020 14:39:51 +0000 (09:39 -0500)]
[Attributor][FIX] Properly check uses in the call not uses of the call
In the AANoAlias logic we determine if a pointer may have been captured
before a call. We need to look at other uses in the call not uses of the
call.
The new code is not perfect as it does not allow trivial cases where the
call has multiple arguments but it is at least not unsound and a TODO
was added.
Johannes Doerfert [Sat, 10 Oct 2020 14:28:47 +0000 (09:28 -0500)]
[Attributor][NFC] Improve time trace output
John Demme [Wed, 28 Oct 2020 01:01:44 +0000 (01:01 +0000)]
[MLIR] [ODS] Allowing attr-dict in custom directive
Enhance tblgen's declarative assembly format to allow `attr-dict` in
custom directives.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D89772
Valentin Clement [Wed, 28 Oct 2020 01:09:48 +0000 (21:09 -0400)]
[flang][openacc] Fix ambiguity in the self clause parsing
In the OpenACC specification, there are two different self clause. One for the
update directive with a var-list argument. This clause is a synonym of the host clause.
The second self clause is present for most of the compute construct and takes an optional
condition. To solve this ambiguity, the self clause for the update directive is directly
translated to a host clause during the parsing. The self clause in AccClause refers always
to the compute construct clause.
Reviewed By: kiranktp
Differential Revision: https://reviews.llvm.org/D90185
Derek Schuff [Wed, 28 Oct 2020 00:57:32 +0000 (17:57 -0700)]
Revert "[WebAssembly] Add support for DWARF type units"
This reverts commit
bcb8a119df210753c5f1a3ac346d49597fef0f51.
Richard Smith [Wed, 28 Oct 2020 00:16:16 +0000 (17:16 -0700)]
Remove unused variable name. NFC.
Eugene Zhulenev [Wed, 28 Oct 2020 00:02:10 +0000 (17:02 -0700)]
[mlir] Fix stack-use-after-scope in cuda/vulkan cpu runners
+fix rocm runner
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D90274
Wei Wang [Wed, 28 Oct 2020 00:11:26 +0000 (17:11 -0700)]
[clang] Pass-through remarks options to linker
Summary:
Propagate driver commandline remarks options to linker when LTO is enabled.
This gives novice user a convenient way to collect and filter remarks throughout
a typical toolchain invocation with sample profile and LTO using single switch
from the clang driver.
A typical use of this option from clang command-line:
* Using -Rpass* options to print remarks to screen:
clang -fuse-ld=lld -flto=thin -fprofile-sample-use=foo_sample.txt
-Rpass=inline -Rpass-missed=inline -Rpass-analysis=inline
-fdiagnostics-show-hotness -fdiagnostics-hotness-threshold=100 -o foo foo.cpp
Remarks will be dumped to screen from both pre-lto and lto
compilation.
* Using serialized remarks options
clang -fuse-ld=lld -flto=thin -fprofile-sample-use=foo_sample.txt
-fsave-optimization-record
-fdiagnostics-show-hotness -fdiagnostics-hotness-threshold=100 -o foo foo.cpp
This will produce multiple yaml files containing optimization remarks:
1. foo.opt.yaml : remarks from pre-lto
2. foo.opt.ld.yaml.thin.1.yaml: remark during lto
Differential Revision: https://reviews.llvm.org/D85810
Derek Schuff [Wed, 30 Sep 2020 18:55:12 +0000 (11:55 -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
Johannes Doerfert [Wed, 14 Oct 2020 18:54:20 +0000 (13:54 -0500)]
[LangRef] Clarify `dereferenceable` -> `nonnull` implication
If `null_pointer_is_valid` is present, `dereferenceable` does not imply
`nonnull`, make it clear.
Came up in D17993.
Reviewed By: aqjune
Differential Revision: https://reviews.llvm.org/D89417
Johannes Doerfert [Thu, 22 Oct 2020 16:36:49 +0000 (11:36 -0500)]
[OpenMP][CUDA] Add missing overload for `remquo(float,float,int*)`
Reported by Colleen Bertoni <bertoni@anl.gov> after running the OvO test
suite: https://github.com/TApplencourt/OvO/
The template overload is still hidden behind an ifdef for OpenMP. In the
future we probably want to remove the ifdef but that requires further
testing.
Reviewed By: JonChesterfield, tra
Differential Revision: https://reviews.llvm.org/D89971
Nico Weber [Wed, 28 Oct 2020 00:10:48 +0000 (20:10 -0400)]
Unbreak build with gcc5.3 after 917acac
Siva Chandra Reddy [Tue, 27 Oct 2020 20:12:18 +0000 (13:12 -0700)]
[libc][NFC] Use a convenience macro to declare special floating point constants.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D90262
Fangrui Song [Tue, 27 Oct 2020 23:29:10 +0000 (16:29 -0700)]
[BranchProbabilityInfo] Make MaxSuccIdx[Src] efficient and add a comment about the subtle eraseBlock. NFC
Follow-up to D90272.
River Riddle [Tue, 27 Oct 2020 23:22:13 +0000 (16:22 -0700)]
[mlir][NFC] Fix incorrect header comments.
Resolves missed comments in D89103
River Riddle [Tue, 27 Oct 2020 23:03:40 +0000 (16:03 -0700)]
[mlir][NFC] Remove unnecessary PatternRewriter::create methods
At this point, these methods are just carbon copies of OpBuilder::create and aren't necessary given that PatternRewriter inherits from OpBuilder.
Differential Revision: https://reviews.llvm.org/D90087
River Riddle [Tue, 27 Oct 2020 23:03:22 +0000 (16:03 -0700)]
[mlir][Interfaces] Optimize the implementation of InterfaceMap to reduce generated code size.
An InterfaceMap is generated for every single operation type, and is responsible for a large amount of the code size from MLIR given that its internals highly utilize templates. This revision refactors the internal implementation to use bare malloc/free for interface instances as opposed to static variables and moves as much code out of templates as possible. This led to a decrease of over >1mb (~12% of total MLIR related code size) for a downstream MLIR library with a large amount of operations.
Differential Revision: https://reviews.llvm.org/D90086