[llvm] [LSR] Deduplicate cast instructions across ICmpZero fixups (PR #201970)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 8 06:03:51 PDT 2026
nikic wrote:
> Nevertheless getOrCreateCast also serves the RewriteForPHI and Rewrite call sites where casts can be genuinely necessary (like trunc when LSR widens a narrow IV). So this patch addresses the immediate duplication in what LSR currently produces, while the deeper change of avoiding unnecessary inttoptr can come as a separate improvement.
The question here would be whether reusing casts in those cases is actually practically useful. This patch doesn't affect any of our existing test coverage, so I'd suspect the answer is "no". If it *is* (end-to-end) useful, we should have tests for that.
https://github.com/llvm/llvm-project/pull/201970
More information about the llvm-commits
mailing list