Fangrui Song [Wed, 30 Mar 2022 16:02:23 +0000 (09:02 -0700)]
[X86][test] Precommit D122541 tests for prologue/epilogue CFI
Currently there is no CFI_INSTRUCTION MIR test with .ll input. This patch
adds some -stop-after=prologepilog tests.
Nathan Sidwell [Tue, 18 Jan 2022 15:14:08 +0000 (07:14 -0800)]
[clang][ABI] New C++20 module mangling scheme
Implement a demangleable strong ownership symbol mangling.
* The original module symbol mangling scheme turned out to be
undemangleable.
* The hoped-for C++17 compatibility of weak ownership turns out to be
fragile
* C++20 now has better ways of controlling C++17 compatibility
The issue is captured on the ABI list at:
https://github.com/itanium-cxx-abi/cxx-abi/issues/134
GCC implements this new mangling.
The old mangling is unceremoniously dropped. No backwards
compatibility, no deprectated old-mangling flag. It was always
labelled experimental. (Old and new manglings cannot be confused.)
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D122256
Nikita Popov [Wed, 30 Mar 2022 15:25:49 +0000 (17:25 +0200)]
[AutoUpgrade] Don't upgrade intrinsics returning overloaded struct type
We only want to do the upgrade from named to anonymous struct
return if the intrinsic is declared to return a struct, but not
if it has an overloaded return type that just happens to be a
struct. In that case the struct type will be mangled into the
intrinsic name and there is no problem.
This should address the problem reported in
https://reviews.llvm.org/D122471#3416598.
Louis Dionne [Fri, 4 Mar 2022 19:34:46 +0000 (14:34 -0500)]
[libunwind] Add a _LIBUNWIND_VERSION macro
This allows us to detect whether we're being compiled with LLVM's libunwind
more easily, without CMake having to set explicit variables.
As discussed in https://llvm.org/D119538.
Differential Revision: https://reviews.llvm.org/D121015
Sanjay Patel [Wed, 30 Mar 2022 14:24:54 +0000 (10:24 -0400)]
[SDAG] avoid libcalls to fmin/fmax for soft-float targets
This is an extension of D70965 to avoid creating a mathlib
call where it did not exist in the original source. Also see
D70852 for discussion about an alternative proposal that was
abandoned.
In the motivating bug report:
https://github.com/llvm/llvm-project/issues/54554
...we also have a more general issue about handling "no-builtin" options.
Differential Revision: https://reviews.llvm.org/D122610
Pavel Labath [Mon, 14 Mar 2022 15:32:51 +0000 (16:32 +0100)]
Recommit [lldb/test] Make category-skipping logic "platform"-independent
This recommits
dddf4ce03, which was reverted because of a couple of test
failures on macos. The reason behind the failures was that the patch
inadvertenly changed the value returned by the host platform from
"macosx" to "darwin". The new version fixes that.
Original commit message was:
The decision which categories are relevant for a particular test run
happen very early in the test setup process. They use the SBPlatform
object to determine which categories should be skipped. The platform
object created for this purpose transcends individual test runs.
This setup is not compatible with the direction discussed in
<https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594>
-- when platform objects are tied to a specific (SB)Debugger, they need
to be created alongside it, which currently happens in the test setUp
method.
This patch is the first step in that direction -- it rewrites the
category skipping logic to avoid depending on a global SBPlatform
object. Fortunately, the skipping logic is fairly simple (and I believe
it outght to stay that way) and mainly consists of comparing the
platform name against some hardcoded lists. This patch bases this
comparison on the platform name instead of the os part of the triple (as
reported by the platform).
Differential Revision: https://reviews.llvm.org/D121605
serge-sans-paille [Wed, 30 Mar 2022 06:17:56 +0000 (08:17 +0200)]
Fix invalid overflow check in flang
Statically checking for overflow with
if constexpr (sizeof(std::size_t) <= sizeof(std::int64_t)) {
return static_cast<std::int64_t>(length);
}
Doesn't work if `sizeof(std::size_t) == sizeof(std::int64_t)` because std::size_t
is unsigned.
if `length == std::numeric_limits<size_t>` casting it to `int64_t` is going to overflow.
This code would be much simpler if returning a `uint64_t` instead of a signed
value...
Differential Revision: https://reviews.llvm.org/D122705
Jun Zhang [Tue, 29 Mar 2022 07:24:48 +0000 (15:24 +0800)]
[NFC] Use range based loop.
Signed-off-by: Jun Zhang <jun@junz.org>
Differential Revision: https://reviews.llvm.org/D122657
Fraser Cormack [Wed, 9 Mar 2022 15:02:53 +0000 (15:02 +0000)]
[VP] Add vp.fcmp comparison intrinsic and docs
This patch adds the first support for vector-predicated comparison
intrinsics, starting with vp.fcmp. It uses metadata to encode its
condition code, like the llvm.experimental.constrained.fcmp intrinsic.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D121292
Sanjay Patel [Wed, 30 Mar 2022 13:29:32 +0000 (09:29 -0400)]
[SDAG] try to canonicalize logical shift after bswap
When shifting by a byte-multiple:
bswap (shl X, C) --> lshr (bswap X), C
bswap (lshr X, C) --> shl (bswap X), C
This is the backend version of D122010 and an alternative
suggested in D120648.
There's an extra check to make sure the shift amount is
valid that was not in the rough draft.
I'm not sure if there is a larger motivating case for RISCV (bug report?),
but the ARM diffs show a benefit from having a late version of the
transform (because we do not combine the loads in IR).
Differential Revision: https://reviews.llvm.org/D122655
Sanjay Patel [Tue, 29 Mar 2022 21:07:41 +0000 (17:07 -0400)]
[x86] add tests for fcmp with 0.0 operand; NFC
Sanjay Patel [Tue, 29 Mar 2022 19:03:14 +0000 (15:03 -0400)]
[SystemZ] generate full checks for tests; NFC
These may change if we transform the fcmp (setcc) to avoid a constant operand.
Simon Pilgrim [Wed, 30 Mar 2022 12:34:14 +0000 (13:34 +0100)]
[X86] Extend xor-lea test coverage
Add XOR(ADD/SUB(X,Y),MIN_SIGNED_VALUE) tests and adjust some XOR(SHL(X,C),MIN_SIGNED_VALUE) shifts to better match LEA scales
Fraser Cormack [Thu, 24 Mar 2022 11:03:26 +0000 (11:03 +0000)]
[SelectionDAG] Don't create illegally-typed nodes while constant folding
This patch fixes a (seemingly very rare) crash during vector constant
folding introduced in D113300.
Normally, during legalization, if we create an illegally-typed node during
a failed attempt at constant folding it's cleaned up before being
visited, due to it having no uses.
If, however, an illegally-typed node is created during one round of
legalization and isn't cleaned up, it's possible for a second round of
legalization to create new illegally-typed nodes which add extra uses to
the old illegal nodes. This means that we can end up visiting the old
nodes before they're known to be dead, at which point we crash.
I'm not happy about this fix. Creating illegal types at all seems like a
bad idea, but we all-too-often rely on illegal constants being
successfully folded and being fixed up afterwards. However, we can't
rely on constant folding actually happening, and we don't have a
foolproof way of peering into the future.
Perhaps the correct fix is to revisit the node-iteration order during
legalization, ensuring we visit all uses of nodes before the nodes
themselves. Or alternatively we could try and clean up dead nodes
immediately after failing constant folding.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D122382
Florian Hahn [Wed, 30 Mar 2022 12:11:20 +0000 (13:11 +0100)]
[LV] Pass LoopHeaderBB directly to updateDominatorTree. (NFC)
At the call site, we already know what the vector header block is. Pass
it directly.
Nikita Popov [Wed, 30 Mar 2022 12:00:24 +0000 (14:00 +0200)]
[RuntimeDebugBuilder] Remove pointer element type accesses
Simon Pilgrim [Wed, 30 Mar 2022 11:56:49 +0000 (12:56 +0100)]
[X86] Add test coverage based off Issue #51609
wangpc [Wed, 30 Mar 2022 11:28:38 +0000 (19:28 +0800)]
[RISCV] Add index check for vset/vget
Index of vset/vget must be a constant integer and be
located in right range.
Reviewed By: kito-cheng
Differential Revision: https://reviews.llvm.org/D122629
Aaron Ballman [Wed, 30 Mar 2022 11:12:04 +0000 (07:12 -0400)]
Don't diagnostic atomic object access as UB in an unevaluated context
We started diagnosing this situation with a more clear diagnostic
message, but it was pointed out that unevaluated contexts don't really
have the undefined behavior property as there is no runtime access
involved.
This augments the changes in https://reviews.llvm.org/D122656 to not
diagnose in an unevaluated context.
Simon Pilgrim [Wed, 30 Mar 2022 10:08:03 +0000 (11:08 +0100)]
[MC][X86] Ensure all opcode tests are sorted by instruction name
Noticed while reviewing D122449
Luo, Yuanke [Wed, 30 Mar 2022 09:51:47 +0000 (17:51 +0800)]
[X86][AMX] Pre-checkin the test case for AMX undef and zero
Serge Pavlov [Wed, 30 Mar 2022 09:43:34 +0000 (16:43 +0700)]
Revert "Mapping of FP operations to constrained intrinsics"
This reverts commit
115b3ace369254f573ca28934ef30ab9d8f497ef.
Starting from this commit the buildbot sanitizer-x86_64-linux-bootstrap-msan
starts failing (build 10071). Reverted for investigation.
Luo, Yuanke [Wed, 30 Mar 2022 09:20:22 +0000 (17:20 +0800)]
[X86][AMX] Fix bug for amx cast tranform
After combining amx cast operation, some amx cast intrinsic may be dead
code. This patch is to delete such dead code and avoid crash.
Vitaly Buka [Wed, 30 Mar 2022 01:35:55 +0000 (18:35 -0700)]
[CodeGen] Avoid access after runtime
Insts must be destroyd before xParent
or it can read it with stack like this:
0 in llvm::MachineInstr::getMF() const MachineInstr.cpp:637:3
1 in getMF MachineInstr.h:302:50
2 in removeNodeFromList MachineBasicBlock.cpp:163:32
Nikita Popov [Wed, 30 Mar 2022 08:03:08 +0000 (10:03 +0200)]
[MLIR] Remove LLVMVectorType
While this claims to be the base class for fixed and scalable
vectors, this is no longer the case since D94405. In fact,
LLVMVectorType is not usable, since the methods it declares are
never defined. Remove this leftover.
Differential Revision: https://reviews.llvm.org/D122707
Simon Pilgrim [Wed, 30 Mar 2022 08:51:26 +0000 (09:51 +0100)]
[X86] Add PR47857 test case
Liqin Weng [Wed, 30 Mar 2022 07:57:46 +0000 (15:57 +0800)]
[RISCV] Add CMIX isel pattern for (xor (and (xor rs1, rs3), rs2), rs3)
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D122702
bzcheeseman [Wed, 30 Mar 2022 08:36:41 +0000 (01:36 -0700)]
[mlir] Allow Diagnostic/InFlightDiagnostic to convert to FailureOr.
Allow conversion of a diagnostic to FailureOr. This conversion only results
in `failure` because in the case where operator LogicalResult would return
success, the FailureOr constructor would assert.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D122596
Luboš Luňák [Wed, 30 Mar 2022 08:29:23 +0000 (10:29 +0200)]
add missing include for -DLLVM_ENABLE_MODULES=On
Simon Pilgrim [Tue, 29 Mar 2022 21:24:02 +0000 (22:24 +0100)]
[X86] combineADC - fold ADC(C1,C2,Carry) -> ADC(0,C1+C2,Carry)
If we're not relying on the flag result, we can fold the constants together into the RHS immediate operand and set the LHS operand to zero, simplifying for further folds.
We could do something similar if the flag result is in use and the constant fold doesn't affect it, but I don't have any real test cases for this yet.
As suggested by @davezarzycki on Issue #35256
Differential Revision: https://reviews.llvm.org/D122482
Simon Pilgrim [Fri, 25 Mar 2022 11:09:40 +0000 (11:09 +0000)]
[CostModel][X86] Reduce cost of v2i64 icmp base cost on SSE2 targets
Based off the script from D103695, we were exaggerating the cost of the v2i64 comparison expansion using instruction count instead of effective throughput
Ingo Müller [Mon, 28 Mar 2022 09:07:58 +0000 (09:07 +0000)]
[mlir][docs] Convert block comments to line comments.
The op documentation of the ops of the scf dialect used /**/ style block
comments which doesn't seem to exists (anymore?).
Reviewed By: nicolasvasilache, ingomueller-net
Differential Revision: https://reviews.llvm.org/D122565
Fraser Cormack [Tue, 29 Mar 2022 06:43:30 +0000 (07:43 +0100)]
[RISCV] Trim RVV isel pats matchable via DAG post-process
In D122512, several masked patterns were added to support lowering of
vector-predicated float-to-int and int-to-float conversions. With the
introduction of these patterns, all of the old "unmasked" patterns are
matchable via the DAG post-process introduced in D118810, once the relevant
opcode entries are set up in the helper table.
Locally this reduces the generated isel table by 4%.
Reviewed By: arcbbb
Differential Revision: https://reviews.llvm.org/D122637
Nikita Popov [Tue, 29 Mar 2022 16:21:39 +0000 (18:21 +0200)]
[MLIR] Avoid some pointer element type accesses
Determine the element type from the MLIR LLVMPointerType, rather
than the LLVM PointerType.
Nikita Popov [Fri, 25 Mar 2022 09:50:13 +0000 (10:50 +0100)]
[IR] Require intrinsic struct return type to be anonymous
This is an alternative to D122376. Rather than working around the
problem, this patch requires that struct return types in intrinsics
are anonymous/literal and adds auto-upgrade code to convert
existing uses of intrinsics with named struct types.
This ensures that the mapping between intrinsic name and
intrinsic function type is actually bijective, as it is supposed
to be.
This also fixes https://github.com/llvm/llvm-project/issues/37891.
Differential Revision: https://reviews.llvm.org/D122471
LLVM GN Syncbot [Wed, 30 Mar 2022 07:33:49 +0000 (07:33 +0000)]
[gn build] Port
1410a4860eb2
Pavel Labath [Wed, 30 Mar 2022 07:28:19 +0000 (09:28 +0200)]
[lldb] Remove vasprintf windows-compat implementation
We already have a VASprintf function for this purpose, so I'm switching
the remaining few users to that.
Markus Böck [Wed, 30 Mar 2022 07:25:33 +0000 (09:25 +0200)]
[clang][DR] Add test for DR1227 and mark it as complete
DR: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1227
This DR has been implemented in Clang as far back as I could check. This patch simply adds a test and comment to mark it as complete.
Differential Revision: https://reviews.llvm.org/D122682
Pavel Labath [Wed, 30 Mar 2022 07:12:59 +0000 (09:12 +0200)]
[lldb] Use =default in the ValueList class
Danny Mösch [Wed, 30 Mar 2022 06:03:32 +0000 (08:03 +0200)]
[clang-tidy] Make test work on architectures which do not provide a `__int128_t`
See
f10cee91ae07022e602d6a47e504e86796d49a7d. The test did still not run successful since the
`CHECK-MESSAGE` line is still read and considered even though the `#ifdef` removes the code if
`__int128_t` is not available. Now there is a fallback type in this case.
Serge Pavlov [Wed, 30 Mar 2022 04:23:49 +0000 (11:23 +0700)]
Mapping of FP operations to constrained intrinsics
A new function 'getConstrainedIntrinsic' is added, which for any gived
instruction returns id of the corresponding constrained intrinsic. If
there is no constrained counterpart for the instruction or the instruction
is already a constrained intrinsic, the function returns zero.
Differential Revision: https://reviews.llvm.org/D69562
Michael Kruse [Wed, 30 Mar 2022 04:08:13 +0000 (23:08 -0500)]
[docs] Update LoopTerminology.
Includes 2 corrections:
* Update irreducible control flow and add references to CycleTerminology;
Natural loop is not the only definition of something looping in LLVM anymore.
* Mention mustprogress loop and function attributes to be used
instead of the llvm.sideeffect intrinsic.
Liqin Weng [Wed, 30 Mar 2022 02:51:26 +0000 (02:51 +0000)]
[RISCV][NFC] Add immediate tests for the icmp instruction
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D122651
Chenbing Zheng [Wed, 30 Mar 2022 01:50:28 +0000 (09:50 +0800)]
[DAGCombine] add tests for bitreverse-shift optimization
This patch add some tests to show some optimization opportunities
for bitreverse-shift.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D121507
Zakk Chen [Wed, 30 Mar 2022 00:28:28 +0000 (17:28 -0700)]
[RISCV] Use maskedoff to decide mask policy for masked compare and vmsbf/vmsif/vmsof.
masked compare and vmsbf/vmsif/vmsof are always tail agnostic, we could
check maskedoff value to decide mask policy rather than have a addtional
policy operand.
Reviewed By: craig.topper, arcbbb
Differential Revision: https://reviews.llvm.org/D122456
Zakk Chen [Wed, 30 Mar 2022 00:28:13 +0000 (17:28 -0700)]
Revert "[RISCV] Add policy operand for masked compare and vmsbf/vmsif/vmsof IR"
This reverts commit
10fd2822b77e12215b4ea82fc6d0a052961eb9d9.
I have a better implementation for those operations without the
additional policy operand.
masked compare and vmsbf/vmsif/vmsof are always tail agnostic so we could
assume undef maskedoff is mask agnostic.
Differential Revision: https://reviews.llvm.org/D122455
Dominic Chen [Wed, 30 Mar 2022 00:52:09 +0000 (17:52 -0700)]
Revert "[scudo] Wrap clang pragma to avoid GCC error"
Revert "[scudo] Add noreturn/pragma to suppress compiler warnings"
This reverts commit
686dcbe8b018759b5443c05bfeeb7abf4d9cf09c.
This reverts commit
030d8262a6e8055660ae74bdb7e4f22c741a1e17.
Dominic Chen [Wed, 16 Mar 2022 20:35:51 +0000 (13:35 -0700)]
[scudo] Provide allocator declaration
Ensure that extern allocator declaration is visible before definition
Differential Revision: https://reviews.llvm.org/D121848
Dominic Chen [Wed, 30 Mar 2022 00:36:33 +0000 (17:36 -0700)]
[scudo] Wrap clang pragma to avoid GCC error
Fixes: [scudo] Add noreturn/pragma to suppress compiler warnings
Differential Revision: https://reviews.llvm.org/D121853
Roland McGrath [Fri, 25 Sep 2020 18:53:12 +0000 (11:53 -0700)]
[lsan] On Fuchsia, don't use atexit hook for leak checks
This is a re-land of https://reviews.llvm.org/D86171 with fix.
Fuchsia's system libraries are instrumented and use the lsan
allocator for internal purposes. So leak checking needs to run
after all atexit hooks and after the system libraries' internal
exit-time hooks. The <zircon/sanitizer.h> hook API calls the
__sanitizer_process_exit_hook function at exactly the right time.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D88248
Michael Jones [Tue, 29 Mar 2022 23:33:58 +0000 (16:33 -0700)]
[libc][obvious] Add mfma to log2f
In the previous patch adding -mfma to functions that need it for windows
builds I missed log2f.
Differential Revision: https://reviews.llvm.org/D122693
Michael Jones [Tue, 29 Mar 2022 22:04:03 +0000 (15:04 -0700)]
[libc] Add mfma option to functions that use fma
On Windows the functions that use fma don't properly include the fma
intrinsics unless -mfma is added to the compile options. This patch adds
the compile option to all of the functions that need it.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D122689
Michael Jones [Tue, 29 Mar 2022 21:52:54 +0000 (14:52 -0700)]
[libc][obvious] fix sqrt when long double is double
Previously, the "fsqrt" instruction was used on all x86_64 platforms
for finding the square root of long doubles. On long double is double
platforms (e.g. windows) this created errors. This patch changes square
root function for long doubles to be the same as the one for doubles if
long doubles are doubles.
Reviewed By: sivachandra, lntue
Differential Revision: https://reviews.llvm.org/D122688
Akira Hatanaka [Tue, 29 Mar 2022 22:53:35 +0000 (15:53 -0700)]
Remove -O1 from command line of nrvo.cpp
Also, check that NRVO currently isn't performed in test25. The checks
were accidentally removed when https://reviews.llvm.org/D122425 disabled
inlining.
Jonas Devlieghere [Tue, 29 Mar 2022 00:14:44 +0000 (17:14 -0700)]
[lldb] Make ModuleSpecList iterable (NFC)
Chris Bieneman [Tue, 29 Mar 2022 20:47:49 +0000 (15:47 -0500)]
[HLSL] Fix MSFT Attribute parsing, add numthreads
HLSL uses Microsoft-style attributes `[attr]`, which clang mostly
ignores. For HLSL we need to handle known Microsoft attributes, and to
maintain C/C++ as-is we ignore unknown attributes.
To utilize this new code path, this change adds the HLSL `numthreads`
attribute.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D122627
Vince Bridgers [Fri, 25 Mar 2022 22:30:59 +0000 (17:30 -0500)]
[analyzer] Fix "RhsLoc and LhsLoc bitwidth must be same"
clang: <root>/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:727:
void assertEqualBitWidths(clang::ento::ProgramStateRef,
clang::ento::Loc, clang::ento::Loc): Assertion `RhsBitwidth ==
LhsBitwidth && "RhsLoc and LhsLoc bitwidth must be same!"'
This change adjusts the bitwidth of the smaller operand for an evalBinOp
as a result of a comparison operation. This can occur in the specific
case represented by the test cases for a target with different pointer
sizes.
Reviewed By: NoQ
Differential Revision: https://reviews.llvm.org/D122513
Yonghong Song [Tue, 29 Mar 2022 06:30:10 +0000 (23:30 -0700)]
BPF: support inlining __builtin_memcmp intrinsic call
Delyan Kratunov reported an issue where __builtin_memcmp is
not inlined into simple load/compare instructions.
This is a known issue. In the current state, __builtin_memcmp
will be converted to memcmp call which won't work for
bpf programs.
This patch added support for expanding __builtin_memcmp with
actual loads and compares up to currently maximum 128 total loads.
The implementation is identical to PowerPC.
Differential Revision: https://reviews.llvm.org/D122676
Shraiysh Vaishay [Tue, 29 Mar 2022 21:41:14 +0000 (03:11 +0530)]
[mlir][OpenMP] Fix memory leak by deleting unused value
Reviewed By: ftynse, rriddle
Differential Revision: https://reviews.llvm.org/D122633
Florian Hahn [Tue, 29 Mar 2022 21:52:42 +0000 (22:52 +0100)]
[LV] Handle zero cost loops in selectInterleaveCount.
In some case, like in the added test case, we can reach
selectInterleaveCount with loops that actually have a cost of 0.
Unfortunately a loop cost of 0 is also used to communicate that the cost
has not been computed yet. To resolve the crash, bail out if the cost
remains zero after computing it.
This seems like the best option, as there are multiple code paths that
return a cost of 0 to force a computation in selectInterleaveCount.
Computing the cost at multiple places up front there would unnecessarily
complicate the logic.
Fixes #54413.
Zixu Wang [Fri, 25 Mar 2022 22:15:08 +0000 (15:15 -0700)]
[clang][extract-api] Add Objective-C protocol support
Add support for Objective-C protocol declarations in ExtractAPI.
Depends on D122446
Differential Revision: https://reviews.llvm.org/D122511
Vitaly Buka [Tue, 29 Mar 2022 21:09:35 +0000 (14:09 -0700)]
[msan] Add link to the lifetime definition
Differential Revision: https://reviews.llvm.org/D122685
James Y Knight [Tue, 29 Mar 2022 21:32:52 +0000 (17:32 -0400)]
Fix memory leak in [Clang] Implement __builtin_source_location.
Fixes:
d61487490022
Zixu Wang [Fri, 25 Mar 2022 01:19:30 +0000 (18:19 -0700)]
[clang][extract-api] Add Objective-C interface support
Add support for Objective-C interface declarations in ExtractAPI.
Depends on D122495
Differential Revision: https://reviews.llvm.org/D122446
Dominic Chen [Wed, 16 Mar 2022 20:42:49 +0000 (13:42 -0700)]
[scudo] Add noreturn/pragma to suppress compiler warnings
Differential Revision: https://reviews.llvm.org/D121853
Dominic Chen [Tue, 29 Mar 2022 04:49:46 +0000 (21:49 -0700)]
[scudo] Add missing include for extern variable declaration
Add include to resolve compiler warning about no previous extern declaration for non-static HashAlgorithm
Differential Revision: https://reviews.llvm.org/D122630
Dominic Chen [Tue, 29 Mar 2022 04:52:04 +0000 (21:52 -0700)]
[scudo] Fix definition of canCache() function
The called member function has boolean type, change this function to match
Differential Revision: https://reviews.llvm.org/D122631
Dominic Chen [Tue, 29 Mar 2022 04:54:43 +0000 (21:54 -0700)]
[scudo] Initialize local variable to avoid compiler warning
Compiler warns about HeaderPos possibly being uninitialized which should not be possible, but just initialize it anyway
Differential Revision: https://reviews.llvm.org/D122632
Benjamin Kramer [Mon, 28 Mar 2022 12:10:26 +0000 (14:10 +0200)]
[linalg] When removing noop linalg.generics, check that inserting a cast is valid
linalg.generic can also take scalars instead of tensors, which
tensor.cast doesn't support. We don't have an easy way to cast between
scalars and tensors so just keep the linalg.generic in those cases.
Differential Revision: https://reviews.llvm.org/D122575
Eli Friedman [Fri, 25 Mar 2022 22:40:46 +0000 (15:40 -0700)]
[MC] Make MCAsmInfo::isAcceptableChar reflect MCAsmInfo::doesAllowAtInName
On targets which don't allow "@" in unquoted identifiers, make sure we
don't emit them; otherwise, we can't parse our own output.
Differential Revision: https://reviews.llvm.org/D122516
Vitaly Buka [Tue, 29 Mar 2022 20:29:07 +0000 (13:29 -0700)]
[NFC] clang-format sanitizer_interface_internal.h
Chris Bieneman [Tue, 29 Mar 2022 19:46:24 +0000 (14:46 -0500)]
NFC. Fixing warnings from adding DXContainer
Adds DXContainer to switch statements in Clang and LLDB to silence
warnings.
Chris Bieneman [Sat, 19 Mar 2022 19:33:39 +0000 (14:33 -0500)]
Add DXContainer
DXIL is wrapped in a container format defined by the DirectX 11
specification. Codebases differ in calling this format either DXBC or
DXILContainer.
Since eventually we want to add support for DXBC as a target
architecture and the format is used by DXBC and DXIL, I've termed it
DXContainer here.
Most of the changes in this patch are just adding cases to switch
statements to address warnings.
Reviewed By: pete
Differential Revision: https://reviews.llvm.org/D122062
Florian Hahn [Tue, 29 Mar 2022 19:27:59 +0000 (20:27 +0100)]
[LV] Move code to place pointer induction increment to VPlan post-processing.
This patch moves the code to set the correct incoming block for the
backedge value to VPlan::execute.
When generating the phi node, the backedge value is temporarily added
using the pre-header as incoming block. The invalid phi node will be
fixed up during VPlan::execute after main VPlan code generation.
At the same time, the backedge value is also moved to the latch.
This change removes the requirement to create the latch block up-front
for VPWidenInductionPHIRecipe::execute, which in turn will enable
modeling the pre-header in VPlan.
Depends on D121617.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D121618
Sanjay Patel [Tue, 29 Mar 2022 18:53:41 +0000 (14:53 -0400)]
[x86] consolidate tests and auto-gen complete check lines; NFC
The same test was duplicated in 2 files.
Markus Böck [Tue, 29 Mar 2022 18:45:41 +0000 (20:45 +0200)]
[clang][DR] Test and mark DR1305 as complete
DR: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1305
This DR has always been implemented in all clang versions as far back as I could go. This patch basically just adds a test with the needed comments to mark it as complete.
Differential Revision: https://reviews.llvm.org/D122674
wangyihan [Tue, 29 Mar 2022 18:38:29 +0000 (11:38 -0700)]
[Clang][CodeGen]Remove anonymous tag locations
Remove anonymous tag locations, powered by 'PrintingPolicy',
@aaron.ballman once suggested removing this extra information in
https://reviews.llvm.org/D122248
struct:
struct S {
int a;
struct /* Anonymous*/ {
int x;
} b;
int c;
};
Before:
struct S {
int a = 0
struct S::(unnamed at ./builtin_dump_struct.c:20:3) {
int x = 0
}
int c = 0
}
After:
struct S {
int a = 0
struct S::(unnamed) {
int x = 0
}
int c = 0
}
Differntial Revision: https://reviews.llvm.org/D122670
Chris Bieneman [Tue, 29 Mar 2022 17:57:49 +0000 (12:57 -0500)]
NFC. Fixing rebase error
Somehow managed to get a double-assignment in there. Thanks @erichkeane
for pointing it out!
Stanislav Mekhanoshin [Wed, 23 Mar 2022 18:59:08 +0000 (11:59 -0700)]
[AMDGPU] gfx940 VALU hazard recognizer
Differntial Revision: https://reviews.llvm.org/D122339
Mehdi Amini [Tue, 29 Mar 2022 17:39:05 +0000 (17:39 +0000)]
Revert "[Support/BLAKE3] Re-enable building with the simd-optimized implementations"
This reverts commit
23519d3000b4703f17e639534a38b4f221fa4f63.
This breaks the build with clang-5:
/usr/bin/clang-5.0 -DBUILD_EXAMPLES -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Support/BLAKE3 -Illvm/lib/Support/BLAKE3 -Iinclude -Illvm/include -fPIC -O3 -DNDEBUG -MD -MT lib/Support/BLAKE3/CMakeFiles/LLVMSupportBlake3.dir/blake3_avx512_x86-64_unix.S.o -MF lib/Support/BLAKE3/CMakeFiles/LLVMSupportBlake3.dir/blake3_avx512_x86-64_unix.S.o.d -o lib/Support/BLAKE3/CMakeFiles/LLVMSupportBlake3.dir/blake3_avx512_x86-64_unix.S.o -c llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S
...
llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S:54:9: error: instruction requires: AVX-512 ISA
kmovw k1, r9d
^
Chris Bieneman [Mon, 28 Mar 2022 21:33:16 +0000 (16:33 -0500)]
[ADT] add initializer list specialization for is_contained
Adding an initializer list specialization for is_contained allows for
compile-time evaluation when called with a constant or runtime
evaluation for non-constant values.
This patch doesn't add any uses of this template, but that is coming in
a subsequent patch.
Reviewed By: pete
Differential Revision: https://reviews.llvm.org/D122079
wangyihan [Tue, 29 Mar 2022 17:30:34 +0000 (10:30 -0700)]
[Clang][doc][NFC]Remove duplicate items in ReleaseNotes
Remove duplicate items in ReleaseNotes for __builtin_dump_struct, the
code changes int patch https://reviews.llvm.org/D122248
Differential Revision: https://reviews.llvm.org/D122668
Zixu Wang [Fri, 25 Mar 2022 18:43:44 +0000 (11:43 -0700)]
[clang][extract-api] Use correct language info from inputs
The current way of getting the `clang::Language` from `LangOptions` does
not handle Objective-C correctly because `clang::Language::ObjC` does
not correspond to any `LangStandard`. This patch passes the correct
`Language` from the frontend input information.
Differential Revision: https://reviews.llvm.org/D122495
Arjun P [Tue, 29 Mar 2022 16:57:14 +0000 (17:57 +0100)]
[MLIR][Presburger] Simplify std::{all,any}_of -> llvm::{all,any}_of (NFC)
Also simplify [](const F &f){ return f.foo(); } -> std::mem_fn(&F::foo)
Zequan Wu [Mon, 28 Mar 2022 23:42:53 +0000 (16:42 -0700)]
[llvm-pdbutil] Fix a crash due to Expected not checked before destruction
Reviewed By: aganea
Differential Revision: https://reviews.llvm.org/D122622
Mogball [Tue, 29 Mar 2022 16:54:41 +0000 (16:54 +0000)]
[mlir][ods] Allow null to be passed as default-valued attributes
Allow default-valued attributes to be passed as null to builders, which will not add the attribute if not present, so the default value will be returned by getters.
Fangrui Song [Tue, 29 Mar 2022 16:51:41 +0000 (09:51 -0700)]
[ELF] --emit-relocs: adjust offsets of .rel[a].eh_frame relocations
Two code paths may reach the EHFrame case in SectionBase::getOffset:
* .eh_frame reference
* relocation copy for --emit-relocs
The first may be used by clang_rt.crtbegin.o and GCC crtbeginT.o to get the
start address of the output .eh_frame. The relocation has an offset of 0 or
(x86-64 PC-relative leaq for clang_rt.crtbegin.o) -4. The current code just
returns `offset`, which handles this case well.
The second is related to InputSection::copyRelocations on .eh_frame (used by
--emit-relocs). .eh_frame pieces may be dropped due to GC/ICF, so we should
convert the input offset to the output offset. Use the same way as
MergeInputSection with a special case handling outSecOff==-1 for an invalid
piece (see eh-frame-marker.s).
This exposes an issue in mips64-eh-abs-reloc.s that we don't reliably
handle anyway. Just add --no-check-dynamic-relocations to paper over it.
Differential Revision: https://reviews.llvm.org/D122459
Aaron Ballman [Tue, 29 Mar 2022 16:26:38 +0000 (12:26 -0400)]
Fix a test failure.
This amends
3c84e4a0dbd08fc03bbcdd8354a984e0efcf7672 which had an
unsaved change when committed.
Simon Pilgrim [Tue, 29 Mar 2022 16:15:25 +0000 (17:15 +0100)]
[X86] combineCarryThroughADD - remove unused peek through of SEXT/AEXT nodes.
Aaron Ballman [Tue, 29 Mar 2022 16:13:54 +0000 (12:13 -0400)]
[C11] Improve the diagnostic when accessing a member of an atomic struct
Member access for an atomic structure or union is unconditional
undefined behavior (C11 6.5.2.3p5). However, we would issue a confusing
error message about the base expression not being a structure or union
type.
GCC issues a warning for this case. Clang now warns as well, but the
warning is defaulted to an error because the actual access is still
unsafe.
This fixes Issue 54563.
Ron Lieberman [Tue, 29 Mar 2022 14:53:27 +0000 (14:53 +0000)]
[libomptarget] x86 offloading fails map_back_race.cpp intermittently
Differential Revision: https://reviews.llvm.org/D122658
Pavel Labath [Mon, 21 Mar 2022 13:52:22 +0000 (14:52 +0100)]
[lldb] Remove usages of case-insensitive c-string functions
They are not portable (which meant we had a hand-rolled implementation
for windows), and llvm::StringRef provides equivalent functionality.
Danny Mösch [Tue, 29 Mar 2022 15:58:05 +0000 (17:58 +0200)]
[clang-tidy] Fix test failing on 32-bit architectures due to missing `__int128_t`
This was caused by
ff60af91ac0bbab12dd5ff5dc9b78bc1636f2d86. The reason for the failure is that
the type `__int128_t` is not available on 32-bit architectures. So just exclude the test case if
128-bit integers are not available.
Fangrui Song [Tue, 29 Mar 2022 15:56:21 +0000 (08:56 -0700)]
[ELF] --emit-relocs: fix missing STT_SECTION when the first input section is synthetic
addSectionSymbols suppresses the STT_SECTION symbol if the first input section
is non-SHF_MERGE synthetic. This is incorrect when the first input section is synthetic
while a non-synthetic input section exists:
* `.bss : { *(COMMON) *(.bss) }`
(
abc388ed3cf0ef7e617ebe243d3b0b32d29e69a5 regressed the case because
COMMON symbols precede .bss in the absence of a linker script)
* Place a synthetic section in another section: `.data : { *(.got) *(.data) }`
For `%t/a1` in the new test emit-relocs-synthetic.s, ld.lld produces incorrect
relocations with symbol index 0.
```
0000000000000000 <_start>:
0: 8b 05 33 00 00 00 movl 51(%rip), %eax # 0x39 <bss>
0000000000000002: R_X86_64_PC32 *ABS*+0xd
6: 8b 05 1c 00 00 00 movl 28(%rip), %eax # 0x28 <common>
0000000000000008: R_X86_64_PC32 common-0x4
c: 8b 05 06 00 00 00 movl 6(%rip), %eax # 0x18
000000000000000e: R_X86_64_GOTPCRELX *ABS*+0x4
```
Fix the issue by checking every input section.
Reviewed By: ikudrin
Differential Revision: https://reviews.llvm.org/D122463
Louis Dionne [Thu, 24 Mar 2022 13:27:03 +0000 (09:27 -0400)]
[libc++] Use __builtin_expect and __builtin_assume in _LIBCPP_ASSERT
Since we expect the condition to be true most of the time, we might
as well tell the compiler. And when assertions are disabled, we
might as well tell the compiler that it's allowed to assume that
the condition holds.
Differential Revision: https://reviews.llvm.org/D122397
Louis Dionne [Tue, 29 Mar 2022 15:45:49 +0000 (11:45 -0400)]
[libc++][NFC] Fix typo in comment
Hirochika Matsumoto [Tue, 29 Mar 2022 14:51:59 +0000 (10:51 -0400)]
[InstCombine] Fold (ctpop(X) == 1) | (X == 0) into ctpop(X) < 2
https://alive2.llvm.org/ce/z/94yRMN
Fixes #54177
Differential Revision: https://reviews.llvm.org/D122077
Johannes Doerfert [Mon, 21 Mar 2022 21:02:42 +0000 (16:02 -0500)]
[OpenMP] Regenerate the check lines for 2 tests
Somehow those check lines were mostly untested prefixes and the ones we
were looking for have been removed. Simple cleanup.
Ivan Butygin [Mon, 28 Mar 2022 08:09:00 +0000 (11:09 +0300)]
[mlir][spirv] Mark SPV_UndefOp NoSideEffect
Differential Revision: https://reviews.llvm.org/D122561
Nikita Popov [Tue, 29 Mar 2022 14:51:55 +0000 (16:51 +0200)]
[InstCombine] Remove call to getPointerElementType()
This was erroneously re-introduced as part of
bb0b23174e4ab963df427393fbf21bddede499bf.