276731 Commits

Author SHA1 Message Date
Michael Maitland
c2c4db8d8f
[RISCV][VLOPT] Add support for 11.11 div instructions (#112201)
This adds support for these instructions and also tests getOperandInfo
for these instructions as well.
2024-10-14 14:44:33 -04:00
Michael Maitland
82e89c0271
[RISCV][VLOPT] Add support for 11.9 min/max instructions (#112198)
This adds support for these instructions and also tests getOperandInfo
for these instructions as well.
2024-10-14 14:43:56 -04:00
Yuta Saito
d4efc3e097
[Coverage][WebAssembly] Add initial support for WebAssembly/WASI (#111332)
Currently, WebAssembly/WASI target does not provide direct support for
code coverage.
This patch set fixes several issues to unlock the feature. The main
changes are:

1. Port `compiler-rt/lib/profile` to WebAssembly/WASI.
2. Adjust profile metadata sections for Wasm object file format.
- [CodeGen] Emit `__llvm_covmap` and `__llvm_covfun` as custom sections
instead of data segments.
    - [lld] Align the interval space of custom sections at link time.
- [llvm-cov] Copy misaligned custom section data if the start address is
not aligned.
    - [llvm-cov] Read `__llvm_prf_names` from data segments
3. [clang] Link with profile runtime libraries if requested

See each commit message for more details and rationale.
This is part of the effort to add code coverage support in Wasm target
of Swift toolchain.
2024-10-15 02:41:43 +09:00
Michael Maitland
2f077ece2f [RISCV][VLOPT] Enable VLOptimizer for vl-opt.ll test file 2024-10-14 10:36:06 -07:00
Michael Marjieh
b5600c6f85
[TargetLowering][SelectionDAG] Exploit nneg Flag in UINT_TO_FP (#108931)
1. Propagate the nneg flag in WidenVecRes
2. Use SINT_TO_FP in expandUINT_TO_FP when possible.
2024-10-14 20:55:48 +04:00
Shilei Tian
a74659445d
[AMDGPU] Skip terminators when forcing emit zero flag (#112116)
When forcing emit zero, we need to skip terminators of a MBB; otherwise
the terminator list of the MBB would be broken.
2024-10-14 11:46:18 -04:00
Michael Maitland
a31e834ba8 [RISCV][VLOPT] Update test cases to use riscv-enable-vl-optimizer and better formatting 2024-10-14 08:44:16 -07:00
David Spickett
eb83e4abd6 [llvm][llvm-lit] Fix typo in --resultdb-output help 2024-10-14 15:12:40 +00:00
Alexey Bataev
ab902ee54a [SLP][NFC]Replace more unreachable terminators by rets, NFC 2024-10-14 07:50:07 -07:00
Albert Huang
aa2c0f35a1
[ARM] [AArch32] Add support for Arm China STAR-MC1 CPU (#110085)
STAR-MC1 is an Armv8m CPU.

Technical specifications available at:

https://www.armchina.com/download/Documents/Application-Notes/Technical-Reference-Manual?infoId=160
2024-10-14 15:48:12 +01:00
Jay Foad
cbc4be2dd5 [AMDGPU] Use MachineInstr::mayLoadOrStore. NFC. 2024-10-14 15:37:56 +01:00
pkarveti
81fee740d0
[Hexagon] Mark instructions as part of the frame setup to fix test sugared-constants.ll (#111795)
Added .setMIFlag(MachineInstr::FrameSetup) to all BuildMI calls in
HexagonFrameLowering::insertAllocframe. This change ensures that the
test sugared-constants.ll passes upstream by correctly marking
instructions as part of the frame setup.
2024-10-14 09:27:55 -05:00
Rahul Joshi
84b99b4b1e
[NFC][CodingStandard] Extend if-else brace example with else-if (#112193)
Extend example to document that single statement `else if` needs a brace
as well if the associated `if` needs a brace.
2024-10-14 07:20:39 -07:00
Jonathan Thackray
ddb64e62bd
[AArch64] Add support for Armv9.6-A FEAT_MPAM system registers (#111822)
Add support for Armv9.6-A FEAT_MPAM system registers as documented here:

https://developer.arm.com/documentation/ddi0601/2024-09/AArch64-Registers
2024-10-14 15:13:09 +01:00
Alexey Bataev
91a0fecf19 [SLP][NFC]Replace unreachable instructions by rets, NFC. 2024-10-14 07:00:56 -07:00
Nico Weber
b53186f93c [gn build] Port 8f9cce0bef31 2024-10-14 09:58:26 -04:00
Kazu Hirata
9c64b5e759
[ARM] Simplify code with std::map::operator[] (NFC) (#112159) 2024-10-14 06:56:39 -07:00
Simon Pilgrim
d81c2f16a3 [X86] canCreateUndefOrPoisonForTargetNode - X86ISD::VPERMV3 shuffles don't create undef/poison
The operands might contain an undef/poison element, but the shuffle node itself will not create one by itself.

Improves test case from #109272
2024-10-14 14:54:03 +01:00
Simon Pilgrim
fd8a4b0073 [X86] combineAndnp - fold ANDN(SEXT(SETCC()),X) -> SELECT(NOT(SETCC()),X,0) on AVX512 targets
Reverse the generic foldVSelectToSignBitSplatMask fold on AVX512 targets where we can use the SETCC result directly in predicated moves/instructions.

Fixes #109272
2024-10-14 14:54:03 +01:00
Akshat Oke
cd6c2b80be
[NewPM][CodeGen] Port StackColoring to NPM (#111812) 2024-10-14 19:23:34 +05:30
c8ef
a3b0c31ebc
Revert "[DAG] Enhance SDPatternMatch to match integer minimum and maximum patterns in addition to the existing ISD nodes." (#112200)
Reverts llvm/llvm-project#111774

This appears to be causing some tests to fail.
2024-10-14 21:43:49 +08:00
c8ef
11f625cb87
[DAG] Enhance SDPatternMatch to match integer minimum and maximum patterns in addition to the existing ISD nodes. (#111774)
Closes #108218.

This patch adds icmp+select patterns for integer min/max matchers in
SDPatternMatch, similar to those in IR PatternMatch.
2024-10-14 21:19:34 +08:00
Alexey Bataev
f9bc00e4bb
[SLP]Initial support for interleaved loads
Adds initial support for interleaved loads, which allows
emission of segmented loads for RISCV RVV.

Vectorizes extra code for RISCV
CFP2006/447.dealII, CFP2006/453.povray,
CFP2017rate/510.parest_r, CFP2017rate/511.povray_r,
CFP2017rate/526.blender_r, CFP2017rate/538.imagick_r, CINT2006/403.gcc,
CINT2006/473.astar, CINT2017rate/502.gcc_r, CINT2017rate/525.x264_r

Reviewers: RKSimon, preames

Reviewed By: preames

Pull Request: https://github.com/llvm/llvm-project/pull/112042
2024-10-14 09:12:33 -04:00
Nico Weber
f3947aaa37 [gn] port aa44f59abf39 2024-10-14 09:10:27 -04:00
Ramkumar Ramachandra
bdf241cab3
ValueTracking: handle more ops in isNotCrossLaneOperation (#112183)
Reuse llvm::isTriviallyVectorizable in llvm::isNotCrossLaneOperation, in
order to get it to handle more intrinsics.

Alive2 proofs for changed tests: https://alive2.llvm.org/ce/z/XSV_GT
2024-10-14 14:08:12 +01:00
Sam Elliott
429387a71c
[RISCV] Support Expressions in .insn Directives (#111893)
When assembling raw instructions, often you want to or together several
fields for clarity, or because you're using an assembly macro with
separate arguments.

This brings the use of `.insn` closer into line with what can be done
with the binutils assembler.

The 64-bit instruction test here explicitly sets the top bit to make
sure this works, even though the assembler is really using `int64_t`
in most places internally.
2024-10-14 14:07:35 +01:00
Akshat Oke
8b20f1b924
[MIR] Fix tests for flags in register info (#112179)
[MIR] Serialize virtual register flags #110228 introduces register flags
which appear empty in .mir dumps. Future tests should use
`-simplify-mir`.
2024-10-14 18:28:54 +05:30
Yingwei Zheng
9edc454ee6
[InstCombine] Drop range attributes in foldIsPowerOf2OrZero (#112178)
Closes https://github.com/llvm/llvm-project/issues/112078.
2024-10-14 20:52:55 +08:00
Sunho Kim
39aae57574 [ORC] skip reoptimization tests on PPC.
Fix https://lab.llvm.org/buildbot/#/builders/64/builds/1202.
2024-10-14 21:35:40 +09:00
Florian Hahn
7f06d8afb0
[SCEV] Retain SCEVSequentialMinMaxExpr if an operand may trigger UB. (#110824)
Retain SCEVSequentialMinMaxExpr if an operand may trigger UB, e.g. if
there is an UDiv operand that may divide by 0 or poison

PR: https://github.com/llvm/llvm-project/pull/110824
2024-10-14 13:08:49 +01:00
Jack Styles
6a98c4a160
Revert "[llvm][ARM] Add Addend Checks for MOVT and MOVW instructions.… (#112184)
… (#111970)"

I was made aware of breakages in Windows/ARM, so reverting while I
investigate.

This reverts commit f3aebe623b49b7ae14d0f0996999114aac052e4b.
2024-10-14 12:31:50 +01:00
Michał Górny
387b37af1a
[LLVM] [Clang] Support for Gentoo *t64 triples (64-bit time_t ABIs) (#111302)
Gentoo is planning to introduce a `*t64` suffix for triples that will be
used by 32-bit platforms that use 64-bit `time_t`. Add support for
parsing and accepting these triples, and while at it make clang
automatically enable the necessary glibc feature macros when this suffix
is used.

An open question is whether we can backport this to LLVM 19.x. After
all, adding new triplets to Triple sounds like an ABI change — though I
suppose we can minimize the risk of breaking something if we move new
enum values to the very end.
2024-10-14 11:18:04 +00:00
Simon Pilgrim
f7788618dd [X86] vselect-packss.ll - regenerate test checks with vpternlog comments 2024-10-14 12:11:30 +01:00
Simon Pilgrim
ccb9835edb
[X86] LowerShift - lower vXi8 shifts of an uniform constant using PSHUFB (#112175)
If each 128-bit vXi8 lane is shifting the same constant value, we can pre-compute the 8 valid shift results and use PSHUFB to act as a LUT with the shift amount.

Fixes #110317
2024-10-14 12:10:41 +01:00
Thomas Preud'homme
5af8cec8b5 Revert "Fix CMake dependencies on mlir-linalg-ods-yaml-gen (#111973)"
This reverts commit d6827f68ad9110ae0c9992de7b2e2eec0f23be14 due to the
following CMake configure failure being observed by some:

add_custom_target called with invalid target name
2024-10-14 11:58:23 +01:00
Ramkumar Ramachandra
c5f82f7893
ValueTracking: introduce llvm::isNotCrossLaneOperation (#112011)
Factor out and unify common code from InstSimplify and InstCombine that
partially guard against cross-lane vector operations into
llvm::isNotCrossLaneOperation in ValueTracking.

Alive2 proofs for changed tests: https://alive2.llvm.org/ce/z/68H4ka
2024-10-14 11:37:30 +01:00
Jubilee
fdf2b0a252
[LangRef] Document that sret only works with void returns (#112167) 2024-10-14 11:50:52 +02:00
Serge Pavlov
52e5683ddd
[GlobalISel][ARM] Legalization of G_CONSTANT using constant pool (#98308)
ARM uses complex encoding of immediate values using small number of
bits. As a result, some values cannot be represented as immediate
operands, they need to be synthesized in a register. This change
implements legalization of such constants with loading values from
constant pool.

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2024-10-14 16:40:21 +07:00
Jeremy Morse
fe1e1e3ae6
Add myself as the PS4/PS5 code owner (#108002)
As discussed here:
https://discourse.llvm.org/t/new-ps4-ps5-code-owner/80901
2024-10-14 10:39:34 +01:00
Jack Styles
f3aebe623b
[llvm][ARM] Add Addend Checks for MOVT and MOVW instructions. (#111970)
Previously, any value could be used for the MOVT and MOVW instructions,
however the ARM ABI dictates that the addend should be a signed 16 bit
value. To ensure this is followed, the Assembler will now check that
when using these instructions, the addend is a 16bit signed value, and
throw an error if this is not the case.

Information relating to the ABI requirements can be found here:
https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst#addends-and-pc-bias-compensation
2024-10-14 10:38:58 +01:00
Akshat Oke
bec839d8ee
[AMDGPU] Serialize WWM_REG vreg flag (#110229) 2024-10-14 14:37:21 +05:30
David Green
828d72b263
[GlobalISel] Add an assert for the DemandedElts APInt size. (#112150)
Similar to the other implementations in DAG/ValueTracking, this adds an
assert that the size of the DemandedElts is what we expect it to be -
the size of a fixed length vector or APInt(1,1) otherwise. The
G_BUILDVECTOR is fixed as it was passing an original DemandedElts for
the scalar operands.
2024-10-14 09:59:26 +01:00
Akshat Oke
3dba5d8584
[MIR] Add missing noteNewVirtualRegister callbacks (#111634)
The delegates' callback isn't invoked on parsing new virtual registers.

There are two places in the serialization where new virtual registers can be discovered: in register infos and in instructions.
2024-10-14 14:29:09 +05:30
Akshat Oke
dbfca24b99
[MIR] Serialize virtual register flags (#110228)
[MIR] Serialize virtual register flags

This introduces target-specific vreg flag serialization. Flags are represented as `uint8_t` and the `TargetRegisterInfo` override provides methods `getVRegFlagValue` to deserialize and `getVRegFlagsOfReg` to serialize.
2024-10-14 14:19:53 +05:30
Thomas Preud'homme
d6827f68ad
Fix CMake dependencies on mlir-linalg-ods-yaml-gen (#111973)
Fix a number of dependencies issue to build mlir-linalg-ods-yaml-gen
host binary which make a cross-build using the Make generator fail.
Namely:

- do not use binary path for the custom target created when
  LLVM_USE_HOST_TOOLS is true;
- use target name instead of name of variable holding the target name
  for add_custom_target and set_target_properties in setup_host_tool();
- remove dependency on target defined in different directory in
  add_linalg_ods_yaml_gen() since add_custom_target DEPENDS can only be
  used on "files and outputs of custom commands created with
  add_custom_command() command calls in the same directory";
- remove unneeded dependency on ${MLIR_LINALG_ODS_YAML_GEN_EXE}, the
  target dependency will ensure the binary will be built.

Note that we keep using ${MLIR_LINALG_ODS_YAML_GEN_EXE} in the COMMAND
rather than use ${MLIR_LINALG_ODS_YAML_GEN_TARGET} because when
LLVM_NATIVE_TOOL_DIR is used the latter is an empty string.

Testing-wise, all three codepaths in get_host_tool_path() were tested
with both GNU Make and Ninja generators:
- cross-compiling with LLVM_NATIVE_TOOL_DIR checks the if path;
- cross-compiling without LLVM_NATIVE_TOOL_DIR checks the elseif path;
- native build without LLVM_NATIVE_TOOL_DIR checks the else path.
2024-10-14 09:44:44 +01:00
David Spickett
57cd6d8634
[llvm][docs] Document how to get admin permissions for a Buildbot worker (#108561)
I spent a long time trying different combinations of primary and
verified emails, until a colleague tried it who happened to have a
public profile email set when I did not.

Document how this works to save everyone else the legwork.
2024-10-14 09:09:20 +01:00
David Green
a07639f4bb
[AArch64] Increase inline memmove limit to 16 stored registers (#111848)
The memcpy inline limit has been 16 for a long time, this patch makes
the memmove inline limit the same, allowing small-constant sized
memmoves to be emitted inline. The 16 is the number of registers stored,
which equates to a limit of 256 bytes.
2024-10-14 08:57:32 +01:00
Pierre van Houtryve
4a0dc3ef36
[AMDGPU][SplitModule] Handle !callees metadata (#108802)
See #106528 to review the first commit.

Handle the `!callees` metadata to further reduce the amount of indirect
call cases that end up conservatively assuming that any indirectly
callable function is a potential target.
2024-10-14 08:55:12 +02:00
YunQiang Su
c01ddbe916
RISC-V: Select FCANONICALIZE (#112083)
We can use `FMIN.x OP,OP` to canonlize a float.
2024-10-14 14:12:36 +08:00
Shilei Tian
ed77df56f2 [NFC] clang-format llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp 2024-10-14 00:57:01 -04:00