mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:43:36 +01:00
7bf3404c76
When replacing a conditional branch by an unconditional one because the targets are identical, transfer the metadata to the new branch instruction. Reviewed By: lebedev.ri Differential Revision: https://reviews.llvm.org/D101226
20 lines
459 B
LLVM
20 lines
459 B
LLVM
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
|
;
|
|
; Ensure that the loop metadata is preserved when converting the
|
|
; conditional branch to an unconditional.
|
|
|
|
define void @commondest_loopid(i1 %T) {
|
|
; CHECK-LABEL: @commondest_loopid(
|
|
; CHECK: !llvm.loop !0
|
|
; CHECK: !0 = distinct !{!0, !1}
|
|
; CHECK: !1 = !{!"loopprop"}
|
|
entry:
|
|
br label %loop
|
|
|
|
loop:
|
|
br i1 %T, label %loop, label %loop, !llvm.loop !0
|
|
}
|
|
|
|
!0 = distinct !{!0, !1}
|
|
!1 = !{!"loopprop"}
|