[PATCH] D23896: [InstCombine] Try to resubmit the combine of A->B->A BitCast and fix for pr27996

Evgeny Stupachenko via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 15:02:56 PDT 2016


evstupac added a comment.

> Yes, optimizeBitCastFromPhi only generates new BitCast for load/store instructions,


In the code I see Constants as well.
It would be nice to have more comments at return explaining why this is a fix point.


================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:1860
@@ +1859,3 @@
+        Builder->SetInsertPoint(OldPN->getIncomingBlock(j)->getTerminator());
+        NewV = Builder->CreateBitCast(LI, DestTy);
+        Worklist.Add(LI);
----------------
New BitCast instruction is created if one of OldPN operands is Load, right?

L = Load
X = Phi [L, ...]

To:

L = Load
NewL = BitCast (L)
NewX = Phi [NewL, ...]

The new BitCast instruction user is PHI, not Load or Store.
Will it pass your fix point?



https://reviews.llvm.org/D23896





More information about the llvm-commits mailing list