File: crash.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (34 lines) | stat: -rw-r--r-- 1,035 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7

define void @test1(i1 %x, i8 %x2, i8* %x3, i64 %x4) {
entry:
  %tmp3 = and i64 %x4, 16
  %bf.shl = trunc i64 %tmp3 to i8
  %bf.clear = and i8 %x2, -17
  %bf.set = or i8 %bf.shl, %bf.clear
  br i1 %x, label %if.then, label %if.end

if.then:
  ret void

if.end:
  store i8 %bf.set, i8* %x3, align 4
  ret void
}

; A BUILD_VECTOR of 1 element caused a crash in combineBVOfConsecutiveLoads()
; Test that this is no longer the case
define signext i32 @test2() {
entry:
  %retval = alloca i32, align 4
  %__a = alloca i128, align 16
  %b = alloca i64, align 8
  store i32 0, i32* %retval, align 4
  %0 = load i128, i128* %__a, align 16
  %splat.splatinsert = insertelement <1 x i128> undef, i128 %0, i32 0
  %splat.splat = shufflevector <1 x i128> %splat.splatinsert, <1 x i128> undef, <1 x i32> zeroinitializer
  %1 = bitcast <1 x i128> %splat.splat to <2 x i64>
  %2 = extractelement <2 x i64> %1, i32 0
  store i64 %2, i64* %b, align 8
  ret i32 0
}