OSDN Git Service

android-x86/external-llvm.git
5 years ago[mips] Use mult/mflo pattern on 64-bit targets prior to MIPS64
Simon Atanasyan [Wed, 17 Jul 2019 08:11:40 +0000 (08:11 +0000)]
[mips] Use mult/mflo pattern on 64-bit targets prior to MIPS64

The `MUL` instruction is available starting from the MIPS32/MIPS64 targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366301 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Implement .cplocal directive
Simon Atanasyan [Wed, 17 Jul 2019 08:11:31 +0000 (08:11 +0000)]
[mips] Implement .cplocal directive

This directive forces to use the alternate register for context pointer.
For example, this code:
  .cplocal $4
  jal foo
expands to:
  ld    $25, %call16(foo)($4)
  jalr  $25

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366300 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Support the "o" inline asm constraint
Simon Atanasyan [Wed, 17 Jul 2019 08:11:15 +0000 (08:11 +0000)]
[mips] Support the "o" inline asm constraint

As well as other LLVM targets we do not handle "offsettable"
memory addresses in any special way. In other words, the "o" constraint
is an exact equivalent of the "m" one. But some existing code require
the "o" constraint support.

This fixes PR42589.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366299 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LoopInfo] Fix getUniqueNonLatchExitBlocks
Serguei Katkov [Wed, 17 Jul 2019 07:09:20 +0000 (07:09 +0000)]
[LoopInfo] Fix getUniqueNonLatchExitBlocks

It is possible that exit block has two predecessors and one of them is a latch
block while another is not.

Current algorithm is based on the assumption that all exits are dedicated
and therefore we can check only first predecessor of loop exit to find all unique
exits.

However if we do not consider latch block and it is first predecessor of some
exit then this exit will be found.

Regression test is added.

As a side effect of algorithm re-writing, the restriction that all exits are dedicated
is eliminated.

Reviewers: reames, fhahn, efriedma
Reviewed By: efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D64787

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366294 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUpdate email address.
Qiu Chaofan [Wed, 17 Jul 2019 07:02:02 +0000 (07:02 +0000)]
Update email address.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366291 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r366265
Nico Weber [Wed, 17 Jul 2019 01:21:14 +0000 (01:21 +0000)]
gn build: Merge r366265

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366289 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r366216
Nico Weber [Wed, 17 Jul 2019 01:19:30 +0000 (01:19 +0000)]
gn build: Merge r366216

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366288 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Autogenerate register asm names
Stanislav Mekhanoshin [Tue, 16 Jul 2019 23:44:21 +0000 (23:44 +0000)]
[AMDGPU] Autogenerate register asm names

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366283 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoARM: Fix missing immarg for space intrinsic
Matt Arsenault [Tue, 16 Jul 2019 22:41:38 +0000 (22:41 +0000)]
ARM: Fix missing immarg for space intrinsic

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366280 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoGlobalISel: Add overload of handleAssignments with CCState
Matt Arsenault [Tue, 16 Jul 2019 22:41:34 +0000 (22:41 +0000)]
GlobalISel: Add overload of handleAssignments with CCState

AMDGPU needs to allocate special argument registers separately from
the user function argument list, so needs direct control over the
CCState.

The ArgLocs argument is only really necessary because CCState doesn't
allow access to it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366279 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TableGen] Generate offsets into a flat array for getOperandType
Justin Bogner [Tue, 16 Jul 2019 22:39:18 +0000 (22:39 +0000)]
[TableGen] Generate offsets into a flat array for getOperandType

Rather than an array of std::initializer_list, generate a table of
offsets and a flat array of the operands for getOperandType. This is a
bit more efficient on platforms that don't manage to get the array of
inintializer_lists initialized at link time (I'm looking at you
macOS). It's also quite quite a bit faster to compile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366278 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Compile all TLS on Emscripten as local-exec
Guanzhong Chen [Tue, 16 Jul 2019 22:22:08 +0000 (22:22 +0000)]
[WebAssembly] Compile all TLS on Emscripten as local-exec

Summary:
Currently, on Emscripten, dynamic linking is not supported with threads.
This means that if thread-local storage is used, it must be used in a
statically-linked executable. Hence, local-exec is the only possible model.

This diff compiles all TLS variables to use local-exec on Emscripten as a
temporary measure until dynamic linking is supported with threads.

The goal for this is to allow C++ types with constructors to be thread-local.

Currently, when `clang` compiles a `thread_local` variable with a constructor,
it generates `__tls_guard` variable:

    @__tls_guard = internal thread_local global i8 0, align 1

As no TLS model is specified, this is treated as general-dynamic, which we do
not support (and cannot support without implementing dynamic linking support
with threads in Emscripten). As a result, any C++ constructor in `thread_local`
variables would not compile.

By compiling all `thread_local` as local-exec, `__tls_guard` will compile and
we can support C++ constructors with TLS without implementing dynamic linking
with threads.

Depends on D64537

Reviewers: tlively, aheejin, sbc100

Reviewed By: aheejin

Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366275 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TableGen] Add "getOperandType" to get operand types from opcode/opidx
Justin Bogner [Tue, 16 Jul 2019 22:10:16 +0000 (22:10 +0000)]
[TableGen] Add "getOperandType" to get operand types from opcode/opidx

The InstrInfoEmitter outputs an enum called "OperandType" which gives
numerical IDs to each operand type. This patch makes use of this enum
to define a function called "getOperandType", which allows looking up
the type of an operand given its opcode and operand index.

Patch by Nicolas Guillemot. Thanks!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366274 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Implement thread-local storage (local-exec model)
Guanzhong Chen [Tue, 16 Jul 2019 22:00:45 +0000 (22:00 +0000)]
[WebAssembly] Implement thread-local storage (local-exec model)

Summary:
Thread local variables are placed inside a `.tdata` segment. Their symbols are
offsets from the start of the segment. The address of a thread local variable
is computed as `__tls_base` + the offset from the start of the segment.

`.tdata` segment is a passive segment and `memory.init` is used once per thread
to initialize the thread local storage.

`__tls_base` is a wasm global. Since each thread has its own wasm instance,
it is effectively thread local. Currently, `__tls_base` must be initialized
at thread startup, and so cannot be used with dynamic libraries.

`__tls_base` is to be initialized with a new linker-synthesized function,
`__wasm_init_tls`, which takes as an argument a block of memory to use as the
storage for thread locals. It then initializes the block of memory and sets
`__tls_base`. As `__wasm_init_tls` will handle the memory initialization,
the memory does not have to be zeroed.

To help allocating memory for thread-local storage, a new compiler intrinsic
is introduced: `__builtin_wasm_tls_size()`. This instrinsic function returns
the size of the thread-local storage for the current function.

The expected usage is to run something like the following upon thread startup:

    __wasm_init_tls(malloc(__builtin_wasm_tls_size()));

Reviewers: tlively, aheejin, kripken, sbc100

Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, jfb, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366272 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Partially revert r366250
Matt Arsenault [Tue, 16 Jul 2019 22:00:10 +0000 (22:00 +0000)]
AMDGPU: Partially revert r366250

GCCBuiltin doesn't work for these, because they have a mangled type
(although they arguably should not).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366271 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ORC][docs] Fix an RST error: the code-block directive needs a newline after it.
Lang Hames [Tue, 16 Jul 2019 21:41:43 +0000 (21:41 +0000)]
[ORC][docs] Fix an RST error: the code-block directive needs a newline after it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366270 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ORC][docs] Trim ORCv1 to ORCv2 transition section, add a how-to section.
Lang Hames [Tue, 16 Jul 2019 21:34:59 +0000 (21:34 +0000)]
[ORC][docs] Trim ORCv1 to ORCv2 transition section, add a how-to section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366269 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[x86] use more phadd for reductions
Sanjay Patel [Tue, 16 Jul 2019 21:30:41 +0000 (21:30 +0000)]
[x86] use more phadd for reductions

This is part of what is requested by PR42023:
https://bugs.llvm.org/show_bug.cgi?id=42023

There's an extension needed for FP add, but exactly how we would specify
that using flags is not clear to me, so I left that as a TODO.
We're still missing patterns for partial reductions when the input vector
is 256-bit or 512-bit, but I think that's a failure of vector narrowing.
If we can reduce the widths, then this matching should work on those tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366268 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDWARF: Skip zero column for inline call sites
David Blaikie [Tue, 16 Jul 2019 21:15:19 +0000 (21:15 +0000)]
DWARF: Skip zero column for inline call sites

D64033 <https://reviews.llvm.org/D64033> added DW_AT_call_column for
inline sites. However, that change wasn't aware of "-gno-column-info".
To avoid adding column info when "-gno-column-info" is used, now
DW_AT_call_column is only added when we have non-zero column (when
"-gno-column-info" is used, column will be zero).

Patch by Wenlei He!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366264 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Select G_ASHR
Matt Arsenault [Tue, 16 Jul 2019 20:31:25 +0000 (20:31 +0000)]
AMDGPU/GlobalISel: Select G_ASHR

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366257 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Select G_LSHR
Matt Arsenault [Tue, 16 Jul 2019 20:25:43 +0000 (20:25 +0000)]
AMDGPU/GlobalISel: Select G_LSHR

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366256 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC][HTM] Fix impossible reg-to-reg copy assert with ttest builtin
Jinsong Ji [Tue, 16 Jul 2019 20:24:33 +0000 (20:24 +0000)]
[PowerPC][HTM] Fix impossible reg-to-reg copy assert with ttest builtin

Summary:
This is exposed by our internal testing.
The reduced testcase will assert with "Impossible reg-to-reg copy"

We can't use COPY to do 32-bit to 64-bit conversion.

Reviewers: kbarton, hfinkel, nemanjai

Reviewed By: hfinkel

Subscribers: hiraditya, MaskRay, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366255 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Select G_SHL
Matt Arsenault [Tue, 16 Jul 2019 20:15:30 +0000 (20:15 +0000)]
AMDGPU/GlobalISel: Select G_SHL

I think this manages to not break the DAG handling with the divergent
predicates because the stadalone divergent patterns end up with a
higher priority than the pattern on the instruction definition.

The 16-bit versions don't work yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366254 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Change register type for v32 vectors
Stanislav Mekhanoshin [Tue, 16 Jul 2019 20:06:00 +0000 (20:06 +0000)]
[AMDGPU] Change register type for v32 vectors

When it is AReg_1024 this results in unnecessary copying into
AGPRs of a 32 element vectors even though they are not intended
for an mfma instruction.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366252 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix -Wreturn-type warning. NFC.
Michael Liao [Tue, 16 Jul 2019 19:59:08 +0000 (19:59 +0000)]
Fix -Wreturn-type warning. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366251 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Fix some missing GCCBuiltin declarations
Matt Arsenault [Tue, 16 Jul 2019 19:44:14 +0000 (19:44 +0000)]
AMDGPU: Fix some missing GCCBuiltin declarations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366250 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Fix selection of private stores
Matt Arsenault [Tue, 16 Jul 2019 19:27:44 +0000 (19:27 +0000)]
AMDGPU/GlobalISel: Fix selection of private stores

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366249 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Select private loads
Matt Arsenault [Tue, 16 Jul 2019 19:22:21 +0000 (19:22 +0000)]
AMDGPU/GlobalISel: Select private loads

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366248 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Select flat stores
Matt Arsenault [Tue, 16 Jul 2019 18:42:53 +0000 (18:42 +0000)]
AMDGPU/GlobalISel: Select flat stores

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366246 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Add register classes to flat store patterns
Matt Arsenault [Tue, 16 Jul 2019 18:26:42 +0000 (18:26 +0000)]
AMDGPU: Add register classes to flat store patterns

For some reason GlobalISelEmitter needs register classes to import
these, although it works for the load patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366242 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[IndVars] Speculative fix for an assertion failure seen in bots
Philip Reames [Tue, 16 Jul 2019 18:23:49 +0000 (18:23 +0000)]
[IndVars] Speculative fix for an assertion failure seen in bots

I don't have an IR sample which is actually failing, but the issue described in the comment is theoretically possible, and should be guarded against even if there's a different root cause for the bot failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366241 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Replace store PatFrags
Matt Arsenault [Tue, 16 Jul 2019 18:21:25 +0000 (18:21 +0000)]
AMDGPU: Replace store PatFrags

Convert the easy cases to formats understood for GlobalISel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366240 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Select flat loads
Matt Arsenault [Tue, 16 Jul 2019 18:05:29 +0000 (18:05 +0000)]
AMDGPU/GlobalISel: Select flat loads

Now that the patterns use the new PatFrag address space support, the
only blocker to importing most load patterns is the addressing mode
complex patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366237 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTeach `llvm-pdbutil pretty -native` about `-injected-sources`
Nico Weber [Tue, 16 Jul 2019 18:04:26 +0000 (18:04 +0000)]
Teach `llvm-pdbutil pretty -native` about `-injected-sources`

`pretty -native -injected-sources -injected-source-content` works with
this patch, and produces identical output to the dia version.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366236 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Optimize atomic max/min
Jay Foad [Tue, 16 Jul 2019 17:44:54 +0000 (17:44 +0000)]
[AMDGPU] Optimize atomic max/min

Summary:
Extend the atomic optimizer to handle signed and unsigned max and min
operations, as well as add and subtract.

Reviewers: arsenm, sheredom, critson, rampitec

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366235 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Redefine load PatFrags
Matt Arsenault [Tue, 16 Jul 2019 17:38:50 +0000 (17:38 +0000)]
AMDGPU: Redefine load PatFrags

Rewrite PatFrags using the new PatFrag address space matching in
tablegen. These will now work with both SelectionDAG and GlobalISel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366234 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Fix missing immarg for mfma intrinsics
Matt Arsenault [Tue, 16 Jul 2019 17:22:21 +0000 (17:22 +0000)]
AMDGPU: Fix missing immarg for mfma intrinsics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366230 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Add the adjusted FP as a livein register.
Michael Liao [Tue, 16 Jul 2019 15:57:12 +0000 (15:57 +0000)]
[AMDGPU] Add the adjusted FP as a livein register.

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366223 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Strict FP] Allow more relaxed scheduling
Ulrich Weigand [Tue, 16 Jul 2019 15:55:45 +0000 (15:55 +0000)]
[Strict FP] Allow more relaxed scheduling

Reimplement scheduling constraints for strict FP instructions in
ScheduleDAGInstrs::buildSchedGraph to allow for more relaxed
scheduling.  Specifially, allow one strict FP instruction to
be scheduled across another, as long as it is not moved across
any global barrier.

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

Reviewed By: cameron.mcinally

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366222 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert [tools] [llvm-nm] Default to reading from stdin not a.out
Alex Brachet [Tue, 16 Jul 2019 15:33:43 +0000 (15:33 +0000)]
Revert [tools] [llvm-nm] Default to reading from stdin not a.out

This reverts r365889 (git commit 60c81354b1d3fced1bd284d334f118d2d792ab4b)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366219 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdd missing test for r366215
Amara Emerson [Tue, 16 Jul 2019 15:28:29 +0000 (15:28 +0000)]
Add missing test for r366215

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366218 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Remarks] Simplify and refactor the RemarkParser interface
Francis Visoiu Mistrih [Tue, 16 Jul 2019 15:25:05 +0000 (15:25 +0000)]
[Remarks] Simplify and refactor the RemarkParser interface

Before, everything was based on some kind of type erased parser
implementation which container a lot of boilerplate code when multiple
formats were to be supported.

This simplifies it by:

* the remark now owns its arguments
* *always* returning an error from the implementation side
* working around the way the YAML parser reports errors: catch them through
callbacks and re-insert them in a proper llvm::Error
* add a CParser wrapper that is used when implementing the C API to
avoid cluttering the C++ API with useless state
* LLVMRemarkParserGetNext now returns an object that needs to be
released to avoid leaking resources
* add a new API to dispose of a remark entry: LLVMRemarkEntryDispose

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366217 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Remarks][NFC] Combine ParserFormat and SerializerFormat
Francis Visoiu Mistrih [Tue, 16 Jul 2019 15:24:59 +0000 (15:24 +0000)]
[Remarks][NFC] Combine ParserFormat and SerializerFormat

It's useless to have both.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366216 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ADCE] Fix non-deterministic behaviour due to iterating over a pointer set.
Amara Emerson [Tue, 16 Jul 2019 15:23:10 +0000 (15:23 +0000)]
[ADCE] Fix non-deterministic behaviour due to iterating over a pointer set.

Original patch by Yann Laigle-Chapuy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366215 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DAGCombiner] fold (addcarry (xor a, -1), b, c) -> (subcarry b, a, !c) and flip carry.
Amaury Sechet [Tue, 16 Jul 2019 15:17:00 +0000 (15:17 +0000)]
[DAGCombiner] fold (addcarry (xor a, -1), b, c) -> (subcarry b, a, !c) and flip carry.

Summary:
As per title. DAGCombiner only mathes the special case where b = 0, this patches extends the pattern to match any value of b.

Depends on D57302

Reviewers: hfinkel, RKSimon, craig.topper

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366214 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Fix test failures in release build
Matt Arsenault [Tue, 16 Jul 2019 14:28:30 +0000 (14:28 +0000)]
AMDGPU/GlobalISel: Fix test failures in release build

Apparently the check for legal instructions during instruction
select does not happen without an asserts build, so these would
successfully select in release, and fail in debug.

Make s16 and/or/xor legal. These can just be selected directly
to the 32-bit operation, as is already done in SelectionDAG, so just
make them legal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366210 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-ar][test] Add to llvm-ar test coverage
Owen Reynolds [Tue, 16 Jul 2019 14:25:37 +0000 (14:25 +0000)]
[llvm-ar][test] Add to llvm-ar test coverage

This change adds tests to cover existing llvm-ar functionality.
print.test is omitted due to failing on Darwin.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366209 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReapply [llvm-ar][test] Increase llvm-ar test coverage
Owen Reynolds [Tue, 16 Jul 2019 12:53:59 +0000 (12:53 +0000)]
Reapply [llvm-ar][test] Increase llvm-ar test coverage

This reapplies 365316 without extract.test due to failing on Darwin.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366206 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoremove a duplicate declaration
Sylvestre Ledru [Tue, 16 Jul 2019 12:05:54 +0000 (12:05 +0000)]
remove a duplicate declaration

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366205 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoDocument the LLVM_ENABLE_BINDINGS option
Sylvestre Ledru [Tue, 16 Jul 2019 11:59:17 +0000 (11:59 +0000)]
Document the LLVM_ENABLE_BINDINGS option

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366204 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Object/llvm-readelf/llvm-readobj] - Improve error reporting when e_shstrndx is broken.
George Rimar [Tue, 16 Jul 2019 11:07:30 +0000 (11:07 +0000)]
[Object/llvm-readelf/llvm-readobj] - Improve error reporting when e_shstrndx is broken.

When e_shstrndx is broken, it is impossible to get a section name.
In this patch I improved the error message we show and
added tests for Object and for llvm-readelf/llvm-readobj

Message was changed in two places:
1) llvm-readelf/llvm-readobj previously used a code from Object/ELF.h,
now they have a modified version of it (it has less checks and allows
dumping broken things).
2) Code in Object/ELF.h is still used for generic cases.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366203 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReapply [llvm-ar][test] Add to MRI test coverage
Owen Reynolds [Tue, 16 Jul 2019 11:02:11 +0000 (11:02 +0000)]
Reapply [llvm-ar][test] Add to MRI test coverage

This reapplies 363232 without mri-utf8.test due to failing on Darwin.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366201 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRemove username from git-llvm script, erroneously added in 366197
Sam McCall [Tue, 16 Jul 2019 10:14:53 +0000 (10:14 +0000)]
Remove username from git-llvm script, erroneously added in 366197

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366198 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64] Implement __jcvt intrinsic from Armv8.3-A
Kyrylo Tkachov [Tue, 16 Jul 2019 09:27:39 +0000 (09:27 +0000)]
[AArch64] Implement __jcvt intrinsic from Armv8.3-A

The jcvt intrinsic defined in ACLE [1] is available when ARM_FEATURE_JCVT is defined.

This change introduces the AArch64 intrinsic, wires it up to the instruction and a new clang builtin function.
The __ARM_FEATURE_JCVT macro is now defined when an Armv8.3-A or higher target is used.
I've implemented the target detection logic in Clang so that this feature is enabled for architectures from armv8.3-a onwards (so -march=armv8.4-a also enables this, for example).

make check-all didn't show any new failures.

[1] https://developer.arm.com/docs/101028/latest/data-processing-intrinsics

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366197 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Test commit: add full stop at end of comment
Kyrylo Tkachov [Tue, 16 Jul 2019 09:15:01 +0000 (09:15 +0000)]
[NFC] Test commit: add full stop at end of comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366195 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][PowerPC] Add test case for D64195
Zi Xuan Wu [Tue, 16 Jul 2019 07:54:47 +0000 (07:54 +0000)]
[NFC][PowerPC] Add test case for D64195

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366191 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DWARF] Fix the reserved values for unit length in DWARFDebugLine.
Igor Kudrin [Tue, 16 Jul 2019 07:01:08 +0000 (07:01 +0000)]
[DWARF] Fix the reserved values for unit length in DWARFDebugLine.

The DWARF3 documentation had inconsistency concerning the reserved range
for unit length values. The issue was fixed in DWARF4.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366190 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DWARF] Fix an incorrect format specifier.
Igor Kudrin [Tue, 16 Jul 2019 06:56:10 +0000 (06:56 +0000)]
[DWARF] Fix an incorrect format specifier.

This adjusts the format specifier because PCOffset is uint16_t.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366189 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DWARF] Simplify DWARFAttribute. NFC.
Igor Kudrin [Tue, 16 Jul 2019 06:53:06 +0000 (06:53 +0000)]
[DWARF] Simplify DWARFAttribute. NFC.

The first argument in the constructor was ignored, and the remaining
arguments were always passed as their defaults.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366188 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] In combineStore, don't convert v2f32 load/store pairs to f64 loads/stores.
Craig Topper [Tue, 16 Jul 2019 05:52:27 +0000 (05:52 +0000)]
[X86] In combineStore, don't convert v2f32 load/store pairs to f64 loads/stores.

Type legalization can take care of this. This gives DAG combine
a little more time with the original types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366182 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Match GNU tools canonical JALR and add aliases
Alex Bradbury [Tue, 16 Jul 2019 04:56:43 +0000 (04:56 +0000)]
[RISCV] Match GNU tools canonical JALR and add aliases

The canonical GNU form of JALR resembles a load/store instruction rather
than placing the immediate offset as a separate argument, so match this
behaviour. Also add parser-only aliases for the three-operand form, and
add other shorter aliases also emitted by GNU tools.

Differential Revision: https://reviews.llvm.org/D55277
Patch by James Clarke.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366179 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix parameter name comments using clang-tidy. NFC.
Rui Ueyama [Tue, 16 Jul 2019 04:46:31 +0000 (04:46 +0000)]
Fix parameter name comments using clang-tidy. NFC.

This patch applies clang-tidy's bugprone-argument-comment tool
to LLVM, clang and lld source trees. Here is how I created this
patch:

$ git clone https://github.com/llvm/llvm-project.git
$ cd llvm-project
$ mkdir build
$ cd build
$ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug \
    -DLLVM_ENABLE_PROJECTS='clang;lld;clang-tools-extra' \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLLVM_ENABLE_LLD=On \
    -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../llvm
$ ninja
$ parallel clang-tidy -checks='-*,bugprone-argument-comment' \
    -config='{CheckOptions: [{key: StrictMode, value: 1}]}' -fix \
    ::: ../llvm/lib/**/*.{cpp,h} ../clang/lib/**/*.{cpp,h} ../lld/**/*.{cpp,h}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366177 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Avoid overflow when determining number of nops for code align
Alex Bradbury [Tue, 16 Jul 2019 04:40:25 +0000 (04:40 +0000)]
[RISCV] Avoid overflow when determining number of nops for code align

RISCVAsmBackend::shouldInsertExtraNopBytesForCodeAlign() assumed that the
align specified would be greater than or equal to the minimum nop length, but
that is not always the case - for example if a user specifies ".align 0" in
assembly.

Differential Revision: https://reviews.llvm.org/D63274
Patch by Edward Jones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366176 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Fix a potential issue in shouldInsertFixupForCodeAlign()
Alex Bradbury [Tue, 16 Jul 2019 04:37:19 +0000 (04:37 +0000)]
[RISCV] Fix a potential issue in shouldInsertFixupForCodeAlign()

The bool result of shouldInsertExtraNopBytesForCodeAlign() is not checked but
the returned nop count is unconditionally read even though it could be
uninitialized.

Differential Revision: https://reviews.llvm.org/D63285
Patch by Edward Jones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366175 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV][NFC] Split PseudoCALL pattern out from instruction
Alex Bradbury [Tue, 16 Jul 2019 03:56:45 +0000 (03:56 +0000)]
[RISCV][NFC] Split PseudoCALL pattern out from instruction

Since PseudoCALL defines AsmString, it can be generated from assembly,
and so code-gen patterns should be defined separately to be consistent
with the style of the RISCV backend. Other pseudo-instructions exist
that have code-gen patterns defined directly, but these instructions are
purely for code-gen and cannot be written in assembly.

Differential Revision: https://reviews.llvm.org/D64012
Patch by James Clarke.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366174 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV][NFC] Fix HasStedExtA -> HasStdExtA typo in comment
Alex Bradbury [Tue, 16 Jul 2019 03:54:08 +0000 (03:54 +0000)]
[RISCV][NFC] Fix HasStedExtA -> HasStdExtA typo in comment

Differential Revision: https://reviews.llvm.org/D64011
Patch by James Clarke.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366173 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Make RISCVELFObjectWriter::getRelocType check IsPCRel
Alex Bradbury [Tue, 16 Jul 2019 03:47:34 +0000 (03:47 +0000)]
[RISCV] Make RISCVELFObjectWriter::getRelocType check IsPCRel

Previously, this function didn't check the IsPCRel argument. But doing so is a
useful check for errors, and also seemingly necessary for FK_Data_4 (which we
produce a R_RISCV_32_PCREL relocation for if IsPCRel).

Other than R_RISCV_32_PCREL, this should be NFC. Future exception handling
related patches will include tests that capture this behaviour.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366172 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agohwasan: Pad arrays with non-1 size correctly.
Peter Collingbourne [Tue, 16 Jul 2019 03:25:50 +0000 (03:25 +0000)]
hwasan: Pad arrays with non-1 size correctly.

Spotted by eugenis.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366171 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Avoid code predicates for extload PatFrags
Matt Arsenault [Tue, 16 Jul 2019 02:46:05 +0000 (02:46 +0000)]
AMDGPU: Avoid code predicates for extload PatFrags

Use the MemoryVT field. This will be necessary for tablegen to
automatically handle patterns for GlobalISel.

Doesn't handle the d16 lo/hi patterns. Those are a special case since
it involvess the custom node type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366168 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRe-land "[DebugInfo] Move function from line table to the prologue (NFC)"
Jonas Devlieghere [Tue, 16 Jul 2019 01:21:25 +0000 (01:21 +0000)]
Re-land "[DebugInfo] Move function from line table to the prologue (NFC)"

In LLDB, when parsing type units, we don't need to parse the whole line
table. Instead, we only need to parse the "support files" from the line
table prologue.

To make that possible, this patch moves the respective functions from
the LineTable into the Prologue. Because I don't think users of the
LineTable should have to know that these files come from the Prologue,

I've left the original methods in place, and made them redirect to the
LineTable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366164 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstructionSimplify] Apply sext/trunc after pointer stripping
Michael Liao [Tue, 16 Jul 2019 01:03:06 +0000 (01:03 +0000)]
[InstructionSimplify] Apply sext/trunc after pointer stripping

Summary:
- As the pointer stripping could trace through `addrspacecast` now, need
  to sext/trunc the offset to ensure it has the same width as the
  pointer after stripping.

Reviewers: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366162 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[DebugInfo] Move function from line table to the prologue (NFC)"
Jonas Devlieghere [Tue, 16 Jul 2019 00:59:04 +0000 (00:59 +0000)]
Revert "[DebugInfo] Move function from line table to the prologue (NFC)"

This broke LLD, which I didn't have enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366160 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[DebugInfo] Move function from line table to the prologue (NFC)
Jonas Devlieghere [Tue, 16 Jul 2019 00:37:17 +0000 (00:37 +0000)]
[DebugInfo] Move function from line table to the prologue (NFC)

In LLDB, when parsing type units, we don't need to parse the whole line
table. Instead, we only need to parse the "support files" from the line
table prologue.

To make that possible, this patch moves the respective functions from
the LineTable into the Prologue. Because I don't think users of the
LineTable should have to know that these files come from the Prologue,

I've left the original methods in place, and made them redirect to the
LineTable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366158 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTemporarily Revert "[SLP] Recommit: Look-ahead operand reordering heuristic."
Eric Christopher [Mon, 15 Jul 2019 23:36:02 +0000 (23:36 +0000)]
Temporarily Revert "[SLP] Recommit: Look-ahead operand reordering heuristic."

As there are some reported miscompiles with AVX512 and performance regressions
in Eigen. Verified with the original committer and testcases will be forthcoming.

This reverts commit r364964.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366154 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[NewPM] Port Sancov"
Leonard Chan [Mon, 15 Jul 2019 23:18:31 +0000 (23:18 +0000)]
Revert "[NewPM] Port Sancov"

This reverts commit 5652f35817f07b16f8b3856d594cc42f4d7ee29c.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366153 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Teach convertToThreeAddress to handle SUB with immediate
Craig Topper [Mon, 15 Jul 2019 23:07:56 +0000 (23:07 +0000)]
[X86] Teach convertToThreeAddress to handle SUB with immediate

We mostly avoid sub with immediate but there are a couple cases that can create them. One is the add 128, %rax -> sub -128, %rax trick in isel. The other is when a SUB immediate gets created for a compare where both the flags and the subtract value is used. If we are unable to linearize the SelectionDAG to satisfy the flag user and the sub result user from the same instruction, we will clone the sub immediate for the two uses. The one that produces flags will eventually become a compare. The other will have its flag output dead, and could then be considered for LEA creation.

I added additional test cases to add.ll to show the the sub -128 trick gets converted to LEA and a case where we don't need to convert it.

This showed up in the current codegen for PR42571.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366151 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Add missing utility methods for exnref type
Heejin Ahn [Mon, 15 Jul 2019 23:04:00 +0000 (23:04 +0000)]
[WebAssembly] Add missing utility methods for exnref type

Summary:
This adds missing utility methods and copy instruction handling for
`exnref` type and also adds tests.

`tee` instruction tests are missing because `isTee` is currently only
used in ExplicitLocals pass and testing that pass in mir requires
serialization of stackified registers in mir files, which is a bit
nontrivial because `MachineFunctionInfo` only has info of vreg numbers
(which are large integers) but not the mir's register numbers. But this
change is quite trivial anyway.

Reviewers: tlively

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366149 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readelf] Print "File: lib.a(file.o)" info when dumping archive files.
Yuanfang Chen [Mon, 15 Jul 2019 22:52:01 +0000 (22:52 +0000)]
[llvm-readelf] Print "File: lib.a(file.o)" info when dumping archive files.

Match GNU readelf.

https://bugs.llvm.org/show_bug.cgi?id=35351

Reviewers: jhenderson, grimar, MaskRay, rupprecht

Reviewed by: jhenderson, MaskRay, grimar

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366147 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Rename except_ref type to exnref
Heejin Ahn [Mon, 15 Jul 2019 22:49:25 +0000 (22:49 +0000)]
[WebAssembly] Rename except_ref type to exnref

Summary:
We agreed to rename `except_ref` to `exnref` for consistency with other
reference types in
https://github.com/WebAssembly/exception-handling/issues/79. This also
renames WebAssemblyInstrExceptRef.td to WebAssemblyInstrRef.td in order
to use the file for other reference types in future.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366145 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert [llvm-lipo] Implement -create (with hardcoded alignments)
Shoaib Meenai [Mon, 15 Jul 2019 22:44:08 +0000 (22:44 +0000)]
Revert [llvm-lipo] Implement -create (with hardcoded alignments)

This reverts r366142 (git commit 67cee1dc7ee285b03372eb818a3894d35efa7394)

The test is failing on the Windows buildbots. Reverting while I
investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366144 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-lipo] Implement -create (with hardcoded alignments)
Shoaib Meenai [Mon, 15 Jul 2019 22:29:30 +0000 (22:29 +0000)]
[llvm-lipo] Implement -create (with hardcoded alignments)

Creates universal binary output file from input files. Currently uses
hard coded value for alignment.  Want to get the create functionality
approved before implementing the alignment function.

Patch by Anusha Basana <anusha.basana@gmail.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366142 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Simplify regcopy.mir
Heejin Ahn [Mon, 15 Jul 2019 22:22:10 +0000 (22:22 +0000)]
[WebAssembly] Simplify regcopy.mir

Summary:
This deletes the ll templates from the functions because they don't need
them (mir files need ll templates only when they have function calls or
BB names that are not numbers).

This also renames the filename to `reg-copy.mir`, because I'm planning
to add some more `reg-*.mir` soon.

Reviewers: tlively

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366140 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Assembler: support special floats: infinity / nan
Wouter van Oortmerssen [Mon, 15 Jul 2019 22:13:39 +0000 (22:13 +0000)]
[WebAssembly] Assembler: support special floats: infinity / nan

Summary:
These are emitted as identifiers by the InstPrinter, so we should
parse them as such. These could potentially clash with symbols of
the same name, but that is out of our (the WebAssembly backend) control.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, aheejin, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366139 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Enable merging m0 initializations.
Austin Kerbow [Mon, 15 Jul 2019 22:07:05 +0000 (22:07 +0000)]
[AMDGPU] Enable merging m0 initializations.

Summary:
Enable hoisting and merging m0 defs that are initialized with the same
immediate value. Fixes bug where removed instructions are not considered
to interfere with other inits, and make sure to not hoist inits before block
prologues.

Reviewers: rampitec, arsenm

Reviewed By: rampitec

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366135 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[mips] Print BEQZL and BNEZL pseudo instructions
Simon Atanasyan [Mon, 15 Jul 2019 21:46:38 +0000 (21:46 +0000)]
[mips] Print BEQZL and BNEZL pseudo instructions

One of the reasons - to be compatible with GNU tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366133 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Use standalone MUBUF load patterns
Matt Arsenault [Mon, 15 Jul 2019 21:41:44 +0000 (21:41 +0000)]
AMDGPU: Use standalone MUBUF load patterns

We already do this for the flat and DS instructions, although it is
certainly uglier and more verbose.

This will allow using separate pattern definitions for extload and
zextload. Currently we get away with using a single PatFrag with
custom predicate code to check if the extension type is a zextload or
anyextload. The generic mechanism the global isel emitter understands
treats these as mutually exclusive. I was considering making the
pattern emitter accept zextload or sextload extensions for anyextload
patterns, but in global isel, the different extending loads have
distinct opcodes, and there is currently no mechanism for an opcode
matcher to try multiple (and there probably is very little need for
one beyond this case).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366132 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LoopUnroll+LoopUnswitch] do not transform loops containing callbr
Nick Desaulniers [Mon, 15 Jul 2019 21:16:29 +0000 (21:16 +0000)]
[LoopUnroll+LoopUnswitch] do not transform loops containing callbr

Summary:
There is currently a correctness issue when unrolling loops containing
callbr's where their indirect targets are being updated correctly to the
newly created labels, but their operands are not.  This manifests in
unrolled loops where the second and subsequent copies of callbr
instructions have blockaddresses of the label from the first instance of
the unrolled loop, which would result in nonsensical runtime control
flow.

For now, conservatively do not unroll the loop.  In the future, I think
we can pursue unrolling such loops provided we transform the cloned
callbr's operands correctly.

Such a transform and its legalities are being discussed in:
https://reviews.llvm.org/D64101

Link: https://bugs.llvm.org/show_bug.cgi?id=42489
Link: https://groups.google.com/forum/#!topic/clang-built-linux/z-hRWP9KqPI
Reviewers: fhahn, hfinkel, efriedma

Reviewed By: fhahn, hfinkel, efriedma

Subscribers: efriedma, hiraditya, zzheng, dmgreen, llvm-commits, pirama, kees, nathanchance, E5ten, craig.topper, chandlerc, glider, void, srhines

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366130 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTableGen/GlobalISel: Fix handling of truncstore patterns
Matt Arsenault [Mon, 15 Jul 2019 21:15:20 +0000 (21:15 +0000)]
TableGen/GlobalISel: Fix handling of truncstore patterns

This was failing to import the AMDGPU truncstore patterns. The
truncating stores from 32-bit to 8/16 were then somehow being
incorrectly selected to a 4-byte store.

A separate check is emitted for the LLT size in comparison to the
specific memory VT, which looks strange to me but makes sense based on
the hierarchy of PatFrags used for the default truncstore PatFrags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366129 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTableGen: Add address space to matchers
Matt Arsenault [Mon, 15 Jul 2019 20:59:42 +0000 (20:59 +0000)]
TableGen: Add address space to matchers

Currently AMDGPU uses a CodePatPred to check address spaces from the
MachineMemOperand. Introduce a new first class property so that the
existing patterns can be easily modified to uses the new generated
predicate, which will also be handled for GlobalISel.

I would prefer these to match against the pointer type of the
instruction, but that would be difficult to get working with
SelectionDAG compatbility. This is much easier for now and will avoid
a painful tablegen rewrite for all the loads and stores.

I'm also not sure if there's a better way to encode multiple address
spaces in the table, rather than putting the number to expect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366128 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Allow scalar s1 and/or/xor
Matt Arsenault [Mon, 15 Jul 2019 20:20:18 +0000 (20:20 +0000)]
AMDGPU/GlobalISel: Allow scalar s1 and/or/xor

If a 1-bit value is in a 32-bit VGPR, the scalar opcodes set SCC to
whether the result is 0. If the inputs are SCC, these can be copied to
a 32-bit SGPR to produce an SCC result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366125 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoARM MTE stack sanitizer.
Evgeniy Stepanov [Mon, 15 Jul 2019 20:02:23 +0000 (20:02 +0000)]
ARM MTE stack sanitizer.

Add "memtag" sanitizer that detects and mitigates stack memory issues
using armv8.5 Memory Tagging Extension.

It is similar in principle to HWASan, which is a software implementation
of the same idea, but there are enough differencies to warrant a new
sanitizer type IMHO. It is also expected to have very different
performance properties.

The new sanitizer does not have a runtime library (it may grow one
later, along with a "debugging" mode). Similar to SafeStack and
StackProtector, the instrumentation pass (in a follow up change) will be
inserted in all cases, but will only affect functions marked with the
new sanitize_memtag attribute.

Reviewers: pcc, hctim, vitalybuka, ostannard

Subscribers: srhines, mehdi_amini, javed.absar, kristof.beyls, hiraditya, cryptoad, steven_wu, dexonsmith, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366123 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Select G_AND/G_OR/G_XOR
Matt Arsenault [Mon, 15 Jul 2019 19:50:07 +0000 (19:50 +0000)]
AMDGPU/GlobalISel: Select G_AND/G_OR/G_XOR

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366121 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Don't constrain source register of VCC copies
Matt Arsenault [Mon, 15 Jul 2019 19:48:36 +0000 (19:48 +0000)]
AMDGPU/GlobalISel: Don't constrain source register of VCC copies

This is a hack until I come up with a better way of dealing with the
pseudo-register banks used for boolean values. If the use instruction
constrains the register, the selector for the def instruction won't
see that the bank was VCC. A 1-bit SReg_32 is could ambiguously have
been SCCRegBank or VCCRegBank in wave32.

This is necessary to successfully select branches with and and/or/xor
condition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366120 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Fix selecting vcc->vcc bank copies
Matt Arsenault [Mon, 15 Jul 2019 19:46:48 +0000 (19:46 +0000)]
AMDGPU/GlobalISel: Fix selecting vcc->vcc bank copies

The extra test change is correct, although how it arrives there is a
bug that needs work. With wave32, the test for isVCC ambiguously
reports true for an SCC or VCC source. A new allocatable pseudo
register class for SCC may be necesssary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366119 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Fix not constraining result reg of copies to VCC
Matt Arsenault [Mon, 15 Jul 2019 19:45:49 +0000 (19:45 +0000)]
AMDGPU/GlobalISel: Fix not constraining result reg of copies to VCC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366118 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Fix handling of sgpr (not scc bank) s1 to VCC
Matt Arsenault [Mon, 15 Jul 2019 19:44:07 +0000 (19:44 +0000)]
AMDGPU/GlobalISel: Fix handling of sgpr (not scc bank) s1 to VCC

This was emitting a copy from a 32-bit register to a 64-bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366117 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Custom legalize G_INSERT_VECTOR_ELT
Matt Arsenault [Mon, 15 Jul 2019 19:43:04 +0000 (19:43 +0000)]
AMDGPU/GlobalISel: Custom legalize G_INSERT_VECTOR_ELT

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366116 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Custom legalize G_EXTRACT_VECTOR_ELT
Matt Arsenault [Mon, 15 Jul 2019 19:40:59 +0000 (19:40 +0000)]
AMDGPU/GlobalISel: Custom legalize G_EXTRACT_VECTOR_ELT

Turn the constant cases into G_EXTRACTs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366115 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Fix G_ICMP for wave32
Matt Arsenault [Mon, 15 Jul 2019 19:39:31 +0000 (19:39 +0000)]
AMDGPU/GlobalISel: Fix G_ICMP for wave32

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366114 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoGlobalISel: Implement narrowScalar for vector extract/insert indexes
Matt Arsenault [Mon, 15 Jul 2019 19:37:34 +0000 (19:37 +0000)]
GlobalISel: Implement narrowScalar for vector extract/insert indexes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366113 91177308-0d34-0410-b5e6-96231b3b80d8