[PATCH] D27853: [CodeGenPrep]Restructure promoting Ext to form ExtLoad

Jun Bum Lim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 22 12:15:01 PST 2016


junbuml added inline comments.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:4141
+/// instruction. If it reach to an unpromotable instruction, save the promoted
+/// Ext in \p PromotedExts. When some promotion happened, \p TPT contains the
+/// proper state to revert them.
----------------
qcolombet wrote:
> [...]save the promoted Ext[...]
> You mean save the promoted instructions, right?
I meant the last moved extensions which reach to unpromotable point. I use them to find the last Value feeding to an extension after all possible promotions.  Renamed "PromotedExts" to "LastMovedExts".
 


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:4171
+    if (!TPH) {
+      PromotedExts.push_back(I);
       continue;
----------------
qcolombet wrote:
> "I" is not promoted here, we shouldn't push it.
"I" is an extension, which cannot be moved up any more.  We need to save it to get the Value feeding to the extension after promotions and to determine if the extension is derived from a load.  





================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:4177
+    if (!TLI || !TLI->enableExtLdPromotion() || DisableExtLdPromotion)
+      return false;
+
----------------
qcolombet wrote:
> Shouldn't we keep this check before TypePromotionHelper::getAction?
Yes, we should check "if (!TLI)" before TypePromotionHelper::getAction().


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:4206
       TPT.rollback(LastKnownGood);
+      PromotedExts.push_back(I);
       continue;
----------------
qcolombet wrote:
> "I" is not promoted here.
Looks like the name of "PromotedExts" caused the confusion. I saved an extension in PromotedExts when it reach to an unpromotable/unprofitable point. Added a comment and rename "PromotedExts" to "LastExts".


https://reviews.llvm.org/D27853





More information about the llvm-commits mailing list