================
@@ -0,0 +1,71 @@
+# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx950 -run-pass=greedy 
-verify-regalloc -o - %s | FileCheck %s
+#
+# The gist of this test is we want something that triggers the
+# hoistSpillInsideBB spilling optimization placement, while spilling a value
+# that is defined by a copy inserted by live-range splitting within the
+# prologue of the basic block (i.e., where we do our exec masks shenanigans).
+#
+# Since the spiller cannot insert the spill code within that prologue, it
+# needs to extend the live-range through the prologue region and that test
+# captures that.
+#
+# The verify-regalloc flag makes sure the live-ranges are properly updated.
+# Before it would complain about missing live segment.
+#
+# The test looks like this at a high level:
+#
+# bb:
+#  %1 = COPY %0 #copy in the prologue
+#  ... # prologue instruction
+#  ... # high pressure point
+#  use %1
+#
+# And with hoistSpillInsideBB we will generate:
+# bb:
+#   -- # %1 = COPY %0 gets removed
+#  ... # prologue instruction
+#  store %0 # %0 liveness is extended to this point.
+#  ... # high pressure point
+#  %1_reload = load
+#  use %1_reload
+#
+# To be able to hit the problematic code in hoistSpillInsideBB, %0 needs to
+# be defined by a PHI (hence the diamond with two %0 defs in the test case)
+# and %0 and %1 need to be sibling registers (hence the %3 split-from).
----------------
rovka wrote:

This whole comment kind of screams "unit test". Would it take a lot of 
boilerplate to do this in a unit test instead?

https://github.com/llvm/llvm-project/pull/197363
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to