[PATCH] D26947: [NVPTX] Structurize the NVPTX CFG.

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 17:16:05 PST 2016


majnemer added a comment.

In https://reviews.llvm.org/D26947#602034, @jlebar wrote:

> In https://reviews.llvm.org/D26947#602031, @majnemer wrote:
>
> > You can do the `setRequiresStructuredCFG(true);` independently of enabling the structurizer.
>
>
> I tried and it didn't make any difference in my testcases.
>
> If we have a test where it does make a difference, I am absolutely onboard with turning it on without getting the structurizer.


Here is one:

> $ cat t.ll

  define void @f(i32 %x, i32 %n, i32* %p) {
  entry:
    %tmp29 = lshr i32 %x, %n
    %tmp3 = and i32 %tmp29, 1
    %tmp4 = icmp eq i32 %tmp3, 0
    br i1 %tmp4, label %bb, label %UnifiedReturnBlock
  
  bb:
    store volatile i32 0, i32* %p
    ret void
  
  UnifiedReturnBlock:
    ret void
  }

> $ diff <(~/llvm/Debug+Asserts/bin/llc bt.ll -o -  -mtriple nvptx64 -enable-tail-merge=true) <(~/llvm/Debug+Asserts/bin/llc bt.ll -o -  -mtriple nvptx64 -enable-tail-merge=false)
> 31a32
>  > 	ret;


https://reviews.llvm.org/D26947





More information about the llvm-commits mailing list