[PATCH] [Statepoints] Reuse stack slots for assignment idioms

Igor Laevsky igor at azulsystems.com
Thu Jun 11 15:10:01 PDT 2015


Do I understand correctly that you relaxed constraints on findPreviousSpillSlot to return location which does not necessarily contains requested value? If so, maybe it's better to rename it? Something like findPreferredSpillSlot.

Also with this approach we can do better for phi nodes. When visiting phi node we can return known location even if some of the phi node branches are unknown. There is TODO for this somewhere in findPreviousSpillSlot. Not sure how profitable it would be though.


================
Comment at: lib/CodeGen/SelectionDAG/StatepointLowering.cpp:422-424
@@ -420,1 +421,5 @@
 
+  // Now spill the value.  When we have multiple values which map the same
+  // stack slot this may result in redundant spills, but we can generally rely
+  // on the backend to clean these up for us and don't need to be fancy here.
+  
----------------
Are you certain about this? I do remember experimenting with this approach, but I was seeing quite the opposite picture - almost no redundant stores were removed. But actually it was quite a while ago and I didn't dig to deep into this, maybe my code had some simple mistake. I will try to run few of my old tests on your code tomorrow.

================
Comment at: test/CodeGen/X86/statepoint-stack-usage.ll:98
@@ +97,3 @@
+; safepoints.  We'll build on this pattern for other tests.
+define i32 addrspace(1)* @test3(i32 addrspace(1)* %a) gc "statepoint-example" {
+; CHECK-LABEL: test3
----------------
Is that different from back_to_back_calls test?

http://reviews.llvm.org/D10402

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list