platform/upstream/llvm.git
4 years ago[MC][DWARF] Corrected handling of is_stmt flag in .loc directives
Dmitry Preobrazhensky [Mon, 20 Apr 2020 10:53:15 +0000 (13:53 +0300)]
[MC][DWARF] Corrected handling of is_stmt flag in .loc directives

According to DWARF standard, is_stmt is a global flag; when set or cleared it should affect subsequent .loc directives.

However llvm assembler handled is_stmt differently: it forced all locations to have is_stmt=1 unless is_stmt was specified explicitly as 0.

The fix utilizes current DWARF state flags to compute correct is_stmt values.

See https://bugs.llvm.org/show_bug.cgi?id=45529 for a detailed issue description.

Reviewers: arsenm, probinson, enderby

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

4 years agoX86Subtarget.cpp - sort includes. NFC
Simon Pilgrim [Mon, 20 Apr 2020 10:54:04 +0000 (11:54 +0100)]
X86Subtarget.cpp - sort includes. NFC
Ensure X86Subtarget.h module header is at the top, and sort the remaining includes.

4 years agoX86MCTargetDesc.h - remove unnecessary MCStreamer.h include. NFC.
Simon Pilgrim [Mon, 20 Apr 2020 10:39:21 +0000 (11:39 +0100)]
X86MCTargetDesc.h - remove unnecessary MCStreamer.h include. NFC.
We don't need all of MCStreamer.h, just FormattedStream.h. The rest can be replaced with forward declarations.
X86WinAllocaExpander.cpp had an implicit dependency on MapVector.h which I've added locally.

4 years agoX86MCAsmInfo.h - remove unnecessary MCAsmInfo.h include. NFC.
Simon Pilgrim [Mon, 20 Apr 2020 10:22:26 +0000 (11:22 +0100)]
X86MCAsmInfo.h - remove unnecessary MCAsmInfo.h include. NFC.
We only use the COFF/Darwin/ELF classes directly.

4 years agoX86InstrFoldTables.h - remove unnecessary include. NFC.
Simon Pilgrim [Mon, 20 Apr 2020 10:20:22 +0000 (11:20 +0100)]
X86InstrFoldTables.h - remove unnecessary include. NFC.
We don't need the limits defines, just the sized integer types so use cstdint system header directly.

4 years ago[AArch64][SVE] Remove LD1/ST1 dependency on llvm.masked.load/store
Kerry McLaughlin [Mon, 20 Apr 2020 10:07:48 +0000 (11:07 +0100)]
[AArch64][SVE] Remove LD1/ST1 dependency on llvm.masked.load/store

Summary:
The SVE masked load and store intrinsics introduced in D76688 rely on
common llvm.masked.load/store nodes. This patch creates new ISD nodes
for LD1(S) & ST1 to remove this dependency.

Additionally, this adds support for sign & zero extending
loads and truncating stores.

Reviewers: sdesmalen, efriedma, cameron.mcinally, c-rhodes, rengolin

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, danielkiss, andwar, cfe-commits, llvm-commits

Tags: #llvm

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

4 years ago[analyzer] Do not report CFError null dereference for nonnull params.
Valeriy Savchenko [Mon, 20 Apr 2020 08:08:57 +0000 (11:08 +0300)]
[analyzer] Do not report CFError null dereference for nonnull params.

We want to trust user type annotations and stop assuming pointers declared
as nonnull still can be null. This functionality is implemented as part
of NonNullParamChecker because it already checks parameter attributes.
Whenever we start analyzing a new function, we assume that all parameters
with 'nonnull' attribute are indeed non-null.

Patch by Valeriy Savchenko!

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

4 years ago[analyzer] Do not report NSError null dereference for _Nonnull params.
Valeriy Savchenko [Wed, 8 Apr 2020 15:58:40 +0000 (18:58 +0300)]
[analyzer] Do not report NSError null dereference for _Nonnull params.

We want to trust user type annotations and stop assuming pointers declared
as _Nonnull still can be null. This functionality is implemented as part
of NullabilityChecker as it already tracks non-null types.

Patch by Valeriy Savchenko!

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

4 years ago[VPlan] Clean up tryToCreate(Widen)Recipe. (NFC)
Florian Hahn [Mon, 20 Apr 2020 08:42:02 +0000 (09:42 +0100)]
[VPlan] Clean up tryToCreate(Widen)Recipe. (NFC)

This patch includes some clean-ups to tryToCreateRecipe, suggested in
D77973.

It includes:
  * Renaming tryToCreateRecipe to tryToCreateWidenRecipe.
  * Move VPBB insertion logic to caller of tryToCreateWidenRecipe.
  * Hoists instruction checks to tryToCreateWidenRecipe, making it
    clearer which instructions are handled by which recipe, simplifying
    the checks by using early exits.
  * Split up handling of induction PHIs and truncates using inductions.

Reviewers: gilr, rengolin, Ayal, hsaito

Reviewed By: Ayal

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

4 years ago[ARM][MVE] Add patterns for VRHADD
Sam Parker [Wed, 15 Apr 2020 10:10:09 +0000 (11:10 +0100)]
[ARM][MVE] Add patterns for VRHADD

Add patterns which use standard add nodes along with arm vshr imm
nodes.

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

4 years ago[ARM][MC][Thumb] Revert relocation for some pc-relative fixups.
Mark Murray [Thu, 16 Apr 2020 14:17:34 +0000 (15:17 +0100)]
[ARM][MC][Thumb] Revert relocation for some pc-relative fixups.

Summary:
This commit reverts https://reviews.llvm.org/D75039. Concensus appears to
be in favour of assembly-time resolution of these ADR and LDR relocations,
in line with GNU.

Reviewers: psmith

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

Tags: #llvm

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

4 years ago[PredicateInfo] Use new Instruction::comesBefore instead of OI (NFC).
Florian Hahn [Mon, 20 Apr 2020 08:11:32 +0000 (09:11 +0100)]
[PredicateInfo] Use new Instruction::comesBefore instead of OI (NFC).

The recently added Instruction::comesBefore can be used instead of
OrderedInstructions.

Reviewers: rnk, nikic, efriedma

Reviewed By: nikic

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

4 years ago[MLIR] Add #include "llvm/ADT/SmallPtrSet.h" back to LoopUtils.h.
Alexander Belyaev [Mon, 20 Apr 2020 08:16:52 +0000 (10:16 +0200)]
[MLIR] Add #include "llvm/ADT/SmallPtrSet.h" back to LoopUtils.h.

4 years ago[NFC][TTI] Explicit use of VectorType
Sam Parker [Fri, 17 Apr 2020 12:29:31 +0000 (13:29 +0100)]
[NFC][TTI] Explicit use of VectorType

The API for shuffles and reductions uses generic Type parameters,
instead of VectorType, and so assertions and casts are used a lot.
This patch makes those types explicit, which means that the clients
can't be lazy, but results in less ambiguity, and that can only be a
good thing.

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

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

4 years ago[CodeGen] Support freeze expand for ppc_fp128
Kang Zhang [Mon, 20 Apr 2020 07:27:41 +0000 (07:27 +0000)]
[CodeGen] Support freeze expand for ppc_fp128

Summary:
The patch D29014 has added the new ISD::FREEZE and can deal with the
integer.
The patch D76980 has added SoftenFloatRes_FREEZE for float point.
But we still lack of expand for ppc_fp128, this will cause assertion for
some cases.
This patch is to support freeze expand for ppc_fp128.

Reviewed By: efriedma

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

4 years ago[MLIR] Move `replaceAllUsesExcept` from LoopUtil.h to Value.h.
Alexander Belyaev [Mon, 20 Apr 2020 07:17:45 +0000 (09:17 +0200)]
[MLIR] Move `replaceAllUsesExcept` from LoopUtil.h to Value.h.

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

4 years ago[CallSite removal][SCCP] Use CallBase instead of CallSite. NFC
Craig Topper [Mon, 20 Apr 2020 07:05:18 +0000 (00:05 -0700)]
[CallSite removal][SCCP] Use CallBase instead of CallSite. NFC

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

4 years ago[clangd][test] Make sed git bash compliant
Kadir Cetinkaya [Mon, 20 Apr 2020 06:27:15 +0000 (08:27 +0200)]
[clangd][test] Make sed git bash compliant

4 years ago[CallSite removal][Analysis] Use CallBase instead of CallSite in SparsePropagation...
Craig Topper [Mon, 20 Apr 2020 05:39:24 +0000 (22:39 -0700)]
[CallSite removal][Analysis] Use CallBase instead of CallSite in SparsePropagation unit test. NFC

4 years ago[CallSite removal][CalledValuePropagation] Use CallBase instead of CallSite. NFC
Craig Topper [Mon, 20 Apr 2020 04:54:38 +0000 (21:54 -0700)]
[CallSite removal][CalledValuePropagation] Use CallBase instead of CallSite. NFC

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

4 years agollvm-dwarfdump: Fix UB (unsequenced writes) introduced in e0fd87cc64d5
David Blaikie [Mon, 20 Apr 2020 04:32:33 +0000 (21:32 -0700)]
llvm-dwarfdump: Fix UB (unsequenced writes) introduced in e0fd87cc64d5

Unsequenced write due to "x &= f()" where 'f()' modifies 'x'.

Detected by the llvm-clang-x86_64-expensive-checks-win buildbot.
Investigated/identified by Galina - thanks!

4 years ago[Test] Fix test failure: platform-dependent printout
Max Kazantsev [Mon, 20 Apr 2020 03:26:15 +0000 (10:26 +0700)]
[Test] Fix test failure: platform-dependent printout

4 years agoHandle CET for -exception-model sjlj
Xiang1 Zhang [Mon, 20 Apr 2020 02:17:34 +0000 (10:17 +0800)]
Handle CET for -exception-model sjlj

Summary:
In SjLj exception mode, the old landingpad BB will create a new landingpad BB and use indirect branch jump to the old landingpad BB in lowering.
So we should add 2 endbr for this exception model.

Reviewers: hjl.tools, craig.topper, annita.zhang, LuoYuanke, pengfei, efriedma

Reviewed By: LuoYuanke

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[Object] Use BFD name for little-endian PowerPC64
Bill Wendling [Mon, 20 Apr 2020 03:08:30 +0000 (20:08 -0700)]
[Object] Use BFD name for little-endian PowerPC64

Summary:
Little-endian PowerPC object files should report "elf64-powerpcle" instead of
"elf64-powerpc".

Reviewers: jhenderson, MaskRay, espindola, alexshap, rupprecht, #powerpc

Reviewed By: MaskRay

Subscribers: wuzish, emaste, nemanjai, shchenz, steven.zhang, llvm-commits

Tags: #llvm, #powerpc

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

4 years ago[Test] Add a test showing how CFG analyses are invalidated after LV
Max Kazantsev [Mon, 20 Apr 2020 02:37:30 +0000 (09:37 +0700)]
[Test] Add a test showing how CFG analyses are invalidated after LV

It demonstrates that, even if LV does no actual vectorization and only
forms LCSSA, CFG analyses get dropped.

4 years ago[X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part III)
Shengchen Kan [Sat, 18 Apr 2020 08:52:50 +0000 (16:52 +0800)]
[X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part III)

Summary:
When we encode an instruction, we need to know the number of bytes being
emitted to determine the fixups in `X86MCCodeEmitter::emitImmediate`.
There are only two callers for `emitImmediate`: `emitMemModRMByte` and
`encodeInstruction`.

Before this patch, we kept track of the current byte being emitted
by passing a reference parameter `CurByte` across all the `emit*`
funtions, which is ugly and unnecessary. For example, we don't have any
fixups when emitting prefixes, so we don't need to track this value.

In this patch, we use `StartByte` to record the initial status of the
streamer, and use `OS.tell()` to get the current status of the streamer
when we need to know the number of bytes being emitted. On one hand,
this eliminates the parameter `CurByte` for most `emit*` functions, on
the other hand, this make things clear: Only pass the parameter when we
really need it.

Reviewers: craig.topper, pengfei, MaskRay

Reviewed By: craig.topper, MaskRay

Subscribers: hiraditya, llvm-commits, annita.zhang

Tags: #llvm

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

4 years ago[CallSite removal][WebAssembly] Replace CallSite with CallBase in WebAssemblyOptimize...
Craig Topper [Mon, 20 Apr 2020 01:32:20 +0000 (18:32 -0700)]
[CallSite removal][WebAssembly] Replace CallSite with CallBase in WebAssemblyOptimizeReturned.

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

4 years ago[CallSite removal][Analysis] Replace CallSite with CallBase in MemoryBuiltins. NFC
Craig Topper [Mon, 20 Apr 2020 01:32:03 +0000 (18:32 -0700)]
[CallSite removal][Analysis] Replace CallSite with CallBase in MemoryBuiltins. NFC

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

4 years ago[CallSite removal][Lint] Replace visitCallSite with visitCallBase. NFC
Craig Topper [Mon, 20 Apr 2020 01:31:42 +0000 (18:31 -0700)]
[CallSite removal][Lint] Replace visitCallSite with visitCallBase. NFC

Drop visitCallInst/visitInvokeInst since the generic implementation
will delegate to visitCallBase. They appear to be from a time
before visitCallSite existed in the InstVisitor system.

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

4 years ago[X86] Add X86ISD nodes for PDEP and PEXT.
Craig Topper [Sun, 19 Apr 2020 23:13:22 +0000 (16:13 -0700)]
[X86] Add X86ISD nodes for PDEP and PEXT.

This will allow use to add DAG combines for these instructions.

4 years ago[CallSite removal][AMDGPU] Use CallBase instead of CallSite in AMDGPUFixFunctionBitca...
Craig Topper [Sun, 19 Apr 2020 07:41:43 +0000 (00:41 -0700)]
[CallSite removal][AMDGPU] Use CallBase instead of CallSite in AMDGPUFixFunctionBitcasts. NFC

4 years agoX86CallLowering.h - remove unnecessary ArrayRef.h include. NFC.
Simon Pilgrim [Sun, 19 Apr 2020 20:24:25 +0000 (21:24 +0100)]
X86CallLowering.h - remove unnecessary ArrayRef.h include. NFC.

4 years agoSectionMemoryManager.h - remove unnecessary StringRef.h include. NFC.
Simon Pilgrim [Sat, 18 Apr 2020 17:52:07 +0000 (18:52 +0100)]
SectionMemoryManager.h - remove unnecessary StringRef.h include. NFC.

4 years ago[LVI] Use Optional instead of out parameter (NFC)
Nikita Popov [Thu, 9 Apr 2020 19:13:03 +0000 (21:13 +0200)]
[LVI] Use Optional instead of out parameter (NFC)

As suggested on D76788, this switches the LVI implementation to
return Optional<ValueLatticeElement> from various methods, instead
of passing in a ValueLatticeElement reference and returning a boolean.

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

4 years ago[TTI] Clean up includes (NFC).
Florian Hahn [Sun, 19 Apr 2020 19:02:45 +0000 (20:02 +0100)]
[TTI] Clean up includes (NFC).

Remove some unnecessary includes, replace some with forward
declarations.

This also exposed a few places that were missing some includes.

4 years ago[IVDescriptors] Clean up includes.
Florian Hahn [Sun, 19 Apr 2020 18:39:55 +0000 (19:39 +0100)]
[IVDescriptors] Clean up includes.

Some includes are not required and forward declarations can be used
instead. This also exposed a few places that were not directly including
required files.

4 years ago[LoopUtils] Clean up includes, use forward decls if appropriate (NFC).
Florian Hahn [Sun, 19 Apr 2020 17:17:20 +0000 (18:17 +0100)]
[LoopUtils] Clean up includes, use forward decls if appropriate (NFC).

Most of the includes in LoopUtils.h are not required in the header and
they can be replaced by forward declarations.

Unfortunately includes of TargetTransformInfo.h and IVDescriptors.h pull
in a bunch of additional things, but there is no easy way to get rid of
them at the moment I think.

4 years agoFix one more link for a Rationale doc moved under Rationale/
Mehdi Amini [Sun, 19 Apr 2020 17:03:01 +0000 (17:03 +0000)]
Fix one more link for a Rationale doc moved under Rationale/

4 years agoDependenceGraphBuilder.h - remove unused includes. NFC.
Simon Pilgrim [Sun, 19 Apr 2020 16:52:35 +0000 (17:52 +0100)]
DependenceGraphBuilder.h - remove unused includes. NFC.
Replace with forward declarations.

4 years agoFix documentation link to MlirSpirvAbi
Mehdi Amini [Fri, 17 Apr 2020 19:23:57 +0000 (19:23 +0000)]
Fix documentation link to MlirSpirvAbi

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

4 years agoFix one more doc links after moving the document under Tutorials
Mehdi Amini [Sun, 19 Apr 2020 16:52:05 +0000 (16:52 +0000)]
Fix one more doc links after moving the document under Tutorials

4 years agoFix more broken doc links after some moved under the Rationale category
Mehdi Amini [Sun, 19 Apr 2020 16:49:30 +0000 (16:49 +0000)]
Fix more broken doc links after some moved under the Rationale category

4 years agoX86MachineFunctionInfo.h - remove unused include. NFC.
Simon Pilgrim [Sun, 19 Apr 2020 15:52:26 +0000 (16:52 +0100)]
X86MachineFunctionInfo.h - remove unused include. NFC.

4 years agoX86InstrInfo.h - remove unused forward declarations. NFC.
Simon Pilgrim [Sun, 19 Apr 2020 13:44:19 +0000 (14:44 +0100)]
X86InstrInfo.h - remove unused forward declarations. NFC.

4 years agoX86DisassemblerDecoder.h - remove unused forward declaration. NFC.
Simon Pilgrim [Sun, 19 Apr 2020 13:41:25 +0000 (14:41 +0100)]
X86DisassemblerDecoder.h - remove unused forward declaration. NFC.

4 years ago[CMake] Delete HAVE_SCHED_GETAFFINITY and HAVE_CPU_COUNT
Fangrui Song [Sun, 19 Apr 2020 15:46:47 +0000 (08:46 -0700)]
[CMake] Delete HAVE_SCHED_GETAFFINITY and HAVE_CPU_COUNT

sched_getaffinity (Linux specific) has been available

* in glibc since 2002-08-08 (commit 972e719e8154eec5f543b027e2a08dfa285d55d5)
* in musl since the initial check-in.

4 years ago[InstSimplify] add tests for logic+icmp folds for nullptr; NFC
Sanjay Patel [Sun, 19 Apr 2020 14:42:08 +0000 (10:42 -0400)]
[InstSimplify] add tests for logic+icmp folds for nullptr; NFC

See discussion in D78430.

4 years ago[x86] avoid build warning for enum mismatch; NFC
Sanjay Patel [Sun, 19 Apr 2020 14:19:37 +0000 (10:19 -0400)]
[x86] avoid build warning for enum mismatch; NFC

gcc may warn here because X86ISD::NodeType is specified as "unsigned",
but ISD::NodeType is a naked C enum (although passed as an "unsigned"
throughout SDAG).

4 years ago[LAA] Remove unnecessary includes (NFC).
Florian Hahn [Sun, 19 Apr 2020 14:11:25 +0000 (15:11 +0100)]
[LAA] Remove unnecessary includes (NFC).

4 years agoX86MCTargetDesc.h - remove unnecessary includes and forward declarations. NFC.
Simon Pilgrim [Sun, 19 Apr 2020 13:29:35 +0000 (14:29 +0100)]
X86MCTargetDesc.h - remove unnecessary includes and forward declarations. NFC.

4 years agoX86.h - remove unused forward declarations. NFC.
Simon Pilgrim [Sun, 19 Apr 2020 13:28:52 +0000 (14:28 +0100)]
X86.h - remove unused forward declarations. NFC.

4 years agoX86SelectionDAGInfo.h - remove unnecessary includes and forward declarations. NFC.
Simon Pilgrim [Sun, 19 Apr 2020 13:20:53 +0000 (14:20 +0100)]
X86SelectionDAGInfo.h - remove unnecessary includes and forward declarations. NFC.

4 years agoX86TargetTransformInfo.h - remove unnecessary includes. NFC.
Simon Pilgrim [Sun, 19 Apr 2020 13:03:29 +0000 (14:03 +0100)]
X86TargetTransformInfo.h - remove unnecessary includes. NFC.

4 years ago[ARM] Regenerate tests. NFC
David Green [Sun, 19 Apr 2020 12:21:01 +0000 (13:21 +0100)]
[ARM] Regenerate tests. NFC

4 years ago[X86][SSE] getFauxShuffle - don't combine shuffles with small truncated scalars ...
Simon Pilgrim [Sun, 19 Apr 2020 12:34:58 +0000 (13:34 +0100)]
[X86][SSE] getFauxShuffle - don't combine shuffles with small truncated scalars (PR45604)

getFauxShuffle attempts to combine INSERT_VECTOR_ELT(TRUNCATE/EXTEND(EXTRACT_VECTOR_ELT(x))) patterns into a target shuffle chain.

PR45604 identified an issue where the scalar was truncated to a size smaller than the destination vector element and then zero extended back, which requires the upper bits to be zero'd which we don't currently do.

To avoid the bug I've added an early out in these truncation cases, a future commit should allow us to handle this by inserting the necessary SM_SentinelZero padding.

4 years ago[clangd] Add index export to dexp
Sam McCall [Sun, 19 Apr 2020 12:33:00 +0000 (14:33 +0200)]
[clangd] Add index export to dexp

Summary: Add a command to dexp that exports index data in chosen format (e.g. YAML).

Reviewers: sammccall

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

Tags: #clang-tools-extra, #clang

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

4 years ago[x86] use vector instructions to lower more FP->int->FP casts
Sanjay Patel [Sun, 19 Apr 2020 12:32:02 +0000 (08:32 -0400)]
[x86] use vector instructions to lower more FP->int->FP casts

This is an enhancement to D77895 to avoid another
round-trip from XMM->GPR->XMM. This time we handle
the case of starting/ending with an f64 and casting
to signed i32 as the intermediate value.

It's a bit more involved than I initially assumed
because we need to use target-specific opcodes to
represent the non-standard cast ops.

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

4 years ago[clangd] Extend YAML Serialization
Sam McCall [Sun, 19 Apr 2020 12:22:23 +0000 (14:22 +0200)]
[clangd] Extend YAML Serialization

Reviewers: sammccall

Reviewed By: sammccall

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

Tags: #clang-tools-extra, #clang

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

4 years ago[VectorCombine] transform bitcasted shuffle to wider elements
Sanjay Patel [Sun, 19 Apr 2020 12:06:17 +0000 (08:06 -0400)]
[VectorCombine] transform bitcasted shuffle to wider elements

bitcast (shuf V, MaskC) --> shuf (bitcast V), MaskC'

This is the widen shuffle elements enhancement to D76727.
It builds on the analysis and simplifications in
D77881 and rG6a7e958a423e.

The phase ordering tests show that we can simplify inverse
shuffles across a binop in both directions (widen/narrow or
narrow/widen) now.

There's another potential transform visible in some of the
remaining TODOs - move a bitcasted operand of a shuffle
after the shuffle.

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

4 years ago[InstSimplify] add tests for logic-of-icmp with min/max constant; NFC
Sanjay Patel [Fri, 17 Apr 2020 18:05:04 +0000 (14:05 -0400)]
[InstSimplify] add tests for logic-of-icmp with min/max constant; NFC

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

We had partial coverage for some of these patterns, so removing duplicate tests
with the complete set in the new test file.

4 years ago[X86][SSE] Add test case for PR45604
Simon Pilgrim [Sun, 19 Apr 2020 12:13:54 +0000 (13:13 +0100)]
[X86][SSE] Add test case for PR45604

4 years agoSelectionDAGBuilder.h - remove unused includes + forward declarations. NFC.
Simon Pilgrim [Sun, 19 Apr 2020 11:38:41 +0000 (12:38 +0100)]
SelectionDAGBuilder.h - remove unused includes + forward declarations. NFC.
Replace SelectionDAG.h include with SelectionDAG forward declaration.

4 years agoX86InstrFMA3Info.h - remove unnecessary includes. NFC.
Simon Pilgrim [Sun, 19 Apr 2020 11:17:56 +0000 (12:17 +0100)]
X86InstrFMA3Info.h - remove unnecessary includes. NFC.
There were a number of cpp files explicitly relying on X86InstrFMA3Info.h to include the X86.h header - so I've had to add it locally.

4 years agoInstrEmitter.h - reduce SelectionDAG.h include to SelectionDAGNodes.h include.
Simon Pilgrim [Sun, 19 Apr 2020 10:52:31 +0000 (11:52 +0100)]
InstrEmitter.h - reduce SelectionDAG.h include to SelectionDAGNodes.h include.
Add SDDbgLabel/TargetLowering forward declarations.
Add the full SelectionDAG.h include to InstrEmitter.cpp.

4 years agoX86AsmPrinter.h - cleanup includes and forward declarations. NFC.
Simon Pilgrim [Sun, 19 Apr 2020 10:38:50 +0000 (11:38 +0100)]
X86AsmPrinter.h - cleanup includes and forward declarations. NFC.
Reduce X86Subtarget.h/MCCodeEmitter.h/TargetMachine.h includes to forward declarations
Add explicit X86Subtarget.h/TargetMachine.h includes to X86AsmPrinter.cpp/X86MCInstLower.cpp
Remove unused MCSymbol forward declaration

4 years agoDebugHandlerBase.h - reduce MachineInstr.h include to DebugLoc.h include.
Simon Pilgrim [Sun, 19 Apr 2020 10:13:26 +0000 (11:13 +0100)]
DebugHandlerBase.h - reduce MachineInstr.h include to DebugLoc.h include.

We were only including MachineInstr.h for DebugLoc.h. This exposes an implicit include dependency in BTFDebug.h where I've had to add the MachineInstr.h include.

4 years agoBuildLibCalls.h - remove unnecessary TargetLibraryInfo forward declaration. NFC
Simon Pilgrim [Sun, 19 Apr 2020 10:00:30 +0000 (11:00 +0100)]
BuildLibCalls.h - remove unnecessary TargetLibraryInfo forward declaration. NFC

We already have to include the TargetLibraryInfo.h header.

4 years agoTypeBasedAliasAnalysis.h - replace InstrTypes.h include with forward declaration...
Simon Pilgrim [Sun, 19 Apr 2020 09:55:23 +0000 (10:55 +0100)]
TypeBasedAliasAnalysis.h - replace InstrTypes.h include with forward declaration. NFC.

4 years agoRemove remaining callers of CreateShuffleVector with unsigned indices and mark it...
Benjamin Kramer [Sun, 19 Apr 2020 09:48:28 +0000 (11:48 +0200)]
Remove remaining callers of CreateShuffleVector with unsigned indices and mark it as deprecated

No functionality change intended.

4 years agoOMPConstants.h - replace StringRef.h include with forward declaration. NFC.
Simon Pilgrim [Sun, 19 Apr 2020 09:29:38 +0000 (10:29 +0100)]
OMPConstants.h - replace StringRef.h include with forward declaration. NFC.

4 years ago[ValueLattice] Add struct for merge options.
Florian Hahn [Sun, 19 Apr 2020 07:56:08 +0000 (08:56 +0100)]
[ValueLattice] Add struct for merge options.

This makes it easier to extend the merge options in the future and also
reduces the risk of accidentally setting a wrong option.

Reviewers: efriedma, nikic, reames, davide

Reviewed By: efriedma

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

4 years ago[MLIR] NFC Fix/clarify line in const usage rationale doc
Uday Bondhugula [Sun, 19 Apr 2020 05:40:31 +0000 (11:10 +0530)]
[MLIR] NFC Fix/clarify line in const usage rationale doc

Update misleading line in conclusions. Although the application to IR
objects is stated earlier, the concluding section contradicts it in
isolation.

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

4 years ago[MLIR] Mark dominance methods const
Uday Bondhugula [Sun, 19 Apr 2020 05:21:58 +0000 (10:51 +0530)]
[MLIR] Mark dominance methods const

This change is in line with MLIR's coding style
https://mlir.llvm.org/getting_started/DeveloperGuide/
and also consistent with the dominance methods in LLVM.

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

4 years ago[CallSite removal][PtrUseVisitor] Use visitCallBase instead of visitCallSite. NFC
Craig Topper [Sun, 19 Apr 2020 06:14:59 +0000 (23:14 -0700)]
[CallSite removal][PtrUseVisitor] Use visitCallBase instead of visitCallSite. NFC

4 years ago[SyntheticCountsPropagation] Remove unnecessary includes and add a LLVM license heade...
Craig Topper [Sun, 19 Apr 2020 05:24:55 +0000 (22:24 -0700)]
[SyntheticCountsPropagation] Remove unnecessary includes and add a LLVM license header. NFC

Noticed while looking for CallSite.h uses to remove.

4 years agoFix broken website link: Use absolute URL to point back to the source on GitHub
Mehdi Amini [Sun, 19 Apr 2020 04:54:31 +0000 (04:54 +0000)]
Fix broken website link: Use absolute URL to point back to the source on GitHub

4 years agoFix broken doc links to DefiningAttributesAndTypes.md after move to Tutorials/
Mehdi Amini [Sun, 19 Apr 2020 04:52:37 +0000 (04:52 +0000)]
Fix broken doc links to DefiningAttributesAndTypes.md after move to Tutorials/

4 years agoFix broken doc links to QuickstartRewrites.md after move under Tutorials
Mehdi Amini [Sun, 19 Apr 2020 04:51:03 +0000 (04:51 +0000)]
Fix broken doc links to QuickstartRewrites.md after move under Tutorials

4 years agoFix relative links in Rationale docs following move to subfolder
Mehdi Amini [Sun, 19 Apr 2020 04:47:15 +0000 (04:47 +0000)]
Fix relative links in Rationale docs following move to subfolder

4 years agoFix broken docs links by using relative paths in the Linalg Rationale
Mehdi Amini [Sun, 19 Apr 2020 04:44:49 +0000 (04:44 +0000)]
Fix broken docs links by using relative paths in the Linalg Rationale

4 years agoFix broken doc links (Rationale.md -> Rationale/Rationale.md)
Mehdi Amini [Sun, 19 Apr 2020 04:42:08 +0000 (04:42 +0000)]
Fix broken doc links (Rationale.md -> Rationale/Rationale.md)

4 years agoFix broken docs links (WritingAPass.md was renamed PassManagement.md)
Mehdi Amini [Sun, 19 Apr 2020 04:37:26 +0000 (04:37 +0000)]
Fix broken docs links (WritingAPass.md was renamed PassManagement.md)

4 years ago[Dominators] Facilitate updates to MachinePostDominatorTree
Carl Ritson [Sun, 19 Apr 2020 01:02:58 +0000 (10:02 +0900)]
[Dominators] Facilitate updates to MachinePostDominatorTree

Summary:
Add getBase accessor so that underlying tree can be
manipulated in a similar manner to MachineDominatorTree.

Reviewers: kuhar, arsenm, hliao, nhaehnle

Reviewed By: kuhar

Subscribers: lkail, mgorny, hiraditya, wdng, llvm-commits

Tags: #llvm

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

4 years ago[llvm][NFC] Dereferencing before cast-ing in ProfileSummaryInfoTest
Mircea Trofin [Sun, 19 Apr 2020 00:47:37 +0000 (17:47 -0700)]
[llvm][NFC] Dereferencing before cast-ing in ProfileSummaryInfoTest

Incorporated feedback from https://reviews.llvm.org/D78414

4 years ago[PowerPC] Don't use rldicl for PPC32
LemonBoy [Sat, 18 Apr 2020 19:55:18 +0000 (12:55 -0700)]
[PowerPC] Don't use rldicl for PPC32

According to https://www.ibm.com/support/knowledgecenter/ssw_aix_72/assembler/idalangref_rldicl_rletdw_instrs.html rldicl should not be used when targeting 32bit CPUs.

Reviewed By: #powerpc, nemanjai, MaskRay

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

4 years agoadd more temporary logging for a bot-only failure
Nico Weber [Sun, 19 Apr 2020 00:22:52 +0000 (20:22 -0400)]
add more temporary logging for a bot-only failure

4 years ago[ORC] Add example showing how to initialize/deinitialize a JITDylib with LLJIT.
Lang Hames [Sat, 18 Apr 2020 20:56:13 +0000 (13:56 -0700)]
[ORC] Add example showing how to initialize/deinitialize a JITDylib with LLJIT.

4 years ago[ORC] Add a convenience method to create a JITEvaluatedSymbol from a pointer.
Lang Hames [Sat, 18 Apr 2020 20:54:05 +0000 (13:54 -0700)]
[ORC] Add a convenience method to create a JITEvaluatedSymbol from a pointer.

This can be used to reduce boilerplate code, especially when defining absolute
symbols.

4 years ago[ORC] Replace LLJIT::defineAbsolute with an LLJIT::define convenience method.
Lang Hames [Sat, 18 Apr 2020 04:19:11 +0000 (21:19 -0700)]
[ORC] Replace LLJIT::defineAbsolute with an LLJIT::define convenience method.

LLJIT::defineAbsolute did not mangle its Name argument, which is inconsistent
with the behavior of other LLJIT methods (e.g. lookup). Since it is currently
unused anyway, this commit replaces it with a generic 'define' convenience
method for adding MaterializationUnits to the main JITDylib. This simplifies
use of the generic absoluteSymbols function (as well as the symbolAlias,
reexports and other functions that generate MaterializationUnits) with LLJIT.

4 years ago[LV] Mark first-order recurrences as allowed exits
Ayal Zaks [Wed, 15 Apr 2020 14:04:01 +0000 (17:04 +0300)]
[LV] Mark first-order recurrences as allowed exits

First-order recurrences require special treatment when they are live-out;
such treatment is provided by fixFirstOrderRecurrence(), so they should be
included in AllowedExit set.

(Should probably have been included originally in D16197.)

Fixes PR45526: AllowedExit set is used by prepareToFoldTailByMasking() to
check whether the treatment for live-outs also holds when folding the tail,
which is not (yet) the case for first-order recurrences.

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

4 years agoRecommit "[Local] Simplify the alignment limits in getOrEnforceKnownAlignment. NFCI"
Craig Topper [Sat, 18 Apr 2020 20:28:25 +0000 (13:28 -0700)]
Recommit "[Local] Simplify the alignment limits in getOrEnforceKnownAlignment. NFCI"

With a tweak to avoid a linker error for passing
MaxAlignmentExponent by reference to std::min.

4 years agoUnrollLoop.h - replace StringRef.h/ValueMapper.h includes with forward declarations...
Simon Pilgrim [Fri, 17 Apr 2020 11:40:45 +0000 (12:40 +0100)]
UnrollLoop.h - replace StringRef.h/ValueMapper.h includes with forward declarations. NFC.

4 years ago[ValueLattice] Remove unnecessary ConstVal nulling (NFC)
Nikita Popov [Sat, 18 Apr 2020 20:36:38 +0000 (22:36 +0200)]
[ValueLattice] Remove unnecessary ConstVal nulling (NFC)

ConstVal is not an owned pointer, so setting it to nullptr is not
actually doing anything. If we switch to a state that does not use
ConstVal, the value does not matter.

Split out from D78425.

4 years ago[PredicateInfo] Factor out PredicateInfoBuilder (NFC)
Nikita Popov [Thu, 16 Apr 2020 20:22:14 +0000 (22:22 +0200)]
[PredicateInfo] Factor out PredicateInfoBuilder (NFC)

When running IPSCCP on a module with many small functions, memory
usage is dominated by PredicateInfo, which is a huge structure
(partially due to some unfortunate nested SmallVector use). However,
most of it is actually only temporary state needed to build
predicate info, and does not need to be retained after initial
construction.

This patch factors out the predicate building logic and state
into a separate PrediceInfoBuilder, with the extra bonus that
it does not need to live in the header anymore.

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

4 years agoRevert "[Local] Simplify the alignment limits in getOrEnforceKnownAlignment. NFCI"
Craig Topper [Sat, 18 Apr 2020 20:23:29 +0000 (13:23 -0700)]
Revert "[Local] Simplify the alignment limits in getOrEnforceKnownAlignment. NFCI"

This reverts commit e00cfe254d99629ec344031adfe1878a84f3b0b3.

Seems to be causing a linker error on the build bots.

4 years ago[scudo] Silent warning for u64 -> u32 convertion
kpdev [Fri, 17 Apr 2020 06:26:29 +0000 (09:26 +0300)]
[scudo] Silent warning for u64 -> u32 convertion

Error is raised because of using -Werror=convertion

4 years ago[Local] Simplify the alignment limits in getOrEnforceKnownAlignment. NFCI
Craig Topper [Sat, 18 Apr 2020 18:57:50 +0000 (11:57 -0700)]
[Local] Simplify the alignment limits in getOrEnforceKnownAlignment. NFCI

We previously clamped the trailing zero count to 31 bits. And
then clamped the final alignment to MaximumAlignment which is
1 << 29.

This patch simplifies this to just clamp the trailing zero to
29 using MaxAlignmentExponent.

I was looking into changing this function to use Align/MaybeAlign
and noticed this.

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

4 years ago[DebugInfo] Change DIEnumerator payload type from int64_t to APInt
LemonBoy [Sat, 18 Apr 2020 18:31:38 +0000 (11:31 -0700)]
[DebugInfo] Change DIEnumerator payload type from int64_t to APInt

This allows the representation of arbitrarily large enumeration values.
See https://lists.llvm.org/pipermail/llvm-dev/2017-December/119475.html for context.

Reviewed By: andrewrk, aprantl, MaskRay

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

4 years ago[MLIR] NFC affine for op tiling cleanup / utility rename
Uday Bondhugula [Sat, 18 Apr 2020 10:51:07 +0000 (16:21 +0530)]
[MLIR] NFC affine for op tiling cleanup / utility rename

Rename mlir::tileCodeGen -> mlir::tilePerfectlyNested to be consistent.
NFC clean up tiling utility code, drop dead code, better comments.
Expose isPerfectlyNested and reuse.

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

4 years ago[llvm][NFC][CallSite] Remove CallSite from ProfileSummary
Mircea Trofin [Sat, 18 Apr 2020 02:35:05 +0000 (19:35 -0700)]
[llvm][NFC][CallSite] Remove CallSite from ProfileSummary

Summary: Depends on D78395.

Reviewers: craig.topper, dblaikie, wmi, davidxl

Subscribers: eraman, hiraditya, haicheng, llvm-commits

Tags: #llvm

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