File: simplify-region-lite-after-inliner.fir

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (36 lines) | stat: -rw-r--r-- 1,144 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
35
36
// RUN: tco %s | FileCheck %s


// In flang pipeline, the inliner calls createCanonicalizerPass with the region
// simplification disabled. The inliner pass does canonicalization even if
// no inlining happens. After canonicalization, FIR lite region simplification
// must be called to get rid of unreachable regions.
// This code exposes the need to run SimplifyRegionLitePass after the inliner is
// called with FIR pipeline.


func.func @repro(%arg0: i8, %arg1: i8) {
  %c34_i8 = arith.constant 34 : i8
  %c-1_i8 = arith.constant -1 : i8
  %2 = arith.xori %c34_i8, %c-1_i8 : i8
  %3 = arith.andi %arg0, %c34_i8 : i8
  %4 = arith.andi %arg1, %2 : i8
  %5 = arith.ori %3, %4 : i8
  %c34_i8_0 = arith.constant 34 : i8
  %7 = arith.andi %arg0, %c34_i8_0 : i8
  %c-35_i8 = arith.constant -35 : i8
  %9 = arith.andi %arg1, %c-35_i8 : i8
  %10 = arith.ori %7, %9 : i8
  %11 = arith.cmpi ne, %5, %10 : i8
  cf.cond_br %11, ^bb1, ^bb2
^bb1:  // pred: ^bb0
  %13 = func.call @foo() : () -> none
  cf.br ^bb2
^bb2:  // pred: ^bb0, ^bb2
  return
}
func.func private @foo() -> none


// CHECK: define void @repro(i8 %0, i8 %1)
//   CHECK-NEXT  ret void