[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 06:48:28 PDT 2025


================
@@ -0,0 +1,42 @@
+; 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.
+
+ at g1 = internal global ptr null
+ at g2 = 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