[PATCH] D24780: [RS4GC] Refactor code for Rematerializing in presence of phi. NFC

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 13:28:15 PDT 2016


reames added inline comments.

================
Comment at: lib/Transforms/Scalar/RewriteStatepointsForGC.cpp:1818
@@ -1818,3 +1817,3 @@
   SmallVectorImpl<Instruction*> &ChainToBase,
   Value *CurrentValue, Value *BaseValue) {
 
----------------
Not quite what I had in mind, but this works.  I'd expected you to remove the BaseValue parameter at the same time.  I'd expected the return value to basically be the first instruction we couldn't prove was part of a rematerializable chain.  The caller would then look to see if that was something it knew how to handle.

================
Comment at: lib/Transforms/Scalar/RewriteStatepointsForGC.cpp:1913
@@ +1912,3 @@
+    if (RootNode != Info.PointerToBase[LiveValue]) {
+      // Check for same values, when both BaseValue and RootNode are phi nodes.
+      // PHI nodes that have the same incoming values, and belonging to the same
----------------
The nesting here gets confusing.  I'd suggest extracting a isEquivelentPHI helper.  This might already exist in fact.


https://reviews.llvm.org/D24780





More information about the llvm-commits mailing list