[PATCH] D75505: [InstCombine] Enhance cast-of-load->load-of-bitcast fold to handle multiple identical casts

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 10 06:24:18 PDT 2020


spatel added a comment.

In D75505#1914300 <https://reviews.llvm.org/D75505#1914300>, @lebedev.ri wrote:

> @spatel could you please specify if you don't want this in instcombine


If the consensus is that this is good, I'm not going to block it, but...

1. Loads are usually between 10-25% of all instructions, so walking the users of every load has potential to substantially increase compile-time.
2. According to the summary text, we don't have practical evidence of the benefit.
3. We agree that we could do hoisting/sinking more generally and more efficiently in a stand-alone pass.

So I'd prefer an alternative route or at least some preliminary perf data if that's feasible.

I was just rummaging around in CGP and noticed that it has CodeGenPrepare::tryToSinkFreeOperands(). Maybe we could move that up as a utility function and extend it to try hoisting too?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75505





More information about the llvm-commits mailing list