mirror of
https://github.com/RPCS3/llvm.git
synced 2026-01-31 01:25:19 +01:00
Summary: When recording uses we need to rewrite after cloning a loop we need to check if the use is not dominated by the original def. The initial assumption was that the cloned basic block will introduce a new path and thus the original def will only dominate the use if they are in the same BB, but as the reproducer from PR37745 shows it's not always the case. This fixes PR37745. Reviewers: haicheng, Ka-Ka Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D48111 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335675 91177308-0d34-0410-b5e6-96231b3b80d8
20 lines
348 B
LLVM
20 lines
348 B
LLVM
; RUN: opt -jump-threading -verify-each -S -mtriple=x86_64-- -o - %s
|
|
|
|
define void @foo() {
|
|
entry:
|
|
br i1 false, label %A, label %B
|
|
|
|
A:
|
|
%x = phi i32 [ undef, %entry ], [ %z, %B ]
|
|
br label %B
|
|
|
|
B:
|
|
%y = phi i32 [ undef, %entry ], [ %x, %A ]
|
|
%z = add i32 %y, 1
|
|
%cmp = icmp ne i32 %z, 0
|
|
br i1 %cmp, label %exit, label %A
|
|
|
|
exit:
|
|
ret void
|
|
}
|