mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-05 10:17:36 +00:00
4aa599e067
In one case, we were handling out of bounds, but not undef indices. In the other, we were handling undef (with the comment making the analogy to out of bounds), but not out of bounds. Be consistent and treat both undef and constant out of bounds indices as producing undefined results. As a side effect, this also protects instcombine from having to handle large constant indices as we always simplify first. llvm-svn: 321575
32 lines
766 B
LLVM
32 lines
766 B
LLVM
; RUN: opt -S -instsimplify < %s | FileCheck %s
|
|
|
|
define <4 x i32> @test1(<4 x i32> %A) {
|
|
%I = insertelement <4 x i32> %A, i32 5, i64 4294967296
|
|
; CHECK: ret <4 x i32> undef
|
|
ret <4 x i32> %I
|
|
}
|
|
|
|
define <4 x i32> @test2(<4 x i32> %A) {
|
|
%I = insertelement <4 x i32> %A, i32 5, i64 4
|
|
; CHECK: ret <4 x i32> undef
|
|
ret <4 x i32> %I
|
|
}
|
|
|
|
define <4 x i32> @test3(<4 x i32> %A) {
|
|
%I = insertelement <4 x i32> %A, i32 5, i64 1
|
|
; CHECK: ret <4 x i32> %I
|
|
ret <4 x i32> %I
|
|
}
|
|
|
|
define <4 x i32> @test4(<4 x i32> %A) {
|
|
%I = insertelement <4 x i32> %A, i32 5, i128 100
|
|
; CHECK: ret <4 x i32> undef
|
|
ret <4 x i32> %I
|
|
}
|
|
|
|
define <4 x i32> @test5(<4 x i32> %A) {
|
|
%I = insertelement <4 x i32> %A, i32 5, i64 undef
|
|
; CHECK: ret <4 x i32> undef
|
|
ret <4 x i32> %I
|
|
}
|