aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/Transforms/Reassociate/or-disjoint.ll
blob: b060b94e01d69d89bbc871a3bbb1a367e24f0572 (plain)
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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=reassociate -S %s | FileCheck %s


define i16 @or_disjoint_both(i16 %a, i16 %b) {
; CHECK-LABEL: @or_disjoint_both(
; CHECK-NEXT:    [[OR_1:%.*]] = or disjoint i16 [[A:%.*]], 1
; CHECK-NEXT:    [[OR_2:%.*]] = or disjoint i16 [[OR_1]], [[B:%.*]]
; CHECK-NEXT:    ret i16 [[OR_2]]
;
  %or.1 = or disjoint i16 %b, %a
  %or.2 = or disjoint i16 %or.1, 1
  ret i16 %or.2
}

define i16 @or_disjoint_first(i16 %a, i16 %b) {
; CHECK-LABEL: @or_disjoint_first(
; CHECK-NEXT:    [[OR_1:%.*]] = or i16 [[A:%.*]], 1
; CHECK-NEXT:    [[OR_2:%.*]] = or i16 [[OR_1]], [[B:%.*]]
; CHECK-NEXT:    ret i16 [[OR_2]]
;
  %or.1 = or i16 %b, %a
  %or.2 = or disjoint i16 %or.1, 1
  ret i16 %or.2
}

define i16 @or_disjoint_last(i16 %a, i16 %b) {
; CHECK-LABEL: @or_disjoint_last(
; CHECK-NEXT:    [[OR_1:%.*]] = or i16 [[A:%.*]], 1
; CHECK-NEXT:    [[OR_2:%.*]] = or i16 [[OR_1]], [[B:%.*]]
; CHECK-NEXT:    ret i16 [[OR_2]]
;
  %or.1 = or disjoint i16 %b, %a
  %or.2 = or i16 %or.1, 1
  ret i16 %or.2
}