Commit Graph

459473 Commits

Author SHA1 Message Date
Kiung Jung
eb22971bfb [MLIR][EmitC] Add empty emitc.constant check
Implementing logic to check if the emitc dialect constant Op is empty.

Reviewed By: marbre

Differential Revision: https://reviews.llvm.org/D147907
2023-04-27 16:03:53 +00:00
Ulrich Weigand
f2404d589e [LLD][ELF] Fix compressed-debug-level test on SystemZ
The libz compression library on SystemZ by default makes use of the
platform's hardware-accelerated compression facility. This is much
faster than the regular software implementation, but often results in
slightly different outputs. This causes failures with the
compressed-debug-level test case.

To fix this, run this test while setting the DFLTCC environment
variable to zero, which prevents use of hardware compression and falls
back to the software implementation. (This should not have any effect
on other platforms.)

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D149273
2023-04-27 17:49:32 +02:00
Ulrich Weigand
fb8557813a Fix PDB relocation on big-endian hosts
When running the LLD test suite on a big-endian host, the
COFF/pdb-framedata.yaml test case currently fails.

As it turns out, this is because code in DebugSHandler::finish
intended to relocate RvaStart entries of FDO records does not
work correctly when compiled for a big-endian host.

Fixed by always reading file data in little-endian mode.

Reviewed By: aganea

Differential Revision: https://reviews.llvm.org/D149268
2023-04-27 17:48:27 +02:00
Akash Banerjee
1ed522623d [MLIR][OpenMP] Use inlineConvertOmpRegions for targetData conversion
Co-authored-by: Kiran Chandramohan <kiran.chandramohan@arm.com>

Reviewed By: TIFitis

Differential Revision: https://reviews.llvm.org/D149153
2023-04-27 15:45:54 +00:00
Kiung Jung
2aa1818a76 Disallow to apply the op & to const
Disallow to apply the operator & (address of) to emitc.constant operations.

Reviewed By: marbre, simon-camp

Differential Revision: https://reviews.llvm.org/D147992
2023-04-27 15:44:16 +00:00
Craig Topper
0b5396b163 [LegalizeVectorOps] Use all ones mask when expanding i1 VP_SELECT.
We were previously using the condition as the mask. By the semantics
of VP operations, that means that anywhere the condition is false
returns poison and not the false operand.

Use an all ones mask instead.

No tests are affected because RISC-V drops the mask when lowering.

Reviewed By: fakepaper56

Differential Revision: https://reviews.llvm.org/D149310
2023-04-27 08:26:16 -07:00
Mark de Wever
019e784bb1 [libc++] Adds newer clang-tidy in the CI.
In order to use clang-tidy for modules version 17 is required. Some of the
development fixes haven't been backported. This adds the new version to
the CI so it can be used in a follow-up patch.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D148831
2023-04-27 17:24:17 +02:00
Jakub Kuderski
ab85aec1af [mlir][arith] Add missing canon pattern trunci(ext*i(x)) -> ext*i(x)
This pattern triggers when only the extension bits are truncated.

Reviewed By: dcaballe

Differential Revision: https://reviews.llvm.org/D149286
2023-04-27 11:21:59 -04:00
Craig Topper
05d0caef60 [RISCV] Remove support for attribute interrupt("user").
This was part of the N extension which didn't make it version
1.12 of the privilege specification.

Reviewed By: kito-cheng

Differential Revision: https://reviews.llvm.org/D149314
2023-04-27 08:21:36 -07:00
Mark de Wever
96f303324f [libc++][chrono] Adds formatter file_time.
Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D148928
2023-04-27 17:12:59 +02:00
LLVM GN Syncbot
30e1e292d6 [gn build] Port 9d16cbc5c8 2023-04-27 15:07:24 +00:00
Mark de Wever
9d16cbc5c8 [libc++] Adds more forward declaration headers.
The module validation script of D144994 validate whether the contents of
an include match its module. An include is the set of files matching the
pattern:
- foo
- foo/*.
- __fwd/foo.h

Several declarations of the stream headers are in the header iosfwd.
This gives issue using the validation script. Adding iosfwd to the set
of matching files gives too many declarations. For example when
validating the fstream header it will pull in declarations of the
istream header. Instead if writing a set of filters the headers are
granularized into smaller headers containing the expected declarations.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D148927
2023-04-27 17:07:10 +02:00
Louis Dionne
77ac36547a [libc++] Fix ODR violation with placeholders
In D145589, we made the std::bind placeholders inline constexpr to
satisfy C++17. It turns out that this causes ODR violations since the
shared library provides strong definitions for those placeholders, and
the linker on Windows actually complains about this.

Fortunately, C++17 only encourages implementations to use `inline constexpr`,
it doesn't force them. So instead, we unconditionally define the placeholders
as `extern const`, which avoids the ODR violation and is indistinguishable
from `inline constexpr` for most purposes, since the placeholders are
empty types anyway.

Note that we could also go back to the pre-D145589 state of defining them
as non-inline constexpr variables in C++17, however that is definitely
non-conforming since that means the placeholders have different addresses
in different TUs. This is all a bit pedantic, but all in all I feel that
`extern const` provides the best bang for our buck, and I can't really
find any downsides to that solution.

Differential Revision: https://reviews.llvm.org/D149292
2023-04-27 10:57:15 -04:00
Andrew Gozillon
6d0ca5ae4c [MLIR][OpenMP][test] Update omp::FlagsAttr tests to only use CHECK tests
The CHECK-NOT tests were incorrect and impacting the other
tests flag tests negatively, they'd pass as false positives.
2023-04-27 09:23:39 -05:00
Andrew Gozillon
2f5477df95 [MLIR][OpenMP] Add check for appropriate module operation during convertFlagsAttr
Checks if the operation the attirbute resides on is an ModuleOp otherwise it fails.
2023-04-27 09:23:39 -05:00
Nico Weber
843450b9a6 [clang] Try to fix check-clang after f539b6ffc2 2023-04-27 10:12:39 -04:00
Christian Ulmann
a8dd375cbf [PGO] Move CFGMST.h into the include directory
This commit moves the CFGMST.h file into the include directory. The
implemented algorithm is can be helpful for downstream projects that
want to use the PGO data in a non-standard way.

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D149336
2023-04-27 14:11:04 +00:00
Nikita Popov
28adee04d1 [Polly] Update polly test after SCEV changes
Make the phi non-trivial, so SCEV can't see through it.
2023-04-27 16:09:08 +02:00
skc7
e016fb57b3 [AMDGPU] Legalize soffset of buffer instructions. Use Waterfall loop logic.
Legalize soffset of buffer instructions using waterfall loop.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D141030
2023-04-27 19:36:50 +05:30
Zequan Wu
439f804c47 Revert "[COFF] Add MC support for emitting IMAGE_WEAK_EXTERN_ANTI_DEPENDENCY symbols"
This reverts commit 10c17c97eb. It causes undefined symbol error on chromium windows build. A small repro was uploaded to the code review.
2023-04-27 10:01:56 -04:00
Akash Banerjee
51297a7a72 [MLIR][OpenMP][NFC] Minor code cleanup
Cleanup how the IsBegin argument is passed and removed unnecessary variable.
2023-04-27 14:49:32 +01:00
Jingu Kang
044f27f62f [AArch64] Precommit tests for VECTOR_SHUFFLE 2023-04-27 14:44:09 +01:00
ManuelJBrito
8b56da5e9f [IR] Change shufflevector undef mask to poison
With this patch an undefined mask in a shufflevector will be printed as poison.
This change is done to support the new shufflevector semantics
for undefined mask elements.

Differential Revision: https://reviews.llvm.org/D149210
2023-04-27 14:41:10 +01:00
Zhongyunde
90d30fde12 [InstCombine] Add frozen for the condition value of SelectInst
If the condition value of SelectInst may be a poison or undef value,
infer constant range at SelectInst use is incorrect, similar to D143883.
Fixes https://github.com/llvm/llvm-project/issues/62401

Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D149339
2023-04-27 21:35:54 +08:00
Erich Keane
f539b6ffc2 [NFC] Add tests from my fix for GH62362.
This ended up being fixed separately by @rsmith in 1e43349e3 in a
better/correct way. This patch adds the tests from the original, as
though they are reasonably covered in his patch, explicit versions seem
to have value here.

Additionally, this adds a release note for 1e43349e3.
2023-04-27 06:33:34 -07:00
Nikita Popov
fa0014a68b [SCEV] Drop LCSSA check in createNodeFromSelectLikePHI()
SCEV expressions no longer try to preserve LCSSA form. SCEV
construction will try to look through LCSSA phi nodes. As such,
we also no longer need to limit this special-case fold.
2023-04-27 15:18:07 +02:00
Nikita Popov
079c525f20 [SCEV] Try simplifying phi before createNodeFromSelectLikePHI()
Sometimes a phi can both be trivial and match the
createNodeFromSelectLikePHI() fold. In that case it is generally
more profitable to look through the phi node.
2023-04-27 15:07:19 +02:00
Haojian Wu
6cfcf0242f [clangd] Fix the include-cleaner-batch-fix.test failure on some
platforms

It seems that on some platforms, the spelling include doesn't work. Make
the test less strict on it.
2023-04-27 14:59:37 +02:00
OCHyams
bd1109307a [DebugInfo][InstCombine] Fix missing source and variable locations after foldOpIntoPhi
Reviewed By: fdeazeve

Differential Revision: https://reviews.llvm.org/D149335
2023-04-27 13:56:09 +01:00
Ilya Leoshkevich
a3e56a8792 [KMSAN] Enable on SystemZ
Enable -fsanitize=kernel-memory support in Clang.

The x86_64 ABI requires that shadow_origin_ptr_t must be returned via a
register pair, and the s390x ABI requires that it must be returned via
memory pointed to by a hidden parameter. Normally Clang takes care of
the ABI, but the sanitizers run long after it, so unfortunately they
have to duplicate the ABI logic.

Therefore add a special case for SystemZ and manually emit the
s390x-ABI-compliant calling sequences. Since it's only 2 architectures,
do not create a VarArgHelper-like abstraction layer.

The kernel functions are compiled with the "packed-stack" and
"use-soft-float" attributes. For the "packed-stack" functions, it's not
correct for copyRegSaveArea() to copy 160 bytes of shadow and origins,
since the save area is dynamically sized. Things are greatly simplified
by the fact that the vararg "use-soft-float" functions use precisely
56 bytes in order to save the argument registers to where va_arg() can
find them.

Make copyRegSaveArea() copy only 56 bytes in the "use-soft-float" case.
The "packed-stack" && !"use-soft-float" case has no practical uses at
the moment, so leave it for the future.

Add tests.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D148596
2023-04-27 13:44:54 +02:00
Nikita Popov
fe3ed6550e [SCEV] Regenerate test checks (NFC) 2023-04-27 12:57:28 +02:00
Nikita Popov
c27a96607c [SCEV] Remove LCSSA special case in getSCEVAtScope() (NFCI)
We no longer try to preserve LCSSA form in SCEV representation:
Nowadays, we look through LCSSA PHI nodes directly during SCEV
construction. As such, this separate special case in
getSCEVAtScope() is no longer needed.
2023-04-27 12:53:03 +02:00
Jie Fu
6d2c293bb2 [mlir][test] Remove unused lambda capture 'this' in UtilsTest.cpp (NFC)
/data/llvm-project/mlir/unittests/Analysis/Presburger/UtilsTest.cpp:39:17: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
  auto merge = [this](unsigned i, unsigned j) -> bool { return true; };
                ^~~~
/data/llvm-project/mlir/unittests/Analysis/Presburger/UtilsTest.cpp:52:17: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
  auto merge = [this](unsigned i, unsigned j) -> bool { return true; };
                ^~~~
2 errors generated.
2023-04-27 18:45:14 +08:00
Timm Bäder
f8a9c55bef [clang][Interp] Emit diagnostic when comparing function pointers
Function pointers can be compared for (in)equality but, but LE, GE, LT,
and GT opcodes should emit an error and abort.

Differential Revision: https://reviews.llvm.org/D149154
2023-04-27 12:33:28 +02:00
Haojian Wu
4b1cec0652 [clangd] Add batch fixes for include-cleaner diagnostics
For each unused-include/missing-include diagnostic, we provide fix-all
alternative to them.

This patch also adds LSP ChangeAnnotation support.

Differential Revision: https://reviews.llvm.org/D147684
2023-04-27 12:08:59 +02:00
Jay Foad
fdc0d5f399 [DAG] Do not call computeKnownBits from isKnownToBeAPowerOfTwo
The only way known bits could help identify a known power of two is if
it knows exactly which power of two it is, i.e. if it is a known
constant. But in that case the value should have been simplified to a
constant already. So save some compile time by not calling
computeKnownBits.

Differential Revision: https://reviews.llvm.org/D149325
2023-04-27 11:05:56 +01:00
Timm Bäder
6cf14a7239 [clang][Interp] Check Neg ops for errors
This should fail when negating __INT_MIN__.

Differential Revision: https://reviews.llvm.org/D148987
2023-04-27 12:05:23 +02:00
Mikhail Goncharov
8babf8f343 [bazel][mlir] fix build for transform utils 2023-04-27 12:03:20 +02:00
Alexis Engelke
7751a91465 [AArch64][FastISel] Handle call with multiple return regs
The code closely follows the X86 back-end. Applications that make heavy
use of {i64, i64} returns to use two registers strongly benefit from the
reduced number of SelectionDAG fallbacks.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D148346
2023-04-27 11:59:33 +02:00
Jie Fu
563e3028c9 [X86] Fix -Wstring-conversion in X86InstrInfo.cpp (NFC)
/Users/jiefu/llvm-project/llvm/lib/Target/X86/X86InstrInfo.cpp:9794:12: error: implicit conversion turns string literal into bool: 'const char[25]' to 'bool' [-Werror,-Wstring-conversion]
    assert("It should not reach here");
    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode13.1/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/assert.h:99:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)
                      ~ ^
1 error generated.
2023-04-27 17:52:57 +08:00
Mariya Podchishchaeva
7c97dc20ab [clang] Do not crash on undefined template partial specialization
Before checking that template partial specialization is "reachable",
ensure it exists.

Fixes https://github.com/llvm/llvm-project/issues/61356

Reviewed By: shafik, erichkeane

Differential Revision: https://reviews.llvm.org/D148330
2023-04-27 05:38:41 -04:00
Nikita Popov
19732a3eaa [SCEV] Check correct binary operator for nowrap flags
We should be checking the current BO here, not the nested one. If
the current BO has nowrap flags (and is UB on poison), then we'll
fetch both operand SCEVs of that BO. We'll check the nested BO
on the next iteration of the do/while loop.
2023-04-27 11:25:40 +02:00
Nikita Popov
3690e1f8a7 [SCEV] Check MatchBinaryOp opcode instead of original opcode
These are not necessarily the same (e.g. or can become add) and
this is what we're switching over in the first place.
2023-04-27 11:13:35 +02:00
Jie Fu
8de16131cb [X86] Fix -Wsometimes-uninitialized in X86InstrInfo.cpp (NFC)
/data/llvm-project/llvm/lib/Target/X86/X86InstrInfo.cpp:9793:3: error: variable 'MaddOpc' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
  default:
  ^~~~~~~
/data/llvm-project/llvm/lib/Target/X86/X86InstrInfo.cpp:9854:25: note: uninitialized use occurs here
  Madd->setDesc(TII.get(MaddOpc));
                        ^~~~~~~
/data/llvm-project/llvm/lib/Target/X86/X86InstrInfo.cpp:9791:19: note: initialize the variable 'MaddOpc' to silence this warning
  unsigned MaddOpc;
                  ^
                   = 0
/data/llvm-project/llvm/lib/Target/X86/X86InstrInfo.cpp:9793:3: error: variable 'AddOpc' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
  default:
  ^~~~~~~
/data/llvm-project/llvm/lib/Target/X86/X86InstrInfo.cpp:9862:46: note: uninitialized use occurs here
      BuildMI(*MF, MIMetadata(Root), TII.get(AddOpc), DstReg)
                                             ^~~~~~
/data/llvm-project/llvm/lib/Target/X86/X86InstrInfo.cpp:9790:18: note: initialize the variable 'AddOpc' to silence this warning
  unsigned AddOpc;
                 ^
                  = 0
2 errors generated.
2023-04-27 17:08:24 +08:00
Mikhail Goncharov
25462d14b1 [bazel][mlir] update build for mem2reg f88f8fd0bc
Differential Revision: https://reviews.llvm.org/D149326
2023-04-27 10:59:53 +02:00
Nikita Popov
4fcb006fb6 [SCEV] Fix getOperandsToCreate() for and/or
We can create expressions either for constant operand or i1
and/or. The implementation was inverting the latter check.
2023-04-27 10:50:57 +02:00
gilsaia
e63cc56d9d [MLIR][presburger] normalize divisionrepr
Added a simple normalize function to divisionrepr and added a simple unittest.
Added a normalizediv call to divisionrepr's removeDuplicateDivs function, which now eliminates divs that are consistent after gcd's normalize

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D147381
2023-04-27 14:13:15 +05:30
Luo, Yuanke
8f7f9d86a7 [X86] Machine combine vnni instruction.
"vpmaddwd + vpaddd" can be combined to vpdpwssd and the latency is
reduced after combination. However when vpdpwssd is in a critical path
the combination get less ILP. It happens when vpdpwssd is in a loop, the
vpmaddwd can be executed in parallel in multi-iterations while vpdpwssd
has data dependency for each iterations. If vpaddd is in a critical path
while vpmaddwd is not, it is profitable to split vpdpwssd into "vpmaddwd
+ vpaddd".
This patch is based on the machine combiner framework to acheive decision
on "vpmaddwd + vpaddd" combination. The typical example code is as
below.
```
__m256i foo(int cnt, __m256i c, __m256i b, __m256i *p) {

    for (int i = 0; i < cnt; ++i) {
        __m256i a = p[i];
        __m256i m = _mm256_madd_epi16 (b, a);
        c = _mm256_add_epi32(m, c);
    }

    return c;
}
```

Differential Revision: https://reviews.llvm.org/D148980
2023-04-27 16:42:04 +08:00
Jay Foad
47d3cbcf84 [BranchFolder] Skip redundant IMPLICIT_DEFs of subregs
Differential Revision: https://reviews.llvm.org/D148509
2023-04-27 09:40:06 +01:00
Jay Foad
12b70ad68c [BranchFolder] Precommit AMDGPU test case for D148509 2023-04-27 09:40:06 +01:00