platform/upstream/llvm.git
3 years ago[TargetLowering] Use getBoolConstant instead of assuming zero or one for boolean...
Craig Topper [Fri, 22 Jan 2021 08:19:13 +0000 (00:19 -0800)]
[TargetLowering] Use getBoolConstant instead of assuming zero or one for boolean contents.

Noticed while I was touching other nearby code. I don't have a
test where this matters because the targets I work on
use zero or one boolean contents. And the tests cases I've seen
this fire on happen before type legalization where the result type
is MVT::i1 so the distinction doesn't matter.

3 years agoNFC: Remove simple_ilist comment mentioning ilist/iplist allocating
Nathan Lanza [Fri, 22 Jan 2021 08:22:50 +0000 (03:22 -0500)]
NFC: Remove simple_ilist comment mentioning ilist/iplist allocating

Allocation was removed from ilist in 2016 in the git commit
b5da00533510.

Reviewed By: dexonsmith

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

3 years agoUpdate filename to workers.py file in documentation
Douglas Yung [Fri, 22 Jan 2021 08:18:09 +0000 (00:18 -0800)]
Update filename to workers.py file in documentation

Commit be9f322e8dc530a56f03356aad31fa9031b27e26 moved the list of workers from
slaves.py to workers.py, but the documentation in "How To Add A Builder" was
never updated and now references a non-existing file. This fixes that.

Reviewed By: gkistanova

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

3 years ago[AMDGPU] Test clean up (NFC)
Christudasan Devadasan [Fri, 22 Jan 2021 07:24:16 +0000 (12:54 +0530)]
[AMDGPU] Test clean up (NFC)

3 years ago[TargetLowering] Simplify some code in SimplifySetCC that tries to handle SIGN_EXTEND...
Craig Topper [Fri, 22 Jan 2021 07:21:05 +0000 (23:21 -0800)]
[TargetLowering] Simplify some code in SimplifySetCC that tries to handle SIGN_EXTEND_INREG operand types that should never happen. NFCI

There was code to handle the first operand being different than
the result type. And code to handle first operand having the
same type as the type to extend from. This should never happen
for a correctly formed SIGN_EXTEND_INREG. I've replace the
code with asserts.

I also noticed we created the same APInt twice so I've reused it.

3 years ago[AArch64][GlobalISel] Implement widenScalar for signed overflow
Cassie Jones [Fri, 22 Jan 2021 06:55:00 +0000 (22:55 -0800)]
[AArch64][GlobalISel] Implement widenScalar for signed overflow

Implement widening for G_SADDO and G_SSUBO. Previously it was only
implemented for G_UADDO and G_USUBO. Also add legalize-add/sub tests for
narrow overflowing add/sub on AArch64.

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

3 years ago[mlir][StandardToSPIRV] Add support for lowering uitofp to SPIR-V
Hanhan Wang [Fri, 22 Jan 2021 06:20:18 +0000 (22:20 -0800)]
[mlir][StandardToSPIRV] Add support for lowering uitofp to SPIR-V

- Extend spirv::ConstantOp::getZero/One to handle float, vector of int, and vector of float.
- Refactor ZeroExtendI1Pattern to use getZero/One methods.
- Add one more test for lowering std.zexti which extends vector<4xi1> to vector<4xi64>.

Reviewed By: antiagainst

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

3 years ago[mlir][Linalg] Introduce linalg.pad_tensor op.
Hanhan Wang [Fri, 22 Jan 2021 06:08:51 +0000 (22:08 -0800)]
[mlir][Linalg] Introduce linalg.pad_tensor op.

`linalg.pad_tensor` is an operation that pads the `source` tensor
with given `low` and `high` padding config.

Example 1:

```mlir
  %pad_value = ... : f32
  %1 = linalg.pad_tensor %0 low[1, 2] high[2, 3] {
  ^bb0(%arg0 : index, %arg1 : index):
    linalg.yield %pad_value : f32
  } : tensor<?x?xf32> to tensor<?x?xf32>
```

Example 2:
```mlir
  %pad_value = ... : f32
  %1 = linalg.pad_tensor %arg0 low[2, %arg1, 3, 3] high[3, 3, %arg1, 2] {
  ^bb0(%arg2: index, %arg3: index, %arg4: index, %arg5: index):
    linalg.yield %pad_value : f32
  } : tensor<1x2x2x?xf32> to tensor<6x?x?x?xf32>
```

Reviewed By: nicolasvasilache

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

3 years ago[test] Make incorrect-exit-count.ll work under NPM
Arthur Eubanks [Fri, 22 Jan 2021 05:45:32 +0000 (21:45 -0800)]
[test] Make incorrect-exit-count.ll work under NPM

3 years ago[NewPM][opt] Run the "default" AA pipeline by default
Arthur Eubanks [Thu, 21 Jan 2021 00:53:03 +0000 (16:53 -0800)]
[NewPM][opt] Run the "default" AA pipeline by default

We tend to assume that the AA pipeline is by default the default AA
pipeline and it's confusing when it's empty instead.

PR48779

Initially reverted due to BasicAA running analyses in an unspecified
order (multiple function calls as parameters), fixed by fetching
analyses before the call to construct BasicAA.

Reviewed By: asbirlea

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

3 years ago[JITLink][ELF/x86-64] Range check 32-bit relocs.
Lang Hames [Fri, 22 Jan 2021 04:38:45 +0000 (15:38 +1100)]
[JITLink][ELF/x86-64] Range check 32-bit relocs.

Also switch to using little_<b> / ulittle_<b> types to write results for
consistency with MachO.

3 years ago[ASTReader] Allow controlling separately whether validation should be disabled for...
Argyrios Kyrtzidis [Thu, 21 Jan 2021 19:19:34 +0000 (11:19 -0800)]
[ASTReader] Allow controlling separately whether validation should be disabled for a PCH vs a module file

This addresses an issue with how the PCH preable works, specifically:

1. When using a PCH/preamble the module hash changes and a different cache directory is used
2. When the preamble is used, PCH & PCM validation is disabled.

Due to combination of #1 and #2, reparsing with preamble enabled can end up loading a stale module file before a header change and using it without updating it because validation is disabled and it doesn’t check that the header has changed and the module file is out-of-date.

rdar://72611253

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

3 years ago[NFC] Disallow unused prefixes under llvm/test
Mircea Trofin [Thu, 21 Jan 2021 02:37:22 +0000 (18:37 -0800)]
[NFC] Disallow unused prefixes under llvm/test

This patch sets the default for llvm tests, with the exception of tests
under Reduce, because quite a few of them use 'FileCheck' as parameter
to a tool, and including a flag as that parameter would complicate
matters.

The rest of the patch undo-es the lit.local.cfg changes we progressively
introduced as temporary measure to avoid regressions under various
directories.

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

3 years ago[AMDGPU][Inliner] Remove amdgpu-inline and add a new TTI inline hook
Arthur Eubanks [Wed, 6 Jan 2021 05:11:21 +0000 (21:11 -0800)]
[AMDGPU][Inliner] Remove amdgpu-inline and add a new TTI inline hook

Having a custom inliner doesn't really fit in with the new PM's
pipeline. It's also extra technical debt.

amdgpu-inline only does a couple of custom things compared to the normal
inliner:
1) It disables inlining if the number of BBs in a function would exceed
   some limit
2) It increases the threshold if there are pointers to private arrays(?)

These can all be handled as TTI inliner hooks.
There already exists a hook for backends to multiply the inlining
threshold.

This way we can remove the custom amdgpu-inline pass.

This caused inline-hint.ll to fail, and after some investigation, it
looks like getInliningThresholdMultiplier() was previously getting
applied twice in amdgpu-inline (https://reviews.llvm.org/D62707 fixed it
not applying at all, so some later inliner change must have fixed
something), so I had to change the threshold in the test.

Reviewed By: rampitec

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

3 years agoRevert "[NewPM][opt] Run the "default" AA pipeline by default"
Arthur Eubanks [Fri, 22 Jan 2021 04:16:34 +0000 (20:16 -0800)]
Revert "[NewPM][opt] Run the "default" AA pipeline by default"

This reverts commit be611431cd1f5c826a55b531db92a63e84323866.

Other/new-pm-lto-defaults.ll failing

3 years ago[mlir] Enable passing crash reproducer stream factory method
Jacques Pienaar [Thu, 21 Jan 2021 15:00:13 +0000 (07:00 -0800)]
[mlir] Enable passing crash reproducer stream factory method

Add factory to create streams for logging the reproducer. Allows for more general logging (beyond file) and logging the configuration/module separately (logged in order, configuration before module).

Also enable querying filename of ToolOutputFile.

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

3 years ago[llvm] Use isDigit (NFC)
Kazu Hirata [Fri, 22 Jan 2021 03:59:50 +0000 (19:59 -0800)]
[llvm] Use isDigit (NFC)

3 years ago[llvm] Don't include StringSwitch.h where unnecessary (NFC)
Kazu Hirata [Fri, 22 Jan 2021 03:59:48 +0000 (19:59 -0800)]
[llvm] Don't include StringSwitch.h where unnecessary (NFC)

3 years ago[CodeGen] Use llvm::append_range (NFC)
Kazu Hirata [Fri, 22 Jan 2021 03:59:46 +0000 (19:59 -0800)]
[CodeGen] Use llvm::append_range (NFC)

3 years ago[NewPM][opt] Run the "default" AA pipeline by default
Arthur Eubanks [Thu, 21 Jan 2021 00:53:03 +0000 (16:53 -0800)]
[NewPM][opt] Run the "default" AA pipeline by default

We tend to assume that the AA pipeline is by default the default AA
pipeline and it's confusing when it's empty instead.

PR48779

Reviewed By: asbirlea

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

3 years ago[RISCV] Correct DWARF number for vector registers.
Hsiangkai Wang [Fri, 15 Jan 2021 03:07:59 +0000 (11:07 +0800)]
[RISCV] Correct DWARF number for vector registers.

The DWARF numbers of vector registers are already defined in
riscv-elf-psabi. The DWARF number for vector is start from 96.
Correct the DWARF numbers of vector registers.

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

3 years ago[RISCV] Don't create LMUL=8 pseudo instructions for ternary widening arithmetic instr...
Craig Topper [Fri, 22 Jan 2021 01:51:29 +0000 (17:51 -0800)]
[RISCV] Don't create LMUL=8 pseudo instructions for ternary widening arithmetic instructions

These instructions produce 2*SEW result so the input can't have
an LMUL=8 or the result would need a non-existant LMUL=16. So
only create pseudos for LMUL up to 4.

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

3 years ago[AArch64][GlobalISel] Make G_USUBO legal and select it.
Cassie Jones [Fri, 22 Jan 2021 02:48:09 +0000 (18:48 -0800)]
[AArch64][GlobalISel] Make G_USUBO legal and select it.

The expansion for wide subtractions includes G_USUBO.

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

3 years ago[RISCV] Add intrinsics for RVV1.0 VFRSQRTE7 & VFRECE7
ShihPo Hung [Thu, 21 Jan 2021 02:45:33 +0000 (18:45 -0800)]
[RISCV] Add intrinsics for RVV1.0 VFRSQRTE7 & VFRECE7

Reviewed By: craig.topper, frasercrmck

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

3 years ago[RISCV] Add intrinsics for vector unordered indexed load in RVV 1.0
ShihPo Hung [Tue, 19 Jan 2021 09:07:34 +0000 (01:07 -0800)]
[RISCV] Add intrinsics for vector unordered indexed load in RVV 1.0

Add unordered indexed load: vluxei

Reviewed By: craig.topper

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

3 years ago[RISCV] Add intrinsics for RVV 1.0 vrgatherei16
ShihPo Hung [Tue, 19 Jan 2021 02:44:59 +0000 (18:44 -0800)]
[RISCV] Add intrinsics for RVV 1.0 vrgatherei16

Reviewed By: craig.topper

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

3 years ago[Inlining] Delete redundant optnone/alwaysinline check
Xun Li [Fri, 22 Jan 2021 02:38:10 +0000 (18:38 -0800)]
[Inlining] Delete redundant optnone/alwaysinline check

The same check is done in InlineCost: https://github.com/llvm/llvm-project/blob/8b0bd54d0ec968df28ccc58bbb537a7b7c074ef2/llvm/lib/Analysis/InlineCost.cpp#L2537-L2552
Also, doing a check on the callee here is confusing, because anything that deals with callee should be done in the inner loop where we proecss all calls from the same caller.

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

3 years ago[PowerPC] Duplicate inherited heuristic from base scheduler
Qiu Chaofan [Fri, 22 Jan 2021 02:00:28 +0000 (10:00 +0800)]
[PowerPC] Duplicate inherited heuristic from base scheduler

PowerPC has its custom scheduler heuristic. It calls parent classes'
tryCandidate in override version, but the function returns void, so this
way doesn't actually help. This patch duplicates code from base scheduler
into PPC machine scheduler class, which does what we wanted.

Reviewed By: steven.zhang

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

3 years ago[AMDGPU] Test case demonstrating issues with generation of .debug_frame
RamNalamothu [Fri, 22 Jan 2021 01:54:06 +0000 (07:24 +0530)]
[AMDGPU] Test case demonstrating issues with generation of .debug_frame

This test case demonstrates that the Call Frame Information generation is
totally biased towards whether exceptions are enabled or not. Currently
LLVM does not generate CFI i.e. a .debug_frame for debug purpose even
if --force-dwarf-frame-section is enabled unless exceptions are enabled.

Reviewed By: scott.linder

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

3 years ago[CodeGen][ObjC] Fix broken IR generated when there is a nil receiver
Akira Hatanaka [Fri, 22 Jan 2021 01:38:46 +0000 (17:38 -0800)]
[CodeGen][ObjC] Fix broken IR generated when there is a nil receiver
check

This patch fixes a bug in emitARCOperationAfterCall where it inserts the
fall-back call after a bitcast instruction and then replaces the
bitcast's operand with the result of the fall-back call. The generated
IR without this patch looks like this:

msgSend.call:                                     ; preds = %entry
  %call = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
  br label %msgSend.cont

msgSend.null-receiver:                            ; preds = %entry
  call void @llvm.objc.release(i8* %4)
  br label %msgSend.cont

msgSend.cont:
  %8 = phi i8* [ %call, %msgSend.call ], [ null, %msgSend.null-receiver ]
  %9 = bitcast i8* %10 to %0*
  %10 = call i8* @llvm.objc.retain(i8* %8)

Notice that `%9 = bitcast i8* %10` to %0* is taking operand %10 which is
defined after it.

To fix the bug, this patch modifies the insert point to point to the
bitcast instruction so that the fall-back call is inserted before the
bitcast. In addition, it teaches the function to look at phi
instructions that are generated when there is a check for a null
receiver and insert the retainRV/claimRV instruction right after the
call instead of inserting a fall-back call right after the phi
instruction.

rdar://73360225

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

3 years ago[mlir] Support FuncOpSignatureConversion for more FunctionLike ops.
mikeurbach [Tue, 19 Jan 2021 02:20:25 +0000 (19:20 -0700)]
[mlir] Support FuncOpSignatureConversion for more FunctionLike ops.

This extracts the implementation of getType, setType, and getBody from
FunctionSupport.h into the mlir::impl namespace and defines them
generically in FunctionSupport.cpp. This allows them to be used
elsewhere for any FunctionLike ops that use FunctionType for their
type signature.

Using the new helpers, FuncOpSignatureConversion is generalized to
work with all such FunctionLike ops. Convenience helpers are added to
configure the pattern for a given concrete FunctionLike op type.

Reviewed By: rriddle

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

3 years ago[llvm-mca] Addressing build failures due to missing override specifiers
Wolfgang Pieb [Fri, 22 Jan 2021 01:30:59 +0000 (17:30 -0800)]
[llvm-mca] Addressing build failures due to missing override specifiers

3 years ago[RISCV] Add a VL output to vleff intrinsics.
Craig Topper [Fri, 22 Jan 2021 01:08:41 +0000 (17:08 -0800)]
[RISCV] Add a VL output to vleff intrinsics.

The fault-only-first-load instructions can reduce VL if an element
other than element 0 triggers a memory fault. This can be used to
vectorize loops with data dependent exit conditions like strcmp or
strlen.

This patch adds a VL output to these intrinsics so that the new
VL value can be captured by software. This will be expanded to
'csrr gpr, vl' after the vleff instruction during SelectionDAG.

By doing this with one intrinsic we are able to guarantee that the
csrr reads the VL value produced by the vleff instruction. Having
it as a separate intrinsic would make it impossible to guarantee
ordering without making every other vector intrinsic have side
effects.

The intrinsics are expanded during lowering into two ISD nodes
that are glued together. These ISD nodes will go
through isel separately, but should maintain the glue so that they
get emitted adjacently by InstrEmitter.

I've only ran the chain through the vleff instruction, allowing
the READ_VL to be deleted if it is unused.

Reviewed By: HsiangKai

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

3 years ago[NFC] [TargetRegisterInfo] add another API to get srcreg through copy.
Chen Zheng [Tue, 19 Jan 2021 02:55:11 +0000 (21:55 -0500)]
[NFC] [TargetRegisterInfo] add another API to get srcreg through copy.

Reviewed By: nemanjai, jsji

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

3 years ago[flang] Fix bogus error message with binding
peter klausler [Thu, 21 Jan 2021 22:54:53 +0000 (14:54 -0800)]
[flang] Fix bogus error message with binding

ProcedureDesignator::GetInterfaceSymbol() needs to return
the procedure bound to a bindings.

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

3 years ago[libcxx] Check return value for asprintf()
Brad Smith [Fri, 22 Jan 2021 00:39:52 +0000 (19:39 -0500)]
[libcxx] Check return value for asprintf()

local __libcpp_asprintf_l() -> libc asprintf() was inspecting the pointer (with
indeterminate value) for failure, rather than the return value of -1.

Reviewed By: ldionne

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

3 years ago[flang] Allow NULL() actual argument for pointer dummy
peter klausler [Thu, 21 Jan 2021 22:50:57 +0000 (14:50 -0800)]
[flang] Allow NULL() actual argument for pointer dummy

Fixes a bogus error message about an actual argument not being an
object.

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

3 years ago[llvm-mca] Test case was missing a triple.
Wolfgang Pieb [Fri, 22 Jan 2021 00:19:01 +0000 (16:19 -0800)]
[llvm-mca] Test case was missing a triple.

3 years ago[flang] Address name resolution problems
peter klausler [Thu, 21 Jan 2021 22:42:20 +0000 (14:42 -0800)]
[flang] Address name resolution problems

Don't emit a bogus error message about a bad forward reference
when it's an IMPORT of a USE-associated symbol; don't ignore
intrinsic functions when USE-associating the contents of a
module when the intrinsic has been explicitly USE'd; allow
PUBLIC or PRIVATE accessibility attribute to be specified
for an enumerator before the declaration of the enumerator.

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

3 years ago[RISCV] Use v8-v23 as argument registers to conform to the proposal.
Hsiangkai Wang [Thu, 21 Jan 2021 13:54:20 +0000 (21:54 +0800)]
[RISCV] Use v8-v23 as argument registers to conform to the proposal.

The maximum LMUL is 8. We need 16 vector registers for two LMUL-8
arguments. The modification follows the proposal of psABI in
https://github.com/riscv/riscv-elf-psabi-doc/pull/171

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

3 years ago[llvm-mca] Forgot a couple of override specifiers.
Wolfgang Pieb [Thu, 21 Jan 2021 23:44:14 +0000 (15:44 -0800)]
[llvm-mca] Forgot a couple of override specifiers.

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

3 years ago[RISCV] New vector load/store in V extension v1.0
Hsiangkai Wang [Mon, 21 Dec 2020 05:59:52 +0000 (13:59 +0800)]
[RISCV] New vector load/store in V extension v1.0

Upgrade RISC-V V extension to v1.0-08a0b46.
Indexed load/store have ordered and unordered form.
New whole vector load/store.

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

3 years ago[libc] Distinguish compiler and run failures
Petr Hosek [Thu, 21 Jan 2021 08:01:18 +0000 (00:01 -0800)]
[libc] Distinguish compiler and run failures

This is useful for debugging issues, for example when cross-compiling.

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

3 years ago[gn build] Port d38be2ba0e4e
LLVM GN Syncbot [Thu, 21 Jan 2021 23:19:45 +0000 (23:19 +0000)]
[gn build] Port d38be2ba0e4e

3 years ago[libc++abi] Simplify scan_eh_tab
Fangrui Song [Thu, 21 Jan 2021 23:19:22 +0000 (15:19 -0800)]
[libc++abi] Simplify scan_eh_tab

1.
All `_URC_HANDLER_FOUND` return values need to set `landingPad`
and its value does not matter for `_URC_CONTINUE_UNWIND`. So we
can always set `landingPad` to unify code.

2.
For an exception specification (`ttypeIndex < 0`), we can check `_UA_FORCE_UNWIND` first.

3.
The so-called type 3 search (`actions & _UA_CLEANUP_PHASE && !(actions & _UA_HANDLER_FRAME)`)
is actually conceptually wrong.  For a catch handler or an unmatched dynamic
exception specification, `_UA_HANDLER_FOUND` should be returned immediately.  It
still appeared to work because the `ttypeIndex==0` case would return
`_UA_HANDLER_FOUND` at a later time.

This patch fixes the conceptual error and simplifies the code by handling type 3
the same way as type 2 (which is also what libsupc++ does).
The only difference between phase 1 and phase 2 is what to do with a cleanup
(`actionEntry==0`, or a `ttypeIndex==0` is found in the action record chain):
phase 1 returns `_URC_CONTINUE_UNWIND` while phase 2 returns `_URC_HANDLER_FOUND`.

Reviewed By: #libc_abi, compnerd

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

3 years ago[llvm-mca] Initial implementation of serialization using JSON. The views
Wolfgang Pieb [Thu, 21 Jan 2021 22:04:13 +0000 (14:04 -0800)]
[llvm-mca] Initial implementation of serialization using JSON. The views
implemented at this time are Summary, Timeline, ResourcePressure and InstructionInfo.
Use --json on the command line to obtain JSON output.

3 years agoAdd Python bindings for the builtin dialect
Mehdi Amini [Wed, 20 Jan 2021 05:53:44 +0000 (05:53 +0000)]
Add Python bindings for the builtin dialect

This includes some minor customization for FuncOp and ModuleOp.

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

3 years agoFix crash when emitting NullReturn guards for functions returning BOOL
Jon Roelofs [Thu, 21 Jan 2021 21:56:27 +0000 (13:56 -0800)]
Fix crash when emitting NullReturn guards for functions returning BOOL

CodeGenModule::EmitNullConstant() creates constants with their "in memory"
type, not their "in vregs" type. The one place where this difference matters is
when the type is _Bool, as that is an i1 when in vregs and an i8 in memory.

Fixes: rdar://73361264

3 years ago[WebAssembly] Test that invalid symbol/relocation types generate errors
Sam Clegg [Thu, 21 Jan 2021 20:07:43 +0000 (12:07 -0800)]
[WebAssembly] Test that invalid symbol/relocation types generate errors

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

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

3 years agoRevert [mlir] Link mlir_runner_utils statically into cuda/rocm-runtime-wrappers ...
Christian Sigg [Thu, 21 Jan 2021 20:00:46 +0000 (21:00 +0100)]
Revert [mlir] Link mlir_runner_utils statically into cuda/rocm-runtime-wrappers (cf50f4f76456)

There are cmake failures that I do not know how to fix.

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

3 years ago[libc++abi] Add an option to avoid demangling in terminate.
Dan Albert [Thu, 21 Jan 2021 21:27:14 +0000 (13:27 -0800)]
[libc++abi] Add an option to avoid demangling in terminate.

We've been using this patch in Android so we can avoid including the
demangler in libc++.so. It comes with a rather large cost in RSS and
isn't commonly needed.

Reviewed By: #libc_abi, compnerd

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

3 years ago[lldb-vscode] improve modules request
Walter Erquinigo [Mon, 4 Jan 2021 22:05:42 +0000 (14:05 -0800)]
[lldb-vscode] improve modules request

lldb-vsdode was communicating the list of modules to the IDE with events, which in practice ended up having some drawbacks
- when debugging large targets, the number of these events were easily 10k, which polluted the messages being transmitted, which caused the following: a harder time debugging the messages, a lag after terminated the process because of these messages being processes (this could easily take several seconds). The latter was specially bad, as users were complaining about it even when they didn't check the modules view.
- these events were rarely used, as users only check the modules view when something is wrong and they try to debug things.

After getting some feedback from users, we realized that it's better to not used events but make this simply a request and is triggered by users whenever they needed.

This diff achieves that and does some small clean up in the existing code.

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

3 years ago[LV][ARM] Inloop reduction cost modelling
David Green [Thu, 21 Jan 2021 21:03:41 +0000 (21:03 +0000)]
[LV][ARM] Inloop reduction cost modelling

This adds cost modelling for the inloop vectorization added in
745bf6cf4471. Up until now they have been modelled as the original
underlying instruction, usually an add. This happens to works OK for MVE
with instructions that are reducing into the same type as they are
working on. But MVE's instructions can perform the equivalent of an
extended MLA as a single instruction:

  %sa = sext <16 x i8> A to <16 x i32>
  %sb = sext <16 x i8> B to <16 x i32>
  %m = mul <16 x i32> %sa, %sb
  %r = vecreduce.add(%m)
  ->
  R = VMLADAV A, B

There are other instructions for performing add reductions of
v4i32/v8i16/v16i8 into i32 (VADDV), for doing the same with v4i32->i64
(VADDLV) and for performing a v4i32/v8i16 MLA into an i64 (VMLALDAV).
The i64 are particularly interesting as there are no native i64 add/mul
instructions, leading to the i64 add and mul naturally getting very
high costs.

Also worth mentioning, under NEON there is the concept of a sdot/udot
instruction which performs a partial reduction from a v16i8 to a v4i32.
They extend and mul/sum the first four elements from the inputs into the
first element of the output, repeating for each of the four output
lanes. They could possibly be represented in the same way as above in
llvm, so long as a vecreduce.add could perform a partial reduction. The
vectorizer would then produce a combination of in and outer loop
reductions to efficiently use the sdot and udot instructions. Although
this patch does not do that yet, it does suggest that separating the
input reduction type from the produced result type is a useful concept
to model. It also shows that a MLA reduction as a single instruction is
fairly common.

This patch attempt to improve the costmodelling of in-loop reductions
by:
 - Adding some pattern matching in the loop vectorizer cost model to
   match extended reduction patterns that are optionally extended and/or
   MLA patterns. This marks the cost of the reduction instruction correctly
   and the sext/zext/mul leading up to it as free, which is otherwise
   difficult to tell and may get a very high cost. (In the long run this
   can hopefully be replaced by vplan producing a single node and costing
   it correctly, but that is not yet something that vplan can do).
 - getExtendedAddReductionCost is added to query the cost of these
   extended reduction patterns.
 - Expanded the ARM costs to account for these expanded sizes, which is a
   fairly simple change in itself.
 - Some minor alterations to allow inloop reduction larger than the highest
   vector width and i64 MVE reductions.
 - An extra InLoopReductionImmediateChains map was added to the vectorizer
   for it to efficiently detect which instructions are reductions in the
   cost model.
 - The tests have some updates to show what I believe is optimal
   vectorization and where we are now.

Put together this can greatly improve performance for reduction loop
under MVE.

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

3 years ago[SLP] rename reduction variable to avoid shadowing; NFC
Sanjay Patel [Thu, 21 Jan 2021 21:01:12 +0000 (16:01 -0500)]
[SLP] rename reduction variable to avoid shadowing; NFC

The code structure can likely be improved now that
'OperationData' is gone.

3 years agoScalar: Don't visit constants in findInnerReductionPhi in LoopInterchange
Anton Rapetov [Thu, 21 Jan 2021 20:15:31 +0000 (12:15 -0800)]
Scalar: Don't visit constants in findInnerReductionPhi in LoopInterchange

In LoopInterchange, `findInnerReductionPhi()` looks for reduction
variables, which cannot be constants. Update it to return early in that
case.

This also addresses a blocker for removing use-lists from ConstantData,
whose users could be spread across arbitrary modules in the same
LLVMContext.

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

3 years agoRemove deprecated methods from OpState.
Christian Sigg [Thu, 21 Jan 2021 11:03:57 +0000 (12:03 +0100)]
Remove deprecated methods from OpState.

Reviewed By: rriddle

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

3 years agoADT: Fix reference invalidation in SmallVector::emplace_back and assign(N,V)
Duncan P. N. Exon Smith [Fri, 15 Jan 2021 00:40:41 +0000 (16:40 -0800)]
ADT: Fix reference invalidation in SmallVector::emplace_back and assign(N,V)

This fixes the final (I think?) reference invalidation in `SmallVector`
that we need to fix to align with `std::vector`. (There is still some
left in the range insert / append / assign, but the standard calls that
UB for `std::vector` so I think we don't care?)

For POD-like types, reimplement `emplace_back()` in terms of
`push_back()`, taking a copy even for large `T` rather than lose the
realloc optimization in `grow_pod()`.

For other types, split the grow operation in three and construct the new
element in the middle.

- `mallocForGrow()` calculates the new capacity and returns the result
  of `safe_malloc()`. We only need a single definition per
  `SmallVectorBase` so this is defined in SmallVector.cpp to avoid code
  size bloat. Moving this part of non-POD grow to the source file also
  allows the logic to be easily shared with `grow_pod`, and
  `report_size_overflow()` and `report_at_maximum_capacity()` can move
  there too.
- `moveElementsForGrow()` moves elements from the old to the new
  allocation.
- `takeAllocationForGrow()` frees the old allocation and saves the
  new allocation and capacity .

`SmallVector:assign(size_type, const T&)` also uses the split-grow
operations for non-POD, but it also has a semantic change when not
growing. Previously, assign would start with `clear()`, and so the old
elements were destructed and all elements of the new vector were
copy-constructed (potentially invalidating references). The new
implementation skips destruction and uses copy-assignment for the prefix
of the new vector that fits. The new semantics match what libc++ does
for `std::vector::assign()`.

Note that the following is another possible implementation:
```
  void assign(size_type NumElts, ValueParamT Elt) {
    std::fill_n(this->begin(), std::min(NumElts, this->size()), Elt);
    this->resize(NumElts, Elt);
  }
```
The downside of this simpler implementation is that if the vector has to
grow there will be `size()` redundant copy operations.

(I had planned on splitting this patch up into three for committing
(after getting performance numbers / initial review), but I've realized
that if this does for some reason need to be reverted we'll probably
want to revert the whole package...)

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

3 years agoRecommit "[RISCV] Legalize select when Zbt extension available"
Michael Munday [Thu, 21 Jan 2021 19:35:05 +0000 (11:35 -0800)]
Recommit "[RISCV] Legalize select when Zbt extension available"

This recommits 71ed4b6ce57d8843ef705af8f98305976a8f107a with
the polarity of some of the pattern corrected.

Original commit message:
The custom expansion of select operations in the RISC-V backend
interferes with the matching of cmov instructions. Legalizing
select when the Zbt extension is available solves that problem.

Reviewed By: luismarques, craig.topper

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

3 years ago[SLP] simplify reduction matching
Sanjay Patel [Thu, 21 Jan 2021 19:54:03 +0000 (14:54 -0500)]
[SLP] simplify reduction matching

This is NFC-intended and removes the "OperationData"
class which had become nothing more than a recurrence
(reduction) type.

I adjusted the matching logic to distinguish
instructions from non-instructions - that's all that
the "IsLeafValue" member was keeping track of.

3 years ago[ELF] report section sizes when output file too large
Bob Haarman [Tue, 12 Jan 2021 20:55:18 +0000 (20:55 +0000)]
[ELF] report section sizes when output file too large

Fixes PR48523. When the linker errors with "output file too large",
one question that comes to mind is how the section sizes differ from
what they were previously. Unfortunately, this information is lost
when the linker exits without writing the output file. This change
makes it so that the error message includes the sizes of the largest
sections.

Reviewed By: MaskRay, grimar, jhenderson

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

3 years ago[FunctionAttrs] Infer willreturn for functions without loops
Nikita Popov [Wed, 13 Jan 2021 20:56:08 +0000 (21:56 +0100)]
[FunctionAttrs] Infer willreturn for functions without loops

If a function doesn't contain loops and does not call non-willreturn
functions, then it is willreturn. Loops are detected by checking
for backedges in the function. We don't attempt to handle finite
loops at this point.

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

3 years agoX86: Fix use-after-realloc in X86AsmParser::ParseIntelExpression
Duncan P. N. Exon Smith [Thu, 21 Jan 2021 02:46:09 +0000 (18:46 -0800)]
X86: Fix use-after-realloc in X86AsmParser::ParseIntelExpression

`X86AsmParser::ParseIntelExpression` has a while loop. In the body,
calls to MCAsmLexer::UnLex can force a reallocation in the MCAsmLexer's
`CurToken` SmallVector, invalidating saved references to
`MCAsmLexer::getTok()`.

`const MCAsmToken &Tok` is such a saved reference, and this moves it
from outside the while loop to inside the body, fixing a
use-after-realloc.

`Tok` will still be reused across calls to `Lex()`, each of which
effectively destroys and constructs the pointed-to token. I'm a bit
skeptical of this usage pattern, but it seems broadly used in the
X86AsmParser (and others) so I'm leaving it alone (for now).

Somehow this bug was exposed by https://reviews.llvm.org/D94739,
resulting in test failures in dot-operator related tests in
llvm/test/tools/llvm-ml. I suspect the exposure path is related to
optimizer changes from splitting up the grow operation, but I haven't
dug all the way in. Regardless, there are already tests in tree that
cover this; they might fail consistently if we added ASan
instrumentation to SmallVector.

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

3 years ago[OpenMP] Fix failing test due to change in offloading flags
Joseph Huber [Thu, 21 Jan 2021 14:59:29 +0000 (09:59 -0500)]
[OpenMP] Fix failing test due to change in offloading flags

Summary:
Prior to D91261 the information checked the OMP_MAP_TARGET_PARAM flag, change this as it has been removed. The INFO macro was changed to accept a flag as input to make conditionally printing information easier.

Reviewed By: jdoerfert

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

3 years ago[CUDA] Normalize handling of defauled dtor.
Artem Belevich [Fri, 15 Jan 2021 00:05:33 +0000 (16:05 -0800)]
[CUDA] Normalize handling of defauled dtor.

Defaulted destructor was treated inconsistently, compared to other
compiler-generated functions.

When Sema::IdentifyCUDATarget() got called on just-created dtor which didn't
have implicit __host__ __device__ attributes applied yet, it would treat it as a
host function.  That happened to (sometimes) hide the error when dtor referred
to a host-only functions.

Even when we had identified defaulted dtor as a HD function, we still treated it
inconsistently during selection of usual deallocators, where we did not allow
referring to wrong-side functions, while it is allowed for other HD functions.

This change brings handling of defaulted dtors in line with other HD functions.

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

3 years ago[flang] Better C_LOC and C_ASSOCIATED in flang/module
peter klausler [Thu, 14 Jan 2021 20:49:27 +0000 (12:49 -0800)]
[flang] Better C_LOC and C_ASSOCIATED in flang/module

The place-holding implementation of C_LOC just didn't work
when used with our more complete semantic checking, specifically
in the case of a polymorphic argument; convert it to an external
function with an implicit interface.  C_ASSOCIATED needs to be
a generic interface with specific implementations for C_PTR and
C_FUNPTR.

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

3 years ago[NFC][Doc] Mention SystemZ supports StackMap generation
Ulrich Weigand [Thu, 21 Jan 2021 17:29:46 +0000 (18:29 +0100)]
[NFC][Doc] Mention SystemZ supports StackMap generation

Support available as of commit 5eb64110d241cf2506f54ade3c2693beed42dd8f.

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

3 years ago[RISCV] Update V instructions constraints to conform to v1.0
Hsiangkai Wang [Mon, 28 Dec 2020 03:57:41 +0000 (11:57 +0800)]
[RISCV] Update V instructions constraints to conform to v1.0

Upgrade RISC-V V extension to v1.0-08a0b46.
Update instruction constraints to conform to v1.0.

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

3 years ago[OpenMP] Add time profiling support in libomp
Giorgis Georgakoudis [Sat, 16 Jan 2021 02:50:06 +0000 (18:50 -0800)]
[OpenMP] Add time profiling support in libomp

Profiling has been recently implemented in libomptarget (D93055). This patch enables time profiling support for libomptarget in libomp, to support profiling of multi-threaded execution of offloaded regions.

Reviewed By: jdoerfert

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

3 years agoRevert "[AMDGPU] Implement mir parseCustomPseudoSourceValue"
Sebastian Neubauer [Thu, 21 Jan 2021 17:11:48 +0000 (18:11 +0100)]
Revert "[AMDGPU] Implement mir parseCustomPseudoSourceValue"

This reverts commit ba7dcd8542abfc784255efcb0767701dec42fe83.

(caused memory leaks)

3 years ago[libc++] Use ioctl when available to get random_device entropy.
Marek Kurdej [Thu, 21 Jan 2021 16:55:19 +0000 (17:55 +0100)]
[libc++] Use ioctl when available to get random_device entropy.

Implemented the idea from D94571 to improve entropy on Linux.

Reviewed By: ldionne, #libc

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

3 years ago[RISCV] Add new V instructions in v1.0-08a0b46.
Hsiangkai Wang [Mon, 21 Dec 2020 04:14:06 +0000 (12:14 +0800)]
[RISCV] Add new V instructions in v1.0-08a0b46.

Add new V instructions.
vfrsqrte7.v
vfrece7.v
vrgatherei16.vv
vneg.v
vncvt.x.x.w
vfneg.v

3 years ago[flang][driver] Move fixed/free from detection out of FrontendAction API
Andrzej Warzynski [Thu, 21 Jan 2021 15:42:56 +0000 (15:42 +0000)]
[flang][driver] Move fixed/free from detection out of FrontendAction API

All Fortran options should be set in `CompilerInstance` (via its
`CompilerInvocation`) before any of `FrontendAction` is entered -
that's one of the tasks of the driver. However, this is a bit tricky
with fixed and free from detection introduced in
https://reviews.llvm.org/D94228.

Fixed-free form detection needs to happen:
  * before any frontend action (we need to specify `isFixedForm` in
    `Fortran::parser::Options` before running any actions)
  * separately for every input file (we might be compiling multiple
    Fortran files, some in free form, some in fixed form)
In other words, we need this to happen early (before any
`FrontendAction`), but not too early (we need to know what the current
input file is). In practice, `isFixedForm` can only be set later
than other options (other options are inferred from compiler flags). So
we can't really set all of them in one place, which is not ideal.

All changes in this patch are NFCs (hence no new tests). Quick summary:
  * move fixed/free form detection from `FrontendAction::ExecuteAction` to
    `CompilerInstance::ExecuteAction`
  * add a bool flag in `FrontendInputFile` to mark a file as fixed/free
    form
  * updated a few comments

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

3 years ago[RISCV] Make LMUL field in VTYPE continuous.
Hsiangkai Wang [Mon, 21 Dec 2020 04:08:09 +0000 (12:08 +0800)]
[RISCV] Make LMUL field in VTYPE continuous.

Upgrade RISC-V V extension to v1.0-08a0b46.
Update the VTYPE encoding. Make LMUL encoding in a continuous field.

3 years ago[mlir]][SPIRV] Define OrderedOp and UnorderedOp and add lowerings from Standard.
MaheshRavishankar [Wed, 20 Jan 2021 22:47:14 +0000 (14:47 -0800)]
[mlir]][SPIRV] Define OrderedOp and UnorderedOp and add lowerings from Standard.

Define OrderedOp and UnorderedOp instructions in SPIR-V and convert
cmpf operations with `ord` and `uno` tag to these instructions
respectively.

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

3 years ago[mlir][SPIRV] Rename OpSpecConstantOperation -> OpSpecConstantOp
MaheshRavishankar [Wed, 20 Jan 2021 22:46:36 +0000 (14:46 -0800)]
[mlir][SPIRV] Rename OpSpecConstantOperation -> OpSpecConstantOp

The SPIR-V spec uses OpSpecConstantOp. Using an inconsistent name
makes the dialect generation scripts fail. Update to use the right
operation name, and fix the auto generation scripts as well.

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

3 years ago[AMDGPU][GlobalISel] Run SIAddImgInit
Jay Foad [Thu, 21 Jan 2021 14:31:43 +0000 (14:31 +0000)]
[AMDGPU][GlobalISel] Run SIAddImgInit

This pass is required to get correct codegen for image instructions with
the tfe or lwe bits set.

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

3 years agoAMDGPU: Remove v_rsq_f64 patterns
Matt Arsenault [Wed, 20 Jan 2021 22:07:41 +0000 (17:07 -0500)]
AMDGPU: Remove v_rsq_f64 patterns

This isn't accurate enough without correction

3 years agoAMDGPU: Use more accurate fast f64 fdiv
Matt Arsenault [Wed, 20 Jan 2021 18:55:55 +0000 (13:55 -0500)]
AMDGPU: Use more accurate fast f64 fdiv

A raw v_rcp_f64 isn't accurate enough, so start applying correction.

3 years ago[OpenMP][NVPTX] Added forward declaration for atomic operations
Shilei Tian [Thu, 21 Jan 2021 15:37:05 +0000 (10:37 -0500)]
[OpenMP][NVPTX] Added forward declaration for atomic operations

Pretty similar to D95058, this patch added forward declaration for
CUDA atomic functions. We already have definitions with right mangled names in
internal CUDA headers so the forward declaration here can work properly.

Reviewed By: jdoerfert, JonChesterfield

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

3 years agoAArch64/GlobalISel: Factor out parametersInCSRMatch
Matt Arsenault [Tue, 12 Jan 2021 23:58:30 +0000 (18:58 -0500)]
AArch64/GlobalISel: Factor out parametersInCSRMatch

Make this look more like the DAG handling and move to common code.

I also noticed AArch64 seems to not be properly adding the
physreg:virtreg mapping to the function live ins.

3 years ago[AMDGPU] Implement mir parseCustomPseudoSourceValue
Sebastian Neubauer [Fri, 15 Jan 2021 12:57:24 +0000 (13:57 +0100)]
[AMDGPU] Implement mir parseCustomPseudoSourceValue

Allow parsing generated mir with custom pseudo source value tokens.
Also rename pseudo source values to have more meaningful names.

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

3 years ago[ARM] Fix vector saddsat costs.
David Green [Thu, 21 Jan 2021 15:30:39 +0000 (15:30 +0000)]
[ARM] Fix vector saddsat costs.

It turns out the vectorizer calls the getIntrinsicInstrCost functions
with a scalar return type and vector VF. This updates the costmodel to
handle that, still producing the correct vector costs.

A vectorizer test is added to show it vectorizing at the correct factor
again.

3 years ago[flang][driver] Make the driver report diagnostics from the prescanner
Andrzej Warzynski [Thu, 21 Jan 2021 15:02:22 +0000 (15:02 +0000)]
[flang][driver] Make the driver report diagnostics from the prescanner

This patch makes sure that diagnostics from the prescanner are reported
when running `flang-new -E` (i.e. only the preprocessor phase is
requested). More specifically, the `PrintPreprocessedAction` action is
updated.

With this patch we make sure that the `f18` and `flang-new` provide
identical output when running the preprocessor and the prescanner
generates diagnostics.

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

3 years ago[OpenMP] Add support for mapping names in mapper API
Joseph Huber [Fri, 15 Jan 2021 18:09:35 +0000 (13:09 -0500)]
[OpenMP] Add support for mapping names in mapper API

Summary:
The custom mapper API did not previously support the mapping names added previously. This means they were not present if a user requested debugging information while using the mapper functions. This adds basic support for passing the mapped names to the runtime library.

Reviewers: jdoerfert

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

3 years agoAMDGPU: Add occupancy to serialized MachineFunctionInfo
Matt Arsenault [Fri, 15 Jan 2021 21:07:37 +0000 (16:07 -0500)]
AMDGPU: Add occupancy to serialized MachineFunctionInfo

Not sure about the default value handling, but also not sure
defaulting to a theoretically subtarget dependent value.

3 years ago[lldb][NFC] Fix build with GCC<6
Raphael Isemann [Thu, 21 Jan 2021 14:04:40 +0000 (15:04 +0100)]
[lldb][NFC] Fix build with GCC<6

GCC/libstdc++ before 6.1 can't handle scoped enums as unordered_map keys. LLVM
(and some build) bots officially support some GCC 5.x versions, so this patch
just makes the enum unscoped until we can require GCC 6.x.

3 years ago[clang][AST] Add get functions for CXXFoldExpr paren locations.
Balázs Kéri [Thu, 21 Jan 2021 09:17:57 +0000 (10:17 +0100)]
[clang][AST] Add get functions for CXXFoldExpr paren locations.

Reviewed By: hokein

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

3 years ago[InstCombine] avoid crashing on attribute propagation
Sanjay Patel [Thu, 21 Jan 2021 12:54:41 +0000 (07:54 -0500)]
[InstCombine] avoid crashing on attribute propagation

In https://llvm.org/PR48810 , we are crashing while trying to
propagate attributes from mempcpy (returns void*) to memcpy
(returns nothing - void).

We can avoid the crash by removing known incompatible
attributes for the void return type.

I'm not sure if this goes far enough (should we just drop all
attributes since this isn't the same function?). We also need
to audit other transforms in LibCallSimplifier to make sure
there are no other cases that have the same problem.

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

3 years ago[MC] Use std::make_tuple to make some toolchains happy again
Mikael Holmen [Thu, 21 Jan 2021 13:04:44 +0000 (14:04 +0100)]
[MC] Use std::make_tuple to make some toolchains happy again

My toolchain (LLVM 8.0, libstdc++ 5.4.0) complained with:

12:27:43 ../lib/MC/MCDwarf.cpp:814:10: error: chosen constructor is explicit in copy-initialization
12:27:43   return {Offset, Size, SetDelta};
12:27:43          ^~~~~~~~~~~~~~~~~~~~~~~~
12:27:43 /proj/flexasic/app/llvm/8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
12:27:43         constexpr tuple(_UElements&&... __elements)
12:27:43                   ^
12:27:43 1 error generated.

This commit adds explicit calls to std::make_tuple to work around
the problem.

3 years agoAdd log1p lowering from standard to ROCDL intrinsics
Frederik Gossen [Thu, 21 Jan 2021 12:54:48 +0000 (13:54 +0100)]
Add log1p lowering from standard to ROCDL intrinsics

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

3 years ago[DAGCombiner] Enable SimplifyDemandedBits vector support for TRUNCATE (REAPPLIED).
Simon Pilgrim [Thu, 21 Jan 2021 12:58:16 +0000 (12:58 +0000)]
[DAGCombiner] Enable SimplifyDemandedBits vector support for TRUNCATE (REAPPLIED).

Add DemandedElts support inside the TRUNCATE analysis.

REAPPLIED - this was reverted by @hans at rGa51226057fc3 due to an issue with vector shift amount types, which was fixed in rG935bacd3a724 and an additional test case added at rG0ca81b90d19d

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

3 years agoAdd log1p lowering from standard to NVVM intrinsics
Frederik Gossen [Thu, 21 Jan 2021 12:56:25 +0000 (13:56 +0100)]
Add log1p lowering from standard to NVVM intrinsics

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

3 years ago[X86][SSE] Add uitofp(trunc(and(lshr(x,c)))) vector test
Simon Pilgrim [Thu, 21 Jan 2021 12:29:50 +0000 (12:29 +0000)]
[X86][SSE] Add uitofp(trunc(and(lshr(x,c)))) vector test

Reduced from regression reported by @hans on D56387

3 years ago[DAG] SimplifyDemandedBits - correctly adjust truncated shift amount type
Simon Pilgrim [Thu, 21 Jan 2021 12:24:35 +0000 (12:24 +0000)]
[DAG] SimplifyDemandedBits - correctly adjust truncated shift amount type

As noticed on D56387, for vectors we must always correctly adjust the shift amount type during truncation (not just after legalization). We were getting away with it as we currently only accepted scalars via the dyn_cast<ConstantSDNode>.

3 years agoReland [lldb] Fix TestThreadStepOut.py after "Flush local value map on every instruction"
Raphael Isemann [Thu, 26 Nov 2020 08:40:02 +0000 (09:40 +0100)]
Reland [lldb] Fix TestThreadStepOut.py after "Flush local value map on every instruction"

The original patch got reverted as a dependency of cf1c774d6ace59c5adc9ab71b31e .
That patch got relanded so it's also necessary to reland this patch.

Original summary:

After cf1c774d6ace59c5adc9ab71b31e762c1be695b1, Clang seems to generate code
that is more similar to icc/Clang, so we can use the same line numbers for
all compilers in this test.

3 years ago[lldb] Make TestBSDArchives a no-debug-info-test
Raphael Isemann [Thu, 21 Jan 2021 12:06:47 +0000 (13:06 +0100)]
[lldb] Make TestBSDArchives a no-debug-info-test

The DSYM variant of this test is failing since D94890. But as we explicitly
try to disable the DSYM generation in the makefile and build the archive on
our own, I don't see why we even need to run the DSYM version of the test.

This patch disables the generated derived versions of this test for the
different debug information containers (which includes the failing DSYM one).

3 years ago[lldb][import-std-module] Do some basic file checks before trying to import a module
Raphael Isemann [Thu, 21 Jan 2021 11:05:59 +0000 (12:05 +0100)]
[lldb][import-std-module] Do some basic file checks before trying to import a module

Currently when LLDB has enough data in the debug information to import the `std` module,
it will just try to import it. However when debugging libraries where the sources aren't
available anymore, importing the module will generate a confusing diagnostic that
the module couldn't be built.

For the fallback mode (where we retry failed expressions with the loaded module), this
will cause the second expression to fail with a module built error instead of the
actual parsing issue in the user expression.

This patch adds checks that ensures that we at least have any source files in the found
include paths before we try to import the module. This prevents the module from being
loaded in the situation described above which means we don't emit the bogus 'can't
import module' diagnostic and also don't waste any time retrying the expression in the
fallback mode.

For the unit tests I did some refactoring as they now require a VFS with the files in it
and not just the paths. The Python test just builds a binary with a fake C++ module,
then deletes the module before debugging.

Fixes rdar://73264458

Reviewed By: JDevlieghere

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

3 years agoMC: AArch64: Add support for gotpage_lo15
Adhemerval Zanella [Wed, 13 Jan 2021 17:27:42 +0000 (17:27 +0000)]
MC: AArch64: Add support for gotpage_lo15

It is not used bt LLVM itself, but it would be used on lld tests
to implement R_AARCH64_LD64_GOTPAGE_LO15 support.

3 years ago[DAG] CombineToPreIndexedLoadStore - use const APInt& for getAPIntValue(). NFCI.
Simon Pilgrim [Thu, 21 Jan 2021 11:01:02 +0000 (11:01 +0000)]
[DAG] CombineToPreIndexedLoadStore - use const APInt& for getAPIntValue(). NFCI.

Cleanup some code to use auto* properly from cast, and use const APInt& for getAPIntValue() to avoid an unnecessary copy.

3 years ago[X86] Avoid a std::string copy by replacing auto with const auto&. NFC.
Simon Pilgrim [Thu, 21 Jan 2021 10:43:07 +0000 (10:43 +0000)]
[X86] Avoid a std::string copy by replacing auto with const auto&. NFC.

Fixes msvc analyzer warning.