James Y Knight [Fri, 6 Jan 2023 18:26:03 +0000 (13:26 -0500)]
Cleanup unwind table emission code a bit.
This change removes the `tidyLandingPads` function, which previously
had a few responsibilities:
1. Dealing with the deletion of an invoke, after MachineFunction lowering.
2. Dealing with the deletion of a landing pad BB, after MachineFunction lowering.
3. Cleaning up the type-id list generated by `MachineFunction::addLandingPad`.
Case 3 has been fixed in the generator, and the others are now handled
during table emission.
This change also removes `MachineFunction`'s `addCatchTypeInfo`,
`addFilterTypeInfo`, and `addCleanup` helper fns, as they had a single
caller, and being outlined didn't make it simpler.
Finally, as calling `tidyLandingPads` was effectively the only thing
`DwarfCFIExceptionBase` did, that class has been eliminated.
James Y Knight [Fri, 6 Jan 2023 15:11:44 +0000 (10:11 -0500)]
Remove special cases for invoke of non-throwing inline-asm.
Non-throwing inline asm infers the nounwind attribute in
instcombine. Thus, it can be handled in the same manner as
non-throwing target functions are generally. Further special casing is
unnecessary complexity.
Rob Suderman [Fri, 6 Jan 2023 18:13:32 +0000 (10:13 -0800)]
[mlir][tosa] Add tosa.conv3d lowering to Linalg
Conv3D has an existing linalg operation for floating point. Adding a quantized
variant and corresponding lowering from TOSA. Numerical correctness was validated
using the TOSA conformance tests.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D140919
Jason Molenda [Fri, 6 Jan 2023 18:45:07 +0000 (10:45 -0800)]
When loading mach-o corefile, new fallback for finding images
When lldb is reading a user process corefile, it starts by finding
dyld, then finding the dyld_all_image_infos structure in dyld by
symbol name, then getting the list of loaded binaries. If it fails
to find the structure by name, it can't load binaries. There is
an additional fallback that this patch adds, which is to look for
this object by the section name it is stored in, if the symbol name
lookup fails.
Differential Revision: https://reviews.llvm.org/D140066
rdar://
103369931
ziqingluo-90 [Fri, 6 Jan 2023 18:33:21 +0000 (10:33 -0800)]
Re-land "[-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations"
This reverts commit
22df4549a3718dcd8b387ba8246978349e4be50c.
After a quick investigation, realizing that the Sanitizer test
failures caused by this patch is not likely to block other
contributors. I re-land this patch before taking a closer look at
those tests so that it won't block the [-Wunsafe-buffer-usage]
development.
Stephen Tozer [Fri, 6 Jan 2023 18:21:11 +0000 (18:21 +0000)]
Fix: Title underline too short in D129372
This patch fixes an error in commit
e10e9363 in which the
added documentation contained an incorrectly-styled underline
for the title "Debug Instruction Reference Operands".
Stephen Tozer [Thu, 15 Sep 2022 10:26:57 +0000 (11:26 +0100)]
[DebugInfo][NFC] Add new MachineOperand type and change DBG_INSTR_REF syntax
This patch makes two notable changes to the MIR debug info representation,
which result in different MIR output but identical final DWARF output (NFC
w.r.t. the full compilation). The two changes are:
* The introduction of a new MachineOperand type, MO_DbgInstrRef, which
consists of two unsigned numbers that are used to index an instruction
and an output operand within that instruction, having a meaning
identical to first two operands of the current DBG_INSTR_REF
instruction. This operand is only used in DBG_INSTR_REF (see below).
* A change in syntax for the DBG_INSTR_REF instruction, shuffling the
operands to make it resemble DBG_VALUE_LIST instead of DBG_VALUE,
and replacing the first two operands with a single MO_DbgInstrRef-type
operand.
This patch is the first of a set that will allow DBG_INSTR_REF
instructions to refer to multiple machine locations in the same manner
as DBG_VALUE_LIST.
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D129372
Casey Carter [Fri, 6 Jan 2023 03:28:21 +0000 (19:28 -0800)]
[libc++][test] Suppress MSVC warnings in std::expected tests
* initializing `short`s with `short`s instead of `int`s to avoid narrowing warnings
* Explicitly discard the result of `value` calls to avoid `[[nodiscard]]` warnings
Drive-by: `testException` from `value` test is duplicated in `value_or` test; remove the duplicate.
Differential Review: https://reviews.llvm.org/D141108
Kai Nacke [Fri, 18 Nov 2022 19:12:01 +0000 (19:12 +0000)]
[PPC] Add support for tune-cpu attribute
clang (like gcc) has the -mtune= command line option. This option
adds the "tune-cpu" attribute to a function. The intended functionality
is that the scheduling model of that cpu is used. E.g. -mtune=pwr9 -march=pwr8
generates only instructions supported on pwr8 but uses the scheduling model
of pwr9 for it.
This PR adds the infrastructure to support this in LLVM.
clang support was added in https://reviews.llvm.org/D130526.
Reviewed By: amyk, qiucf
Differential Revision: https://reviews.llvm.org/D138317
LiDongjin [Fri, 6 Jan 2023 17:54:19 +0000 (09:54 -0800)]
Recommit "[RISCV] Enable the LocalStackSlotAllocation pass support"
This includes a fix for the tramp3d failure from the llvm-testsuite
that caused the last revert. Hopefully the others failures were the
same issue.
Original commit message:
For RISC-V, load/store(exclude vector load/store) instructions only has a 12 bit immediate operand. If the offset is out-of-range, it must make use of a temp register to make up this offset. If between these offsets, they have a small(IsInt<12>) relative offset, LocalStackSlotAllocation pass can find a value as frame base register's value, and replace the origin offset with this register's value plus the relative offset.
Co-authored-by: luxufan <luxufan@iscas.ac.cn>
Co-authored-by: Craig Topper <craig.topper@sifive.com>
Differential Revision: https://reviews.llvm.org/D98101
Alex Richardson [Fri, 6 Jan 2023 14:59:24 +0000 (14:59 +0000)]
Re-gernerate a test in preparation for D141060
Alex Zinenko [Fri, 6 Jan 2023 16:09:28 +0000 (17:09 +0100)]
[mlir] improve error handling in Linalg op splitting
In several cases, the splitting may be known to be a noop, i.e., produce
no second part. Thread this information through the transform utilities
to the transform dialect, and differentiate it from the error state.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D141138
Thomas Raoux [Thu, 5 Jan 2023 21:20:45 +0000 (21:20 +0000)]
[mlir][nvvm] Add lowering of gpu.printf to nvvm
When converting to nvvm lowering gpu.printf to vprintf allows us to
support printing when running on cuda.
Differential Revision: https://reviews.llvm.org/D141049
Alexey Bataev [Wed, 21 Dec 2022 21:38:38 +0000 (13:38 -0800)]
[SLP]Fix cost of the broadcast buildvector/gather.
Need to include the cost of the initial insertelement to the cost of the
broadcasts. Also, need to adjust the cost of the gather/buildvector if
the element is inserted into poison/undef vector.
Differential Revision: https://reviews.llvm.org/D140498
Craig Topper [Fri, 6 Jan 2023 16:39:14 +0000 (08:39 -0800)]
[RISCV] Improve 4x and 8x (s/u)int_to_fp.
Previously we emitted a 4x or 8x vzext followed by a vfcvt.
We can instead use a 2x or 4x vzext followed by a vfwcvt.
Nikita Popov [Fri, 6 Jan 2023 16:33:53 +0000 (17:33 +0100)]
Revert "[Dominator] Add findNearestCommonDominator() for Instructions (NFC)"
This reverts commit
7f0de9573f758f5f9108795850337a5acbd17eef.
This is missing handling for !isReachableFromEntry() blocks, which
may be relevant for some callers. Revert for now.
Craig Topper [Fri, 6 Jan 2023 16:29:23 +0000 (08:29 -0800)]
[RISCV] Add more XVentanaCondOps patterns.
Add patterns with seteq/setne conditions.
We don't have instructions for seteq/setne except for comparing
with zero and need to emit an ADDI or XOR before a seqz/snez to
compare other values.
The select ISD node takes a 0/1 value for the condition, but the
VT_MASKC(N) instructions check all XLen bits for zero or non-zero.
We can use this to avoid the seqz/snez in many cases.
This is pretty ridiculous number of patterns. I wonder if we could
use some ComplexPatterns to merge them, but I'd like to do that as
a follow up and focus on correctness of the result in this patch.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D140421
Nikita Popov [Fri, 6 Jan 2023 16:28:18 +0000 (17:28 +0100)]
[GVN] Name instructions in test (NFC)
Nikita Popov [Fri, 6 Jan 2023 16:25:09 +0000 (17:25 +0100)]
[EntryExitInstrumenter] Convert test to opaque pointers (NFC)
Craig Topper [Fri, 6 Jan 2023 16:20:37 +0000 (08:20 -0800)]
[RISCV] Add support for the vscale_range attribute.
This is based on @frasercrmck's D107290. At least some of the clang
portion of D107290 has already been committed.
This uses vscale_range for min/max vector width unless the command
line overrides are used.
As a follow up, I plan to add a max or exact VLEN option to clang
to control the vscale_range. This will eliminate many of the reasons
for users to use the overrides through the -mllvm interface.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D139873
Thomas Raoux [Fri, 6 Jan 2023 16:09:21 +0000 (16:09 +0000)]
[mlir][vector] Relax restriction on reduction distribution
Relax unnecessary restriction when distribution a vector.reduce op.
All the float and integer types can be supported by user's lambda.
Differential Revision: https://reviews.llvm.org/D141094
Sylvestre Ledru [Fri, 6 Jan 2023 16:12:03 +0000 (17:12 +0100)]
flang: break the build on 32bit systems
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D141132
Sylvestre Ledru [Fri, 6 Jan 2023 16:09:21 +0000 (17:09 +0100)]
Doc: improve the flang readme page
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D141126
Nikita Popov [Fri, 6 Jan 2023 15:56:34 +0000 (16:56 +0100)]
[Dominator] Add findNearestCommonDominator() for Instructions (NFC)
This is a recurring pattern: We want to find the nearest common
dominator (instruction) for two instructions, but currently only
provide an API for the nearest common dominator of two basic blocks.
Add an overload that accepts and return instructions.
LLVM GN Syncbot [Fri, 6 Jan 2023 15:46:03 +0000 (15:46 +0000)]
[gn build] Port
16c1c9fdcc48
Luke Lau [Thu, 5 Jan 2023 18:27:12 +0000 (18:27 +0000)]
[SelectionDAG] Implicitly truncate known bits in SPLAT_VECTOR
Now that D139525 fixes the Hexagon infinite loop, the stopgap can be
removed to provide more information about known bits in SPLAT_VECTOR
whose operands are smaller than the bit width (which is most of the
time)
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D141075
Luke Lau [Fri, 6 Jan 2023 11:30:09 +0000 (11:30 +0000)]
[WebAssembly][NFC] Add test case for PR59626
For D141079
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D141120
Guillaume Chatelet [Fri, 6 Jan 2023 15:31:46 +0000 (15:31 +0000)]
Revert D140263 "[NFC] Vastly simplifies TypeSize"
This broke some build bots : https://lab.llvm.org/buildbot/#/builders/16/builds/41419/steps/5/logs/stdio
This reverts commit
4670d5ece57d9b030597da679072f78bb3f4d419.
David Green [Fri, 6 Jan 2023 15:32:38 +0000 (15:32 +0000)]
[LoopFlattening] Check for extra uses on Mul
Similar to D138404, we were not guarding against extra uses of the Mul.
In most cases other checks would catch the issue due to unsupported
instructions in the outer loop, but certain non-canonical loop forms
could still get through.
Fixes #59339
Differential Revision: https://reviews.llvm.org/D141114
David Green [Fri, 6 Jan 2023 14:18:27 +0000 (14:18 +0000)]
[LoopFlatten][NFC] Run instnamer on pr59339.ll
Hassnaa Hamdi [Thu, 5 Jan 2023 16:10:50 +0000 (16:10 +0000)]
[AArch64][SME]: Make 'Expand' the default action for all Ops.
By default expand all operations, then change to Custom/Legal if needed.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D141068
Guillaume Chatelet [Fri, 6 Jan 2023 15:27:50 +0000 (15:27 +0000)]
Revert D141134 "[NFC] Only expose getXXXSize functions in TypeSize"
The patch should be discussed further.
This reverts commit
dd56e1c92b0e6e6be249f2d2dd40894e0417223f.
Guillaume Chatelet [Fri, 6 Jan 2023 14:47:21 +0000 (14:47 +0000)]
[NFC] Only expose getXXXSize functions in TypeSize
Currently 'TypeSize' exposes two functions that serve the same purpose:
- getFixedSize / getFixedValue
- getKnownMinSize / getKnownMinValue
source : https://github.com/llvm/llvm-project/blob/
bf82070ea465969e9ae86a31dfcbf94c2a7b4c4c/llvm/include/llvm/Support/TypeSize.h#L337-L338
This patch offers to remove one of the two and stick to a single function in the code base.
Differential Revision: https://reviews.llvm.org/D141134
Nikita Popov [Fri, 6 Jan 2023 15:10:47 +0000 (16:10 +0100)]
[StackLifetime] Fix sign compare warning (NFC)
Nikita Popov [Fri, 6 Jan 2023 14:58:49 +0000 (15:58 +0100)]
[MemCpyOpt] Extract processStoreOfLoad() method (NFC)
Joseph Huber [Fri, 6 Jan 2023 15:09:18 +0000 (09:09 -0600)]
[Libomptarget] Add more moves to expected conversion
Summary:
Fixes other instances of the same problem in the previous patch.
Joseph Huber [Fri, 6 Jan 2023 14:56:31 +0000 (08:56 -0600)]
[Libomptarget] Add move to expected conversion
Summary:
These implicit conversions from move-only types to expected seem to only
work with newer compilers. This should hopefully fix it.
Alex Zinenko [Fri, 6 Jan 2023 15:02:14 +0000 (16:02 +0100)]
[mlir] fix use-after-free on error path in transform dialect
Backl1ght [Fri, 6 Jan 2023 13:05:15 +0000 (21:05 +0800)]
[clang-format] fix template closer followed by >
fix https://github.com/llvm/llvm-project/issues/59785
Reviewed By: HazardyKnusperkeks, MyDeveloperDay, owenpan
Differential Revision: https://reviews.llvm.org/D140843
Nikita Popov [Fri, 6 Jan 2023 14:43:02 +0000 (15:43 +0100)]
[IR] Use isEntryBlock() API (NFC)
Nikita Popov [Fri, 6 Jan 2023 14:33:39 +0000 (15:33 +0100)]
[IR] Add AllocaInst::getAllocationSize() (NFC)
When fetching allocation sizes, we almost always want to have the
size in bytes, but we were only providing an InBits API. Also add
the corresponding byte-based conjugate to save some *8 and /8
juggling everywhere.
Sanjay Patel [Fri, 6 Jan 2023 13:49:19 +0000 (08:49 -0500)]
[SDAG] try to avoid multiply for X*Y==0
Forking this off from D140850 -
https://alive2.llvm.org/ce/z/TgBeK_
https://alive2.llvm.org/ce/z/STVD7d
We could almost justify doing this in IR, but consideration for
"minsize" requires that we only try it in codegen -- the
transform is not reversible.
In all other cases, avoiding multiply should be a win because a
mul is more expensive than simple/parallelizable compares. AArch
even has a trick to keep instruction count even for some types.
Differential Revision: https://reviews.llvm.org/D141086
Matt Arsenault [Fri, 30 Dec 2022 14:45:32 +0000 (09:45 -0500)]
AMDGPU/GlobalISel: Add missing test for implicit_def regbankselect
Matt Arsenault [Tue, 27 Dec 2022 23:26:54 +0000 (18:26 -0500)]
AMDGPU/GlobalISel: Add wave32 checks to bool test
Liming Liu [Fri, 6 Jan 2023 13:56:25 +0000 (05:56 -0800)]
[C++20] Determine the dependency of unevaluated lambdas more accurately
During template instantiation, the instantiator will enter constant
evaluated
context before instantiate a template argument originated from an
expression,
and this impedes the instantiator from creating lambdas with independent
types.
This patch solves the problem via widening the condition that the
instantiator
marks lambdas as never dependent, and fixes the issue #57960
Differential Revision: https://reviews.llvm.org/D140554
Jay Foad [Fri, 6 Jan 2023 11:09:36 +0000 (11:09 +0000)]
[AMDGPU] Add a feature for VALUTransUseHazard
NFCI. This just allows us to experiment with enabling/disabling the
workaround on different subtargets.
Differential Revision: https://reviews.llvm.org/D141121
Guillaume Chatelet [Fri, 6 Jan 2023 13:24:44 +0000 (13:24 +0000)]
[llvm-exegesis][NFC] Update benchmark phase naming to match documentation
Matthias Springer [Fri, 6 Jan 2023 13:24:30 +0000 (14:24 +0100)]
[mlir][memref] Add runtime verification for memref::CastOp
Verify unranked -> ranked casts and casts of dynamic sizes/offset/strides to static ones.
Differential Revision: https://reviews.llvm.org/D138671
Sanjay Patel [Thu, 5 Jan 2023 20:35:24 +0000 (15:35 -0500)]
[AArch64] add tests for x*y == 0; NFC
Sanjay Patel [Thu, 5 Jan 2023 19:58:56 +0000 (14:58 -0500)]
[x86] add tests for x*y == 0; NFC
Alex Richardson [Fri, 6 Jan 2023 13:23:10 +0000 (13:23 +0000)]
[UpdateTestChecks] Do not add --force-update to UTC_ARGS
Persisting this flag only introduces test churn.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D141124
Alex Richardson [Fri, 6 Jan 2023 13:20:11 +0000 (13:20 +0000)]
Make switch-to-lookup-large-types.ll more reliable
When larger integer types are natively supported simplifycfg will use an
inline constant instead of a global variable for this transform. I noticed
this while trying to automatically infer the datalayout from the target
triple in opt if it is not explicitly specified. Since the x86_64
datalayout includes "n8:16:32:64", this test started failing.
While touching this file also change i128 to i64 in the first test since
this was intended behaviour in the original commit.
Reviewed By: spatel, fhahn
Differential Revision: https://reviews.llvm.org/D141055
Nikita Popov [Fri, 6 Jan 2023 13:34:41 +0000 (14:34 +0100)]
[CallSiteSplitting] Convert test to opaque pointers (NFC)
Keeping the bitcasts here because this is in part testing the
(legal) bitcast after a musttail call, even though it's no longer
really relevant.
LLVM GN Syncbot [Fri, 6 Jan 2023 13:20:13 +0000 (13:20 +0000)]
[gn build] Port
4670d5ece57d
Guillaume Chatelet [Sat, 17 Dec 2022 17:48:36 +0000 (17:48 +0000)]
[NFC] Vastly simplifies TypeSize
Simplifies the implementation of `TypeSize` while retaining its interface.
There is no need for abstract concepts like `LinearPolyBase`, `UnivariateLinearPolyBase` or `LinearPolySize`.
Differential Revision: https://reviews.llvm.org/D140263
Luke Lau [Tue, 3 Jan 2023 19:37:16 +0000 (19:37 +0000)]
[WebAssembly] Explicitly add {z,s}ext so extends are selected
During DAG legalization, {u,s}itofp instructions on v2i8, v2i16, v4i8
and v4i16 types ended up being legalized into scalar instructions, when
they could just be extended to v2i32/v4i32 instead.
Fixes https://github.com/llvm/llvm-project/issues/57182
Differential Revision: https://reviews.llvm.org/D140916
Alex Zinenko [Tue, 3 Jan 2023 16:01:07 +0000 (16:01 +0000)]
[mlir] adapt TransformEachOpTrait to parameter values
Adapt the implementation of TransformEachOpTrait to the existence of
parameter values recently introduced into the transform dialect. In
particular, allow `applyToOne` hooks to return a list containing a mix
of `Operation *` that will be associated with handles and `Attribute`
that will be associated with parameter values by the trait
implementation of the transform interface's `apply` method.
Disentangle the "transposition" of the list of per-payload op partial
results to decrease its overall complexity and detemplatize the code
that doesn't really need templates. This removes the poorly documented
special handling for single-result ops with TransformEachOpTrait that
could have assigned null pointer values to handles.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D140979
Alex Zinenko [Mon, 2 Jan 2023 17:11:40 +0000 (17:11 +0000)]
[mlir] NFC: move DiagnosedSilenceableFailure to Utils in Transform dialect
It was originally placed in TransformInterfaces for convenience, but it
is really a generic utility. It may also create an include cycle between
TransformTypes and TransformInterfaces if the latter needs to include
the former because the former uses the failure util.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D140978
Alex Zinenko [Mon, 2 Jan 2023 13:58:53 +0000 (13:58 +0000)]
[mlir] NFC: rename TransformTypeInterface to TransformHandleTypeInterface
This makes it more consistent with the recently added
TransformParamTypeInterface.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D140977
Alex Zinenko [Mon, 2 Jan 2023 13:07:02 +0000 (13:07 +0000)]
[mlir] introduce parameters into the transofrm dialect
Introduce a new kind of values into the transform dialect -- parameter
values. These values have a type implementing the new
`TransformParamTypeInterface` and are associated with lists of
attributes rather than lists of payload operations. This mechanism
allows one to wrap numeric calculations, typically heuristics, into
transform operations separate from those at actually applying the
transformation. For example, tile size computation can be now separated
from tiling itself, and not hardcoded in the transform dialect. This
further improves the separation of concerns between transform choice and
implementation.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D140976
Benjamin Kramer [Fri, 6 Jan 2023 11:51:01 +0000 (12:51 +0100)]
[bazel] Add missing :Support dependency after
1b8224537070
Matthias Springer [Fri, 6 Jan 2023 10:59:30 +0000 (11:59 +0100)]
[mlir][tensor] Support parallel_insert_slice in MergeConsecutiveInsertExtractSlicePatterns.cpp
Differential Revision: https://reviews.llvm.org/D141116
Matthias Springer [Fri, 6 Jan 2023 10:59:41 +0000 (11:59 +0100)]
[mlir][linalg] Swap extract_slice(fill(x)) ops
This pattern is similar to `FoldFillWithTensorReshape`, which performs the same swapping with reshapes.
Fill the smaller extracted tensor slice instead of `x`. This allows for additional simplifications in case `x` is the result of another extract_slice.
Differential Revision: https://reviews.llvm.org/D141117
Balázs Kéri [Fri, 6 Jan 2023 10:21:41 +0000 (11:21 +0100)]
[clang][analyzer] Extend StreamChecker with some new functions.
The stream handling functions `ftell`, `rewind`, `fgetpos`, `fsetpos`
are evaluated in the checker more exactly than before.
New tests are added to test behavior of the checker together with
StdLibraryFunctionsChecker. The option ModelPOSIX of that checker
affects if (most of) the stream functions are recognized, and checker
StdLibraryFunctionArgs generates warnings if constraints for arguments
are not satisfied. The state of `errno` is set by StdLibraryFunctionsChecker
too for every case in the stream functions.
StreamChecker works with the stream state only, does not set the errno state,
and is not dependent on other checkers.
Reviewed By: Szelethus
Differential Revision: https://reviews.llvm.org/D140395
Nikita Popov [Fri, 6 Jan 2023 11:09:52 +0000 (12:09 +0100)]
[Transforms] Convert some tests to opaque pointers (NFC)
Ties Stuij [Fri, 6 Jan 2023 10:09:46 +0000 (10:09 +0000)]
[AArch64] add GlobalIsel support for scalar CNT instruction
When feature CSSC is available we should use instruction CNT for s32, s64 and
s128 types in GlobalIsel's G_CTPOP.
spec:
https://developer.arm.com/documentation/ddi0602/2022-09/Base-Instructions/CNT--Count-bits-
Reviewed By: aemerson
Differential Revision: https://reviews.llvm.org/D139417
Nikita Popov [Fri, 6 Jan 2023 11:07:06 +0000 (12:07 +0100)]
[GlobalSplit] Convert test to opaque pointers (NFC)
Nikita Popov [Fri, 6 Jan 2023 11:02:52 +0000 (12:02 +0100)]
[ConstantFold] Don't drop zero index gep with inrange attribute
This may cause GlobalSplit to fail if opaque pointers are used.
inrange really needs a new representation, but for now restore the
pre-opaque pointers status.
OCHyams [Fri, 6 Jan 2023 10:58:12 +0000 (10:58 +0000)]
NFC Address review comment for D140905
Florian Hahn [Fri, 6 Jan 2023 10:56:17 +0000 (10:56 +0000)]
[LV] Disable runtime unrolling for vectorized loops.
This patch adds metadata to disable runtime unrolling to the vectorized
loop. If runtime unrolling/interleaving is considered profitable, LV
will interleave the loop directly. There should be no need to perform
runtime unrolling at a later stage.
Note that we already add metadata to disable runtime unrolling to the
scalar loop after vectorization.
The additional unrolling unnecessarily increases code size and compile
time. In addition to that we have several bug reports of unncessary
runtime unrolling for vectorized loops, e.g. PR40961
Compile-time improvements:
NewPM-O3: -1.04%
NewPM-ReleaseThinLTO: -0.59%
NewPM-ReleaseLTO-g: -0.97%
https://llvm-compile-time-tracker.com/compare.php?from=
ce1be13a868d0f8afa367975558c1a6175cce33a&to=
78bc2e67f22e9e10e61cdb6cdac4bb857d95eb1b&stat=instructions:u
Fixes #40306.
Reviewed By: lebedev.ri, nikic
Differential Revision: https://reviews.llvm.org/D115261
OCHyams [Fri, 6 Jan 2023 10:49:13 +0000 (10:49 +0000)]
[DebugInfo] Replace UndefValue with PoisonValue in setKillLocation
This helps towards the effort to remove UndefValue from LLVM.
Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value
Reviewed By: nlopes
Differential Revision: https://reviews.llvm.org/D140905
Nikita Popov [Fri, 6 Jan 2023 10:47:32 +0000 (11:47 +0100)]
[LoopUnroll] Convert test to opaque pointers (NFC)
Nikita Popov [Fri, 6 Jan 2023 10:46:59 +0000 (11:46 +0100)]
[LoopUnroll] Name instructions in test (NFC)
Mehdi Amini [Thu, 5 Jan 2023 19:28:48 +0000 (19:28 +0000)]
Apply clang-tidy fixes for performance-unnecessary-value-param in SparseTensorCodegen.cpp (NFC)
Nikita Popov [Fri, 6 Jan 2023 10:19:48 +0000 (11:19 +0100)]
[LoopIdiom] Convert tests to opaque pointers (NFC)
The differences here are due to SCEVExpander producing GEPs with
explicit offset calculation, a known difference with opaque pointers.
Luke Lau [Thu, 5 Jan 2023 17:46:22 +0000 (17:46 +0000)]
[cmake] Add llvm-debuginfod as test dependency
llvm-debuginfod is used by llvm-lit as of
36f01909a0e29c1014301ed6835687a84bf0e9fa, so adding this dependency
fixes a "note: Did not find llvm-debuginfod" warning from showing up
when running tests.
Differential Revision: https://reviews.llvm.org/D141071
OCHyams [Fri, 6 Jan 2023 09:16:50 +0000 (09:16 +0000)]
[DebugInfo] Prefer setKillLocation rather than replacing operands with undef
NFC-ish. There is a functional change but the outputs are semantically
identical. Where we might've before replaced one operand with undef (which
means "this is a kill location marker") the use of `setKillLocation` will
replace all location operands with `undef` (which also means "this is a kill
location marker").
Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value
Reviewed By: StephenTozer
Differential Revision: https://reviews.llvm.org/D140904
Nikita Popov [Fri, 6 Jan 2023 10:07:42 +0000 (11:07 +0100)]
[LoopIdiom] Name instructions in test (NFC)
Balázs Kéri [Fri, 6 Jan 2023 08:57:37 +0000 (09:57 +0100)]
[clang][analyzer] Add stream related functions to StdLibraryFunctionsChecker.
Additional stream handling functions are added.
These are partially evaluated by StreamChecker, result of the addition is
check for more preconditions and construction of success and failure branches
with specific errno handling.
Reviewed By: Szelethus
Differential Revision: https://reviews.llvm.org/D140387
Noah Goldstein [Fri, 6 Jan 2023 07:24:15 +0000 (15:24 +0800)]
[X86] Add tests for atomic bittest with register/memory operands
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D140938
Guillaume Chatelet [Thu, 5 Jan 2023 13:35:09 +0000 (13:35 +0000)]
[libc] Add a section about supported compilers in the documentation
Context https://github.com/llvm/llvm-project/issues/59368
Differential Revision: https://reviews.llvm.org/D141045
OCHyams [Fri, 6 Jan 2023 08:42:18 +0000 (08:42 +0000)]
[DebugInfo][NFC] Rename is/setUndef to is/setKilllocation
These names better reflect the semantics and also the implementation, since
it's not just "undef" operands that are sentinels used to signal that the debug
intrinsic terminates dominating locations definitions.
Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value
Reviewed By: StephenTozer
Differential Revision: https://reviews.llvm.org/D140903
Markus Böck [Fri, 6 Jan 2023 08:54:55 +0000 (09:54 +0100)]
[lldb] Allow configuring on Windows with python interpreter within a junction
The current implementation nicely takes into account when the python interpreter is symlinked (or transitively within a symlinked directory). Sadly, `os.path.islink` returns `false` on Windows if instead of Windows symlinks, junctions are used. This has caused me issues after I started using `scoop` as my package manager on Windows, which creates junctions instead of symlinks.
The fix proposed in this patch is to check whether `realpath` returns a different path to `exe`, and if it does, to simply try again with that path.
The code could also be simplified since `sys.executable` is guaranteed to be absolute, and `os.readlink`, which can return a relative path, is no longer used.
Tested on Windows 11 with Python 3.11 as interpreter and Ubuntu 18.04 with Python 3.6
Differential Revision: https://reviews.llvm.org/D141042
Jean Perier [Fri, 6 Jan 2023 08:57:08 +0000 (09:57 +0100)]
[flang] add hlfir.null to implement NULL()
In HLFIR, the address of a Fortran entity in lowering must be defined
by an operation that has the FortranVariableOpInterface (it is a sanity
requirement to ensure that the mlir::Value propagated in certain places
of lowering can be reasoned about).
fir.zero_bits does not have this interface and it makes little sense to
add it since it can "zero initialize" more types than just addresses.
Creating an hlfir.declare for null addresses is a bit too much (what
would be the name), and it would be noisy in the IR.
Instead add a small hlfir.null operation whose codegen is simply a
replacement by fir.zero_bits.
It may also later help dealing with the NULL(MOLD) cases in a nicer
way (the current lowering of this uses special handling it).
Differential Revision: https://reviews.llvm.org/D141040
Juan Manuel MARTINEZ CAAMAÑO [Fri, 6 Jan 2023 08:45:36 +0000 (09:45 +0100)]
[CodeGen][AMDGPU] EXTRACT_VECTOR_ELT: input vector element type can differ from output type
In function SITargetLowering::performExtractVectorElt,
the output type was not considered which could lead to type mismatches
later.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D139943
Nikita Popov [Fri, 6 Jan 2023 08:44:27 +0000 (09:44 +0100)]
Revert "CodingStandards: restrict CamelCase variable names guideline to llvm/clang/clang-tools-extra/polly/bolt"
This reverts commit
ee9ccb11036ac46ff9b9f3fa2d459d9d2bce5509.
See https://reviews.llvm.org/D140585#4019417 and following.
Multiple people requested a revert of this change pending further
discussion.
Nikita Popov [Fri, 6 Jan 2023 08:37:45 +0000 (09:37 +0100)]
Revert "[X86] Revert -fno-plt __tls_get_addr workaround for old GNU ld"
This reverts commit
2679e8bba3e166e3174971d040b9457ec7b7d768.
This change is a significant backwards-compatibility break, which
does in fact break the entire Rust ecosystem, which uses an
-fno-plt -mrelax-relocations=0 default.
Please go through pre-commit review for this change in order to
gain broader consensus.
Chuanqi Xu [Fri, 6 Jan 2023 08:34:48 +0000 (16:34 +0800)]
[NFC] [Coroutines] Move collectFrameAlloca to decrease the times to iterate the function
Previously in collectFrameAllocas, we will iterate every instruction in
the Function and we will iterate the function again later. It is
redundnt.
Pierre van Houtryve [Tue, 13 Dec 2022 08:50:41 +0000 (03:50 -0500)]
[Sema] Fix crash when evaluating nested call with value-dependent arg
Fix an edge case `ExprConstant.cpp`'s `EvaluateWithSubstitution` when called by `CheckEnableIf`
The assertion in `CallStackFrame::getTemporary`
could fail during evaluation of nested calls to a function
using `enable_if` when the second argument was a
value-dependent expression.
This caused a temporary to be created for the second
argument with a given version during the
evaluation of the inner call, but we bailed out
when evaluating the second argument of the
outer call due to the expression being value-dependent.
After bailing out, we tried to clean up the argument's value slot but it
caused an assertion to trigger in `getTemporary` as
a temporary for the second argument existed, but only for the inner call and not the outer call.
See the test case for a more complete description of the issue.
Reviewed By: ahatanak
Differential Revision: https://reviews.llvm.org/D139713
Benjamin Chetioui [Fri, 6 Jan 2023 07:25:44 +0000 (07:25 +0000)]
[NFC] Test commit.
Yeting Kuo [Thu, 5 Jan 2023 07:01:16 +0000 (15:01 +0800)]
[VP][RISCV] Add vp.abs and RISC-V support.
RISC-V uses ISD::ABS lower method (abs x) -> (smax_vl x (sub_vl 0, x)) for ISD::VP_ABS.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D141033
Akira Hatanaka [Fri, 6 Jan 2023 06:06:50 +0000 (22:06 -0800)]
Save the result of getenv() to a string
The result has to be saved to a string as the result might be
overwritten by subsequent calls to getenv.
https://pubs.opengroup.org/onlinepubs/
009696899/functions/getenv.html
See the discussion here: https://reviews.llvm.org/D137996#4029305
Noah Goldstein [Fri, 6 Jan 2023 06:08:25 +0000 (14:08 +0800)]
[X86] Add additional tests to no-shift.ll
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D141076
Fangrui Song [Fri, 6 Jan 2023 06:21:13 +0000 (22:21 -0800)]
[Driver] Simplify -fsanitize-memory-track-origins handling. NFC
ziqingluo-90 [Fri, 6 Jan 2023 06:02:43 +0000 (22:02 -0800)]
Revert "[Fix]"[-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations""
This reverts commit
ef47a0a711f12add401394f7af07a0b4d1635b56.
Revert "[-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations"
This reverts commit
b2ac5fd724c44cf662caed84bd8f84af574b981d.
This patch is causing failure in some Sanitizer tests
(https://lab.llvm.org/buildbot/#/builders/5/builds/30522/steps/13/logs/stdio). Reverting the patch and its' fix.
Josh Stone [Wed, 4 Jan 2023 00:04:45 +0000 (16:04 -0800)]
[RegAllocFast] Handle new debug values for spills
These new debug values get inserted after the place where the spill
happens, which means they won't be reached by the reverse traversal of
basic block instructions. This would crash or fail assertions if they
contained any virtual registers to be replaced. We can manually handle
the new debug values right away to resolve this.
Fixes https://github.com/llvm/llvm-project/issues/59172
Reviewed By: StephenTozer
Differential Revision: https://reviews.llvm.org/D139590
Akira Hatanaka [Fri, 6 Jan 2023 04:09:56 +0000 (20:09 -0800)]
[Sema] Fix a bug where clang doesn't detect uses of unavailable decls
in C++ base or member initializers
Differential Revision: https://reviews.llvm.org/D127442
Akira Hatanaka [Fri, 6 Jan 2023 03:48:25 +0000 (19:48 -0800)]
[CodeGen][ObjC] Fix a memory leak that occurs when a non-trivial C
struct property is set using dot notation
Make sure the destructor is called if needed.
Differential Revision: https://reviews.llvm.org/D136639
Xiaodong Liu [Fri, 6 Jan 2023 01:32:20 +0000 (09:32 +0800)]
[LoongArch] Add intrinsics for CACOP instruction
The CACOP instruction is mainly used for cache initialization
and cache-consistency maintenance.
Depends on D140872
Reviewed By: SixWeining
Differential Revision: https://reviews.llvm.org/D140527
Jie Fu [Fri, 6 Jan 2023 03:36:13 +0000 (19:36 -0800)]
[mlir] Fix build error due to -Wsign-compare after revision D140871
This patch fixes build failure due to -Wsign-compare in sparse2SparseRewrite(...) after https://reviews.llvm.org/D140871.
```
llvm-project/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp:842:32: error: comparison of integers of different signs: 'uint64_t' (aka 'unsigned long') and 'int64_t' (aka 'long') [-Werror,-Wsign-compare]
for (uint64_t i = 0; i < rank; i++) {
~ ^ ~~~~
1 error generated.
```
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D141104