[PATCH] D104950: [OpaquePtr] Support forward references in textual IR

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 25 16:01:31 PDT 2021


dexonsmith added inline comments.


================
Comment at: llvm/lib/AsmParser/LLParser.cpp:1152-1153
-
-    // Move the forward-reference to the correct spot in the module.
-    M->getGlobalList().splice(M->global_end(), M->getGlobalList(), GV);
-  }
----------------
Seems like we could probably keep this behaviour somehow -- getting the global to the "correct" spot in the module might avoid some of the testcase churn as well. See the example I call out below.


================
Comment at: llvm/test/Transforms/LowerTypeTests/icall-branch-funnel.ll:9-10
 ; CHECK: @g2 = alias i32, getelementptr inbounds ({ i32, [0 x i8], i32 }, { i32, [0 x i8], i32 }* @0, i32 0, i32 2)
+; CHECK: @f1 = alias void (), void ()* @.cfi.jumptable
+; CHECK: @f2 = alias void (), bitcast ([8 x i8]* getelementptr inbounds ([2 x [8 x i8]], [2 x [8 x i8]]* bitcast (void ()* @.cfi.jumptable to [2 x [8 x i8]]*), i64 0, i64 1) to void ()*)
 
----------------
I'm wondering if churn like this can be avoided by keeping some logic to move things back to the "correct" spot.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104950/new/

https://reviews.llvm.org/D104950



More information about the llvm-commits mailing list