File: no_reassoc-codegen.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 (31 lines) | stat: -rw-r--r-- 1,356 bytes parent folder | download | duplicates (14)
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
// Test hlfir.noreassoc code generation to FIR.

// RUN: fir-opt %s -bufferize-hlfir -convert-hlfir-to-fir | FileCheck %s

func.func @no_reassoc_expr(%addr: !fir.ref<!fir.char<1,?>>, %len: index) {
  %0:2 = hlfir.declare %addr typeparams %len {uniq_name = "c"} : (!fir.ref<!fir.char<1,?>>, index) -> (!fir.boxchar<1>, !fir.ref<!fir.char<1,?>>)
  %1 = hlfir.as_expr %0#0 : (!fir.boxchar<1>) -> !hlfir.expr<!fir.char<1,?>>
  %2 = hlfir.no_reassoc %1 : !hlfir.expr<!fir.char<1,?>>
  return
}
// CHECK:  %[[VAL_4:.*]] = fir.alloca !fir.char<1,?>
// CHECK:  %[[VAL_5:.*]] = fir.declare %[[VAL_4]] {{.*}}
// CHECK:  %[[VAL_6:.*]] = fir.emboxchar %[[VAL_5]], %{{.*}}
// CHECK:  fir.no_reassoc %[[VAL_6]] : !fir.boxchar<1>

func.func @no_reassoc_var(%addr: !fir.ref<!fir.char<1,?>>, %len: index) {
  %0:2 = hlfir.declare %addr typeparams %len {uniq_name = "c"} : (!fir.ref<!fir.char<1,?>>, index) -> (!fir.boxchar<1>, !fir.ref<!fir.char<1,?>>)
  %1 = hlfir.no_reassoc %0#0 : !fir.boxchar<1>
  return
}
// CHECK-LABEL:   func.func @no_reassoc_var(
// CHECK:  %[[VAL_3:.*]] = fir.emboxchar
// CHECK:  fir.no_reassoc %[[VAL_3]] : !fir.boxchar<1>

func.func @no_reassoc_value(%arg0 : i32) {
  %0 = hlfir.no_reassoc %arg0 : i32
  return
}
// CHECK-LABEL:   func.func @no_reassoc_value(
// CHECK-SAME:    %[[VAL_0:.*]]: i32) {
// CHECK:  fir.no_reassoc %[[VAL_0]] : i32