Commit graph

419690 commits

Author SHA1 Message Date
wangpc cebbfd3d25 [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
2022-03-30 19:29:13 +08:00
Aaron Ballman cf4a67bcbb 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.
2022-03-30 07:12:49 -04:00
Simon Pilgrim 4a33b9ece0 [MC][X86] Ensure all opcode tests are sorted by instruction name
Noticed while reviewing D122449
2022-03-30 11:08:11 +01:00
Luo, Yuanke 7471d8b13c [X86][AMX] Pre-checkin the test case for AMX undef and zero 2022-03-30 17:53:01 +08:00
Serge Pavlov 8160dd582b Revert "Mapping of FP operations to constrained intrinsics"
This reverts commit 115b3ace36.
Starting from this commit the buildbot sanitizer-x86_64-linux-bootstrap-msan
starts failing (build 10071). Reverted for investigation.
2022-03-30 16:46:43 +07:00
Luo, Yuanke 1141c8b6fc [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.
2022-03-30 17:22:30 +08:00
Vitaly Buka 15972e37ba [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
2022-03-30 02:08:13 -07:00
Nikita Popov 6ae13b74d6 [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
2022-03-30 10:57:42 +02:00
Simon Pilgrim bce954321a [X86] Add PR47857 test case 2022-03-30 09:51:36 +01:00
Liqin Weng 4cb85da811 [RISCV] Add CMIX isel pattern for (xor (and (xor rs1, rs3), rs2), rs3)
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D122702
2022-03-30 16:51:09 +08:00
bzcheeseman 4fec44b0e6 [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
2022-03-30 01:37:20 -07:00
Luboš Luňák a60e09509c add missing include for -DLLVM_ENABLE_MODULES=On 2022-03-30 10:31:59 +02:00
Simon Pilgrim 6697e3354f [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
2022-03-30 09:11:55 +01:00
Simon Pilgrim d663166acb [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
2022-03-30 09:11:55 +01:00
Ingo Müller e124f73b52 [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
2022-03-30 08:08:42 +00:00
Fraser Cormack 75047577d6 [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
2022-03-30 08:56:38 +01:00
Nikita Popov ea043ea183 [MLIR] Avoid some pointer element type accesses
Determine the element type from the MLIR LLVMPointerType, rather
than the LLVM PointerType.
2022-03-30 10:00:51 +02:00
Nikita Popov 8a72391f60 [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
2022-03-30 09:51:24 +02:00
LLVM GN Syncbot f54f448525 [gn build] Port 1410a4860e 2022-03-30 07:33:49 +00:00
Pavel Labath 1410a4860e [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.
2022-03-30 09:32:35 +02:00
Markus Böck e59335e891 [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
2022-03-30 09:25:52 +02:00
Pavel Labath c484857b2e [lldb] Use =default in the ValueList class 2022-03-30 09:12:59 +02:00
Danny Mösch b3079e8a7e [clang-tidy] Make test work on architectures which do not provide a __int128_t
See f10cee91ae. 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.
2022-03-30 08:03:32 +02:00
Serge Pavlov 115b3ace36 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
2022-03-30 12:21:30 +07:00
Michael Kruse 793b7f903d [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.
2022-03-29 23:26:18 -05:00
Liqin Weng 7f81765898 [RISCV][NFC] Add immediate tests for the icmp instruction
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D122651
2022-03-30 02:51:26 +00:00
Chenbing Zheng 780eb9f586 [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
2022-03-30 09:50:28 +08:00
Zakk Chen b578330754 [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
2022-03-29 18:05:33 -07:00
Zakk Chen 10b2760da0 Revert "[RISCV] Add policy operand for masked compare and vmsbf/vmsif/vmsof IR"
This reverts commit 10fd2822b7.

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
2022-03-29 18:05:33 -07:00
Dominic Chen 22a95dd3e6 Revert "[scudo] Wrap clang pragma to avoid GCC error"
Revert "[scudo] Add noreturn/pragma to suppress compiler warnings"

This reverts commit 686dcbe8b0.
This reverts commit 030d8262a6.
2022-03-29 17:52:20 -07:00
Dominic Chen 6ba8c8abe9 [scudo] Provide allocator declaration
Ensure that extern allocator declaration is visible before definition

Differential Revision: https://reviews.llvm.org/D121848
2022-03-29 17:39:45 -07:00
Dominic Chen 030d8262a6 [scudo] Wrap clang pragma to avoid GCC error
Fixes: [scudo] Add noreturn/pragma to suppress compiler warnings

Differential Revision: https://reviews.llvm.org/D121853
2022-03-29 17:36:33 -07:00
Roland McGrath fd7ec90abd [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
2022-03-29 17:13:55 -07:00
Michael Jones 9276074271 [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
2022-03-29 16:34:52 -07:00
Michael Jones 2f8829aba3 [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
2022-03-29 16:23:36 -07:00
Michael Jones 4ac3f7e41a [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
2022-03-29 16:05:40 -07:00
Akira Hatanaka 6ec79a15cb 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.
2022-03-29 15:53:36 -07:00
Jonas Devlieghere 8991ad43ff
[lldb] Make ModuleSpecList iterable (NFC) 2022-03-29 15:26:54 -07:00
Chris Bieneman 94189b42cc [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
2022-03-29 17:17:19 -05:00
Vince Bridgers fe8b2236ef [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
2022-03-29 17:08:19 -05:00
Yonghong Song 5898979387 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
2022-03-29 15:03:26 -07:00
Shraiysh Vaishay 4d1010909f [mlir][OpenMP] Fix memory leak by deleting unused value
Reviewed By: ftynse, rriddle

Differential Revision: https://reviews.llvm.org/D122633
2022-03-30 03:25:53 +05:30
Florian Hahn ecb4171dcb
[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.
2022-03-29 22:52:43 +01:00
Zixu Wang d1d34bafef [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
2022-03-29 14:44:49 -07:00
Vitaly Buka 122638d97d [msan] Add link to the lifetime definition
Differential Revision: https://reviews.llvm.org/D122685
2022-03-29 14:42:36 -07:00
James Y Knight 8f66f13719 Fix memory leak in [Clang] Implement __builtin_source_location.
Fixes: d614874900
2022-03-29 17:32:59 -04:00
Zixu Wang 9b36e126fd [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
2022-03-29 14:29:39 -07:00
Dominic Chen 686dcbe8b0 [scudo] Add noreturn/pragma to suppress compiler warnings
Differential Revision: https://reviews.llvm.org/D121853
2022-03-29 14:26:15 -07:00
Dominic Chen db13f5a1b0 [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
2022-03-29 14:26:15 -07:00
Dominic Chen d0eeb0fba0 [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
2022-03-29 14:26:15 -07:00