[llvm] [polly] [IR] Enable dereferenceable-at-point semantics (PR #204795)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 26 03:43:32 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Nikita Popov (nikic)
<details>
<summary>Changes</summary>
The precise semantics of `dereferenceable` are currently undocumented, but de facto they are:
* Argument position `dereferenceable` implies that the memory remains dereferenceable while the function executes.
* Return position `dereferenceable` implies that the memory remains dereferenceable forever.
This is not coherent with how these attributes are use, in at least two ways:
* C++ reference arguments are annotated as `dereferenceable` by Clang. However, C++ does not actually make any guarantees that the underlying memory does not get freed during the execution of the function. (Unlike Rust, which does guarantee this via protectors in SB/TB.)
* We infer `dereferenceable` on allocator return values (from `allocsize`). Allocator return values quite obviously do not stay dereferenceable forever, as they can be freed.
This PR changes the semantics of `dereferenceable` to apply at-point, i.e. only directly on function entry (for arguments), or at the position of the call (for return values). The fact that the memory cannot be freed between the point where the `dereferenceable` fact has been established and the point where we're trying to speculate needs to be explicitly proven now.
The main ways this happens is:
* Via `nofree` function attributes (inferred).
* Via `noalias nofree` argument attributes. The former is inferred, but the latter generally requires frontend annotation. In Rust the combination of `noalias nofree dereferenceable` is used, so it should not be materially affected by these changes.
* Context-sensitive analysis to check for frees (i.e. non-nofree calls or synchronizing atomis) between the point of definition and the point of speculation.
It's expected that this will regress optimization of C++ code in some cases, because we can no longer use dereferenceability facts that are not, in fact, guaranteed to hold.
[Compile-time impact](https://llvm-compile-time-tracker.com/compare.php?from=3c33c36d925f5d278501fea55ef5a2e1f8f331ca&to=11fcd26e0c889012950d589726422c06a39bb2a4&stat=instructions:u): Peculiarly we actually see an improvement at stage2 -- it looks like we get "lucky" and don't perform some non-profitable speculation... Otherwise this is fairly neutral.
---
Patch is 32.82 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/204795.diff
20 Files Affected:
- (modified) llvm/docs/LangRef.rst (+13-3)
- (modified) llvm/docs/ReleaseNotes.md (+4)
- (modified) llvm/lib/IR/Value.cpp (+1-1)
- (modified) llvm/test/CodeGen/AMDGPU/amdhsa-trap-num-sgprs.ll (+1-1)
- (modified) llvm/test/CodeGen/AMDGPU/asyncmark-gfx12plus.ll (+8-7)
- (modified) llvm/test/CodeGen/AMDGPU/insert-delay-alu-bug.ll (+7-5)
- (modified) llvm/test/CodeGen/AMDGPU/madak.ll (+11-13)
- (modified) llvm/test/CodeGen/AMDGPU/rewrite-mfma-form-spill-cost-reset.ll (+1-1)
- (modified) llvm/test/CodeGen/X86/load-partial.ll (+1-1)
- (modified) llvm/test/CodeGen/X86/oddsubvector.ll (+5-5)
- (modified) llvm/test/Transforms/GVN/PRE/volatile.ll (+1-1)
- (modified) llvm/test/Transforms/LoopVectorize/AArch64/simple_early_exit.ll (+1-1)
- (modified) llvm/test/Transforms/LoopVectorize/early_exit_legality.ll (+1-1)
- (modified) llvm/test/Transforms/LoopVectorize/early_exit_with_outer_loop.ll (+9-9)
- (modified) llvm/test/Transforms/LoopVectorize/single_early_exit.ll (+2-2)
- (modified) llvm/test/Transforms/LoopVectorize/single_early_exit_live_outs.ll (+1-1)
- (modified) llvm/test/Transforms/MergeICmps/X86/no-gep-other-work.ll (+1-1)
- (modified) llvm/test/Transforms/PhaseOrdering/AArch64/constraint-elimination-placement.ll (+11-6)
- (modified) llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll (+6-8)
- (modified) polly/test/ScopInfo/invariant_load_dereferenceable.ll (+1-1)
``````````diff
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index b7744ad2ff5fd..e4cc23efd731d 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -1616,6 +1616,12 @@ Currently, only the following parameter attributes are defined:
otherwise it is undefined behavior. This means ``dereferenceable(<n>)``
implies ``noundef``.
+ The ``dereferenceable`` attribute only implies dereferenceability at the
+ point of the attribute (i.e. on function entry for arguments or at the
+ point of the call for return values). The underlying object may still get
+ freed after that point. Other attributes such as ``nofree`` can be used
+ to exclude frees.
+
.. _attr_dereferenceable_or_null:
``dereferenceable_or_null(<n>)``
@@ -7834,12 +7840,15 @@ it is attached to is completely unpredictable.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The existence of the ``!dereferenceable`` metadata on the instruction
-tells the optimizer that the value loaded is known to be dereferenceable,
-otherwise the behavior is undefined.
+tells the optimizer that the value loaded is known to be dereferenceable
+at the current program point, otherwise the behavior is undefined.
The number of bytes known to be dereferenceable is specified by the integer
value in the metadata node. This is analogous to the ''dereferenceable''
attribute on parameters and return values.
+The ``!deferenceable`` metadata can be combined with the ``!nofree`` metadata
+to indicate that the pointer will stay dereferenceable forever.
+
.. _md_dereferenceable_or_null:
'``dereferenceable_or_null``' Metadata
@@ -7847,7 +7856,8 @@ attribute on parameters and return values.
The existence of the ``!dereferenceable_or_null`` metadata on the
instruction tells the optimizer that the value loaded is known to be either
-dereferenceable or null, otherwise the behavior is undefined.
+dereferenceable at the current program point or null, otherwise the behavior is
+undefined.
The number of bytes known to be dereferenceable is specified by the integer
value in the metadata node. This is analogous to the ''dereferenceable_or_null''
attribute on parameters and return values.
diff --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md
index 24b8604ca11d8..e783ff2968338 100644
--- a/llvm/docs/ReleaseNotes.md
+++ b/llvm/docs/ReleaseNotes.md
@@ -102,6 +102,10 @@ Makes programs 10x faster by doing Special New Thing.
outlining. Add the `noinline` and `nooutline` attributes as well in cases
where inlining and outlining should additionally be disabled.
+* The `dereferenceable` and `dereferenceable_or_null` attributes (and
+ corresponding metadata) now apply only at the point of definition, instead of
+ for the execution of the function (for arguments) or forever (for returns).
+
### Changes to LLVM infrastructure
* Removed ``Constant::isZeroValue``. It was functionally identical to
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index d3f90bd81bbe2..6d0170dd23e75 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -38,7 +38,7 @@
using namespace llvm;
static cl::opt<bool> UseDerefAtPointSemantics(
- "use-dereferenceable-at-point-semantics", cl::Hidden, cl::init(false),
+ "use-dereferenceable-at-point-semantics", cl::Hidden, cl::init(true),
cl::desc("Deref attributes and metadata infer facts at definition only"));
//===----------------------------------------------------------------------===//
diff --git a/llvm/test/CodeGen/AMDGPU/amdhsa-trap-num-sgprs.ll b/llvm/test/CodeGen/AMDGPU/amdhsa-trap-num-sgprs.ll
index 85b5c7c870b23..eac6daf9b9bcc 100644
--- a/llvm/test/CodeGen/AMDGPU/amdhsa-trap-num-sgprs.ll
+++ b/llvm/test/CodeGen/AMDGPU/amdhsa-trap-num-sgprs.ll
@@ -2,7 +2,7 @@
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -mattr=-trap-handler < %s | FileCheck %s --check-prefixes=GCN,TRAP-HANDLER-DISABLE
; GCN-LABEL: {{^}}amdhsa_trap_num_sgprs
-; TRAP-HANDLER-ENABLE: NumSgprs: 61
+; TRAP-HANDLER-ENABLE: NumSgprs: 63
; TRAP-HANDLER-DISABLE: NumSgprs: 77
define amdgpu_kernel void @amdhsa_trap_num_sgprs(
ptr addrspace(1) %out0, i32 %in0,
diff --git a/llvm/test/CodeGen/AMDGPU/asyncmark-gfx12plus.ll b/llvm/test/CodeGen/AMDGPU/asyncmark-gfx12plus.ll
index 5d55eeecbe2fc..ee18a04a0eb59 100644
--- a/llvm/test/CodeGen/AMDGPU/asyncmark-gfx12plus.ll
+++ b/llvm/test/CodeGen/AMDGPU/asyncmark-gfx12plus.ll
@@ -172,12 +172,13 @@ define amdgpu_kernel void @test_pipelined_loop(ptr addrspace(1) %foo, ptr addrsp
; SDAG-NEXT: s_cbranch_scc1 .LBB1_1
; SDAG-NEXT: ; %bb.2: ; %epilog
; SDAG-NEXT: s_lshl2_add_u32 s0, s3, s2
-; SDAG-NEXT: ; wait_asyncmark(1)
-; SDAG-NEXT: s_wait_asynccnt 0x1
+; SDAG-NEXT: v_mov_b32_e32 v2, 0
; SDAG-NEXT: s_add_co_i32 s0, s0, -8
; SDAG-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
-; SDAG-NEXT: v_dual_mov_b32 v2, 0 :: v_dual_mov_b32 v0, s0
+; SDAG-NEXT: v_mov_b32_e32 v0, s0
; SDAG-NEXT: s_load_b64 s[0:1], s[4:5], 0x34 nv
+; SDAG-NEXT: ; wait_asyncmark(1)
+; SDAG-NEXT: s_wait_asynccnt 0x1
; SDAG-NEXT: ds_load_b32 v0, v0
; SDAG-NEXT: ; wait_asyncmark(0)
; SDAG-NEXT: s_wait_dscnt 0x0
@@ -228,14 +229,14 @@ define amdgpu_kernel void @test_pipelined_loop(ptr addrspace(1) %foo, ptr addrsp
; GISEL-NEXT: s_cbranch_scc1 .LBB1_1
; GISEL-NEXT: ; %bb.2: ; %epilog
; GISEL-NEXT: s_lshl_b32 s0, s3, 2
-; GISEL-NEXT: ; wait_asyncmark(1)
-; GISEL-NEXT: s_wait_asynccnt 0x1
-; GISEL-NEXT: s_add_co_u32 s0, s2, s0
; GISEL-NEXT: v_mov_b32_e32 v1, 0
+; GISEL-NEXT: s_add_co_u32 s0, s2, s0
+; GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
; GISEL-NEXT: s_add_co_u32 s0, s0, -8
-; GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
; GISEL-NEXT: v_mov_b32_e32 v0, s0
; GISEL-NEXT: s_load_b64 s[0:1], s[4:5], 0x34 nv
+; GISEL-NEXT: ; wait_asyncmark(1)
+; GISEL-NEXT: s_wait_asynccnt 0x1
; GISEL-NEXT: ds_load_b32 v0, v0
; GISEL-NEXT: ; wait_asyncmark(0)
; GISEL-NEXT: s_wait_dscnt 0x0
diff --git a/llvm/test/CodeGen/AMDGPU/insert-delay-alu-bug.ll b/llvm/test/CodeGen/AMDGPU/insert-delay-alu-bug.ll
index 7ba2f1b847fa0..b0ea20d4969bd 100644
--- a/llvm/test/CodeGen/AMDGPU/insert-delay-alu-bug.ll
+++ b/llvm/test/CodeGen/AMDGPU/insert-delay-alu-bug.ll
@@ -113,16 +113,18 @@ define amdgpu_kernel void @f2(i32 %arg, i32 %arg1, i32 %arg2, i1 %arg3, i32 %arg
; GFX11-NEXT: s_cmp_eq_u32 s1, 0
; GFX11-NEXT: s_cbranch_scc0 .LBB2_8
; GFX11-NEXT: ; %bb.5: ; %bb18.preheader
-; GFX11-NEXT: s_load_b128 s[28:31], s[18:19], 0x44
+; GFX11-NEXT: s_clause 0x1
+; GFX11-NEXT: s_load_b64 s[0:1], s[18:19], 0x44
+; GFX11-NEXT: s_load_b32 s9, s[18:19], 0x4c
; GFX11-NEXT: v_mov_b32_e32 v0, 0
; GFX11-NEXT: s_waitcnt lgkmcnt(0)
-; GFX11-NEXT: s_mul_hi_u32 s1, s29, s28
-; GFX11-NEXT: s_mul_i32 s0, s29, s28
+; GFX11-NEXT: s_mul_hi_u32 s29, s1, s0
+; GFX11-NEXT: s_mul_i32 s28, s1, s0
; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
-; GFX11-NEXT: s_lshr_b64 s[0:1], s[0:1], 1
+; GFX11-NEXT: s_lshr_b64 s[0:1], s[28:29], 1
; GFX11-NEXT: s_mov_b32 s1, 0
; GFX11-NEXT: s_or_b32 s0, s0, 1
-; GFX11-NEXT: s_lshr_b32 s0, s0, s30
+; GFX11-NEXT: s_lshr_b32 s0, s0, s9
; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
; GFX11-NEXT: s_mul_i32 s0, s0, s22
; GFX11-NEXT: s_mul_i32 s0, s0, s20
diff --git a/llvm/test/CodeGen/AMDGPU/madak.ll b/llvm/test/CodeGen/AMDGPU/madak.ll
index 8d40458a46087..dd0d190f9f160 100644
--- a/llvm/test/CodeGen/AMDGPU/madak.ll
+++ b/llvm/test/CodeGen/AMDGPU/madak.ll
@@ -1323,14 +1323,13 @@ define amdgpu_kernel void @madak_constant_bus_violation(i32 %arg1, [8 x i32], fl
; GFX6-NEXT: buffer_store_dword v0, off, s[0:3], 0
; GFX6-NEXT: s_waitcnt vmcnt(0)
; GFX6-NEXT: .LBB9_2: ; %bb4
+; GFX6-NEXT: s_load_dword s0, s[4:5], 0x12
; GFX6-NEXT: s_mov_b32 s3, 0xf000
; GFX6-NEXT: s_mov_b32 s2, -1
-; GFX6-NEXT: s_waitcnt expcnt(0)
+; GFX6-NEXT: v_mov_b32_e32 v1, 0x42280000
+; GFX6-NEXT: s_waitcnt expcnt(0) lgkmcnt(0)
; GFX6-NEXT: buffer_load_dword v0, off, s[0:3], 0 glc
; GFX6-NEXT: s_waitcnt vmcnt(0)
-; GFX6-NEXT: s_load_dword s0, s[4:5], 0x12
-; GFX6-NEXT: v_mov_b32_e32 v1, 0x42280000
-; GFX6-NEXT: s_waitcnt lgkmcnt(0)
; GFX6-NEXT: v_mac_f32_e64 v1, s0, 0.5
; GFX6-NEXT: v_mul_f32_e32 v0, v1, v0
; GFX6-NEXT: buffer_store_dword v0, off, s[0:3], 0
@@ -1348,9 +1347,9 @@ define amdgpu_kernel void @madak_constant_bus_violation(i32 %arg1, [8 x i32], fl
; GFX8-NEXT: flat_store_dword v[0:1], v0
; GFX8-NEXT: s_waitcnt vmcnt(0)
; GFX8-NEXT: .LBB9_2: ; %bb4
+; GFX8-NEXT: s_load_dword s0, s[4:5], 0x48
; GFX8-NEXT: flat_load_dword v0, v[0:1] glc
; GFX8-NEXT: s_waitcnt vmcnt(0)
-; GFX8-NEXT: s_load_dword s0, s[4:5], 0x48
; GFX8-NEXT: v_mov_b32_e32 v1, 0x42280000
; GFX8-NEXT: s_waitcnt lgkmcnt(0)
; GFX8-NEXT: v_mac_f32_e64 v1, s0, 0.5
@@ -1370,9 +1369,9 @@ define amdgpu_kernel void @madak_constant_bus_violation(i32 %arg1, [8 x i32], fl
; GFX9-NEXT: global_store_dword v[0:1], v0, off
; GFX9-NEXT: s_waitcnt vmcnt(0)
; GFX9-NEXT: .LBB9_2: ; %bb4
+; GFX9-NEXT: s_load_dword s0, s[4:5], 0x48
; GFX9-NEXT: global_load_dword v0, v[0:1], off glc
; GFX9-NEXT: s_waitcnt vmcnt(0)
-; GFX9-NEXT: s_load_dword s0, s[4:5], 0x48
; GFX9-NEXT: v_mov_b32_e32 v1, 0x42280000
; GFX9-NEXT: s_waitcnt lgkmcnt(0)
; GFX9-NEXT: v_mac_f32_e64 v1, s0, 0.5
@@ -1392,9 +1391,9 @@ define amdgpu_kernel void @madak_constant_bus_violation(i32 %arg1, [8 x i32], fl
; GFX10-MAD-NEXT: global_store_dword v[0:1], v0, off
; GFX10-MAD-NEXT: s_waitcnt_vscnt null, 0x0
; GFX10-MAD-NEXT: .LBB9_2: ; %bb4
+; GFX10-MAD-NEXT: s_load_dword s0, s[4:5], 0x48
; GFX10-MAD-NEXT: global_load_dword v0, v[0:1], off glc dlc
; GFX10-MAD-NEXT: s_waitcnt vmcnt(0)
-; GFX10-MAD-NEXT: s_load_dword s0, s[4:5], 0x48
; GFX10-MAD-NEXT: v_mov_b32_e32 v1, 0.5
; GFX10-MAD-NEXT: s_waitcnt lgkmcnt(0)
; GFX10-MAD-NEXT: v_madak_f32 v1, s0, v1, 0x42280000
@@ -1414,10 +1413,9 @@ define amdgpu_kernel void @madak_constant_bus_violation(i32 %arg1, [8 x i32], fl
; GFX11-MAD-NEXT: global_store_b32 v[0:1], v0, off dlc
; GFX11-MAD-NEXT: s_waitcnt_vscnt null, 0x0
; GFX11-MAD-NEXT: .LBB9_2: ; %bb4
-; GFX11-MAD-NEXT: global_load_b32 v0, v[0:1], off glc dlc
-; GFX11-MAD-NEXT: s_waitcnt vmcnt(0)
; GFX11-MAD-NEXT: s_load_b32 s0, s[4:5], 0x48
-; GFX11-MAD-NEXT: s_waitcnt lgkmcnt(0)
+; GFX11-MAD-NEXT: global_load_b32 v0, v[0:1], off glc dlc
+; GFX11-MAD-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
; GFX11-MAD-NEXT: v_mul_f32_e64 v1, s0, 0.5
; GFX11-MAD-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
; GFX11-MAD-NEXT: v_add_f32_e32 v1, 0x42280000, v1
@@ -1437,9 +1435,9 @@ define amdgpu_kernel void @madak_constant_bus_violation(i32 %arg1, [8 x i32], fl
; GFX942-FMA-NEXT: global_store_dword v[0:1], v0, off sc0 sc1
; GFX942-FMA-NEXT: s_waitcnt vmcnt(0)
; GFX942-FMA-NEXT: .LBB9_2: ; %bb4
+; GFX942-FMA-NEXT: s_load_dword s0, s[4:5], 0x48
; GFX942-FMA-NEXT: global_load_dword v0, v[0:1], off sc0 sc1
; GFX942-FMA-NEXT: s_waitcnt vmcnt(0)
-; GFX942-FMA-NEXT: s_load_dword s0, s[4:5], 0x48
; GFX942-FMA-NEXT: v_mov_b32_e32 v1, 0x42280000
; GFX942-FMA-NEXT: s_waitcnt lgkmcnt(0)
; GFX942-FMA-NEXT: v_fmac_f32_e64 v1, s0, 0.5
@@ -1459,9 +1457,9 @@ define amdgpu_kernel void @madak_constant_bus_violation(i32 %arg1, [8 x i32], fl
; GFX10-FMA-NEXT: global_store_dword v[0:1], v0, off
; GFX10-FMA-NEXT: s_waitcnt_vscnt null, 0x0
; GFX10-FMA-NEXT: .LBB9_2: ; %bb4
+; GFX10-FMA-NEXT: s_load_dword s0, s[4:5], 0x48
; GFX10-FMA-NEXT: global_load_dword v0, v[0:1], off glc dlc
; GFX10-FMA-NEXT: s_waitcnt vmcnt(0)
-; GFX10-FMA-NEXT: s_load_dword s0, s[4:5], 0x48
; GFX10-FMA-NEXT: v_mov_b32_e32 v1, 0.5
; GFX10-FMA-NEXT: s_waitcnt lgkmcnt(0)
; GFX10-FMA-NEXT: v_fmaak_f32 v1, s0, v1, 0x42280000
@@ -1481,9 +1479,9 @@ define amdgpu_kernel void @madak_constant_bus_violation(i32 %arg1, [8 x i32], fl
; GFX11-FMA-NEXT: global_store_b32 v[0:1], v0, off dlc
; GFX11-FMA-NEXT: s_waitcnt_vscnt null, 0x0
; GFX11-FMA-NEXT: .LBB9_2: ; %bb4
+; GFX11-FMA-NEXT: s_load_b32 s0, s[4:5], 0x48
; GFX11-FMA-NEXT: global_load_b32 v0, v[0:1], off glc dlc
; GFX11-FMA-NEXT: s_waitcnt vmcnt(0)
-; GFX11-FMA-NEXT: s_load_b32 s0, s[4:5], 0x48
; GFX11-FMA-NEXT: v_mov_b32_e32 v1, 0.5
; GFX11-FMA-NEXT: s_waitcnt lgkmcnt(0)
; GFX11-FMA-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
diff --git a/llvm/test/CodeGen/AMDGPU/rewrite-mfma-form-spill-cost-reset.ll b/llvm/test/CodeGen/AMDGPU/rewrite-mfma-form-spill-cost-reset.ll
index ce59330eed898..dc7120b8aef94 100644
--- a/llvm/test/CodeGen/AMDGPU/rewrite-mfma-form-spill-cost-reset.ll
+++ b/llvm/test/CodeGen/AMDGPU/rewrite-mfma-form-spill-cost-reset.ll
@@ -533,7 +533,7 @@ define amdgpu_kernel void @test_spill_cost_reset(
; CHECK-NEXT: S_BRANCH %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2.epilogue:
- ; CHECK-NEXT: [[S_LOAD_DWORDX2_IMM:%[0-9]+]]:sreg_64_xexec_xnull = S_LOAD_DWORDX2_IMM [[COPY]](p4), 0, 0 :: (dereferenceable invariant load (s64) from %ir.out.kernarg.offset550, align 16, addrspace 4)
+ ; CHECK-NEXT: [[S_LOAD_DWORDX2_IMM:%[0-9]+]]:sreg_64_xexec_xnull = S_LOAD_DWORDX2_IMM [[COPY]](p4), 0, 0 :: (invariant load (s64) from %ir.out.kernarg.offset550, align 16, addrspace 4)
; CHECK-NEXT: [[V_MOV_B32_e32_13:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
; CHECK-NEXT: GLOBAL_STORE_DWORD_SADDR [[V_MOV_B32_e32_13]], [[V_MFMA_F32_16X16X32_F16_vgprcd_e64_2]].sub0, [[S_LOAD_DWORDX2_IMM]], 0, 0, implicit $exec :: (store (s32) into %ir.out.load, addrspace 1)
; CHECK-NEXT: S_ENDPGM 0
diff --git a/llvm/test/CodeGen/X86/load-partial.ll b/llvm/test/CodeGen/X86/load-partial.ll
index a2f4f7ac3d534..c4c1d0d01fb5e 100644
--- a/llvm/test/CodeGen/X86/load-partial.ll
+++ b/llvm/test/CodeGen/X86/load-partial.ll
@@ -150,7 +150,7 @@ define <4 x float> @load_float4_float3_as_float2_float_0122(ptr nocapture readon
ret <4 x float> %10
}
-define <4 x float> @load_float4_float3_trunc(ptr nocapture readonly dereferenceable(16)) {
+define <4 x float> @load_float4_float3_trunc(ptr nocapture readonly dereferenceable(16)) nofree {
; SSE-LABEL: load_float4_float3_trunc:
; SSE: # %bb.0:
; SSE-NEXT: movaps (%rdi), %xmm0
diff --git a/llvm/test/CodeGen/X86/oddsubvector.ll b/llvm/test/CodeGen/X86/oddsubvector.ll
index 5df1867f73c8e..c971619a2a64c 100644
--- a/llvm/test/CodeGen/X86/oddsubvector.ll
+++ b/llvm/test/CodeGen/X86/oddsubvector.ll
@@ -91,11 +91,11 @@ define void @PR40815(ptr nocapture readonly dereferenceable(64), ptr nocapture d
;
; AVX512-LABEL: PR40815:
; AVX512: # %bb.0:
-; AVX512-NEXT: vmovaps 48(%rdi), %xmm0
-; AVX512-NEXT: vmovups 16(%rdi), %ymm1
-; AVX512-NEXT: vinsertf128 $1, (%rdi), %ymm1, %ymm1
-; AVX512-NEXT: vinsertf128 $1, 32(%rdi), %ymm0, %ymm0
-; AVX512-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
+; AVX512-NEXT: vmovaps 16(%rdi), %xmm0
+; AVX512-NEXT: vmovaps 48(%rdi), %xmm1
+; AVX512-NEXT: vinsertf128 $1, (%rdi), %ymm0, %ymm0
+; AVX512-NEXT: vinsertf128 $1, 32(%rdi), %ymm1, %ymm1
+; AVX512-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
; AVX512-NEXT: vmovups %zmm0, (%rsi)
; AVX512-NEXT: vzeroupper
; AVX512-NEXT: retq
diff --git a/llvm/test/Transforms/GVN/PRE/volatile.ll b/llvm/test/Transforms/GVN/PRE/volatile.ll
index 38ba5e2cfeb19..9d5227f025b95 100644
--- a/llvm/test/Transforms/GVN/PRE/volatile.ll
+++ b/llvm/test/Transforms/GVN/PRE/volatile.ll
@@ -153,7 +153,7 @@ exit:
; Another volatile PRE case - two paths through a loop
; load in preheader, one path read only, one not
-define i32 @test8(i1 %b, i1 %c, ptr noalias align 4 dereferenceable(4) %p, ptr noalias %q) {
+define i32 @test8(i1 %b, i1 %c, ptr noalias align 4 dereferenceable(4) %p, ptr noalias %q) nofree {
; CHECK-LABEL: @test8(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[Y1:%.*]] = load i32, ptr [[P:%.*]], align 4
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/simple_early_exit.ll b/llvm/test/Transforms/LoopVectorize/AArch64/simple_early_exit.ll
index 630cd40f1f299..d9904db8df386 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/simple_early_exit.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/simple_early_exit.ll
@@ -3,7 +3,7 @@
target triple = "aarch64-unknown-linux-gnu"
-declare void @init_mem(ptr, i64);
+declare void @init_mem(ptr, i64) nofree
define i64 @same_exit_block_pre_inc_use1() #1 {
; CHECK-LABEL: define i64 @same_exit_block_pre_inc_use1(
diff --git a/llvm/test/Transforms/LoopVectorize/early_exit_legality.ll b/llvm/test/Transforms/LoopVectorize/early_exit_legality.ll
index 88a2bccf9c904..eab41ecdb60d2 100644
--- a/llvm/test/Transforms/LoopVectorize/early_exit_legality.ll
+++ b/llvm/test/Transforms/LoopVectorize/early_exit_legality.ll
@@ -2,7 +2,7 @@
; REQUIRES: asserts
; RUN: opt -S < %s -p loop-vectorize -debug-only=loop-vectorize,vplan -force-vector-width=4 -disable-output 2>&1 | FileCheck %s
-declare void @init_mem(ptr, i64);
+declare void @init_mem(ptr, i64) nofree
; == SOME LEGAL EXAMPLES ==
diff --git a/llvm/test/Transforms/LoopVectorize/early_exit_with_outer_loop.ll b/llvm/test/Transforms/LoopVectorize/early_exit_with_outer_loop.ll
index b02a96ab25f3c..d244adcc259c0 100644
--- a/llvm/test/Transforms/LoopVectorize/early_exit_with_outer_loop.ll
+++ b/llvm/test/Transforms/LoopVectorize/early_exit_with_outer_loop.ll
@@ -122,7 +122,7 @@ exit:
; Tests when an early-exit inner loop has multiple exits and all exits
; leave the outer loop.
-define i32 @multi_early_exit_all_leave_outer_loop(i1 %c, ptr dereferenceable(1024) %src) {
+define i32 @multi_early_exit_all_leave_outer_loop(i1 %c, ptr dereferenceable(1024) %src) nofree {
; CHECK-LABEL: Loop info for function 'multi_early_exit_all_leave_outer_loop':
; CHECK-NEXT: Loop at depth 1 containing: %outer.header<header>,%outer.latch<latch><exiting>,%vector.ph,%vector.body<exiting>,%vector.body.interim,%middle.block
; CHECK-NEXT: Loop at depth 2 containing: %vector.body<header><exiting>,%vector.body.interim<latch><exiting>
@@ -159,7 +159,7 @@ early.exit.2:
; Tests when an inner loop has two early exits at different loop levels
; (one staying in the outer loop, one leaving all loops).
-define i32 @multi_early_exit_different_loop_levels(i1 %c, ptr dereferenceable(1024) %src) {
+define i32 @multi_early_exit_different_loop_levels(i1 %c, ptr dereferenceable(1024) %src) nofree {
; CHECK-LABEL: Loop info for function 'multi_early_exit_different_loop_levels':
; CHECK-NEXT: Loop at depth 1 containing: %outer.header<header>,%early.exit.outer,%outer.latch<latch>,%outer.latch.loopexit,%vector.ph,%vector.body,%vector.body.interim,%middle.block,%vector.early.exit.check<exiting>,%vector.early.exit.0
; CHECK-NEXT: Loop at depth 2 containing: %vector.body<header><exiting>,%vector.body.interim<latch><exiting>
@@ -196,7 +196,7 @@ early.exit.leave:
; Same as above, but the early exit order is reversed: the first early exit
; leaves all loops and the second stays in the outer loop.
-define i32 @multi_early_exit_different_loop_levels_reversed(i1 %c, ptr dereferenceable(1024) %src) {
+define i32 @multi_early_exit_different_loop_levels_reversed(i1 %c, ptr dereferenceable(1024) %src) nofree {
; CHECK-LABEL: Loop info for function 'multi_early_exit_different_loop_levels_reversed':
; CHECK-NEXT: Loop at depth 1 containing: %outer.header<header>,%early.exit.outer,%outer.latch<latch>,%outer.latch.loopexit,%vector.ph,%vector.body,%vector.body.interim,%middle.block,%vector.early.exit.check<exiting>,%vector.early.exit.1
; CHECK-NEXT: Loop at depth 2 containing: %vector.body<header><exiting>,%vector.body.interim<latch><exiting>
@@ -233,7 +233,7 @@ early.exit.leave:
; Tests when an inner loop has two early exits at different loop levels
; (one going to a middle loop, one going to the outer loop).
-define i32 @multi_early_exit_two_different_loops(i1 %c, ptr dereferenceable(1024) %src) {
+define i32 @multi_early_exit_two_different_loops(i1 %c, ptr dereferenceable(1024) %src) nofree {
; CHECK-LABEL: Loop info for function 'multi_early_exit_two_different_loops...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/204795
More information about the llvm-commits
mailing list