File: vector-type.ll

package info (click to toggle)
llvm-toolchain-6.0 1:6.0-1~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 594,652 kB
  • sloc: cpp: 3,044,500; ansic: 595,051; asm: 271,890; python: 128,923; objc: 106,554; sh: 21,854; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,214; cs: 2,027; xml: 686; php: 212; csh: 117
file content (15 lines) | stat: -rw-r--r-- 524 bytes parent folder | download | duplicates (26)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; The code in InstCombiner::FoldSelectOpOp was calling
; Type::getVectorNumElements without checking first if the type was a vector.

; RUN: opt < %s -instcombine -S

define i32 @vselect1(i32 %a.coerce, i32 %b.coerce, i32 %c.coerce) {
entry:
  %0 = bitcast i32 %a.coerce to <2 x i16>
  %1 = bitcast i32 %b.coerce to <2 x i16>
  %2 = bitcast i32 %c.coerce to <2 x i16>
  %cmp = icmp sge <2 x i16> %2, zeroinitializer
  %or = select <2 x i1> %cmp, <2 x i16> %0, <2 x i16> %1
  %3 = bitcast <2 x i16> %or to i32
  ret i32 %3
}