[PATCH] D140166: [IR] return nullptr in Instruction::getInsertionPointAfterDef for CallBrInst

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 10:02:54 PST 2022


StephenTozer added a comment.

Not very familiar with this area, but it looks as though currently `InstCombinerImpl::transformConstExprCastCall` in `InstCombineCalls.cpp` will need updating as well. Specifically it may transform a `CallBr` instruction and insert a Cast for the return, for which it calls `NewCall->getInsertionPointAfterDef()` and asserts that the return is non-null. Not sure what the solution would be, but it might require dropping support for `CallBr` in `transformConstExprCastCall` if the return type is changed: there's already a block in there that bails out of transforming invoke or callbr instructions if they are used in a PHI node, since there's no place to insert the Cast in that case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140166/new/

https://reviews.llvm.org/D140166



More information about the llvm-commits mailing list