Home | History | Annotate | Download | only in AArch64
      1 # RUN: llc -run-pass=aarch64-ldst-opt -o - -mtriple=aarch64-- %s | FileCheck %s
      2 # Check that we merge the MIFlags from both the instructions in the final
      3 # instruction.
      4 ---
      5 name:            case11
      6 # CHECK-LABEL: name: case11
      7 body:             |
      8   bb.0:
      9     frame-setup STRWui $w1, $x0, 1 :: (store 4)
     10     $w1 = frame-destroy LDRWui $x0, 1 :: (load 4)
     11 
     12   ; CHECK: frame-setup STRWui
     13   ; CHECK-NOT: frame-setup
     14   ; CHECK-NEXT: frame-destroy ORRWrs
     15   ; No merging happening here, make sure we keep the flags of the previous
     16   ; instruction.
     17     RET_ReallyLR
     18 
     19 ...
     20 ---
     21 name:            case12
     22 # CHECK-LABEL: name: case12
     23 body:             |
     24   bb.0:
     25     frame-setup STRWui $w1, $x0, 1 :: (store 4)
     26     $w2 = frame-destroy LDRHHui $x0, 2 :: (load 2)
     27 
     28   ; CHECK: frame-setup STRWui
     29   ; CHECK-NOT: frame-setup
     30   ; CHECK-NEXT: frame-destroy ANDWri
     31   ; No merging happening here, make sure we keep the flags of the previous
     32   ; instruction.
     33     RET_ReallyLR
     34 
     35 ...
     36 ---
     37 name:            case13
     38 # CHECK-LABEL: name: case13
     39 body:             |
     40   bb.0:
     41     frame-setup STRWui $w1, $x0, 1 :: (store 4)
     42     $w2 = frame-destroy LDRHHui $x0, 3 :: (load 2)
     43 
     44   ; CHECK: frame-setup STRWui
     45   ; CHECK-NOT: frame-setup
     46   ; CHECK-NEXT: frame-destroy UBFMWri
     47   ; No merging happening here, make sure we keep the flags of the previous
     48   ; instruction.
     49     RET_ReallyLR
     50 
     51 ...
     52 ---
     53 name:            case2
     54 # CHECK-LABEL: name: case2
     55 body:             |
     56   bb.0:
     57     frame-setup STRHHui $wzr, $x0, 0 :: (store 4)
     58     frame-destroy STRHHui $wzr, $x0, 1 :: (store 4)
     59 
     60   ; CHECK: frame-setup frame-destroy STRWui
     61     RET_ReallyLR
     62 
     63 ...
     64 ---
     65 name:            case3
     66 # CHECK-LABEL: name: case3
     67 body:             |
     68   bb.0:
     69 
     70     $x0 = frame-setup LDRXui $x2, 0 :: (load 8)
     71     $x1 = frame-destroy LDRXui $x2, 1 :: (load 8)
     72 
     73   ; CHECK: frame-setup frame-destroy LDPXi
     74     RET_ReallyLR
     75 ...
     76 ---
     77 name:            case4
     78 # CHECK-LABEL: name: case4
     79 body:             |
     80   bb.0:
     81     $x26, $x25 = frame-setup LDPXi $sp, 0
     82     $sp = frame-destroy ADDXri $sp, 64, 0
     83 
     84   ; CHECK: = frame-setup frame-destroy LDPXpost
     85     RET_ReallyLR
     86 
     87 ...
     88 ---
     89 name:            case41
     90 # CHECK-LABEL: name: case41
     91 body:             |
     92   bb.0:
     93     $x26 = frame-setup LDRXui $sp, 0
     94     $sp = frame-destroy ADDXri $sp, 64, 0
     95 
     96   ; CHECK: = frame-setup frame-destroy LDRXpost
     97     RET_ReallyLR
     98 
     99 ...
    100