summaryrefslogtreecommitdiff
path: root/llvm/lib/TargetParser/TargetParser.cpp
AgeCommit message (Collapse)Author
2025-11-19[AMDGPU] Adding instruction specific features (#167809)Shoreshen
2025-11-06[ASan] Skip explicit check of 'xnack' feature for gfx1250 && gfx1251. (#166754)Amit Kumar Pandey
Xnack processing is essential and performed at the frontend to enable ASan instrumentation for AMDGPU device code. Certain AMDGPU subtargets like gfx1250 && gfx1251 don't have to enable 'xnack+' explictly in '--offload-arch=' for device ASan instrumentation.
2025-10-22[AMDGPU] Add intrinsics for v_[pk]_add_{min|max}_* instructions (#164731)Stanislav Mekhanoshin
2025-10-06[NFC] Change spelling of cluster feature to "clusters" (#162103)Shilei Tian
2025-10-06[AMDGPU] Make cluster a target feature (#162040)Shilei Tian
This replaces the original arch check.
2025-09-17[AMDGPU] Add gfx1251 subtarget (#159430)Stanislav Mekhanoshin
2025-09-16[AMDGPU] Add missing bf16-pk-insts feature to gfx1250 (#159167)Stanislav Mekhanoshin
2025-08-27[AMDGPU] More radical feature initialization refactoring (#155222)Stanislav Mekhanoshin
Factoring in flang, just have a single fillAMDGPUFeatureMap function doing it all as an external interface and returing an error.
2025-08-27[AMDGPU] Refactor insertWaveSizeFeature (#154850)Stanislav Mekhanoshin
If a wavefrontsize32 or wavefrontsize64 is the only possible value insert it into feature list by default and use that value as an indication that another wavefront size is not legal.
2025-08-05[Clang][AMDGPU] Add builtins for some buffer resource atomics (#149216)zGoldthorpe
This patch exposes builtins for atomic `add`, `max`, and `min` operations that operate over buffer resource pointers.
2025-08-05[AMDGCNSPIRV][NFC] Add missing target features to AMDGCNSPIRV (#152057)Alex Voicu
`gfx1250` bring-up omitted updating the `amdgcnspirv` feature list, this fixes that oversight.
2025-08-01[AMDGPU] gfx1250 v_perm_pk16_* instructions (#151773)Stanislav Mekhanoshin
2025-07-30[AMDGPU] Add gfx1250 v_cvt_sr_pk_bf16_f32 instruction (#151385)Stanislav Mekhanoshin
2025-07-24[AMDGPU] gfx1250 vmem prefetch target intrinsics and builtins (#150466)Stanislav Mekhanoshin
2025-07-17[AMDGPU] Add support for `v_tanh_f32` on gfx1250 (#149360)Shilei Tian
Co-authored-by: Mekhanoshin, Stanislav <Stanislav.Mekhanoshin@amd.com>
2025-07-14[AMDGPU] Add support for `v_tanh_bf16` on gfx1250 (#147425)Shilei Tian
Co-authored-by: Mekhanoshin, Stanislav <Stanislav.Mekhanoshin@amd.com>
2025-07-08[AMDGPU] Add support for `v_cvt_f32_fp8` on gfx1250 (#147579)Shilei Tian
Co-authored-by: Mekhanoshin, Stanislav <Stanislav.Mekhanoshin@amd.com>
2025-06-26AMDGPU: Add MC layer support for load transpose instructions for gfx1250 ↵Changpeng Fang
(#146024) Co-authored with @jayfoad
2025-06-19[AMDGPU] Initial support for gfx1250 target. (#144965)Stanislav Mekhanoshin
This is just a stub for now.
2025-06-19Fix bazel build after #144594, mark variable as potentially unused (#144910)Karlo Basioli
2025-06-19[Reland] [PowerPC] frontend get target feature from backend with cpu name ↵zhijian lin
(#144594) 1. The PR proceeds with a backend target hook to allow front-ends to determine what target features are available in a compilation based on the CPU name. 2. Fix a backend target feature bug that supports HTM for Power8/9/10/11. However, HTM is only supported on Power8/9 according to the ISA. 3. All target features that are hardcoded in PPC.cpp can be retrieved from the backend target feature. I have double-checked that the hardcoded logic for inferring target features from the CPU in the frontend(PPC.cpp) is the same as in PPC.td. The reland patch addressed the comment https://github.com/llvm/llvm-project/pull/137670#discussion_r2143541120
2025-06-12Revert " [PowerPC] frontend get target feature from backend with cpu name ↵Reid Kleckner
(#137670)" This reverts commit 9208b343e962b9f1140ee345c0050a3920bdcbf2. TargetParser shouldn't re-run the PPC subtarget tablegen target, it should define its own `-gen-ppc-target-def` rule like all the other targets do in llvm/include/llvm/TargetParser/CMakeLists.txt . One user reported that there are incorrect CMake dependencies after this change, so I will roll this back in the meantime.
2025-06-12 [PowerPC] frontend get target feature from backend with cpu name (#137670)zhijian lin
1. The PR proceeds with a backend target hook to allow front-ends to determine what target features are available in a compilation based on the CPU name. 2. Fix a backend target feature bug that supports HTM for Power8/9/10/11. However, HTM is only supported on Power8/9 according to the ISA. 3. All target features that are hardcoded in PPC.cpp can be retrieved from the backend target feature. I have double-checked that the hardcoded logic for inferring target features from the CPU in the frontend(PPC.cpp) is the same as in PPC.td.
2025-04-11[AMDGPU] vmem-to-lds-load-insts incoherence between TargetParser and ↵Juan Manuel Martinez Caamaño
AMDGPU.td (#135376) The vmem-to-lds-loads-insts feature is only available on gfx9/10. While target-parser was also enabling it for gfx6,7,8.
2025-04-02[AMDGPU] Use a target feature to enable __builtin_amdgcn_global_load_lds on ↵Juan Manuel Martinez Caamaño
gfx9/10 (#133055) This patch introduces the `vmem-to-lds-load-insts` target feature, which can be used to enable builtins `__builtin_amdgcn_global_load_lds` and `__builtin_amdgcn_raw_ptr_buffer_load_lds` on platforms which have this feature. This feature is only available on gfx9/10. A limitation of using a common target feature for both builtins is that we could have made `__builtin_amdgcn_raw_ptr_buffer_load_lds` available on gfx6,7,8.
2025-02-19[AMDGPU] Replace gfx940 and gfx941 with gfx942 in llvm (#126763)Fabian Ritter
gfx940 and gfx941 are no longer supported. This is one of a series of PRs to remove them from the code base. This PR removes all non-documentation occurrences of gfx940/gfx941 from the llvm directory, and the remaining occurrences in clang. Documentation changes will follow. For SWDEV-512631
2025-01-20[NFC][AMDGPU] Clean-up feature parsing for AMDGCNSPIRV. (#123519)Alex Voicu
When we did the initial AMDGCNSPIRV commits we left the initialisation of the feature map in a relatively disorderly state. This change corrects that oversight: - We make sure that AMDGCNSPIRV actually advertises the union of all AMDGCN features, as some were not included; - We keep feature initialisation in sorted order to make it easy to pick an insertion point when features are added in the future.
2024-11-26AMDGPU: Builtin & CodeGen support for v_cvt_sr_{bf16|f16}_f32 instructions ↵Matt Arsenault
(#117824) Co-authored-by: Shilei Tian <shilei.tian@amd.com>
2024-11-26AMDGPU: Add builtins & codegen support for bitop3_b{16|32} of gfx950. (#117823)Matt Arsenault
Co-authored-by: Pravin Jagtap <Pravin.Jagtap@amd.com>
2024-11-26AMDGPU: Builtin & CodeGen support for v_cvt_scalef32_pk32_f32_[fp|bf]6 for ↵Matt Arsenault
gfx950 (#117745) Co-authored-by: Pravin Jagtap <Pravin.Jagtap@amd.com>
2024-11-26AMDGPU: Builtins & Codegen support for v_cvt_scale_fp4<->f32 for gfx950 ↵Matt Arsenault
(#117743) OPSEL ASM Syntax for v_cvt_scalef32_pk_f32_fp4 : opsel:[x,y,z] where, x & y i.e. OPSEL[1 : 0] selects which src_byte to read. OPSEL ASM Syntax for v_cvt_scalef32_pk_fp4_f32 : opsel:[a,b,c,d] where, c & d i.e. OPSEL[3 : 2] selects which dst_byte to write. Co-authored-by: Pravin Jagtap <Pravin.Jagtap@amd.com>
2024-11-26AMDGPU: Builtins & Codegen support for: v_cvt_scalef32_[f16|f32]_[bf8|fp8] ↵Matt Arsenault
(#117739) OPSEL[1:0] collectively decide which byte to read from src input. Builtin takes additional imm argument which represents index (with valid values:[0:3]) of src byte read. Out of bounds checks will added in next patch. OPSEL ASM Syntax: opsel:[x,y,z] where, opsel[x] = Inst{11} = src0_modifier{2} opsel[y] = Inst{12} = src1_modifier{2} opsel[z] = Inst{14} = src0_modifier{3} Note: Inst{13} i.e. OPSEL[2] is ignored in asm syntax and opsel[z] is meaningless for v_cvt_scalef32_f32_{fp|bf}8 Co-authored-by: Pravin Jagtap <Pravin.Jagtap@amd.com>
2024-11-25AMDGPU: Support buffer_atomic_pk_add_bf16 for gfx950 (#117599)Matt Arsenault
Co-authored-by: Sirish Pande <Sirish.Pande@amd.com>
2024-11-25AMDGPU: Add support for v_dot2c_f32_bf16 instruction for gfx950 (#117598)Matt Arsenault
The encoding of v_dot2c_f32_bf16 opcode is same as v_mac_f32 in gfx90a, both from gfx9 series. This required a new decoderNameSpace GFX950_DOT. Co-authored-by: Sirish Pande <Sirish.Pande@amd.com>
2024-11-25AMDGPU: Add support for v_dot2_f32_bf16 instruction for gfx950 (#117597)Matt Arsenault
v_dot2_f32_bf16 was added in gfx11 along with v_dot2_f16_f16 and v_dot2_bf16_bf16. All three instructions were part of Dot9 instructions in the compiler. This patch will split existing dot9 (v_dot2_f16_f16, v_dot2_bf16_bf16, v_dot2_f32_bf16) into new dot9 (v_dot2_f16_f16 and v_dot2_bf16_bf16), and dot12 (v_dot2_f32_bf16). All necessary changes to gfx11 and gfx12 are updated to reflect this change. Co-authored-by: Sirish Pande <Sirish.Pande@amd.com>
2024-11-25AMDGPU: Add support for v_ashr_pk_i8/u8_i32 instructions for gfx950 (#117596)Matt Arsenault
This patch adds assembly and builtin support for v_ashr_pk_i8/u8_i32 instructions. Co-authored-by: Sirish Pande <Sirish.Pande@amd.com>
2024-11-25AMDGPU: Support v_cvt_scalef32_pk32_{bf|f}6_{bf|fp}16 for gfx950 (#117592)Matt Arsenault
Co-authored-by: Pravin Jagtap <Pravin.Jagtap@amd.com>
2024-11-22AMDGPU: Add v_permlane16_swap_b32 and v_permlane32_swap_b32 for gfx950 (#117260)Matt Arsenault
This was a bit annoying because these introduce a new special case encoding usage. op_sel is repurposed as a subset of dpp controls, and is eligible for VOP3->VOP1 shrinking. For some reason fi also uses an enum value, so we need to convert the raw boolean to 1 instead of -1. The 2 registers are swapped, so this has 2 defs. Ideally the builtin would return a pair, but that's difficult so return a vector instead. This would make a hypothetical builtin that supports v2f16 directly uglier.
2024-11-18AMDGPU: Add v_prng_b32 instruction for gfx950 (#116310)Matt Arsenault
Rand num instruction for stochastic rounding.
2024-11-18AMDGPU: Add gfx950 subtarget definitions (#116307)Matt Arsenault
Mostly a stub, but adds some baseline tests and tests for removed instructions.
2024-11-12[AMDGPU] Introduce a new generic target `gfx9-4-generic` (#115190)Shilei Tian
This patch introduces a new generic target, `gfx9-4-generic`. Since it doesn’t support FP8 and XF32-related instructions, the patch includes several code reorganizations to accommodate these changes.
2024-10-23[AMDGPU] Add a new target for gfx1153 (#113138)Carl Ritson
2024-07-09[AMDGPU] Report error in clang if wave32 is requested where unsupported (#97633)Stanislav Mekhanoshin
2024-06-07[clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (#89796)Alex Voicu
This change seeks to add support for vendor flavoured SPIRV - more specifically, AMDGCN flavoured SPIRV. The aim is to generate SPIRV that carries some extra bits of information that are only usable by AMDGCN targets, forfeiting absolute genericity to obtain greater expressiveness for target features: - AMDGCN inline ASM is allowed/supported, under the assumption that the [SPV_INTEL_inline_assembly](https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_inline_assembly.asciidoc) extension is enabled/used - AMDGCN target specific builtins are allowed/supported, under the assumption that e.g. the `--spirv-allow-unknown-intrinsics` option is enabled when using the downstream translator - the featureset matches the union of AMDGCN targets' features - the datalayout string is overspecified to affix both the program address space and the alloca address space, the latter under the assumption that the [SPV_INTEL_function_pointers](https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_function_pointers.asciidoc) extension is enabled/used, case in which the extant SPIRV datalayout string would lead to pointers to function pointing to the private address space, which would be wrong. Existing AMDGCN tests are extended to cover this new target. It is currently dormant / will require some additional changes, but I thought I'd rather put it up for review to get feedback as early as possible. I will note that an alternative option is to place this under AMDGPU, but that seems slightly less natural, since this is still SPIRV, albeit relaxed in terms of preconditions & constrained in terms of postconditions, and only guaranteed to be usable on AMDGCN targets (it is still possible to obtain pristine portable SPIRV through usage of the flavoured target, though).
2024-06-06[AMDGPU] Add a new target gfx1152 (#94534)Shilei Tian
2024-05-31AMDGPU: Add gfx12-generic target (#93875)Konstantin Zhuravlyov
2024-03-06AMDGPU: Define a feature for v_dot4_f32_* instructions (#84248)Changpeng Fang
FeatureDot11Insts (dot11-insts) for: v_dot4_f32_fp8_fp8, v_dot4_f32_fp8_bf8, v_dot4_f32_bf8_fp8, v_dot4_f32_bf8_bf8
2024-02-14[AMDGPU] Replace '.' with '-' in generic target names (#81718)Pierre van Houtryve
The dot is too confusing for tools. Output temporaries would have '10.3-generic' so tools could parse it as an extension, device libs & the associated clang driver logic are also confused by the dot. After discussions, we decided it's better to just remove the '.' from the target name than fix each issue one by one.
2024-02-12[AMDGPU] Introduce GFX9/10.1/10.3/11 Generic Targets (#76955)Pierre van Houtryve
These generic targets include multiple GPUs and will, in the future, provide a way to build once and run on multiple GPU, at the cost of less optimization opportunities. Note that this is just doing the compiler side of things, device libs an runtimes/loader/etc. don't know about these targets yet, so none of them actually work in practice right now. This is just the initial commit to make LLVM aware of them. This contains the documentation changes for both this change and #76954 as well.
2024-01-24[AMDGPU][GFX12] VOP encoding and codegen - add support for v_cvt fp8/… ↵Mariusz Sikora
(#78414) …bf8 instructions Add VOP1, VOP1_DPP8, VOP1_DPP16, VOP3, VOP3_DPP8, VOP3_DPP16 instructions that were supported on GFX940 (MI300): - V_CVT_F32_FP8 - V_CVT_F32_BF8 - V_CVT_PK_F32_FP8 - V_CVT_PK_F32_BF8 - V_CVT_PK_FP8_F32 - V_CVT_PK_BF8_F32 - V_CVT_SR_FP8_F32 - V_CVT_SR_BF8_F32 --------- Co-authored-by: Mateja Marjanovic <mateja.marjanovic@amd.com> Co-authored-by: Mirko Brkušanin <Mirko.Brkusanin@amd.com>