Nikita Popov [Fri, 8 Jul 2022 15:11:08 +0000 (17:11 +0200)]
[InstCombine] Avoid ConstantExpr::get() call
Avoid calling ConstantExpr::get() for associative/commutative
binops, call ConstantFoldBinaryOpOperands() instead. We only
want to perform the reassociation of the constants actually fold.
Simon Pilgrim [Fri, 8 Jul 2022 15:08:22 +0000 (16:08 +0100)]
[DAG] SimplifyDemandedBits - fold AND(INSERT_SUBVECTOR(C,X,I),M) -> INSERT_SUBVECTOR(AND(C,M),X,I)
If all the demanded bits of the AND mask covering the inserted subvector 'X' are known to be one, then the mask isn't affecting the subvector at all.
In which case, if the base vector 'C' is undef/constant, then move the AND mask up to just (constant) fold it directly.
Addresses some of the regressions from D129150, particularly the cases where we're attempting to zero the upper elements of a widened vector.
Differential Revision: https://reviews.llvm.org/D129290
Ye Luo [Fri, 8 Jul 2022 13:52:08 +0000 (08:52 -0500)]
[libomptarget] compile DeviceRTL bc files with -O3
bc files of DeviceRTL are compiled with -O3, the same as the static library.
Differential Revision: https://reviews.llvm.org/D129344
Nikita Popov [Fri, 8 Jul 2022 14:37:34 +0000 (16:37 +0200)]
[ConstantExpr] Don't create float binop expressions
Mark the fadd, fsub, fmul, fdiv, and frem expressions as
undesirable, so they are not created automatically. This is in
preparation for their removal.
Nikita Popov [Fri, 8 Jul 2022 14:04:21 +0000 (16:04 +0200)]
[InstCombine] Avoid creating float binop ConstantExprs
Replace ConstantExpr:getFAdd etc with call to
ConstantFoldBinaryOpOperands(). I'm using the constant folding API
rather than IRBuilder here to ensure that this does actually
constant fold. These transforms don't use m_ImmConstant(), so this
would not otherwise be guaranteed (and apparently, they can't use
m_ImmConstant because they want to handle scalable vector splats).
There is an opportunity here to further migrate these to the
ConstantFoldFPInstOperands() API, which would respect the denormal
mode. I've held off on doing so here, because some of this code
explicitly checks for denormal results, and I don't want to touch
it in a mostly NFC change.
Sanjay Patel [Fri, 8 Jul 2022 13:52:57 +0000 (09:52 -0400)]
[InstCombine] enhance fold for subtract-from-constant -> xor
A low-bit mask is not required:
https://alive2.llvm.org/ce/z/yPShss
This matches the SDAG implementation that was updated at:
8b756713140f
Sanjay Patel [Fri, 8 Jul 2022 12:35:36 +0000 (08:35 -0400)]
[InstCombine] add tests for masked sub; NFC
Valentin Clement [Fri, 8 Jul 2022 14:01:34 +0000 (16:01 +0200)]
[flang][openacc][NFC] Extract device_type parser to its own
Move the device_type parser to a separate parser AccDeviceTypeExprList. Preparatory work for D106968.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D106967
Valentin Clement [Fri, 8 Jul 2022 13:44:48 +0000 (15:44 +0200)]
[flang][openacc][NFC] Make self clause value optional in ACC.td and extract the parser
Set the isOptional flag for the self clause. Move the optional and parenthesis part of the parser. Update the rest of the code to deal with the optional value.
Preparatory work for D106968.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D106965
Cullen Rhodes [Fri, 8 Jul 2022 12:55:52 +0000 (12:55 +0000)]
[AArch64] Use Neoverse N2 sched model as default for:
- Cortex-A710
- Cortex-X2
- Neoverse-V1
- Neoverse-512tvb
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D129203
Daniil Fukalov [Fri, 8 Jul 2022 13:06:45 +0000 (16:06 +0300)]
[LiveIntervals] Fix incorrect range (re)construction from subranges.
After D82916 `updateAllRanges()` started to fix holes in main range with
subranges but it fails on instructions with two subregs def which are parts of
one reg. The main range constructed with //all// subranges of subregs just after
processing the first operand. So the main range gets intervals from subranges
those are not updated yet.
The patch takes into account lane mask to update the main range.
Reviewed By: rampitec, arsenm
Differential Revision: https://reviews.llvm.org/D128553
LLVM GN Syncbot [Fri, 8 Jul 2022 12:39:02 +0000 (12:39 +0000)]
[gn build] Port
1cdec6c96e85
Louis Dionne [Thu, 7 Jul 2022 18:07:37 +0000 (14:07 -0400)]
[libc++] Re-apply the use of ABI tags to provide per-TU insulation
This commit re-applies
9ee97ce3b830, which was reverted by
61d417ce
because it broke the LLDB data formatter tests. It also re-applies
6148c79a (the manual GN change associated to it).
Differential Revision: https://reviews.llvm.org/D127444
Phoebe Wang [Fri, 8 Jul 2022 11:11:33 +0000 (19:11 +0800)]
[X86][FP16] Add constrained FP support for scalar emulation
This is a follow up patch to support constrained FP in FP16 emulation.
Reviewed By: skan
Differential Revision: https://reviews.llvm.org/D128114
Hui Xie [Sun, 26 Jun 2022 15:13:43 +0000 (16:13 +0100)]
[libcxx][ranges] implement `std::ranges::set_difference`
implement `std::ranges::set_difference`
reused classic std::set_difference
added unit tests
Differential Revision: https://reviews.llvm.org/D128983
Sanjay Patel [Fri, 8 Jul 2022 12:13:14 +0000 (08:13 -0400)]
[SDAG] try to replace subtract-from-constant with xor
This is almost the same as the abandoned D48529, but it
allows splat vector constants too.
This replaces the x86-specific code that was added with
the alternate patch D48557 with the original generic
combine.
This transform is a less restricted form of an existing
InstCombine and the proposed SDAG equivalent for that
in D128080:
https://alive2.llvm.org/ce/z/OUm6N_
Differential Revision: https://reviews.llvm.org/D128123
Aaron Ballman [Fri, 8 Jul 2022 11:34:18 +0000 (07:34 -0400)]
Disable clang-format entirely for test directories
See discussion here:
https://github.com/llvm/llvm-project/issues/55982
And the RFC here:
https://discourse.llvm.org/t/rfc-disable-clang-format-in-the-clang-test-tree/63498/2
We don't generally expect test files to be formatted according to the
style guide. Indeed, some tests may require specific formatting for the
purposes of the test.
When tests intentionally do not conform to the "correct" formatting,
this causes errors in the CI, which can drown out real errors and causes
people to stop trusting the CI over time.
From the history of the clang/test/.clang-format file, it looks as if
there have been attempts to make clang-format do a subset of formatting
that would be useful for tests. However, it looks as if it's hard to
make clang-format do exactly the right thing -- see the back-and-forth
between
13316a7
and
7b5bddf.
These changes disable the .clang-format file for clang/test, llvm/test,
and clang-tools-extra/test.
Fixes #55982
Differential Revision: https://reviews.llvm.org/D128706
Aaron Ballman [Fri, 8 Jul 2022 11:23:40 +0000 (07:23 -0400)]
Fix the Clang sphinx bot
This should resolve the issues with:
https://lab.llvm.org/buildbot/#/builders/92/builds/29439
OCHyams [Fri, 8 Jul 2022 08:33:41 +0000 (09:33 +0100)]
[NFC][SelectionDAG] Fix debug prints in salvageUnresolvedDbgValue
The prints are printing pointer values - fix by dereferencing the pointers.
Nikita Popov [Fri, 8 Jul 2022 11:04:00 +0000 (13:04 +0200)]
[PhaseOrdering] Add test for IndVars + SROA interaction (NFC)
Jay Foad [Fri, 8 Jul 2022 10:44:23 +0000 (11:44 +0100)]
[AMDGPU] Add GFX11 test coverage sharing checks with GFX10
David Green [Fri, 8 Jul 2022 10:38:00 +0000 (11:38 +0100)]
[AArch64] Remove incorrect use of DemandElts
This call to computeKnownBits was passing in a 0xff mask, looking like
it was expecting it to be used as a DemandBits, not a DemandElts mask.
serge-sans-paille [Fri, 8 Jul 2022 10:13:28 +0000 (12:13 +0200)]
[lldb/test] Disable TestStringLiteralExpr.test on Windows
This test, introduced by
b042d15d2e39eea528c51a30fe637b9ea84250d3, fails on
https://lab.llvm.org/buildbot/#/builders/83/builds/20933/steps/7/logs/stdio
but succeeds on other targets, see for instance
https://lab.llvm.org/buildbot/#/builders/68/builds/35462/steps/6/logs/stdio
This test is not be arch specific, just disabling it on Windows.
Kito Cheng [Fri, 8 Jul 2022 09:01:44 +0000 (17:01 +0800)]
[RISCV] Fix wrong register rename for store value during make-compressible optimization
Current implementation will rename both register in store instructions if
we store base address into memory with same base register, it's OK if
the offset is 0, however that is wrong transform if offset isn't 0, give
a smalle example here:
sd a0, 808(a0)
We should not transform into:
addi a2, a0, 768
sd a2, 40(a2)
That should just rename base address like this:
addi a2, a0, 768
sd a0, 40(a2)
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D128876
Jay Foad [Fri, 8 Jul 2022 09:55:21 +0000 (10:55 +0100)]
[AMDGPU] More GFX11 coverage for tests with generated checks
Cullen Rhodes [Fri, 8 Jul 2022 09:16:30 +0000 (09:16 +0000)]
[AArch64] Initial sched model for Neoverse N2
The optimization guide can be found here:
https://developer.arm.com/documentation/PJDOC-
466751330-18256/latest/
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D128631
Andrew Ng [Thu, 30 Jun 2022 17:55:53 +0000 (18:55 +0100)]
[Support] Fix Windows dump file hang with multi-threaded crashes
Prevents deadlock between MiniDumpWriteDump and
CryptAcquireContextW (called via fs::createTemporaryFile) in
WriteWindowsDumpFile.
However, there's no guarantee that deadlock can't still occur between
MiniDumpWriteDump and some other Win32 API call. But that would appear
to be the "accepted" risk of using MiniDumpWriteDump in this manner.
Differential Revision: https://reviews.llvm.org/D129004
Weining Lu [Fri, 8 Jul 2022 08:59:25 +0000 (16:59 +0800)]
[LoongArch] Add codegen support for multiplication operations
Reference:
https://llvm.org/docs/LangRef.html#mul-instruction
Differential Revision: https://reviews.llvm.org/D128194
zhongyunde [Fri, 8 Jul 2022 09:03:17 +0000 (17:03 +0800)]
[IndVars] Eliminate redundant type cast between integer and float
Recompute the range: match for fptosi of sitofp, and then query the range of the input to the sitofp
according the comment on D129140.
Fixes https://github.com/llvm/llvm-project/issues/55505.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D129191
Kito Cheng [Fri, 8 Jul 2022 09:00:53 +0000 (17:00 +0800)]
[RISCV] Precommit testcase to show wrong result of make-compressible optimization
Use following example to demo what happened now:
li a1, 1
sd a1, 800(a0)
sd a0, 808(a0) # Store base address into base + offset
li a1, 2
sd a1, 816(a0)
Current will optimizate into:
li a1, 1
addi a2, a0, 768
sd a1, 32(a2)
sd a2, 40(a2) # Wrong replacement for the source register.
li a1, 2
sd a1, 48(a2)
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D128875
Jay Foad [Fri, 8 Jul 2022 08:39:02 +0000 (09:39 +0100)]
[AMDGPU] Add GFX11 coverage to shared sdag/gisel tests
Petar Avramovic [Wed, 6 Jul 2022 12:49:07 +0000 (14:49 +0200)]
[AArch64][GlobalISel] Fix call lowering for <3 x i32> vector arguments
Differential Revision: https://reviews.llvm.org/D129194
Sergei Barannikov [Fri, 8 Jul 2022 08:18:43 +0000 (09:18 +0100)]
[SelectionDAG] computeKnownBits / ComputeNumSignBits for the remaining overflow-aware nodes
Some overflow-aware nodes were missing from the switches in
computeKnownBits and ComputeNumSignBits.
Jay Foad [Wed, 6 Jul 2022 11:14:57 +0000 (12:14 +0100)]
[AMDGPU] Add GFX11 test coverage
Add GFX11 test coverage to a bunch of tests where it was easy to do so,
mostly because the checks are autogenerated and/or GFX11 can share the
same checks as GFX10.
Differential Revision: https://reviews.llvm.org/D129295
Jesus Checa Hidalgo [Fri, 8 Jul 2022 08:00:13 +0000 (10:00 +0200)]
[lldb/test] Add Shell/Expr/TestStringLiteralExpr.test
This test should exercise the usage of expressions containing
string literals and ensure that lldb doesn't crash.
Differential Revision: https://reviews.llvm.org/D129261
Nicolas Vasilache [Fri, 8 Jul 2022 06:40:17 +0000 (23:40 -0700)]
[mlir][Transform] Fix isDefiniteFailure helper
This newly added helper was returning definiteFailure even in the case of silenceableFailure.
Differential Revision: https://reviews.llvm.org/D129347
ChenYang Li [Fri, 8 Jul 2022 07:29:17 +0000 (09:29 +0200)]
[JumpThreading] Avoid threadThroughTwoBasicBlocks when PredPred BB ends with indirectbranch
Since we can't change the destination of indirectbr, so when
encounter indirectbr as PredPredBB terminator, we should pass it.
Differential Revision: https://reviews.llvm.org/D129193
Nikita Popov [Fri, 8 Jul 2022 07:24:11 +0000 (09:24 +0200)]
[CallSiteSplitting] Regenerate test checks (NFC)
This test requires --function-signature to work with unmodified UTC.
Nikita Popov [Thu, 7 Jul 2022 07:32:36 +0000 (09:32 +0200)]
[BasicBlockUtils] Allow critical edge splitting with callbr terminators
After D129205, we support SplitBlockPredecessors() for predecessors
with callbr terminators. This means that it is now also safe to
invoke critical edge splitting for an edge coming from a callbr
terminator. Remove checks in various passes that were protecting
against that.
Differential Revision: https://reviews.llvm.org/D129256
Nikita Popov [Thu, 7 Jul 2022 07:54:09 +0000 (09:54 +0200)]
[UpdateTestChecks] Remove outdated help text
Manually modifying the result of update_test_checks.py is discouraged,
we prefer unmodified check lines where possible. The output is also
considered authoritative nowadays, at least for tests targeting core
middle-end components, where not using it is an automatic review
rejection.
Differential Revision: https://reviews.llvm.org/D129259
Martin Storsjö [Thu, 7 Jul 2022 06:49:25 +0000 (09:49 +0300)]
[libcxx] Make LIBCXX_HERMETIC_STATIC_LIBRARY apply to libc++experimental too
This avoids dllexports in that library.
Differential Revision: https://reviews.llvm.org/D129271
Chuanqi Xu [Fri, 8 Jul 2022 06:32:33 +0000 (14:32 +0800)]
[NFC] Move isSameDefaultTemplateArgument into ASTContext
Move isSameDefaultTemplateArgument into ASTContext to keep consistent
with other ASTContext:isSame* methods.
Craig Topper [Fri, 8 Jul 2022 06:25:21 +0000 (23:25 -0700)]
[SLP] Add missing space to optimization remark.
Reviewed By: vporpo
Differential Revision: https://reviews.llvm.org/D129330
Lian Wang [Wed, 29 Jun 2022 01:38:25 +0000 (01:38 +0000)]
[RISCV] Change VECTOR_SPLICE mask operation from expand to promote
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D128717
Johannes Doerfert [Fri, 8 Jul 2022 05:53:38 +0000 (00:53 -0500)]
Revert "[Attributor] Replace AAValueSimplify with AAPotentialValues"
This reverts commit
f17639ea0cd30f52ac853ba2eb25518426cc3bb8 as three
AMDGPU tests haven't been updated. Will need to verify the changes are
not regressions we should avoid.
Johannes Doerfert [Tue, 21 Jun 2022 15:30:10 +0000 (10:30 -0500)]
[Attributor] Replace AAValueSimplify with AAPotentialValues
For the longest time we used `AAValueSimplify` and
`genericValueTraversal` to determine "potential values". This was
problematic for many reasons:
- We recomputed the result a lot as there was no caching for the 9
locations calling `genericValueTraversal`.
- We added the idea of "intra" vs. "inter" procedural simplification
only as an afterthought. `genericValueTraversal` did offer an option
but `AAValueSimplify` did not. Thus, we might end up with "too much"
simplification in certain situations and then gave up on it.
- Because `genericValueTraversal` was not a real `AA` we ended up with
problems like the infinite recursion bug (#54981) as well as code
duplication.
This patch introduces `AAPotentialValues` and replaces the
`AAValueSimplify` uses with it. `genericValueTraversal` is folded into
`AAPotentialValues` as are the instruction simplifications performed in
`AAValueSimplify` before. We further distinguish "intra" and "inter"
procedural simplification now.
`AAValueSimplify` was not deleted as we haven't ported the
re-materialization of instructions yet. There are other differences over
the former handling, e.g., we may not fold trivially foldable
instructions right now, e.g., `add i32 1, 1` is not folded to `i32 2`
but if an operand would be simplified to `i32 1` we would fold it still.
We are also even more aware of function/SCC boundaries in CGSCC passes,
which is good even if some tests look like they regress.
Fixes: https://github.com/llvm/llvm-project/issues/54981
Note: A previous version was flawed and consequently reverted in
6555558a80589d1c5a1154b92cc3af9495f8f86c.
Abinav Puthan Purayil [Sun, 8 May 2022 18:09:49 +0000 (23:39 +0530)]
[AMDGPU] Use the HasNoUse predicate for no-ret atomic op selection
This change replaces the C++ predicates with the HasNoUse builtin
predicate that would enable the no-ret atomic op selection in
GlobalISel.
Differential Revision: https://reviews.llvm.org/D125213
Abinav Puthan Purayil [Sun, 8 May 2022 15:54:52 +0000 (21:24 +0530)]
[GlobalISel][SelectionDAG] Implement the HasNoUse builtin predicate
This change introduces the HasNoUse builtin predicate in PatFrags that
checks for the absence of use of the first result operand.
GlobalISelEmitter will allow source PatFrags with this predicate to be
matched with destination instructions with empty outs. This predicate is
required for selecting the no-return variant of atomic instructions in
AMDGPU.
Differential Revision: https://reviews.llvm.org/D125212
Abinav Puthan Purayil [Mon, 20 Jun 2022 09:18:14 +0000 (14:48 +0530)]
[AMDGPU] Use AddedComplexity for ret and noret atomic ops selection
This patch removes the predicate for return atomic ops and uses
AddedComplexity to distinguish its selection from its no return variant.
This will produce better matchers that doesn't unnecessarily check for
the negated predicate if the initial predicate failed. Also, it
simplifies the enabling of no return atomic ops selection in GlobalISel.
Differential Revision: https://reviews.llvm.org/D128241
Mogball [Mon, 27 Jun 2022 20:46:29 +0000 (13:46 -0700)]
[mlir] Delete ForwardDataFlowAnalysis
With SCCP and integer range analysis ported to the new framework, this old framework is redundant. Delete it.
Depends on D128866
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D128867
Chuanqi Xu [Mon, 13 Jun 2022 09:40:45 +0000 (17:40 +0800)]
[docs] Add document "Debugging C++ Coroutines"
Previously in D99179, I tried to construct debug information for
coroutine frames in the middle end to enhance the debugability for
coroutines. But I forget to add ReleaseNotes to hint people and
documents to help people to use. My bad. @probinson revealed this in
https://github.com/llvm/llvm-project/issues/55916.
So I try to add the use document now.
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D127626
Mogball [Thu, 23 Jun 2022 19:03:27 +0000 (19:03 +0000)]
[mlir] Swap integer range inference to the new framework
Integer range inference has been swapped to the new framework. The integer value range lattices automatically updates the corresponding constant value on update.
Depends on D127173
Reviewed By: krzysz00, rriddle
Differential Revision: https://reviews.llvm.org/D128866
Chuanqi Xu [Fri, 8 Jul 2022 03:10:49 +0000 (11:10 +0800)]
[C++20] [Modules] Don't complain about duplicated default template argument across modules
See https://github.com/cplusplus/draft/pull/5204 for a detailed
background.
Simply, the test redundant-template-default-arg.cpp attached to this
patch should be accepted instead of being complained about the
redefinition.
Reviewed By: urnathan, rsmith, ChuanqiXu
Differential Revision: https://reviews.llvm.org/D118034
lewuathe [Fri, 8 Jul 2022 02:30:26 +0000 (04:30 +0200)]
[mlir][complex] Lower complex.angle to libm
complex.angle corresponds to arg function in libm. We can lower complex.angle to arg and argf.
Reviewed By: pifon2a
Differential Revision: https://reviews.llvm.org/D129341
Haohai Wen [Fri, 8 Jul 2022 02:27:02 +0000 (10:27 +0800)]
[X86] Fix collectLeaves for adds used by phi that forms loop
When add has additional users, we should indentify whether add's
user is phi that forms loop rather than root's.
Reviewed By: LuoYuanke
Differential Revision: https://reviews.llvm.org/D129169
Lian Wang [Fri, 8 Jul 2022 02:19:46 +0000 (02:19 +0000)]
[RISCV] Recommit test for D128717
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D128778
Phoebe Wang [Fri, 8 Jul 2022 00:13:29 +0000 (17:13 -0700)]
[X86][FP16] Fix crash when lowering copysign for f16
This is to address the assertion fail reported in https://reviews.llvm.org/D107082#3635612
Not sure if it is a problem of promoting FCOPYSIGN + libcall FP_ROUND.
The promoting will set the rounding mode to 1 https://github.com/llvm/llvm-project/blob/
a442c628882eb07fffff8c9f7c87a317af14555a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp#L4810-L4814
While libcall cannot handle the rounding mode equals to 1 https://github.com/llvm/llvm-project/blob/
a442c628882eb07fffff8c9f7c87a317af14555a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp#L4324-L4328
So changing the action to Expand to workaround the problem.
Reviewed By: clementval, MaskRay
Differential Revision: https://reviews.llvm.org/D129294
Lian Wang [Fri, 8 Jul 2022 01:56:29 +0000 (01:56 +0000)]
Revert "[RISCV] Precommit test for D128717"
This reverts commit
b3b37f3ecfd6be665c385455561603bdfc7d6c76.
Lian Wang [Wed, 29 Jun 2022 02:44:02 +0000 (02:44 +0000)]
[RISCV] Precommit test for D128717
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D128778
Eric Astor [Thu, 7 Jul 2022 15:59:41 +0000 (11:59 -0400)]
[ms] [llvm-ml] Add support for the remaining binary named operators
Finish adding support for the remaining binary named operators in expression context: XOR, SHL, and SHR.
Differential Revision: https://reviews.llvm.org/D129299
Jun Zhang [Thu, 7 Jul 2022 14:14:04 +0000 (22:14 +0800)]
[clang-repl][NFC] Split weak symbol test to a new test
Windows has some issues when we try to use `__attribute__((weak))` in
JIT, so we disabled that. But it's not worth to disable the whole test
just for this single feature. This patch split that part from the
original test so we can keep testing stuff that normally working in
Windows.
Signed-off-by: Jun Zhang <jun@junz.org>
Differential Revision: https://reviews.llvm.org/D129250
lewuathe [Fri, 8 Jul 2022 00:24:34 +0000 (09:24 +0900)]
[mlir][complex] Convert complex.abs to libm
Convert complex.abs to libm library
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D127476
Joseph Huber [Fri, 8 Jul 2022 00:41:37 +0000 (20:41 -0400)]
[llvm-objdump][Docs] Document new flag
Jacques Pienaar [Fri, 8 Jul 2022 00:36:28 +0000 (17:36 -0700)]
Julian Lettner [Fri, 8 Jul 2022 00:26:19 +0000 (17:26 -0700)]
Revert "[Sanitizer][Darwin] Cleanup MaybeReexec() function and usage"
Many tests for the `UBSan-Standalone-iossim-x86_64` fail with this.
Reverting so I can investigate.
This reverts commit
0a9667b0f56b1b450abd02f74c6175bea54f832e.
David Blaikie [Fri, 8 Jul 2022 00:11:09 +0000 (00:11 +0000)]
Add a little extra test coverage for simple template names
This would fail with an overly naive approach to simple template
name (clang's -gsimple-template-names) since the names wouldn't be
unique per specialization, creating ambiguity/chance that a query for
one specialization would find another.
Aart Bik [Thu, 7 Jul 2022 20:16:49 +0000 (13:16 -0700)]
[mlir] add complex type to getZeroAttr
Fixes issue encountered with <sparse> complex constant
https://github.com/llvm/llvm-project/issues/56428
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D129325
Florian Hahn [Thu, 7 Jul 2022 23:50:00 +0000 (16:50 -0700)]
[AArch64] Try to re-use extended operand for SETCC with vector ops.
Try to re-use an already extended operand for SetCC with vector operands
feeding an extended select. Doing so avoids requiring another full
extension of the SET_CC result when lowering the select.
This improves lowering for certain extend/cmp/select patterns operating.
For example with v16i8, this replaces 6 instructions for the extra extension
with 4 separate selects.
This improves the generated code for loops like the one below in
combination with D96522.
int foo(uint8_t *p, int N) {
unsigned long long sum = 0;
for (int i = 0; i < N ; i++, p++) {
unsigned int v = *p;
sum += (v < 127) ? v : 256 - v;
}
return sum;
}
https://clang.godbolt.org/z/Wco866MjY
On the AArch64 cores I have access to, the patch improves performance of
the vector loop by ~10%.
This could be generalized per follow-ups, but the initial version
targets one of the more important cases in combination with D96522.
Alive2 modeling:
* sext EQ https://alive2.llvm.org/ce/z/5upBvb
* sext NE https://alive2.llvm.org/ce/z/zbEcJp
* zext EQ https://alive2.llvm.org/ce/z/_xMwof
* zext NE https://alive2.llvm.org/ce/z/5FwKfc
* zext unsigned predicate: https://alive2.llvm.org/ce/z/iEwLU3
* sext signed predicate: https://alive2.llvm.org/ce/z/aMBega
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D120481
Julian Lettner [Fri, 1 Jul 2022 18:05:40 +0000 (11:05 -0700)]
[Sanitizer][Darwin] Cleanup MaybeReexec() function and usage
While investigating another issue, I noticed that `MaybeReexec()` never
actually "re-executes via `execv()`" anymore. `DyldNeedsEnvVariable()`
only returned true on macOS 10.10 and below.
Usually, I try to avoid "unnecessary" cleanups (it's hard to be certain
that there truly is no fallout), but I decided to do this one because:
* I initially tricked myself into thinking that `MaybeReexec()` was
relevant to my original investigation (instead of being dead code).
* The deleted code itself is quite complicated.
* Over time a few other things were mushed into `MaybeReexec()`:
initializing `MonotonicNanoTime()`, verifying interceptors are
working, and stripping the `DYLD_INSERT_LIBRARIES` env var to avoid
problems when forking.
* This platform-specific thing leaked into `sanitizer_common.h`.
* The `ReexecDisabled()` config nob relies on the "strong overrides weak
pattern", which is now problematic and can be completely removed.
* `ReexecDisabled()` actually hid another issue with interceptors not
working in unit tests. I added an explicit `verify_interceptors`
(defaults to `true`) option instead.
Differential Revision: https://reviews.llvm.org/D129157
Jonas Devlieghere [Thu, 7 Jul 2022 23:28:35 +0000 (16:28 -0700)]
Revert "[LLDB][NFC] Decouple dwarf location table from DWARFExpression."
This reverts commit
227dffd0b6d78154516ace45f6ed28259c7baa48 and its
follow up
562c3467a6738aa89203f72fc1d1343e5baadf3c because it breaks a
bunch of tests on GreenDragon:
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/45155/
Hui Xie [Tue, 5 Jul 2022 00:16:19 +0000 (01:16 +0100)]
[libcxx][ranges] Create a test tool `ProxyIterator` that customises `iter_move` and `iter_swap`
It is meant to be used in ranges algorithm tests.
It is much simplified version of C++23's tuple + zip_view.
Using std::swap would cause compilation failure and using `std::move` would not create the correct rvalue proxy which would result in copies.
Differential Revision: https://reviews.llvm.org/D129099
Diego Caballero [Thu, 7 Jul 2022 22:32:15 +0000 (22:32 +0000)]
Revert "[RISCV] Optimize 2x SELECT for floating-point types"
This reverts commit
1178992c72b002c3b2c87203252c566eeb273cc1.
owenca [Tue, 5 Jul 2022 04:59:43 +0000 (21:59 -0700)]
[clang-format][NFC] Clean up IndentForLevel in LevelIndentTracker
Differential Revision: https://reviews.llvm.org/D129105
Mogball [Thu, 23 Jun 2022 19:03:12 +0000 (19:03 +0000)]
[mlir] An implementation of dense data-flow analysis
This patch introduces an implementation of dense data-flow analysis. Dense
data-flow analysis attaches a lattice before and after the execution of every
operation. The lattice state is propagated across operations by a user-defined
transfer function. The state is joined across control-flow and callgraph edges.
Thge patch provides an example pass that uses both a dense and a sparse analysis
together.
Depends on D127139
Reviewed By: rriddle, phisiart
Differential Revision: https://reviews.llvm.org/D127173
Zequan Wu [Thu, 7 Jul 2022 21:56:19 +0000 (14:56 -0700)]
[LLDB] Fix aggregate-indirect-arg.cpp failure introduced by
227dffd0b6d78154516ace45f6ed28259c7baa48
Nico Weber [Thu, 7 Jul 2022 21:56:03 +0000 (23:56 +0200)]
[gn build/mac] Use -mmacos-version-min instead of -mmacosx-version-min
The two flags do the same thing, but the OS is called macOS these days.
(The new flag is 5 years old: https://reviews.llvm.org/D32796)
No behavior change.
River Riddle [Thu, 7 Jul 2022 21:40:46 +0000 (14:40 -0700)]
[vscode-mlir] Bump to version 0.0.10
Since version 0.9 we've:
* Bumped the language-client to `8.0.2-next.5` to fix various bugs/stability issues
* Fixed an issue with starting a language server for non-workspace files
Johannes Doerfert [Thu, 7 Jul 2022 21:05:52 +0000 (16:05 -0500)]
[Attributor] Make heap2stack record alloca placement
We recently learned to place the alloca during the heap2stack
transformation in the entry block but we did not account for other
concurrent modifications. We need to record our decision rather than
checking (then outdated) passes during the manifest stage. This will
also allow us to use a custom (=optimistic) "loop info" in the future.
Johannes Doerfert [Thu, 7 Jul 2022 21:43:27 +0000 (16:43 -0500)]
[Attributor][NFC] Improve heap2stack result readability and code style
Johannes Doerfert [Tue, 21 Jun 2022 22:17:01 +0000 (17:17 -0500)]
[OpenMP] Ensure to not use SPMD mode in the absence of parallel regions
Vitaly Buka [Thu, 7 Jul 2022 03:51:59 +0000 (20:51 -0700)]
[sanitizer] Deduplicate dn_expand test
Reviewed By: kstoimenov
Differential Revision: https://reviews.llvm.org/D129246
Leonard Chan [Thu, 7 Jul 2022 18:43:26 +0000 (11:43 -0700)]
[hwasan] Refactor frame record info into function
This way it can be reused easily in D128387.
Note this changes the IR slightly. Before The steps for calculating and storing the frame record info were:
1. getPC
2. getSP
3. inttoptr
4. or SP, PC
5. store
Now the steps are:
1. getPC
2. getSP
3. or SP, PC
4. inttoptr
5. store
Differential Revision: https://reviews.llvm.org/D129315
Leonard Chan [Thu, 7 Jul 2022 21:42:08 +0000 (14:42 -0700)]
[hwasan][fuchsia] Fix features bitmask checking
Update the address tagging bitmask check to just see if
ZX_ARM64_FEATURE_ADDRESS_TAGGING_TBI is enabled rather than checking
if it's the only thing that's enabled.
Differential Revision: https://reviews.llvm.org/D129318
Mark Harmstone [Wed, 6 Jul 2022 21:20:42 +0000 (00:20 +0300)]
[clang] [MinGW] Fix paths on Gentoo
There's code in clang/lib/Driver/ToolChains/Gnu.cpp for Clang to use Gentoo's include and lib paths, but this is missing for mingw, meaning that any C++ programs using the STL will fail to compile.
See https://bugs.gentoo.org/788430
Differential Revision: https://reviews.llvm.org/D111081
Nico Weber [Thu, 7 Jul 2022 21:25:04 +0000 (23:25 +0200)]
[gn build] (manually) port
36f01909a0e2 (llvm-debuginfod)
LLVM_ENABLE_HTTPLIB is always off in the GN build. This means the
test for this won't run, so it's not really necessary to add the
llvm-debuginfod binary (and the binary might not even be that
interesting with LLVM_ENABLE_HTTPLIB off). But maybe we want
to add support for LLVM_ENABLE_HTTPLIB at some point, so let's
add the binary too. (Usually we wouldn't, since it's not needed
to get tests to pass.)
Krzysztof Drewniak [Wed, 6 Jul 2022 21:38:58 +0000 (21:38 +0000)]
[mlir][AMDGPU] Use the correct values for OOB_SELECT on gfx10
Differential Revision: https://reviews.llvm.org/D129320
Martin Sebor [Thu, 30 Jun 2022 19:54:34 +0000 (13:54 -0600)]
[InstCombine] Fold memchr and strchr equality with first argument
Enhance memchr and strchr handling to simplify calls to the functions
used in equality expressions with the first argument to at most two
integer comparisons:
- memchr(A, C, N) == A to N && *A == C for either a dereferenceable
A or a nonzero N,
- strchr(S, C) == S to *S == C for any S and C, and
- strchr(S, '\0') == 0 to true for any S
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D128939
Peter Steinfeld [Thu, 7 Jul 2022 20:53:59 +0000 (13:53 -0700)]
[flang] Fix typo in runtime message
The title says it.
Differential Revision: https://reviews.llvm.org/D129329
Florian Hahn [Thu, 7 Jul 2022 21:07:25 +0000 (14:07 -0700)]
[AArch64] Add vector select tests with odd element types.
Additional tests for D120481.
Nikolas Klauser [Wed, 6 Jul 2022 23:19:52 +0000 (01:19 +0200)]
[libc++] Add test for algorithm result type alias declarations
Reviewed By: var-const, #libc
Spies: libcxx-commits, jeroen.dobbelaere
Differential Revision: https://reviews.llvm.org/D129189
Xiang Li [Thu, 7 Jul 2022 21:00:52 +0000 (14:00 -0700)]
[NFC] [DirectX] Cleanup test for comput_ids.
Cleanup test for review in https://reviews.llvm.org/D127990
David Blaikie [Tue, 28 Jun 2022 20:41:07 +0000 (20:41 +0000)]
Remove dead code: TypeMap::RemoveMismatchedTypes(TypeClass type_class)
River Riddle [Wed, 6 Jul 2022 04:46:05 +0000 (21:46 -0700)]
[mlir:LSP] Add support for MLIR code completions
This commit adds code completion results to the MLIR LSP using
a new code completion context in the MLIR parser. This commit
adds initial completion for dialect, operation, SSA value, and
block names.
Differential Revision: https://reviews.llvm.org/D129183
River Riddle [Wed, 6 Jul 2022 09:51:00 +0000 (02:51 -0700)]
[mlir-vscode] Bump the language client version
This includes a fix for a code completion/document update bug where
code completion results were being requested before the document actually
updated.
Differential Revision: https://reviews.llvm.org/D129182
River Riddle [Wed, 6 Jul 2022 00:44:43 +0000 (17:44 -0700)]
[mlir-vscode] Explicitly set the return type for didOpen
In the newer versions of the language client, this explicitly expects a
Promise<void> return type, otherwise it errors out.
Fixes #56297
Differential Revision: https://reviews.llvm.org/D129181
Martin Storsjö [Thu, 7 Jul 2022 06:37:18 +0000 (09:37 +0300)]
[libcxx] [ci] Don't disable libc++experimental in mingw builds
Since
dfa88927ae1411ccc3b248b7e624f2acf623d947, the static
libc++experimental should work in mingw dll builds. (It probably worked
all along in static mingw builds.)
Differential Revision: https://reviews.llvm.org/D129270
Philip Reames [Thu, 7 Jul 2022 18:36:57 +0000 (11:36 -0700)]
[RISCV] Adjust fixed vector coverage for get.active.lane.mask
Make sure we include at least one case where the vsadd/vmsltu lowering
requires only LMUL1. We should be able to generate all of the fixed
vector variants from scalar to vector idioms, but this is probably not
very important right now given the fixed length variants we'd actually
use when vectorizing with LMUL=1 are reasonable.
David Blaikie [Thu, 7 Jul 2022 20:27:05 +0000 (20:27 +0000)]
Simplify some AsCString usage that was also explicitly handling default
Wei Yi Tee [Thu, 7 Jul 2022 12:43:47 +0000 (12:43 +0000)]
[clang][dataflow] Return a solution from the solver when `Constraints` are `Satisfiable`.
Differential Revision: https://reviews.llvm.org/D129180
David Blaikie [Thu, 7 Jul 2022 19:58:41 +0000 (19:58 +0000)]
Retrieve as StringRef since that's how it'll be used