This is an archive of the discontinued LLVM Phabricator instance.

Simplify idempotent invariant.group.barriers
Needs ReviewPublic

Authored by Prazek on Apr 12 2017, 3:50 PM.

Details

Summary

Barriers are not fully idempotent, conside: :

%b1 = call i8* @llvm.invariant.group.barrier(i8* %p)
call void @foo(i8* %b1)
%b3 = call i8* @llvm.invariant.group.barrier(i8* %b1)

But we can do it safely if the barrier has only one use -
barrier(barrier(x))

Event Timeline

Prazek created this revision.Apr 12 2017, 3:50 PM
Prazek updated this revision to Diff 95094.Apr 13 2017, 3:14 AM

renamed function

Prazek set the repository for this revision to rL LLVM.Apr 16 2017, 1:38 PM
Prazek updated this revision to Diff 96359.Apr 24 2017, 2:36 AM
  • fix test
davide added a subscriber: davide.Apr 24 2017, 7:53 AM

I'm not entirely sure about how this patch is implemented. Maybe you want to capture the fact this is idempotent inside the function? Otherwise using this in other places of the file becomes error prone as every caller has to check that the Instruction has only one use.

Prazek updated this revision to Diff 96401.Apr 24 2017, 8:38 AM

Good point, I was writing it very late.

sanjoy resigned from this revision.Jan 29 2022, 5:34 PM