Commit Graph

351080 Commits

Author SHA1 Message Date
Fangrui Song 38c271f6f9 [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
2020-04-12 15:18:35 -07:00
Nathan James 672207c319 [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
2020-04-12 23:06:09 +01:00
Huihui Zhang 8e2daa0c7f [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...};
              ^~~~~~
              {     }
2020-04-12 14:42:59 -07:00
Craig Topper 42fc7852f5 [X86] Print k-mask in FMA3 comments. 2020-04-12 13:16:53 -07:00
Craig Topper 95192f548d [CallSite removal][TargetLowering] Use CallBase instead of CallSite in TargetLowering::ParseConstraints interface.
Differential Revision: https://reviews.llvm.org/D77929
2020-04-12 11:26:25 -07:00
Jonathan Roelofs 41f13f1f64 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 3ce77142a6 because the previous patch
broke the expensive-checks bots. The new patch removes the broken check.
2020-04-12 09:52:17 -06:00
Mircea Trofin d2f1cd5d97 [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
2020-04-12 08:27:29 -07:00
Chris Lattner 617b08ff9b 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
2020-04-12 08:25:17 -07:00
Sanjay Patel d04db4825a [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
2020-04-12 10:26:43 -04:00
Sanjay Patel c23cbefd9d [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
2020-04-12 10:14:19 -04:00
Kadir Cetinkaya 101a69d71b
[clangd] Reland target_info_test 2020-04-12 16:10:04 +02:00
Simon Pilgrim 2b74755ec5 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.
2020-04-12 14:30:52 +01:00
Simon Pilgrim 688ac00bb2 IPO.h - replace SmallVector.h include with forward declaration. NFC. 2020-04-12 13:49:57 +01:00
Simon Pilgrim d02bc5e150 Pass.h - replace StringRef.h include with forward declaration. NFC. 2020-04-12 13:36:20 +01:00
Simon Pilgrim c46e65fa80 VirtRegMap.h - remove unnecessary MCRegisterInfo.h include. NFC 2020-04-12 13:11:13 +01:00
Simon Pilgrim 9ad6773790 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.
2020-04-12 12:49:29 +01:00
Simon Pilgrim 0bd13e98cb 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.
2020-04-12 12:36:02 +01:00
Florian Hahn ae1e353a25 [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
2020-04-12 11:03:39 +01:00
Simon Pilgrim 40581a0a2b [X86] Use isAnyZero shuffle mask helper where possible. NFC. 2020-04-12 10:57:29 +01:00
Ehud Katz 3e8de2ed74 [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
2020-04-12 09:29:07 +03:00
River Riddle 8938dea44a [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
2020-04-11 23:13:00 -07:00
River Riddle 1fc6efaf6a [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
2020-04-11 23:07:52 -07:00
Chris Lattner d985b0bf5c 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.
2020-04-11 22:14:35 -07:00
Chris Lattner aef4ec00f9 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.
2020-04-11 22:07:39 -07:00
Stephen Neuendorffer 4956871c0e [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
2020-04-11 22:02:16 -07:00
Stephen Neuendorffer 4c18e1d3af [MLIR] add cmake abstraction for translation libraries
Differential Revision: https://reviews.llvm.org/D77926
2020-04-11 22:02:16 -07:00
Chris Lattner ed87d9d643 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.
2020-04-11 21:59:48 -07:00
Chris Lattner 0031c7f7da 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
2020-04-11 21:48:52 -07:00
Craig Topper 5b42399029 [CallSite removal][FastISel] Remove uses of CallSite.
Differential Revision: https://reviews.llvm.org/D77933
2020-04-11 20:52:45 -07:00
Craig Topper d3465e0691 [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
2020-04-11 20:05:10 -07:00
Stefanos Baziotis 72ffeb2d38 [LoopTerminology] LCSSA: Fix typo in code sample 2020-04-12 04:40:55 +03:00
Sam Clegg 9225ff6278 [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
2020-04-11 18:21:40 -07:00
Matt Arsenault 96819011ca AMDGPU/GlobalISel: Fix RegBankSelect for v2s16 shifts
These need to be promoted and scalarized for the SALU.
2020-04-11 20:55:33 -04:00
David Blaikie 7a45aeacf3 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 416fa7720e.
2020-04-11 16:54:49 -07:00
Rahman Lavaee 61d39b627a Revert "This is a test commit."
This reverts commit ab31797e16.
2020-04-11 15:55:07 -07:00
Rahman Lavaee ab31797e16 This is a test commit. 2020-04-11 15:19:46 -07:00
Matt Arsenault ac8d51a3c6 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.
2020-04-11 18:12:26 -04:00
Uday Bondhugula 75ea9e4e40 [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
2020-04-12 03:33:19 +05:30
Craig Topper d1da1b53ff [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.
2020-04-11 15:01:05 -07:00
Craig Topper 21a7d08e72 [X86] Move code that replaces ISD::VSELECT with X86ISD::BLENDV from X86DAGToDAGISel::Select to PreprocessISelDAG 2020-04-11 15:01:05 -07:00
Eli Friedman 4e86e5eedc [DenseMap] Add assertion that end() iterator isn't derefenced.
This would have saved me some time this morning.
2020-04-11 14:53:09 -07:00
River Riddle 89b007037f [mlir][docs] Remove the MLIR prefix from several titles.
This prefix is already implied by the doc location and functions only as
filler.
2020-04-11 14:49:03 -07:00
Simon Pilgrim 1b76c4cade 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.
2020-04-11 21:25:53 +01:00
Kadir Cetinkaya 5d5671242e
[clangd] Disable failing target_info test 2020-04-11 22:17:01 +02:00
Craig Topper 806763efcf [CallSite removal][SelectionDAGBuilder] Use CallBase instead of ImmutableCallSite in visitPatchpoint.
Differential Revision: https://reviews.llvm.org/D77932
2020-04-11 13:07:31 -07:00
Kadir Cetinkaya d34a91a10f
[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
2020-04-11 22:03:08 +02:00
Matt Arsenault 1747ba25b2 GlobalISel: Fix typo in assert message 2020-04-11 16:02:26 -04:00
Matt Arsenault c5497e5399 AMDGPU/GlobalISel: Fix legalizing <3 x s16> vselects 2020-04-11 15:59:51 -04:00
Hongtao Yu 11455a7905 [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
2020-04-11 12:20:31 -07:00
Aaron Puchert b96b9335ae 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
2020-04-11 21:14:18 +02:00