This is an archive of the discontinued LLVM Phabricator instance.

[JumpThreading] Clone noalias.scope.decl when threading blocks
ClosedPublic

Authored by nikic on Feb 21 2021, 7:47 AM.

Details

Summary

When cloning instructions during jump threading, also clone and adapt any declared scopes. This is primarily important when threading loop exits, because we'll end up with two dominating scope declarations in that case (at least after additional loop rotation). This addresses a loose thread from https://reviews.llvm.org/rG2556b413a7b8#975012.

Diff Detail

Event Timeline

nikic created this revision.Feb 21 2021, 7:47 AM
nikic requested review of this revision.Feb 21 2021, 7:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2021, 7:47 AM

LGTM.

Thanks for taking care of this !

This revision is now accepted and ready to land.Feb 22 2021, 12:50 AM

I am now tempted to think that any same-scope usage of llvm.experimental.noalias.scope should be avoided..
For something like loop-unswitch, it is not 'wrong' conceptually to have the same scope, but always cloning the scope
should be safer, with, in most cases, no impact on code quality.

This revision was landed with ongoing or failed builds.Feb 22 2021, 9:35 AM
This revision was automatically updated to reflect the committed changes.