[PATCH] Reverse order in which base and derived pointers are	lowered in the statepoint StackMap section
    Philip Reames 
    listmail at philipreames.com
       
    Wed May  6 11:30:22 PDT 2015
    
    
  
I generally approve of the intent of the change.  Comments inline.
p.s. Once we LGTM this, please hold off on submission until at least Monday of next week.  I want interested parties to have a chance to see this.
REPOSITORY
  rL LLVM
================
Comment at: lib/CodeGen/SelectionDAG/StatepointLowering.cpp:482
@@ -481,3 +481,3 @@
   for (unsigned i = 0; i < Bases.size() * 2; ++i) {
-    // Even elements will contain base, odd elements - derived ptr
-    const Value *V = i % 2 ? Bases[i / 2] : Ptrs[i / 2];
+    // Even elements will contain base, odd elements - derived ptr,
+    // but it does not matter in which order we reserve slots for this values
----------------
I would prefer to see this loop structured analogously to the other one you changed.  As this change illustrates, the modulo trick here is unnecessarily complex and subject to mistakes.  
================
Comment at: test/CodeGen/X86/statepoint-stackmap-format.ll:11
@@ -10,2 +10,3 @@
 
-define i1 @test(i32 addrspace(1)* %ptr) gc "statepoint-example" {
+define i1 @test(i32 addrspace(1)* %ptr_base, i32 addrspace(1)* %ptr_derived)
+  gc "statepoint-example" {
----------------
This is an invalid test.  An argument can not be a derived pointer.  This is currently utterly unsupported.  
You should create ptr_derived by bitcasting or gepping from the existing argument.
http://reviews.llvm.org/D9527
EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
    
    
More information about the llvm-commits
mailing list