Ehsan Amiri | a538b0f | 2016-08-03 18:17:35 +0000 | [diff] [blame] | 1 | ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 |
Rafael Espindola | c569608 | 2013-12-16 21:24:00 +0000 | [diff] [blame] | 2 | |
| 3 | define void @test1(i1 %x, i8 %x2, i8* %x3, i64 %x4) { |
| 4 | entry: |
| 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 | |
| 11 | if.then: |
| 12 | ret void |
| 13 | |
| 14 | if.end: |
| 15 | store i8 %bf.set, i8* %x3, align 4 |
| 16 | ret void |
| 17 | } |
QingShan Zhang | cae9425 | 2018-09-20 03:09:15 +0000 | [diff] [blame] | 18 | |
| 19 | ; A BUILD_VECTOR of 1 element caused a crash in combineBVOfConsecutiveLoads() |
| 20 | ; Test that this is no longer the case |
| 21 | define signext i32 @test2() { |
| 22 | entry: |
| 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 | } |