[llvm] [Attributor] Prevent infinite loop in AAGlobalValueInfoFloating (PR #94941)
Vidush Singhal via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 10 15:39:35 PDT 2024
================
@@ -0,0 +1,28 @@
+; RUN: opt < %s -passes=attributor
+
+; Global variables that reference themselves alongside a function that is called indirectly
+; used to cause an infinite loop in the attributor. The recursive reference was continually
+; pushed back into the workload, causing the attributor to hang indefinitely.
+
+ at glob1 = global { ptr, ptr } { ptr @glob1, ptr @fnc1 }
+ at glob2 = global { ptr, ptr } { ptr @glob3, ptr @fnc2 }
+ at glob3 = global { ptr, ptr } { ptr @glob2, ptr @fnc2 }
+
+define internal void @fnc1() {
+ ret void
+}
+
+define internal void @fnc2() {
+ ret void
+}
+
+define internal void @indr_caller(ptr %0) {
+ call void %0()
+ ret void
+}
+
----------------
vidsinghal wrote:
I don't see any attributor output.
Did you use the correct run command and use the update_test_checks.py script?
https://github.com/llvm/llvm-project/pull/94941
More information about the llvm-commits
mailing list