[llvm-dev] ConstantFoldTerminator doesn't delete trivially dead phi inputs (original) (raw)
Jay Foad via llvm-dev llvm-dev at lists.llvm.org
Fri May 15 03:57:35 PDT 2020
- Previous message: [llvm-dev] Issue with the function hash used as PGO index
- Next message: [llvm-dev] ConstantFoldTerminator doesn't delete trivially dead phi inputs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm looking into some missed optimizations where CodeGenPrepare seems to leave trivially dead instructions lying around.
This happens because CodeGenPrepare::runOnFunction calls ConstantFoldTerminator which folds a "br i1 false" into an unconditional branch and calls BasicBlock::removePredecessor which calls PHINode::removeIncomingValue. Each incoming value that is removed from a phi node might be dead now, but nothing deletes them.
Is there any way this could be improved? Could PHINode::removeIncomingValue call RecursivelyDeleteTriviallyDeadInstructions on the value it removes, or is that a layering violation? Any other ideas?
Thanks, Jay.
- Previous message: [llvm-dev] Issue with the function hash used as PGO index
- Next message: [llvm-dev] ConstantFoldTerminator doesn't delete trivially dead phi inputs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]