Commit Graph

391788 Commits

Author SHA1 Message Date
Nikita Popov e638a290f7 [ConstantFold] Delay fetching pointer element type
Don't do this while stipping pointer casts, instead fetch it at
the end. This improves compatibility with opaque pointers for the
case where the base object is not opaque.
2021-06-22 15:51:00 +02:00
Nikita Popov 87bdde4962 [ConstantFold] Skip bitcast -> GEP transform for opaque pointers
Same as with the InstCombine transform, this is not possible for
bitcasts involving opaque pointers, as GEP preserves opaqueness.
2021-06-22 15:50:55 +02:00
AndreyChurbanov 5dd4d0d46f [OpenMP] libomp: fix dynamic loop dispatcher
Restructured dynamic loop dispatcher code.
Fixed use of dispatch buffers for nonmonotonic dynamic (static_steal) schedule:
- eliminated possibility of stealing iterations of the wrong loop when victim
  thread changed its buffer to work on another loop;
- fixed race when victim thread changed its buffer to work in nested parallel;
- eliminated "static" property of the schedule, that is now a single thread can
  execute whole loop.

Differential Revision: https://reviews.llvm.org/D103648
2021-06-22 16:29:01 +03:00
Butygin 82c1fb5750 [mlir] Fix invalid handling of AllocOp symbolOperands by SimplifyAllocConst.
symbolOperands were completely ignored by SimplifyAllocConst. Also, slightly improved diagnostic message for verifyAllocLikeOp.

Differential Revision: https://reviews.llvm.org/D104260
2021-06-22 15:39:53 +03:00
Pushpinder Singh 9d110f9159 [AMDGPU][Libomptarget] Move allow_access_to_all_gpu_agents to rtl.cpp
Moving this method helps eliminate a use of g_atl_machine.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D104691
2021-06-22 11:44:52 +00:00
Raphael Isemann c462048cc4 [lldb][NFC] Use SubsystemRAII in XcodeSDKModuleTests 2021-06-22 13:41:01 +02:00
Thomas Johnson 2ef1fbfe0e Add norm sub-target feature to table gen for ARC
This adds the `norm` sub-target feature (without backing implementation for now) to table gen.

Differential Revision: https://reviews.llvm.org/D104558
2021-06-22 14:39:29 +03:00
Muhammad Omair Javaid 28058d4cd1 [LLDB] Skip TestExitDuringExpression on aarch64/linux buildbot
TestExitDuringExpression test_exit_before_one_thread_no_unwind fails
sporadically on both Arm and AArch64 linux buildbots. This seems like
manifesting itself on a fully loaded machine. I have not found a reliable
timeout value so marking it skip for now.
2021-06-22 16:22:48 +05:00
Stephan Herhut bb6afc69b2 [mlir][memref] Add memref.copy operation
As the name suggests, it copies from one memref to another.

Differential Revision: https://reviews.llvm.org/D104657
2021-06-22 13:21:44 +02:00
Florian Hahn d17798823c
[SCEV] Retain AddExpr flags when subtracting a foldable constant.
Currently we drop wrapping flags for expressions like (A + C1)<flags> - C2.

But we can retain flags under certain conditions:

* Adding a smaller constant is NUW if the original AddExpr was NUW.

* Adding a constant with the same sign and small magnitude is NSW, if the
  original AddExpr was NSW.

This can improve results after using `SimplifyICmpOperands`, which may
subtract one in order to use stricter predicates, as is the case for
`isKnownPredicate`.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D104319
2021-06-22 11:27:51 +01:00
Raphael Isemann 98e2b1a8dd [lldb] Adjust Clang version requirements for tail_call_frames tests
Those tests are all failing for older Clang versions. This is adding the
respective test decorators for the passing Clang versions to get the recently
revived matrix bot green.
2021-06-22 12:22:15 +02:00
Nico Weber d6565a2dbc [lld/mac] Add explicit "no unwind info" entries for functions without unwind info
Fixes PR50529. With this, lld-linked Chromium base_unittests passes on arm macs.

Surprisingly, no measurable impact on link time.

Differential Revision: https://reviews.llvm.org/D104681
2021-06-22 06:12:42 -04:00
Raphael Isemann 35cf5b1097 [lldb] Bumb Clang version requirement for TestBasicEntryValues.py to 11
The test only passes with Clang>=11 so adjust the decorator.

Failure output for Clang 10 is:

--- FileCheck trace (code=1) ---
FileCheck main.cpp -check-prefix=FUNC1-GNU

FileCheck input:
      Address: a.out[0x0000000000401127] (a.out.PT_LOAD[1]..text + 263)
      Summary: a.out`func1(int&) + 23 at main.cpp:25:1
       Module: file = "functionalities/param_entry_vals/basic_entry_values/BasicEntryValues_GNU.test_dwo/a.out", arch = "x86_64"
  CompileUnit: id = {0x00000000}, file = "functionalities/param_entry_vals/basic_entry_values/main.cpp", language = "c++11"
     Function: id = {0x400000000000010a}, name = "func1(int&)", mangled = "_Z5func1Ri", range = [0x0000000000401110-0x0000000000401129)
     FuncType: id = {0x400000000000010a}, byte-size = 0, decl = main.cpp:13, compiler_type = "void (int &)"
       Blocks: id = {0x400000000000010a}, range = [0x00401110-0x00401129)
    LineEntry: [0x0000000000401127-0x0000000000401130): functionalities/param_entry_vals/basic_entry_values/main.cpp:25:1
       Symbol: id = {0x0000002c}, range = [0x0000000000401110-0x0000000000401129), name="func1(int&)", mangled="_Z5func1Ri"

FileCheck output:

functionalities/param_entry_vals/basic_entry_values/main.cpp:23:16: error: FUNC1-GNU: expected string not found in input
 // FUNC1-GNU: name = "sink", type = "int &", location = DW_OP_GNU_entry_value
2021-06-22 11:58:05 +02:00
Martin Storsjö 703b0ed8e2 [ADT] Add StringRef consume_front_lower and consume_back_lower
These serve as a convenient combination of consume_front/back and
startswith_lower/endswith_lower, consistent with other existing
case insensitive methods named <operation>_lower.

Differential Revision: https://reviews.llvm.org/D104218
2021-06-22 12:38:08 +03:00
Graham Hunter c6a91ee6aa [Clang][OpenMP] Monotonic does not apply to SIMD
The codegen for simd constructs was affected by the presence (or
absence) of the 'monotonic' schedule modifier for worksharing
loops. The modifier is only intended to apply to the scheduling of
chunks for a thread, not iterations of a loop inside a chunk.

In addition, the monotonic modifier was applied to worksharing loops
by default if no schedule clause was present; the referenced part of
the OpenMP 4.5 spec in the code (section 2.7.1) only applies if the
user specified a schedule clause with a static kind but no modifier.
Without a user-specified schedule clause we should default to
nonmonotonic scheduling.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D103793
2021-06-22 10:24:11 +01:00
Nikita Popov 04395fd6cb [ConstantFolding] Separate conditions in GEP evaluation (NFC)
Handle to gep p, 0-v case separately, and not as part of the loop
that ensures all indices are constant integers. Those two things
are not really related.
2021-06-22 11:14:47 +02:00
Balázs Kéri d7227a5bc7 [clang][Analyzer] Track null stream argument in alpha.unix.Stream .
The checker contains check for passing a NULL stream argument.
This change should make more easy to identify where the passed pointer
becomes NULL.

Reviewed By: NoQ

Differential Revision: https://reviews.llvm.org/D104640
2021-06-22 11:16:56 +02:00
Matthias Springer 060208b4c8 [mlir][NFC] Move SubTensorOp and SubTensorInsertOp to TensorDialect
The main goal of this commit is to remove the dependency of Standard dialect on the Tensor dialect.

* Rename SubTensorOp -> tensor.extract_slice, SubTensorInsertOp -> tensor.insert_slice.
* Some helper functions are (already) duplicated between the Tensor dialect and the MemRef dialect. To keep this commit smaller, this will be cleaned up in a separate commit.
* Additional dialect dependencies: Shape --> Tensor, Tensor --> Standard
* Remove dialect dependencies: Standard --> Tensor
* Move canonicalization test cases to correct dialect (Tensor/MemRef).

Note: This is a fixed version of https://reviews.llvm.org/D104499, which was reverted due to a missing update to two CMakeFile.txt.

Differential Revision: https://reviews.llvm.org/D104676
2021-06-22 17:55:53 +09:00
Fraser Cormack c97cf73867 [Utils][vim] Add missing highlights for fast-math flags
This patch adds the `afn`, `contract`, and `reassoc` fast-math flags.

It also fixes up `fneg`'s order in the alphabetized list.

Reviewed By: MaskRay, craig.topper

Differential Revision: https://reviews.llvm.org/D104541
2021-06-22 09:39:15 +01:00
Sander de Smalen bd7f7e2eba [GlobalISel] Add scalable property to LLT types.
This patch aims to add the scalable property to LLT. The rest of the
patch-series changes the interfaces to take/return ElementCount and
TypeSize, which both have the ability to represent the scalable property.

The changes are mostly mechanical and aim to be non-functional changes
for fixed-width vectors.

For scalable vectors some unit tests have been added, but no effort has
been put into making any of the GlobalISel algorithms work with scalable
vectors yet. That will be left as future work.

The work is split into a series of 5 patches to make reviews easier.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D104450
2021-06-22 08:43:34 +01:00
Bjorn Pettersson d919b73564 [NewPM] Print passes with params when using "opt -print-passes"
Make sure we also print passes with params when using "opt -print-passes".

Differential Revision: https://reviews.llvm.org/D104625
2021-06-22 09:01:38 +02:00
Fangrui Song 3f873e9b51 [llvm-objcopy] Internalize some symbols 2021-06-21 23:49:25 -07:00
Tobias Gysi 4882cacf12 [mlir][linalg] Adapt FillOp to use a scalar operand.
Adapt the FillOp definition to use a scalar operand instead of a capture. This patch is a follow up to https://reviews.llvm.org/D104109. As the input operands are in front of the output operands the patch changes the internal operand order of the FillOp. The pretty printed version of the operation remains unchanged though. The patch also adapts the linalg to standard lowering to ensure the c signature of the FillOp remains unchanged as well.

Differential Revision: https://reviews.llvm.org/D104121
2021-06-22 06:44:52 +00:00
Fangrui Song f14e6e4451 [llvm-objcopy] Delete empty namespace. NFC 2021-06-21 23:44:07 -07:00
Max Kazantsev 4c4f1ae93e Re-land "[LoopDeletion] Handle Phis with similar inputs from different blocks"
Patch was reverted due to a bug that existed before it and was exposed
by it. Returning after the underlying bug has been fixed.

Differential Revision: https://reviews.llvm.org/D103959
2021-06-22 12:28:46 +07:00
Max Kazantsev 575253887b [LoopDeletion] Require loop to have a predecessor when executing 1st iteration symbolically
Two predecessors break the further logic, and the loop may come to the
opt in non-canonicalized state.
2021-06-22 12:20:55 +07:00
Heejin Ahn 1c7b841088 [WebAssembly] Make tag attribute's encoding uint8
This changes the encoding of the `attribute` field, which currently only
contains the value `0` denoting this tag is for an exception, from
`varuint32` to `uint8`. This field is effectively unused at the moment
and reserved for future use, and it is not likely to need `varuint32`
even in future.
See https://github.com/WebAssembly/exception-handling/pull/162.

This does not change any encoded binaries because `0` is encoded in the
same way both in `varuint32` and `uint8`.

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D104571
2021-06-21 21:22:39 -07:00
Walter Erquinigo bff2b9adbc Retry of [lldb-vscode] only report long running progress events
This time adding a check that should prevent the crash found in
https://lab.llvm.org/buildbot/#/builders/68/builds/14182/steps/6/logs/stdio

Differential Revision: https://reviews.llvm.org/D101128
2021-06-21 20:33:09 -07:00
Matthias Springer 2ba387a316 [mlir][linalg] Fusion of PadTensorOp
Note: This commit (and previous ones) implements the same functionality as https://reviews.llvm.org/D103243 (which is abandoned).

Differential Revision: https://reviews.llvm.org/D104683
2021-06-22 11:48:49 +09:00
Walter Erquinigo f84615a5a5 Revert "[lldb-vscode] only report long running progress events"
This reverts commit 610d474cfd.

lldb-vscode is crashing.
2021-06-21 19:42:34 -07:00
Walter Erquinigo 2e11f4e068 [lldb-vscode] Add simple DAP logs dump to investigate flakiness in tests
A few times tests have been flaky, presumably by crashed of lldb-vscode
itself. They can be caught by looking at the DAP logs, so I'm dumping
them when the session ends.
2021-06-21 19:35:05 -07:00
Walter Erquinigo 610d474cfd [lldb-vscode] only report long running progress events
When the number of shared libs is massive, there could be hundreds of
thousands of short lived progress events sent to the IDE, which makes it
irresponsive while it's processing all this data. As these small jobs
take less than a second to process, the user doesn't even see them,
because the IDE only display the progress of long operations. So it's
better not to send these events.

I'm fixing that by sending only the events that are taking longer than 5
seconds to process.
In a specific run, I got the number of events from ~500k to 100, because
there was only 1 big lib to parse.

I've tried this on several small and massive targets, and it seems to
work fine.

Differential Revision: https://reviews.llvm.org/D101128
2021-06-21 19:35:05 -07:00
Eli Friedman 74909e4b6e Rename MachineMemOperand::getOrdering -> getSuccessOrdering.
Since this method can apply to cmpxchg operations, make sure it's clear
what value we're actually retrieving.  This will help ensure we don't
accidentally ignore the failure ordering of cmpxchg in the future.

We could potentially introduce a getOrdering() method on AtomicSDNode
that asserts the operation isn't cmpxchg, but not sure that's
worthwhile.

Differential Revision: https://reviews.llvm.org/D103338
2021-06-21 16:49:27 -07:00
Vitaly Buka ac15a128d8 [NFC] Add getUnderlyingObjects test
Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D104585
2021-06-21 16:36:50 -07:00
Eli Friedman 8f3d16905d [ScalarEvolution] Ensure backedge-taken counts are not pointers.
A backedge-taken count doesn't refer to memory; returning a pointer type
is nonsense. So make sure we always return an integer.

The obvious way to do this would be to just convert the operands of the
icmp to integers, but that doesn't quite work out at the moment:
isLoopEntryGuardedByCond currently gets confused by ptrtoint operations.
So we perform the ptrtoint conversion late for lt/gt operations.

The test changes are mostly innocuous. The most interesting changes are
more complex SCEV expressions of the form "(-1 * (ptrtoint i8* %ptr to
i64)) + %ptr)". This is expected: we can't fold this to zero because we
need to preserve the pointer base.

The call to isLoopEntryGuardedByCond in howFarToZero is less precise
because of ptrtoint operations; this shows up in the function
pr46786_c26_char in ptrtoint.ll. Fixing it here would require more
complex refactoring.  It should eventually be fixed by future
improvements to isImpliedCond.

See https://bugs.llvm.org/show_bug.cgi?id=46786 for context.

Differential Revision: https://reviews.llvm.org/D103656
2021-06-21 16:24:16 -07:00
Rob Suderman ad1a9d629b [mlir][tosa] Enable tosa.div for TosaMakeBroadcastable
TosaMakeBroadcastable needs to include tosa.div, which was added later in the
specification.

Reviewed By: sjarus, NatashaKnk

Differential Revision: https://reviews.llvm.org/D104157
2021-06-21 16:12:11 -07:00
Greg Clayton 4181bfe688 Clarify the "env" launch configuration setting.
A few users recently were trying to set environment values when using lldb-vscode and were unsure of the format of the "env" launch configuration setting. Clarify the exact format as when users add the "env" launch config setting, they can see this help string in the IDE.

Differential Revision: https://reviews.llvm.org/D104578
2021-06-21 16:11:16 -07:00
Nick Desaulniers 8ace121305 [IR] convert warn-stack-size from module flag to fn attr
Otherwise, this causes issues when building with LTO for object files
that use different values.

Link: https://github.com/ClangBuiltLinux/linux/issues/1395

Reviewed By: dblaikie, MaskRay

Differential Revision: https://reviews.llvm.org/D104342
2021-06-21 15:09:25 -07:00
Andrew Browne 759e797767 [DFSan][NFC] Refactor Origin Address Alignment code.
Reviewed By: stephan.yichao.zhao

Differential Revision: https://reviews.llvm.org/D104565
2021-06-21 14:52:02 -07:00
Rong Xu 8c68eb8306 [SampleFDO] Make FSDiscriminator flag part of function parameters
Add a parameter of IsFSDiscriminator to function
getBaseDiscriminatorFromDiscriminator().

This function currently checks the internal flag of
--enable-fs-discriminator. This is not good because we might
change the default value of the internal flag.

Note that we have a default parameter. This is just
because create_afdo_tool has a call-site to it.
I will remove the default parameter in a later patch.

Differential Revision: https://reviews.llvm.org/D104584
2021-06-21 14:37:45 -07:00
Eli Friedman bf0d0671a1 [ARM] Make sure we don't transform unaligned store to stm on Thumb1.
This isn't likely to come up in practice; the combination of compiler
flags required to hit this issue should be rare. Found by inspection.
2021-06-21 14:32:42 -07:00
Fangrui Song c618692218 [AArch64][X86] Allow 64-bit label differences lower to IMAGE_REL_*_REL32
`IMAGE_REL_ARM64_REL64/IMAGE_REL_AMD64_REL64` do not exist and `.quad a - .` is
currently not representable.

For instrumentation, `.quad a - .` is useful representing a cross-section
reference in a metadata section, to allow ELF medium/large code models. The COFF
limitation makes such generic instrumentations inconvenient. I plan to make a
PGO/coverage metadata section field relative in D104556.

Differential Revision: https://reviews.llvm.org/D104564
2021-06-21 14:32:25 -07:00
Jinsong Ji 3996311ee1 [DAGCombine] reassoc flag shouldn't enable contract
According to IR LangRef, the FMF flag:

contract
Allow floating-point contraction (e.g. fusing a multiply followed by an
addition into a fused multiply-and-add).

reassoc
Allow reassociation transformations for floating-point instructions.
This may dramatically change results in floating-point.

My understanding is that these two flags shouldn't imply each other,
as we might have a SDNode that can be reassociated with others, but
not contractble.

eg: We may want following fmul/fad/fsub to freely reassoc, but don't
want fma being generated here.

   %F = fmul reassoc double %A, %B         ; <double> [#uses=1]
   %G = fmul reassoc double %C, %D         ; <double> [#uses=1]
   %H = fadd reassoc double %F, %G         ; <double> [#uses=1]
   %I = fsub reassoc double %H, %E         ; <double> [#uses=1]

Before https://reviews.llvm.org/D45710, `reassoc` flag actually
did not imply isContratable either.

The current implementation also only check the flag in fadd node,
ignoring fmul node, this patch update that as well.

Reviewed By: spatel, qiucf

Differential Revision: https://reviews.llvm.org/D104247
2021-06-21 21:15:43 +00:00
Joel E. Denny 2bfe0536e5 [UpdateCCTestChecks] Fix --replace-value-regex across RUN lines
Without this patch, llvm/utils/update_cc_test_checks.py fails to
perform `--replace-value-regex` replacements when two RUN lines
produce the same output and use the same single FileCheck prefix.  The
problem is that replacements in a RUN line's output are not performed
until after comparing against previous RUN lines' output, where
replacements have already been performed.  This patch fixes that.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D104566
2021-06-21 17:01:17 -04:00
Roman Lebedev 4cf74469a0
[NFC][SimplifyCFG] Add basic test for debuginfo preservation of `ret` tail merging 2021-06-21 23:56:54 +03:00
Roman Lebedev 3e98b88797
[NFC][SimplifyCFG] Fix tests to use FileCheck instead of grep 2021-06-21 23:56:54 +03:00
Alexey Bataev c5bbc737e8 [SLP][NFC]Rename functions in the tests, NFC. 2021-06-21 13:37:12 -07:00
Erich Keane b3634d3e88 Revert "[SYCL][NFC] Ensure SYCL kernel for unique-stable-name is unqualified."
This reverts commit 5013131875.

This patch didn't end up being the solution to the problem.  It "fixed"
our issue but the actual correct solution is something else.  Reverting
as this ends up being unnecessary/extra noise.
2021-06-21 13:23:52 -07:00
Louis Dionne 9b371f5da4 [libc++] NFC: Fix outdated comment about secrets.env
That file (secrets.env) has now been removed, so the comment was
referencing something that didn't exist anymore.
2021-06-21 16:22:26 -04:00
Nikita Popov 39796e1ad0 Reapply [InstCombine] Don't try converting opaque pointer bitcast to GEP
Reapplied without changes -- this was reverted together with an
underlying patch.

-----

Bitcasts having opaque pointer source or result type cannot be
converted into a zero-index GEP, GEP source and result types
always have the same opaque-ness.
2021-06-21 22:15:56 +02:00