[PATCH] D142551: [InstCombine] Teach isDeadPHICycle to look through multiple uses
Luke Lau via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 26 15:00:37 PST 2023
luke marked an inline comment as done.
luke added a comment.
In D142551#4083916 <https://reviews.llvm.org/D142551#4083916>, @nikic wrote:
> Huh, this made compile-time impact even worse: https://llvm-compile-time-tracker.com/compare.php?from=051bcd4f310bbf97781b9ccc95ae2754224a75b2&to=bd36ced96eabd9b4e028778d058dcb56bb6d86ba&stat=instructions
>
> Apparently `wouldInstructionBeTriviallyDead` is that expensive. Using `!isa<PHINode>(I) && !isa<BinaryOperator>(I) && !isa<GetElementPtrInst>(I))` in keeping with the existing code brings it down to this: http://llvm-compile-time-tracker.com/compare.php?from=051bcd4f310bbf97781b9ccc95ae2754224a75b2&to=abae5ca4dc70078006e4e26095215a732be1f330&stat=instructions%3Au
>
> This is still not as free as I had hoped :/
We could also try limiting it to phi nodes with one use. There’s a test case in there for a phi node with 2 uses, but the actual bug that this aims to fix only has single use phi nodes.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142551/new/
https://reviews.llvm.org/D142551
More information about the llvm-commits
mailing list