dtcxzyw wrote:

Reproducer: https://alive2.llvm.org/ce/z/GPj5eT
```
; bin/opt -passes=move-auto-init test.ll -S

define fastcc i8 @func_162() {
lbl_653:
  %l_580 = alloca i32, align 4
  store i32 1, ptr %l_580, align 4
  br i1 true, label %lbl_629, label %if.then

if.then:                                          ; preds = %lbl_653
  br label %if.end

lbl_629:                                          ; preds = %lor.end230, 
%lbl_653
  br label %if.end

if.end:                                           ; preds = %lbl_629, %if.then
  %0 = load i32, ptr %l_580, align 4
  %tobool223.not = icmp eq i32 %0, 0
  br i1 %tobool223.not, label %lor.rhs224, label %lor.end230

lor.rhs224:                                       ; preds = %if.end
  store i8 0, ptr null, align 1
  br label %lor.end230

lor.end230:                                       ; preds = %lor.rhs224, %if.end
  br i1 true, label %for.inc456.1, label %lbl_629

for.inc456.1:                                     ; preds = %lor.end230
  ret i8 0
}
```
Output:
```
define fastcc i8 @func_162() {
lbl_653:
  %l_580 = alloca i32, align 4
  br i1 true, label %lbl_629, label %if.then

if.then:                                          ; preds = %lbl_653
  store i32 1, ptr %l_580, align 4
  br label %if.end

lbl_629:                                          ; preds = %lor.end230, 
%lbl_653
  br label %if.end

if.end:                                           ; preds = %lbl_629, %if.then
  %0 = load i32, ptr %l_580, align 4
  %tobool223.not = icmp eq i32 %0, 0
  br i1 %tobool223.not, label %lor.rhs224, label %lor.end230

lor.rhs224:                                       ; preds = %if.end
  store i8 0, ptr null, align 1
  br label %lor.end230

lor.end230:                                       ; preds = %lor.rhs224, %if.end
  br i1 true, label %for.inc456.1, label %lbl_629

for.inc456.1:                                     ; preds = %lor.end230
  ret i8 0
}
```

https://github.com/llvm/llvm-project/pull/164882
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to