File: trunc_unreachable_bb.ll

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-6~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,418,812 kB
  • sloc: cpp: 5,290,827; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,900; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,892; xml: 953; cs: 573; fortran: 539
file content (48 lines) | stat: -rw-r--r-- 1,542 bytes parent folder | download | duplicates (10)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -aggressive-instcombine -S | FileCheck %s
; RUN: opt < %s -passes=aggressive-instcombine -S | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"

; Aggressive Instcombine should be able ignore unreachable basic block.

define void @func_20() {
; CHECK-LABEL: @func_20(
; CHECK-NEXT:  for.body94:
; CHECK-NEXT:    unreachable
; CHECK:       for.cond641:
; CHECK-NEXT:    [[OR722:%.*]] = or i32 [[OR722]], undef
; CHECK-NEXT:    [[OR723:%.*]] = or i32 [[OR722]], 1
; CHECK-NEXT:    [[CONV724:%.*]] = trunc i32 [[OR723]] to i16
; CHECK-NEXT:    br label [[FOR_COND641:%.*]]
;
for.body94:
  unreachable

for.cond641:
  %or722 = or i32 %or722, undef
  %or723 = or i32 %or722, 1
  %conv724 = trunc i32 %or723 to i16
  br label %for.cond641
}

define void @func_21() {
; CHECK-LABEL: @func_21(
; CHECK-NEXT:  for.body94:
; CHECK-NEXT:    unreachable
; CHECK:       for.cond641:
; CHECK-NEXT:    [[OR722:%.*]] = or i32 [[A:%.*]], undef
; CHECK-NEXT:    [[A]] = or i32 [[OR722]], undef
; CHECK-NEXT:    [[OR723:%.*]] = or i32 [[OR722]], 1
; CHECK-NEXT:    [[CONV724:%.*]] = trunc i32 [[OR723]] to i16
; CHECK-NEXT:    br label [[FOR_COND641:%.*]]
;
for.body94:
  unreachable

for.cond641:
  %or722 = or i32 %a, undef
  %a = or i32 %or722, undef
  %or723 = or i32 %or722, 1
  %conv724 = trunc i32 %or723 to i16
  br label %for.cond641
}