File: packetize_cond_inst.ll

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (32 lines) | stat: -rw-r--r-- 954 bytes parent folder | download | duplicates (12)
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
; RUN: llc -mcpu=hexagonv4 -tail-dup-size=1 < %s | FileCheck %s

target datalayout = "e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:32:32-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a0:0-n16:32"
target triple = "hexagon-unknown--elf"

; Make sure we put the two conditionally executed adds in a packet.
; ifcnv_add:
;     {
;       p0 = cmp.gt(r2, r1)
;       if (!p0.new) r0 = add(r2, r1)
;       if (p0.new) r0 = add(r0, #10)
;     }
; CHECK: cmp
; CHECK-NEXT: add
; CHECK-NEXT: add
define i32 @ifcnv_add(i32, i32, i32) nounwind readnone {
  %4 = icmp sgt i32 %2, %1
  br i1 %4, label %5, label %7

; <label>:5                                       ; preds = %3
  %6 = add nsw i32 %0, 10
  br label %9

; <label>:7                                       ; preds = %3
  %8 = add nsw i32 %2, %1
  br label %9

; <label>:9                                       ; preds = %7, %5
  %10 = phi i32 [ %6, %5 ], [ %8, %7 ]
  %11 = add nsw i32 %10, 1
  ret i32 %11
}