[llvm] [GlobalOpt] Do not fold away addrspacecasts which may be runtime operations (PR #153753)

Owen Anderson via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 15 03:20:23 PDT 2025


================
@@ -0,0 +1,31 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
+; RUN: opt -passes=globalopt < %s -S | FileCheck %s
+
+; Test that we do not fold away addresscasts when optimizing once-stored
+; globals, as these may be runtime operations.
+
+%T = type { ptr }
+
+ at 0 = internal global ptr null
+ at 1 = internal addrspace(1) global i32 0
----------------
resistor wrote:

Done

https://github.com/llvm/llvm-project/pull/153753


More information about the llvm-commits mailing list