https://bugs.llvm.org/show_bug.cgi?id=51178

            Bug ID: 51178
           Summary: support runtime loop unroll with pointer type
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

The loop unroll pass does not support runtime loop unroll with pointer type.
Let's see a example.

declare i32 @foo(i8 *)

define void @test(i8* %s, i64 %a) {
entry:
  %s.addr.a = getelementptr i8, i8* %s, i64 %a
  br label %while.body.us

while.body.us:    
  %s.addr = phi i8* [ %incdec.ptr, %while.body.us ], [ %s, %entry ]
  %incdec.ptr = getelementptr inbounds i8, i8* %s.addr, i64 1
  %incdec.val = load i8, i8* %s.addr, align 1
  %cmp1 = icmp eq i8 %incdec.val, 10
  br i1 %cmp1, label %return.loopexit, label %while.body.us

return.loopexit:    
  ret void
}

As you can see, the iv's instruction is getelementptr and the pass fails to
runtime unroll the loop with the iv. You can reproduce it with below command.

opt  -loop-unroll -unroll-runtime above_ir_code_file.ll -S -o -

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to