Kazu Hirata [Wed, 27 Oct 2021 16:22:31 +0000 (09:22 -0700)]
[X86] Remove getSETOpc (NFC)
This function seems to be unused for at least one year.
Kazu Hirata [Wed, 27 Oct 2021 16:22:29 +0000 (09:22 -0700)]
[X86] Remove NeedsRetpoline in X86AsmPrinter (NFC)
This field seems to be unused for at least one year.
Kazu Hirata [Wed, 27 Oct 2021 16:22:27 +0000 (09:22 -0700)]
[X86] Remove CallOperand in X86Operand (NFC)
This field seems to be unused for at least one year.
Dmitry Vyukov [Wed, 27 Oct 2021 16:01:38 +0000 (18:01 +0200)]
sanitizer_common: fix up onprint.cpp test
Commit D112602 ("sanitizer_common: tighten on_print hook test")
changed fopen to open in this test. fopen created the file
if if does not exist, but open does not. This was unnoticed
during local testing because lit is not hermetic and reuses
files from previous runs, but it started failing on bots.
Fix the open call.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112630
Mikhail Dvorskiy [Wed, 27 Oct 2021 15:51:36 +0000 (18:51 +0300)]
[pstl] A hot fix for a reduction parallel pattern of OpenMP backend
Reviewed By: nadiasvertex, ldionne
Differential Revision: https://reviews.llvm.org/D112125
Alexey Bataev [Mon, 25 Oct 2021 14:32:35 +0000 (07:32 -0700)]
[SLP]Improve/fix reordering of the gathered graph nodes.
Gathered loads/extractelements/extractvalue instructions should be
checked if they can represent a vector reordering node too and their
order should ve taken into account for better graph reordering analysis/
Also, if the gather node has reused scalars, they must be reordered
instead of the scalars themselves.
Differential Revision: https://reviews.llvm.org/D112454
Raphael Isemann [Wed, 27 Oct 2021 15:42:57 +0000 (17:42 +0200)]
[lldb][NFC] Move a declaration in DWARFASTParserClang to its first use.
Djordje Todorovic [Wed, 27 Oct 2021 15:36:05 +0000 (17:36 +0200)]
[llvm-locstats] Move the test from D110621 into test/llvm-locstats/ dir
Aaron Ballman [Wed, 27 Oct 2021 15:24:00 +0000 (11:24 -0400)]
Fix consteval crash when transforming 'this' expressions
When reaching the end of a function body, we need to ensure that the
ExitFunctionBodyRAII object is destroyed before we pop the declaration context
for the function. Exiting the function body causes us to handle immediate
invocations, which involves template transformations that need to know the
correct type for this.
This addresses PR48235.
Gabor Marton [Fri, 22 Oct 2021 08:12:38 +0000 (10:12 +0200)]
[Analyzer][solver] Handle adjustments in constraint assignor remainder
We can reuse the "adjustment" handling logic in the higher level
of the solver by calling `State->assume`.
Differential Revision: https://reviews.llvm.org/D112296
David Sherwood [Fri, 15 Oct 2021 11:54:58 +0000 (12:54 +0100)]
[NFC][LoopVectorize] Change getStepVector to take a Value* for the StartIdx
This patch changes the definition of getStepVector from:
Value *getStepVector(Value *Val, int StartIdx, Value *Step, ...
to
Value *getStepVector(Value *Val, Value *StartIdx, Value *Step, ...
because:
1. it seems inconsistent to pass some values as Value* and some as
integer, and
2. future work will require the StartIdx to be an expression made up
of runtime calculations of the VF.
In widenIntOrFpInduction I've changed the code to pass in the
value returned from getRuntimeVF, but the presence of the assert:
assert(!VF.isScalable() && "scalable vectors not yet supported.");
means that currently this code path is only exercised for fixed-width
VFs and so the patch is still NFC.
Differential revision: https://reviews.llvm.org/D111882
Roman Lebedev [Wed, 27 Oct 2021 14:31:29 +0000 (17:31 +0300)]
[IR] `IRBuilderBase::CreateAnd()`: short-circuit `x & 0` --> `0`
https://alive2.llvm.org/ce/z/YzPhSb
Refs. https://reviews.llvm.org/D109368#3089809
Roman Lebedev [Wed, 27 Oct 2021 14:04:07 +0000 (17:04 +0300)]
[IR] `IRBuilderBase::CreateAnd()`: fix short-circuiting for constant on LHS
Refs. https://reviews.llvm.org/D109368#3089809
Roman Lebedev [Wed, 27 Oct 2021 13:38:01 +0000 (16:38 +0300)]
[IR] `IRBuilderBase::CreateOr()`: fix short-circuiting for constant on LHS
There is no guarantee that the constant is on RHS here,
we have to handle both cases.
Refs. https://reviews.llvm.org/D109368#3089809
Roman Lebedev [Wed, 27 Oct 2021 13:05:09 +0000 (16:05 +0300)]
[IR] `IRBuilderBase::CreateSelect()`: if cond is a constant i1, short-circuit
While we could emit such a tautological `select`,
it will stick around until the next instsimplify invocation,
which may happen after we count the cost of this redundant `select`.
Which is precisely what happens with loop vectorization legality checks,
and that artificially increases the cost of said checks,
which is bad.
There is prior art for this in `IRBuilderBase::CreateAnd()`/`IRBuilderBase::CreateOr()`.
Refs. https://reviews.llvm.org/D109368#3089809
Roman Lebedev [Wed, 27 Oct 2021 12:58:40 +0000 (15:58 +0300)]
[NFC] Re-autogenerate check lines in some tests to ease of future update
Gabor Marton [Mon, 25 Oct 2021 16:10:12 +0000 (18:10 +0200)]
[Analyzer][solver] Simplification: reorganize equalities with adjustment
Initiate the reorganization of the equality information during symbol
simplification. E.g., if we bump into `c + 1 == 0` during simplification
then we'd like to express that `c == -1`. It makes sense to do this only
with `SymIntExpr`s.
Reviewed By: steakhal
Differential Revision: https://reviews.llvm.org/D111642
OCHyams [Wed, 27 Oct 2021 14:27:16 +0000 (15:27 +0100)]
[dexter] Fix failing regression tests
D109833 makes the flags `--builder` and `--binary` mutually exclusive, which
caused some regression tests to fail. Add a new substitution
`%dexter_regression_base` that doesn't include the `--builder`, `--cflags` or
`--ldflags` flags and use that for tests that use the `--binary` flag.
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D112624
Alexey Bataev [Wed, 27 Oct 2021 14:31:36 +0000 (07:31 -0700)]
Revert "[SLP]Improve/fix reordering of the gathered graph nodes."
This reverts commit
f719b794bcaa1df8fa82659d6d4e754c77d2f94e to fix
instability in tests.
AndreyChurbanov [Wed, 27 Oct 2021 13:54:25 +0000 (16:54 +0300)]
[OpenMP][NFC] disable test on power because of -mlong-double-80 option
AndreyChurbanov [Wed, 27 Oct 2021 13:38:09 +0000 (16:38 +0300)]
[OpenMP] libomp: Fix possible NULL dereference.
According to dlsym description, the value of symbol could be NULL,
and there is no error in this case. Thus dlerror will also return NULL in
this case. We need to check the value returned by dlerror before printing it.
Differential Revision: https://reviews.llvm.org/D112174
Nico Weber [Wed, 27 Oct 2021 13:52:17 +0000 (09:52 -0400)]
fix comment typos to cycle bots
Nico Weber [Wed, 27 Oct 2021 13:37:45 +0000 (09:37 -0400)]
[gn build] Use LLD as host linker by default on macOS if clang_base_path is set
lld/mac should be stable enough to use it as host linker. I've been
using `use_lld=true` in my local args.gn for many months now and it
works fine (and links much faster than ld64).
Differential Revision: https://reviews.llvm.org/D112622
Nico Weber [Wed, 27 Oct 2021 13:43:42 +0000 (09:43 -0400)]
fix comment typos to cycle bots
Nico Weber [Wed, 27 Oct 2021 13:34:25 +0000 (09:34 -0400)]
[gn build] Add lldb to default target on Windows
It seems to build fine (even though some tests fail), so might
as well let the bots build it. If it turns out to break a lot,
we can always turn it back off.
Differential Revision: https://reviews.llvm.org/D112620
Jeremy Morse [Wed, 27 Oct 2021 13:19:16 +0000 (14:19 +0100)]
[DebugInfo][NFC] Initialize a new object field in unittests
Over in
e7084ceab3122 the InstrRefBasedLDV class grew a MachineRegisterInfo
pointer to lookup register sizes -- however, that field wasn't initialized
in the corresponding unit tests. This patch initializes it!
Fixes a buildbot failure reported on D112006
Kerry McLaughlin [Tue, 26 Oct 2021 09:37:52 +0000 (10:37 +0100)]
[SVE][CodeGen] Fix incorrect legalisation of zero-extended masked loads
PromoteIntRes_MLOAD always sets the extension type to `EXTLOAD`, which
results in a sign-extended load. If the type returned by getExtensionType()
for the load being promoted is something other than `NON_EXTLOAD`, we
should instead pass this to getMaskedLoad() as the extension type.
Reviewed By: CarolineConcatto
Differential Revision: https://reviews.llvm.org/D112320
Dmitry Vyukov [Wed, 27 Oct 2021 08:42:26 +0000 (10:42 +0200)]
sanitizer_common: tighten on_print hook test
The new tsan runtime does not support arbitrary forms
of recursing into the runtime from hooks.
Disable instrumentation of the hook and use write instead
of fwrite (calls malloc internally).
The new version still recurses (write is intercepted),
but does not fail now (the issue at hand was malloc).
Depends on D112601.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112602
Dmitry Vyukov [Wed, 27 Oct 2021 08:57:42 +0000 (10:57 +0200)]
tsan: switch sync test from EXPECT to CHECK
Gtest's EXPECT calls whole lot of libc functions
(mem*, malloc) even when EXPECT does not fail.
This does not play well with tsan runtime unit tests
b/c e.g. we call some EXPECTs with runtime mutexes locked.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112601
Alexey Bataev [Mon, 25 Oct 2021 14:32:35 +0000 (07:32 -0700)]
[SLP]Improve/fix reordering of the gathered graph nodes.
Gathered loads/extractelements/extractvalue instructions should be
checked if they can represent a vector reordering node too and their
order should ve taken into account for better graph reordering analysis/
Also, if the gather node has reused scalars, they must be reordered
instead of the scalars themselves.
Differential Revision: https://reviews.llvm.org/D112454
Nico Weber [Wed, 27 Oct 2021 13:07:24 +0000 (09:07 -0400)]
[gn build] add build rule for llvm-locstats
Needed by tests after
30a3652b6ade.
Nico Weber [Tue, 26 Oct 2021 14:53:33 +0000 (10:53 -0400)]
[clang] Add range accessor for ObjCAtTryStmt catch_stmts and use it
No behavior change.
Differential Revision: https://reviews.llvm.org/D112543
Nico Weber [Tue, 26 Oct 2021 14:35:21 +0000 (10:35 -0400)]
[clang] Convert ObjCAtTryStmt to llvm::TrailingObjects
And make it final while here.
No behavior change.
Differential Revision: https://reviews.llvm.org/D112542
Caroline Concatto [Wed, 20 Oct 2021 21:38:02 +0000 (22:38 +0100)]
[SelectionDAG] Widening the result of INSERT_SUBVECTOR.
Widens the result and first input vector because they have the same size.
The subvector to be inserted is widened in the operand widen function.
Differential Revision: https://reviews.llvm.org/D112187
Nikita Popov [Mon, 25 Oct 2021 13:47:21 +0000 (15:47 +0200)]
[BasicAA] Handle known bits as ranges
BasicAA currently tries to determine that the offset is positive by
checking whether all variable indices are positive based on known
bits, multiplied by a positive scale. However, this is incorrect
if the scale multiplication might overflow. In the modified test
case the original value is positive, but may be negative after a
left shift.
Fix this by converting known bits into a constant range and reusing
the range-based logic, which handles overflow correctly.
Differential Revision: https://reviews.llvm.org/D112611
djtodoro [Fri, 15 Oct 2021 11:00:04 +0000 (13:00 +0200)]
[llvm-locstats] Report a warning if overflow was detected by llvm-dwarfdump
Catch that llvm-dwarfdump detected an overflow in statistics.
Differential Revision: https://reviews.llvm.org/D110621
Daniel Kiss [Wed, 27 Oct 2021 12:29:35 +0000 (14:29 +0200)]
Revert "[ARM] __cxa_end_cleanup should be called instead of _UnwindResume."
This reverts commit
da1d1a08694bbfe0ea7a23ea094612436e8a2dd0.
Jan Svoboda [Wed, 27 Oct 2021 11:57:35 +0000 (13:57 +0200)]
[clang][deps] Fix fragile test
This test was failing on GreenDragon.
Caitlyn Cano [Thu, 1 Jul 2021 20:41:51 +0000 (20:41 +0000)]
[mlir] gen_spirv_dialect.py: Some support for OCL ops generation
It is not complete and disabled by default, but it can be still useful.
Differential Revision: https://reviews.llvm.org/D111886
Sanjay Patel [Wed, 27 Oct 2021 11:53:14 +0000 (07:53 -0400)]
[x86] enhance mayFoldLoad to check alignment
As noted in D112464, a pre-AVX target may not be able to fold an
under-aligned vector load into another op, so we shouldn't report
that as a load folding candidate. I only found one caller where
this would make a difference -- combineCommutableSHUFP() -- so
that's where I added a test to show the (minor) regression.
Differential Revision: https://reviews.llvm.org/D112545
Kirill Bobyrev [Wed, 27 Oct 2021 11:52:44 +0000 (13:52 +0200)]
[clangd] NFC: Remove single-line braces in IncludeCleaner
Michał Górny [Wed, 27 Oct 2021 11:31:35 +0000 (13:31 +0200)]
[lldb] [docs] Remove obsolete recommonmark use
The recommonmark package is no longer required since all the documents
have been converted to .rst. Remove the related support code from
docs/conf.py.
Differential Revision: https://reviews.llvm.org/D112612
Matt [Tue, 12 Oct 2021 10:18:59 +0000 (10:18 +0000)]
[AArch64][SVE] Combine predicated FMUL/FADD into FMA
Combine FADD and FMUL intrinsics into FMA when the result of the FMUL is an FADD operand
with one only use and both use the same predicate.
Differential Revision: https://reviews.llvm.org/D111638
Alexandros Lamprineas [Mon, 20 Sep 2021 10:49:30 +0000 (11:49 +0100)]
[AArch64] Add support for the 'R' architecture profile.
This change introduces subtarget features to predicate certain
instructions and system registers that are available only on
'A' profile targets. Those features are not present when
targeting a generic CPU, which is the default processor.
In other words the generic CPU now means the intersection of
'A' and 'R' profiles. To maintain backwards compatibility we
enable the features that correspond to -march=armv8-a when the
architecture is not explicitly specified on the command line.
References: https://developer.arm.com/documentation/ddi0600/latest
Differential Revision: https://reviews.llvm.org/D110065
Alexey Bataev [Tue, 26 Oct 2021 14:12:45 +0000 (07:12 -0700)]
[SLP]Fix logical and/or reductions.
Need to emit select(cmp) instructions for poison-safe forms of select
ops. Currently alive reports that `Target is more poisonous than source`
for operations we generating for such instructions.
https://alive2.llvm.org/ce/z/FiNiAA
Differential Revision: https://reviews.llvm.org/D112562
Vignesh Balasubramanian [Wed, 27 Oct 2021 10:49:07 +0000 (16:19 +0530)]
[OpenMP][OMPD] Implementation of OMPD debugging library - libompd.
This is a continuation of the review: https://reviews.llvm.org/D100183
It contains routines that retrieve OpenMP ICV values for OMPD.
Reviewed By: @hbae
Differential Revision: https://reviews.llvm.org/D100184
Pavel Labath [Wed, 27 Oct 2021 10:47:11 +0000 (12:47 +0200)]
[lldb] Modernize TestVLA.py
Use expect_expr/var_path instead of regular expect and substring checks
Michał Górny [Mon, 25 Oct 2021 20:55:48 +0000 (22:55 +0200)]
[lldb] [Host/ConnectionFileDescriptor] Refactor to improve code reuse
Refactor ConnectionFileDescriptor to improve code reuse for different
types of sockets. Unify method naming.
While at it, remove some (now-)dead code from Socket.
Differential Revision: https://reviews.llvm.org/D112495
Nikita Popov [Mon, 25 Oct 2021 16:47:51 +0000 (18:47 +0200)]
[BasicAA] Make range check more precise
Make the range check more precise by calculating the range of
potentially accessed bytes for both accesses and checking whether
their intersection is empty. In that case there can be no overlap
between the accesses and the result is NoAlias.
This is more powerful than the previous approach, because it can
deal with sign-wrapped ranges. In the test case the original range
is [-1, INT_MAX] but becomes [0, INT_MIN] after applying the offset.
This is a wrapping range, so getSignedMin/getSignedMax will treat
it as a full range. However, the range excludes the elements
[INT_MIN+1, -1], which is enough to prove NoAlias with an access
at offset -1.
Differential Revision: https://reviews.llvm.org/D112486
Roman Lebedev [Wed, 27 Oct 2021 09:48:16 +0000 (12:48 +0300)]
[NFC][LV][X86] Improve test coverage for masked mem ops
Eugene Zhulenev [Wed, 27 Oct 2021 10:18:47 +0000 (03:18 -0700)]
[mlir] Reduce the number of iterations in async microbenchmarks
Differential Revision: https://reviews.llvm.org/D112609
Florian Hahn [Wed, 27 Oct 2021 10:15:58 +0000 (11:15 +0100)]
[DSE] Add test case with 2 memcpys that should not be eliminated.
Vassil Vassilev [Wed, 27 Oct 2021 10:11:29 +0000 (10:11 +0000)]
[clang-repl] Remove redundant link libraries and drop unused file.
Many thanks to @thakis for pointing this out.
That commit should have been a part of https://reviews.llvm.org/D107049
Mikhail Dvorskiy [Fri, 22 Oct 2021 15:58:06 +0000 (18:58 +0300)]
[pstl] A hot compilation fix for MacOS, OpenMP backend; + full qualified names for some internal functions
Reviewed By: nadiasvertex, ldionne
Differential Revision: https://reviews.llvm.org/D112528
Sam McCall [Tue, 26 Oct 2021 13:27:07 +0000 (15:27 +0200)]
[clangd] Add integration test for crash handling
This replaces the test removed in
51be7061d025139ba66869d5d99c7157a3ae9edd
It is more principled and tests more critical cases: a crash while parsing.
We need two pieces of plumbing:
- a way to re-enable the crashing #pragmas via a flag, to test parse crashes
- a bit of reshuffling around ASTWorker execution so that we set up the
crash handler in both sync/async modes.
Sync mode is useful for debugging, so I tested both.
Differential Revision: https://reviews.llvm.org/D112565
Kirill Bobyrev [Wed, 27 Oct 2021 09:50:35 +0000 (11:50 +0200)]
[clangd] IncludeCleaner: Don't warn on system headers
This is a temporary hack to disable diagnostics for system headers. As of right
now, IncludeCleaner does not handle the Standard Library correctly and will
report most system headers as unused because very few symbols are defined in
top-level system headers. This will eventually be fixed, but for now we are
aiming for the most conservative approach with as little false-positive
warnings as possible. After the initial prototype and core functionality is
polished, I will turn back to handling the Standard Library as it requires
custom logic.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D112571
Salman Javed [Wed, 27 Oct 2021 09:38:52 +0000 (22:38 +1300)]
[clang-tidy] Correct typo in bugprone-easily-swappable-parameters
The string table `DefaultIgnoredParameterTypeSuffixes` has a typo:
`ForwardIt` is mistyped as `FowardIt`.
Correct typo and add test coverage.
Differential Revision: https://reviews.llvm.org/D112596
Pavel Labath [Tue, 26 Oct 2021 08:52:39 +0000 (10:52 +0200)]
Modernize Platform::GetOSKernelDescription
Jay Foad [Mon, 27 Sep 2021 15:05:54 +0000 (16:05 +0100)]
[LiveInterval] Add RemoveDeadValNo argument to removeSegment(iterator)
Add an optional bool RemoveDeadValNo argument to the
removeSegment(iterator) overload, for consistency with the other
overloads. This gives clients a way to remove dead valnos while also
getting an updated iterator returned (in the manner of vector::erase).
Use this to clean up some inefficient code in
LiveIntervals::repairOldRegInRange. NFC.
Differential Revision: https://reviews.llvm.org/D110560
Daniel Kiss [Wed, 27 Oct 2021 08:32:11 +0000 (10:32 +0200)]
[ARM] __cxa_end_cleanup should be called instead of _UnwindResume.
ARM EHABI[1] specifies the __cxa_end_cleanup to be called after cleanup.
It will call the UnwindResume.
__cxa_begin_cleanup will be called from libcxxabi while __cxa_end_cleanup is never called.
This will trigger a termination when a foreign exception is processed while UnwindResume is called
because the global state will be wrong due to the missing __cxa_end_cleanup call.
Additional test here: D109856
[1] https://github.com/ARM-software/abi-aa/blob/main/ehabi32/ehabi32.rst#941compiler-helper-functions
Reviewed By: logan
Differential Revision: https://reviews.llvm.org/D111703
David Sherwood [Mon, 4 Oct 2021 16:31:35 +0000 (17:31 +0100)]
[NFC][LoopVectorize] Remove setBestPlan in favour of getBestPlanFor
I have removed LoopVectorizationPlanner::setBestPlan, since this
function is quite aggressive because it deletes all other plans
except the one containing the <VF,UF> pair required. The code is
currently written to assume that all <VF,UF> pairs will live in the
same vplan. This is overly restrictive, since scalable VFs live in
different plans to fixed-width VFS. When we add support for
vectorising epilogue loops when the main loop uses scalable vectors
then we will the vplan for the main loop will be different to the
epilogue.
Instead I have added a new function called
LoopVectorizationPlanner::getBestPlanFor
that returns the best vplan for the <VF,UF> pair requested and leaves
all the vplans untouched. We then pass this best vplan to
LoopVectorizationPlanner::executePlan
which now takes an additional VPlanPtr argument.
Differential revision: https://reviews.llvm.org/D111125
Matthias Springer [Wed, 27 Oct 2021 07:40:26 +0000 (16:40 +0900)]
[mlir][linalg][bufferize] Add analysis fuzzer option
Analyze ops in a pseudo-random order to see if any assertions are triggered. Randomizing the order of analysis likely worsens the quality of the bufferization result (more out-of-place bufferizations). However, assertions should never fail, as that would indicate a problem with our implementation.
Differential Revision: https://reviews.llvm.org/D112581
Shraiysh Vaishay [Wed, 27 Oct 2021 06:48:00 +0000 (12:18 +0530)]
[MLIR][OpenMP] Added omp.atomic.read and omp.atomic.write
This patch supports the atomic construct (read and write) following
section 2.17.7 of OpenMP 5.0 standard. Also added tests and
verifier for the same.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D111992
Kirill Bobyrev [Wed, 27 Oct 2021 08:30:03 +0000 (10:30 +0200)]
[clangd] IncludeCleaner: Support macros
Collect the macro definition locations for all the macros used in the main
file.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D112447
Nicolas Vasilache [Tue, 26 Oct 2021 21:13:11 +0000 (21:13 +0000)]
[mlir][Linalg] NFC - Add additional control to lower vector.shape_cast ops
This also moves some code to a new patterns file.
Differential Revision: https://reviews.llvm.org/D112575
Nicolas Vasilache [Wed, 27 Oct 2021 07:48:39 +0000 (07:48 +0000)]
[mlir][Vector] Add InsertStridedSliceOp -> ShuffleOp for the rank-1 cases.
This also fixes the vector.shuffle C++ builder which had an incorrect type assumption that triggers with this new rewrite.
The vector.shuffle semantics were correct though.
Differential revision: https://reviews.llvm.org/D112578
Kadir Cetinkaya [Tue, 26 Oct 2021 17:10:26 +0000 (19:10 +0200)]
[clangd] Fix filename ranges while replaying preamble
Clangd used first token of filename as filename range rather than the
synthezied filename token. Unfortunately the former only contains `"` or `<` in
the raw lexing mode, resulting in wrong range information and breaking tidy
checks that relied on it.
Fixes https://github.com/clangd/clangd/issues/896.
Differential Revision: https://reviews.llvm.org/D112559
Arthur Eubanks [Wed, 27 Oct 2021 06:41:02 +0000 (23:41 -0700)]
[InferAddressSpaces] Make pass work with opaque pointers
Avoid getPointerElementType().
Dmitry Vyukov [Tue, 26 Oct 2021 14:37:11 +0000 (16:37 +0200)]
tsan: tidy up SCOPED_INTERCEPTOR_RAW
Don't leak caller_pc var from the macro
(it's not supposed to be used by interceptors).
Use UNUSED instead of (void) cast.
Depends on D112540.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112541
Dmitry Vyukov [Tue, 26 Oct 2021 14:31:46 +0000 (16:31 +0200)]
tsan: remove real func check from interceptors
If the real function is not intercepted,
we are going to crash one way or another.
The question is just in the failure mode:
error message vs NULL deref. But the message
costs us a check in every interceptor and
they are not observed to be failing in real life
for a long time, also other sanitizers don't
have this check as well (also crash on
NULL deref if that happens).
Remove the check from non-debug mode.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112540
Kazu Hirata [Wed, 27 Oct 2021 06:38:14 +0000 (23:38 -0700)]
[Hexagon] Remove set-but-unused variables (NFC)
Pavel Labath [Thu, 21 Oct 2021 18:13:45 +0000 (20:13 +0200)]
Remove ConstString from Language, LanguageRuntime, SystemRuntime and SymbolFile plugin names
Phoebe Wang [Wed, 27 Oct 2021 05:58:31 +0000 (13:58 +0800)]
[X86][NFC] Add the missed `break;` for
79f9dfef0da5
Uday Bondhugula [Tue, 19 Oct 2021 07:19:01 +0000 (12:49 +0530)]
[Clang][NFC] Clang CUDA codegen clean-up
Update an instance of dyn_cast -> cast and other NFC clang-tidy fixes
for Clang CUDA codegen.
Differential Revision: https://reviews.llvm.org/D112284
Craig Topper [Wed, 27 Oct 2021 05:23:48 +0000 (22:23 -0700)]
[RISCV] Add ICmp and FCmp to shouldSinkOperands.
River Riddle [Wed, 27 Oct 2021 04:11:49 +0000 (04:11 +0000)]
Fix AffineDemotion pass after the DialectConversion change in D111620
Kazu Hirata [Wed, 27 Oct 2021 04:01:29 +0000 (21:01 -0700)]
[Utils] Fix a warning in DialectConversion.cpp
This patch fixes:
mlir/lib/Transforms/Utils/DialectConversion.cpp:2775:5: error:
default label in switch which covers all enumeration values
[-Werror,-Wcovered-switch-default]
by removing the default case. This way, the compiler should issue a
warning in the future when somebody adds a new enum value without a
corresponding case in the switch statement.
Lang Hames [Wed, 27 Oct 2021 01:32:06 +0000 (18:32 -0700)]
[JITLink] Fix element-present check in MachOLinkGraphParser.
Not all symbols are added to the index-to-symbol map, so we shouldn't use the
size of the map as a proxy for the highest valid index.
Lang Hames [Mon, 25 Oct 2021 22:06:45 +0000 (15:06 -0700)]
[ORC] Don't try to perform empty deallocations.
Jake Egan [Wed, 27 Oct 2021 03:42:15 +0000 (23:42 -0400)]
Generalize DWARF tests that expect DW_FORM_strp
The modified tests were failing on AIX because DWARF on AIX uses inline strings by default, but the tests check for `DW_FORM_strp`.
This patch removes `DW_FORM_strp` so both forms will pass the check.
Reviewed By: shchenz, dblaikie
Differential Revision: https://reviews.llvm.org/D112286
Max Kazantsev [Wed, 27 Oct 2021 02:28:45 +0000 (09:28 +0700)]
[SCEV][NFC] Verify intergity of SCEVUsers
Make sure that, for every living SCEV, we have all its direct
operand tracking it as their user.
Differential Revision: https://reviews.llvm.org/D112402
Reviewed By: reames
Ben Shi [Sun, 17 Oct 2021 12:27:57 +0000 (12:27 +0000)]
[RISCV] Optimize immediate materialisation with SLLI.UW in the Zba extension
Simplify "LUI+SLLI+ADDI+SLLI" and "LUI+ADDIW+SLLI+ADDI+SLLI" to
"LUI+ADDIW+SLLIUW" to reduce total instruction amount.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D111933
Ben Shi [Sat, 16 Oct 2021 09:06:14 +0000 (09:06 +0000)]
[RISCV][test] Add more tests of immediate materialisation
Reviewed By: craig.topper, MaskRay
Differential Revision: https://reviews.llvm.org/D111932
River Riddle [Wed, 27 Oct 2021 02:00:10 +0000 (02:00 +0000)]
[mlir:DialectConversion] Restructure how argument/target materializations get invoked
The current implementation invokes materializations
whenever an input operand does not have a mapping for the
desired type, i.e. it requires materialization at the earliest possible
point. This conflicts with goal of dialect conversion (and also the
current documentation) which states that a materialization is only
required if the materialization is supposed to persist after the
conversion process has finished.
This revision refactors this such that whenever a target
materialization "might" be necessary, we insert an
unrealized_conversion_cast to act as a temporary materialization.
This allows for deferring the invocation of the user
materialization hooks until the end of the conversion process,
where we actually have a better sense if it's actually
necessary. This has several benefits:
* In some cases a target materialization hook is no longer
necessary
When performing a full conversion, there are some situations
where a temporary materialization is necessary. Moving forward,
these users won't need to provide any target materializations,
as the temporary materializations do not require the user to
provide materialization hooks.
* getRemappedValue can now handle values that haven't been
converted yet
Before this commit, it wasn't well supported to get the remapped
value of a value that hadn't been converted yet (making it
difficult/impossible to convert multiple operations in many
situations). This commit updates getRemappedValue to properly
handle this case by inserting temporary materializations when
necessary.
Another code-health related benefit is that with this change we
can move a majority of the complexity related to materializations
to the end of the conversion process, instead of handling adhoc
while conversion is happening.
Differential Revision: https://reviews.llvm.org/D111620
River Riddle [Wed, 27 Oct 2021 01:59:45 +0000 (01:59 +0000)]
[NFC] Tidy up DialectConversion.cpp
This file has gotten a bit crusty over the years, and has outdated stylistic decisions.
Ben Shi [Tue, 26 Oct 2021 08:39:51 +0000 (08:39 +0000)]
[CUDA][NFC] Fix inexact warning message about lambdas
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D112521
Nico Weber [Wed, 27 Oct 2021 01:05:48 +0000 (21:05 -0400)]
Unbreak code_signature_lc.test on macOS after
911be05743eb606
Daniel Rodríguez Troitiño [Wed, 27 Oct 2021 00:03:08 +0000 (17:03 -0700)]
[test][objcopy] Replace GNU sed extension with BSD compatible syntax.
GNU sed offers the `,+4d` to delete the line a next four lines, but BSD
sed doesn't seem to support it (at least in macOS 10.15, but seems to do
in my 11.6 version).
Replace the usage of the extension with the equivalent syntax that works
both in BSD and GNU sed. I don't have a macOS 10.15 to check, but this
works in both my macOS 11.6 and Linux machines.
Differential Revision: https://reviews.llvm.org/D112583
Jacques Pienaar [Wed, 27 Oct 2021 00:35:16 +0000 (17:35 -0700)]
[mlir] Fix missing prefix for region accessor on OpAdaptor
Also flip op-decl-and-defs test to _Prefixed to test more.
Brad Smith [Wed, 27 Oct 2021 00:05:12 +0000 (20:05 -0400)]
[mlir] Avoid including <alloca.h> on OpenBSD
Luís Ferreira [Tue, 26 Oct 2021 23:23:27 +0000 (16:23 -0700)]
[Demangle] Add prepend functionality to OutputString
Implement the functionallity of prepend, required by D demangler.
Please read discussion https://reviews.llvm.org/D111414 for context.
See also https://reviews.llvm.org/D111947 .
Reviewed By: dblaikie, Geod24
Differential Revision: https://reviews.llvm.org/D111948
David Blaikie [Tue, 26 Oct 2021 23:19:38 +0000 (16:19 -0700)]
Add cross-project-test for simplified template name rebuilding
LLVM GN Syncbot [Tue, 26 Oct 2021 23:05:31 +0000 (23:05 +0000)]
[gn build] Port
566bfbb740bb
Jacques Pienaar [Tue, 26 Oct 2021 23:04:15 +0000 (16:04 -0700)]
[mlir][ods] Fix incorrect accessing of segment_sizes
The previous change resulted in prefixing a query that uses the raw
attribute as if function invocation. Fixing quickly, with updated test
to follow.
Jez Ng [Tue, 26 Oct 2021 22:40:20 +0000 (18:40 -0400)]
[lld-macho] Fix compact-unwind-bad-reloc.s test
Broken by
a9353dbe517c522ac63818de2cde645acdc46834.
Now that the functions point to the compact unwind entries, instead of
the other way around, we need to perform the "invalid reference" check
in a different place.
This change was originally part of the stacked diff D109946, but should
have been included as part of D109945.
David Blaikie [Tue, 26 Oct 2021 22:48:20 +0000 (15:48 -0700)]
llvm-dwarfdump --verify: Exit non-zero on simplified template name rebuilding failures
Nico Weber [Tue, 26 Oct 2021 22:40:07 +0000 (18:40 -0400)]
Reland "[gn build] (manually) port
6fe2beba7d2a (ExceptionTests)"
This reverts commit
e2a2e5475cbd370044474e132a1b5c58e6a3d458.
6fe2beba7d2a relanded (again) in
c24a58081b527fa8.
Rob Suderman [Tue, 26 Oct 2021 22:08:05 +0000 (15:08 -0700)]
[tosa][mlir] Add bailout to TosaMakeBroadcastable for unranked case
Dyn-cast should be checked and bailed out if the dyn_cast failed.
Reviewed By: sjarus, NatashaKnk
Differential Revision: https://reviews.llvm.org/D112574
Austin Kerbow [Sat, 23 Oct 2021 05:06:41 +0000 (22:06 -0700)]
[AMDGPU] Use max waves for scheduler's initial occupancy target
The scheduler should set critical/excess register usage thresholds that
are guided by the maximum possible occupancy for the function. This
change is focused on setting proper lower bounds on register usage which
we would typically only see when a specific number of maximum waves is
requested with the "waves-per-eu" attribute, or by setting
"amdgpu-num-vgpr|sgpr" directly. This was broken previously. I have a
follow-on patch that will address issues with the scheduler not
targeting correct upper bounds on register usage which is typical with
launch bounds and min "waves-per-eu".
Changes by this patch:
Set the initial critical register usage thresholds to minimum values
that are determined by the maximum possible occupancy for the function,
or the number of allocatable registers, whichever is lower.
Avoid unisgned overflow if register limits are lower than the register
tracking "ErrorMargin", I.e. when using stress-regalloc=2.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D112373
Yuanfang Chen [Tue, 26 Oct 2021 20:58:43 +0000 (13:58 -0700)]
[DebugInfo] Skip ODRUniquing for mismatched tags
Otherwise, ODRUniquing would map some member method/variable MDNodes
to have enum type DIScope, resulting in invalid debug info and bad
DWARF.
- Add a Verifier check that when a 'scope:' operand is an ODR type that is not an enum.
- Makes ODRUniquing apply to only ODR types with the same tag so that the debuginfo/DWARF is well-formed.
Reviewed By: probinson, aprantl
Differential Revision: https://reviews.llvm.org/D111770