[PATCH] D81806: [DivergenceAnalysis] mark join of divergent loop exits

Sameer Sahasrabuddhe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 16 07:10:11 PDT 2020


sameerds marked an inline comment as done.
sameerds added inline comments.


================
Comment at: llvm/lib/Analysis/DivergenceAnalysis.cpp:290
+  // disjoint-paths join at JoinBlock
   markBlockJoinDivergent(JoinBlock);
+
----------------
simoll wrote:
> Add a FIXME here that clearly states that this is a quickfix. You could also add the following test (in comments since it will fail) to your test case to document the imprecision caused by this:
> 
>     ; CHECK: bb2:
>     ; CHECK-NOT: DIVERGENT:       %Guard.bb2 = phi i1 [ true, %bb1 ], [ false, %bb0 ]
> 
>     define protected amdgpu_kernel void @test2(i1 %uni) {
>     bb0:
>       %tid.x = call i32 @llvm.amdgcn.workitem.id.x()
>       %i5 = icmp eq i32 %tid.x, -1
>       br i1 %uni, label %bb1, label %bb2
> 
>     bb1:                                              ; preds = %bb2, %bb0
>       %lsr.iv = phi i32 [ 7, %bb0 ], [ %lsr.iv.next, %bb1 ]
>       %lsr.iv.next = add nsw i32 %lsr.iv, -1
>       br i1 %i5, label %bb2, label %bb1
> 
>     bb2:                                              ; preds = %bb2, %bb1
>       %Guard.bb2 = phi i1 [ true, %bb1 ], [ false, %bb0 ]
>       ret void
>     }
> 
>     attributes #0 = { nounwind readnone speculatable }
> 
Not intending to bikeshed, but having a CHECK-NOT here will make it appear as if the test is endorsing this behaviour and things are exactly as they should be. Wouldn't an XFAIL be better? In addition, would filing a bug be a more reliable way to track the FIXME?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81806





More information about the llvm-commits mailing list