platform/upstream/llvm.git
4 years ago[clang-format] use spaces for alignment with UT_ForContinuationAndIndentation
mydeveloperday [Mon, 13 Apr 2020 14:14:26 +0000 (15:14 +0100)]
[clang-format] use spaces for alignment with UT_ForContinuationAndIndentation

Summary:
Use spaces instead of tabs for alignment with UT_ForContinuationAndIndentation to make the code aligned for any tab/indent width.

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

Reviewed By: MyDeveloperDay

Patch By: fickert

Tags: #clang-format

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

4 years ago[clang-format] A Minor change to clang-format-diff.py
mydeveloperday [Mon, 13 Apr 2020 14:08:07 +0000 (15:08 +0100)]
[clang-format] A Minor change to clang-format-diff.py

Summary: Testing for None should use the 'is' operator.

Reviewed By: MyDeveloperDay

Patch By:  eagleoflqj

Tags: #clang-format

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

4 years ago[clang-format] Always break line after enum opening brace
mydeveloperday [Mon, 13 Apr 2020 14:03:36 +0000 (15:03 +0100)]
[clang-format] Always break line after enum opening brace

Summary:
clang-format currently puts the first enumerator on the same line as the
enum keyword and opening brace if it fits (for example, for anonymous
enums if IndentWidth is 8):

  $ echo "enum { RED, GREEN, BLUE };" | clang-format -style="{BasedOnStyle: llvm, ColumnLimit: 15, IndentWidth: 8}"
  enum { RED,
         GREEN,
         BLUE };

This doesn't seem to be intentional, as I can't find any style guide that
suggests wrapping enums this way. Always force the enumerator to be on a new
line, which gets us the desired result:

  $ echo "enum { RED, GREEN, BLUE };" | ./bin/clang-format -style="{BasedOnStyle: llvm, ColumnLimit: 15, IndentWidth: 8}"
  enum {
          RED,
          GREEN,
          BLUE
  };

Test Plan:

New test added. Confirmed test failed without change and passed with change by
running:

  $ ninja FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewed By: MyDeveloperDay

Patch By: osandov

Tags: #clang-format, #clang

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

4 years ago[X86][AVX] Attempt to scale masked shuffles to match the root type
Simon Pilgrim [Mon, 13 Apr 2020 13:57:25 +0000 (14:57 +0100)]
[X86][AVX] Attempt to scale masked shuffles to match the root type

Improve the chances of folding the writemask into the combined shuffle by scaling a wider shuffle mask to match the root's original type.

This creates a few minor issues with variable shuffles, preventing combines of shuffles because of the more limited support binary shuffle types. In most cases we're probably better off combining the shuffles and losing the writemask fold, but this isn't always going to be true.

4 years ago[X86][AVX] Add some masked variable shuffle tests
Simon Pilgrim [Mon, 13 Apr 2020 13:29:57 +0000 (14:29 +0100)]
[X86][AVX] Add some masked variable shuffle tests

Now that's D77928 landed we need to try harder to match shuffle and mask widths. This is a couple of tests showing where variable shuffle masks have been widened preventing them from folding with the mask.

4 years agoAddress sphinx warnings
Benjamin Kramer [Mon, 13 Apr 2020 12:39:25 +0000 (14:39 +0200)]
Address sphinx warnings

LanguageExtensions.rst:2191: WARNING: Title underline too short.
llvm-symbolizer.rst:157: Error in "code-block" directive: maximum 1 argument(s) allowed, 30 supplied.

4 years agoCodeMetrics.h - include and forward declaration cleanup. NFC.
Simon Pilgrim [Mon, 13 Apr 2020 12:09:08 +0000 (13:09 +0100)]
CodeMetrics.h - include and forward declaration cleanup. NFC.

Remove SmallPtrSet include, replace with forward declaration and include SmallPtrSet.h in CodeMetrics.cpp directly.
Remove unused llvm::DataLayout/Instruction forward declarations.

4 years agoIVDescriptors.h - include and forward declaration cleanup. NFC.
Simon Pilgrim [Mon, 13 Apr 2020 11:01:14 +0000 (12:01 +0100)]
IVDescriptors.h - include and forward declaration cleanup. NFC.

Replace unused AliasAnalysis.h and EHPersonalities.h includes
Remove unused llvm::AliasSet/AliasSetTracker/BasicBlock/DataLayout/LoopInfo/OptimizationRemarkEmitter/PredIteratorCache/TargetLibraryInfo/TargetTransformInfo forward declarations.

4 years ago[X86][AVX] Create splitVectorIntBinary helper.
Simon Pilgrim [Sun, 12 Apr 2020 15:15:26 +0000 (16:15 +0100)]
[X86][AVX] Create splitVectorIntBinary helper.

Removes duplicate code from split256IntArith/split512IntArith.

4 years agoTypos correction.
SCOTT-HAMILTON [Mon, 13 Apr 2020 06:39:58 +0000 (08:39 +0200)]
Typos correction.

4 years agoNormalize working directory when running llvm-mc in test
serge-sans-paille [Mon, 13 Apr 2020 11:44:15 +0000 (13:44 +0200)]
Normalize working directory when running llvm-mc in test

Otherwise, depending on the lit location used to run the test, llvm-mc adds an
include_directories entry in the dwarf output, which breaks tests in some setup.

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

4 years agofix some doc typos to cycle bots
Nico Weber [Mon, 13 Apr 2020 10:28:33 +0000 (06:28 -0400)]
fix some doc typos to cycle bots

4 years ago[clangd] Update TUStatus test to handle async PreambleThread
Kadir Cetinkaya [Tue, 7 Apr 2020 18:53:56 +0000 (20:53 +0200)]
[clangd] Update TUStatus test to handle async PreambleThread

Summary:
Currently it doesn't matter because we run PreambleThread in sync mode.
Once we start running it in async, test order will become non-deterministic.

Reviewers: sammccall

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, mgrang, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[LV] Clean up vectorizeInterleaveGroup (NFCI)
Gil Rapaport [Mon, 13 Apr 2020 05:53:42 +0000 (08:53 +0300)]
[LV] Clean up vectorizeInterleaveGroup (NFCI)

Pass from the calling recipe the interleave group itself instead of passing the
group's insertion position and having the function query CM for its interleave
group and making sure that given instruction is the insertion point of.

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

4 years ago[AssumeBundles] adapt Assumption cache to assume bundles
Tyker [Mon, 13 Apr 2020 09:27:27 +0000 (11:27 +0200)]
[AssumeBundles] adapt Assumption cache to assume bundles

Summary: change assumption cache to store an assume along with an index to the operand bundle containing the knowledge.

Reviewers: jdoerfert, hfinkel

Reviewed By: jdoerfert

Subscribers: hiraditya, mgrang, llvm-commits

Tags: #llvm

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

4 years ago[LLDB] Remove xfail aarch64/linux from TestThreadPlanCommands.py
Muhammad Omair Javaid [Mon, 13 Apr 2020 09:30:23 +0000 (14:30 +0500)]
[LLDB] Remove xfail aarch64/linux from TestThreadPlanCommands.py

4 years agoRevert "[SCCP] Use SimplifyBinOp for non-integer constant/expressions & overdef."
Benjamin Kramer [Mon, 13 Apr 2020 09:23:26 +0000 (11:23 +0200)]
Revert "[SCCP] Use SimplifyBinOp for non-integer constant/expressions & overdef."

This reverts commit 1a02aaeaa4f8675490da38ee8cb0d4a6d39815dd. Crashes on
the following test case:

$ cat crash.ll
source_filename = "__compute_module"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"

@0 = private unnamed_addr constant [24 x i8] c"\00\00\C0\7F\00\00\C0\7F\09\85\08?\ED\C94\FE~\EB/\F3\90\CF\BA\C1"
@1 = private unnamed_addr constant [24 x i8] c"\00\00\C0\7F\A3\A0\0FA\00\00\C0\7F\00\00\C0\7F\00\00\00\00\02\9AA\00"

define void @IgammaSpecialValues.448() {
entry:
  br label %fusion.26.loop_header.dim.0

fusion.26.loop_header.dim.0:                      ; preds = %fusion.26.loop_header.dim.0, %entry
  %fusion.26.invar_address.dim.0.0 = phi i64 [ 0, %entry ], [ %invar.inc17, %fusion.26.loop_header.dim.0 ]
  %0 = getelementptr inbounds [6 x float], [6 x float]* bitcast ([24 x i8]* @0 to [6 x float]*), i64 0, i64 %fusion.26.invar_address.dim.0.0
  %1 = load float, float* %0
  %2 = fmul float %1, 0.000000e+00
  %3 = getelementptr inbounds [6 x float], [6 x float]* bitcast ([24 x i8]* @1 to [6 x float]*), i64 0, i64 %fusion.26.invar_address.dim.0.0
  %4 = load float, float* %3
  %5 = fneg float %4
  %6 = fadd float %2, %5
  %invar.inc17 = add nuw nsw i64 %fusion.26.invar_address.dim.0.0, 1
  br label %fusion.26.loop_header.dim.0
}

$ opt -ipsccp -S < crash.ll
opt: llvm/include/llvm/Analysis/ValueLattice.h:251: bool llvm::ValueLatticeElement::markConstant(llvm::Constant *, bool): Assertion `getConstant() == V && "Marking constant with different value"' failed.

4 years ago[mlir][NFC] Mark a debug only variable as (void) to avoid unused warning
River Riddle [Mon, 13 Apr 2020 07:48:17 +0000 (00:48 -0700)]
[mlir][NFC] Mark a debug only variable as (void) to avoid unused warning

4 years ago[VPlan] Introduce VPWidenSelectRecipe (NFC).
Florian Hahn [Mon, 13 Apr 2020 07:28:26 +0000 (08:28 +0100)]
[VPlan] Introduce VPWidenSelectRecipe (NFC).

Widening a selects depends on whether the condition is loop invariant or
not. Rather than checking during codegen-time, the information can be
recorded at the VPlan construction time.

This was suggested as part of D76992, to reduce the reliance on
accessing the original underlying IR values.

Reviewers: gilr, rengolin, Ayal, hsaito

Reviewed By: gilr

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

4 years ago[mlir][SymbolDCE][NFC] Fix the visibility of the symbols within the test and
River Riddle [Mon, 13 Apr 2020 07:19:14 +0000 (00:19 -0700)]
[mlir][SymbolDCE][NFC] Fix the visibility of the symbols within the test and
move it to test/Transforms/

4 years ago[CallSite removal][CodeGen] Use CallBase instead of CallSite in getNoopInput in Analy...
Craig Topper [Mon, 13 Apr 2020 06:47:17 +0000 (23:47 -0700)]
[CallSite removal][CodeGen] Use CallBase instead of CallSite in getNoopInput in Analysis.cpp. NFC

4 years ago[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in TargetFrameL...
Craig Topper [Mon, 13 Apr 2020 06:43:06 +0000 (23:43 -0700)]
[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in TargetFrameLoweringInfo. NFC

4 years ago[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in IntrinsicLow...
Craig Topper [Mon, 13 Apr 2020 06:34:57 +0000 (23:34 -0700)]
[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in IntrinsicLowering. NFC

4 years ago[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in WinEHPrepare...
Craig Topper [Mon, 13 Apr 2020 06:12:41 +0000 (23:12 -0700)]
[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in WinEHPrepare. NFC

4 years ago[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in SwiftErrorVa...
Craig Topper [Mon, 13 Apr 2020 06:09:35 +0000 (23:09 -0700)]
[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in SwiftErrorValueTracking. NFC

4 years ago[MC] Reorganize and improve macro tests
Fangrui Song [Mon, 13 Apr 2020 05:02:55 +0000 (22:02 -0700)]
[MC] Reorganize and improve macro tests

* Reorganize tests and add coverage
* Improve diagnostic testing
* Make assert() tests more relevant
* Rename tests to macro-* or altmacro-*

This is not NFC because a (previously untested) diagnostic message is changed.

4 years agoRemove dependency between test files.
Alexander Kornienko [Mon, 13 Apr 2020 04:16:46 +0000 (06:16 +0200)]
Remove dependency between test files.

There seems to be no good reason for rocm-device-libs.cl to depend on opencl.cl.
Removed this dependency to unbreak the tests in our setup.

4 years ago[AMDGPU] Don't assert on partial exec copy
Austin Kerbow [Mon, 13 Apr 2020 01:44:45 +0000 (18:44 -0700)]
[AMDGPU] Don't assert on partial exec copy

After Machine CSE and coalescing we can end up with copies of exec to
subregister SGPRs.

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

4 years ago[NFC][PowerPC] Add a new test case early-ret-verify.mir
Kang Zhang [Mon, 13 Apr 2020 03:48:35 +0000 (03:48 +0000)]
[NFC][PowerPC] Add a new test case early-ret-verify.mir

4 years ago[mlir][EnumGen] Generate utility symbolizeEnum and stringifyEnum methods during EnumGen
River Riddle [Mon, 13 Apr 2020 02:03:33 +0000 (19:03 -0700)]
[mlir][EnumGen] Generate utility symbolizeEnum and stringifyEnum methods during EnumGen

Summary:
This revision adds generation of two utility methods during EnumGen:
```
llvm::Optional<EnumType> symbolizeEnum<EnumType>(llvm::StringRef)
<stringifyResult> stringifyEnum(EnumType);
```

This provides a generic interface for stringifying/symbolizing any enum that can be used in a template environment.

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

4 years ago[CallSite removal][FastISel] Use CallBase instead of CallSite in fastLowerCall.
Craig Topper [Sun, 12 Apr 2020 23:47:06 +0000 (16:47 -0700)]
[CallSite removal][FastISel] Use CallBase instead of CallSite in fastLowerCall.

4 years agoclang format one more line.
Chris Lattner [Sun, 12 Apr 2020 23:36:56 +0000 (16:36 -0700)]
clang format one more line.

4 years agoNFC: Clean up the implementation of StringPool a bit, and remove dependence on some...
Chris Lattner [Sun, 12 Apr 2020 17:44:03 +0000 (10:44 -0700)]
NFC: Clean up the implementation of StringPool a bit, and remove dependence on some "implicitly MallocAllocator" based methods on StringMapEntry. This allows reducing the #includes in StringMapEntry.h.

Summary:
StringPool has many caveats and isn't used in the monorepo.  I will
propose removing it as a patch separate from this refactoring patch.

Reviewers: rriddle

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

4 years ago[GlobalOpt] Explicitly set alignment of bool load/store operations.
Eli Friedman [Sun, 12 Apr 2020 23:01:28 +0000 (16:01 -0700)]
[GlobalOpt] Explicitly set alignment of bool load/store operations.

4 years ago[NFC] Use VectorType::isScalable to align with ongoing VectorType refactor.
Huihui Zhang [Sun, 12 Apr 2020 22:05:37 +0000 (15:05 -0700)]
[NFC] Use VectorType::isScalable to align with ongoing VectorType refactor.

4 years ago[MC][test] Reorganize macro tests
Fangrui Song [Sun, 12 Apr 2020 15:14:37 +0000 (08:14 -0700)]
[MC][test] Reorganize macro tests

* Add locations
* Use FileCheck --match-full-lines --strict-whitespace
* Use CHECK-NEXT:
* Merge related tests
* Delete redundant tests
* Improve test coverage

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

4 years ago[clang-tidy] Convert config options that are bools to use the bool overload of get...
Nathan James [Thu, 9 Apr 2020 21:47:09 +0000 (22:47 +0100)]
[clang-tidy] Convert config options that are bools to use the bool overload of get(GlobalOrLocal)?

Summary: This was done with a script that looks for calls to Options.get(GlobalOrLocal) that take an integer for the second argument and the result is either compared not equal to 0 or implicitly converted to bool. There may be other occurances

Reviewers: aaron.ballman, alexfh, gribozavr2

Reviewed By: aaron.ballman

Subscribers: wuzish, nemanjai, xazax.hun, kbarton, cfe-commits

Tags: #clang

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

4 years ago[NFC] Silence compiler warning [-Wmissing-braces].
Huihui Zhang [Sun, 12 Apr 2020 21:41:03 +0000 (14:41 -0700)]
[NFC] Silence compiler warning [-Wmissing-braces].

llvm/include/llvm/Support/FormatVariadic.h:146:15: warning: suggest braces around initialization of subobject [-Wmissing-braces]
      return {&Items...};
              ^~~~~~
              {     }

4 years ago[X86] Print k-mask in FMA3 comments.
Craig Topper [Sun, 12 Apr 2020 20:16:53 +0000 (13:16 -0700)]
[X86] Print k-mask in FMA3 comments.

4 years ago[CallSite removal][TargetLowering] Use CallBase instead of CallSite in TargetLowering...
Craig Topper [Sun, 12 Apr 2020 04:45:09 +0000 (21:45 -0700)]
[CallSite removal][TargetLowering] Use CallBase instead of CallSite in TargetLowering::ParseConstraints interface.

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

4 years agoreland: [DAG] Fix PR45049: LegalizeTypes crash
Jonathan Roelofs [Sat, 28 Mar 2020 18:55:51 +0000 (12:55 -0600)]
reland: [DAG] Fix PR45049: LegalizeTypes crash

Sometimes LegalizeTypes knows about common subexpressions before SelectionDAG
does, leading to accidental SDValue removal before its reference count was
truly zero.

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

Reviewed-By: bjope
Fixes: https://bugs.llvm.org/show_bug.cgi?id=45049

Reverted in 3ce77142a6452d76d6f97c9a6c2da193e78841ba because the previous patch
broke the expensive-checks bots. The new patch removes the broken check.

4 years ago[llvm][NFC] Refactor uses of CallSite to CallBase - call promotion
Mircea Trofin [Sun, 12 Apr 2020 01:07:50 +0000 (18:07 -0700)]
[llvm][NFC] Refactor uses of CallSite to CallBase - call promotion

Summary:
Updated CallPromotionUtils and impacted sites. Parameters that are
expected to be non-null, and return values that are guranteed non-null,
were replaced with CallBase references rather than pointers.

Left FIXME in places where more changes are facilitated by CallBase, but
aren't CallSites: Instruction* parameters or return values, for example,
where the contract that they are actually CallBase values.

Reviewers: davidxl, dblaikie, wmi

Reviewed By: dblaikie

Subscribers: arsenm, jvesely, nhaehnle, eraman, hiraditya, kerbowa, llvm-commits

Tags: #llvm

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

4 years agoRefactor StringMap.h, splitting StringMapEntry out to its own header.
Chris Lattner [Sun, 12 Apr 2020 05:33:06 +0000 (22:33 -0700)]
Refactor StringMap.h, splitting StringMapEntry out to its own header.

Summary:
StringMapEntry.h can have lower dependencies, than StringMap.h, which
is useful for public headers that want to expose inline methods on
StringMapEntry<> but don't need to expose all of StringMap.h.  One
example of this is mlir's Identifier.h, another example is the existing
LLVM StringPool.h.

StringPool also could use a cleanup, I'll deal with that in a follow-on
patch.

Reviewers: rriddle

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

4 years ago[x86] use vector instructions to lower FP->int->FP casts
Sanjay Patel [Sun, 12 Apr 2020 14:26:43 +0000 (10:26 -0400)]
[x86] use vector instructions to lower FP->int->FP casts

As discussed in PR36617:
https://bugs.llvm.org/show_bug.cgi?id=36617#c13
...we can avoid the likely slow round-trip from XMM to GPR to XMM
by using the vector versions of the convert instructions.

Based on experimental results from recent Intel/AMD chips, we don't
need to worry about triggering denorm stalls while operating on
garbage data in the high lanes with convert instructions, so this is
expected to always be as good or better perf than the scalar
instruction equivalent. FP exceptions are also not a concern because
strict code should not be using the regular SDAG opcodes.

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

4 years ago[VectorUtils] add IR-level analysis for widening of shuffle mask
Sanjay Patel [Sun, 12 Apr 2020 13:17:59 +0000 (09:17 -0400)]
[VectorUtils] add IR-level analysis for widening of shuffle mask

This is similar to the recent move/addition of "scaleShuffleMask" (D76508),
but there are a couple of differences:

1. The existing x86 helper (canWidenShuffleElements) always tries to
   divide-by-2, so it gets called iteratively and wouldn't handle the
   general case of non-pow-2 length.
2. The existing x86 code handles "SM_SentinelZero" - we don't have
   that in IR, but this code should be safe to use with that or other
   special (negative) values.

The motivation is to enable shuffle folds in instcombine/vector-combine
that are similar to D76844 and D76727, but in the reverse-bitcast direction.
Those patterns are visible in the tests for D40633.

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

4 years ago[clangd] Reland target_info_test
Kadir Cetinkaya [Sat, 11 Apr 2020 20:25:25 +0000 (22:25 +0200)]
[clangd] Reland target_info_test

4 years agoTrigramIndex.h - remove unnecessary StringMap.h include. NFC
Simon Pilgrim [Sun, 12 Apr 2020 13:30:52 +0000 (14:30 +0100)]
TrigramIndex.h - remove unnecessary StringMap.h include. NFC

Include StringRef.h inside TrigramIndex.cpp as thats the only part of StringMap.h that is actually required.

4 years agoIPO.h - replace SmallVector.h include with forward declaration. NFC.
Simon Pilgrim [Sun, 12 Apr 2020 12:49:57 +0000 (13:49 +0100)]
IPO.h - replace SmallVector.h include with forward declaration. NFC.

4 years agoPass.h - replace StringRef.h include with forward declaration. NFC.
Simon Pilgrim [Sun, 12 Apr 2020 12:36:20 +0000 (13:36 +0100)]
Pass.h - replace StringRef.h include with forward declaration. NFC.

4 years agoVirtRegMap.h - remove unnecessary MCRegisterInfo.h include. NFC
Simon Pilgrim [Sun, 12 Apr 2020 12:11:13 +0000 (13:11 +0100)]
VirtRegMap.h - remove unnecessary MCRegisterInfo.h include. NFC

4 years agoSelectionDAGISel.h - remove Pass.h include and forward declarations. NFC.
Simon Pilgrim [Sun, 12 Apr 2020 11:49:29 +0000 (12:49 +0100)]
SelectionDAGISel.h - remove Pass.h include and forward declarations. NFC.

Remove Pass.h include - we don't use anything direct from the header and its implicitly included by MachineFunctionPass.h.
Remove unused forward declarations.

4 years agoParallelCG.h - replace TargetMachine.h include with forward declaration. NFC.
Simon Pilgrim [Sun, 12 Apr 2020 11:36:02 +0000 (12:36 +0100)]
ParallelCG.h - replace TargetMachine.h include with forward declaration. NFC.

We need to include memory.h as it was being implicitly included.

Also remove unused llvm::TargetOptions forward declaration.

4 years ago[VPlan] Turn classes with all public members into structs (NFC).
Florian Hahn [Sun, 12 Apr 2020 09:51:17 +0000 (10:51 +0100)]
[VPlan] Turn classes with all public members into structs (NFC).

struct should be used when all members are public:
 https://llvm.org/docs/CodingStandards.html#use-of-class-and-struct-keywords

Reviewers: gilr, rengolin, Ayal, hsaito

Reviewed By: Ayal

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

4 years ago[X86] Use isAnyZero shuffle mask helper where possible. NFC.
Simon Pilgrim [Sun, 12 Apr 2020 09:57:29 +0000 (10:57 +0100)]
[X86] Use isAnyZero shuffle mask helper where possible. NFC.

4 years ago[MLIR] Fix MLIR_MAIN_[SRC|INCLUDE]_DIR variables
Ehud Katz [Sun, 12 Apr 2020 06:29:07 +0000 (09:29 +0300)]
[MLIR] Fix MLIR_MAIN_[SRC|INCLUDE]_DIR variables

Define MLIR_MAIN_INCLUDE_DIR, as it was not set anywhere.

Set MLIR_MAIN_SRC_DIR to the actual "source directory", and not the
"include directory" (as currently set).

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

4 years ago[mlir][IR] Manually register command line options for MLIRContext and AsmPrinter
River Riddle [Sun, 12 Apr 2020 06:11:51 +0000 (23:11 -0700)]
[mlir][IR] Manually register command line options for MLIRContext and AsmPrinter

Summary: This revision makes the registration of command line options for these two files manual with `registerMLIRContextCLOptions` and `registerAsmPrinterCLOptions` methods. This removes the last remaining static constructors within lib/.

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

4 years ago[mlir][StorageUniquer] Replace all usages of std::function with function_ref.
River Riddle [Sun, 12 Apr 2020 06:00:11 +0000 (23:00 -0700)]
[mlir][StorageUniquer] Replace all usages of std::function with function_ref.

Summary: std::function has a notoriously large amount of malloc traffic, whereas function_ref is a cheaper and more efficient alternative.

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

4 years agoA few cosmetic cleanups to StringMap/StringSet.h, including fixing
Chris Lattner [Sun, 12 Apr 2020 05:14:35 +0000 (22:14 -0700)]
A few cosmetic cleanups to StringMap/StringSet.h, including fixing
the indentation of the StringSet.h file and its file comment header,
and significantly reduce redundant #includes that are already pulled
in transitively.  NFC.

This is in preparation for a more interesting patch I'll post to phab.

4 years agoChange the identifier table in MLIRContext to use StringSet instead of
Chris Lattner [Sun, 12 Apr 2020 05:06:45 +0000 (22:06 -0700)]
Change the identifier table in MLIRContext to use StringSet instead of
StringMap<char>, saving a byte due to the StringMapEntry specialization
for a value of NoneType.  NFC.

4 years ago[MLIR] CMake cleanup for mlir-opt
Stephen Neuendorffer [Sat, 11 Apr 2020 01:20:20 +0000 (18:20 -0700)]
[MLIR] CMake cleanup for mlir-opt

A few libraries which are also Dialect libraries where independently
in the link line for mlir-opt.  Remove them.

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

4 years ago[MLIR] add cmake abstraction for translation libraries
Stephen Neuendorffer [Fri, 10 Apr 2020 23:58:39 +0000 (16:58 -0700)]
[MLIR] add cmake abstraction for translation libraries

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

4 years agoChange the implementation of mlir::hash_value(Identifier) to be consistent
Chris Lattner [Sun, 12 Apr 2020 04:59:48 +0000 (21:59 -0700)]
Change the implementation of mlir::hash_value(Identifier) to be consistent
with DenseMapInfo<mlir::Identifier>::getHashValue. NFC.

Adjust a few variable names to follow MLIR convention while here NFC.

4 years agoImplement some micro-optimizations for Identifier. NFC
Chris Lattner [Sun, 12 Apr 2020 01:15:56 +0000 (18:15 -0700)]
Implement some micro-optimizations for Identifier. NFC

Summary:
Identifier doesn't maintain a length, so every time strref() is called,
it does a strlen.  In the case of comparisons, this isn't necessary:
there is no need to scan a string to get its length, then rescan it to
do the comparison.  Just done one comparison.

This also moves some assertions in Identifier::get as another
microoptimization for 'assertions enabled' modes.

Reviewers: rriddle!

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits

Tags: #llvm

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

4 years ago[CallSite removal][FastISel] Remove uses of CallSite.
Craig Topper [Sat, 11 Apr 2020 07:35:32 +0000 (00:35 -0700)]
[CallSite removal][FastISel] Remove uses of CallSite.

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

4 years ago[X86] Enable shuffle combining for AVX512 unless the root is used by a vselect
Craig Topper [Sat, 11 Apr 2020 22:17:13 +0000 (15:17 -0700)]
[X86] Enable shuffle combining for AVX512 unless the root is used by a vselect

A lot of vectorized code doesn't use masks so we shouldn't penalize them by not doing shuffle combining on avx512 targets.

I've added support for VALIGNQ/VALIGND and 512-bit SHUF128 to prevent some regressions. I also prevented recombining 256-bit SHUF128 to PERM2X128. We may not need to add 256-bit SHUF128 support, but I don't think I found any cases requiring that in my testing.

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

4 years ago[LoopTerminology] LCSSA: Fix typo in code sample
Stefanos Baziotis [Sun, 12 Apr 2020 01:40:55 +0000 (04:40 +0300)]
[LoopTerminology] LCSSA: Fix typo in code sample

4 years ago[lld][WebAssembly] Add test for --export of empty string
Sam Clegg [Fri, 27 Mar 2020 23:54:39 +0000 (16:54 -0700)]
[lld][WebAssembly] Add test for --export of empty string

The actual bug was fixed in https://reviews.llvm.org/D74589

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

4 years agoAMDGPU/GlobalISel: Fix RegBankSelect for v2s16 shifts
Matt Arsenault [Sat, 11 Apr 2020 23:26:19 +0000 (19:26 -0400)]
AMDGPU/GlobalISel: Fix RegBankSelect for v2s16 shifts

These need to be promoted and scalarized for the SALU.

4 years agoRevert "llvm-dwarfdump: Report errors when failing to parse loclist/debug_loc entries"
David Blaikie [Sat, 11 Apr 2020 23:53:26 +0000 (16:53 -0700)]
Revert "llvm-dwarfdump: Report errors when failing to parse loclist/debug_loc entries"

Broke an LLDB build bot & I can't seem to build LLDB locally to fix
forward...
http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/15567/steps/test/logs/stdio

This reverts commit 416fa7720e30750939c53935051c6c750dfad2c2.

4 years agoRevert "This is a test commit."
Rahman Lavaee [Sat, 11 Apr 2020 22:55:07 +0000 (15:55 -0700)]
Revert "This is a test commit."

This reverts commit ab31797e166c118217ecf926a29c4b3a4a414847.

4 years agoThis is a test commit.
Rahman Lavaee [Sat, 11 Apr 2020 21:52:33 +0000 (14:52 -0700)]
This is a test commit.

4 years agoAMDGPU/GlobalISel: Legalize 16-bit shift amounts to s16
Matt Arsenault [Sat, 11 Apr 2020 21:04:48 +0000 (17:04 -0400)]
AMDGPU/GlobalISel: Legalize 16-bit shift amounts to s16

The current selector depends on 16-bit shifts using 16-bit shift
amount types, but really it should accept either for all types.

4 years ago[MLIR][NFC] add doc cross links from/to std.alloca
Uday Bondhugula [Sat, 11 Apr 2020 21:11:45 +0000 (02:41 +0530)]
[MLIR][NFC] add doc cross links from/to std.alloca

 Add doc cross links between std.alloca and AutomaticAllocationScope.

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits

Tags: #llvm

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

4 years ago[X86] Cleanup ISD::BRIND handling code in X86DAGToDAGISel::Select. NFC
Craig Topper [Sat, 11 Apr 2020 21:23:42 +0000 (14:23 -0700)]
[X86] Cleanup ISD::BRIND handling code in X86DAGToDAGISel::Select. NFC

-Drop llvm:: on MVT::i32
-Use getValueType instead of getSimpleValueType for an equality
check just cause its shorter and doesn't matter.
-Don't create a const SDValue & since its cheap to copy.
-Remove explicit case from MVT enum to EVT.
-Add message to assert.

4 years ago[X86] Move code that replaces ISD::VSELECT with X86ISD::BLENDV from X86DAGToDAGISel...
Craig Topper [Sat, 11 Apr 2020 21:05:27 +0000 (14:05 -0700)]
[X86] Move code that replaces ISD::VSELECT with X86ISD::BLENDV from X86DAGToDAGISel::Select to PreprocessISelDAG

4 years ago[DenseMap] Add assertion that end() iterator isn't derefenced.
Eli Friedman [Sat, 11 Apr 2020 21:53:09 +0000 (14:53 -0700)]
[DenseMap] Add assertion that end() iterator isn't derefenced.

This would have saved me some time this morning.

4 years ago[mlir][docs] Remove the MLIR prefix from several titles.
River Riddle [Sat, 11 Apr 2020 21:49:03 +0000 (14:49 -0700)]
[mlir][docs] Remove the MLIR prefix from several titles.

This prefix is already implied by the doc location and functions only as
filler.

4 years agoModuleUtils.h - include and forward declaration cleanup. NFC.
Simon Pilgrim [Sat, 11 Apr 2020 12:18:39 +0000 (13:18 +0100)]
ModuleUtils.h - include and forward declaration cleanup. NFC.

Replace SmallSet.h include with SmallVector.h - only SmallVector.h is used from inside SmallSet.h
Remove llvm::StringRef forward declaration (we include StringRef.h)
Remove unused llvm::GlobalVariable forward declaration.

4 years ago[clangd] Disable failing target_info test
Kadir Cetinkaya [Sat, 11 Apr 2020 20:16:54 +0000 (22:16 +0200)]
[clangd] Disable failing target_info test

4 years ago[CallSite removal][SelectionDAGBuilder] Use CallBase instead of ImmutableCallSite...
Craig Topper [Sat, 11 Apr 2020 06:12:07 +0000 (23:12 -0700)]
[CallSite removal][SelectionDAGBuilder] Use CallBase instead of ImmutableCallSite in visitPatchpoint.

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

4 years ago[clangd][test] Provide registered targets to lit tests
Kadir Cetinkaya [Sat, 11 Apr 2020 15:18:25 +0000 (17:18 +0200)]
[clangd][test] Provide registered targets to lit tests

Summary:
We had tests in clangd (target_info.test) that got enabled only on
systems that know about x86. But they were always disabled as clangd lit config
never registered those targets.

This patch adds those targets as `$TARGET$-registered-target`

Reviewers: sammccall

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

Tags: #clang

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

4 years agoGlobalISel: Fix typo in assert message
Matt Arsenault [Sat, 11 Apr 2020 19:32:04 +0000 (15:32 -0400)]
GlobalISel: Fix typo in assert message

4 years agoAMDGPU/GlobalISel: Fix legalizing <3 x s16> vselects
Matt Arsenault [Sat, 11 Apr 2020 19:59:51 +0000 (15:59 -0400)]
AMDGPU/GlobalISel: Fix legalizing <3 x s16> vselects

4 years ago[CodeGen] Allow partial tail duplication in Machine Block Placement.
Hongtao Yu [Sat, 11 Apr 2020 19:20:12 +0000 (12:20 -0700)]
[CodeGen] Allow partial tail duplication in Machine Block Placement.

Summary: A count profile may affect tail duplication's heuristic causing a block to be duplicated in only a part of its predecessors. This is not allowed in the Machine Block Placement pass where an assert will go off. I'm removing the assert and making the optimization bail out when such case happens.

Reviewers: wenlei, davidxl, Carrot

Reviewed By: Carrot

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoUse more LLVM_ENABLE_ABI_BREAKING_CHECKS in Error.h
Aaron Puchert [Sat, 11 Apr 2020 19:14:01 +0000 (21:14 +0200)]
Use more LLVM_ENABLE_ABI_BREAKING_CHECKS in Error.h

Summary:
If we don't read the flag, we don't need to set it. Then we also don't
need to filter it out to get the pointer.

This should have a (small) positive impact on code size and performance.

Reviewed By: lhames

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

4 years ago[mlir][docs] Refactor the layout of the docs folder
River Riddle [Sat, 11 Apr 2020 18:38:05 +0000 (11:38 -0700)]
[mlir][docs] Refactor the layout of the docs folder

Summary:
This revision performs a few refactorings on the main docs folder. Namely it:
* Adds a new Rationale/ folder to contain various rationale documents
* Moves several "getting started" documents to the Tutorials/ folder
* Cleans up the titles of various documents

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

4 years ago[libc++][test] Silence "unused variable" warning
Casey Carter [Sat, 11 Apr 2020 18:38:53 +0000 (11:38 -0700)]
[libc++][test] Silence "unused variable" warning

4 years ago[MC] Default MCAsmInfo::UseIntegratedAssembler to true
Fangrui Song [Sat, 11 Apr 2020 17:06:18 +0000 (10:06 -0700)]
[MC] Default MCAsmInfo::UseIntegratedAssembler to true

4 years ago[MC] Add UseIntegratedAssembler = false. NFC
Fangrui Song [Sat, 11 Apr 2020 17:01:36 +0000 (10:01 -0700)]
[MC] Add UseIntegratedAssembler = false. NFC

4 years agoSimplify string joins. NFCI.
Benjamin Kramer [Sat, 11 Apr 2020 15:18:54 +0000 (17:18 +0200)]
Simplify string joins. NFCI.

4 years ago[clangd] Remove redundant code in test. NFC
Sam McCall [Sat, 11 Apr 2020 15:14:31 +0000 (17:14 +0200)]
[clangd] Remove redundant code in test. NFC

4 years ago[mlir][docs] Explain the EDSC acronym. NFC
Jonathan Roelofs [Fri, 10 Apr 2020 22:40:31 +0000 (16:40 -0600)]
[mlir][docs] Explain the EDSC acronym. NFC

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

4 years ago[mlir][toy] Fix comment typo. NFC
Jonathan Roelofs [Fri, 10 Apr 2020 14:18:34 +0000 (08:18 -0600)]
[mlir][toy] Fix comment typo. NFC

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

4 years ago[mlir][toy][docs] Fix reference to generated ToyCombine.inc. NFC
Jonathan Roelofs [Wed, 8 Apr 2020 20:55:36 +0000 (14:55 -0600)]
[mlir][toy][docs] Fix reference to generated ToyCombine.inc. NFC

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

4 years ago[mlir][toy][docs] Reword for better sentence flow. NFC
Jonathan Roelofs [Thu, 9 Apr 2020 17:53:56 +0000 (11:53 -0600)]
[mlir][toy][docs] Reword for better sentence flow. NFC

4 years agoAMDGPU/GlobalISel: Work around forming illegal zextload after legalize
Matt Arsenault [Sun, 5 Apr 2020 21:48:55 +0000 (17:48 -0400)]
AMDGPU/GlobalISel: Work around forming illegal zextload after legalize

Selection would fail after the post legalize combiner put an illegal
zextload back together.

The base combiner has parameter to only allow legal operations, but
they appear to not be used. I also don't see a nice way to remove a
single entry from all_combines, so just hack around this.

4 years ago[scudo][standalone] Work with -Werror=class-memaccess
Kostya Kortchinsky [Fri, 10 Apr 2020 20:41:12 +0000 (13:41 -0700)]
[scudo][standalone] Work with -Werror=class-memaccess

Summary:
Fuchsia's gcc uses this, which in turn prevents us to compile successfully
due to a few `memset`'ing some non-trivial classes in some `init`.

Change those `memset` to members initialization.

Reviewers: pcc, hctim

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

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

4 years ago[MLIR] Handle in-place folding properly in greedy pattern rewrite driver
Uday Bondhugula [Sun, 5 Apr 2020 04:35:52 +0000 (10:05 +0530)]
[MLIR] Handle in-place folding properly in greedy pattern rewrite driver

OperatioFolder::tryToFold performs both true folding and in a few
instances in-place updates through op rewrites. In the latter case, we
should still be applying the supplied pattern rewrites in the same
iteration; however this wasn't the case since tryToFold returned
success() for both true folding and in-place updates, and the patterns
for the in-place updated ops were being applied only in the next
iteration of the driver's outer loop. This fix would make it converge
faster.

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

4 years ago[VectorUtils] rename scaleShuffleMask to narrowShuffleMaskElts; NFC
Sanjay Patel [Sat, 11 Apr 2020 14:05:49 +0000 (10:05 -0400)]
[VectorUtils] rename scaleShuffleMask to narrowShuffleMaskElts; NFC

As proposed in D77881, we'll have the related widening operation,
so this name becomes too vague.

While here, change the function signature to take an 'int' rather
than 'size_t' for the scaling factor, add an assert for overflow of
32-bits, and improve the documentation comments.

4 years agoTargetLoweringObjectFileImpl.h - replace MCExpr.h and Module.h includes with forward...
Simon Pilgrim [Sat, 11 Apr 2020 13:13:18 +0000 (14:13 +0100)]
TargetLoweringObjectFileImpl.h - replace MCExpr.h and Module.h includes with forward declarations. NFC.

Also remove unused llvm::Mangler forward declaration.