Commit Graph

419522 Commits

Author SHA1 Message Date
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
Dominic Chen
92897217fa [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
2022-03-29 14:26:15 -07:00
Benjamin Kramer
35dab904c0 [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
2022-03-29 23:05:54 +02:00
Eli Friedman
a8ebd85e46 [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
2022-03-29 14:01:32 -07:00
Vitaly Buka
01daf97a0b [NFC] clang-format sanitizer_interface_internal.h 2022-03-29 13:29:07 -07:00
Chris Bieneman
dfde354958 NFC. Fixing warnings from adding DXContainer
Adds DXContainer to switch statements in Clang and LLDB to silence
warnings.
2022-03-29 14:46:24 -05:00
Chris Bieneman
9130e471fe 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
2022-03-29 14:34:23 -05:00
Florian Hahn
d1d3563278
[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
2022-03-29 20:27:59 +01:00
Sanjay Patel
7f5c2f6a76 [x86] consolidate tests and auto-gen complete check lines; NFC
The same test was duplicated in 2 files.
2022-03-29 14:55:04 -04:00
Markus Böck
c1e614c8eb [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
2022-03-29 20:45:49 +02:00
wangyihan
de7cd3ccf5 [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
2022-03-29 11:38:29 -07:00
Chris Bieneman
7a94a032f0 NFC. Fixing rebase error
Somehow managed to get a double-assignment in there. Thanks @erichkeane
for pointing it out!
2022-03-29 13:19:06 -05:00
Stanislav Mekhanoshin
f311f934e1 [AMDGPU] gfx940 VALU hazard recognizer
Differntial Revision: https://reviews.llvm.org/D122339
2022-03-29 10:57:54 -07:00
Mehdi Amini
267d1873fa Revert "[Support/BLAKE3] Re-enable building with the simd-optimized implementations"
This reverts commit 23519d3000.

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
        ^
2022-03-29 17:43:37 +00:00
Chris Bieneman
b39f437757 [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
2022-03-29 12:39:39 -05:00
wangyihan
6c32075d29 [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
2022-03-29 10:30:34 -07:00
Zixu Wang
15bf0e5673 [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
2022-03-29 10:06:08 -07:00
Arjun P
ef6f7c4a60 [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)
2022-03-29 18:04:45 +01:00
Zequan Wu
a9e29848a2 [llvm-pdbutil] Fix a crash due to Expected not checked before destruction
Reviewed By: aganea

Differential Revision: https://reviews.llvm.org/D122622
2022-03-29 10:01:32 -07:00