Commit Graph

413851 Commits

Author SHA1 Message Date
Joseph Huber 9138d96f8b [OpenMP] Don't use bound architecture when checking cache on the host
When we are creating jobs for the new driver we first check the cache to
see if the job was already created as a part of the offloading
toolchain. This would sometimes fail if the bound architecture was set
for the host during offloading. We want to ingore this because it is not
relevant for looking up host actions. Previously it was set on some
machines and would cause the cache lookup to fail.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D118858
2022-02-03 17:17:38 -05:00
Vy Nguyen 36f32ffd2a [lld-macho] Minor clean up: use .find() to check for key existence rather than [], which would create a new entry.
Differential Revision: https://reviews.llvm.org/D118945
2022-02-03 17:17:14 -05:00
Zequan Wu ac73e12ee0 [LLDB] remove an extra register enum on windows x64 2022-02-03 14:12:24 -08:00
Nikolas Klauser 5173f43cc8 [libc++] Remove the std::string base class
Removing the base class of std::basic_string is not an ABI break, so we can remove any references to it from the header.

Reviewed By: ldionne, Mordante, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D118733
2022-02-03 22:57:23 +01:00
Björn Schäpers 3d0b619261 [clang-format][NFC] Code Tidies in UnwrappedLineFormatter
* Give I[1] and I[-1] a name:
  - Easier to understand
  - Easier to debug (since you don't go through operator[] everytime)
* TheLine->First != TheLine->Last follows since last is a l brace and
  first isn't.
* Factor the check for is(tok::l_brace) out.
* Drop else after return.

Differential Revision: https://reviews.llvm.org/D115060
2022-02-03 22:55:27 +01:00
Nico Weber e017dbab8c [gn build] (manually) attempt to port 95d609b549 2022-02-03 16:53:34 -05:00
ksyx 88e4e6be16 [clang-format] Use wider comment prefix space rule
This commit changes the condition of requiring comment to start with
alphanumeric characters to make no change only for a certain set of
characters, currently horizontal whitespace and punctuation characters,
to support wider set of leading characters unrelated to documentation
generation directives.

Reviewed By: HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D118869
2022-02-03 21:49:10 +00:00
Ben Barham a5cff6af1d [VFS] Add back setFallthrough for downstream users
This fixes lldb's build. We can remove this in the future if we want but
for now this will be nicer to existing consumers.
2022-02-03 13:46:18 -08:00
Aaron Ballman e765e0bc8e Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the first batch of tests being updated (there are a significant
number of other tests left to be updated).
2022-02-03 16:42:27 -05:00
Shoaib Meenai 4db89e2319 [cmake] Increase -fms-compatibility-version in Windows toolchain file
Make it match LLVM's new minimum requirement (after https://reviews.llvm.org/D114639).
2022-02-03 13:41:46 -08:00
Alexander Yermolovich 4d5f66da6a [GSYM] Add Split Dwarf Support to DwarfTransformer
The convert only worked on CUs in main binary.
If it's a skeleton CU it will now use the DWO CU
when invoking handleDie.

Test Plan:
llvm-lit

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D118521
2022-02-03 13:39:19 -08:00
Dmitri Gribenko 852afed5e0 Revert "[clang] Mark `trivial_abi` types as "trivially relocatable"."
This reverts commit 19aa2db023. It breaks
a PS4 buildbot.
2022-02-03 22:31:44 +01:00
Alex Brachet 85381e67a9 [llvm-objcopy][COFF] Implement --update-section
Reviewed By: jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D118189
2022-02-03 21:30:42 +00:00
Philip Reames 1519629a20 [SLP] Add basic self consistency asserts into scheduling
The idea here is to have a verify routine we can call during scheduling to ensure broken invariants are reported.  The intent is to help in debugging scheduling bugs.

At the moment, only the most basic properties are checked as adding several I thought held reported failures.
2022-02-03 13:27:35 -08:00
Thomas Raoux c3c1c5c695 [mlir][scf] Fix bug in pipelining prologue emission
Induction variable calculation was ignoring scf.for step value. Fix it to get
the correct induction variable value in the prologue.

Differential Revision: https://reviews.llvm.org/D118932
2022-02-03 13:12:50 -08:00
Ben Barham 502f14d6f2 [VFS] Add a "redirecting-with" field to overlays
Extend "fallthrough" to allow a third option: "fallback". Fallthrough
allows the original path to used if the redirected (or mapped) path
fails. Fallback is the reverse of this, ie. use the original path and
fallback to the mapped path otherwise.

While this result *can* be achieved today using multiple overlays, this
adds a much more intuitive option. As an example, take two directories
"A" and "B". We would like files from "A" to be used, unless they don't
exist, in which case the VFS should fallback to those in "B".

With the current fallthrough option this is possible by adding two
overlays: one mapping from A -> B and another mapping from B -> A. Since
the frontend *nests* the two RedirectingFileSystems, the result will
be that "A" is mapped to "B" and back to "A", unless it isn't in "A" in
which case it fallsthrough to "B" (or fails if it exists in neither).

Using "fallback" semantics allows a single overlay instead: one mapping
from "A" to "B" but only using that mapping if the operation in "A"
fails first.

"redirect-only" is used to represent the current "fallthrough: false"
case.

Differential Revision: https://reviews.llvm.org/D117937
2022-02-03 13:10:23 -08:00
Matt Morehouse 95d609b549 [HWASan] Add __hwasan_init to .preinit_array.
Fixes segfaults on x86_64 caused by instrumented code running before
shadow is set up.

Reviewed By: pcc

Differential Revision: https://reviews.llvm.org/D118171
2022-02-03 13:07:58 -08:00
Vang Thao 2ca194ff55 [AMDGPU] Fix scheduler live-ins with debug inst at start of block
GCNDownwardRPTracker RPTracker.reset() skips debug instructions for NextMI so RPTracker.getNext() will never give the beginning of a sched region if it is a debug value. In this case we will never set the live-ins for that block.

Add check to see if getNext also equals the MI after skipping debug instructions.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D118853
2022-02-03 12:41:32 -08:00
Mircea Trofin 592f52de33 [nfc][regalloc] const LiveIntervals within the allocator
Once built, LiveIntervals are immutable. This patch captures that.

Differential Revision: https://reviews.llvm.org/D118918
2022-02-03 12:35:36 -08:00
Philip Reames 9fa3243ffc [tests] Add coverage for SLP reschedule event
This is slightly reduced from the crash reported against D117951.
2022-02-03 12:23:11 -08:00
Kazu Hirata 3710078ceb [SampleProfile] Reduce indentation with an early return (NFC) 2022-02-03 12:22:23 -08:00
Bjorn Pettersson 0352ee1a22 [CodeGenPrepare] Avoid out-of-bounds shift
AddressingModeMatcher::matchOperationAddr may attempt to shift a
variable by the same amount of steps as found in the IR in a SHL
instruction. This was done without considering that there could be
undefined behavior in the IR, so the shift performed when compiling
could end up having undefined behavior as well.

This patch avoid UB in the codegenprepare by making sure that we
limit the shift amount used, in a similar way as already being done
in CodeGenPrepare::optimizeLoadExt.

Differential Revision: https://reviews.llvm.org/D118602
2022-02-03 21:03:58 +01:00
Stanislav Mekhanoshin 1d111090ad [AMDGPU] Fix windows build warning with IMMBitSelConst. NFC.
VS gives this warning for an integer constant:
AMDGPUGenDAGISel.inc(214687): warning C4334: '<<': result of 32-bit
shift implicitly converted to 64 bits (was 64-bit shift intended?)
2022-02-03 12:03:22 -08:00
John Ericson e0eeae9a44 [lld][clang][cmake] Clean up a few things
- If not using `llvm-config`, `LLVM_MAIN_SRC_DIR` now has a sane default

- `LLVM_CONFIG_PATH` will continue to work for LLD for back compat.

- More quoting of paths in an abundance of caution.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D118792
2022-02-03 20:01:28 +00:00
River Riddle 139751e514 [mlir:Vector][NFC] Remove unnecessary dependency on Affine 2022-02-03 11:55:14 -08:00
Zequan Wu 607ffa5515 [LLDB] Fix window bot failure
This attempts to fix this bot failure: https://lab.llvm.org/buildbot/#/builders/83/builds/14736 caused by D118750 by un-xfail those expected failed tests.

Differential Revision: https://reviews.llvm.org/D118866
2022-02-03 11:27:48 -08:00
Caroline Concatto 961e954af5 [AArch64][SVE] Add more folds to make use of gather/scatter with 32-bit indices
In AArch64ISelLowering.cpp this patch implements this fold:

1) GEP (%ptr, SHL ((stepvector(A) + splat(%offset))) << splat(B)))
into GEP (%ptr + (%offset << B), step_vector (A << B))

The above transform simplifies the index operand so that it can be expressed
as i32 elements.
This allows using only one gather/scatter assembly instruction instead of two.

Patch by Paul Walker (@paulwalker-arm).

Depends on D117900

Differential Revision: https://reviews.llvm.org/D118345
2022-02-03 19:18:30 +00:00
Florian Mayer 8ada962a34 [NFC] [hwasan] use InstIterator
Differential Revision: https://reviews.llvm.org/D118865
2022-02-03 11:10:18 -08:00
Keith Smiley ecf132debc [llvm-libtool-darwin] Remove var to fix use
This seems to have been moved so the second use is invalid on Linux but
not macOS
2022-02-03 11:07:14 -08:00
Florian Mayer 9ac874ff7f [nfc] [mte] use InstrIter.
this improves code clarity.
2022-02-03 11:01:05 -08:00
Caroline Concatto 019f0221d5 [AArch64][SVE] Fold gather/scatter with 32bits when possible
In AArch64ISelLowering.cpp this patch implements this fold:

GEP (%ptr, (splat(%offset) + stepvector(A)))
into GEP ((%ptr + %offset), stepvector(A))

The above transform simplifies the index operand so that it can be expressed
as i32 elements.
This allows using only one gather/scatter assembly instruction instead of two.

Patch by Paul Walker (@paulwalker-arm).

Depends on D118459

Differential Revision: https://reviews.llvm.org/D117900
2022-02-03 18:58:37 +00:00
River Riddle 14124c3025 [mlir][NFC] Split MlirQuant into proper IR/Utils/Transforms libraries
This matches the structure of other dialects, and also removes
unnecessary dependencies from the core dialect lib.
2022-02-03 10:54:52 -08:00
Mahesh Ravishankar 32288d3722 [mli][Linalg] NFC: Refactor methods in `ElementwiseOpFusion`.
Reorder the methods and patterns to move related patterns/methods
closer (textually).

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D118870
2022-02-03 18:53:13 +00:00
Dmitry Vyukov 4f3f4d6722 sanitizer_common: fix __sanitizer_get_module_and_offset_for_pc signature mismatch
This fixes the following error:

sanitizer_interface_internal.h:77:7: error: conflicting types for
     '__sanitizer_get_module_and_offset_for_pc'
  int __sanitizer_get_module_and_offset_for_pc(
common_interface_defs.h:349:5: note: previous declaration is here
int __sanitizer_get_module_and_offset_for_pc(void *pc, char *module_path,

I am getting it on a code that uses sanitizer_common (includes internal headers),
but also transitively gets includes of the public headers in tests
via an internal version of gtest.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D118910
2022-02-03 19:41:19 +01:00
mydeveloperday 23fc20e06c [clang-format] regression from clang-format v13
https://github.com/llvm/llvm-project/issues/53567

The following source

```
namespace A {

template <int N> struct Foo<char[N]> {
  void foo() { std::cout << "Bar"; }
}; // namespace A
```

is incorrectly formatted as:

```
namespace A {

template <int N> struct Foo<char[N]>{void foo(){std::cout << "Bar";
}
}
; // namespace A
```

This looks to be caused by 5c2e7c9ca0

Reviewed By: curdeius

Differential Revision: https://reviews.llvm.org/D118911
2022-02-03 18:37:43 +00:00
Keith Smiley ffea9fc10d [llvm-libtool-darwin] Improve warning message for no symbols
This more closely mirrors apple's libtool, and also potentially makes it
clearer for multi-arch archives where the issue lies.

Differential Revision: https://reviews.llvm.org/D118867
2022-02-03 10:22:06 -08:00
Joseph Huber 28ab5944cd [Clang][Docs] Add documention for new OpenMP offloading driver
This patch adds more documentation for the OpenMP offloading driver.
This includes a new file that describes the overall pipeline becuase
that was not previously explained in full elsewhere.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D118815
2022-02-03 13:09:49 -05:00
Amir Ayupov 9f0ce07711 [Support][NFC] Don’t duplicate class or function name in comment
Refactor comments in CommandLine.h to follow the Coding Style rule

Reviewed By: MaskRay, serge-sans-paille

Differential Revision: https://reviews.llvm.org/D118859
2022-02-03 10:02:17 -08:00
Marek Kurdej ca0d97072e [clang-format] Avoid merging macro definitions.
Fixes https://github.com/llvm/llvm-project/issues/42087.

Reviewed By: HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D118879
2022-02-03 18:54:46 +01:00
Marek Kurdej 529aa4b011 [clang-format] Avoid adding space after the name of a function-like macro when the name is a keyword.
Fixes https://github.com/llvm/llvm-project/issues/31086.

Before the code:
```
#define if(x)
```

was erroneously formatted to:
```
#define if (x)
```

Reviewed By: HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D118844
2022-02-03 18:45:51 +01:00
Craig Topper 237eb37260 [RISCV] Add FMV_X_W and FMV_X_H to RISCVSExtWRemoval.
Add -target-abi to sextw-removal.ll RUN lines to show benefit on
new test case.
2022-02-03 09:40:47 -08:00
Stanislav Mekhanoshin d3b87e4a1c [AMDGPU] HWRegs TMA and TBA also supported on gfx9
Differential Revision: https://reviews.llvm.org/D118860
2022-02-03 09:36:10 -08:00
Sanjay Patel a662456b33 [x86] add minimal test for sbb idiom and CPU capabilities; NFC
D116804 proposes to alter codegen on this example based on
CPU tuning, so check a variety of models to confirm it works
as expected. We already have this test mixed in with several
others in another test file, but it seems wasteful to add so
many RUN lines to check this difference over and over again.
2022-02-03 12:32:36 -05:00
Sanjay Patel 3dbe33e4ec [x86] remove CPU requirement for RUN line in test file; NFC
A proposed change ( D118843 ) that would affect this test
will not require a specific CPU model to show a difference.
2022-02-03 12:32:36 -05:00
Florian Mayer 54d2e6a121 [hwasan] add musttail IR test.
we currently only have a test at the clang level

Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D118856
2022-02-03 09:30:34 -08:00
Mircea Trofin 79b98f0a07 Revert "[nfc][mlgo] De-const a parameter"
This reverts commit bc3b372161.

The planned change that would have needed non-const MachineFunction refs
isn't needed after all.
2022-02-03 09:20:36 -08:00
Philip Reames 6d0c007bc1 [SLP] Fix a typo in comment 2022-02-03 09:11:47 -08:00
Pavel Labath 359a2deb6f [lldb] Fix windows&mac builds for c34698a811 2022-02-03 18:06:55 +01:00
Thomas Symalla 476babcc1d [AMDGPU] Introduce new ISel combine for trunc-slr patterns
In some cases, when selecting a (trunc (slr)) pattern, the slr gets translated
to a v_lshrrev_b3e2_e64 instruction whereas the truncation gets selected to
a sequence of v_and_b32_e64 and v_cmp_eq_u32_e64. In the final ISA, this appears
as selecting the nth-bit:

v_lshrrev_b32_e32 v0, 2, v1
v_and_b32_e32 v0, 1, v0
v_cmp_eq_u32_e32 vcc_lo, 1, v0

However, when the value used in the right shift is known at compilation time, the
whole sequence can be reduced to two VALUs when the constant operand in the v_and is adjusted to (1 << lshrrev_operand):

v_and_b32_e32 v0, (1 << 2), v1
v_cmp_ne_u32_e32 vcc_lo, 0, v0

In the example above, the following pseudo-code:

v0 = (v1 >> 2)
v0 = v0 & 1
vcc_lo = (v0 == 1)

would be translated to:

v0 = v1 & 0b100
vcc_lo = (v0 == 0b100)

which should yield an equivalent result.
This is a little bit hard to test as one needs to force the SelectionDAG to
contain the nodes before instruction selection, but the test sequence was
roughly derived from a production shader.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D118461
2022-02-03 18:06:44 +01:00
Chris Lattner 968280bc40 [mlir-translate] Teach these tools about --allow-unregistered-dialect
Some translations do work with unregistered dialects, this allows one
to write testcases against them.  It works the same way as it does for
mlir-opt.

Differential Revision: https://reviews.llvm.org/D118872
2022-02-03 09:00:38 -08:00