Commit Graph

370645 Commits

Author SHA1 Message Date
Sam Clegg 9d1409df87 [lld][WebAssembly] Give better warnings on bad relocation sites
Differential Revision: https://reviews.llvm.org/D90443
2020-10-30 10:11:04 -07:00
Arthur Eubanks 2e31727a88 [NFC] Clean up PassBuilder
Make DebugLogging a member variable so that users of PassBuilder don't
need to pass it around so much.

Move call to TargetMachine::registerPassBuilderCallbacks() within
PassBuilder so users don't need to remember to call it.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D90437
2020-10-30 10:03:59 -07:00
Arthur Eubanks 10f2a0d662 Use uint64_t for branch weights instead of uint32_t
CallInst::updateProfWeight() creates branch_weights with i64 instead of i32.
To be more consistent everywhere and remove lots of casts from uint64_t
to uint32_t, use i64 for branch_weights.

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D88609
2020-10-30 10:03:46 -07:00
Andrzej Warzynski e5699b8ff1 [clang][driver] Rename DriverOption as NoXarchOption (NFC)
As discussed in [1], ClangFlags::DriverOption is currently only used to
mark options that should not be forwarded to other tools via `-Xarch`
options. This patch renames this flag accordingly and updates the
corresponding driver diagnostic.

A comment in ToolChain::TranslateXarchArgs is also updated to reflect
the change. The original comment referred to isDriverOption(), which is
no longer available.

[1] http://lists.llvm.org/pipermail/cfe-dev/2020-October/066953.html

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D89799
2020-10-30 17:00:06 +00:00
Louis Dionne 4dfe014a12 [libc++] Add -Wno-sized-deallocation to avoid spurious GCC warnings
GCC tries to be nice and tell us that we probably want to also implement
sized deallocation functions when we override the normal ones. However,
we know what we're doing in the test suite and don't want to override
them.
2020-10-30 12:51:07 -04:00
Pedro Tammela 86e0c1acdb [NFC][Reg2Mem] modernize loops iterators
This patch updates the Reg2Mem loops to use more modern iterators.

Differential Revision: https://reviews.llvm.org/D90122
2020-10-30 16:50:07 +00:00
Pedro Tammela 70a495c7f0 [NFC][LoopSimplify] modernize for loops over LoopInfo
This patch modifies two for loops to use the range based syntax.
Since they are equivalent, this patch is tagged NFC.

Differential Revision: https://reviews.llvm.org/D90069
2020-10-30 16:50:07 +00:00
Louis Dionne c479e0c994 [libc++] NFC: Fix several GCC warnings in the test suite
- Several -Wshadow warnings
- Several places where we did not initialize our base class explicitly
- Unused variable warnings
- Some tautological comparisons
- Some places where we'd pass null arguments to functions expecting
  non-null (in unevaluated contexts)
- Add a few pragmas to turn off spurious warnings
- Fix warnings about declarations that don't declare anything
- Properly disable deprecation warnings in ext/ tests (the pragmas we
  were using didn't work on GCC)
- Disable include_as_c.sh.cpp because GCC complains about C++ flags
  when compiling as C. I couldn't find a way to fix this one properly,
  so I'm disabling the test. This isn't great, but at least we'll be
  able to enable warnings in the whole test suite with GCC.
2020-10-30 12:48:05 -04:00
Daniel Kiss 1d7786d45f [libunwind] Support DW_CFA_remember/restore_state without heap allocation.
This patch just reorganises the code to make possible to use alloca
instead of malloc. This makes possible to use `.cfi_remember_state`/`.cfi_restore_state` on
platforms without heap allocation.
Also it will be safe to backtrace/unwind faults related to the allocator behind malloc.
`_LIBUNWIND_REMEMBER_HEAP_ALLOC ` option reenables the heap usage for `.cfi_remember_state`/`.cfi_restore_state`.
Define _LIBUNWIND_REMEMBER_STACK_ALLOC to force stack allocation.

Reviewed By: #libunwind, mstorsjo

Differential Revision: https://reviews.llvm.org/D85005
2020-10-30 17:45:20 +01:00
Sanjay Patel 251dd7c0f9 [x86] add cost overrides for mul with overflow
I'm assuming the standard size integer instructions for this end up as something like:
mulq %rsi
seto %al

And the 'mul' generally has reciprocal throughput of 1 on typical implementations
(higher latency, but that's not handled here).
The default costs may end up much higher than that, and that's what we see in the test diffs.

Vector types are left as a 'TODO'.

Differential Revision: https://reviews.llvm.org/D90431
2020-10-30 12:38:16 -04:00
Amy Huang 7156910d85 [CodeView] Encode signed int values correctly when emitting S_CONSTANTs
Differential Revision: https://reviews.llvm.org/D90199
2020-10-30 09:28:41 -07:00
Simon Pilgrim 973317cc5e [CodeGen][X86] Remove unused check-prefix in constrained fma tests 2020-10-30 16:23:08 +00:00
Simon Pilgrim 365f46efeb [CodeGen][X86] Remove unused check-prefix in movdir tests 2020-10-30 16:23:08 +00:00
Jonas Devlieghere 5b17b6d924 [lldb] Ignore binary data in crashlog
Skip the instruction stream section in the crashlog section.

Differential revision: https://reviews.llvm.org/D90414
2020-10-30 09:17:45 -07:00
Simon Pilgrim c44846f537 [CodeGen][X86] Cleanup + fix unused check-prefixes in bmi tests 2020-10-30 16:13:54 +00:00
Simon Pilgrim fe3d765ac7 [CodeGen][X86] Tidyup CHECKs on bitscan tests 2020-10-30 16:13:52 +00:00
Simon Pilgrim 5cdd470504 [CodeGen][X86] Remove unused check-prefix in bitscan tests 2020-10-30 16:13:50 +00:00
Simon Pilgrim 0ff9d8c8ba [CodeGen][X86] Remove unused check-prefix in bswap tests 2020-10-30 16:13:49 +00:00
Simon Pilgrim d7389f05ee [CodeGen][X86] Cleanup + remove unused check-prefixes in avx union tests 2020-10-30 16:13:47 +00:00
Simon Pilgrim bbe055dd73 [CodeGen][X86] Remove unused check-prefix in amx inline asm tests 2020-10-30 16:13:45 +00:00
Pavel Labath 1d1d916f96 Fix an embarrasing use-after-free from a895a446bc 2020-10-30 16:54:24 +01:00
Jan Kratochvil a136699b2a [nfc] [lldb] Align `user_id_t` format to the current `DIERef` format
Current user_id_t format is:
        63{isDebugTypes} 62..32{dwo || 7fffffff}
        31..0 {die_offset}
while current DIERef format is (I have made up the bit positions but the
field widths do match):
        63{m_section==isDebugTypes} 62{m_dwo_num_valid} 61..32{m_dwo_num}
        31..0 {m_die_offset}

Proposing to change user_id_t to:
        63{isDebugTypes} 62{dwo_is_valid} 61..32{dwo; 0 if !valid}
        31..0 {die_offset}

There is no benefit of having 31-bits wide dwo_num in user_id_t when it
gets converted to 30-bits width in DIERef.

This patch is for future DWZ patchset which extends the dwo_is_valid bit
into a 2-bit field (normal, DWO, DWZ, DWZcommon) so that both user_id_t
and DIERef can be changed then the same way.

It would be best to somehow unify user_id_t and DIERef but I do not plan
to do that. user_id_t should probably remain a number for the Python API
compatibility while there still needs to be some class with all the
methods to access it.

SymbolFileDWARF::GetDwpSymbolFile() and SymbolFileDWARF::GetDIE use
0x3fffffff for DWP but that does not clash:

formerly:
  31bits32..62:0x7fffffff = normal unit / not any DWO
  31bits32..62:0x3fffffff = DWP
  31bits32..62:others = DWO unit number

after this patch:
  bit62=0 30bits32..61:any = normal unit / not any DWO
  bit62=1 30bits32..61:0x3fffffff = DWP
  bit62=1 30bits32..61:others = DWO unit number

Differential Revision: https://reviews.llvm.org/D90413
2020-10-30 16:50:52 +01:00
Simon Moll 1943b7f15d [VE][NFC] move scalar tests to Scalar/
Restructure lit tests to follow downstream

Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D90468
2020-10-30 16:44:32 +01:00
Keith Smiley e7ada98b56 [llvm-cov][NFC] Remove unused prefixes from FileCheck usage
This is to enable `--allow-unused-duplicates=false`. These prefixes
appear to be outdated and intentionally unused.

Reviewed By: vsk

Differential Revision: https://reviews.llvm.org/D90423
2020-10-30 08:28:10 -07:00
Michael Liao c82403d025 [gvn] PRE needs to skip convergent intrinsics/calls.
- As convergent intrinsics/calls could only be moved to
  control-equivalent blocks, or more precisely the same divergent
  branch, PRE needs to skip them.

Differential Revision: https://reviews.llvm.org/D90391
2020-10-30 11:24:40 -04:00
Evgeniy Brevnov 3d31adaec4 [DSE] Improve partial overlap detection
Currently isOverwrite returns OW_MaybePartial even for accesss known not to overlap. This is not a big problem for legacy implementation (since isPartialOverwrite follows isOverwrite and clarifies the result). Contrary SSA based version does a lot of work to later find out that accesses don't overlap. Besides negative impact on compile time we quickly reach MemorySSAPartialStoreLimit and miss optimization opportunities.

Note: In fact, I think it would be cleaner implementation if isOverwrite returned fully clarified result in the first place whithout need to call isPartialOverwrite. This can be done as a follow up. What do you think?

Reviewed By: fhahn, asbirlea

Differential Revision: https://reviews.llvm.org/D90371
2020-10-30 22:23:20 +07:00
Simon Pilgrim 1eeae43107 [SLP][X86] Extend target coverage for PR47629
As suggested on D90445, add tests for various SSE/AVX levels and more complex gep pointer offsets
2020-10-30 15:20:41 +00:00
Simon Pilgrim ed577892cf Use cast<> instead of dyn_cast<> as we dereference the pointers immediately. NFCI.
Fix clang static analyzer warnings - we're better off relying on cast<> asserting on failure rather than a null dereference crash.
2020-10-30 15:20:40 +00:00
Simon Moll 4474d4d49c [VE][NFC] Split up lowering init
Split up the monolithic VETargetLowering ctor into three initialization phases:
1. initRegisterClasses()
2. initSPUActions()
3. // TODO initVPUActions()

Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D90463
2020-10-30 16:18:27 +01:00
Matt Arsenault 790f5771fd AMDGPU: Fix missing writelane cases to skip with exec=0 2020-10-30 11:15:11 -04:00
Cullen Rhodes 58d3f0ea49 [clang][aarch64] Address various fixed-length SVE vector operations
This patch adds tests and support for operations on SVE vectors created
by the 'arm_sve_vector_bits' attribute, described by the Arm C Language
Extensions (ACLE, version 00bet6, section 3.7.3.3) for SVE [1].

This covers the following:
* VLSTs support the same forms of element-wise initialization as GNU
  vectors.
* VLSTs support the same built-in C and C++ operators as GNU vectors.
* Conditional and binary expressions containing GNU and SVE vectors
  (fixed or sizeless) are invalid since the ambiguity around the result
  type affects the ABI.

No functional changes were required to support vector initialization and
operators. The functional changes are to address unsupported conditional and
binary expressions.

[1] https://developer.arm.com/documentation/100987/latest

Reviewed By: fpetrogalli

Differential Revision: https://reviews.llvm.org/D88233
2020-10-30 15:10:54 +00:00
Mehdi Amini b3430ed05f Revert "[MLIR][SPIRV] Start module combiner"
This reverts commit 316593ce83.
Build is broken with:

TestModuleCombiner.cpp:(.text._ZN12_GLOBAL__N_122TestModuleCombinerPass14runOnOperationEv+0x195): undefined reference to `mlir::spirv::combine(llvm::MutableArrayRef<mlir::spirv::ModuleOp>, mlir::OpBuilder&, llvm::function_ref<void (mlir::spirv::ModuleOp, llvm::StringRef, llvm::StringRef)>)'
2020-10-30 15:09:21 +00:00
David Green 87c27e67bf [ARM] Update target triple in tests. NFC 2020-10-30 15:06:49 +00:00
Florian Hahn aa1a198a64 [VPlan] Use isa<> instead getVPRecipeID in getFirstNonPhi (NFC).
As per the comment in VPRecipeBase, clients should not rely on
getVPRecipeID, as it may change in the future. It should only be used in
classof implementations. Use isa instead in getFirstNonPhi.
2020-10-30 14:56:06 +00:00
Simon Pilgrim b7c91a9b8e [SCEV] SCEVExpander::InsertNoopCastOfTo - reduce scope of pointer type. NFCI.
By reducing the scope of the dyn_cast<PointerType> we can make this a cast<PointerType> and avoid clang static analyzer null deference warnings.
2020-10-30 14:55:09 +00:00
Frederik Gossen 56299b1e58 [MLIR] Use `llvm::is_one_of` in walk templates
Differential Revision: https://reviews.llvm.org/D90449
2020-10-30 14:42:34 +00:00
serge-sans-paille 2706942a22 [lit] Ship and bundle license for lit package
lit is bundled independently from LLVM in at least one location
(https://pypi.org/project/lit/), it's easier to state its license locally.

Differential Revision: https://reviews.llvm.org/D90136
2020-10-30 15:34:00 +01:00
serge-sans-paille 0f60bcc36c [stack-clash] Fix probing of dynamic alloca
- Perform the probing in the correct direction.
  Related to https://github.com/rust-lang/rust/pull/77885#issuecomment-711062924

- The first touch on a dynamic alloca cannot use a mov because it clobbers
  existing space. Use a xor 0 instead

Differential Revision: https://reviews.llvm.org/D90216
2020-10-30 15:34:00 +01:00
Simon Pilgrim 0ff1ab42f2 Use cast<> instead of dyn_cast<> as we dereference the pointer immediately. NFCI.
Fix clang static analyzer warning - we know that the arg should be ConstantInt and we're better off relying on cast<> asserting on failure rather than a null dereference crash.
2020-10-30 14:33:20 +00:00
Simon Pilgrim 5bf45ee156 BitcodeReader::popValue - pass SmallVectorImpl<> as const reference. NFCI.
Fixes cppcheck warning.
2020-10-30 14:33:19 +00:00
Melanie Blower 71bf9f07d5 [clang] add fexperimental-strict-floating-point to test cases that fail on arm and aarch not sure this will work due to commit rG13bfd89c4962 2020-10-30 07:30:06 -07:00
Pavel Labath 8485ee781f [lldb/DWARF] Fix dwo flavour of TestTypeGetModule
SymbolFileDWARF::GetTypes was not handling dwo correctly. The fix is
simple -- adding a GetNonSkeletonUnit call -- but I've snuck in a small
refactor as well.
2020-10-30 15:20:27 +01:00
Marco Antognini bbdbd020d2 Address ABI issues introduced with CXCursor_CXXAddrspaceCastExpr
Revert values in CXCursorKind as they were before
CXCursor_CXXAddrspaceCastExpr was introduced in a6a237f204 ([OpenCL]
Added addrspace_cast operator in C++ mode., 2020-05-18).

Insert CXCursor_CXXAddrspaceCastExpr after the last expression in
CXCursorKind using the next available value.

Reviewed By: akyrtzi, svenvh

Differential Revision: https://reviews.llvm.org/D90385
2020-10-30 14:12:01 +00:00
Roman Lebedev ef22d500f7
[NFCI][SCEV] getPtrToIntExpr(): use SCEVRewriteVisitor<> for ptrtoint cast sinking
This is functionally-identical to the previous implementation,
just using a generic interface to do that instead of hand-rolled one,
with caching as a bonus. Thought the sinking is still recursive..

Note that SCEVRewriteVisitor<>'s default implementations
don't preserve NoWrap flags on Add/Mul (but does on AddRec!),
but here we know we can preserve them,
so `visitAddExpr()`/`visitMulExpr()` are specialized.
2020-10-30 17:05:14 +03:00
Florian Hahn 73f01e3df5 [TTI] Add VecPred argument to getCmpSelInstrCost.
On some targets, like AArch64, vector selects can be efficiently lowered
if the vector condition is a compare with a supported predicate.

This patch adds a new argument to getCmpSelInstrCost, to indicate the
predicate of the feeding select condition. Note that it is not
sufficient to use the context instruction when querying the cost of a
vector select starting from a scalar one, because the condition of the
vector select could be composed of compares with different predicates.

This change greatly improves modeling the costs of certain
compare/select patterns on AArch64.

I am also planning on putting up patches to make use of the new argument in
SLPVectorizer & LV.

Reviewed By: dmgreen, RKSimon

Differential Revision: https://reviews.llvm.org/D90070
2020-10-30 13:49:08 +00:00
Erich Keane ec809e4cfe PR47372: Fix Lambda invoker calling conventions
As mentioned in the defect, the lambda static invoker does not follow
the calling convention of the lambda itself, which seems wrong. This
patch ensures that the calling convention of operator() is passed onto
the invoker and conversion-operator type.

This is accomplished by extracting the calling-convention determination
code out into a separate function in order to better reflect the 'thiscall'
work, as well as somewhat better support the future implementation of
https://devblogs.microsoft.com/oldnewthing/20150220-00/?p=44623

For any target (basically just win32) that has a different free and
static function calling convention, this generates BOTH alternatives.
This required some work to get the Windows mangler to work correctly for
this, as well as some tie-breaking for the unary operators.

Differential Revision: https://reviews.llvm.org/D89559
2020-10-30 06:39:55 -07:00
ergawy 316593ce83 [MLIR][SPIRV] Start module combiner
This commit adds a new library that merges/combines a number of spv
modules into a combined one. The library has a single entry point:
combine(...).

To combine a number of MLIR spv modules, we move all the module-level ops
from all the input modules into one big combined module. To that end, the
combination process can proceed in 2 phases:

  (1) resolving conflicts between pairs of ops from different modules
  (2) deduplicate equivalent ops/sub-ops in the merged module. (TODO)

This patch implements only the first phase.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D90022
2020-10-30 09:37:28 -04:00
David Sherwood cea69fa4dc [SVE] Add fatal error for unnamed SVE variadic arguments
We don't currently support passing unnamed variadic SVE arguments
so I've added a fatal error if we hit such cases to prevent any
silent ABI issues in future.

Differential Revision: https://reviews.llvm.org/D90230
2020-10-30 13:35:47 +00:00
David Green d14db8c8dc [ARM] Match MVE vqdmulh
This adds ISel matching for a form of VQDMULH. There are several ir
patterns that we could match to that instruction, this one is for:

min(ashr(mul(sext(a), sext(b)), 7), 127)

Which is what llvm will optimize to once it has removed the max that
usually makes up the min/max saturate pattern, as in this case the
compare will always be false. The additional complication to match i32
patterns (which extend into an i64) is that the min will be a
vselect/setcc, as vmin is not supported for i64 vectors. Tablegen
patterns have also been updated to attempt to reuse the MVE_TwoOpPattern
patterns.

Differential Revision: https://reviews.llvm.org/D90096
2020-10-30 13:34:27 +00:00
Pavel Labath 62286c569d [lldb/test] Remove a double debugserver launch in TestGdbRemoteGPacket
Debug server is already launched by prep_debug_monitor_and_inferior. The
second seems to have been benign so far, but after 8cc49bec2 this test
started failing frequently on GreenDragon, and this is the only unusual
thing about it.
2020-10-30 14:27:50 +01:00