platform/upstream/llvm.git
4 years ago[AArch64][SVE] Add intrinsics for non-temporal gather-loads/scatter-stores
Andrzej Warzynski [Wed, 19 Feb 2020 12:25:30 +0000 (12:25 +0000)]
[AArch64][SVE] Add intrinsics for non-temporal gather-loads/scatter-stores

Summary:
This patch adds the following LLVM IR intrinsics for SVE:
1. non-temporal gather loads
  * @llvm.aarch64.sve.ldnt1.gather
  * @llvm.aarch64.sve.ldnt1.gather.uxtw
  * @llvm.aarch64.sve.ldnt1.gather.scalar.offset
2. non-temporal scatter stores
  * @llvm.aarch64.sve.stnt1.scatter
  * @llvm.aarch64.sve.ldnt1.gather.uxtw
  * @llvm.aarch64.sve.ldnt1.gather.scalar.offset
These intrinsic are mapped to the corresponding SVE instructions
(example for half-words, zero-extending):
  * ldnt1h { z0.s }, p0/z, [z0.s, x0]
  * stnt1h { z0.s }, p0/z, [z0.s, x0]

Note that for non-temporal gathers/scatters, the SVE spec defines only
one instruction type: "vector + scalar". For this reason, we swap the
arguments when processing intrinsics that implement the "scalar +
vector" addressing mode:
  * @llvm.aarch64.sve.ldnt1.gather
  * @llvm.aarch64.sve.ldnt1.gather.uxtw
  * @llvm.aarch64.sve.stnt1.scatter
  * @llvm.aarch64.sve.ldnt1.gather.uxtw
In other words, all intrinsics for gather-loads and scatter-stores
implemented in this patch are mapped to the same load and store
instruction, respectively.

The sve2_mem_gldnt_vs multiclass (and it's counterpart for scatter
stores) from SVEInstrFormats.td was split into:
  * sve2_mem_gldnt_vec_vs_32_ptrs (32bit wide base addresses)
  * sve2_mem_gldnt_vec_vs_62_ptrs (64bit wide base addresses)
This is consistent with what we did for
@llvm.aarch64.sve.ld1.scalar.offset and highlights the actual split in
the spec and the implementation.

Reviewed by: sdesmalen

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

4 years ago[ARM,MVE] Add ACLE intrinsics for VCVT[ANPM] family.
Simon Tatham [Mon, 2 Mar 2020 09:06:09 +0000 (09:06 +0000)]
[ARM,MVE] Add ACLE intrinsics for VCVT[ANPM] family.

Summary:
These instructions convert a vector of floats to a vector of integers
of the same size, with assorted non-default rounding modes.
Implemented in IR as target-specific intrinsics, because as far as I
can see there are no matches for that functionality in the standard IR
intrinsics list.

Reviewers: MarkMurrayARM, dmgreen, miyuki, ostannard

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[ARM,MVE] Add ACLE intrinsics for VCVT.F32.F16 family.
Simon Tatham [Mon, 2 Mar 2020 09:06:00 +0000 (09:06 +0000)]
[ARM,MVE] Add ACLE intrinsics for VCVT.F32.F16 family.

Summary:
These instructions make a vector of `<4 x float>` by widening every
other lane of a vector of `<8 x half>`.

I wondered about representing these using standard IR, along the lines
of a shufflevector to extract elements of the input into a `<4 x half>`
followed by an `fpext` to turn that into `<4 x float>`. But it looks as
if that would take a lot of work in isel lowering to make it match any
pattern I could sensibly write in Tablegen, and also I haven't been
able to think of any other case where that pattern might be generated
in IR, so there wouldn't be any extra code generation win from doing
it that way.

Therefore, I've just used another target-specific intrinsic. We can
always change it to the other way later if anyone thinks of a good
reason.

(In order to put the intrinsic definition near similar things in
`IntrinsicsARM.td`, I've also lifted the definition of the
`MVEMXPredicated` multiclass higher up the file, without changing it.)

Reviewers: MarkMurrayARM, dmgreen, miyuki, ostannard

Reviewed By: miyuki

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[ARM,MVE] Correct MC operands in VCVT.F32.F16. (NFC)
Simon Tatham [Mon, 2 Mar 2020 09:05:48 +0000 (09:05 +0000)]
[ARM,MVE] Correct MC operands in VCVT.F32.F16. (NFC)

Summary:
The two MVE instructions that convert between v4f32 and v8f16 were
implemented as instances of the same class, with the same MC operand
list.

But that's not really appropriate, because the narrowing conversion
only partially overwrites its output register (it only has 4 f16
values to write into a vector of 8), so even when unpredicated, it
needs a $Qd_src input, a constraint tying that to the $Qd output, and
a vpred_n.

The widening conversion is better represented like any other
instruction that completely replaces its output when unpredicated: it
should have no $Qd_src operand, and instead, a vpred_r containing a
$inactive parameter. That's a better match to other similar
instructions, such as its integer analogue, the VMOVL instruction that
makes a v4i32 by sign- or zero-extending every other lane of a v8i16.

This commit brings the widening VCVT.F32.F16 into line with the other
instructions that behave like it. That means you can write isel
patterns that use it unpredicated, without having to add a pointless
undefined $QdSrc operand.

No existing code generation uses that instruction yet, so there should
be no functional change from this fix.

Reviewers: MarkMurrayARM, dmgreen, miyuki, ostannard

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[ARM,MVE] Add ACLE intrinsics for VQMOV[U]N family.
Simon Tatham [Mon, 2 Mar 2020 09:05:35 +0000 (09:05 +0000)]
[ARM,MVE] Add ACLE intrinsics for VQMOV[U]N family.

Summary:
These instructions work like VMOVN (narrowing a vector of wide values
to half size, and overwriting every other lane of an output register
with the result), except that the narrowing conversion is saturating.
They come in three signedness flavours: signed to signed, unsigned to
unsigned, and signed to unsigned. All are represented in IR by a
target-specific intrinsic that takes two separate 'unsigned' flags.

Reviewers: MarkMurrayARM, dmgreen, miyuki, ostannard

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[lld] Fix test failure from d978656fd06
Pavel Labath [Mon, 2 Mar 2020 10:28:48 +0000 (11:28 +0100)]
[lld] Fix test failure from d978656fd06

Tweak the test to account for the slightly different wording of the
error message.

4 years ago[DWARF] Use DWARFDataExtractor::getInitialLength to parse debug_names
Pavel Labath [Tue, 25 Feb 2020 14:40:49 +0000 (15:40 +0100)]
[DWARF] Use DWARFDataExtractor::getInitialLength to parse debug_names

Summary:
In this patch I've done a slightly bigger rewrite to also remove the
hardcoded header lengths.

Reviewers: jhenderson, dblaikie, ikudrin

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[DWARF] Use getInitialLength in range list parsing
Pavel Labath [Tue, 25 Feb 2020 14:17:57 +0000 (15:17 +0100)]
[DWARF] Use getInitialLength in range list parsing

Summary:
This could be considered obvious, but I am putting it up to illustrate
the usefulness/impact of the getInitialLength change.

Reviewers: dblaikie, jhenderson, ikudrin

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[DWARFDebugLine] Use new DWARFDataExtractor::getInitialLength
Pavel Labath [Fri, 14 Feb 2020 14:41:38 +0000 (15:41 +0100)]
[DWARFDebugLine] Use new DWARFDataExtractor::getInitialLength

Summary:
The error messages change somewhat, but I believe the overall
informational value remains unchanged.

Reviewers: jhenderson, dblaikie, ikudrin

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoFix Base64Test - for StringRef size
serge-sans-paille [Mon, 2 Mar 2020 10:06:07 +0000 (11:06 +0100)]
Fix Base64Test - for StringRef size

Original failures: http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/15975/steps/test-stage1-compiler/logs/stdio

4 years ago[git-clang-format] Fix typo in help message
Jim Lin [Mon, 2 Mar 2020 09:11:08 +0000 (17:11 +0800)]
[git-clang-format] Fix typo in help message

4 years ago[ARM][MVE] Restrict allowed types of gather/scatter offsets
Anna Welker [Mon, 2 Mar 2020 09:14:37 +0000 (09:14 +0000)]
[ARM][MVE] Restrict allowed types of gather/scatter offsets

The MVE gather instructions smaller than 32bits zext extend the values
in the offset register, as opposed to sign extending them. We need to
make sure that the code that we select from is suitably extended, which
this patch attempts to fix by tightening up the offset checks.

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

4 years ago[NFC][PowerPC] Move some alias definition from PPCInstrInfo.td to PPCInstr64Bit.td
Kang Zhang [Mon, 2 Mar 2020 09:50:01 +0000 (09:50 +0000)]
[NFC][PowerPC] Move some alias definition from PPCInstrInfo.td to PPCInstr64Bit.td

Summary:
Some 64-bit instructions alias definition is in PPCInstrInfo.td, it should be
moved to PPCInstr64Bit.td.

4 years ago[MLIR] Added llvm.freeze
Sagar Jain [Mon, 2 Mar 2020 09:19:57 +0000 (10:19 +0100)]
[MLIR] Added llvm.freeze

This patch adds llvm.freeze & processes undef constants from LLVM IR.

Syntax:
LLVM IR
`<result> = freeze ty <val>`

MLIR LLVM Dialect:
`llvm.freeze val attr-dict : type`

Example:
LLVM IR: `%3 = freeze i32 5`
MLIR: `%6 = llvm.freeze %5 : !llvm.i32`

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

4 years ago[gn build] Port 5a1958f2673
LLVM GN Syncbot [Mon, 2 Mar 2020 09:02:51 +0000 (09:02 +0000)]
[gn build] Port 5a1958f2673

4 years agoSyndicate, test and fix base64 implementation
serge-sans-paille [Mon, 24 Feb 2020 16:21:32 +0000 (17:21 +0100)]
Syndicate, test and fix base64 implementation

Move Base64 implementation from clangd/SemanticHighlighting to
llvm/Support/Base64, fix its implementation and provide a decent test suite.

Previous implementation code was using + operator instead of | to combine some
results, which is a problem when shifting signed values. (0xFF << 16) is
implicitly converted to a (signed) int, and thus results in 0xffff0000, which is
negative. Combining negative numbers with a + in that context is not what we
want to do.

This fixes https://github.com/llvm/llvm-project/issues/149.

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

4 years ago[clangd] Remove the deprecated clangdServer::rename API, NFC.
Haojian Wu [Mon, 2 Mar 2020 08:46:47 +0000 (09:46 +0100)]
[clangd] Remove the deprecated clangdServer::rename API, NFC.

There is no actual user of it now.

4 years ago[libc] Add sigprocmask
Alex Brachet [Mon, 2 Mar 2020 08:47:21 +0000 (03:47 -0500)]
[libc] Add sigprocmask

Summary: This patch adds `sigprocmask`, `sigemptyset` and `sigaddset`

Reviewers: sivachandra, MaskRay, gchatelet

Reviewed By: sivachandra

Subscribers: mgorny, tschuett, libc-commits

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

4 years agoRevert "[DebugInfo][clang][DWARF5]: Added support for debuginfo generation for defaul...
Hans Wennborg [Mon, 2 Mar 2020 08:26:00 +0000 (09:26 +0100)]
Revert "[DebugInfo][clang][DWARF5]: Added support for debuginfo generation for defaulted parameters"

The Bitcode/DITemplateParameter-5.0.ll test is failing:

FAIL: LLVM :: Bitcode/DITemplateParameter-5.0.ll (5894 of 36324)
******************** TEST 'LLVM :: Bitcode/DITemplateParameter-5.0.ll' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/thakis/src/llvm-project/out/gn/bin/llvm-dis -o - /usr/local/google/home/thakis/src/llvm-project/llvm/test/Bitcode/DITemplateParameter-5.0.ll.bc | /usr/local/google/home/thakis/src/llvm-project/out/gn/bin/FileCheck /usr/local/google/home/thakis/src/llvm-project/llvm/test/Bitcode/DITemplateParameter-5.0.ll
--
Exit Code: 2

Command Output (stderr):
--

It looks like the Bitcode/DITemplateParameter-5.0.ll.bc file was never checked in.

This reverts commit c2b437d53d40b6dc5603c97f527398f477d9c5f1.

4 years ago[DebugInfo][clang][DWARF5]: Added support for debuginfo generation for defaulted...
Awanish Pandey [Mon, 2 Mar 2020 05:22:12 +0000 (10:52 +0530)]
[DebugInfo][clang][DWARF5]: Added support for debuginfo generation for defaulted parameters
in C++ templates.

Summary:
This patch adds support for debuginfo generation for defaulted
parameters in clang and also extends corresponding DebugMetadata/IR to support this feature.

Reviewers: probinson, aprantl, dblaikie

Reviewed By: aprantl, dblaikie

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

4 years ago[PowerPC][test] Improve .got2 and .toc tests
Fangrui Song [Mon, 2 Mar 2020 06:36:55 +0000 (22:36 -0800)]
[PowerPC][test] Improve .got2 and .toc tests

There is no .got2 test for powerpc32.
There is no comdat variable test for powerpc{32,64}.

4 years ago[InlineSpiller] Relax re-materialization restriction for statepoint
Serguei Katkov [Fri, 28 Feb 2020 10:34:33 +0000 (17:34 +0700)]
[InlineSpiller] Relax re-materialization restriction for statepoint

We should be careful to allow count of re-materialization of operands to be less
then number of physical registers.

STATEPOINT instruction has a variable number of operands and potentially very big.
So re-materialization for all operands is disabled at the moment if restrict-statepoint-remat is true.

The patch relaxes the re-materialization restriction for STATEPOINT instruction allowing it for
fixed operands. Specifically it is about call target.

Reviewers: reames
Reviewed By: reames
Subscribers: llvm-commits, qcolombet, hiraditya
Differential Revision: https://reviews.llvm.org/D75335

4 years ago[ELF][PPC32] Don't report "relocation refers to a discarded section" for .got2
Fangrui Song [Sun, 1 Mar 2020 02:40:58 +0000 (18:40 -0800)]
[ELF][PPC32] Don't report "relocation refers to a discarded section" for .got2

Similar to D63182 [ELF][PPC64] Don't report "relocation refers to a discarded section" for .toc

Reviewed By: Bdragon28

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

4 years ago[Sparc] Fix incorrect operand for matching CMPri pattern
Jim Lin [Mon, 2 Mar 2020 02:04:21 +0000 (10:04 +0800)]
[Sparc] Fix incorrect operand for matching CMPri pattern

Summary:
It should be normal constant instead of target constant.
Pattern CMPri can be matched if the constant can be fitted into immediate field.
Otherwise, pattern CMPrr will be matched.
This fixed bug https://bugs.llvm.org/show_bug.cgi?id=44091.

Reviewers: dcederman, jyknight

Reviewed By: jyknight

Subscribers: jonpa, hiraditya, fedor.sergeev, jrtc27, llvm-commits

Tags: #llvm

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

4 years ago[DAGCombiner][X86] Disable narrowExtractedVectorLoad if the element type size isn...
Craig Topper [Mon, 2 Mar 2020 00:42:04 +0000 (16:42 -0800)]
[DAGCombiner][X86] Disable narrowExtractedVectorLoad if the element type size isn't byte sized

The address calculation for the offset assumes that you can calculate the offset by multiplying the index by the store size of the element. But that only works if the element's store size is exactly its real size since we store vectors tightly packed in memory. There are improvements we could make to this like special casing extracting element 0. I think we could also handle cases where the extracted VT is byte sized and the index is aligned with the extract element count.

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

4 years ago[X86] Not track size of the boudaryalign fragment during the layout
Shengchen Kan [Sun, 1 Mar 2020 07:43:53 +0000 (15:43 +0800)]
[X86] Not track size of the boudaryalign fragment during the layout

Summary:
Currently the boundaryalign fragment caches its size during the process
of layout and then it is relaxed and update the size in each iteration. This
behaviour is unnecessary and ugly.

Reviewers: annita.zhang, reames, MaskRay, craig.topper, LuoYuanke, jyknight

Reviewed By: MaskRay

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

4 years ago[X86][TwoAddressInstructionPass] Teach tryInstructionCommute to continue checking...
Craig Topper [Fri, 28 Feb 2020 04:53:17 +0000 (20:53 -0800)]
[X86][TwoAddressInstructionPass] Teach tryInstructionCommute to continue checking for commutable FMA operands in more cases.

Previously we would only check for another commutable operand if the first commute was an aggressive commute.

But if we have two kill operands and neither is tied to the def at the start, we should consider both operands as the one to use as the new def.

This improves the loop in the fma-commute-loop.ll test. This test is derived from a post from discourse here https://llvm.discourse.group/t/unnecessary-vmovapd-instructions-generated-can-you-hint-in-favor-of-vfmadd231pd/582

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

4 years ago[DAGCombiner] Don't emit select_cc from visitSINT_TO_FP/visitUINT_TO_FP. Use plain...
Craig Topper [Sun, 1 Mar 2020 18:41:20 +0000 (10:41 -0800)]
[DAGCombiner] Don't emit select_cc from visitSINT_TO_FP/visitUINT_TO_FP. Use plain select instead.

Select_cc isn't used by all targets. X86 doesn't have optimizations
for it.

Since we already know the input to the sint_to_fp/uint_to_fp is
a setcc we can just emit a plain select using that setcc as the
condition. Other DAG combines can turn that into a select_cc on
targets that support it.

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

4 years ago[JITLink] Update DEBUG_TYPE string for llvm-jitlink.
Lang Hames [Sun, 1 Mar 2020 17:34:31 +0000 (09:34 -0800)]
[JITLink] Update DEBUG_TYPE string for llvm-jitlink.

Apparently LLVM_DEBUG doesn't like dashes in strings.

4 years agoFix [ADT][NFC] SCCIterator: Change hasLoop() to hasCycle()
Stefanos Baziotis [Sun, 1 Mar 2020 17:35:58 +0000 (19:35 +0200)]
Fix [ADT][NFC] SCCIterator: Change hasLoop() to hasCycle()

4 years ago[ADT][NFC] SCCIterator: Change hasLoop() to hasCycle()
Stefanos Baziotis [Sun, 1 Mar 2020 17:17:21 +0000 (19:17 +0200)]
[ADT][NFC] SCCIterator: Change hasLoop() to hasCycle()

4 years agoAttempt to fix ZLIB CMake logic on Windows
Reid Kleckner [Sun, 1 Mar 2020 16:45:22 +0000 (08:45 -0800)]
Attempt to fix ZLIB CMake logic on Windows

CMake doesn't seem to like it when you regex search for "^".

4 years ago[WinEH] Fix inttoptr+phi optimization in presence of catchswitch
Reid Kleckner [Sun, 1 Mar 2020 15:47:55 +0000 (07:47 -0800)]
[WinEH] Fix inttoptr+phi optimization in presence of catchswitch

getFirstInsertionPt's return value must be checked for validity before
casting it to Instruction*. Don't attempt to insert casts after a phi in
a catchswitch block.

Fixes PR45033, introduced in D37832.

Reviewed By: davidxl, hfinkel

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

4 years ago[DAGCombiner] recognize shuffle (shuffle X, Mask0), Mask --> splat X
Sanjay Patel [Sun, 1 Mar 2020 14:09:22 +0000 (09:09 -0500)]
[DAGCombiner] recognize shuffle (shuffle X, Mask0), Mask --> splat X

We get the simple cases of this via demanded elements and other folds,
but that doesn't work if the values have >1 use, so add a dedicated
match for the pattern.

We already have this transform in IR, but it doesn't help the
motivating x86 tests (based on PR42024) because the shuffles don't
exist until after legalization and other combines have happened.
The AArch64 test shows a minimal IR example of the problem.

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

4 years ago[Coroutines][New pass manager] Move CoroElide pass to right position
Jun Ma [Sun, 1 Mar 2020 12:55:06 +0000 (20:55 +0800)]
[Coroutines][New pass manager] Move CoroElide pass to right position

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

4 years agoRevert "[Coroutines][new pass manager] Move CoroElide pass to right position"
Jun Ma [Sun, 1 Mar 2020 13:37:41 +0000 (21:37 +0800)]
Revert "[Coroutines][new pass manager] Move CoroElide pass to right position"

This reverts commit 4c0a133a412cd85381469e20f88ee7bf5d2ded8e.

4 years ago[Coroutines][new pass manager] Move CoroElide pass to right position
Jun Ma [Sun, 1 Mar 2020 12:55:06 +0000 (20:55 +0800)]
[Coroutines][new pass manager] Move CoroElide pass to right position

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

4 years ago[X86] Don't add DELETED_NODES to DAG combine worklist after calling SimplifyDemandedB...
Craig Topper [Sun, 1 Mar 2020 08:01:38 +0000 (00:01 -0800)]
[X86] Don't add DELETED_NODES to DAG combine worklist after calling SimplifyDemandedBits/SimplifyDemandedVectorElts.

These AddToWorklist calls were added in 84cd968f75bbd6e0fbabecc29d2c1090263adec7.
It's possible the SimplifyDemandedBits/SimplifyDemandedVectorElts
triggered CSE that deleted N. Detect that and avoid adding N
to the worklist.

Fixes PR45067.

4 years ago[PowerPC] Move .got2/.toc logic from PPCLinuxAsmPrinter::doFinalization() to emitEndO...
Fangrui Song [Sat, 29 Feb 2020 20:08:08 +0000 (12:08 -0800)]
[PowerPC] Move .got2/.toc logic from PPCLinuxAsmPrinter::doFinalization() to emitEndOfAsmFile()

Delete redundant .p2align 2 and improve tests.

4 years agoFix MLIR build by adding missing header after cleanup in af450eab
Mehdi Amini [Sun, 1 Mar 2020 01:11:12 +0000 (01:11 +0000)]
Fix MLIR build by adding missing header after cleanup in af450eab

4 years ago[ValueTracking] Let getGuaranteedNonFullPoisonOp consider assume, remove mentioning...
Juneyoung Lee [Sat, 29 Feb 2020 22:22:03 +0000 (07:22 +0900)]
[ValueTracking] Let getGuaranteedNonFullPoisonOp consider assume, remove mentioning about br

Summary:
This patch helps getGuaranteedNonFullPoisonOp handle llvm.assume call.
Also, a comment about the semantics of branch is removed to prevent confusion.
As llvm.assume does, branching on poison directly raises UB (as LangRef says), and this allows transformations such as introduction of llvm.assume on branch condition at each successor, or freely replacing values after conditional branch (such as at loop exit).
Handling br is not addressed in this patch. It makes SCEV more accurate, causing existing LoopVectorize/IndVar/etc tests to fail.

Reviewers: spatel, lebedev.ri, nlopes

Reviewed By: nlopes

Subscribers: hiraditya, javed.absar, llvm-commits

Tags: #llvm

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

4 years ago[ValueTracking] A value is never undef or poison if it must raise UB
Juneyoung Lee [Sat, 29 Feb 2020 04:10:31 +0000 (13:10 +0900)]
[ValueTracking] A value is never undef or poison if it must raise UB

Summary:
This patch helps isGuaranteedNotToBeUndefOrPoison return true if the value
makes the program always undefined.

According to value tracking functions' comments, it is not still in consensus
whether a poison value can be bitwise or not, so conservatively only the case with
i1 is considered.

Reviewers: spatel, lebedev.ri, reames, nlopes, regehr

Reviewed By: nlopes

Subscribers: uenoku, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[GVN] Fold equivalent freeze instructions
Juneyoung Lee [Sat, 29 Feb 2020 05:58:07 +0000 (14:58 +0900)]
[GVN] Fold equivalent freeze instructions

Summary:
This patch defines two freeze instructions to have the same value number if they are equivalent.

This is allowed because GVN replaces all uses of a duplicated instruction with another.

If it partially rewrites use, it is not allowed. e.g)

```
a = freeze(x)
b = freeze(x)
use(a)
use(a)
use(b)
=>
use(a)
use(b) // This is not allowed!
use(b)
```

Reviewers: fhahn, reames, spatel, efriedma

Reviewed By: fhahn

Subscribers: lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[X86] Tighten up the SDTypeProfile for X86ISD::CVTNE2PS2BF16. NFCI
Craig Topper [Sat, 29 Feb 2020 06:45:05 +0000 (22:45 -0800)]
[X86] Tighten up the SDTypeProfile for X86ISD::CVTNE2PS2BF16. NFCI

4 years agoAvoid including FileSystem.h from MemoryBuffer.h
Reid Kleckner [Sat, 29 Feb 2020 18:23:54 +0000 (10:23 -0800)]
Avoid including FileSystem.h from MemoryBuffer.h

Lots of headers pass around MemoryBuffer objects, but very few open
them. Let those that do include FileSystem.h.

Saves ~250 includes of Chrono.h & FileSystem.h:

$ diff -u thedeps-before.txt thedeps-after.txt | grep '^[-+] ' | sort | uniq -c | sort -nr
    254 -    ../llvm/include/llvm/Support/FileSystem.h
    253 -    ../llvm/include/llvm/Support/Chrono.h
    237 -    ../llvm/include/llvm/Support/NativeFormatting.h
    237 -    ../llvm/include/llvm/Support/FormatProviders.h
    192 -    ../llvm/include/llvm/ADT/StringSwitch.h
    190 -    ../llvm/include/llvm/Support/FormatVariadicDetails.h
...

This requires duplicating the file_t typedef, which is unfortunate. I
sunk the choice of mapping mode down into the cpp file using variable
template specializations instead of class members in headers.

4 years agoRevert "[MLIR] Move from using target_link_libraries to LINK_LIBS for llvm libraries."
Stephen Neuendorffer [Sat, 29 Feb 2020 19:51:04 +0000 (11:51 -0800)]
Revert "[MLIR] Move from using target_link_libraries to LINK_LIBS for llvm libraries."

This reverts commit 7a6c68977114b91097d693e9cfcb636631f61f91.
This breaks the build with cmake 3.13.4, but succeeds with cmake 3.15.3

4 years agoRevert "[MLIR] Remove redundant library dependencies"
Stephen Neuendorffer [Sat, 29 Feb 2020 19:50:45 +0000 (11:50 -0800)]
Revert "[MLIR] Remove redundant library dependencies"

This reverts commit c4c8fbde649af8359cbfcbb5cef90fbe195c16fc.

4 years agoRevert "[MLIR] Move from add_dependencies() to DEPENDS"
Stephen Neuendorffer [Sat, 29 Feb 2020 19:50:31 +0000 (11:50 -0800)]
Revert "[MLIR] Move from add_dependencies() to DEPENDS"

This reverts commit 31e07d716a083b85df226c31f6ba72bc477f58fc.

4 years agoFix Wdocumentation warning - use tparam for template parameters. NFC.
Simon Pilgrim [Sat, 29 Feb 2020 19:24:21 +0000 (19:24 +0000)]
Fix Wdocumentation warning - use tparam for template parameters. NFC.

4 years ago[MachineInst] Remove dead code. NFCI.
Simon Pilgrim [Sat, 29 Feb 2020 19:22:40 +0000 (19:22 +0000)]
[MachineInst] Remove dead code. NFCI.

The MachineFunction MF value is not used any more and is always null.

4 years agoMake argument const to silence cppcheck warning. NFCI.
Simon Pilgrim [Sat, 29 Feb 2020 19:11:00 +0000 (19:11 +0000)]
Make argument const to silence cppcheck warning. NFCI.

4 years agoRevert "[MLIR] Add support for libMLIR.so"
Stephen Neuendorffer [Sat, 29 Feb 2020 19:08:19 +0000 (11:08 -0800)]
Revert "[MLIR] Add support for libMLIR.so"

This reverts commit e17d9c11d49ab42ec19620679e981bb6147a2856.
It breaks the build.

4 years agoRevert "[MLIR] Fixes for BUILD_SHARED_LIBS=on"
Stephen Neuendorffer [Sat, 29 Feb 2020 19:06:50 +0000 (11:06 -0800)]
Revert "[MLIR] Fixes for BUILD_SHARED_LIBS=on"

This reverts commit 777e97cc1a8c1fe44245bdcb4fd9386ae2b3cc9d.

4 years ago[CMake] Link against ZLIB::ZLIB
Petr Hosek [Thu, 6 Feb 2020 23:24:07 +0000 (15:24 -0800)]
[CMake] Link against ZLIB::ZLIB

This is the imported target that find_package(ZLIB) defines.

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

4 years ago[CMake] Use PUBLIC link mode for static libraries
Petr Hosek [Thu, 6 Feb 2020 03:07:43 +0000 (19:07 -0800)]
[CMake] Use PUBLIC link mode for static libraries

Using INTERFACE prevents the use of imported libraries as we've done
in 00b3d49 because these aren't linked against the target, they're
only made part of the interface. This doesn't affect the output since
static libraries aren't being linked into, but it enables the use of
imported libraries.

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

4 years ago[X86][F16C] Remove cvtph2ps intrinsics and use generic half2float conversion (PR37554)
Simon Pilgrim [Sat, 29 Feb 2020 18:56:53 +0000 (18:56 +0000)]
[X86][F16C] Remove cvtph2ps intrinsics and use generic half2float conversion (PR37554)

This removes everything but int_x86_avx512_mask_vcvtph2ps_512 which provides the SAE variant, but even this can use the fpext generic if the rounding control is the default.

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

4 years ago[MLIR] Fixes for BUILD_SHARED_LIBS=on
Stephen Neuendorffer [Thu, 27 Feb 2020 22:53:12 +0000 (14:53 -0800)]
[MLIR] Fixes for BUILD_SHARED_LIBS=on

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

4 years ago[MLIR] Add support for libMLIR.so
Valentin Churavy [Sun, 9 Feb 2020 03:27:54 +0000 (19:27 -0800)]
[MLIR] Add support for libMLIR.so

Putting this up mainly for discussion on
how this should be done. I am interested in MLIR from
the Julia side and we currently have a strong preference
to dynamically linking against the LLVM shared library,
and would like to have a MLIR shared library.

This patch adds a new cmake function add_mlir_library()
which accumulates a list of targets to be compiled into
libMLIR.so.  Note that not all libraries make sense to
be compiled into libMLIR.so.  In particular, we want
to avoid libraries which primarily exist to support
certain tools (such as mlir-opt and mlir-cpu-runner).

Note that the resulting libMLIR.so depends on LLVM, but
does not contain any LLVM components.  As a result, it
is necessary to link with libLLVM.so to avoid linkage
errors. So, libMLIR.so requires LLVM_BUILD_LLVM_DYLIB=on

FYI, Currently it appears that LLVM_LINK_LLVM_DYLIB is broken
because mlir-tblgen is linked against libLLVM.so and
and independent LLVM components.

Previous version of this patch broke depencies on TableGen
targets.  This appears to be because it compiled all
libraries to OBJECT libraries (probably because cmake
is generating different target names).  Avoiding object
libraries results in correct dependencies.

(updated by Stephen Neuendorffer)

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

4 years ago[MLIR] Move from add_dependencies() to DEPENDS
Stephen Neuendorffer [Thu, 20 Feb 2020 18:48:51 +0000 (10:48 -0800)]
[MLIR] Move from add_dependencies() to DEPENDS

add_llvm_library and add_llvm_executable may need to create new targets with
appropriate dependencies.  As a result, it is not sufficient in some
configurations (namely LLVM_BUILD_LLVM_DYLIB=on) to only call
add_dependencies().  Instead, the explicit TableGen dependencies must
be passed to add_llvm_library() or add_llvm_executable() using the DEPENDS
keyword.

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

4 years ago[MLIR] Remove redundant library dependencies
Stephen Neuendorffer [Thu, 20 Feb 2020 06:56:38 +0000 (22:56 -0800)]
[MLIR] Remove redundant library dependencies

In cmake, it is redundant to have a target list under target_link_libraries()
and add_dependency().  This patch removes the redundant dependency from
add_dependency().

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

4 years ago[MLIR] Move from using target_link_libraries to LINK_LIBS for llvm libraries.
Stephen Neuendorffer [Tue, 18 Feb 2020 23:07:35 +0000 (15:07 -0800)]
[MLIR] Move from using target_link_libraries to LINK_LIBS for llvm libraries.

When compiling libLLVM.so, add_llvm_library() manipulates the link libraries
being used.  This means that when using add_llvm_library(), we need to pass
the list of libraries to be linked (using the LINK_LIBS keyword) instead of
using the standard target_link_libraries call.  This is preparation for
properly dealing with creating libMLIR.so as well.

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

4 years agoEnsure that multi-threading is disabled when enabling IRPrinting with module scope
Mehdi Amini [Sat, 29 Feb 2020 06:04:38 +0000 (06:04 +0000)]
Ensure that multi-threading is disabled when enabling IRPrinting with module scope

This is avoid the user to shoot themselves in the foot and encounter
strange crashes that are confusing until one run with TSAN.

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

4 years ago[MC] Add MCStreamer::emitInt{8,16,32,64}
Fangrui Song [Sat, 29 Feb 2020 16:25:22 +0000 (08:25 -0800)]
[MC] Add MCStreamer::emitInt{8,16,32,64}

Similar to AsmPrinter::emitInt{8,16,32,64}.

4 years agoRemove unused parameter from CXXRecordDecl::forallBases [NFC]
Aaron Puchert [Sat, 29 Feb 2020 13:22:41 +0000 (14:22 +0100)]
Remove unused parameter from CXXRecordDecl::forallBases [NFC]

Summary:
Apparently all users of the function were fine with short-circuiting
and none cared to override the default argument.

Reviewers: aaron.ballman, rsmith

Reviewed By: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[PassManager] add tests for vector pass enabling; NFC
Sanjay Patel [Fri, 28 Feb 2020 22:49:22 +0000 (17:49 -0500)]
[PassManager] add tests for vector pass enabling; NFC

4 years ago[ExecutionEngine] Add JITSymbolFlags::fromSummary(GlobalValueSummary*)
Stefan Gränitz [Sat, 29 Feb 2020 11:52:19 +0000 (11:52 +0000)]
[ExecutionEngine] Add JITSymbolFlags::fromSummary(GlobalValueSummary*)

Summary: A function that creates JITSymbolFlags from a GlobalValueSummary. Similar functions exist: fromGlobalValue(), fromObjectSymbol()

Reviewers: lhames

Reviewed By: lhames

Subscribers: hiraditya, steven_wu, dexonsmith, arphaman, llvm-commits

Tags: #llvm

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

4 years agoFirst test commit - empty
Stefanos Baziotis [Sat, 29 Feb 2020 09:53:11 +0000 (11:53 +0200)]
First test commit - empty

4 years ago[llvm-readobj] - Report warnings instead of errors for broken relocations.
Georgii Rymar [Fri, 14 Feb 2020 09:47:52 +0000 (12:47 +0300)]
[llvm-readobj] - Report warnings instead of errors for broken relocations.

This is a follow-up for https://reviews.llvm.org/D74545.

It adds test cases for each incorrect case returned in `getRelocationTarget`.

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

4 years agoArrayRef'ize restoreCalleeSavedRegisters. NFCI.
Benjamin Kramer [Sat, 29 Feb 2020 08:50:23 +0000 (09:50 +0100)]
ArrayRef'ize restoreCalleeSavedRegisters. NFCI.

restoreCalleeSavedRegisters can mutate the contents of the
CalleeSavedInfos, so use a MutableArrayRef.

4 years ago[libc] Add ability to generate enum types/values to HdrGen.
Siva Chandra Reddy [Thu, 27 Feb 2020 22:30:24 +0000 (14:30 -0800)]
[libc] Add ability to generate enum types/values to HdrGen.

A target to generate the std C threads.h file has been added. This
utilizes the new feature added in this change.

Reviewers: phosek

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

4 years ago[X86] Move the function getOrCreateBoundaryAlignFragment
Shengchen Kan [Fri, 28 Feb 2020 14:27:53 +0000 (22:27 +0800)]
[X86] Move the function getOrCreateBoundaryAlignFragment

MCObjectStreamer is more suitable to create fragments than
X86AsmBackend, for example, the function getOrCreateDataFragment is
defined in MCObjectStreamer.

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

4 years ago[X86] Disable the NOP padding for branches when bundle is enabled
Shengchen Kan [Fri, 28 Feb 2020 13:09:30 +0000 (21:09 +0800)]
[X86] Disable the NOP padding for branches when bundle is enabled

When bundle is enabled, data fragment itself has a space to emit NOP
to bundle-align instructions. The behaviour makes it impossible for
us to determine whether the macro fusion really happen when emitting
instructions. In addition, boundary-align fragment is also used to
emit NOPs to align instructions, currently using them together sometimes
makes code crazy.

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

4 years ago[ELF][PPC32] Fix canonical PLTs when the order does not match the PLT order
Fangrui Song [Sat, 29 Feb 2020 01:22:29 +0000 (17:22 -0800)]
[ELF][PPC32] Fix canonical PLTs when the order does not match the PLT order

Reviewed By: Bdragon28

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

4 years ago[ELF] Delete two unneeded `referenced = true` after D65584
Fangrui Song [Sat, 29 Feb 2020 05:26:36 +0000 (21:26 -0800)]
[ELF] Delete two unneeded `referenced = true` after D65584

4 years agoRevert "Fix GSYM tests to run the yaml files and fix test failures on some machines."
Greg Clayton [Sat, 29 Feb 2020 05:19:05 +0000 (21:19 -0800)]
Revert "Fix GSYM tests to run the yaml files and fix test failures on some machines."

This reverts commit d334ce0b5acb945d6202d0ab6a17bdca530f50c1.

4 years ago[cmake] Fix LLVM_USE_SPLIT_DWARF
Michael Liao [Fri, 28 Feb 2020 05:01:08 +0000 (00:01 -0500)]
[cmake] Fix LLVM_USE_SPLIT_DWARF

Summary:
- Add `-gsplit-dwarf` as an option instead of a definition.
- Only add that option on compilers supporting dwarf splitting, such as clang
  and gcc.

Reviewers: echristo, pcc

Subscribers: mgorny, aprantl, llvm-commits

Tags: #llvm

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

4 years agoDisable instrprof-merging.cpp on powerpc64 (D69471 follow up)
Vedant Kumar [Sat, 29 Feb 2020 02:59:56 +0000 (18:59 -0800)]
Disable instrprof-merging.cpp on powerpc64 (D69471 follow up)

An execution count goes missing for a constructor, this needs
investigation:

http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/45132/

```
/home/buildbots/ppc64be-clang-test/clang-ppc64be/llvm/compiler-rt/test/profile/instrprof-merging.cpp:28:16:
error: V1: expected string not found in input
 A() {} // V1: [[@LINE]]{{ *}}|{{ *}}1

<stdin>:28:32: note: possible intended match here
 28| | A() {} // V1: [[@LINE]]{{ *}}|{{ *}}1
```

4 years agoAdd cast to appease clang-armv7-linux-build-cache (D69471 followup)
Vedant Kumar [Sat, 29 Feb 2020 02:27:04 +0000 (18:27 -0800)]
Add cast to appease clang-armv7-linux-build-cache (D69471 followup)

http://lab.llvm.org:8011/builders/clang-armv7-linux-build-cache/builds/27075

error: non-constant-expression cannot be narrowed from type 'uint64_t'
(aka 'unsigned long long') to 'size_t' (aka 'unsigned int') in
initializer list [-Wc++11-narrowing]
  return {MappingBuf, getDataSize<FuncRecordTy, Endian>(Record)};

4 years agoReland: [Coverage] Revise format to reduce binary size
Vedant Kumar [Mon, 21 Oct 2019 18:48:38 +0000 (11:48 -0700)]
Reland: [Coverage] Revise format to reduce binary size

Try again with an up-to-date version of D69471 (99317124 was a stale
revision).

---

Revise the coverage mapping format to reduce binary size by:

1. Naming function records and marking them `linkonce_odr`, and
2. Compressing filenames.

This shrinks the size of llc's coverage segment by 82% (334MB -> 62MB)
and speeds up end-to-end single-threaded report generation by 10%. For
reference the compressed name data in llc is 81MB (__llvm_prf_names).

Rationale for changes to the format:

- With the current format, most coverage function records are discarded.
  E.g., more than 97% of the records in llc are *duplicate* placeholders
  for functions visible-but-not-used in TUs. Placeholders *are* used to
  show under-covered functions, but duplicate placeholders waste space.

- We reached general consensus about giving (1) a try at the 2017 code
  coverage BoF [1]. The thinking was that using `linkonce_odr` to merge
  duplicates is simpler than alternatives like teaching build systems
  about a coverage-aware database/module/etc on the side.

- Revising the format is expensive due to the backwards compatibility
  requirement, so we might as well compress filenames while we're at it.
  This shrinks the encoded filenames in llc by 86% (12MB -> 1.6MB).

See CoverageMappingFormat.rst for the details on what exactly has
changed.

Fixes PR34533 [2], hopefully.

[1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118428.html
[2] https://bugs.llvm.org/show_bug.cgi?id=34533

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

4 years agoRevert "[Coverage] Revise format to reduce binary size"
Vedant Kumar [Sat, 29 Feb 2020 02:03:15 +0000 (18:03 -0800)]
Revert "[Coverage] Revise format to reduce binary size"

This reverts commit 99317124e1c772e9a9de41a0cd56e1db049b4ea4. This is
still busted on Windows:

http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/40873

The llvm-cov tests report 'error: Could not load coverage information'.

4 years ago[compiler-rt/test] Relax a test so we can debug it on sanitizer-x86_64-linux-android
Vedant Kumar [Sat, 29 Feb 2020 01:46:54 +0000 (17:46 -0800)]
[compiler-rt/test] Relax a test so we can debug it on sanitizer-x86_64-linux-android

This test is failing with a core dump on /just/ this bot, and I'd like
to find out why.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/27979/

4 years ago[Coverage] Revise format to reduce binary size
Vedant Kumar [Mon, 21 Oct 2019 18:48:38 +0000 (11:48 -0700)]
[Coverage] Revise format to reduce binary size

Revise the coverage mapping format to reduce binary size by:

1. Naming function records and marking them `linkonce_odr`, and
2. Compressing filenames.

This shrinks the size of llc's coverage segment by 82% (334MB -> 62MB)
and speeds up end-to-end single-threaded report generation by 10%. For
reference the compressed name data in llc is 81MB (__llvm_prf_names).

Rationale for changes to the format:

- With the current format, most coverage function records are discarded.
  E.g., more than 97% of the records in llc are *duplicate* placeholders
  for functions visible-but-not-used in TUs. Placeholders *are* used to
  show under-covered functions, but duplicate placeholders waste space.

- We reached general consensus about giving (1) a try at the 2017 code
  coverage BoF [1]. The thinking was that using `linkonce_odr` to merge
  duplicates is simpler than alternatives like teaching build systems
  about a coverage-aware database/module/etc on the side.

- Revising the format is expensive due to the backwards compatibility
  requirement, so we might as well compress filenames while we're at it.
  This shrinks the encoded filenames in llc by 86% (12MB -> 1.6MB).

See CoverageMappingFormat.rst for the details on what exactly has
changed.

Fixes PR34533 [2], hopefully.

[1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118428.html
[2] https://bugs.llvm.org/show_bug.cgi?id=34533

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

4 years agoTry to fix WindowsManifest CMake logic on Windows
Reid Kleckner [Sat, 29 Feb 2020 01:21:50 +0000 (17:21 -0800)]
Try to fix WindowsManifest CMake logic on Windows

CMake is complaining about the "^" regex if the prefixes are empty
strings.

4 years agoFix GSYM tests to run the yaml files and fix test failures on some machines.
Greg Clayton [Fri, 28 Feb 2020 23:25:47 +0000 (15:25 -0800)]
Fix GSYM tests to run the yaml files and fix test failures on some machines.

Summary: YAML files were not being run during lit testing as there was no lit.local.cfg file. Once this was fixed, some buildbots would fail due to a StringRef that pointed to a std::string inside of a temporary llvm::Triple object. These issues are fixed here by making a local triple object that stays around long enough so the StringRef points to valid data.

Reviewers: aprantl, thakis, MaskRay, aadsm, wallace

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[X86] Remove isel patterns from broadcast of loadi32.
Craig Topper [Fri, 28 Feb 2020 23:42:47 +0000 (15:42 -0800)]
[X86] Remove isel patterns from broadcast of loadi32.

We already combine non extending loads with broadcasts in DAG
combine. All these patterns are picking up is the aligned extload
special case. But the only lit test we have that exercsises it is
using v8i1 load that datalayout is reporting align 8 for. That
seems generous. So without a realistic test case I don't think
there is much value in these patterns.

4 years ago[compiler-rt/test] Use FileCheck -allow-empty instead of count 0
Vedant Kumar [Sat, 29 Feb 2020 00:20:54 +0000 (16:20 -0800)]
[compiler-rt/test] Use FileCheck -allow-empty instead of count 0

Hope this fixes:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/27977/steps/run%20lit%20tests%20%5Bi686%2Ffugu-userdebug%2FN2G48C%5D/logs/stdio

```
: 'RUN: at line 8';   UBSAN_OPTIONS=suppressions=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_i686/test/ubsan/Standalone-i386/TestCases/Misc/Output/nullability.c.tmp.supp  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_i686/test/ubsan/Standalone-i386/TestCases/Misc/Output/nullability.c.tmp 2>&1 | count 0
--
Exit Code: 1

Command Output (stderr):
--
Expected 0 lines, got 2.
```

Not sure what this would be printing though, a sanitizer initialization message?

4 years ago[LTO][Legacy] Add explicit dependency on BinaryFormat
Francis Visoiu Mistrih [Fri, 28 Feb 2020 23:49:28 +0000 (15:49 -0800)]
[LTO][Legacy] Add explicit dependency on BinaryFormat

This fixes some windows bots.

4 years ago[DFSan] Add __dfsan_cmp_callback.
Matt Morehouse [Fri, 28 Feb 2020 23:49:37 +0000 (15:49 -0800)]
[DFSan] Add __dfsan_cmp_callback.

Summary:
When -dfsan-event-callbacks is specified, insert a call to
__dfsan_cmp_callback on every CMP instruction.

Reviewers: vitalybuka, pcc, kcc

Reviewed By: kcc

Subscribers: hiraditya, #sanitizers, eugenis, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[Sema] Fix an assert when objc_externally_retained was applied to an unprototyped...
Erik Pilkington [Fri, 28 Feb 2020 23:24:23 +0000 (15:24 -0800)]
[Sema] Fix an assert when objc_externally_retained was applied to an unprototyped function

rdar://58893199

4 years ago[DFSan] Add __dfsan_mem_transfer_callback.
Matt Morehouse [Fri, 28 Feb 2020 23:48:03 +0000 (15:48 -0800)]
[DFSan] Add __dfsan_mem_transfer_callback.

Summary:
When -dfsan-event-callbacks is specified, insert a call to
__dfsan_mem_transfer_callback on every memcpy and memmove.

Reviewers: vitalybuka, kcc, pcc

Reviewed By: kcc

Subscribers: eugenis, hiraditya, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[modules] Allow frameworks to have only a private module without a public one.
Volodymyr Sapsai [Thu, 27 Feb 2020 23:51:24 +0000 (15:51 -0800)]
[modules] Allow frameworks to have only a private module without a public one.

Support only preferred spelling 'Modules/module.private.modulemap' and
not the deprecated 'module_private.map'.

rdar://problem/57715533

Reviewed By: bruno

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

4 years ago[AMDGPU] Fix scheduling model for V_MULLIT_F32
Jay Foad [Fri, 28 Feb 2020 23:20:45 +0000 (23:20 +0000)]
[AMDGPU] Fix scheduling model for V_MULLIT_F32

This was incorrectly marked as a half rate 64-bit instruction by D45073.

4 years ago[X86] Canonicalize (bitcast (vbroadcast_load)) so that the cast and vbroadcast_load...
Craig Topper [Fri, 28 Feb 2020 08:35:52 +0000 (00:35 -0800)]
[X86] Canonicalize (bitcast (vbroadcast_load)) so that the cast and vbroadcast_load are both integer or fp.

Helps a little with some isel pattern matching. Especially on
32-bit targets where we sometimes use f64 loads.

4 years ago[X86] Remove stale FIXME form test. NFC.
Craig Topper [Fri, 28 Feb 2020 05:32:49 +0000 (21:32 -0800)]
[X86] Remove stale FIXME form test. NFC.

4 years ago[X86] Cleanup a comment around bitcasting X86ISD::VBROADCAST_LOAD and add an assert...
Craig Topper [Fri, 28 Feb 2020 05:29:52 +0000 (21:29 -0800)]
[X86] Cleanup a comment around bitcasting X86ISD::VBROADCAST_LOAD and add an assert to make sure memory VT size doesn't change.

4 years ago[llvm][Support][modulemap] Exclude WindowsSupport.h from the LLVM_Util module
Michael Spencer [Fri, 28 Feb 2020 22:39:49 +0000 (14:39 -0800)]
[llvm][Support][modulemap] Exclude WindowsSupport.h from the LLVM_Util module

rG01f9abbb50b1 moved WindowsSupport.h to include/llvm/Support/Windows/

This is a problem because the modulemap include all of the Support and
ADT directories, thus any use of any header in Support or ADT would
cause the compiler to try to build WindowsSupport.h, which only works
on Windows.

Fix this by explicitly excluding WindowsSupport.h from the LLVM_Util
module.

4 years ago[ubsan] Add support for -fsanitize=nullability-* suppressions
Vedant Kumar [Fri, 28 Feb 2020 22:09:14 +0000 (14:09 -0800)]
[ubsan] Add support for -fsanitize=nullability-* suppressions

rdar://59402904

4 years ago[entry values] ARM: Add a describeLoadedValue override (PR45025)
Vedant Kumar [Thu, 27 Feb 2020 17:58:24 +0000 (09:58 -0800)]
[entry values] ARM: Add a describeLoadedValue override (PR45025)

As a narrow stopgap for the assertion failure described in PR45025, add
a describeLoadedValue override to ARMBaseInstrInfo and use it to detect
copies in which the forwarding reg is a super/sub reg of the copy
destination. For the moment this is unsupported.

Several follow ups are possible:

1) Handle VORRq. At the moment, we do not, because isCopyInstrImpl
   returns early when !MI.isMoveReg().

2) In the case where forwarding reg is a super-reg of the copy
   destination, we should be able to describe the forwarding reg as a
   subreg within the copy destination. I'm not 100% sure about this, but
   it looks like that's what's done in AArch64InstrInfo.

3) In the case where the forwarding reg is a sub-reg of the copy
   destination, maybe we could describe the forwarding reg using the
   copy destinaion and a DW_OP_LLVM_fragment (I guess this should be
   possible after D75036).

https://bugs.llvm.org/show_bug.cgi?id=45025
rdar://59772698

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

4 years ago[DFSan] Add __dfsan_load_callback.
Matt Morehouse [Fri, 28 Feb 2020 22:25:45 +0000 (14:25 -0800)]
[DFSan] Add __dfsan_load_callback.

Summary:
When -dfsan-event-callbacks is specified, insert a call to
__dfsan_load_callback() on every load.

Reviewers: vitalybuka, pcc, kcc

Reviewed By: vitalybuka, kcc

Subscribers: hiraditya, #sanitizers, llvm-commits, eugenis, kcc

Tags: #sanitizers, #llvm

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

4 years ago[ADT] Allow K to be incomplete during DenseMap<K*, V> instantiation
Reid Kleckner [Thu, 27 Feb 2020 21:11:17 +0000 (13:11 -0800)]
[ADT] Allow K to be incomplete during DenseMap<K*, V> instantiation

DenseMap requires two sentinel values for keys: empty and tombstone
values. To avoid undefined behavior, LLVM aligns the two sentinel
pointers to alignof(T). This requires T to be complete, which is
needlessly restrictive.

Instead, assume that DenseMap pointer keys have a maximum alignment of
4096, and use the same sentinel values for all pointer keys. The new
sentinels are:
  empty:     static_cast<uintptr_t>(-1) << 12
  tombstone: static_cast<uintptr_t>(-2) << 12

These correspond to the addresses of -4096 and -8192. Hopefully, such a
key is never inserted into a DenseMap.

I encountered this while looking at making clang's SourceManager not
require FileManager.h, but it has several maps keyed on classes defined
in FileManager.h. FileManager depends on various LLVM FS headers, which
cumulatively take ~200ms to parse, and are generally not needed.

Reviewed By: hans

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