[InstSimplify] Add additional test for PR49839 (NFC)

This is a variant involving an aggregate constant, which was not
covered by the previous patch.
This commit is contained in:
Nikita Popov 2022-06-13 12:22:56 +02:00
parent b4f2f7bebd
commit c232a15df4
1 changed files with 20 additions and 0 deletions

View File

@ -195,3 +195,23 @@ join:
%phi = phi i64 [ srem (i64 1, i64 ptrtoint (ptr @g to i64)), %if ], [ srem (i64 1, i64 ptrtoint (ptr @g to i64)) , %entry ] %phi = phi i64 [ srem (i64 1, i64 ptrtoint (ptr @g to i64)), %if ], [ srem (i64 1, i64 ptrtoint (ptr @g to i64)) , %entry ]
ret i64 %phi ret i64 %phi
} }
define <1 x i64> @pr49839_vector(i1 %c) {
; CHECK-LABEL: @pr49839_vector(
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 [[C:%.*]], label [[IF:%.*]], label [[JOIN:%.*]]
; CHECK: if:
; CHECK-NEXT: br label [[JOIN]]
; CHECK: join:
; CHECK-NEXT: ret <1 x i64> <i64 srem (i64 1, i64 ptrtoint (ptr @g to i64))>
;
entry:
br i1 %c, label %if, label %join
if:
br label %join
join:
%phi = phi <1 x i64> [ poison, %if ], [ <i64 srem (i64 1, i64 ptrtoint (ptr @g to i64))>, %entry ]
ret <1 x i64> %phi
}