arsenm added a comment. I do think it's cleaner/more canonical IR to cluster these at the top of the block, but I don't understand this comment:
> otherwise, inliner's attempt to move static allocas from callee to caller > will fail, The inliner successfully moves allocas to the caller's entry block, even with addrspacecasts interspersed. ================ Comment at: clang/lib/CodeGen/CGExpr.cpp:102-106 + auto *EBB = AllocaInsertPt->getParent(); + auto Iter = AllocaInsertPt->getIterator(); + if (Iter != EBB->end()) + ++Iter; + Builder.SetInsertPoint(EBB, Iter); ---------------- Where are the addrspacecasts inserted? Could you just adjust where those are inserted instead? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110257/new/ https://reviews.llvm.org/D110257 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits