418106 Commits

Author SHA1 Message Date
Jessica Clarke
883f755639 [NFC][RISCV] Pre-commit tests for hoisting of PseudoLLA/PseudoLA*
Only PseudoLLA is currently hoisted; this will be fixed in a subsequent
commit.
2022-03-16 18:45:19 +00:00
Bill Wendling
114a8903b8 [docs] Fix typo in tutorial
Use "operands" instead of "operators"

Closes #54397
2022-03-16 11:44:23 -07:00
Valentin Clement
24f3d55a5a
[flang] Keep ifdef macro for INT128
This was wrongly removed in 9aeb7f035bdde83501e5eddd9e6ad175b8ed697f
and makes buildbot fail.
2022-03-16 19:11:01 +01:00
Jakub Kuderski
7c285b78cf [bazel] Add build rule for llvm-remark-size-diff
This binary is used in LIT tests.

Test: `bazel run --config=generic_clang -c opt @llvm-project//llvm:llvm-remark-size-diff -- --help`

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D121742
2022-03-16 14:07:07 -04:00
Yonghong Song
212f714ff7 [lldb] add missed handling for new BTFTagAttributed type
Commit 3251ba2d0fcf ("[Attr] Fix a btf_type_tag AST generation")
added a new type BTFTagAttributedType to the clang AST type
system. There are a few places in lldb needed to handle this type
similar to Attributed type to avoid compilation warning/error
when 'switch' is used to enumerate all types.
2022-03-16 11:00:35 -07:00
Florian Mayer
3b4c59c156 [HWASan] add shortgranule tests to use-after-scope.
Reviewed By: hctim

Differential Revision: https://reviews.llvm.org/D121395
2022-03-16 10:43:04 -07:00
Sanjay Patel
83413bb617 [x86] reduce indentation; NFC
We may be able to refine the conditions for these transforms ( D120648 ).
2022-03-16 13:39:02 -04:00
Kirill Stoimenov
d6aa3aa2da [ASan] Added .section statement to each function so they can be removed by --gc-sections.
Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D121813
2022-03-16 17:35:15 +00:00
Florian Mayer
448c89415b [HWASan] Update use-after-scope test to use ARM64.
Reviewed By: hctim

Differential Revision: https://reviews.llvm.org/D121394
2022-03-16 10:30:50 -07:00
Andrzej Warzynski
11a12544b5 [flang][lowering] Add support for lowering of the i{a}char intrinsics
This patch adds support for lowering of the `i{a}char` intrinsics from
Fortran to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

Differential Revision: https://reviews.llvm.org/D121790

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: zacharyselk <zrselk@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-16 17:15:39 +00:00
Snehasish Kumar
49c048add4 [memprof] Add a test to verify callstack order.
We add to ensure that we are observing the correct callstack order in memprof
during symbolization. There was some confusion whether the order of
DIFrame objects were reversed but in reality the leaf function is at
index 0 so no code changes are required.

Differential Revision: https://reviews.llvm.org/D121759
2022-03-16 10:10:57 -07:00
Petr Hosek
67f53708b2 Revert "[CMake][Fuchsia] Use correct architecture for iossim"
This reverts commit 1b6ff3f4f89e06af17575627fba3e6d90d1abbc5 since
it broke Fuchsia's macOS builders.
2022-03-16 10:10:15 -07:00
Andrzej Warzynski
365fcecda7 [flang][lowering] Add support for lowering of the ibclr intrinsic
This patch adds support for lowering of the `ibclr` intrinsic from Fortran
to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>

Differential Revision: https://reviews.llvm.org/D121789
2022-03-16 17:05:01 +00:00
Florian Hahn
8a3d75a760
[ASan] Add read to large_func_test.cpp to prevent optimization.
After e5822ded562f, the call to LargeFunction can be optimized out, as x
is never accessed in main. This is causing the test to fail, because the
out-of-bounds access won't be executed.

Adding an extra read and returning the value should prevent the
optimizer from removing the call.
2022-03-16 17:00:32 +00:00
Siddharth Bhat
e83c6aa91e [MLIR] [LangRef] Clarify parsing of dense<...>
dense<...> expects ... to be a tensor-literal.
Define this in the grammar in BuiltinAttributes.td,
and reflect this in the reference grammar written in
AttributeParser.cpp.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D121048
2022-03-16 22:25:52 +05:30
Nathan Ridge
606ba8a68f [clangd] Handle more than two conflicting semantic tokens in resolveConflict()
Fixes https://github.com/clangd/clangd/issues/1057

Differential Revision: https://reviews.llvm.org/D121775
2022-03-16 12:53:04 -04:00
Andrzej Warzynski
3887ebbba0 [flang][lowering] Add support for lowering of the ieor intrinsic
This patch adds support for lowering of the `ieor` intrinsic from Fortran
to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>

Differential Revision: https://reviews.llvm.org/D121791
2022-03-16 16:50:43 +00:00
Fangrui Song
30718f3aa6 [llvm-objcopy] --weaken-symbol/--weaken: weaken STB_GNU_UNIQUE symbols
STB_GNU_UNIQUE is like STB_GLOBAL with extra semantics:

* gold and ld.lld: changed to STB_GLOBAL if --no-gnu-unique is specified
* glibc: unique even with dlopen `RTLD_LOCAL`, implies DF_1_NODELETE

Therefore, I think it makes sense for --weaken-symbol/--weaken-symbols/--weaken
to change STB_GNU_UNIQUE symbols.

binutils 2.39 will have the same behavior: https://sourceware.org/bugzilla/show_bug.cgi?id=28926

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D120638
2022-03-16 09:48:19 -07:00
Marco Elver
555df03012 [SelectionDAG][NFC] Clean up SDCallSiteDbgInfo accessors
* Consistent naming: addCallSiteInfo vs. getCallSiteInfo;
* Use ternary operator to reduce verbosity;
* const'ify getters;
* Add comments;

NFCI.

Differential Revision: https://reviews.llvm.org/D121820
2022-03-16 17:46:06 +01:00
Daniel Thornburgh
9990395859 [Symbolize] Fix overflow warning on 32-bit hosts.
The inserted cast is a no-op.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D121752
2022-03-16 16:44:36 +00:00
Mark de Wever
e72cedcb01 [libc++][NFC] Add TEST_HAS_NO_INCOMPLETE_RANGES.
This avoids using an libc++ internal macro in our tests.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D121515
2022-03-16 17:42:48 +01:00
David Truby
d38c9d3834 [NFC][clang][SVE] Auto-generate SVE operator tests. 2022-03-16 16:39:27 +00:00
Amir Ayupov
dc1cf838a5 [BOLT] Strip redundant AdSize override prefix
Since LLVM MC now preserves redundant AdSize override prefix (0x67), remove it
in BOLT explicitly (-x86-strip-redundant-adsize, on by default).

Test Plan:
`bin/llvm-lit -a bolt/test/X86/addr32.s`

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D120975
2022-03-16 09:38:17 -07:00
Louis Dionne
78669c4185 [libc++][tests] Use CMake provided paths for includes and libdir instead of hardcoding them
In the new-style testing configurations, we were hardcoding paths to the
`include` and `lib` directories, which was incorrect but always went
unnoticed because the hardcoded values always happened to match the
actual value.

When using new-style configs with the bootstrapping build, this falls
appart -- and we never noticed this because the bootstrapping build was
still using old style configs.

This patch removes the %{install} substitution, which makes it too
tempting to hardcode installation paths, and it also switches the
bootstrapping build to actually using new-style configs like we
always intended to do.

Differential Revision: https://reviews.llvm.org/D121700
2022-03-16 12:35:06 -04:00
Malhar Jajoo
a36d269658 [VPlan] Avoid collecting scalars for SVE
This patch ensures scalars (except for uniforms) are no
longer collected (prior to LVP planning phase) for
scalable vectorization.

This is to avoid the chances of generating scalarized
instructions later (during LVP execute phase) as they
are not supported for scalable vectorization.

Relevant test has also been added.

Differential Revision: https://reviews.llvm.org/D121452
2022-03-16 16:33:34 +00:00
Jonas Devlieghere
3f0e050842
[lldb] Fix Minidump/no-process-id.yaml
Update warning after 2fc38b2b7bf9896806749655124ea5f13cc6d383.
2022-03-16 09:32:06 -07:00
Andrzej Warzynski
6f0041ea44 [flang][lowering] Add lowering for the size intrinsic
This patch adds support for lowering of the `size` intrinsic from Fortran
to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

Differential Revision: https://reviews.llvm.org/D121803

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
2022-03-16 16:30:12 +00:00
Nikita Popov
0958450251 Revert "[FuzzMutate] Don't insert instructions after musttail call"
This reverts commit 6a23d2764467bd45c2e02828f6175a0b9f9a1005.

The newly added tests fail on the llvm-clang-x86_64-sie-win
buildbot. Not sure why a failure only occurs there, possibly
differen PRNG sequence?
2022-03-16 17:29:27 +01:00
Valentin Clement
4840e7505d
[flang] Lower shift intrinsics
This patch adds lowering for shift intrinsics:
- `ishft`
- `eoshift`
- `ishftc`
- `cshift`

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D121808

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
Co-authored-by: AlexisPerry <aperry@lanl.gov>
2022-03-16 17:16:46 +01:00
Valentin Clement
9aeb7f035b
[flang] Lower IO input with vector subscripts
This patch adds lowering for IO input with vector subscripts.
It defines a VectorSubscriptBox class that allow representing and working
with a lowered Designator containing vector subscripts while ensuring
all the subscripts expression are only lowered once.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D121806

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-16 17:13:23 +01:00
Nikita Popov
6a23d27644 [FuzzMutate] Don't insert instructions after musttail call 2022-03-16 16:58:33 +01:00
Yonghong Song
3251ba2d0f [Attr] Fix a btf_type_tag AST generation
Current ASTContext.getAttributedType() takes attribute kind,
ModifiedType and EquivType as the hash to decide whether an AST node
has been generated or note. But this is not enough for btf_type_tag
as the attribute might have the same ModifiedType and EquivType, but
still have different string associated with attribute.

For example, for a data structure like below,
  struct map_value {
        int __attribute__((btf_type_tag("tag1"))) __attribute__((btf_type_tag("tag3"))) *a;
        int __attribute__((btf_type_tag("tag2"))) __attribute__((btf_type_tag("tag4"))) *b;
  };
The current ASTContext.getAttributedType() will produce
an AST similar to below:
  struct map_value {
        int __attribute__((btf_type_tag("tag1"))) __attribute__((btf_type_tag("tag3"))) *a;
        int __attribute__((btf_type_tag("tag1"))) __attribute__((btf_type_tag("tag3"))) *b;
  };
and this is incorrect.

It is very difficult to use the current AttributedType as it is hard to
get the tag information. To fix the problem, this patch introduced
BTFTagAttributedType which is similar to AttributedType
in many ways but with an additional BTFTypeTagAttr. The tag itself can
be retrieved with BTFTypeTagAttr.
With the new BTFTagAttributed type, the debuginfo code can be greatly
simplified compared to previous TypeLoc based approach.

Differential Revision: https://reviews.llvm.org/D120296
2022-03-16 08:46:52 -07:00
Jake Egan
c7dc9dbaff [VE] Remove output to /dev/stdout
Sending output to /dev/stdout on AIX gets an llc permission denied error, so this patch removes this from the tests.

Reviewed By: simoll, hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D121799
2022-03-16 11:42:09 -04:00
Jonas Devlieghere
2fc38b2b7b
[lldb] Report debugger diagnostics as events
Report warnings and errors through events instead of printing directly
the to the debugger's error stream. By using events, IDEs such as Xcode
can report these issues in the UI instead of having them show up in the
debugger console.

The new diagnostic events are handled by the default event loop. If a
diagnostic is reported while nobody is listening for the new event
types, it is printed directly to the debugger's error stream.

Differential revision: https://reviews.llvm.org/D121511
2022-03-16 08:33:01 -07:00
Amir Ayupov
2c4e38fa6f [X86] Emit REX prefix immediately before the opcode
Fix prefix emission order to emit REX immediately before the opcode (SDM vol2,
2.1, Figure 2-1). According to SDM vol2 2.2.1, "Other placements are ignored".

This fix has a side effect of outputting segment override prefix in a different
order than previously (benign).

Follow-up to https://reviews.llvm.org/D120592

Reviewed By: skan, craig.topper

Differential Revision: https://reviews.llvm.org/D120871
2022-03-16 08:30:31 -07:00
Amir Ayupov
1d3719820f [X86] Preserve redundant Address-Size override prefix
Print and emit redundant Address-Size override prefix if it's set on the
instruction.

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D120592
2022-03-16 08:30:29 -07:00
Haojian Wu
e5b1b9edb8 [pseudo] Cleanup the leftover header guards after the movement, NFC. 2022-03-16 16:25:18 +01:00
LLVM GN Syncbot
a8ef5d2f6d [gn build] Port c2f62ab84b5f 2022-03-16 15:19:44 +00:00
Amir Ayupov
698127df51 [BOLT][NFC] Move isMOVSX64rm32 out of MCPlusBuilder
Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D121669
2022-03-16 08:18:56 -07:00
Kazushi (Jam) Marukawa
c2f62ab84b [Clang][VE] Add the rest of intrinsics to clang
Add the rest of intrinsics to clang except intrinsics using vector mask
registers.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D121586
2022-03-17 00:17:21 +09:00
Andrzej Warzynski
3833b4b4d7 [flang][lowering] Add lowering for the set_exponent intrinsic
This patch adds support for lowering of the `set_exponent` intrinsic
from Fortran to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

Differential Revision: https://reviews.llvm.org/D121805

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eun Jung Park <ejpark@lanl.gov>
2022-03-16 15:16:10 +00:00
Joe Nash
fb81f06f63 [AMDGPU] Calculate RegWidth in bits in AsmParser
NFC. Switch from calculations based on dwords to bits, to be more
flexible.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D121730
2022-03-16 10:52:14 -04:00
Jean Perier
7d52beb275 [flang] Relax fir.rebox verifier with characters
Allow fir.rebox input and output element type to differ for characters
if:
- Any of the character type is dynamic. Fortran allows making pointer
assignments between deferred and constant lengths entities, making this
case useful (if the input length is dynamic and the output length constant,
it is a user requirement that the length matches at runtime. There is no
option to check this at runtime, but it could be added as an option to
fir.rebox codegen later if desired).

- Or, there is a slice in the fir.rebox (the fir.rebox can implement a
substring view, hence the constant output and input lengths).

This is only a verifier constraint change, the fir.rebox codegen is not
impacted and already support those cases.

Add related FIR parsing, error, and codegen tests.

Differential Revision: https://reviews.llvm.org/D121710
2022-03-16 16:08:52 +01:00
Pavel Labath
ccba163d85 [lldb] Change back LLDBLog::Commands->Types in a couple more places
This was inadvertedly changed (bad search&replace) when I was removing
the LLDBLOG macros.
2022-03-16 15:46:17 +01:00
Nikita Popov
d7cf7ec05d [SROA] Handle over-large loads during presplitting
When a load extends past the extent of the alloca, SROA will
restrict the slice size to extend to the end of the alloca only.
However, presplitting was asserting that the load size and the
slice size match exactly, which does not hold in this case.
Relax the assertion to only require that the load size is greater
or equal than the slice size.
2022-03-16 15:41:11 +01:00
Will Hawkins
d58ef6df0d [LLDB] Change enumaration to enumeration
Change enumaration to enumeration in code handling LLDB help output.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D121800
2022-03-16 15:31:25 +01:00
Will Hawkins
fe93395b92 [LLDB] Fix typos in LLDB help output.
Correct a few spelling errors and typos in the LLDB help output.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D121802
2022-03-16 15:31:25 +01:00
Matthias Springer
b59fd8c20a [mlir][bufferize] Update documentation with allow-return-allocs
Differential Revision: https://reviews.llvm.org/D121807
2022-03-16 23:30:09 +09:00
Matthias Springer
1e1eeae840 [mlir][bufferize] Allow non-equivalent yields from scf.for loops
This removes a restriction wrt. scf.for loops during One-Shot Bufferization. Such IR was previously rejected. It is still rejected by default because the bufferized IR could be slow. But such IR can now be bufferized with `allow-return-allocs`.

Differential Revision: https://reviews.llvm.org/D121529
2022-03-16 23:22:06 +09:00
Shengchen Kan
ac64d0d230 [NFC][CodeGen] Remove redundant if clause in TargetPassConfig::addPass 2022-03-16 22:14:23 +08:00