[llvm-dev] Questions about jump threading optimization and what we can do

Johannes Doerfert via llvm-dev llvm-dev at lists.llvm.org
Sun Feb 2 09:14:48 PST 2020


On 01/30, Karl Rehm via llvm-dev wrote:
> Since the bug report here: https://bugs.llvm.org/show_bug.cgi?id=44679 I've
> been thinking about cases like it, such as: https://godbolt.org/z/Fwq8mn
> 
> I wonder what we can do about this in a general sense. As far as I can
> tell, the jump threading algorithm is *really* conservative, which is one
> reason this isn't working as well as I'd hope; however, we don't want to
> produce irreducible control flow that the other passes would work less
> effectively on. Thoughts?

I'm confused. In your godbold link you run it with O0 which disables
almost all transformations. If we take the IR, remove the optnone
attribute, run mem2reg and jump-threading we get what I think is
reasonable:
  https://godbolt.org/z/u3fcTZ

Please correct me if I misunderstand anything here.

Cheers,
  Johannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200202/0f622ce6/attachment.sig>


More information about the llvm-dev mailing list