[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
       
    Fri Sep 23 16:52:37 PDT 2016
    
    
  
evstupac added inline comments.
================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:1768
@@ +1767,3 @@
+  for (User *U : CI.users()) {
+    if (!isa<StoreInst>(U))
+      return false;
----------------
Ok.
You are generating BitCast only for 1 store operand:
SI->setOperand(0, Builder->CreateBitCast(NewPNodes[PN], SrcTy));
Here you are exiting if BitCast goes to one of store operand (0 or 1). What is the reason?
================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:1879
@@ +1878,3 @@
+  }
+
+  return replaceInstUsesWith(CI, NewPNodes[PN]);
----------------
Could you please insert an assert on newly Created BitCast (to be sure we'll not hit it on next iteration)?
https://reviews.llvm.org/D23896
    
    
More information about the llvm-commits
mailing list