Matt Arsenault [Thu, 16 Jan 2020 03:25:58 +0000 (22:25 -0500)]
AMDGPU: Move permlane discard vdst_in optimization
This case can be handled as a regular selection pattern, so move it
out of the weird post-isel folding code which doesn't have an exactly
equivalent place in GlobalISel.
I think it doesn't make much sense to do this optimization here
though, and it would be more useful in instcombine. There's not really
any new information that will be gained during lowering since these
inputs were known from the beginning.
Sam Clegg [Tue, 14 Jan 2020 17:44:28 +0000 (09:44 -0800)]
[llvm-nm] Use `StringRef` over `const std::string &` params
Differential Revision: https://reviews.llvm.org/D72718
Krzysztof Parzyszek [Thu, 16 Jan 2020 21:54:24 +0000 (15:54 -0600)]
Add BuiltinsHexagonDep.def to clang module map
Derek Schuff [Wed, 18 Dec 2019 22:50:19 +0000 (14:50 -0800)]
[WebAssembly] Track frame registers through VReg and local allocation
This change has 2 components:
Target-independent: add a method getDwarfFrameBase to TargetFrameLowering. It
describes how the Dwarf frame base will be encoded. That can be a register (the
default), the CFA (which replaces NVPTX-specific logic in DwarfCompileUnit), or
a DW_OP_WASM_location descriptr.
WebAssembly: Allow WebAssemblyFunctionInfo::getFrameRegister to return the
correct virtual register instead of FP32/SP32 after WebAssemblyReplacePhysRegs
has run. Make WebAssemblyExplicitLocals store the local it allocates for the
frame register. Use this local information to implement getDwarfFrameBase
The result is that the DW_AT_frame_base attribute is correctly encoded for each
subprogram, and each param and local variable has a correct DW_AT_location that
uses DW_OP_fbreg to refer to the frame base.
Differential Revision: https://reviews.llvm.org/D71681
Sanjay Patel [Thu, 16 Jan 2020 21:20:48 +0000 (16:20 -0500)]
[IR] fix crash in Constant::isElementWiseEqual() with FP types
We lifted this code from InstCombine for general usage in:
rL369842
...but it's not safe as-is. There are no existing users that can
trigger this bug, but I discovered it via crashing several
regression tests when trying to use it for select folding in
InstSimplify.
ICmp requires (vector) integer types, so give up on anything that's
not integer or FP (pointers and ?) then bitcast the constants
before trying the match. That matches the definition of "equal or
undef" that I was looking for. If someone wants an FP-aware version
of equality (deal with NaN, -0.0), that could be a different mode
or different function.
Differential Revision: https://reviews.llvm.org/D72784
Alexey Bataev [Thu, 16 Jan 2020 20:46:34 +0000 (15:46 -0500)]
[OPENMP]Avoid string concat where possible and use standard name
generation function, NFC.
LLVM GN Syncbot [Thu, 16 Jan 2020 21:35:08 +0000 (21:35 +0000)]
[gn build] Port
d5c6b8407c1
Logan Smith [Thu, 16 Jan 2020 21:29:19 +0000 (16:29 -0500)]
Factor out renaming logic from readability-identifier-naming
Before this patch, readability-identifier-naming contained a significant amount
of logic for (a) checking the style of identifiers, followed by (b) renaming/
applying fix-its. This patch factors out (b) into a separate base class so that
it can be reused by other checks that want to do renaming. This also cleans up
readability-identifier-naming significantly, since now it only needs to be
concerned with the interesting details of (a).
Peter Collingbourne [Thu, 5 Dec 2019 01:46:15 +0000 (17:46 -0800)]
scudo: Add initial memory tagging support.
When the hardware and operating system support the ARM Memory Tagging
Extension, tag primary allocation granules with a random tag. The granules
either side of the allocation are tagged with tag 0, which is normally
excluded from the set of tags that may be selected randomly. Memory is
also retagged with a random tag when it is freed, and we opportunistically
reuse the new tag when the block is reused to reduce overhead. This causes
linear buffer overflows to be caught deterministically and non-linear buffer
overflows and use-after-free to be caught probabilistically.
This feature is currently only enabled for the Android allocator
and depends on an experimental Linux kernel branch available here:
https://github.com/pcc/linux/tree/android-experimental-mte
All code that depends on the kernel branch is hidden behind a macro,
ANDROID_EXPERIMENTAL_MTE. This is the same macro that is used by the Android
platform and may only be defined in non-production configurations. When the
userspace interface is finalized the code will be updated to use the stable
interface and all #ifdef ANDROID_EXPERIMENTAL_MTE will be removed.
Differential Revision: https://reviews.llvm.org/D70762
StevenWanYu [Thu, 16 Jan 2020 21:08:07 +0000 (16:08 -0500)]
[NFC] Remove unnecessary link components.
Remove unused link components in unittest according to post commit
comments.
Michael Liao [Thu, 16 Jan 2020 21:02:47 +0000 (16:02 -0500)]
[clangd] Add workaround for GCC5 host compilers. NFC.
Krzysztof Parzyszek [Thu, 16 Jan 2020 20:46:03 +0000 (14:46 -0600)]
[Hexagon] Add ELF flags for Hexagon v66 to ELFYAML.cpp
Fedor Sergeev [Thu, 16 Jan 2020 17:31:24 +0000 (20:31 +0300)]
[GVN] add GVN parameters parsing to new pass manager
Introduce parsing, add a few instances of parameter use into GVN-PRE tests.
Reviewers: skatkov, asbirlea
Reviewed By: skatkov
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72752
Kazu Hirata [Thu, 16 Jan 2020 19:04:16 +0000 (11:04 -0800)]
Resubmit: [JumpThreading] Thread jumps through two basic blocks
This reverts commit
2d258ed931cdf47a7d1dcf08ad963b5452a8670f. This
revision fixes the Windows build and adds a testcase for it, namely
thread-two-bbs3.ll. My original patch improperly copied EH pads on
Windows. This patch disregards jump threading opportunities having to
do with EH pads.
[JumpThreading] Thread jumps through two basic blocks
Summary:
This patch teaches JumpThreading.cpp to thread through two basic
blocks like:
bb3:
%var = phi i32* [ null, %bb1 ], [ @a, %bb2 ]
%tobool = icmp eq i32 %cond, 0
br i1 %tobool, label %bb4, label ...
bb4:
%cmp = icmp eq i32* %var, null
br i1 %cmp, label bb5, label bb6
by duplicating basic blocks like bb3 above. Once we duplicate bb3 as
bb3.dup and redirect edge bb2->bb3 to bb2->bb3.dup, we have:
bb3:
%var = phi i32* [ @a, %bb2 ]
%tobool = icmp eq i32 %cond, 0
br i1 %tobool, label %bb4, label ...
bb3.dup:
%var = phi i32* [ null, %bb1 ]
%tobool = icmp eq i32 %cond, 0
br i1 %tobool, label %bb4, label ...
bb4:
%cmp = icmp eq i32* %var, null
br i1 %cmp, label bb5, label bb6
Then the existing code in JumpThreading.cpp can thread edge
bb3.dup->bb4 through bb4 and eventually create bb3.dup->bb5.
Reviewers: wmi
Subscribers: hiraditya, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70247
Krzysztof Parzyszek [Thu, 16 Jan 2020 20:13:25 +0000 (14:13 -0600)]
[Hexagon] Update autogenerated intrinsic info in clang
In addition to that, use target features to validate intrinsic
availability on a given target.
Fangrui Song [Thu, 16 Jan 2020 20:00:24 +0000 (12:00 -0800)]
[ELF] -r: don't create .interp
`{clang,gcc} -nostdlib -r a.c` passes --dynamic-linker to the linker,
and the expected behavior is to ignore it.
If .interp is kept in the relocatable object file, a final link will get
PT_INTERP even if --dynamic-linker is not specified. glibc ld.so expects
to see PT_DYNAMIC and the executable will likely fail to run.
Ignore --dynamic-linker in -r mode as well as -shared.
StevenWanYu [Thu, 16 Jan 2020 20:07:50 +0000 (15:07 -0500)]
Address redirect issue on Windows.
Joachim Protze [Wed, 15 Jan 2020 17:07:47 +0000 (07:07 -1000)]
[OpenMP][Tool] Fix memory leak and double-allocation
Fix the memory leak pointed out in https://reviews.llvm.org/D70412.
And a second one due to double-allocation.
Reviewed by: Hahnfeld
Differential revision: https://reviews.llvm.org/D72779
Eric Fiselier [Thu, 16 Jan 2020 20:00:34 +0000 (15:00 -0500)]
[libc++] Fix Windows DLL build for string.
We need to mark string::npos with _LIBCPP_FUNC_VIS on the first
in-class declaration, otherwise it might get ignored
Jonas Devlieghere [Thu, 16 Jan 2020 19:57:57 +0000 (11:57 -0800)]
[lldb/test] Exted test for CMTime data formatter
Cover more cases handled by the formatter.
Matt Arsenault [Wed, 15 Jan 2020 14:28:03 +0000 (09:28 -0500)]
AMDGPU: Remove outdated comment
StevenWanYu [Thu, 16 Jan 2020 19:37:25 +0000 (14:37 -0500)]
Don't run powerpc lit test case on other platforms.
Only run this test on powerpc tragets, because other platforms might
not have powerpc registered.
Matt Arsenault [Thu, 16 Jan 2020 19:05:46 +0000 (14:05 -0500)]
AMDGPU: Update more tests to use modern buffer intrinsics
Matt Arsenault [Sat, 11 Jan 2020 23:03:18 +0000 (18:03 -0500)]
AMDGPU/GlobalISel: Improve lowering of G_SEXT_INREG
Clamping the scalar is much better than lowering with superwide shifts
for types > s64.
Matt Arsenault [Fri, 10 Jan 2020 15:41:29 +0000 (10:41 -0500)]
GlobalISel: Don't ignore requested ext narrowing type
This was assuming the narrow target was the source type. Respect the
requested type when these don't match by using intermediate
merges. This avoids producing very wide, illegal shift expansions.
Matt Arsenault [Fri, 10 Jan 2020 16:02:18 +0000 (11:02 -0500)]
GlobalISel: Move extension scalar narrowing to separate function
Also rename a few things. Handling a different requested type will
require this to become much more complex.
Krzysztof Parzyszek [Thu, 16 Jan 2020 17:10:34 +0000 (11:10 -0600)]
[Hexagon] Update autogeneated intrinsic information in LLVM
Craig Topper [Thu, 16 Jan 2020 18:27:38 +0000 (10:27 -0800)]
[LegalizeDAG][Mips] Add an assert to protect a uint_to_fp implementation from double rounding. Add a i32->f32 uint_to_fp implementation that avoids this code.
The algorithm here only works if the sint_to_fp doesn't do any
rounding. Otherwise it can round before the offset fixup is
applied. Add an assert to protect this.
To avoid breaking the one test in tree that tested this code
with a set of types that fail the assert, I've enabled i32->f32
to use the i64->f32 algorithm. This only occurs when f64 isn't
a legal type. If f64 is legal then we do i32->f64->f32 instead.
Differential Revision: https://reviews.llvm.org/D72794
Kadir Cetinkaya [Thu, 16 Jan 2020 14:20:13 +0000 (15:20 +0100)]
[clangd] Print underlying type for decltypes in hover
Summary: Fixes https://github.com/clangd/clangd/issues/249
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72498
Kadir Cetinkaya [Thu, 16 Jan 2020 14:36:12 +0000 (15:36 +0100)]
[clangd] Make define outline code action visible
Summary: This got forgotten during the process.
Reviewers: sammccall, usaxena95
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72840
Matt Arsenault [Thu, 16 Jan 2020 18:37:59 +0000 (13:37 -0500)]
AMDGPU: Remove IR section from MIR test
Also generate check lines so this isn't just testing the meaningless
block name.
Matt Arsenault [Sun, 12 Jan 2020 20:54:09 +0000 (15:54 -0500)]
GlobalISel: Apply target MMO flags to atomics
Unify MMO flag handling with SelectionDAG like with loads and stores.
Matt Arsenault [Sun, 12 Jan 2020 19:10:42 +0000 (14:10 -0500)]
GlobalISel: Preserve load/store metadata in IRTranslator
This was dropping the invariant metadata on dead argument loads, so
they weren't deleted.
Atomics still need to be fixed the same way. Also, apparently store
was never preserving dereferencable which should also be fixed.
Matt Arsenault [Thu, 16 Jan 2020 15:47:13 +0000 (10:47 -0500)]
TableGen/GlobalISel: Fix srcvalue inputs
Allow using srcvalue for discarding pattern inputs.
Matt Arsenault [Thu, 16 Jan 2020 03:50:37 +0000 (22:50 -0500)]
TableGen: Remove dead code
Matt Arsenault [Thu, 16 Jan 2020 16:34:19 +0000 (11:34 -0500)]
AMDGPU: Update tests to use modern buffer intrinsics
Adrian Prantl [Thu, 16 Jan 2020 18:43:49 +0000 (10:43 -0800)]
Delete control character from comment. (NFC)
Krzysztof Parzyszek [Thu, 16 Jan 2020 18:00:35 +0000 (12:00 -0600)]
[Hexagon] Add a target feature to disable compound instructions
This affects the following instructions:
Tag: M4_mpyrr_addr Syntax: Ry32 = add(Ru32,mpyi(Ry32,Rs32))
Tag: M4_mpyri_addr_u2 Syntax: Rd32 = add(Ru32,mpyi(#u6:2,Rs32))
Tag: M4_mpyri_addr Syntax: Rd32 = add(Ru32,mpyi(Rs32,#u6))
Tag: M4_mpyri_addi Syntax: Rd32 = add(#u6,mpyi(Rs32,#U6))
Tag: M4_mpyrr_addi Syntax: Rd32 = add(#u6,mpyi(Rs32,Rt32))
Tag: S4_addaddi Syntax: Rd32 = add(Rs32,add(Ru32,#s6))
Tag: S4_subaddi Syntax: Rd32 = add(Rs32,sub(#s6,Ru32))
Tag: S4_or_andix Syntax: Rx32 = or(Ru32,and(Rx32,#s10))
Tag: S4_andi_asl_ri Syntax: Rx32 = and(#u8,asl(Rx32,#U5))
Tag: S4_ori_asl_ri Syntax: Rx32 = or(#u8,asl(Rx32,#U5))
Tag: S4_addi_asl_ri Syntax: Rx32 = add(#u8,asl(Rx32,#U5))
Tag: S4_subi_asl_ri Syntax: Rx32 = sub(#u8,asl(Rx32,#U5))
Tag: S4_andi_lsr_ri Syntax: Rx32 = and(#u8,lsr(Rx32,#U5))
Tag: S4_ori_lsr_ri Syntax: Rx32 = or(#u8,lsr(Rx32,#U5))
Tag: S4_addi_lsr_ri Syntax: Rx32 = add(#u8,lsr(Rx32,#U5))
Tag: S4_subi_lsr_ri Syntax: Rx32 = sub(#u8,lsr(Rx32,#U5))
Fangrui Song [Thu, 16 Jan 2020 01:44:14 +0000 (17:44 -0800)]
[ELF] Decrease alignment of ThunkSection on 64-bit targets from 8 to 4
ThunkSection contains 4-byte instructions on all targets that use
thunks. Thunks should not be used in any performance sensitive places,
and locality/cache line/instruction fetching arguments should not apply.
We use 16 bytes as preferred function alignments for modern PowerPC cores.
In any case, 8 is not optimal.
Differential Revision: https://reviews.llvm.org/D72819
Arkady Shlykov [Thu, 16 Jan 2020 16:35:00 +0000 (08:35 -0800)]
Revert "[Loop Peeling] Add possibility to enable peeling on loop nests."
This reverts commit 3f3017e because there's a failure on peel-loop-nests.ll
with LLVM_ENABLE_EXPENSIVE_CHECKS on.
Differential Revision: https://reviews.llvm.org/D70304
Nico Weber [Thu, 16 Jan 2020 18:19:09 +0000 (13:19 -0500)]
[gn build] (manually) port
bed7626f04f7
Nico Weber [Thu, 16 Jan 2020 18:10:27 +0000 (13:10 -0500)]
[gn build] include revision information in lld --version output
stevewan [Thu, 16 Jan 2020 16:42:11 +0000 (11:42 -0500)]
[PowerPC][AIX] Make PIC the default relocation model for AIX
Summary:
The `llc` tool currently defaults to Static relocation model and generates non-relocatable code for 32-bit Power.
This is not desirable on AIX where we always generate Position Independent Code (PIC). This patch makes PIC the default relocation model for AIX.
Reviewers: daltenty, hubert.reinterpretcast, DiggerLin, Xiangling_L, sfertile
Reviewed By: hubert.reinterpretcast
Subscribers: mgorny, wuzish, nemanjai, hiraditya, kbarton, jsji, shchenz, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72479
Ulrich Weigand [Thu, 16 Jan 2020 17:56:16 +0000 (18:56 +0100)]
[SystemZ] Avoid unnecessary conversions in vecintrin.h
Use floating-point instead of integer zero constants to avoid
creating implicit conversions, which currently cause suboptimal
code to be generated with -ffp-exception-behavior=strict.
NFC otherwise.
Pavel Labath [Thu, 16 Jan 2020 17:55:59 +0000 (18:55 +0100)]
[lldb/test] Revert changes to debug-names-compressed.cpp
With the changes in
15a6df52efa, the test is failing in some
configurations. Reverting while I investigate
Nico Weber [Thu, 16 Jan 2020 17:47:56 +0000 (12:47 -0500)]
remove an include that's unused after r347592
Derek Schuff [Thu, 16 Jan 2020 17:38:37 +0000 (09:38 -0800)]
[LLDB] Convert Plugins/ObjectFile/wasm/ObjectFileWasm.h to unix line endings
Paolo Severini [Thu, 16 Jan 2020 16:36:45 +0000 (08:36 -0800)]
[LLDB] Add SymbolVendorWasm plugin for WebAssembly debugging
Add plugin class SymbolVendorWasm, with the logic to manage debug symbols
for Wasm modules.
Reviewers: clayborg, labath, aprantl, sbc100, teemperor
Reviewed By: labath
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D72650
Fedor Sergeev [Thu, 16 Jan 2020 16:02:44 +0000 (19:02 +0300)]
[GVN] introduce GVNOptions to control GVN pass behavior
There are a few global (cl::opt) controls that enable optional
behavior in GVN. Introduce GVNOptions that provide corresponding
per-pass instance controls.
That will allow to use GVN multiple times in pipeline each time
with different settings.
Reviewers: asbirlea, rnk, reames, skatkov, fhahn
Reviewed By: fhahn
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72732
Jonas Devlieghere [Thu, 16 Jan 2020 17:15:33 +0000 (09:15 -0800)]
[lldb/Scripts] Remove swig_bot_lib/__init__.py
Mircea Trofin [Thu, 16 Jan 2020 16:51:50 +0000 (08:51 -0800)]
[llvm] Make new pass manager's OptimizationLevel a class
Summary:
The old pass manager separated speed optimization and size optimization
levels into two unsigned values. Coallescing both in an enum in the new
pass manager may lead to unintentional casts and comparisons.
In particular, taking a look at how the loop unroll passes were constructed
previously, the Os/Oz are now (==new pass manager) treated just like O3,
likely unintentionally.
This change disallows raw comparisons between optimization levels, to
avoid such unintended effects. As an effect, the O{s|z} behavior changes
for loop unrolling and loop unroll and jam, matching O2 rather than O3.
The change also parameterizes the threshold values used for loop
unrolling, primarily to aid testing.
Reviewers: tejohnson, davidxl
Reviewed By: tejohnson
Subscribers: zzheng, ychen, mehdi_amini, hiraditya, steven_wu, dexonsmith, dang, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D72547
LLVM GN Syncbot [Thu, 16 Jan 2020 16:56:26 +0000 (16:56 +0000)]
[gn build] Port
6b357866496
Krzysztof Parzyszek [Thu, 16 Jan 2020 16:30:09 +0000 (10:30 -0600)]
[Hexagon] Fix alignment info for __builtin_circ_lduh
Miloš Stojanović [Mon, 30 Dec 2019 15:18:40 +0000 (16:18 +0100)]
[llvm-exegesis][mips] Add RegisterAliasingTest unit test
Differential Revision: https://reviews.llvm.org/D72004
Miloš Stojanović [Mon, 30 Dec 2019 14:50:51 +0000 (15:50 +0100)]
[llvm-exegesis][NFC] Refactor Mips tests fixtures into a base class.
Differential Revision: https://reviews.llvm.org/D72003
Matt Arsenault [Thu, 16 Jan 2020 16:28:46 +0000 (11:28 -0500)]
AMDGPU/GlobalISel: Don't handle legacy buffer intrinsic
Hubert Tong [Thu, 16 Jan 2020 16:28:37 +0000 (11:28 -0500)]
[MC][test] Fix non-portable GNU diff option
Summary: This patch replaces the non-portable GNU diff option `--strip-trailing-cr` with the POSIX `-b` option in two test files.
Reviewers: daltenty, jasonliu
Reviewed By: daltenty
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72745
Raphael Isemann [Thu, 16 Jan 2020 16:26:34 +0000 (17:26 +0100)]
[lldb][NFC] Delete TestDataFormatterObjCNSDate.py
This test is just TestDataFormatterObjCNSData.py copied but without any changes
(and it therefore doesn't even test NSDate).
It's also failing as NSData has been changed by me in
4f244bba4f66b14382c446b62e122fa684b8db78.
Matt Arsenault [Mon, 13 Jan 2020 00:04:24 +0000 (19:04 -0500)]
AMDGPU/GlobalISel: Select DS GWS intrinsics
Krzysztof Parzyszek [Thu, 16 Jan 2020 16:17:20 +0000 (10:17 -0600)]
[Hexagon] Add preprocessor test for hexagonv66
Jay Foad [Thu, 16 Jan 2020 14:36:41 +0000 (14:36 +0000)]
[GlobalISel] Don't arbitrarily limit a mask to 64 bits
Reviewers: arsenm
Subscribers: wdng, rovka, hiraditya, volkan, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72853
Jay Foad [Thu, 16 Jan 2020 12:37:00 +0000 (12:37 +0000)]
[GlobalISel] Pass MachineOperands into MachineIRBuilder helper methods
Reviewers: arsenm, aditya_nandakumar, aemerson
Subscribers: wdng, rovka, hiraditya, volkan, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72849
Nico Weber [Thu, 16 Jan 2020 15:27:25 +0000 (10:27 -0500)]
Remove some SVN-specific code.
$URL$ is an SVN keyword substitution enabled via
`svn propset svn:keywords "URL" tools/clang/lib/Basic/Version.cpp`.
Now that we no longer use SVN, it's no longer being replaced by
anything, and we no longer offer svn exports. So remove the
$URL$-specific logic.
The "cfe" path prefix removal also no longer makes sense now that
we're on git: Both CLANG_REPOSITORY and LLVM_REPOSITORY are usually
set to https://github.com/llvm/llvm-project.git
So remove that too, and remove the "llvm" prefix removal for symmetry.
With the github url, "llvm" _is_ found in the string, but not in
the place the function expected. Nobody noticed since the llvm
repository path is only used if CLANG_REVISION and LLVM_REVISION are
different, which in the git monorepo world they never should be.
(I might remove the "// Support LLVM in a separate repository"
block in a separate commit.)
Differential Revision: https://reviews.llvm.org/D72848
Krzysztof Parzyszek [Thu, 16 Jan 2020 15:58:45 +0000 (09:58 -0600)]
[Hexagon] Remove unnecessary case in StringSwitch, NFC
Sam Parker [Thu, 16 Jan 2020 15:42:41 +0000 (15:42 +0000)]
[ARM][LowOverheadLoops] Update liveness info
Recommitting
e93e0d413f3a after reverting due to test failures, which
will hopefully now be fixed. Original commit message:
After expanding the pseudo instructions, update the liveness info.
We do this in a post-order traversal of the loop, including its
exit blocks and preheader(s).
Differential Revision: https://reviews.llvm.org/D72131
Jay Foad [Thu, 16 Jan 2020 12:09:48 +0000 (12:09 +0000)]
[GlobalISel] Use more MachineIRBuilder helper methods
Reviewers: arsenm, nhaehnle
Subscribers: wdng, rovka, hiraditya, volkan, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72833
Pavel Labath [Wed, 15 Jan 2020 11:17:35 +0000 (12:17 +0100)]
[lldb/DWARF/test] Freshen up debug_names tests
These tests used "clang -mllvm -accel-tables=Dwarf" as a way to
guarantee that clang will emit the debug_names table. Unfortunately,
a change it clang made that insufficient (-gpubnames is required now
too), which rendered these tests ineffective. Since lldb automatically
falls back to the manual index, the tests didn't fail and this change
went largely unnoticed.
This patch updates the tests to really use debug_names (-gdwarf-5
-gpubnames) is the combination that works now, and it adds additional
checks to ensure the section is actually emitted.
Fortunately, no regressions crept in while these tests were disabled.
Anna Welker [Thu, 16 Jan 2020 13:48:18 +0000 (13:48 +0000)]
[ARM][MVE] Enable extending gathers
Enables the masked gather pass to
create extending masked gathers.
Differential Revision: https://reviews.llvm.org/D72451
Nicolas Vasilache [Thu, 16 Jan 2020 14:30:17 +0000 (09:30 -0500)]
[mlir][Linalg] Fix Linalg EDSC builders
Summary:
This diff fixes the fact that the method `mlir::edsc::makeGenericLinalgOp`
incorrectly adds 2 blocks to Linalg ops.
Tests are updated accordingly.
Reviewers: ftynse, hanchung, herhut, pifon2a, asaadaldien
Reviewed By: asaadaldien
Subscribers: merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72780
Nico Weber [Thu, 16 Jan 2020 15:12:06 +0000 (10:12 -0500)]
try to unbreak build after
4b6d9ac392613
Francesco Petrogalli [Fri, 13 Dec 2019 19:43:26 +0000 (19:43 +0000)]
[VectorUtils] Rework the Vector Function Database (VFDatabase).
Summary:
This commits is a rework of the patch in
https://reviews.llvm.org/D67572.
The rework was requested to prevent out-of-tree performance regression
when vectorizing out-of-tree IR intrinsics. The vectorization of such
intrinsics is enquired via the static function `isTLIScalarize`. For
detail see the discussion in https://reviews.llvm.org/D67572.
Reviewers: uabelho, fhahn, sdesmalen
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72734
Dmitri Gribenko [Thu, 16 Jan 2020 14:57:28 +0000 (15:57 +0100)]
Removed an unused include from TypeLocVisitor.h
Nico Weber [Thu, 16 Jan 2020 14:55:36 +0000 (09:55 -0500)]
Make lld cmake not compute commit revision twice
r354605 moved LLD to the unified revision handling introduced in
rL353268 / r352729 and removed uses of LLD_REPOSITORY_STRING and
LLD_REVISION_STRING.
After this change, we no longer compute the (now-unused) values
of these two variables.
Since this removes the only use of llvm/utils/GetRepositoryPath,
remove that too (it's redundant with the system added in r354605).
While here, also remove LLD_VERSION_MAJOR and LLD_VERSION_MINOR.
Their uses were removed in r285163.
Also remove LLD_VERSION from Version.inc which as far as I can
tell has been unused since the file was added in r219277.
No behavior change.
Differential Revision: https://reviews.llvm.org/D72803
Jeremy Morse [Thu, 16 Jan 2020 14:01:27 +0000 (14:01 +0000)]
Revert "[PHIEliminate] Move dbg values after phi and label"
Testing compiler-rt, a new assertion failure occurs when building
the GwpAsanTestObjects object. I'm uploading a reproducer to D70597.
This reverts commit
75188b01e9af3a89639d84be912f84610d6885ba.
Andrew Ng [Wed, 15 Jan 2020 11:48:37 +0000 (11:48 +0000)]
[ELF] Optimization to LinkerScript::computeInputSections NFC
Moved the section name check ahead of any filename matching or
exclusion. Firstly, this reduces the need to retrieve the filename and
secondly, reduces the amount of potentially expensive filename pattern
matching if such rules are present in the linker script.
The impact of this change is particularly significant when linking
objects built with -ffunction-sections and -fstack-size-section, using a
linker script that includes non-trivial filename patterns. In a number
of such cases, the link time is halved.
Differential Revision: https://reviews.llvm.org/D72775
Kadir Cetinkaya [Thu, 16 Jan 2020 10:37:58 +0000 (11:37 +0100)]
[clangd] Make output order of allTargetDecls deterministic
Summary:
Makes use of insertion order to stabilize output for multiple decls.
Fixes https://bugs.llvm.org/show_bug.cgi?id=44564
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, usaxena95, cfe-commits, aemerson
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72826
Simon Pilgrim [Thu, 16 Jan 2020 11:26:56 +0000 (11:26 +0000)]
Fix unused variable warning. NFCI.
Simon Pilgrim [Wed, 15 Jan 2020 16:40:20 +0000 (16:40 +0000)]
Fix "pointer is null" static analyzer warnings. NFCI.
Use castAs<> instead of getAs<> since the pointer is dereferenced immediately in all cases and castAs will perform the null assertion for us.
Raphael Isemann [Wed, 15 Jan 2020 12:30:04 +0000 (13:30 +0100)]
[lldb][NFC] Migrate several tests to expect_expr
expect_expr is the stricter and safer way of testing these expressions.
Hans Wennborg [Thu, 16 Jan 2020 12:24:21 +0000 (13:24 +0100)]
Remove release note about in-process-cc1
This feature landed before the 10.x branch, so it will be covered in the
clang 10 release notes instead.
Chris Ye [Thu, 16 Jan 2020 11:40:44 +0000 (11:40 +0000)]
[PHIEliminate] Move dbg values after phi and label
If there are DBG_VALUEs between phi and label (after phi and before label),
DBG_VALUE will block PHI lowering after the LABEL. Moving all DBG_VALUEs
after Labels in the function ScheduleDAGSDNodes::EmitSchedule to avoid
impacting PHI lowering.
before:
PHI
DBG_VALUE
LABEL
after: (move DBG_VALUE after label)
PHI
LABEL
DBG_VALUE
then: (phi lowering after label)
LABEL
COPY
DBG_VALUE
Fixes the issue: https://bugs.llvm.org/show_bug.cgi?id=43859
Differential Revision: https://reviews.llvm.org/D70597
Saar Raz [Thu, 16 Jan 2020 11:35:20 +0000 (13:35 +0200)]
[Concepts] Fix ConceptSpecializationExpr profiling crash
ConceptSpecializationExprs (CSEs) were being created with nullptr
TemplateArgsAsWritten during TemplateTemplateParmDecl canonicalization, and
we were relying on them during profiling which caused sporadic crashes
in test/CXX/.../temp.arg.template/p3-2a.cpp introduced in D44352.
Change profiling of CSEs to instead rely on the actual converted template
arguments and concept named.
Kadir Cetinkaya [Wed, 15 Jan 2020 17:09:51 +0000 (18:09 +0100)]
[clangd] Dont display `<unknown>` kinds in hover board
Summary:
Currently when hovering over an `auto` or `decltype` that resolve to a
builtin-type, clangd would display `<unknown>` as the kind of the symbol.
Drop that to make rendering nicer.
Reviewers: usaxena95
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72777
Florian Hahn [Thu, 16 Jan 2020 10:25:29 +0000 (10:25 +0000)]
[IR] Mark memset.* intrinsics as IntrWriteMem.
llvm.memset intrinsics do only write memory, but are missing
IntrWriteMem, so they doesNotReadMemory() returns false for them.
The test change is due to the test checking the fn attribute ids at the
call sites, which got bumped up due to a new combination with writeonly
appearing in the test file.
Reviewers: jdoerfert, reames, efriedma, nlopes, lebedev.ri
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D72789
Martin Probst [Mon, 18 Nov 2019 09:07:32 +0000 (10:07 +0100)]
clang-format: [JS] tests for async wrapping.
Summary:
Adds tests to ensure that `async method() ...` does not wrap between async and
the method name, which would cause automatic semicolon insertion.
Reviewers: krasimir
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70377
Florian Hahn [Thu, 16 Jan 2020 10:06:09 +0000 (10:06 +0000)]
[LV] Allow assume calls in predicated blocks.
The assume intrinsic is intentionally marked as may reading/writing
memory, to avoid passes moving them around. When flattening the CFG
for predicated blocks, we have to drop the assume calls, as they
are control-flow dependent.
There are some cases where we can do better (when control flow is
preserved), but that is follow-up work.
Fixes PR43620.
Reviewers: hsaito, rengolin, dcaballe, Ayal
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D68814
Florian Hahn [Thu, 16 Jan 2020 09:57:12 +0000 (09:57 +0000)]
[LV] Make X86/assume.ll X86 independent (NFC).
The test does not check anything X86 specific. This is a preparation for
the D68814.
LLVM GN Syncbot [Thu, 16 Jan 2020 09:55:55 +0000 (09:55 +0000)]
[gn build] Port
ed181efa175
Sameer Sahasrabuddhe [Thu, 22 Aug 2019 10:04:35 +0000 (15:34 +0530)]
[HIP][AMDGPU] expand printf when compiling HIP to AMDGPU
Summary:
This change implements the expansion in two parts:
- Add a utility function emitAMDGPUPrintfCall() in LLVM.
- Invoke the above function from Clang CodeGen, when processing a HIP
program for the AMDGPU target.
The printf expansion has undefined behaviour if the format string is
not a compile-time constant. As a sufficient condition, the HIP
ToolChain now emits -Werror=format-nonliteral.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D71365
Kazushi (Jam) Marukawa [Thu, 16 Jan 2020 08:24:41 +0000 (09:24 +0100)]
[VE] i64 arguments, return values and constants
Summary: Support for i64 arguments (in register), return values and constants along with tests.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D72776
Raphael Isemann [Thu, 16 Jan 2020 08:57:13 +0000 (09:57 +0100)]
[lldb] Fix asan failures in data-formatter-objc tests
The test is currently failing on some systems with ASAN enabled due to:
```
==22898==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000003da4 at pc 0x00010951c33d bp 0x7ffee6709e00 sp 0x7ffee67095c0
READ of size 5 at 0x603000003da4 thread T0
#0 0x10951c33c in wrap_memmove+0x16c (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x1833c)
#1 0x7fff4a327f57 in CFDataReplaceBytes+0x1ba (CoreFoundation:x86_64+0x13f57)
#2 0x7fff4a415a44 in __CFDataInit+0x2db (CoreFoundation:x86_64+0x101a44)
#3 0x1094f8490 in main main.m:424
#4 0x7fff77482084 in start+0x0 (libdyld.dylib:x86_64+0x17084)
0x603000003da4 is located 0 bytes to the right of 20-byte region [0x603000003d90,0x603000003da4)
allocated by thread T0 here:
#0 0x109547c02 in wrap_calloc+0xa2 (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x43c02)
#1 0x7fff763ad3ef in class_createInstance+0x52 (libobjc.A.dylib:x86_64+0x73ef)
#2 0x7fff4c6b2d73 in NSAllocateObject+0x12 (Foundation:x86_64+0x1d73)
#3 0x7fff4c6b5e5f in -[_NSPlaceholderData initWithBytes:length:copy:deallocator:]+0x40 (Foundation:x86_64+0x4e5f)
#4 0x7fff4c6d4cf1 in -[NSData(NSData) initWithBytes:length:]+0x24 (Foundation:x86_64+0x23cf1)
#5 0x1094f8245 in main main.m:404
#6 0x7fff77482084 in start+0x0 (libdyld.dylib:x86_64+0x17084)
```
The reason is that we create a string "HELLO" but get the size wrong (it's 5 bytes instead
of 4). Later on we read the buffer and pretend it is 5 bytes long, causing an OOB read
which ASAN detects.
In general this test probably needs some cleanup as it produces on macOS 10.15 around
100 compiler warnings which isn't great, but let's first get the bot green.
Igor Kudrin [Wed, 15 Jan 2020 11:17:07 +0000 (18:17 +0700)]
[DebugInfo] Simplify the constructor of DWARFDebugAranges::Range. NFC.
This removes the default values of the arguments. The only caller,
DWARFDebugAranges::construct(), provides all three parameters.
Differential Revision: https://reviews.llvm.org/D72757
Craig Topper [Thu, 16 Jan 2020 06:01:14 +0000 (22:01 -0800)]
[LegalizeDAG][TargetLowering] Move vXi64/i64->vXf32/f32 uint_to_fp legalizing code from TargetLowering::expandUINT_TO_FP back to LegalizeDAG.
This was moved in October 2018, but we don't appear to be using
this for vectors on any in tree target.
Moving it back simplifies D72794 so we can share the code for i32->f32.
Hiroshi Inoue [Thu, 16 Jan 2020 05:15:34 +0000 (14:15 +0900)]
[mlir] fix broken links to Glossary
Differential Revision: https://reviews.llvm.org/D72697
Jonas Devlieghere [Thu, 16 Jan 2020 04:22:20 +0000 (20:22 -0800)]
[lldb/Reproducers] Print more info for reproducer status
Reproducer status now prints the capture/replay path. It will also print
the status of auto generation when enabled.
LLVM GN Syncbot [Thu, 16 Jan 2020 04:13:31 +0000 (04:13 +0000)]
[gn build] Port
8fdafb7dced
Liu, Chen3 [Thu, 16 Jan 2020 02:49:59 +0000 (10:49 +0800)]
Insert wait instruction after X87 instructions which could raise
float-point exception.
This patch also modify some mayRaiseFPException flag which set in D68854.
Differential Revision: https://reviews.llvm.org/D72750
Jonas Devlieghere [Thu, 16 Jan 2020 03:44:46 +0000 (19:44 -0800)]
[lldb/Reproducers] Add a flag to always generating a reproducer
Add a flag which always generates a reproducer when normally it would be
discarded. This is meant for testing purposes to capture a debugger
session without modification the session itself.
Matt Arsenault [Thu, 5 Dec 2019 09:37:27 +0000 (15:07 +0530)]
Set some fast math attributes in setFunctionAttributes
This will provide a more consistent view to codegen for these
attributes. The current system is somewhat awkward, and the fields in
TargetOptions are reset based on the command line flag if the
attribute isn't set. By forcing these attributes with the flag, there
can never be an inconsistency in the behavior if code directly
inspects the attribute on the function without considering the command
line flags.
Jonas Devlieghere [Thu, 16 Jan 2020 03:12:50 +0000 (19:12 -0800)]
[lldb/Reproducers] Extract function for reading environment override (NFC)
Create a helper function for reading reproducer overrides from
environment variables.