Skip to content

Commit 0f34b65

Browse files
authored
InstCombine: Remove a check for pointer bitcasts (#128491)
1 parent aca8a5c commit 0f34b65

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3656,20 +3656,15 @@ Instruction *InstCombinerImpl::visitUnconditionalBranchInst(BranchInst &BI) {
36563656
assert(BI.isUnconditional() && "Only for unconditional branches.");
36573657

36583658
// If this store is the second-to-last instruction in the basic block
3659-
// (excluding debug info and bitcasts of pointers) and if the block ends with
3659+
// (excluding debug info) and if the block ends with
36603660
// an unconditional branch, try to move the store to the successor block.
36613661

36623662
auto GetLastSinkableStore = [](BasicBlock::iterator BBI) {
3663-
auto IsNoopInstrForStoreMerging = [](BasicBlock::iterator BBI) {
3664-
return BBI->isDebugOrPseudoInst() ||
3665-
(isa<BitCastInst>(BBI) && BBI->getType()->isPointerTy());
3666-
};
3667-
36683663
BasicBlock::iterator FirstInstr = BBI->getParent()->begin();
36693664
do {
36703665
if (BBI != FirstInstr)
36713666
--BBI;
3672-
} while (BBI != FirstInstr && IsNoopInstrForStoreMerging(BBI));
3667+
} while (BBI != FirstInstr && BBI->isDebugOrPseudoInst());
36733668

36743669
return dyn_cast<StoreInst>(BBI);
36753670
};

0 commit comments

Comments
 (0)