45995 Commits

Author SHA1 Message Date
Chen Zheng
4dfa12addd [PowerPC] [NFC] add test for O0 pipeline
This is to address comments https://reviews.llvm.org/D138265#3950197

This should be helpful for detecting optimization passes added to O0
pipeline by mistake.

Reviewed By: lkail

Differential Revision: https://reviews.llvm.org/D138973
2022-12-01 22:16:54 -05:00
chenglin.bi
e63f64bd14 [AArch64] Precommit test for D138904; NFC
shift + and -> shift + shift to select more shfited registers.
2022-12-02 10:59:03 +08:00
Matt Arsenault
d85e849ff4 AMDGPU: Convert some assorted tests to opaque pointers 2022-12-01 21:40:30 -05:00
Matt Arsenault
0fb74d0ff8 AMDGPU: Fix broken attribute usage in test 2022-12-01 21:32:20 -05:00
Matt Arsenault
75a3f22a90 AMDGPU: Convert some stack tests to opaque pointers 2022-12-01 21:32:20 -05:00
Matt Arsenault
4998de4dcc AMDGPU: Update some wait tests to opaque pointers
The script mangled the constantexprs in waitcnt-looptest.ll, so fixed
those manually.
2022-12-01 21:01:58 -05:00
Fangrui Song
858266d308 [LoongArch] Fix tests after comment change 2022-12-01 22:08:21 +00:00
Paul Robinson
3b259de708 [AVR] Convert test to check 'target=avr.*'
Part of the project to eliminate special handling for triples in lit
expressions.
2022-12-01 13:41:10 -08:00
Paul Robinson
6e8b91f3b5 [AVR] Test XPASSes, remove the XFAIL
I built llvm with default triple avr-- and this test XPASSed
so it seems safe enough.
2022-12-01 13:40:22 -08:00
Bjorn Pettersson
a11faeed44 [test] Switch to use -passes syntax in various test cases 2022-12-01 21:25:59 +01:00
Paul Robinson
23ffadcf31 [XCore] Convert tests to check 'target=xcore.*'
Part of the project to eliminate special handling for triples in lit
expressions.
2022-12-01 12:19:37 -08:00
Krzysztof Parzyszek
2191137dff [Hexagon] Check if vector is empty before calling back() 2022-12-01 11:41:47 -08:00
Paul Robinson
f4e2d56a07 [Sparc] Convert tests to check 'target=sparc.*'
Part of the project to eliminate special handling for triples in lit
expressions.
2022-12-01 11:41:30 -08:00
Paul Robinson
d4fbb93620 [Sparc] Remove an XFAIL
I built llvm with default triple sparc-sun-solaris2 and this test
XPASSed so it seems safe enough.
2022-12-01 11:37:22 -08:00
Craig Topper
e00e20a055 [RISCV] Add ADDW/AND/OR/XOR/SUB/SUBW to getRegAllocHints.
These instructions requires both register operands to be compressible
so I've only applied the hint if we already have a GPRC physical register
assigned for the other register operand.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D139079
2022-12-01 11:09:38 -08:00
Paul Robinson
7db8ff32bd [AMDGPU] Convert test to check 'target=r600.*'
Part of the project to eliminate special handling for triples in lit
expressions.
2022-12-01 10:49:38 -08:00
ZHU Zijia
010a8f7a90 [CodeGen] Fix restore blocks' BasicBlock information in branch relaxation
In branch relaxation pass, restore blocks are created and placed before
the jump destination if indirect branches are required. For example:

        foo
        sd      s11, 0(sp)
        jump    .restore, s11
        bar
        bar
        bar
        j       .dest
.restore:
        ld      s11, 0(sp)
.dest:
        baz

The BasicBlock information of the restore MachineBasicBlock should be
identical to the dest MachineBasicBlock.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D131863
2022-12-02 02:42:22 +08:00
ZHU Zijia
3adf828a0e [CodeGen][test] Pre-commit test for D131863
Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D131862
2022-12-02 02:39:14 +08:00
Krzysztof Parzyszek
9b83935672 [Hexagon] Punt on GEPs with different base types in vector alignment 2022-12-01 10:33:48 -08:00
Jonas Paulsson
8ef4632681 Revert "[CodeGen] Add new pass for late cleanup of redundant definitions."
Temporarily revert and fix buildbot failure.

This reverts commit 6d12599fd4134c1da63198c74a25490d28c733f6.
2022-12-01 13:29:24 -05:00
Jonas Paulsson
6d12599fd4 [CodeGen] Add new pass for late cleanup of redundant definitions.
A new pass MachineLateInstrsCleanup is added to be run after PEI.

This is a simple pass that removes redundant and identical instructions
whenever found by scanning the MF once while keeping track of register
definitions in a map. These instructions are typically immediate loads
resulting from rematerialization, and address loads emitted by target in
eliminateFrameInde().

This is enabled by default, but a target could easily disable it by means of
'disablePass(&MachineLateInstrsCleanupID);'.

This late cleanup is naturally not "optimal" in removing instructions as it
is done by looking at phys-regs, but still quite effective. It would be
desirable to improve other parts of CodeGen and avoid these redundant
instructions in the first place, but there are no ideas for this yet.

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

Reviewed By: RKSimon, foad, craig.topper, arsenm, asb
2022-12-01 13:21:35 -05:00
Roman Lebedev
7850ab2112
[NFC] Port an assortment of tests that invoke SROA to new pass manager 2022-12-01 21:17:18 +03:00
Paul Robinson
f4eb87f403 [NVPTX] Convert tests to check 'target=nvptx.*'
Part of the project to eliminate special handling for triples in lit
expressions.
2022-12-01 09:01:48 -08:00
Phoebe Wang
54ebf1c4a1 [X86][FP16] Do not combine fminnum/fmaxnum for FP16 emulation
Under the emulation situation, we lack native fmin/fmax instruction support.

Fixes #59258

Reviewed By: skan, spatel

Differential Revision: https://reviews.llvm.org/D139078
2022-12-01 23:24:40 +08:00
Sander de Smalen
d32c9e8384 Reland "[AArch64][SME]: Generate streaming-compatible code for ld2-alloca."
Phabricator review for this patch was D138791
2022-12-01 14:48:30 +00:00
Sander de Smalen
ea11f4ff0a Reland "[AArch64][SME]: Add precursory tests for D138791"
This reverts commit 06846596eb1768eea06778a5b6da31145e84e461.
2022-12-01 14:48:30 +00:00
David Sherwood
06846596eb Revert "[AArch64][SME]: Add precursory tests for D138791"
This reverts commit 45adca0f52af346a131163d1cc3e4a08baf7f0f1.
2022-12-01 11:14:01 +00:00
David Sherwood
4a5ccf4e93 Revert "[AArch64][SME]: Generate streaming-compatible code for ld2-alloca."
This reverts commit 279c0a83aa22cd35d4b7c7c52b85d2a86f2528a7.
2022-12-01 10:22:21 +00:00
Freddy Ye
89f36dd8f3 [X86] Add ExpandLargeFpConvert Pass and enable for X86
As stated in
https://discourse.llvm.org/t/rfc-llc-add-expandlargeintfpconvert-pass-for-fp-int-conversion-of-large-bitint/65528,
this implementation is very similar to ExpandLargeDivRem, which expands
‘fptoui .. to’, ‘fptosi .. to’, ‘uitofp .. to’, ‘sitofp .. to’ instructions
with a bitwidth above a threshold into auto-generated functions. This is
useful for targets like x86_64 that cannot lower fp convertions with more
than 128 bits. The expanded nodes are referring from the IR generated by
`compiler-rt/lib/builtins/floattidf.c`, `compiler-rt/lib/builtins/fixdfti.c`,
and etc.

Corner cases:
1. For fp16: as there is no related builtins added in compliler-rt. So I
mainly utilized the fp32 <-> fp16 lib calls to implement.
2. For fp80: as this pass is soft fp emulation and no fp80 instructions can
help in this problem. I recommend users to deprecate this usage. For now, the
implementation uses fp128 as the temporary conversion type and inserts
fptrunc/ext at top/end of the function.
3. For bf16: as clang FE currently doesn't support bf16 algorithm operations
(convert to int, float, +, -, *, ...), this patch doesn't consider bf16 for
now.
4. For unsigned FPToI: since both default hardware behaviors and libgcc are
ignoring "returns 0 for negative input" spec. This pass follows this old way
to ignore unsigned FPToI. See this example:
https://gcc.godbolt.org/z/bnv3jqW1M

The end-to-end tests are uploaded at https://reviews.llvm.org/D138261

Reviewed By: LuoYuanke, mgehre-amd

Differential Revision: https://reviews.llvm.org/D137241
2022-12-01 13:47:43 +08:00
Xiang1 Zhang
416e8c6ad5 Enhance stack protector for calling no return function
Reviewed By: LuoYuanke, WangPengfei, lebedev.ri

Differential Revision: https://reviews.llvm.org/D138774
2022-12-01 13:20:36 +08:00
Craig Topper
df7ab6a52e [RISCV] Add ANDI to getRegAllocationHints. 2022-11-30 20:59:02 -08:00
Hassnaa Hamdi
2bda5a6287 [AArch64][SME][NFC]: Enable lowering truncate for enhancement.
Enable lowering truncate to enhance the generated code.
2022-12-01 03:54:28 +00:00
Hassnaa Hamdi
279c0a83aa [AArch64][SME]: Generate streaming-compatible code for ld2-alloca.
To generate code compatible to streaming mode:
 - disable lowering interleaved load to avoid generating invalid NEON intrinsics.

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D138791
2022-12-01 02:31:01 +00:00
Hassnaa Hamdi
45adca0f52 [AArch64][SME]: Add precursory tests for D138791
Testing files:
 - ld2-alloca.ll
2022-12-01 02:31:01 +00:00
Xiang1 Zhang
94c5df8a76 [AMX] Support AMX-FP16 new intrinsic interface
We support AMX-FP16 isa in https://reviews.llvm.org/D135941 now.
The old  intrinsic interface need to manually write tile registers.
So we support its new intrinsic interface to let it be able to do register allocation.

Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D138987
2022-12-01 09:47:53 +08:00
gonglingqin
624401612c [LoongArch] Add remaining intrinsics for CRC check instructions
After D137316 implements the intrinsics of the first crc check instruction
and related diagnosis, this patch implements the intrinsics of all remaining
crc check instructions.

Differential Revision: https://reviews.llvm.org/D138418
2022-12-01 09:40:50 +08:00
Hassnaa Hamdi
1dee88fac1 [AArch64][SME]: Add streaming-compatible testing files.
Testing files:
 - int-compares.ll
 - int-immediates.ll
 - log-reduce.ll

Reviewed By: david-arm, sdesmalen

Differential Revision: https://reviews.llvm.org/D138717
2022-12-01 01:37:36 +00:00
Hassnaa Hamdi
43eef96833 [AArch64][SME]: Add streaming-compatible testing files.
Testing files:
 - limit-duplane.ll
 - optimize-ptrue.ll
 - ptest.ll

Reviewed By: david-arm, sdesmalen

Differential Revision: https://reviews.llvm.org/D138768
2022-12-01 01:15:44 +00:00
Hassnaa Hamdi
de7222b2dd [AArch64][SME]: Add streaming-compatible testing files.
Testing files:
 - subvector.ll
 - permute-rev.ll
 - permute-zip-uzp-trn.ll
 - vector-shuffle.ll

Reviewed By: david-arm, sdesmalen

Differential Revision: https://reviews.llvm.org/D138683
2022-12-01 00:52:08 +00:00
Marco Elver
b95646fe70 Revert "Use-after-return sanitizer binary metadata"
This reverts commit d3c851d3fc8b69dda70bf5f999c5b39dc314dd73.

Some bots broke:

- https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8796062278266465473/overview
- https://lab.llvm.org/buildbot/#/builders/124/builds/5759/steps/7/logs/stdio
2022-11-30 23:35:50 +01:00
Paul Robinson
2fbcf8b9b3 [Hexagon] Convert tests to check 'target=hexagon-.*'
Part of the project to eliminate special handling for triples in lit
expressions.
2022-11-30 13:36:10 -08:00
Craig Topper
a8c79121bf [RISCV] Teach getRegAllocationHints about compressible SRAI/SRLI.
Similar to previous patches for ADDI/ADDIW/SLLI/ADD, but restricted
to only cases where the register is x8-x15(GPRC reg class).

I've restricted it so that we can be precise about whether the
resulting instruction would be compressible. Changing the register
allocation may make some other instruction not compressible so we
should try to be accurate.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D138740
2022-11-30 10:28:57 -08:00
Jay Foad
3d9e226081 [AMDGPU] Use s_cmp instead of s_cmpk
Don't bother pre-shrinking "s_cmp_lg_u32 reg, 0" to s_cmpk_lg_u32
because 0 is already an inline constant so the s_cmpk form is no
smaller.

This is just for consistency with the surrounding code and to simplify a
downstream patch.

Differential Revision: https://reviews.llvm.org/D138993
2022-11-30 18:02:39 +00:00
Philip Reames
ac1ec9e290 [RISCV] Share code for fixed offsets adjustRegs (thus materializing fewer constants)
This reuses the existing optimized implementation of adjustReg, and commons up code. This has the effect of enabling two code changes for the new caller. First, we enable the "split andi" lowering (with no alignment requirement), and second we use a sub with smaller constant in register instead of a add with negative constant in register.

Differential Revision: https://reviews.llvm.org/D132839
2022-11-30 09:28:29 -08:00
Dmitry Vyukov
d3c851d3fc Use-after-return sanitizer binary metadata
Currently per-function metadata consists of:
(start-pc, size, features)

This adds a new UAR feature and if it's set an additional element:
(start-pc, size, features, stack-args-size)

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D136078
2022-11-30 14:50:22 +01:00
Sylvain Audi
3f3438a596 [CodeGen][X86] Crash fixes for "patchable-function" pass
This patch fixes crashes related with how PatchableFunction selects the instruction to make patchable:
- Ensure PatchableFunction skips all instructions that don't generate actual machine instructions.
- Handle the case where the first MachineBasicBlock is empty
- Removed support for 16 bit x86 architectures.

Note: another issue remains related with PatchableFunction, in the lowering part.
See https://github.com/llvm/llvm-project/issues/59039

Differential Revision: https://reviews.llvm.org/D137642
2022-11-30 07:29:54 -05:00
Pierre van Houtryve
a88deb4b65 [AMDGPU] Use aperture registers instead of S_GETREG
Fixes a longstanding TODO in the codebase where we were using S_GETREG + shift to do something that could simply be done with an inline constant (register).

Patch based on D31874 by @kzhuravl
Depends on D137767

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D137542
2022-11-30 12:25:10 +00:00
Tim Northover
b32280baf9 X86: relax EFLAGS liveness check when generating stack probes.
The probes are all inserted at the iterator passed into the functions, so
that's where any EFLAGS clobbering will happen and where we need it to be dead.

Fixes: https://github.com/llvm/llvm-project/issues/59121
2022-11-30 11:44:39 +00:00
Nicolai Hähnle
4e79764f0a AMDGPU: Fixup tests 2022-11-30 12:37:40 +01:00
Nicolai Hähnle
b7f44f7cf9 AMDGPU: Remove ImagePSV and move images to addrspace 7
Following up on the removal of BufferPSV in commit 43b86bf992 ("AMDGPU:
Remove BufferPseudoSourceValue")

It is unclear what exactly the right address space for images should be.
They seem morally closest to buffers, so that's what I went with. In
practical terms, address space 7 is better than address space 0 because
it can't alias with LDS.

Differential Revision: https://reviews.llvm.org/D138949
2022-11-30 11:32:34 +01:00