Page MenuHomePhabricator

[LoopRotate] Use llvm.experimental.noalias.scope.decl for duplicating noalias metadata as needed
Needs ReviewPublic

Authored by jeroen.dobbelaere on Fri, Jan 8, 7:00 AM.

Details

Reviewers
nikic
jdoerfert
Summary

Similar to D92887, LoopRotation also needs duplicate the noalias scopes when rotating a @llvm.experimental.noalias.scope.decl across a block boundary.
This is based on the version from the Full Restrict paches (D68511).

The problem it fixes also showed up in Transforms/Coroutines/ex5.ll after D93040

Diff Detail

Event Timeline

jeroen.dobbelaere requested review of this revision.Fri, Jan 8, 7:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptFri, Jan 8, 7:00 AM
nikic added a comment.Fri, Jan 8, 1:12 PM

This is tricker than the unroll case, but also looks sound to me.

llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
479

// if D is part of OrigHeader

480

// if D and U are part of OrigHeader

496

llvm:: probably not needed.

503

Is there any reason to insert a new one before NAD and then move NAD, rather then just inserting the new one at NewHeaderInsertionPoint?

llvm/test/Transforms/LoopRotate/noalias.ll
45

In line with the usual convention, this should be at the start of the @test_02 function.

  • Update according to comments
jeroen.dobbelaere marked 3 inline comments as done.
  • insert clone directly at the right location
jeroen.dobbelaere marked 2 inline comments as done.Sat, Jan 9, 10:24 AM
jeroen.dobbelaere added inline comments.
llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
503

hmm. Probably not.. let me change this.

jeroen.dobbelaere marked an inline comment as done.Tue, Jan 19, 2:09 PM
jeroen.dobbelaere added inline comments.
llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
408

I'll remove the unnecessary braces in a next version.