1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

194863 Commits

Author SHA1 Message Date
Jonathan Roelofs
fadd2db182 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.
2020-04-12 09:52:17 -06:00
Mircea Trofin
d088dc177a [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
9f32bd6e6c 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
f7ca7a7a5c [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
91701e7d4b [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
Simon Pilgrim
916cfc591d 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
cde3e369bf IPO.h - replace SmallVector.h include with forward declaration. NFC. 2020-04-12 13:49:57 +01:00
Simon Pilgrim
61ea52483b Pass.h - replace StringRef.h include with forward declaration. NFC. 2020-04-12 13:36:20 +01:00
Simon Pilgrim
eebdaff5cd VirtRegMap.h - remove unnecessary MCRegisterInfo.h include. NFC 2020-04-12 13:11:13 +01:00
Simon Pilgrim
8371ba1293 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
9c7f74d33b 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
5c020096c8 [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
8be836ae45 [X86] Use isAnyZero shuffle mask helper where possible. NFC. 2020-04-12 10:57:29 +01:00
Chris Lattner
3652a30d15 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
Craig Topper
768e5a5b49 [CallSite removal][FastISel] Remove uses of CallSite.
Differential Revision: https://reviews.llvm.org/D77933
2020-04-11 20:52:45 -07:00
Craig Topper
b27ca834da [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
f5bcf98c90 [LoopTerminology] LCSSA: Fix typo in code sample 2020-04-12 04:40:55 +03:00
Matt Arsenault
6a077dd7a8 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
356c6ad409 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.
2020-04-11 16:54:49 -07:00
Matt Arsenault
e12ddb0e52 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
Craig Topper
9127250ae4 [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
87799e9feb [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
5bf90476ea [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
Simon Pilgrim
7bbe4c6008 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
Craig Topper
b596a19170 [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
Matt Arsenault
0fdb14b861 GlobalISel: Fix typo in assert message 2020-04-11 16:02:26 -04:00
Matt Arsenault
f678530c6e AMDGPU/GlobalISel: Fix legalizing <3 x s16> vselects 2020-04-11 15:59:51 -04:00
Hongtao Yu
e7db5b116b [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
c19e55e1a6 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
Fangrui Song
3c474aa8ad [MC] Default MCAsmInfo::UseIntegratedAssembler to true 2020-04-11 10:13:52 -07:00
Fangrui Song
89981ade6c [MC] Add UseIntegratedAssembler = false. NFC 2020-04-11 10:13:49 -07:00
Benjamin Kramer
d4c4773e87 Simplify string joins. NFCI. 2020-04-11 17:20:11 +02:00
Matt Arsenault
70f3ab2891 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.
2020-04-11 10:52:58 -04:00
Sanjay Patel
8105dac4cc [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.
2020-04-11 10:05:49 -04:00
Simon Pilgrim
c68409d10e TargetLoweringObjectFileImpl.h - replace MCExpr.h and Module.h includes with forward declarations. NFC.
Also remove unused llvm::Mangler forward declaration.
2020-04-11 14:13:39 +01:00
Benjamin Kramer
dda49c99ab [FormatVariadic] Put back return type in an attempt to make GCC happy 2020-04-11 15:11:44 +02:00
Benjamin Kramer
9f3f98bdcb [argpromote] Use formatv to simplify code. NFCI. 2020-04-11 14:54:32 +02:00
Benjamin Kramer
b25315e825 [FormatVariadic] Reduce allocations
- Move Adapters array to the stack, we know the size precisely
- Parse format string on demand into a SmallVector. In theory this could
  lead to parsing it multiple times, but I couldn't find a single instance
  of that in LLVM.
- Make more of the implementation details private.
2020-04-11 14:54:32 +02:00
Nemanja Ivanovic
1af021cea8 [PowerPC] Handle f16 as a storage type only
The PPC back end currently crashes (fails to select) with f16 input. This patch
expands it on subtargets prior to ISA 3.0 (Power9) and uses the HW conversions
on Power9.

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

Differential revision: https://reviews.llvm.org/D68237
2020-04-11 07:34:47 -05:00
Florian Hahn
150d22f2af [VPlan] Drop redundant private: at beginning of class defs (NFC).
Default visibility for classes is private, so the private: at the top of
various class definitions is redundant.

Reviewers: gilr, rengolin, Ayal, hsaito

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D77810
2020-04-11 13:27:10 +01:00
Simon Pilgrim
e0512a5d06 CodeGen/EdgeBundles - move Twine.h include down into EdgeBundles.cpp. NFC.
EdgeBundles.h has no use for it.
2020-04-11 12:21:04 +01:00
Simon Pilgrim
3f1d22de55 Local.h - remove unnecessary Twine.h include. NFC. 2020-04-11 12:21:04 +01:00
Simon Pilgrim
32c17c7efe PhiValues.h - remove unused llvm::Use forward declaration. NFC. 2020-04-11 12:21:04 +01:00
Simon Pilgrim
9ae669cb5c ObjCARCAnalysisUtils.h - remove unused llvm::raw_ostream forward declaration. NFC. 2020-04-11 12:21:04 +01:00
Simon Pilgrim
38c517ba07 SyntheticCountsUtils.h - remove unused llvm::CallGraph/Function forward declarations. NFC. 2020-04-11 12:21:03 +01:00
Simon Pilgrim
7ba4485ee9 OptimizationRemarkEmitter.h - remove unused llvm::DebugLoc/Loop/Pass/Twine forward declarations. NFC. 2020-04-11 12:21:03 +01:00
Simon Pilgrim
e8d212820a Passes.h - remove unused llvm::LoopPass/Pass/PassInfo forward declarations. NFC. 2020-04-11 12:21:03 +01:00
Simon Pilgrim
8d7f4c85f5 PredicateInfo.h - remove unused llvm::Instruction/MemoryAccess/LLVMContext forward declarations. NFC. 2020-04-11 11:25:48 +01:00
Simon Pilgrim
e93b439d86 IntrinsicLowering.h - remove unused llvm::Module forward declaration. NFC. 2020-04-11 11:25:48 +01:00
Simon Pilgrim
43bac524ac ExecutionDomainFix.h - remove unused llvm::MachineBasicBlock forward declaration. NFC. 2020-04-11 11:25:48 +01:00