16 months ago[libc] Add a README.md file to the AOR directory.
Siva Chandra Reddy [Mon, 16 Mar 2020 19:27:22 +0000 (12:27 -0700)]
[libc] Add a README.md file to the AOR directory.

Also, add config.mk file which will help test the implementations in the
"math" directory for x86_64 with a simple "make check".

16 months agoRevert "[InstSimplify] Simplify calls with "returned" attribute"
Nico Weber [Mon, 16 Mar 2020 19:15:21 +0000 (15:15 -0400)]
Revert "[InstSimplify] Simplify calls with "returned" attribute"

This reverts commit 45555c381926050bc45a3372b1af0e15650371b6.
Causes clang crashes in some causes, see comments on
https://reviews.llvm.org/D75815 for details (including
repro steps).

16 months ago[libc] Provide Arm Optimized Routines for the LLVM libc project.
Kristof Beyls [Mon, 16 Mar 2020 19:00:15 +0000 (12:00 -0700)]
[libc] Provide Arm Optimized Routines for the LLVM libc project.

This adds the Arm Optimized Routines (see
https://github.com/ARM-software/optimized-routines) source code under the
the LLVM license. The version of the code provided in this patch is v20.02
of the Arm Optimized Routines project.

This entire contribution is being committed as is even though it does
not currently fit the LLVM libc model and does not follow the LLVM
coding style. In the near future, implementations from this patch will be
moved over to their right place in the LLVM-libc tree. This will be done
over many small patches, all of which will go through the normal LLVM code
review process. See this libc-dev post for the plan:

Differential revision of the original upload: https://reviews.llvm.org/D75355

16 months ago[mlir][NFC] Add missing include for std::string.
River Riddle [Mon, 16 Mar 2020 19:13:31 +0000 (12:13 -0700)]
[mlir][NFC] Add missing include for std::string.

16 months agoImplement IR intrinsics for gather prefetch.
Francesco Petrogalli [Wed, 26 Feb 2020 22:19:42 +0000 (22:19 +0000)]
Implement IR intrinsics for gather prefetch.

Intrinsics and relative codegen has been implemented for the following
SVE instructions:

1. PRF<T> <prfop>, <Pg>, [<Xn|SP>, <Zm>.S, <mod>] -> 32-bit          scaled offset
2. PRF<T> <prfop>, <Pg>, [<Xn|SP>, <Zm>.D, <mod>] -> 32-bit unpacked scaled offset
3. PRF<T> <prfop>, <Pg>, [<Xn|SP>, <Zm>.D]        -> 64-bit          scaled offset
4. PRF<T> <prfop>, <Pg>, [<Zn>.S{, #<imm>}]       -> 32-bit element
5. PRF<T> <prfop>, <Pg>, [<Zn>.D{, #<imm>}]       -> 64-bit element

The instructions are associated the following intrinsics, respectively:

1. void @llvm.aarch64.sve.gather.prf<T>.scaled.<mod>.nx4vi32(
          i8* %base,
          <vscale x 4 x i32> %offset,
          <vscale x 4 x i1> %Pg,
          i32 %prfop)

2. void @llvm.aarch64.sve.gather.prf<T>.scaled.<mod>.nx2vi32(
          i8* %base,
          <vscale x 2 x i32> %offset,
          <vscale x 2 x i1> %Pg,
          i32 %prfop)

3. void @llvm.aarch64.sve.gather.prf<T>.scaled.nx2vi64(
          i8* %base,
          <vscale x 2 x i64> %offset,
          <vscale x 2 x i1> %Pg,
          i32 %prfop)

4. void @llvm.aarch64.sve.gather.prf<T>.nx4vi32(
          <vscale x 4 x i32> %bases,
          i64 %imm,
          <vscale x 4 x i1> %Pg,
          i32 %prfop)

5. void @llvm.aarch64.sve.gather.prf<T>.nx2vi64(
          <vscale x 2 x i64> %bases,
          i64 %imm,
          <vscale x 2 x i1> %Pg,
          i32 %prfop)

The intrinsics are the IR counterpart of the following SVE ACLE functions:

* void svprf<T>(svbool_t pg, const void *base, svprfop op)
* void svprf<T>_vnum(svbool_t pg, const void *base, int64_t vnum, svprfop op)
* void svprf<T>_gather[_u32base](svbool_t pg, svuint32_t bases, svprfop op)
* void svprf<T>_gather[_u64base](svbool_t pg, svuint64_t bases, svprfop op)
* void svprf<T>_gather_[s32]offset(svbool_t pg, const void *base, svint32_t offsets, svprfop op)
* void svprf<T>_gather_[u32]offset(svbool_t pg, const void *base, svint32_t offsets, svprfop op)
* void svprf<T>_gather_[s64]offset(svbool_t pg, const void *base, svint64_t offsets, svprfop op)
* void svprf<T>_gather_[u64]offset(svbool_t pg, const void *base, svint64_t offsets, svprfop op)
* void svprf<T>_gather[_u32base]_offset(svbool_t pg, svuint32_t bases, int64_t offset, svprfop op)
* void svprf<T>_gather[_u64base]_offset(svbool_t pg, svuint64_t bases,int64_t offset, svprfop op)

Reviewers: andwar, sdesmalen, efriedma, rengolin

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75580

16 months ago[InstSimplify][SVE] Fix SimplifyGEPInst for scalable vector.
Huihui Zhang [Mon, 16 Mar 2020 18:45:45 +0000 (11:45 -0700)]
[InstSimplify][SVE] Fix SimplifyGEPInst for scalable vector.

Skip folds that rely on DataLayout::getTypeAllocSize(). For scalable
vector, only minimal type alloc size is known at compile-time.

Reviewers: sdesmalen, efriedma, spatel, apazos

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75892

16 months agoUtils: Always set alignment when expanding mem intrinsics
Matt Arsenault [Fri, 14 Feb 2020 20:39:44 +0000 (15:39 -0500)]
Utils: Always set alignment when expanding mem intrinsics

This was creating natural aligned loads and stores, which may not be
the case. The target could request a wider type load with less

16 months agoTTI: Add addrspace parameters to memcpy lowering functions
Matt Arsenault [Fri, 14 Feb 2020 18:22:53 +0000 (13:22 -0500)]
TTI: Add addrspace parameters to memcpy lowering functions

16 months ago[Syntax] Build declarator nodes
Marcel Hlopko [Mon, 16 Mar 2020 18:13:38 +0000 (19:13 +0100)]
[Syntax] Build declarator nodes

Copy of https://reviews.llvm.org/D72089 with Ilya's permission. See
https://reviews.llvm.org/D72089 for the first batch of comments.

Reviewers: gribozavr2

Reviewed By: gribozavr2

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D76220

16 months agoRevert "[llvm-objdump] Display locations of variables alongside disassembly"
Nico Weber [Mon, 16 Mar 2020 17:47:37 +0000 (13:47 -0400)]
Revert "[llvm-objdump] Display locations of variables alongside disassembly"

Makes tests fail on Windows, see https://reviews.llvm.org/D70720#1924542

This reverts commit 3a5ddedadb671e485ce5c638142817879ac14a8c, and

16 months ago[X86] matchScalarReduction - add support for partial reductions
Simon Pilgrim [Mon, 16 Mar 2020 17:58:37 +0000 (17:58 +0000)]
[X86] matchScalarReduction - add support for partial reductions

Add optional support for opt-in partial reduction cases by providing an optional partial mask to indicate which elements have been extracted for the scalar reduction.

16 months agoGlobalISel: Fix lower bswap for vectors
Matt Arsenault [Fri, 14 Feb 2020 16:51:57 +0000 (11:51 -0500)]
GlobalISel: Fix lower bswap for vectors

This would hit an assertion from trying to use the wrong bitwidth for
the constants.

16 months ago[PowerPC] Disable sanitizer test due to failures when using LLD
Nemanja Ivanovic [Mon, 16 Mar 2020 17:26:51 +0000 (12:26 -0500)]
[PowerPC] Disable sanitizer test due to failures when using LLD

This test case fails due to different handling of weak items between
LLD and LD on PPC. The issue only occurs when the default linker is LLD
and the test case is run on a system where ASLR is enabled.

16 months agoAMDGPU/GlobalISel: Fix handling of G_ANYEXT with s1 source
Matt Arsenault [Thu, 20 Feb 2020 22:01:45 +0000 (17:01 -0500)]
AMDGPU/GlobalISel: Fix handling of G_ANYEXT with s1 source

We were letting G_ANYEXT with a vcc register bank through, which was
incorrect and would select to an invalid copy. Fix this up like G_ZEXT
and G_SEXT. Also drop old code to fixup the non-boolean case in
RegBankSelect. We now have to perform that expansion during selection,
so there's no benefit to doing it during RegBankSelect.

16 months agoAMDGPU/GlobalISel: Fix some illegal scalar argument types
Matt Arsenault [Mon, 24 Feb 2020 21:38:59 +0000 (16:38 -0500)]
AMDGPU/GlobalISel: Fix some illegal scalar argument types

Fixes integers that don't evenly divide to i32 pieces. We should
probably extract some of the code in the legalizer to start handling
argument breakdowns. I'm dissatisfied with the argument lowering's
handling of vectors for example, and we should not be producing the
weird G_EXTRACTs we do now.

16 months agoImplement _LIBCPP_SUPPRESS_DEPRECATED_XXX when testing MSVC's STL
Casey Carter [Mon, 16 Mar 2020 16:50:23 +0000 (09:50 -0700)]

...to properly silence clang deprecation warnings in `test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp`.

16 months ago[DexTer] Add step.UNKNOWN check for NoneType line numbers.
Tom Weaver [Mon, 16 Mar 2020 16:38:41 +0000 (16:38 +0000)]
[DexTer] Add step.UNKNOWN check for NoneType line numbers.

Summary: It's possible for an instance of the visual studio debugger
to return a NoneType line number location when stepping during a
debugging session.

This patches teaches DexTer how to handle this particular case without
crashing out.

Reviewers: Orlando

Differential revision: https://reviews.llvm.org/D75992

16 months agoMinor fix to a comment in CodeGenPrepare.cpp
Juneyoung Lee [Mon, 16 Mar 2020 16:10:02 +0000 (01:10 +0900)]
Minor fix to a comment in CodeGenPrepare.cpp

16 months agoAMDGPU: Drop special case f64 fround lowering
Matt Arsenault [Tue, 24 Dec 2019 16:22:18 +0000 (11:22 -0500)]
AMDGPU: Drop special case f64 fround lowering

The result is better if ftrunc is emitted and separately legalized
when unavailable.

16 months ago[AST] Correct the CXXOperatorCallExpr source range.
Haojian Wu [Mon, 16 Mar 2020 15:37:19 +0000 (16:37 +0100)]
[AST] Correct the CXXOperatorCallExpr source range.

Previously, the range for "->" CXXOperatorCallExpr is the range of the
class object (not including the operator!), e.g. "[[vector_ptr]]->size()".

This patch includes the range of the operator, which fixes the issue
where clangd doesn't go to the overloaded operator "->" definition.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D76128

16 months agoRevert "[AST] Move dependence computations into a separate file"
Haojian Wu [Mon, 16 Mar 2020 15:49:38 +0000 (16:49 +0100)]
Revert "[AST] Move dependence computations into a separate file"

This reverts commit ddd20ed1586c55947e84620d674a60c118ec6905.
The patch was landed by accident.

16 months ago[AST] Move dependence computations into a separate file
Ilya Biryukov [Mon, 27 Jan 2020 13:54:11 +0000 (14:54 +0100)]
[AST] Move dependence computations into a separate file

To group the code in one place, simplify it and make it easier to add
the containsErrors bit and find existing bugs.

16 months ago[lldb/Reproducers] Decode run-length encoding in GDB replay server.
Jonas Devlieghere [Mon, 16 Mar 2020 15:34:51 +0000 (08:34 -0700)]
[lldb/Reproducers] Decode run-length encoding in GDB replay server.

The GDB replay server sanity-checks that every packet it receives
matches what it expects from the serialized packet log. This mechanism
tripped for TestReproducerAttach.py on Linux, because one of the packets
(jModulesInfo) uses run-length encoding. The replay server was comparing
the expanded incoming packet with the unexpanded packet in the log. As a
result, it claimed to have received an unexpected packet, which caused
the test to fail.

This patch addresses that issue by expanding the run-length encoding
before comparing the packets.

Differential revision: https://reviews.llvm.org/D76163

16 months agoGlobalISel: Fix round lowering
Matt Arsenault [Sat, 14 Mar 2020 18:52:48 +0000 (14:52 -0400)]
GlobalISel: Fix round lowering

I used the implementation for floor instead of round. It also turns
out the OpenCL builtin library wasn't using the round builtin, but
implemented the expanded form.

16 months agoRevert "[gn build] (manually) port 8b409eaba"
Nico Weber [Mon, 16 Mar 2020 15:33:03 +0000 (11:33 -0400)]
Revert "[gn build] (manually) port 8b409eaba"

This reverts commit 85462aefb527eaa4a6a7563f9341ceab283cdf1f
and follow-up 8d6582aa6bbd952744abd1f3cb74065f96535169.

8b409eaba was reverted.

16 months ago[lldb] Re-add nullptr check to IRForTarget::RewriteObjCConstString log statement
Raphael Isemann [Mon, 16 Mar 2020 15:21:32 +0000 (16:21 +0100)]
[lldb] Re-add nullptr check to IRForTarget::RewriteObjCConstString log statement

The nullptr check here was removed in 4ef50a33b12825593a82ca8ea97158b7b71b348e
when I replaced (nearly) all log->Print to LLDB_LOG calls (which automatically
check for this stuff). But it seems this one call escaped my sed call.

Currently working on a test that can cover this code path but we can revert
this until I have found one.

16 months ago[GlobalISel] add additional lowering support for G_INSERT
Dominik Montada [Wed, 11 Mar 2020 11:18:59 +0000 (12:18 +0100)]
[GlobalISel] add additional lowering support for G_INSERT

Summary: Add lowering support for inserting pointers or scalars into scalars, vectors or pointers

Reviewers: arsenm, dsanders

Reviewed By: arsenm

Subscribers: jvesely, wdng, nhaehnle, rovka, hiraditya, volkan, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75994

16 months agoRevert "[SVE] Auto-generate builtins and header for svld1."
Sander de Smalen [Mon, 16 Mar 2020 15:22:15 +0000 (15:22 +0000)]
Revert "[SVE] Auto-generate builtins and header for svld1."

This reverts commit 8b409eabaf755c88a7d652fe99d3ad858a4fe82a.

Reverting this patch for now because it breaks some buildbots.

16 months agoFix typo in parameter name.
Adrian Prantl [Mon, 16 Mar 2020 15:05:46 +0000 (08:05 -0700)]
Fix typo in parameter name.

16 months agoRevert "Disable memcpy-inline-fails.ll for windows"
Guillaume Chatelet [Mon, 16 Mar 2020 15:03:39 +0000 (16:03 +0100)]
Revert "Disable memcpy-inline-fails.ll for windows"

This reverts commit adc2e250a1ca2089f870a7239231f4c8cec16546.

16 months agoAMDGPU/GlobalISel: Make some large merges legal
Matt Arsenault [Mon, 16 Mar 2020 14:42:15 +0000 (10:42 -0400)]
AMDGPU/GlobalISel: Make some large merges legal

We allow up to 1024-bit registers, so we should support merges all the
way to the maximum.

16 months ago[Object] Change ELFObjectFile<ELFT>::getFileFormatName() to use BFD names
Fangrui Song [Thu, 12 Mar 2020 05:00:19 +0000 (22:00 -0700)]
[Object] Change ELFObjectFile<ELFT>::getFileFormatName() to use BFD names

Follow-up for D74433

What the function returns are almost standard BFD names, except that "ELF" is
in uppercase instead of lowercase.

This patch changes "ELF" to "elf" and changes ARM/AArch64 to use their BFD names.
MIPS and PPC64 have endianness differences as well, but this patch does not intend to address them.


* llvm-objdump: the "file format " line matches GNU objdump on ARM/AArch64 objects
* "file format " line can be extracted and fed into llvm-objcopy -O literally.
  (https://github.com/ClangBuiltLinux/linux/issues/779 has such a use case)

Affected tools: llvm-readobj, llvm-objdump, llvm-dwarfdump, MCJIT (internal implementation detail, not exposed)

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D76046

16 months ago[gn build] Port f62b898c1f5
LLVM GN Syncbot [Mon, 16 Mar 2020 13:54:40 +0000 (13:54 +0000)]
[gn build] Port f62b898c1f5

16 months ago[gn build] (manually) port 8b409eaba more
Nico Weber [Mon, 16 Mar 2020 13:52:47 +0000 (09:52 -0400)]
[gn build] (manually) port 8b409eaba more

16 months ago[TargetLowering] Only demand a funnelshift's modulo amount bits
Simon Pilgrim [Mon, 16 Mar 2020 13:46:28 +0000 (13:46 +0000)]
[TargetLowering] Only demand a funnelshift's modulo amount bits

ISD::FSHL/FSHR shift amount values are guaranteed to act as a modulo amount, so for power-of-2 bitwidths we only need the lowest bits.

16 months ago[gn build] (manually) port 8b409eaba
Nico Weber [Mon, 16 Mar 2020 13:46:01 +0000 (09:46 -0400)]
[gn build] (manually) port 8b409eaba

16 months ago[GlobalISel] combine G_TRUNC with G_MERGE_VALUES
Dominik Montada [Mon, 9 Mar 2020 16:00:38 +0000 (17:00 +0100)]
[GlobalISel] combine G_TRUNC with G_MERGE_VALUES

Truncating the result of a merge means that most likely we could have done without merge in the first place and just used the input merge inputs directly. This can be done in three cases:

1. If the truncation result is smaller than the merge source, we can use the source in the trunc directly
2. If the sizes are the same, we can replace the register or use a copy
3. If the truncation size is a multiple of the merge source size, we can build a smaller merge

This gets rid of most of the larger, hard-to-legalize merges.

Reviewers: qcolombet, aditya_nandakumar, aemerson, paquette, arsenm, Petar.Avramovic

Reviewed By: arsenm

Subscribers: sdardis, jvesely, wdng, nhaehnle, rovka, jrtc27, atanasyan, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75915

16 months ago[ExpandMemCmp] Correctly set alignment of generated loads
Juneyoung Lee [Mon, 16 Mar 2020 13:38:29 +0000 (22:38 +0900)]
[ExpandMemCmp] Correctly set alignment of generated loads

This is a part of the series of efforts for correcting alignment of memory operations.
(Another related bugs: https://bugs.llvm.org/show_bug.cgi?id=44388 , https://bugs.llvm.org/show_bug.cgi?id=44543 )

This fixes https://bugs.llvm.org/show_bug.cgi?id=43880 by giving default alignment of loads to 1.

The test CodeGen/AArch64/bcmp-inline-small.ll should have been changed; it was introduced by https://reviews.llvm.org/D64805 . I talked with @evandro, and confirmed that the test is okay to be changed.
Other two tests from PowerPC needed changes as well, but fixes were straightforward.

Reviewers: courbet

Reviewed By: courbet

Subscribers: nlopes, gchatelet, wuzish, nemanjai, kristof.beyls, hiraditya, steven.zhang, danielkiss, llvm-commits, evandro

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76113

16 months ago[lldb] Remove unimplemented StackFrame::BehavesLikeZerothFrame
Tatyana Krasnukha [Mon, 16 Mar 2020 13:19:22 +0000 (16:19 +0300)]
[lldb] Remove unimplemented StackFrame::BehavesLikeZerothFrame

Commit [1] added a declaration of function-member
StackFrame::BehavesLikeZerothFrame but hasn't added an implementation
for the function. This commit removes this declation, because the
function is not used anywhere.

[1] 31e6dbe1c6a6 Fix PC adjustment in StackFrame::GetSymbolContext

Differential Revision: https://reviews.llvm.org/D75979

Patch by Anton Kolesov <Anton.Kolesov@synopsys.com>

16 months ago[lldb] Copy m_behaves_like_zeroth_frame on stack frame update
Tatyana Krasnukha [Mon, 16 Mar 2020 13:13:26 +0000 (16:13 +0300)]
[lldb] Copy m_behaves_like_zeroth_frame on stack frame update

Fix to code from https://reviews.llvm.org/D64993.

Field StackFrame::m_behaves_like_zeroth_frame was introduced in commit
[1], however that commit hasn't added a copying of the field to
UpdatePreviousFrameFromCurrentFrame, therefore the value wouldn't change
when updating frames to reflect the current situation.

The particular scenario, where this matters is following. Assume we have
function main that invokes function func1. We set breakpoint at
func1 entry and in main after the func1 call, and do not stop at
the main entry. Therefore, when debugger stops for the first time,
func1 is frame#0, while main is frame#1, thus
m_behaves_like_zeroth_frame is set to 0 for main frame. Execution is
resumed, and stops now in main, where it is now frame#0. However while
updating the frame object, m_behaves_like_zeroth_frame remains false.
This field plays an important role when calculating line information for
backtrace: for frame#0, PC is the current line, therefore line
information is retrieved for PC, however for all other frames this is
not the case - calculated PC is a return-PC, i.e. instruction after the
function call line, therefore for those frames LLDB needs to step back
by one instruction. Initial implementation did this strictly for frames
that have index != 0 (and index is updated properly in
UpdatePreviousFrameFromCurrentFrame), but m_behaves_like_zeroth_frame
added a capability for middle-of-stack frames to behave in a similar
manner. But because current code now doesn't check frame idx,
m_behaves_like_zeroth_frame must be set to true for frames with 0 index,
not only for frame that behave like one. In the described test case,
after stopping in main, LLDB would still consider frame#0 as
non-zeroth, and would subtract instruction from the PC, and would report
previous like as current line.

The error doesn't manifest itself in LLDB interpreter though - it can be
reproduced through LLDB-MI and when using SB API, but not when we
interpreter command "continue" is executed. Honestly, I didn't fully
understand why it works in interpreter, I did found that bug "fixes"
itself if I enable DEBUG_STACK_FRAMES in StackFrameList.cpp, because
that calls StackFrame::Dump and that calls
GetSymbolContext(eSymbolContextEverything), which fills the context of
frame on the first breakpoint, therefore it doesn't have to be
recalculated (improperly) on a second frame. However, on first
breakpoint symbol context is calculated for the "call" line, not the
next one, therefore it should be recalculated anyway on a second
breakpoint, and it is done correctly, even though
m_behaves_like_zeroth_frame is still incorrect, as long as
GetSymbolContext(eSymbolContextEverything) has been called.

[1] 31e6dbe1c6a6 Fix PC adjustment in StackFrame::GetSymbolContext

Differential Revision: https://reviews.llvm.org/D75975

Patch by Anton Kolesov <Anton.Kolesov@synopsys.com>

16 months agoAdd tests to ExpandMemCmp/X86/memcmp.ll before submitting D76113
Juneyoung Lee [Mon, 16 Mar 2020 13:19:37 +0000 (22:19 +0900)]
Add tests to ExpandMemCmp/X86/memcmp.ll before submitting D76113

16 months agoDisable memcpy-inline-fails.ll for windows
Guillaume Chatelet [Mon, 16 Mar 2020 13:10:08 +0000 (14:10 +0100)]
Disable memcpy-inline-fails.ll for windows

16 months ago[yaml2obj][test] - Fix comments in ELF/program-header-address.yaml test. NFC.
Georgii Rymar [Mon, 16 Mar 2020 13:05:10 +0000 (16:05 +0300)]
[yaml2obj][test] - Fix comments in ELF/program-header-address.yaml test. NFC.

This addresses post-commit comments suggested by James Henderson for D76131.

16 months ago[NFC][TTI] Remove static_casts
Sam Parker [Mon, 16 Mar 2020 12:55:41 +0000 (12:55 +0000)]
[NFC][TTI] Remove static_casts

Introduce a variable for 'this' instead of calling static_cast
multiple times in TargetTransformInfoImpl.h

16 months ago[X86] X86::isConstantSplat - enable partial undef bit handling by default.
Simon Pilgrim [Mon, 16 Mar 2020 12:55:57 +0000 (12:55 +0000)]
[X86] X86::isConstantSplat - enable partial undef bit handling by default.

We currently only ever use this for lowering constant uniform values (shift/rotate by immediate) so we can safely enable it by default (it treats the undef bits as zero when extracting constants).

This is necessary for an upcoming patch that will use SimplifyDemandedBits more aggressively on funnel shift amounts and causes regressions in vXi64 constant without it.

16 months ago[X86] LowerRotate - use X86::isConstantSplat to detect constant splat rotation amounts.
Simon Pilgrim [Mon, 16 Mar 2020 11:44:03 +0000 (11:44 +0000)]
[X86] LowerRotate - use X86::isConstantSplat to detect constant splat rotation amounts.

Avoid code duplication and matches what we do for the similar LowerFunnelShift and LowerScalarImmediateShift methods.

16 months ago[AST] rename DependencyFlags.h => DependenceFlags.h, NFC
Haojian Wu [Mon, 16 Mar 2020 12:43:40 +0000 (13:43 +0100)]
[AST] rename DependencyFlags.h => DependenceFlags.h, NFC

We forgot to fix in the previous patch.

16 months ago[NFC][TTI] Use switch in getCastInstrCost
Sam Parker [Mon, 16 Mar 2020 12:48:12 +0000 (12:48 +0000)]
[NFC][TTI] Use switch in getCastInstrCost

Introduce a switch statement for trunc, bitcast, addrspacecast and
zext in BasicTTIImpl.

16 months agoDisable llvm-objdump --debug-vars tests on Windows
Oliver Stannard [Mon, 16 Mar 2020 12:48:13 +0000 (12:48 +0000)]
Disable llvm-objdump --debug-vars tests on Windows

These tests passed in my Windows 10 VM, but are failing on Windows bots
with errors which look related to unicode encodings. Disable the tests
on Windows for now.

16 months ago[lldb] Hardcode target in dwo-type-in-main-file.s test
Pavel Labath [Mon, 16 Mar 2020 12:21:21 +0000 (13:21 +0100)]
[lldb] Hardcode target in dwo-type-in-main-file.s test

16 months agoAdd AllowMissingMoveFunctionsWhenCopyIsDeleted flag to cppcoreguidelines-special...
Paweł Barań [Mon, 16 Mar 2020 12:13:40 +0000 (08:13 -0400)]
Add AllowMissingMoveFunctionsWhenCopyIsDeleted flag to cppcoreguidelines-special-member-functions

The flag allows classes to don't define move operations when copy operations
are explicitly deleted. This flag is related to Google C++ Style Guide

16 months ago[SystemZ] Avoid scalarization of [SU]INT_TO_FP ISD-nodes.
Jonas Paulsson [Sat, 14 Mar 2020 09:26:53 +0000 (10:26 +0100)]
[SystemZ]  Avoid scalarization of [SU]INT_TO_FP ISD-nodes.

The type legalizer will scalarize vector conversions from integer to floating
point if the source element size is less than that of the result.

This is avoided now by inserting a zero/sign-extension of the source vector
before type legalization.

Review: Ulrich Weigand

Differential revision: https://reviews.llvm.org/D75978

16 months agoDon't run PowerPC objdump tests when PowerPC backend not built
Oliver Stannard [Mon, 16 Mar 2020 12:00:12 +0000 (12:00 +0000)]
Don't run PowerPC objdump tests when PowerPC backend not built

16 months ago[llvm-objdump] Add llvm_unreachable to silence GCC warning. NFC.
Martin Storsjö [Mon, 16 Mar 2020 11:32:37 +0000 (13:32 +0200)]
[llvm-objdump] Add llvm_unreachable to silence GCC warning. NFC.

GCC 7 warned about control reaching the end of the non-void function,
despite all 7 LineChar values being handled in the switch.

16 months agoDon't run ARM objdump tests when ARM backend not built
Oliver Stannard [Mon, 16 Mar 2020 11:24:19 +0000 (11:24 +0000)]
Don't run ARM objdump tests when ARM backend not built

16 months ago[DebugInfo] Handle generic type DW_OP_convert ops in dsymutil
David Stenberg [Mon, 16 Mar 2020 10:47:53 +0000 (11:47 +0100)]
[DebugInfo] Handle generic type DW_OP_convert ops in dsymutil

This is a preparatory change for allowing LLVM to emit DW_OP_convert
operations converting to the generic type.

If DW_OP_convert's operand is 0, it converts the top of the stack to the
generic type, as specified by DWARFv5 section

"[...] takes one operand, which is an unsigned LEB128 integer that
 represents the offset of a debugging information entry in the current
 compilation unit, or value 0 which represents the generic type."

This adds support for such operations to dsymutil.

Reviewers: aprantl, markus, friss, JDevlieghere

Reviewed By: aprantl, JDevlieghere

Subscribers: hiraditya, llvm-commits

Tags: #debug-info, #llvm

Differential Revision: https://reviews.llvm.org/D76142

16 months ago[lldb/DWARF] Fix crash when a dwo compile unit refers to a non-dwo type
Pavel Labath [Mon, 16 Mar 2020 11:11:09 +0000 (12:11 +0100)]
[lldb/DWARF] Fix crash when a dwo compile unit refers to a non-dwo type

In this case dwo_num can be None => stop assuming it can't.

16 months ago[llvm-objdump] Add entry_value and stack_value opcodes
Oliver Stannard [Wed, 19 Feb 2020 12:34:12 +0000 (12:34 +0000)]
[llvm-objdump] Add entry_value and stack_value opcodes

Add the DW_OP_entry_value and DW_OP_stack_value opcodes to the DWARF
expression printer.

Differential revision: https://reviews.llvm.org/D74843

16 months ago[llvm-objdump] Add simple memory expressions to variable display
Oliver Stannard [Wed, 19 Feb 2020 12:24:19 +0000 (12:24 +0000)]
[llvm-objdump] Add simple memory expressions to variable display

Add the DW_OP_breg0..DW_OP_breg31 and DW_OP_bregx opcodes to the DWARF
expression printer.

Differential revision: https://reviews.llvm.org/D74841

16 months ago[DebugInfo] Add unit test for compact expression printer
Oliver Stannard [Thu, 27 Feb 2020 10:39:14 +0000 (10:39 +0000)]
[DebugInfo] Add unit test for compact expression printer

Add a unit test for the compact DWARF expression printer which will be
used by the llvm-objdump --debug-vars option.

Differential revision: https://reviews.llvm.org/D75250

16 months ago[llvm-objdump] Display locations of variables alongside disassembly
Oliver Stannard [Mon, 9 Dec 2019 15:16:47 +0000 (15:16 +0000)]
[llvm-objdump] Display locations of variables alongside disassembly

This adds the --debug-vars option to llvm-objdump, which prints
locations (registers/memory) of source-level variables alongside the
disassembly based on DWARF info. A vertical line is printed for each
live-range, with a label at the top giving the variable name and
location, and the position and length of the line indicating the program
counter range in which it is valid.

Currently, this only works for object files, not executables or shared

Differential revision: https://reviews.llvm.org/D70720

16 months ago[SVE] Auto-generate builtins and header for svld1.
Sander de Smalen [Mon, 16 Mar 2020 10:14:05 +0000 (10:14 +0000)]
[SVE] Auto-generate builtins and header for svld1.

This is a first patch in a series for the SveEmitter to generate the arm_sve.h
header file and builtins.

I've tried my best to strip down this patch as best as I could, but there
are still a few changes that are not necessarily exercised by the load intrinsics
in this patch, mostly around the SVEType class which has some common logic to
represent types from a type and prototype string. I thought it didn't make
much sense to remove that from this patch and split it up.

Reviewers: efriedma, rovka, SjoerdMeijer, rsandifo-arm, rengolin

Reviewed By: SjoerdMeijer

Tags: #clang

Differential Revision: https://reviews.llvm.org/D75470

16 months ago[DebugInfo] Handle generic type DW_OP_convert ops in llvm-dwarfdump
David Stenberg [Mon, 16 Mar 2020 09:53:17 +0000 (10:53 +0100)]
[DebugInfo] Handle generic type DW_OP_convert ops in llvm-dwarfdump

This is a preparatory change for allowing LLVM to emit DW_OP_convert
operations converting to the generic type.

If DW_OP_convert's operand is 0, it converts the top of stack to the
generic type, as specified by DWARFv5 section

"[...] takes one operand, which is an unsigned LEB128 integer that
 represents the offset of a debugging information entry in the current
 compilation unit, or value 0 which represents the generic type."

This adds support for such operations to llvm-dwarfdump.

Reviewers: aprantl, markus, jdoerfert, jhenderson

Reviewed By: aprantl

Subscribers: hiraditya, llvm-commits

Tags: #debug-info, #llvm

Differential Revision: https://reviews.llvm.org/D76141

16 months ago[NFC][MC] Rename alignBranches* to emitInstruction*
Shengchen Kan [Mon, 16 Mar 2020 08:52:31 +0000 (16:52 +0800)]
[NFC][MC] Rename alignBranches* to emitInstruction*

alignBranches is X86 specific, change the name in a
more general one since other target can do some state
chang before and after emitting the instruction.

16 months agoImplement CET Shadow Stack (Intel Controlflow Enforcement Technology) support on...
Rui Ueyama [Fri, 13 Mar 2020 10:41:18 +0000 (19:41 +0900)]
Implement CET Shadow Stack (Intel Controlflow Enforcement Technology) support on Windows

Patch by Petr Penzin.

Windows support for CET is limited to shadow stack, which is enabled
by setting a PE bit in the linker.


MSVC linker flag:


Differential Revision: https://reviews.llvm.org/D70606

16 months ago[obj2yaml][test] - Simplify call-graph-profile-section.yaml. NFCI.
Georgii Rymar [Mon, 16 Mar 2020 08:41:35 +0000 (11:41 +0300)]
[obj2yaml][test] - Simplify call-graph-profile-section.yaml. NFCI.

Use yaml2obj -D to simplify.
We started to use it for other tests recently.

16 months ago[NFC][X86] Simplify test cases for branch align
Shengchen Kan [Sat, 14 Mar 2020 22:09:04 +0000 (06:09 +0800)]
[NFC][X86] Simplify test cases for branch align

16 months ago[AVR] Add a release note about the AVR backend becoming an official backend
Dylan McKay [Mon, 16 Mar 2020 07:07:59 +0000 (20:07 +1300)]
[AVR] Add a release note about the AVR backend becoming an official backend

AVR has been enabled by default since
c480c584a0b7de675dddb2616122fc218cd72c0e, the tests have been stable for
a couple days now, revert extremely unlikely.

16 months ago[MIPS] Implement PUL.PS and PUU.PS instructions
Simon Atanasyan [Fri, 13 Mar 2020 16:15:55 +0000 (19:15 +0300)]
[MIPS] Implement PUL.PS and PUU.PS instructions

Patch by Michael Roe.

Differential Revision: https://reviews.llvm.org/D75812

16 months ago[Verifier] Remove invalid verifier check
Serguei Katkov [Fri, 13 Mar 2020 04:06:13 +0000 (11:06 +0700)]
[Verifier] Remove invalid verifier check

According to LangRef for unordered atomic memory transfer intrinsics
"The first three arguments are the same as they are in the @llvm.memcpy intrinsic, with the added constraint that
 len is required to be a positive integer multiple of the element_size. If len is not a positive integer multiple
 of element_size, then the behaviour of the intrinsic is undefined."

So the len is not multiple of element size is just an undefined behavior and verifier should not complain about that
as undefined behavior is allowed in LLVM IR.

This change removes the verifier check for this condition

Reviewers: reames
Reviewed By: reames
Subscribers: dantrushin, hiraditya, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D76116

16 months ago[Coroutines] Do not evaluate InitListExpr of a co_return
Jun Ma [Fri, 13 Mar 2020 06:08:34 +0000 (14:08 +0800)]
[Coroutines] Do not evaluate InitListExpr of a co_return

Differential Revision: https://reviews.llvm.org/D76118

16 months ago[analyzer] Fix modeling some library functions when UCHAR_MAX > INT_MAX.
Artem Dergachev [Mon, 16 Mar 2020 04:03:23 +0000 (07:03 +0300)]
[analyzer] Fix modeling some library functions when UCHAR_MAX > INT_MAX.

This makes life easier for downstream users who maintain exotic
target platforms.

Patch by Vince Bridgers!

Differential Revision: https://reviews.llvm.org/D75529

16 months ago[debuginfo-tests] Update test for double-dash long-option.
Jonas Devlieghere [Mon, 16 Mar 2020 03:56:33 +0000 (20:56 -0700)]
[debuginfo-tests] Update test for double-dash long-option.

16 months ago[CodeGenPrepare] Freeze condition when transforming select to br
Juneyoung Lee [Sat, 14 Mar 2020 16:34:33 +0000 (01:34 +0900)]
[CodeGenPrepare] Freeze condition when transforming select to br

This is a simple fix for CodeGenPrepare that freezes branch condition when transforming select to branch.
If it is not frozen, instsimplify or the later pipeline can potentially exploit undefined behavior.

The diff shows optimized form becase D75859 and D76048 already made a few changes to CodeGenPrepare for optimizing freeze(cmp).

Reviewers: jdoerfert, spatel, lebedev.ri, efriedma

Reviewed By: lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76179

16 months agoRevert "[CodeGenPrepare] Freeze condition when transforming select to br"
Juneyoung Lee [Mon, 16 Mar 2020 03:45:54 +0000 (12:45 +0900)]
Revert "[CodeGenPrepare] Freeze condition when transforming select to br"

This reverts commit 10aa7ea951e22dbd7f2ebdeb6410cfbc8a251eb1.

16 months ago[lldb/Process] Include Unwind.h in FreeBSDThread
Jonas Devlieghere [Mon, 16 Mar 2020 03:38:40 +0000 (20:38 -0700)]
[lldb/Process] Include Unwind.h in FreeBSDThread

Fixes member access into incomplete type 'lldb_private::Unwind'. Thank
you to Paulf for pointing this out.

16 months ago[lldb/Host] s/FindProcesses/FindProcessesImpl/ in freebsd/Host.cpp
Jonas Devlieghere [Mon, 16 Mar 2020 03:36:40 +0000 (20:36 -0700)]
[lldb/Host] s/FindProcesses/FindProcessesImpl/ in freebsd/Host.cpp

Fix the FreeBSD build. Thank you to Paulf for pointing this out.

16 months ago[lldb/Utils] Use PYTHON_EXECUTABLE to configure lldb-dotest's shebang
Jonas Devlieghere [Fri, 13 Mar 2020 23:40:02 +0000 (16:40 -0700)]
[lldb/Utils] Use PYTHON_EXECUTABLE to configure lldb-dotest's shebang

Ideally we'd want all shebangs to be configurable, but that's not a
viable solution. Given that lldb-dotest is already configured, we might
as well make sure it uses the correct interpreter.

Differential revision: https://reviews.llvm.org/D76167

16 months ago[MLIR] fix parse bound error message
Uday Bondhugula [Mon, 16 Mar 2020 02:56:30 +0000 (02:56 +0000)]
[MLIR] fix parse bound error message

- fix parse error message for affine for op's bounds

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D76198

16 months agoSupport prefix padding for alignment purposes (Relaxable instructions only)
Philip Reames [Mon, 16 Mar 2020 01:10:50 +0000 (18:10 -0700)]
Support prefix padding for alignment purposes (Relaxable instructions only)

Now that D75203 has landed and baked for a few days, extend the basic approach to prefix padding as well. The patch itself is fairly straight forward.

For the moment, this patch adds the functional support and some basic testing there of, but defaults to not enabling prefix padding. I want to be able to phrase a separate patch which adds the target specific reasoning and test it cleanly. I haven't decided whether I want to common it with the nop logic or not.

Differential Revision: https://reviews.llvm.org/D75300

16 months ago[NFC][Test] Add three tests to verify the behavior of a*b-c*d if there is multi-uses
QingShan Zhang [Mon, 16 Mar 2020 01:58:49 +0000 (01:58 +0000)]
[NFC][Test] Add three tests to verify the behavior of a*b-c*d if there is multi-uses

16 months ago[llvm-objdump] Require long options to use double-dash --long-option
Fangrui Song [Sun, 15 Mar 2020 23:47:49 +0000 (16:47 -0700)]
[llvm-objdump] Require long options to use double-dash --long-option

As announced here: http://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html

16 months ago[test] lld/test/: change llvm-objdump single-dash long options to double-dash options
Fangrui Song [Mon, 16 Mar 2020 00:47:44 +0000 (17:47 -0700)]
[test] lld/test/: change llvm-objdump single-dash long options to double-dash options

16 months ago[test] llvm/test/: change llvm-objdump single-dash long options to double-dash options
Fangrui Song [Sun, 15 Mar 2020 23:17:52 +0000 (16:17 -0700)]
[test] llvm/test/: change llvm-objdump single-dash long options to double-dash options

As announced here: http://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html

Grouped option syntax (POSIX Utility Conventions) does not play well with -long-option
A subsequent change will reject -long-option.

16 months ago[X86] Add a non-zero cost for truncating v32i16->v32i8 on avx512bw.
Craig Topper [Mon, 16 Mar 2020 00:18:46 +0000 (17:18 -0700)]
[X86] Add a non-zero cost for truncating v32i16->v32i8 on avx512bw.

16 months ago[compiler-rt] [netbsd] Add support for the MKIPFILTER=no distribution
Kamil Rytarowski [Sun, 15 Mar 2020 23:39:02 +0000 (00:39 +0100)]
[compiler-rt] [netbsd] Add support for the MKIPFILTER=no distribution

Add fallback definition for the IPFilter ioctl commands.

16 months ago[llvm-objdump][test] Change llvm-objdump tests to use double dash options
Fangrui Song [Sun, 15 Mar 2020 22:30:18 +0000 (15:30 -0700)]
[llvm-objdump][test] Change llvm-objdump tests to use double dash options

16 months agoRevert "[ORC] Enable JITEventListeners in the RTDyldObjectLinkingLayer."
Lang Hames [Sun, 15 Mar 2020 22:34:37 +0000 (15:34 -0700)]
Revert "[ORC] Enable JITEventListeners in the RTDyldObjectLinkingLayer."

This reverts commit 98f2bb4461072347dcca7d2b1b9571b3a6525801.

Reverting while I investigate bot failures.

16 months ago[gn build] don't repeat arm header targets twice. no behavior change.
Nico Weber [Sun, 15 Mar 2020 22:20:17 +0000 (18:20 -0400)]
[gn build] don't repeat arm header targets twice. no behavior change.

16 months ago[llvm-objdump][test] Move {AArch64,ARM}/* to ELF/ARM/ or MachO/ARM/ and {AMDGPU,Hexag...
Fangrui Song [Sun, 15 Mar 2020 22:07:25 +0000 (15:07 -0700)]
[llvm-objdump][test] Move {AArch64,ARM}/* to ELF/ARM/ or MachO/ARM/ and {AMDGPU,Hexagon,Mips,powerPC}/ to ELF/

16 months ago[ORC] Enable JITEventListeners in the RTDyldObjectLinkingLayer.
Lang Hames [Mon, 9 Mar 2020 06:00:48 +0000 (23:00 -0700)]
[ORC] Enable JITEventListeners in the RTDyldObjectLinkingLayer.

Enable use of ExecutionEngine JITEventListeners in RTDyldObjectLinkingLayer.
This allows existing MCJIT clients to more easily migrate to LLJIT / ORCv2.

Example usage in llvm/examples/OrcV2Examples/LLJITWithGDBRegistrationListener.

Differential Revision: https://reviews.llvm.org/D75838

16 months ago[llvm-objdump][test] Move {AArch64,X86}/macho-* to MachO/
Fangrui Song [Sun, 15 Mar 2020 21:51:33 +0000 (14:51 -0700)]
[llvm-objdump][test] Move {AArch64,X86}/macho-* to MachO/

16 months agoAMDGPU/GlobalISel: Remove -global-isel-abort=0 from some tests
Matt Arsenault [Sun, 15 Mar 2020 20:58:26 +0000 (16:58 -0400)]
AMDGPU/GlobalISel: Remove -global-isel-abort=0 from some tests

16 months agoAMDGPU/GlobalISel: Add more tests for G_SADDE/G_SSUBE
Matt Arsenault [Thu, 27 Feb 2020 00:19:16 +0000 (19:19 -0500)]
AMDGPU/GlobalISel: Add more tests for G_SADDE/G_SSUBE

These don't work, but add baseline tests.

16 months ago[gn build] Port 5087ace6519
LLVM GN Syncbot [Sun, 15 Mar 2020 20:28:52 +0000 (20:28 +0000)]
[gn build] Port 5087ace6519

16 months ago[gn build] (manually) port 5087ace6519 more
Nico Weber [Sun, 15 Mar 2020 20:28:19 +0000 (16:28 -0400)]
[gn build] (manually) port 5087ace6519 more

16 months ago[Driver][test] Add a specific test file for -fmerge-all-constants
Fangrui Song [Sun, 15 Mar 2020 20:06:47 +0000 (13:06 -0700)]
[Driver][test] Add a specific test file for -fmerge-all-constants

Also, delete the option from the `// Test that we don't error on these.` block in test/Driver/clang_f_opts.c

16 months ago[gn build] (manually) port 5087ace6519
Nico Weber [Sun, 15 Mar 2020 20:06:37 +0000 (16:06 -0400)]
[gn build] (manually) port 5087ace6519

16 months agoAMDGPU/GlobalISel: Add baseline test for mul
Matt Arsenault [Sun, 15 Mar 2020 18:53:24 +0000 (14:53 -0400)]
AMDGPU/GlobalISel: Add baseline test for mul

16 months agoAMDGPU/GlobalISel: Add baseline test for mul
Matt Arsenault [Thu, 27 Feb 2020 14:32:25 +0000 (09:32 -0500)]
AMDGPU/GlobalISel: Add baseline test for mul