[IR] Clean up dead instructions after simplifying a conditional branch
Change BasicBlock::removePredecessor to optionally return a vector of instructions which might be dead. Use this in ConstantFoldTerminator to delete them if they are dead. Reapply with a bug fix: don't drop the "!KeepOneInputPHIs" argument when removePredecessor calls PHINode::removeIncomingValue. Differential Revision: https://reviews.llvm.org/D80206
Showing
- llvm/include/llvm/IR/BasicBlock.h 8 additions, 1 deletionllvm/include/llvm/IR/BasicBlock.h
- llvm/lib/IR/BasicBlock.cpp 12 additions, 3 deletionsllvm/lib/IR/BasicBlock.cpp
- llvm/lib/Transforms/Utils/Local.cpp 7 additions, 4 deletionsllvm/lib/Transforms/Utils/Local.cpp
- llvm/test/Transforms/PGOProfile/chr.ll 61 additions, 65 deletionsllvm/test/Transforms/PGOProfile/chr.ll
Loading
Please register or sign in to comment