Andrew Litteken [Wed, 9 Mar 2022 18:35:09 +0000 (10:35 -0800)]
[IRSim][IROutliner] Ignoring Musttail Function
Musttail calls require extra handling to properly propagate the calling convention information and tail call information. The outliner does not currently do this, so we ignore call instructions that utilize the swifttailcc and tailcc calling convention as well as functions marked with the attribute musttail.
Reviewers: paquette, aschwaighofer
Differential Revision: https://reviews.llvm.org/D120733
Andrew Litteken [Mon, 14 Mar 2022 00:26:45 +0000 (19:26 -0500)]
Revert "[IRSim][IROutliner] Ignoring Musttail Function"
This reverts commit
c7037c72572c9d1b2a50dbf56077be7975f83f09.
Pushed too soon
Andrew Litteken [Wed, 9 Mar 2022 18:35:09 +0000 (10:35 -0800)]
[IRSim][IROutliner] Ignoring Musttail Function
Florian Hahn [Sun, 13 Mar 2022 21:40:25 +0000 (21:40 +0000)]
[VPlan] Ensure each iv user is only visited once in transform.
If a recipe has multiple uses of an IV, we crash. It causes a crash when
building llvm-test-suite.
Exposed by
95f76bff1c40bc1c2f.
Marek Kurdej [Sun, 13 Mar 2022 21:17:48 +0000 (22:17 +0100)]
[clang-format] Fix incorrect assertion on macro definitions with keyword class.
Fixes https://github.com/llvm/llvm-project/issues/54348.
Marek Kurdej [Fri, 11 Mar 2022 11:51:15 +0000 (12:51 +0100)]
[clang-format] Correctly format variable templates.
Fixes https://github.com/llvm/llvm-project/issues/54257.
Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D121456
Marek Kurdej [Tue, 1 Mar 2022 08:42:28 +0000 (09:42 +0100)]
[clang-format] Add space to comments starting with '#'.
Fixes https://github.com/llvm/llvm-project/issues/35116.
Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D121451
Marek Kurdej [Wed, 9 Mar 2022 10:05:34 +0000 (11:05 +0100)]
[clang-format] Handle attributes before case label.
Fixes https://github.com/llvm/llvm-project/issues/53110.
Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D121450
Simon Pilgrim [Sun, 13 Mar 2022 17:28:18 +0000 (17:28 +0000)]
[X86] Update AVX512 intrinsic tests to avoid adds
As noticed in D119654, by adding the masked intrinsics results together we can end up with the selects being canonicalized away from the intrinsic - this isn't what we want to test here so replace with a insertvalue chain into a aggregate instead to retain all the results.
Florian Hahn [Sun, 13 Mar 2022 17:23:25 +0000 (17:23 +0000)]
[PhaseOrdering] Update naming of blocks after
95f76bff1c40.
Simon Pilgrim [Sun, 13 Mar 2022 17:20:12 +0000 (17:20 +0000)]
[X86] Update AVX512VL intrinsic tests to avoid adds
As noticed in D119654, by adding the masked intrinsics results together we can end up with the selects being canonicalized away from the intrinsic - this isn't what we want to test here so replace with a insertvalue chain into a aggregate instead to retain all the results.
Florian Hahn [Sun, 13 Mar 2022 17:15:24 +0000 (17:15 +0000)]
[LV] Create & use VPScalarIVSteps for all scalar users.
This patch is a follow-up to D115953. It updates optimizeInductions
to also introduce new VPScalarIVStepsRecipes if an IV has both vector
and scalar uses.
It updates all uses that only need scalar values to use the newly
created recipe for the scalar steps.
This completes untangling of VPWidenIntOrFpInductionRecipe
code-generation. Now the recipe *only* creates the widened vector
values, as it says on the tin.
The code to genereate IR has been moved directly to
VPWidenIntOrFpInductionRecipe::execute.
Note that the recipe has been updated to hold a reference to
ScalarEvolution, which is needed to expand the step, until we can place
the corresponding SCEV expansion in the pre-header.
Depends on D120827.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D120828
Balazs Benics [Sun, 13 Mar 2022 16:51:00 +0000 (17:51 +0100)]
[clang-tidy][docs] Fix wrong url in DontModifyStdNamespaceCheck
It was probably a copy-paste mistake.
The check was added as `cert-dcl58-cpp`, so the doc should point there.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D121373
Balazs Benics [Sun, 13 Mar 2022 16:51:00 +0000 (17:51 +0100)]
[clang-tidy][docs][NFC] Update URL and docs of PostfixOperatorCheck
The docs URL was dangling, and the docs suggested that it has no fixits,
but it actually had.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D121372
Balazs Benics [Sun, 13 Mar 2022 16:51:00 +0000 (17:51 +0100)]
[clang-tidy][docs][NFC] Refer to the CERT rule in bugprone-shared-ptr-array-mismatch docs
Document the connection between this checker and the corresponding CERT
rule.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D121214
Joe Loser [Sat, 12 Mar 2022 15:46:57 +0000 (10:46 -0500)]
[libc++] Replace _LIBCPP_HAS_NO_CONCEPTS with _LIBCPP_STD_VER > 17. NFCI.
All supported compilers that support C++20 now support concepts. So, remove
`_LIB_LIBCPP_HAS_NO_CONCEPTS` in favor of `_LIBCPP_STD_VER > 17`. Similarly in
the tests, remove `// UNSUPPORTED: libcpp-no-concepts`.
Differential Revision: https://reviews.llvm.org/D121528
Sanjay Patel [Sun, 13 Mar 2022 15:06:53 +0000 (11:06 -0400)]
[SDAG] simplify bitwise logic with repeated operand
We do not have general reassociation here (and probably
do not need it), but I noticed these were missing in
patches/tests motivated by D111530, so we can at
least handle the simplest patterns.
The VE test diff looks correct, but we miss that
pattern in IR currently:
https://alive2.llvm.org/ce/z/u66_PM
Sanjay Patel [Sun, 13 Mar 2022 14:29:27 +0000 (10:29 -0400)]
[AArch64] add tests for bitwise logic reassociation; NFC
Chooses from a variety of scalar/vector/illegal types
because that should not inhibit any folds.
Simon Pilgrim [Sun, 13 Mar 2022 14:40:34 +0000 (14:40 +0000)]
[InstCombine] Add additional icmp eq/ne test coverage for Issue #32161
Groverkss [Sun, 13 Mar 2022 14:34:23 +0000 (20:04 +0530)]
[MLIR][Presburger][NFC] Fix doc for PresburgerSpace::numLocals
Simon Pilgrim [Sun, 13 Mar 2022 14:15:35 +0000 (14:15 +0000)]
[PhaseOrdering] loop-rotation-vs-common-code-hoisting.ll - merge equivalent check-prefixes
Christian Sigg [Sun, 13 Mar 2022 13:17:08 +0000 (14:17 +0100)]
[MLIR][NFC] Fix deprecation message.
Groverkss [Sun, 13 Mar 2022 11:36:10 +0000 (17:06 +0530)]
[MLIR][Presburger] Add support for PresburgerRelation
This patch adds supports for union of relations (PresburgerRelation). Along
with this, support for PresburgerSet is also maintained.
This patch is part of a series of patches to add support for relations in
Presburger library.
Reviewed By: arjunp
Differential Revision: https://reviews.llvm.org/D121417
Simon Pilgrim [Sun, 13 Mar 2022 11:38:40 +0000 (11:38 +0000)]
[X86] combineCMP - peek through zero-extensions for X86cmp(zext(x0),0) zero tests (PR38960)
If we're comparing a value against zero, strip away any zero-extension and perform the comparison on the pre-extended value
Fixes #38308
Differential Revision: https://reviews.llvm.org/D121472
Lehua Ding [Sun, 13 Mar 2022 10:06:09 +0000 (18:06 +0800)]
[RISCV][RVV] Fix vslide1up/down intrinsics overflow bug for SEW=64 on RV32
Reviewed By: craig.topper, kito-cheng
Differential Revision: https://reviews.llvm.org/D120899
Austin Kerbow [Fri, 4 Mar 2022 07:59:26 +0000 (23:59 -0800)]
[AMDGPU] Add llvm.amdgcn.s.setprio intrinsic
Reviewed By: rampitec, arsenm
Differential Revision: https://reviews.llvm.org/D120976
Nimish Mishra [Sun, 13 Mar 2022 11:30:23 +0000 (17:00 +0530)]
[NFC][flang][OpenMP] Fixes formatting issues with D110714
This NFC fixes formatting issues introduced with https://reviews.llvm.org/D110714
Reviewed By: peixin, shraiysh
Differential Revision: https://reviews.llvm.org/D121186
chhzh123 [Sun, 13 Mar 2022 05:24:00 +0000 (05:24 +0000)]
[MLIR][Python] Add SCFIfOp Python binding
Current generated Python binding for the SCF dialect does not allow
users to call IfOp to create if-else branches on their own.
This PR sets up the default binding generation for scf.if operation
to address this problem.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D121076
Craig Topper [Sun, 13 Mar 2022 00:23:17 +0000 (16:23 -0800)]
[RISCV] Add DAGCombine to fold (bitreverse (bswap X)) to brev8 with Zbkb.
If the type is less than XLenVT, type legalization will turn this
into (srl (bitreverse (bswap (srl (bswap X), C))), C). We can't
completely recover from these shifts. They introduce zeros into
the upper bits of the result and we can't easily tell if they are
needed. By doing a DAG combine early, we avoid introducing these
shifts.
Craig Topper [Sun, 13 Mar 2022 00:13:54 +0000 (16:13 -0800)]
[RISCV] Add Zbp command lines to bswap-bitreverse.ll. NFC
Peter Steinfeld [Fri, 11 Mar 2022 22:01:07 +0000 (14:01 -0800)]
[flang] Improve runtime crash messages
Where possible, I added additional information to the messages to help
programmers figure out what went wrong. I also removed all uses of the word
"bad" from the messages since (to me) that implies a moral judgement rather
than a programming error. I replaced it with either "invalid" or "unsupported"
where appropriate.
Differential Revision: https://reviews.llvm.org/D121493
Fangrui Song [Sat, 12 Mar 2022 22:08:10 +0000 (14:08 -0800)]
[ELF] Simplify addCopyRelSymbol with invokeELFT. NFC
Krystian Kuzniarek [Sat, 12 Mar 2022 21:49:43 +0000 (22:49 +0100)]
[clang-format][docs] Fix incorrect 'clang-format 12' option markers
Introduced by
23a5090c6, some style option markers indicated
'clang-format 12', though their respective options were available in
earlier releases.
Differential Revision: https://reviews.llvm.org/D120631
Björn Schäpers [Tue, 1 Mar 2022 22:15:09 +0000 (23:15 +0100)]
[clang-format] Handle builtins in constraint expression
Fixes https://github.com/llvm/llvm-project/issues/54106
Differential Revision: https://reviews.llvm.org/D120774
Wenlei He [Sat, 26 Feb 2022 07:09:45 +0000 (23:09 -0800)]
[DebugInfo] Include DW_TAG_skeleton_unit when looking for parent UnitDie
`DIE::getUnitDie` looks up parent DIE until compile unit or type unit is found. However for skeleton CU with debug fission, we would have DW_TAG_skeleton_unit instead of DW_TAG_compile_unit as top level DIE.
This change fixes the look up so we can get DW_TAG_skeleton_unit as UnitDie for skeleton CU.
Differential Revision: https://reviews.llvm.org/D120610
Chris Lattner [Fri, 4 Mar 2022 05:11:37 +0000 (21:11 -0800)]
[mlirTranslateMain] Add a customization callback.
mlir-translate and related tools currently have a fixed set
of flags that are built into Translation.cpp. This works for
simple cases, but some clients want to change the default
globally (e.g. default to allowing unregistered dialects
without a command line flag), or support dialect-independent
translations without having those translations register every
conceivable dialect they could be used with (breaking
modularity).
This approach could also be applied to mlirOptMain to reduce
the significant number of flags it has accumulated.
Differential Revision: https://reviews.llvm.org/D120970
serge-sans-paille [Sat, 12 Mar 2022 20:53:14 +0000 (21:53 +0100)]
Replace forward declaration by actual declaration of MemoryBuffer in Object/Binary.h
This is a partial undo of
ed98c1b37661b0795a5e34517941485f0f0688d1, see
https://lab.llvm.org/buildbot#builders/37/builds/11529
for the actual error.
serge-sans-paille [Sat, 12 Mar 2022 17:53:53 +0000 (18:53 +0100)]
Add missing include under EXPENSIVE_CHECKS
mydeveloperday [Sat, 12 Mar 2022 17:21:33 +0000 (17:21 +0000)]
[clang-format] Minimize the damage caused by AlignArrayOfStructures when working on non square arrays
I have lost count of the number of times this has been reported, but it fundamentally comes down to the fact that the "AlignArrayLeft/Right" function is fundamentally broken for non-square arrays.
As a result, a pointer can end up running off the end of the array structure, I've spent the last 2 weekends trying to rewrite this algorithm but I've struggled to get it aligned correctly.
This is an interim fix, that ignores all array that are non-square and leaves them alone. I think this can allow us to close out most of the crashes (if not all).
I think this can help reduce the number of bugs coming in that are duplicates.
https://github.com/llvm/llvm-project/issues/53748
https://github.com/llvm/llvm-project/issues/51767
https://github.com/llvm/llvm-project/issues/51277
Reviewed By: curdeius, HazardyKnusperkeks, feg208
Differential Revision: https://reviews.llvm.org/D121069
LLVM GN Syncbot [Sat, 12 Mar 2022 17:10:56 +0000 (17:10 +0000)]
[gn build] Port
999fa9f68788
Amir Ayupov [Thu, 10 Mar 2022 20:21:39 +0000 (12:21 -0800)]
[BOLT][NFC] Use getShortOpcodeArith in X86MCPlusBuilder
Unify `llvm::X86::getRelaxedOpcodeArith` and `getShortArithOpcode` in
X86MCPlusBuilder.cpp.
Addresses https://lists.llvm.org/pipermail/llvm-dev/2022-January/154526.html
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D121404
Amir Ayupov [Fri, 21 Jan 2022 07:34:53 +0000 (23:34 -0800)]
[X86][NFC] Move table from getRelaxedOpcodeArith into its own class
Move out the table and prepare the code to reuse it for the reverse mapping.
Follows the example of memory folding/unfolding tables in X86InstrFoldTables.cpp
Preparation step to unify `llvm::X86::getRelaxedOpcodeArith` and
`getShortArithOpcode` in BOLT X86MCPlusBuilder.cpp.
Addresses https://lists.llvm.org/pipermail/llvm-dev/2022-January/154526.html
Reviewed By: skan, MaskRay
Differential Revision: https://reviews.llvm.org/D121402
serge-sans-paille [Wed, 9 Mar 2022 21:29:31 +0000 (22:29 +0100)]
Cleanup includes: DebugInfo & CodeGen
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D121332
Jan Svoboda [Sat, 12 Mar 2022 15:55:38 +0000 (16:55 +0100)]
[clang][deps] Update helper script documentation
Since D118986, clang-scan-deps returns the whole command line even for the original translation units.
Jan Svoboda [Sat, 12 Mar 2022 15:44:29 +0000 (16:44 +0100)]
[clang][deps] Simplify PREFIX definitions in tests
Instead of outputting the test directory into the JSON result file, parsing it with `FileCheck` and then potentially stripping it, simply use `FileCheck`'s `-D` option.
Note that we use `%/t` instead of `%t` in order to normalize to forward slashes on Windows, which matches what we do with `sed 's:\\\\\?:/:g'`.
Differential Revision: https://reviews.llvm.org/D121516
Uday Bondhugula [Sat, 12 Mar 2022 02:08:10 +0000 (07:38 +0530)]
[MLIR] Fix block label parsing bug
Fix bug in `Block` label parsing:
https://github.com/llvm/llvm-project/issues/54343
The `parseOptionalBlockArgList` method was doing the wrong thing
(contrary to its doc comment) and its calling context was also
incorrect. This led to a parse failure for something like "^bb0()".
Fixes #54343
Differential Revision: https://reviews.llvm.org/D121503
Mark de Wever [Sat, 12 Mar 2022 11:15:26 +0000 (12:15 +0100)]
[libc++] Remove unneeded tests.
As suggested in D120742.
Mark de Wever [Sat, 12 Mar 2022 11:11:00 +0000 (12:11 +0100)]
[libc++][NFC] Use TEST_HAS_NO_EXCEPTIONS.
The test should use the already available test macro.
Mark de Wever [Sat, 12 Mar 2022 11:07:54 +0000 (12:07 +0100)]
[libc++] Add a missing test case.
Jan Svoboda [Sat, 12 Mar 2022 11:09:10 +0000 (12:09 +0100)]
[clang][deps] Attempt to fix Windows test failure
Jan Svoboda [Sat, 12 Mar 2022 10:42:04 +0000 (11:42 +0100)]
[clang][deps] Remove '-fmodules-cache-path=' arguments
With explicit modules build, the '-fmodules-cache-path=' argument is unused.
This patch removes the argument to avoid warnings or errors (with '-Werror') stemming from that.
Depends on D118915.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D120474
Jan Svoboda [Sat, 12 Mar 2022 10:32:47 +0000 (11:32 +0100)]
[clang][deps] Generate '-fmodule-file=' only for direct dependencies
The `clang-scan-deps` tool currently generates `-fmodule-file=` command-line arguments for the whole transitive closure of modular dependencies. This is not necessary, we only need to provide the direct dependencies on the command line. Information about transitive dependencies is stored within the `.pcm` files of direct dependencies. This makes the command lines shorter, but should be a NFC otherwise (unless there are bugs in the loading mechanism for explicit modules).
Depends on D120465.
Reviewed By: Bigcheese
Differential Revision: https://reviews.llvm.org/D118915
Jan Svoboda [Sat, 12 Mar 2022 10:04:17 +0000 (11:04 +0100)]
[clang][deps] Disable implicit module maps
Since D113473, we don't report any module map files via `-fmodule-map-file=` in explicit builds. The ultimate goal here is to make sure Clang doesn't open/read/parse/evaluate unnecessary module maps.
However, implicit module maps still end up reading all reachable module maps. This patch disables implicit module maps in explicit builds.
Unfortunately, we still need to report some module map files that aren't encoded in PCM files of dependencies: module maps that are necessary to correctly evaluate includes in modules marked as `[no_undeclared_includes]`.
Depends on D120464.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D120465
Johannes Doerfert [Tue, 8 Mar 2022 21:49:26 +0000 (15:49 -0600)]
[Attributor] Remove capture tracker usage and follow uses explicitly
Before we used the capture tracker to follow pointer uses, now we do it
explicitly ourselves through the Attributor API. There are multiple
benefits: For one, the boilerplate is cut down by a lot. The class,
potential copies vector, etc. is all not needed anymore. We also do
avoid explicitly looking through memory here, something that was
duplicated and should only live in the `checkForAllUses~ helper. More
importantly, as we do simplifications we need to make sure all parties
are in sync when they reason about uses. The old way did not allow us to
do this but the new one does as every use visiting AA goes through
`checkForAllUses` now..
Johannes Doerfert [Tue, 8 Mar 2022 21:02:36 +0000 (15:02 -0600)]
[CaptureTracking][NFCI] Expose capture tracking logic
The logic exposed by this patch via `llvm::DetermineUseCaptureKind` was
part of `llvm::PointerMayBeCaptured`. In the Attributor we want to keep
track of the work list items but still reuse the logic if a use might
capture a value. A follow up for the Attributor removes ~100 lines of
code and complexity while making future handling of simplified values
possible.
Differential Revision: https://reviews.llvm.org/D121272
Fangrui Song [Sat, 12 Mar 2022 04:16:17 +0000 (20:16 -0800)]
[lsan] ppc64: dynamically pick address range for allocator
For ppc64 PIE, it seems that [0xa00000000000,0xc00000000000) may be occupied
which will lead to a segfault in certain kernel configurations
(clang-ppc64le-rhel). Use the `!kUsingConstantSpaceBeg` code path like Fuchsia.
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D121257
Fangrui Song [Sat, 12 Mar 2022 04:07:00 +0000 (20:07 -0800)]
[MC] Fix letter case of some MCSection member functions
Johannes Doerfert [Fri, 25 Feb 2022 22:57:18 +0000 (16:57 -0600)]
[Attributor] Avoid replacing return operands twice
As replacements will become more complex it is better to have a single
AA responsible for replacing a use. Before this patch AAValueSimplify*
and AAValueSimplifyReturned could both try to replace the returned
value. The latter was marginally better for the old pass manager
when a function was already carrying a `returned` attribute and when
the context of the return instruction was important. The second
shortcoming was resolved by looking for return attributes in the
AAValueSimplifyCallSiteReturned initialization. The old PM impact is
not concerning.
This is yet another step towards the removal of AAReturnedValues, the
very first AA we should now try to eliminate due to the overlapping
logic with value simplification.
Fangrui Song [Sat, 12 Mar 2022 03:55:07 +0000 (19:55 -0800)]
[MC] Destroy WasmAllocator in MCContext::reset
To not leave lingering getWasmSection instances.
Craig Topper [Sat, 12 Mar 2022 01:10:03 +0000 (17:10 -0800)]
[RISCV] Move GORCIW/GREVIW formation to isel patterns.
Type legalize narrow RISCVISD::GREV/GORC with constant to a larger
type without switching to W. Detect sext_inreg+gorci/grevi with a
uimm5 immediate during isel to emit GREVIW/GORCIW.
This allows us to better propagate known bits information through
extended bits after type legalization. It will also simplify a
change I'm considering for BREV8 with Zbkb.
A future patch will add computeKnownBits support for GORC.
A further improvement here would be to use hasAllWUsers and
doPeepholeSExtW like we do for SLLIW, but I don't think we have
the test coverage for that yet.
Craig Topper [Fri, 11 Mar 2022 23:29:26 +0000 (15:29 -0800)]
[RISCV] Add test cases that show that we're too aggressive about using greviw/gorciw. NFC
We currently type legalize to the W form, but type legalization
doesn't place any requirements on the extended bits. So we are ok
to use GREVI/GORCI for type legalization as long as the control
doesn't cross any bits from the extended bits into the lower bits.
This can allow us to recognize cases where the extended bits end
up being all zeros and we can propagate that information through.
My plan is to move greviw/gorciw formation to isel patterns similar
to slliw.
LLVM GN Syncbot [Sat, 12 Mar 2022 00:46:45 +0000 (00:46 +0000)]
[gn build] Port
ee0f8c401030
Nikolas Klauser [Sat, 12 Mar 2022 00:45:35 +0000 (01:45 +0100)]
[libc++][ranges] Implement ranges::find{, _if, _if_not}
Reviewed By: var-const, #libc, ldionne
Spies: ldionne, tcanens, libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D121248
Johannes Doerfert [Sat, 12 Mar 2022 00:39:21 +0000 (18:39 -0600)]
[Attributor][FIX] Make sure to not ignore non-load users of stores
When we look through memory for a store we used to allow any other use
of the memory that is reachable. This is generally OK but we need to
make sure to actually let the user look at these properly. For now,
we simply require loads (via exact reloads).
Jacques Pienaar [Sat, 12 Mar 2022 00:31:54 +0000 (16:31 -0800)]
[mlir] Update function referenced in comment (NFC)
Khem Raj [Sat, 12 Mar 2022 00:25:49 +0000 (16:25 -0800)]
[builtins] Do not force thumb mode directive in arm/sync-ops.h
.thumb_func was not switching mode until [1]
so it did not show up but now that .thumb_func (without argument) is
switching mode, its causing build failures on armv6 ( rpi0 ) even when
build is explicitly asking for this file to be built with -marm (ARM
mode), therefore use DEFINE_COMPILERRT_FUNCTION macro to add function
header which considers arch and mode from compiler cmdline to decide if
the function is built using thumb mode or arm mode.
[1] https://reviews.llvm.org/D101975
Note that it also needs https://reviews.llvm.org/D99282
Reviewed By: peter.smith, MaskRay
Differential Revision: https://reviews.llvm.org/D104183
LLVM GN Syncbot [Sat, 12 Mar 2022 00:10:18 +0000 (00:10 +0000)]
[gn build] Port
b1b4b6f36695
Kazushi (Jam) Marukawa [Sat, 5 Mar 2022 16:17:04 +0000 (01:17 +0900)]
[Clang][VE] Add vector load intrinsics
Add vector load intrinsic instructions for VE.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D121049
Shubham Sandeep Rastogi [Fri, 11 Mar 2022 20:14:05 +0000 (12:14 -0800)]
Rename EHFrameSplitter to DWARFRecordSectionSplitter
EHFrameSplitter does the exact same work to split up the eh_frame as it would need for any section that follows the DWARF record, therefore this patch just changes the name of it to DWARFRecordSectionSplitter to be more general.
Differential Revision: https://reviews.llvm.org/D121486
Petr Hosek [Thu, 2 Dec 2021 09:04:46 +0000 (01:04 -0800)]
[CMake] Rename TARGET_TRIPLE to LLVM_TARGET_TRIPLE
This clarifies that this is an LLVM specific variable and avoids
potential conflicts with other projects.
Differential Revision: https://reviews.llvm.org/D119918
Jon Chesterfield [Fri, 11 Mar 2022 23:07:11 +0000 (23:07 +0000)]
[nfc][openmp] Swap arguments to remove noise from upcoming diff
Anna Thomas [Fri, 11 Mar 2022 21:47:40 +0000 (16:47 -0500)]
[InlineCost] Add cl::opt for target attributes compatibility check. NFC
This patch adds a CL option for avoiding the attribute compatibility
check between caller and callee in TTI. TTI attribute compatibility
checks for target CPU and target features.
In our downstream compiler, this attribute always remains the same
between callee and caller. By avoiding the addition of this attribute to
each of our inline candidate (and then checking them here during inline
cost), we save some compile time.
The option is kept false, so this change is an NFC upstream.
Julian Lettner [Fri, 11 Mar 2022 22:23:11 +0000 (14:23 -0800)]
[NFC] Improve comment and rename test file
Johannes Doerfert [Fri, 11 Mar 2022 18:51:24 +0000 (12:51 -0600)]
[Attributor] Allow not to default initialize AAs for live internal functions
Outside users of the Attributor, e.g., OpenMP-opt, want to seed AAs
themselves. We should not seed all default AAs one an internal function
becomes live. That said, there should be a callback such that they can
do lazy seeding as well.
Differential Revision: https://reviews.llvm.org/D121489
Johannes Doerfert [Thu, 10 Mar 2022 18:17:38 +0000 (12:17 -0600)]
[Attributor] Cleanup manifest and liveness for CGSCC passes
There was some ad-hoc handling of liveness and manifest to avoid
breaking CGSCC guarantees. Things always slipped through though.
This cleanup will:
1) Prevent us from manifesting any "information" outside the CGSCC.
This might be too conservative but we need to opt-in to annotation
not try to avoid some problematic ones.
2) Avoid running any liveness analysis outside the CGSCC. We did have
some AAIsDeadFunction handling to this end but we need this for all
AAIsDead classes. The reason is that AAIsDead information is only
correct if we actually manifest it, since we don't (see point 1) we
cannot actually derive/use it at all. We are currently trying to
avoid running any AA updates outside the CGSCC but that seems to
impact things quite a bit.
3) Assert, don't check, that our modifications (during cleanup) modifies
only CGSCC functions.
Fangrui Song [Fri, 11 Mar 2022 22:42:07 +0000 (14:42 -0800)]
[MC][test] Improve compression.s
* Actually test compressed .debug_line for 32-bit
* Test .debug_frame can be compressed
* Test a section not named .debug_* is not compressed
owenca [Fri, 11 Mar 2022 02:16:12 +0000 (18:16 -0800)]
[clang-format][NFC] Group QualifierAlignment with other C++ passes
Also increases the initial size of Passes to 8 and move the
definition of BracesInserter up.
Differential Revision: https://reviews.llvm.org/D121434
Richard [Mon, 3 Jan 2022 18:38:42 +0000 (11:38 -0700)]
[clang-tidy] Refactor: Prefer single quoted strings over double quoted strings [NFC]
Fangrui Song [Fri, 11 Mar 2022 21:32:24 +0000 (13:32 -0800)]
[MC] Remove unneeded zlib opt-out for .debug_frame
The opt-out from rL236267 (2015) is untested and seems no longer needed (or not
needed when rL236267 was committed): there is nothing special with uncompressed
alignment. This brings us in line with GCC which compresses .debug_frame .
Checked that -g -fno-asynchronous-unwind-tables + objcopy
--decompress-debug-sections output is identical to -g
-fno-asynchronous-unwind-tables -gz + objcopy --decompress-debug-sections
output.
Dave Lee [Fri, 11 Mar 2022 20:45:47 +0000 (12:45 -0800)]
[lldb] Removed scoped timer from ReadMemoryFromFileCache
`ReadMemoryFromFileCache` can be called at a high rate, and has fast execution.
Signposts for high rate & brief duration can have a negative impact on tracing;
emitting a high volume signposts can lead to blocking, affecting performance,
and total volume makes human review of the trace harder because of the noise.
Differential Revision: https://reviews.llvm.org/D121226
Dave Lee [Fri, 11 Mar 2022 19:16:06 +0000 (11:16 -0800)]
[lldb] Move FindTypes scoped timer to SymbolFileDWARFDebugMap
Jonas Devlieghere [Fri, 11 Mar 2022 20:34:41 +0000 (12:34 -0800)]
[lldb] Include lldb/Host/HostInfo.h in ProcessWindows.cpp
Stanislav Mekhanoshin [Thu, 10 Mar 2022 21:46:55 +0000 (13:46 -0800)]
[AMDGPU] Support v_mov_b64 in dpp combine
Differential Revision: https://reviews.llvm.org/D121411
Stanislav Mekhanoshin [Tue, 8 Mar 2022 18:28:23 +0000 (10:28 -0800)]
[AMDGPU] gfx940 MUBUF format changes
Differential Revision: https://reviews.llvm.org/D121234
Jonas Devlieghere [Fri, 11 Mar 2022 19:32:21 +0000 (11:32 -0800)]
[lldb] Fix typo in ProcessWindows.h
Ivan Butygin [Wed, 23 Feb 2022 11:12:07 +0000 (14:12 +0300)]
[mlir][spirv] Make EntryPointABIAttr.local_size optional
* It doesn't required by OpenCL/Intel Level Zero and can be set programmatically.
* Add GPU to spirv lowering in case when attribute is not present.
* Set higher benefit to WorkGroupSizeConversion pattern so it will always try to lower first from the attribute.
Differential Revision: https://reviews.llvm.org/D120399
Fangrui Song [Fri, 11 Mar 2022 19:25:04 +0000 (11:25 -0800)]
[CommandLine] Remove `may only occur zero or one times!` error
Early adoption of new technologies or adjusting certain code generation/IR optimization thresholds
is often available through some cl::opt options (which have unstable surfaces).
Specifying such an option twice will lead to an error.
```
% clang -c a.c -mllvm -disable-binop-extract-shuffle -mllvm -disable-binop-extract-shuffle
clang (LLVM option parsing): for the --disable-binop-extract-shuffle option: may only occur zero or one times!
% clang -c a.c -mllvm -hwasan-instrument-reads=0 -mllvm -hwasan-instrument-reads=0
clang (LLVM option parsing): for the --hwasan-instrument-reads option: may only occur zero or one times!
% clang -c a.c -mllvm --scalar-evolution-max-arith-depth=32 -mllvm --scalar-evolution-max-arith-depth=16
clang (LLVM option parsing): for the --scalar-evolution-max-arith-depth option: may only occur zero or one times!
```
The option is specified twice, because there is sometimes a global setting and
a specific file or project may need to override (or duplicately specify) the
value.
The error is contrary to the common practice of getopt/getopt_long command line
utilities that let the last option win and the `getLastArg` behavior used by
Clang driver options. I have seen such errors for several times. I think the
error just makes users inconvenient, while providing very little value on
discouraging production usage of unstable surfaces (this goal is itself
controversial, because developers might not want to commit to a stable surface
too early, or there is just some subtle codegen toggle which is infeasible to
have a driver option). Therefore, I suggest we drop the diagnostic, at least
before the diagnostic gets sufficiently better support for the overridding needs.
Removing the error is a degraded error checking experience. I think this error
checking behavior, if desirable, should be enabled explicitly by tools. Users
preferring the behavior can figure out a way to do so.
Reviewed By: jhenderson, rnk
Differential Revision: https://reviews.llvm.org/D120455
Jonas Devlieghere [Fri, 11 Mar 2022 18:50:10 +0000 (10:50 -0800)]
[lldb] Add a getter for the process' system architecture
This patch adds a getter for the process' system architecture. I went
with Process::GetSystemArchitecture to match
Platform::GetSystemArchitecture.
Differential revision: https://reviews.llvm.org/D121443
Jez Ng [Fri, 11 Mar 2022 18:31:20 +0000 (13:31 -0500)]
[lld-macho] Don't allocate memory in parallelForEach
... since BumpPtrAllocator isn't thread-safe.
Reviewed By: #lld-macho, Roger
Differential Revision: https://reviews.llvm.org/D121458
Ivan Butygin [Mon, 21 Feb 2022 12:16:34 +0000 (15:16 +0300)]
[mlir][memref] memref.reinterpret_cast folding
* reinterpret_cast(reinterpret_cast(x)) -> reinterpret_cast(x)
* reinterpret_cast(cast(x)) -> reinterpret_cast(x)
* reinterpret_cast(subview(x)) -> reinterpret_cast(x) if subview offsets are 0
Differential Revision: https://reviews.llvm.org/D120242
Benjamin Kramer [Fri, 11 Mar 2022 18:13:58 +0000 (19:13 +0100)]
[LoopUnswitch] Use SmallPtrSet instead of std::set. NFCI.
Florian Hahn [Fri, 11 Mar 2022 17:56:54 +0000 (17:56 +0000)]
[VPlan] Implement VPCanonicalIVPHIRecipe::onlyFirstLaneUsed.
The recipe only uses the first lane of its operands.
Suggested & split off D120827.
Craig Topper [Fri, 11 Mar 2022 01:56:17 +0000 (17:56 -0800)]
[RISCV] Optimize vfmv.s.f intrinsic with scalar 0.0 to vmv.s.x with x0.
We already do this for RISCVISD::VFMV_S_F_VL and the vfmv.v.f
intrinsic.
Reviewed By: kito-cheng
Differential Revision: https://reviews.llvm.org/D121429
Jean Perier [Fri, 11 Mar 2022 18:03:19 +0000 (19:03 +0100)]
[flang][NFC] rename IsKindParameterizedDerivedType and fix comment typos
Following post-review feedback on https://reviews.llvm.org/D120804 and
https://reviews.llvm.org/D120801 about type descriptor changes, fix typos in
comments and rename IsKindParameterizedDerivedType to
IsDerivedTypeWithKindParameter. Remove a useless `;`.
Reviewed By: clementval, PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D121470
Greg Clayton [Thu, 10 Mar 2022 19:29:45 +0000 (11:29 -0800)]
Return an error when dsymutil might produce an invalid mach-o file.
64 bit mach-o files have sections that only have 32 bit file offsets. If dsymutil tries to produce an invalid mach-o file, then error out with a good error string.
Differential Revision: https://reviews.llvm.org/D121398
Valentin Clement [Fri, 11 Mar 2022 17:39:33 +0000 (18:39 +0100)]
[flang] Add tests for allocatable global
This patch adds couple of tests for allocatable
globals and missing lowering for them
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D121473
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Valentin Clement [Fri, 11 Mar 2022 17:38:08 +0000 (18:38 +0100)]
[flang] Lower of elemental calls in array expression
This patch adds tests and missing lowering
code to lower elemental function/subroutine calls
in array expression
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D121474
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Akira Hatanaka [Fri, 11 Mar 2022 17:30:31 +0000 (09:30 -0800)]
[NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in a couple
more files
Differential Revision: https://reviews.llvm.org/D121135
Jonas Devlieghere [Fri, 11 Mar 2022 06:52:20 +0000 (22:52 -0800)]
[lldb] Don't overwrite the host arch with the process arch
Don't overwrite the host architecture (obtained from qHostInfo) with the
process info (obtained from qProcessInfo).
Differential revision: https://reviews.llvm.org/D121442
Kirill Stoimenov [Fri, 11 Mar 2022 15:47:06 +0000 (15:47 +0000)]
[ASan] Export optimized callbacks.
This is a part of optimized callback reverts. This is needed to export the callbacks from the rt-asan libraries.
Reviewed By: kstoimenov
Differential Revision: https://reviews.llvm.org/D121464