Vitaly Buka [Fri, 5 Nov 2021 22:09:45 +0000 (15:09 -0700)]
[libFuzzer] Disable Msan on InternalStrnlen
It's called from ATTRIBUTE_NO_SANITIZE_MEMORY code.
It worked as expected if inlined and complained otherwise.
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D113323
Zahira Ammarguellat [Mon, 1 Nov 2021 21:08:08 +0000 (14:08 -0700)]
In spir functions, llvm.dbg.declare intrinsics created
for parameters and locals need to refer to the stack
allocation in the alloca address space.
Roman Lebedev [Fri, 5 Nov 2021 21:53:08 +0000 (00:53 +0300)]
[NFC][CostModel] Add exhaustive test coverage for replication shuffles
This coverage has been brought to you by https://godbolt.org/z/nfc3cY1za
Scott Linder [Thu, 4 Nov 2021 15:22:48 +0000 (15:22 +0000)]
[NFC][Verifier] Remove redundant Module parameters
These `M` parameters shadow the `M` member in `VerifierSupport`, and
both always refer to the same module. Eliminate the redundant parameters
and always use the member.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D106474
Jay Foad [Thu, 4 Nov 2021 13:43:09 +0000 (13:43 +0000)]
[TwoAddressInstructionPass] Update existing physreg live intervals
In TwoAddressInstructionPass::processTiedPairs with
-early-live-intervals, update any preexisting physreg live intervals,
as well as virtreg live intervals. By default (without
-precompute-phys-liveness) physreg live intervals only exist for
registers that are live-in to some basic block.
Differential Revision: https://reviews.llvm.org/D113191
Valentin Clement [Fri, 5 Nov 2021 21:16:37 +0000 (22:16 +0100)]
Revert "[fir] Add fir.extract_value and fir.insert_value conversion"
This reverts commit
ea55503d7ca5b6ded73b0fd01a8c528f68e00521.
Leonard Chan [Fri, 5 Nov 2021 21:08:09 +0000 (14:08 -0700)]
[clang][asan] Add test for ensuring PR52382 is fixed
The fix for PR52382 was already introduced in D112732 which ensures that module
instrumentation always runs after function instrumentation. This adds a test
that ensures the PR is addressed and prevent regression.
Differential Revision: https://reviews.llvm.org/D113143
Roman Lebedev [Fri, 5 Nov 2021 16:11:55 +0000 (19:11 +0300)]
[IR] Improve member `ShuffleVectorInst::isReplicationMask()`
When we have an actual shuffle, we can impose the additional restriction
that the mask replicates the elements of the first operand, so we know
the replication factor as a ratio of output and op0 vector sizes.
Jonas Devlieghere [Fri, 5 Nov 2021 20:18:06 +0000 (13:18 -0700)]
[lldb] Use std::string instead of llvm::Twine in GDBRemoteCommunicationClient
From the documentation:
A Twine is not intended for use directly and should not be stored, its
implementation relies on the ability to store pointers to temporary
stack objects which may be deallocated at the end of a statement.
Twines should only be used accepted as const references in arguments,
when an API wishes to accept possibly-concatenated strings.
rdar://
84799118
Differential revision: https://reviews.llvm.org/D113314
Jonas Devlieghere [Fri, 5 Nov 2021 20:13:41 +0000 (13:13 -0700)]
[lldb] Improve 'lang objc tagged-pointer info' command
Don't try to get a class descriptor for a pointer that doesn't look like
a tagged pointer. Also print addresses as fixed-width hex and update the
test.
Arthur O'Dwyer [Thu, 4 Nov 2021 21:58:33 +0000 (17:58 -0400)]
[libc++] Fix hang in counting_semaphore::try_acquire
Before this patch, `try_acquire` blocks instead of returning false.
This is because `__libcpp_thread_poll_with_backoff` interprets zero
as meaning infinite, causing `try_acquire` to wait indefinitely.
Thanks to Pablo Busse (pabusse) for the patch!
Differential Revision: https://reviews.llvm.org/D98334
David Blaikie [Fri, 5 Nov 2021 19:54:39 +0000 (12:54 -0700)]
Add some support for pretty printing Twines containing std::string in gdb
This isn't perfect, since it doesn't use lazy_string - so if the
std::string does contain unprintable characters it might fail, but seems
better than nothing & LLVM doesn't generally store binary data in
std::strings.
Aart Bik [Thu, 4 Nov 2021 17:28:32 +0000 (10:28 -0700)]
[mlir][sparse] run more integration tests with and without SIMD
Reviewed By: wrengr
Differential Revision: https://reviews.llvm.org/D113205
Martin Storsjö [Fri, 5 Nov 2021 09:12:22 +0000 (11:12 +0200)]
[lldb] Use is_style_posix() for path style checks
Since
a8b54834a186f5570b49b614e31b961a9cf1cbfe, there are two
distinct Windows path styles, `windows_backslash` (with the old
`windows` being an alias for it) and `windows_slash`.
4e4883e1f394f7c47ff3adee48039aa8374bb8d0 added helpers for
inspecting path styles.
The newly added windows_slash path style doesn't end up used in
LLDB yet anyway, as LLDB is quite decoupled from most of
llvm::sys::path and uses its own FileSpec class. To take it in
use, it could be hooked up in `FileSpec::Style::GetNativeStyle`
(in lldb/source/Utility/FileSpec.cpp) just like in the `real_style`
function in llvm/lib/Support/Path.cpp in
df0ba47c36f6bd0865e3286853b76d37e037c2d7.
It is not currently clear whether there's a real need for using
the Windows path style with forward slashes in LLDB (if there's any
other applications interacting with it, expecting that style), and
what other changes in LLDB are needed for that to work, but this
at least makes some of the checks more ready for the new style,
simplifying code a bit.
Differential Revision: https://reviews.llvm.org/D113255
Martin Storsjö [Thu, 7 Oct 2021 11:31:32 +0000 (11:31 +0000)]
[unittests] [DWARF] Generalize path separator expectations
This fixes unit tests if running on Windows with a build configured
to prefer forward slashes.
Differential Revision: https://reviews.llvm.org/D113257
Martin Storsjö [Thu, 7 Oct 2021 10:36:46 +0000 (10:36 +0000)]
[DebugInfo] [PDB] Force injected source paths to use backslashes
This fixes lld/COFF/pdb-natvis.test (which only is run on Windows)
when using paths with forward slashes on Windows.
Differential Revision: https://reviews.llvm.org/D113265
Valentin Clement [Fri, 5 Nov 2021 19:49:09 +0000 (20:49 +0100)]
[fir] Remove getModel<Fortran::ISO::CFI_dim_t> in DescriptorModel.h
A windows buildbot complains about previous definiton after D112961.
Remove the extra definition until we can figure out if really needed.
Philip Reames [Fri, 5 Nov 2021 19:34:08 +0000 (12:34 -0700)]
Autogen tests for ease of future update
Martin Storsjö [Fri, 22 Oct 2021 21:48:54 +0000 (00:48 +0300)]
[libcxx] [test] Narrow down XFAILs regarding a MSVC mode specific bug to "windows-dll && msvc"
These tests don't fail when only windows-dll is set in mingw mode, as the
bug is specific to MSVC mode.
Differential Revision: https://reviews.llvm.org/D112348
Sanjay Patel [Fri, 5 Nov 2021 17:28:35 +0000 (13:28 -0400)]
[DAGCombiner] add fold for vselect based on mask of signbit, part 2
This is the 'or' sibling for the fold added with:
D113212
https://alive2.llvm.org/ce/z/tgnp7K
Note that neither of these transforms is poison-safe,
but it does not seem to matter at this level. We have
had the scalar version of D113212 for a long time, so
this is just making optimizer behavior consistent.
We do not have the scalar version of *this* fold,
however, so that is another follow-up.
Sanjay Patel [Fri, 5 Nov 2021 16:46:56 +0000 (12:46 -0400)]
[AArch] add tests for vselect; NFC
These are copy/pasted from the related test patterns in D113212.
Sanjay Patel [Fri, 5 Nov 2021 16:42:22 +0000 (12:42 -0400)]
[x86] add tests for vector select; NFC
River Riddle [Fri, 5 Nov 2021 18:43:26 +0000 (18:43 +0000)]
[mlir][DialectConversion] Legalize all live argument conversions
Previously we didn't materialize conversions for arguments in certain
cases as the implicit type propagation was being heavily relied on
by many patterns. Now that those patterns have been fixed to
properly handle type conversions, we can drop the special behavior.
Differential Revision: https://reviews.llvm.org/D113233
Yonghong Song [Fri, 5 Nov 2021 18:01:31 +0000 (11:01 -0700)]
Reland "[Attr] support btf_type_tag attribute"
This is to revert commit
f95bd18b5faa (Revert "[Attr] support
btf_type_tag attribute") plus a bug fix.
Previous change failed to handle cases like below:
$ cat reduced.c
void a(*);
void a() {}
$ clang -c reduced.c -O2 -g
In such cases, during clang IR generation, for function a(),
CGCodeGen has numParams = 1 for FunctionType. But for
FunctionTypeLoc we have FuncTypeLoc.NumParams = 0. By using
FunctionType.numParams as the bound to access FuncTypeLoc
params, a random crash is triggered. The bug fix is to
check against FuncTypeLoc.NumParams before accessing
FuncTypeLoc.getParam(Idx).
Differential Revision: https://reviews.llvm.org/D111199
Florian Hahn [Fri, 5 Nov 2021 16:45:49 +0000 (17:45 +0100)]
[AArch64][GISel] Optimize 8 and 16 bit variants of uaddo.
Try simplify G_UADDO with 8 or 16 bit operands to wide G_ADD and TBNZ if
result is only used in the no-overflow case. It is restricted to cases
where we know that the high-bits of the operands are 0. If there's an
overflow, then the the 9th or 17th bit must be set, which can be checked
using TBNZ.
Reviewed By: paquette
Differential Revision: https://reviews.llvm.org/D111888
Deepak Panickal [Fri, 5 Nov 2021 17:39:57 +0000 (17:39 +0000)]
[mlir] Add callback to provide a pass pipeline to MlirOptMain
The callback can be used to provide a default pass pipeline.
Reviewed By: mehdi_amini, rriddle
Differential Revision: https://reviews.llvm.org/D113144
Shao-Ce SUN [Fri, 5 Nov 2021 17:39:14 +0000 (01:39 +0800)]
[RISCV] Support Zfhmin extension
According to RISC-V Unprivileged ISA 15.6.
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D111866
Jon Chesterfield [Fri, 5 Nov 2021 17:34:27 +0000 (17:34 +0000)]
[libomptarget] Drop remote plugin cmake version requirement to match llvm
LLVM docs at https://llvm.org/docs/CMake.html#quick-start state 3.13.4
Reviewed By: atmnpatel
Differential Revision: https://reviews.llvm.org/D113271
Zarko Todorovski [Fri, 5 Nov 2021 16:37:42 +0000 (12:37 -0400)]
[AIX][Clang] Fix XL product name in AIX XL compatibility warning
Correct the XLC/C++ version in the warning message to use the information from
XL's -qversion output.
Reviewed By: rzurob
Differential Revision: https://reviews.llvm.org/D112847
Aart Bik [Thu, 4 Nov 2021 16:22:34 +0000 (09:22 -0700)]
[mlir][sparse] test for SIMD reduction chaining in consecutive vector loops
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D113197
Martin Liska [Fri, 5 Nov 2021 16:04:12 +0000 (17:04 +0100)]
sanitizer: Fix -Wpedantic GCC warning
Fixes:
sanitizer_stacktrace.h:212:5: warning: ISO C++ forbids braced-groups within expressions [-Wpedantic]
Differential Revision: https://reviews.llvm.org/D113292
Fangrui Song [Fri, 5 Nov 2021 17:02:49 +0000 (10:02 -0700)]
[llvm-readobj] Display DT_RELRSZ/DT_RELRENT as " (bytes)"
to match RELSZ/RELENT.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D113206
Nico Weber [Fri, 5 Nov 2021 16:43:06 +0000 (12:43 -0400)]
[gn build] Use `=` for of -fdebug-compilation-dir
-f flags usually use the `=` form. -fdebug-compilation-dir= has been
around for a few months now (since
0c2bb6b446c584ab, both LLVM 12.0
and 13.0 have it), so using it shouldn't be a big problem -- especially
since use_relative_paths_in_debug_info is opt-in anyways.
Arthur Eubanks [Fri, 5 Nov 2021 16:31:14 +0000 (09:31 -0700)]
[polly] Properly create and initialize new PM analysis managers
If we don't properly initialize all the analysis managers, we may be
missing analyses that other analyses depend on.
Fixes broken polly test, e.g.
https://lab.llvm.org/buildbot/#/builders/10/builds/7501.
Zarko Todorovski [Fri, 5 Nov 2021 15:27:59 +0000 (11:27 -0400)]
[clang] [Objective C] Inclusive language: use objcmt-allowlist-dir-path=<arg> instead of objcmt-white-list-dir-path=<arg>
Trying to update some options that don't at least have an inclusive language version.
This patch adds `objcmt-allowlist-dir-path` as a default alternative.
Reviewed By: akyrtzi
Differential Revision: https://reviews.llvm.org/D112591
Roman Lebedev [Fri, 5 Nov 2021 16:22:27 +0000 (19:22 +0300)]
[NFCI] InstructionTest: trim `InstructionsTest.ShuffleMaskIsReplicationMask_*` complexity
These tests have pretty high O() complexity due to their nature,
which leads to potentially-long runtimes.
While in release build for me they took ~1 and ~2 sec,
as noted in https://reviews.llvm.org/D113214#inline-1080479
they take minutes in debug build.
Fine-tune the amount of permutations they deal with,
without affecting the test coverage. After this,
they take <~10ms each for me (in release build),
hopefully that is good-enough for debug build too.
Roman Lebedev [Fri, 5 Nov 2021 16:13:06 +0000 (19:13 +0300)]
[NFC] Fix typo in comment for `isReplicationMask()`
This was mentioned in https://reviews.llvm.org/D113214#inline-1080385
but i forgot to stage the change before committing.
Kazu Hirata [Fri, 5 Nov 2021 16:14:32 +0000 (09:14 -0700)]
[Target] Use make_early_inc_range (NFC)
Whitney Tsang [Fri, 5 Nov 2021 15:19:56 +0000 (15:19 +0000)]
Add NoOpLoopNestPass and LOOPNEST_PASS macro
Having a NoOpLoopNestPass can ensure that only outermost loop is invoked
for a LoopNestPass with a lit test.
There are some existing passes that are implemented as LoopNestPass, but
they are still using LOOP_PASS macro.
It would be easier to identify LoopNestPasses with a LOOPNEST_PASS
macro.
Differential Revision: https://reviews.llvm.org/D113185
Craig Topper [Thu, 4 Nov 2021 21:55:22 +0000 (14:55 -0700)]
[RISCV] Enable FP extensions and ABI on fixed-vectors-bitcast.ll.
This improves our type coverage. We were only testing integer
insert and extract before due to the FP types not being enabled for
arguments and returns.
Differential Revision: https://reviews.llvm.org/D113217
Michael Liao [Fri, 5 Nov 2021 14:47:10 +0000 (10:47 -0400)]
[BranchRelaxation] Fix warning on unused variable. NFC.
David Green [Fri, 5 Nov 2021 15:05:09 +0000 (15:05 +0000)]
[InstCombine] Generalize sadd.sat combine to compute sign bits.
There is a combine in instcombine to transform a saturated add/sub into
a saddsat/ssubsat, currently handling inputs which are both sign
extended (https://alive2.llvm.org/ce/z/68qpTn). This can generalize to,
for example ashr of at least the bitwidth (https://alive2.llvm.org/ce/z/4TFyX-
and https://alive2.llvm.org/ce/z/qDWzFs for example). Which means it
generalizes further to "the number of sign bits", needing to be enough
to truncate to the size of the saturate. (An example using `or` for
instance: https://alive2.llvm.org/ce/z/EI_h_A).
So this patch makes use of ComputeNumSignBits (with the newly added
ComputeMinSignedBits) in matchSAddSubSat to generalize the fold to any
inputs with enough sign bits known, truncating the inputs to the new
size of the saturate.
Differential Revision: https://reviews.llvm.org/D112298
Valentin Clement [Fri, 5 Nov 2021 14:52:50 +0000 (15:52 +0100)]
[fir] Add fir.extract_value and fir.insert_value conversion
This patch add the conversion pattern for fir.extract_value
and fir.insert_value. fir.extract_value is lowered to llvm.extractvalue
anf fir.insert_value is lowered to llvm.insertvalue.
This patch also adds the type conversion for the BoxType and RecordType
needed to have some comprehensive tests.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: awarzynski
Differential Revision: https://reviews.llvm.org/D112961
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Nico Weber [Fri, 5 Nov 2021 14:50:24 +0000 (10:50 -0400)]
[gn build] Reformat all files
Ran `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`.
No behavior change.
Alex Lorenz [Fri, 5 Nov 2021 05:01:33 +0000 (22:01 -0700)]
[clang] 'unused-but-set-variable' warning should not apply to __block objective-c pointers
The __block Objective-C pointers can be set but not used due to a commonly used lifetime extension pattern in Objective-C.
Differential Revision: https://reviews.llvm.org/D112850
Nico Weber [Fri, 5 Nov 2021 14:42:07 +0000 (10:42 -0400)]
[gn build] Use build-machine-independent paths in coverage information
This is possible after D106314 /
8773822c578a.
Makes the required prepare-code-coverage-artifact.py invocation a bit longer,
but that seems like a good tradeoff.
Differential Revision: https://reviews.llvm.org/D113282
Tres Popp [Fri, 5 Nov 2021 14:42:47 +0000 (15:42 +0100)]
Extend timeout of llvm/unittests:ir_tests
This test became much slower after
01d8759ac9
David Green [Fri, 5 Nov 2021 14:41:37 +0000 (14:41 +0000)]
[ValueTracking][InstCombine] Introduce and use ComputeMinSignedBits
This introduces a new ComputeMinSignedBits method for ValueTracking that
returns the BitWidth - SignBits + 1 from ComputeSignBits, and represents
the minimum bit size for the value as a signed integer. Similar to the
existing APInt::getMinSignedBits method, this can make some of the
reasoning around ComputeSignBits more natural.
See https://reviews.llvm.org/D112298
Simon Pilgrim [Fri, 5 Nov 2021 14:36:17 +0000 (14:36 +0000)]
[DAG] FoldConstantVectorArithmetic - remove SDNodeFlags argument
Another minor step towards merging FoldConstantVectorArithmetic into FoldConstantArithmetic.
We don't use SDNodeFlags in any constant folding inside DAG, so passing the Flags argument is a waste of time - an alternative would be to wire up FoldConstantArithmetic to take SDNodeFlags just-in-case we someday start using it, but we don't have any way to test it and I'd prefer to avoid dead code.
Differential Revision: https://reviews.llvm.org/D113276
Roman Lebedev [Fri, 5 Nov 2021 14:26:21 +0000 (17:26 +0300)]
[X86] `X86TTIImpl::getInterleavedMemoryOpCostAVX512()`: mask is i8 not i1
Even though AVX512's masked mem ops (unlike AVX1/2) have a mask
that is a `VF x i1`, replication of said masks happens after
promotion of it to `VF x i8`, so we should use `i8`, not `i1`,
when calculating the cost of mask replication.
Sanjay Patel [Fri, 5 Nov 2021 13:25:54 +0000 (09:25 -0400)]
[DAGCombiner] add fold for vselect based on mask of signbit
(X s< 0) ? Y : 0 --> (X s>> BW-1) & Y
We canonicalize to the icmp+select form in IR, and we already have this fold
for scalar select in SDAG, so I think it's an oversight that we don't have
the fold for vectors. It seems neutral for AArch64 and saves some instructions
on x86.
Whether we should also have the sibling folds for the inverse condition or
all-ones true value may depend on target-specific factors such as whether
there's an "and-not" instruction.
Differential Revision: https://reviews.llvm.org/D113212
Sanjay Patel [Thu, 4 Nov 2021 18:22:41 +0000 (14:22 -0400)]
[AArch64] add tests for vector select; NFC
Sanjay Patel [Thu, 4 Nov 2021 17:58:41 +0000 (13:58 -0400)]
[x86] add tests for vector select; NFC
Sanjay Patel [Wed, 3 Nov 2021 18:50:17 +0000 (14:50 -0400)]
[InstCombine] add signbit tests for icmp with trunc; NFC
LLVM GN Syncbot [Fri, 5 Nov 2021 13:54:25 +0000 (13:54 +0000)]
[gn build] Port
7a98761d74db
Roman Lebedev [Fri, 5 Nov 2021 13:50:24 +0000 (16:50 +0300)]
[IR][ShuffleVector] Introduce `isReplicationMask()` matcher
Avid readers of this saga may recall from previous installments,
that replication mask replicates (lol) each of the `VF` elements
in a vector `ReplicationFactor` times. For example, the mask for
`ReplicationFactor=3` and `VF=4` is: `<0,0,0,1,1,1,2,2,2,3,3,3>`.
More importantly, replication mask is used by LoopVectorizer
when using masked interleaved memory operations.
As discussed in previous installments, while it is used by LV,
and we **seem** to support masked interleaved memory operations on X86,
it's support in cost model leaves a lot to be desired:
until basically yesterday even for AVX512 we had no cost model for it.
As it has been witnessed in the recent
AVX2 `X86TTIImpl::getInterleavedMemoryOpCost()`
costmodel patches, while it is hard-enough to query the cost
of a particular assembly sequence [from llvm-mca],
afterwards the check lines LV costmodel tests must be updated manually.
This is, at the very least, boring.
Okay, now we have decent costmodel coverage for interleaving shuffles,
but now basically the same mind-killing sequence has to be performed
for replication mask. I think we can improve at least the second half
of the problem, by teaching
the `TargetTransformInfoImplCRTPBase::getUserCost()` to recognize
`Instruction::ShuffleVector` that are repetition masks,
adding exhaustive test coverage
using `-cost-model -analyze` + `utils/update_analyze_test_checks.py`
This way we can have good exhaustive coverage for cost model,
and only basic coverage for the LV costmodel.
This patch adds precise undef-aware `isReplicationMask()`,
with exhaustive test coverage.
* `InstructionsTest.ShuffleMaskIsReplicationMask` shows that
it correctly detects all the known masks.
* `InstructionsTest.ShuffleMaskIsReplicationMask_undef`
shows that replacing some mask elements in a known replication mask
still allows us to recognize it as a replication mask.
Note, with enough undef elts, we may detect a different tuple.
* `InstructionsTest.ShuffleMaskIsReplicationMask_Exhaustive_Correctness`
shows that if we detected the replication mask with given params,
then if we actually generate a true replication mask with said params,
it matches element-wise ignoring undef mask elements.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D113214
Roman Lebedev [Fri, 5 Nov 2021 13:50:23 +0000 (16:50 +0300)]
[NFC] Move CombinationGenerator from Exegesis to ADT
Reviewed By: courbet
Differential Revision: https://reviews.llvm.org/D113213
David Sherwood [Thu, 4 Nov 2021 15:20:16 +0000 (15:20 +0000)]
[AArch64] Add target DAG combine for UUNPKHI/LO
When created a UUNPKLO/HI node with an undef input then the
output should also be undef. I've added a target DAG combine
function to ensure we avoid creating an unnecessary uunpklo/hi
instruction.
Differential Revision: https://reviews.llvm.org/D113266
Quinn Pham [Wed, 3 Nov 2021 19:41:24 +0000 (14:41 -0500)]
[NFC] Inclusive language: Remove instances of master in URLs
[NFC] This patch fixes URLs containing "master". Old URLs were either broken or
redirecting to the new URL.
Reviewed By: #libc, ldionne, mehdi_amini
Differential Revision: https://reviews.llvm.org/D113186
Simon Pilgrim [Fri, 5 Nov 2021 13:18:53 +0000 (13:18 +0000)]
[DAG] FoldConstantArithmetic - rename NumOps -> NumElts. NFC.
NumOps represents the number of elements for vector constant folding, rename this NumElts so in future we can the consistently use NumOps to represent the number of operands of the opcode.
Minor cleanup before trying to begin generalizing FoldConstantArithmetic to support opcodes other than binops.
Nico Weber [Fri, 5 Nov 2021 13:17:59 +0000 (09:17 -0400)]
[gn build] (manually) port
df0ba47c36f
Jingu Kang [Fri, 5 Nov 2021 10:59:42 +0000 (10:59 +0000)]
[AArch64] Fix a bug from a pattern for uaddv(uaddlp(x)) ==> uaddlv
A pattern has selected wrong uaddlv MI. It should be as below.
uaddv(uaddlp(v8i8)) ==> uaddlv(v8i8)
Differential Revision: https://reviews.llvm.org/D113263
Alfredo Dal'Ava Junior [Fri, 5 Nov 2021 12:23:24 +0000 (07:23 -0500)]
[FreeBSD] Do not mark __stack_chk_guard as dso_local
This symbol is defined in libc.so so it is definitely not DSO-Local.
Marking it as such causes problems on some platforms (such as PowerPC).
Differential revision: https://reviews.llvm.org/D109090
Martin Liska [Thu, 4 Nov 2021 07:54:14 +0000 (08:54 +0100)]
Enable -Wformat-pedantic and fix fallout.
Differential Revision: https://reviews.llvm.org/D113172
Simon Pilgrim [Fri, 5 Nov 2021 12:00:47 +0000 (12:00 +0000)]
[DAG] FoldConstantArithmetic - fold bitlogic(bitcast(x),bitcast(y)) -> bitcast(bitlogic(x,y))
To constant fold bitwise logic ops where we've legalized constant build vectors to a different type (e.g. v2i64 -> v4i32), this patch adds a basic ability to peek through the bitcasts and perform the constant fold on the inner operands.
The MVE predicate v2i64 regressions will be addressed by future support for basic v2i64 type support.
One of the yak shaving fixes for D113192....
Differential Revision: https://reviews.llvm.org/D113202
David Green [Fri, 5 Nov 2021 12:00:03 +0000 (12:00 +0000)]
[InstCombine] Add additional tests for converting to sadd.sat with sign bits. NFC
Valentin Clement [Fri, 5 Nov 2021 11:54:12 +0000 (12:54 +0100)]
[fir] Add fir.select and fir.select_rank FIR to LLVM IR conversion patterns
The `fir.select` and `fir.select_rank` are lowered to llvm.switch.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D113089
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Fraser Cormack [Mon, 1 Nov 2021 16:41:46 +0000 (16:41 +0000)]
[LangRef][VP] Document vp.gather and vp.scatter intrinsics
This patch fleshes out the missing documentation for the final two VP
intrinsics introduced in D99355: `llvm.vp.gather` and `llvm.vp.scatter`.
It does so mostly by deferring to the `llvm.masked.gather` and
`llvm.masked.scatter` intrinsics, respectively.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D112997
Alex Zinenko [Fri, 5 Nov 2021 11:05:02 +0000 (12:05 +0100)]
[mlir][python] fix constructor generation for optional operands in presence of segment attribute
The ODS-based Python op bindings generator has been generating incorrect
specification of the operand segment in presence if both optional and variadic
operand groups: optional groups were treated as variadic whereas they require
separate treatement. Make sure it is the case. Also harden the tests around
generated op constructors as they could hitherto accept the code for both
optional and variadic arguments.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D113259
Simon Pilgrim [Fri, 5 Nov 2021 11:00:19 +0000 (11:00 +0000)]
[X86] Enable v32i16 rotate lowering on non-BWI targets
Fixes one of the regressions in D113192
David Green [Fri, 5 Nov 2021 10:57:38 +0000 (10:57 +0000)]
[ARM] Extra MVE constant select test. NFC
Fraser Cormack [Mon, 1 Nov 2021 14:40:09 +0000 (14:40 +0000)]
[LangRef][VP] Document vp.load and vp.store intrinsics
This patch fleshes out the missing documentation for two of the VP
intrinsics introduced in D99355: `llvm.vp.load` and `llvm.vp.store`. It
does so mostly by deferring to the `llvm.masked.load` and
`llvm.masked.store` intrinsics, respectively.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D112930
Clement Courbet [Fri, 5 Nov 2021 09:45:28 +0000 (10:45 +0100)]
[Sema][NFC] Add tests for builtin spaceship operator.
In preparation for D112453.
Riccardo Mori [Fri, 5 Nov 2021 10:14:39 +0000 (11:14 +0100)]
[Polly][Isl] Use the function unsignedFromIslSize to manage a isl::size object. NFCI
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in lib/External/isl/include/isl/isl-noxceptions.h and the official isl C++ interface.
In the official interface the type `isl::size` cannot be casted to an unsigned without previously having checked if it contains a valid value with the function `isl::size::is_error()`.
For this reason two helping functions have been added:
- `IslAssert`: assert that no errors are present in debug builds and just disables the mandatory error check in non-debug builds
- `unisgnedFromIslSIze`: cast the `isl::size` object to `unsigned`
Changes made:
- Add the functions `IslAssert` and `unsignedFromIslSize`
- Add the utility function `rangeIslSize()`
- Retype `MaxDisjunctsInDomain` from `int` to `unsigned`
- Retype `RunTimeChecksMaxAccessDisjuncts` from `int` to `unsigned`
- Retype `MaxDimensionsInAccessRange` from `int` to `unsigned`
- Replaced some usages of `isl_size` to `unsigned` since we aim not to use `isl_size` anymore
- `isl-noexceptions.h` has been generated by https://github.com/patacca/isl/commit/
e704f73c88f0b4d88e62e447bdb732cf5914094b
No functional change intended.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D113101
Chen Zheng [Fri, 5 Nov 2021 03:22:17 +0000 (03:22 +0000)]
[PowerPC] use correct selection for v16i8/v8i16 splat load
Reviewed By: nemanjai
Differential Revision: https://reviews.llvm.org/D113236
Jay Foad [Fri, 5 Nov 2021 09:53:35 +0000 (09:53 +0000)]
Revert "[TwoAddressInstructionPass] Update existing physreg live intervals"
This reverts commit
ec0e1e88d24fadb2cb22f431d66b22ee1b01cd43.
It was pushed by mistake.
Jay Foad [Fri, 5 Nov 2021 08:22:09 +0000 (08:22 +0000)]
[AMDGPU] NFC formatting fixes in SIMemoryLegalizer
Jay Foad [Thu, 4 Nov 2021 13:43:09 +0000 (13:43 +0000)]
[TwoAddressInstructionPass] Update existing physreg live intervals
In TwoAddressInstructionPass::processTiedPairs with
-early-live-intervals, update any preexisting physreg live intervals,
as well as virtreg live intervals. By default (without
-precompute-phys-liveness) physreg live intervals only exist for
registers that are live-in to some basic block.
Differential Revision: https://reviews.llvm.org/D113191
Matthias Springer [Fri, 5 Nov 2021 08:47:44 +0000 (17:47 +0900)]
[mlir][linalg][bufferize] Move bufferizesToAliasOnly to extraClassDecls
By doing so, the method can no longer be reimplemented.
Differential Revision: https://reviews.llvm.org/D113248
Christian Sigg [Thu, 4 Nov 2021 08:05:53 +0000 (09:05 +0100)]
Fix `insertFunctionArguments()` block argument order.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D113171
Tres Popp [Fri, 5 Nov 2021 09:04:14 +0000 (10:04 +0100)]
Add Bazel support for LLVM_WINDOWS_PREFER_FORWARD_SLASH
This was added in
df0ba47c36f6bd0865e3286853b76d37e037c2d7
Qiu Chaofan [Fri, 5 Nov 2021 08:58:38 +0000 (16:58 +0800)]
[PowerPC] Add intrinsic to convert between ppc_fp128 and fp128
ppc_fp128 and fp128 are both 128-bit floating point types. However, we
can't do conversion between them now, since trunc/ext are not allowed
for same-size fp types.
This patch adds two new intrinsics: llvm.ppc.convert.f128.to.ppcf128 and
llvm.convert.ppcf128.to.f128, to support such conversion.
Reviewed By: shchenz
Differential Revision: https://reviews.llvm.org/D109421
Martin Storsjö [Wed, 13 Oct 2021 12:18:32 +0000 (12:18 +0000)]
[Support] Allow configuring the preferred type of slashes on Windows
Default to preferring forward slashes when built for MinGW, as
many usecases, when e.g. Clang is used as a drop-in replacement
for GCC, requires the compiler to output paths with forward slashes.
Not all tests pass yet, if configuring to prefer forward slashes though.
Differential Revision: https://reviews.llvm.org/D112787
Martin Storsjö [Tue, 5 Oct 2021 10:17:36 +0000 (10:17 +0000)]
[Support] [Windows] Convert paths to the preferred form
This normalizes most paths (except ones input from the user as command
line arguments) into the preferred form, if `real_style()` evaluates to
`windows_forward`.
Differential Revision: https://reviews.llvm.org/D111880
Martin Storsjö [Mon, 4 Oct 2021 14:17:00 +0000 (17:17 +0300)]
[Support] Add a new path style for Windows with forward slashes
This behaves just like the regular Windows style, with both separator
forms accepted, but with get_separator() returning forward slashes.
Add a more descriptive name for the existing style, keeping the old
name around as an alias initially.
Add a new function `make_preferred()` (like the C++17
`std::filesystem::path` function with the same name), which converts
windows paths to the preferred separator form (while this one works on
any platform and takes a `path::Style` argument).
Contrary to `native()` (just like `make_preferred()` in `std::filesystem`),
this doesn't do anything at all on Posix, it doesn't try to reinterpret
backslashes into forward slashes there.
Differential Revision: https://reviews.llvm.org/D111879
Martin Storsjö [Fri, 5 Nov 2021 08:12:20 +0000 (10:12 +0200)]
Revert "[Attr] support btf_type_tag attribute"
This reverts commits
737e4216c537c33aab8ec51880f06b8a54325b94 and
ce7ac9e66aba2b937b3d3b5505ce6cc75dcc56ac.
After those commits, the compiler can crash with a reduced
testcase like this:
$ cat reduced.c
void a(*);
void a() {}
$ clang -c reduced.c -O2 -g
Martin Storsjö [Fri, 10 Sep 2021 19:14:48 +0000 (22:14 +0300)]
[libunwind] Try to add --unwindlib=none while configuring and building libunwind
If Clang is set up to link directly against libunwind (via the
--unwindlib option, or the corresponding builtin default option),
configuring libunwind will fail while bootstrapping (before the
initial libunwind is built), because every cmake test will
fail due to -lunwind not being found, and linking the shared library
will fail similarly.
Check if --unwindlib=none is supported, and add it in that case.
Using check_c_compiler_flag on its own doesn't work, because that only
adds the tested flag to the compilation command, and if -lunwind is
missing, the linking step would still fail - instead try adding it
to CMAKE_REQUIRED_FLAGS and restore the variable if it doesn't work.
This avoids having to pass --unwindlib=none while building libunwind.
Differential Revision: https://reviews.llvm.org/D112126
Markus Lavin [Fri, 5 Nov 2021 07:38:57 +0000 (08:38 +0100)]
[NPM] Fix bug in llvm/utils/reduce_pipeline.py
Last minute changes in https://reviews.llvm.org/D110908 unfortunately
introduced a bug wrt automatic pipeline expansion. This patch fixes that
as well as gets rid of a few redundant variables.
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D113177
Vitaly Buka [Fri, 5 Nov 2021 06:50:57 +0000 (23:50 -0700)]
[asan] compiler-rt version of D113143
David Blaikie [Fri, 5 Nov 2021 03:45:29 +0000 (20:45 -0700)]
Fix some issues with the gdb pretty printers for llvm::Twine
Still some pending bugs, but at least ironed some things out.
Michael Kruse [Fri, 5 Nov 2021 05:03:26 +0000 (00:03 -0500)]
[Preprocessor] Fix newline before/after _Pragma.
The PragmaAssumeNonNullHandler (and maybe others) passes an invalid
SourceLocation to its callback, hence PrintPreprocessedOutput does not
know how many lines to insert between the previous token and the
pragma and does nothing.
With this patch we instead assume that the unknown token is on the same
line as the previous such that we can call the procedure that also emits
semantically significant whitespace.
Fixes bug reported here: https://reviews.llvm.org/D104601#3105044
Michael Kruse [Fri, 5 Nov 2021 05:13:49 +0000 (00:13 -0500)]
[Preprocessor] Fix warning: left and right subexpressions are identical. NFCI.
This is reported by msvc as
warning C6287: redundant code: the left and right subexpressions are identical
EmittedDirectiveOnThisLine implies EmittedTokensOnThisLine
making this an NFC change. To be on the safe side and because both of
them are checked at other places as well, we continue to check both.
Compiler warning reported here:
https://reviews.llvm.org/D104601#2957333
Chen Zheng [Fri, 5 Nov 2021 05:02:23 +0000 (05:02 +0000)]
[PowerPC] address post-commit comments for D106555; NFC
Address namanjai post commit comments.
Keith Smiley [Fri, 5 Nov 2021 02:53:18 +0000 (19:53 -0700)]
[lld-macho] Replace LC_LINKER_OPTION parsing
This removes the tablegen based parsing of LC_LINKER_OPTION since it can
only actually contain a very small number of potential arguments. In our
project with tablegen this took 5 seconds before.
This replaces https://reviews.llvm.org/D113075
Differential Revision: https://reviews.llvm.org/D113235
Matthias Springer [Fri, 5 Nov 2021 04:55:47 +0000 (13:55 +0900)]
[mlir][linalg][bufferize] Separate pass from ComprehensiveBufferize
This commit separates the bufferization from the bufferization pass in Linalg. This allows other dialects to use ComprehensiveBufferize more easily.
This commit mainly moves files to a new directory and adds a new build target.
Differential Revision: https://reviews.llvm.org/D112989
Fangrui Song [Fri, 5 Nov 2021 04:28:33 +0000 (21:28 -0700)]
[lld-macho] Fix an assertion failure when -u specifies an undefined section$start symbol
This matches ld64. Also improve the test for `-dead_strip`.
Reviewed By: #lld-macho, Jez Ng
Differential Revision: https://reviews.llvm.org/D113147
Shengchen Kan [Fri, 5 Nov 2021 03:02:10 +0000 (11:02 +0800)]
[X86][MS-InlineAsm][test] Add triple in ms-inline-asm-array.ll
Fix the LIT test fail on Mac, which is reported in D113096.
Matthias Springer [Fri, 5 Nov 2021 02:55:15 +0000 (11:55 +0900)]
[mlir][linalg][bufferize][NFC] Simplify AllocationCallbacks
AllocationCallbacks functions allocate/deallocate only. They no longer set the insertion point.
This is in preparation of decoupling ComprehensiveBufferize from the Linalg dialect.
Differential Revision: https://reviews.llvm.org/D112991
Matthias Springer [Fri, 5 Nov 2021 02:40:12 +0000 (11:40 +0900)]
[mlir][linalg][bufferize] Decouple BufferizationAliasInfo
Move dialect-specific and analysis-specific function out of BufferizationAliasInfo. BufferizationAliasInfo's only job now is to keep track of aliases.
This is in preparation of futher decoupling ComprehensiveBufferize from various dialects.
Differential Revision: https://reviews.llvm.org/D112992
Matthias Springer [Fri, 5 Nov 2021 02:29:46 +0000 (11:29 +0900)]
[mlir][linalg][bufferize] Add isWritable to op interface
By default, OpResult buffers are writable. But there are ops (e.g., ConstantOp) for which this is not the case.
The purpose of this commit is to further decouple Comprehensive Bufferize from the Standard dialect.
Differential Revision: https://reviews.llvm.org/D112908