[llvm] [Analysis] Use TTI to guard dereferenceability through addrspacecast (PR #198251)
Jozef Sztabinski via llvm-commits
llvm-commits at lists.llvm.org
Mon May 25 00:16:27 PDT 2026
================
@@ -0,0 +1,50 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt -S -passes=simplifycfg < %s | FileCheck %s
+
+; Verify SimplifyCFG does not speculate loads through non-noop addrspacecasts.
+
+target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64-G1"
+
+define i32 @no_speculate_addrspacecast_load(ptr addrspace(4) noalias nocapture readonly dereferenceable(4) %p) {
+; CHECK-LABEL: define i32 @no_speculate_addrspacecast_load(
+; CHECK-SAME: ptr addrspace(4) noalias readonly captures(none) dereferenceable(4) [[P:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
----------------
jszt1 wrote:
Yes, it makes sense to simplify this tests. I have updated it.
https://github.com/llvm/llvm-project/pull/198251
More information about the llvm-commits
mailing list