blob: 9e2e85c365bc7b08e8894eaae234abd37520e5ef [file] [log] [blame]
Ehsan Amiria538b0f2016-08-03 18:17:35 +00001; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7
Rafael Espindolac5696082013-12-16 21:24:00 +00002
3define void @test1(i1 %x, i8 %x2, i8* %x3, i64 %x4) {
4entry:
5 %tmp3 = and i64 %x4, 16
6 %bf.shl = trunc i64 %tmp3 to i8
7 %bf.clear = and i8 %x2, -17
8 %bf.set = or i8 %bf.shl, %bf.clear
9 br i1 %x, label %if.then, label %if.end
10
11if.then:
12 ret void
13
14if.end:
15 store i8 %bf.set, i8* %x3, align 4
16 ret void
17}
QingShan Zhangcae94252018-09-20 03:09:15 +000018
19; A BUILD_VECTOR of 1 element caused a crash in combineBVOfConsecutiveLoads()
20; Test that this is no longer the case
21define signext i32 @test2() {
22entry:
23 %retval = alloca i32, align 4
24 %__a = alloca i128, align 16
25 %b = alloca i64, align 8
26 store i32 0, i32* %retval, align 4
27 %0 = load i128, i128* %__a, align 16
28 %splat.splatinsert = insertelement <1 x i128> undef, i128 %0, i32 0
29 %splat.splat = shufflevector <1 x i128> %splat.splatinsert, <1 x i128> undef, <1 x i32> zeroinitializer
30 %1 = bitcast <1 x i128> %splat.splat to <2 x i64>
31 %2 = extractelement <2 x i64> %1, i32 0
32 store i64 %2, i64* %b, align 8
33 ret i32 0
34}