brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.8 KiB · a152b3f Raw
163 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple aarch64-apple-ios -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=DARWIN3# RUN: llc -mtriple aarch64 -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=UNKNOWN4#5# Check that on Darwin we can combine to G_BZERO. Without Darwin, this should6# stay as memset.7 8--- |9  define void @bzero_unknown_width() { unreachable }10  define void @bzero_tail_unknown_width() { unreachable }11  define void @bzero_constant_width() { unreachable }12  define void @bzero_constant_width_minsize() minsize { unreachable }13  define void @not_zero() minsize { unreachable }14...15---16name:            bzero_unknown_width17tracksRegLiveness: true18body:             |19  bb.0:20    liveins: $x0, $x121    ; Always use G_BZERO when the memset width is unknown on Darwin.22 23    ; DARWIN-LABEL: name: bzero_unknown_width24    ; DARWIN: liveins: $x0, $x125    ; DARWIN-NEXT: {{  $}}26    ; DARWIN-NEXT: %ptr:_(p0) = COPY $x027    ; DARWIN-NEXT: %width:_(s64) = COPY $x128    ; DARWIN-NEXT: G_BZERO %ptr(p0), %width(s64), 0 :: (store (s32))29    ; DARWIN-NEXT: RET_ReallyLR30    ;31    ; UNKNOWN-LABEL: name: bzero_unknown_width32    ; UNKNOWN: liveins: $x0, $x133    ; UNKNOWN-NEXT: {{  $}}34    ; UNKNOWN-NEXT: %ptr:_(p0) = COPY $x035    ; UNKNOWN-NEXT: %zero:_(s8) = G_CONSTANT i8 036    ; UNKNOWN-NEXT: %width:_(s64) = COPY $x137    ; UNKNOWN-NEXT: G_MEMSET %ptr(p0), %zero(s8), %width(s64), 0 :: (store (s32))38    ; UNKNOWN-NEXT: RET_ReallyLR39    %ptr:_(p0) = COPY $x040    %zero:_(s8) = G_CONSTANT i8 041    %width:_(s64) = COPY $x142    G_MEMSET %ptr(p0), %zero(s8), %width(s64), 0 :: (store (s32))43    RET_ReallyLR44...45---46name:            bzero_tail_unknown_width47tracksRegLiveness: true48body:             |49  bb.0:50    liveins: $x0, $x151    ; DARWIN-LABEL: name: bzero_tail_unknown_width52    ; DARWIN: liveins: $x0, $x153    ; DARWIN-NEXT: {{  $}}54    ; DARWIN-NEXT: %ptr:_(p0) = COPY $x055    ; DARWIN-NEXT: %width:_(s64) = COPY $x156    ; DARWIN-NEXT: G_BZERO %ptr(p0), %width(s64), 1 :: (store (s32))57    ; DARWIN-NEXT: RET_ReallyLR58    ;59    ; UNKNOWN-LABEL: name: bzero_tail_unknown_width60    ; UNKNOWN: liveins: $x0, $x161    ; UNKNOWN-NEXT: {{  $}}62    ; UNKNOWN-NEXT: %ptr:_(p0) = COPY $x063    ; UNKNOWN-NEXT: %zero:_(s8) = G_CONSTANT i8 064    ; UNKNOWN-NEXT: %width:_(s64) = COPY $x165    ; UNKNOWN-NEXT: G_MEMSET %ptr(p0), %zero(s8), %width(s64), 1 :: (store (s32))66    ; UNKNOWN-NEXT: RET_ReallyLR67    %ptr:_(p0) = COPY $x068    %zero:_(s8) = G_CONSTANT i8 069    %width:_(s64) = COPY $x170    G_MEMSET %ptr(p0), %zero(s8), %width(s64), 1 :: (store (s32))71    RET_ReallyLR72...73---74name:            bzero_constant_width75tracksRegLiveness: true76body:             |77  bb.0:78    liveins: $x0, $x179    ; For values >256, we should use G_BZERO on Darwin.80 81    ; DARWIN-LABEL: name: bzero_constant_width82    ; DARWIN: liveins: $x0, $x183    ; DARWIN-NEXT: {{  $}}84    ; DARWIN-NEXT: %ptr:_(p0) = COPY $x085    ; DARWIN-NEXT: %width:_(s64) = G_CONSTANT i64 102486    ; DARWIN-NEXT: G_BZERO %ptr(p0), %width(s64), 0 :: (store (s32))87    ; DARWIN-NEXT: RET_ReallyLR88    ;89    ; UNKNOWN-LABEL: name: bzero_constant_width90    ; UNKNOWN: liveins: $x0, $x191    ; UNKNOWN-NEXT: {{  $}}92    ; UNKNOWN-NEXT: %ptr:_(p0) = COPY $x093    ; UNKNOWN-NEXT: %zero:_(s8) = G_CONSTANT i8 094    ; UNKNOWN-NEXT: %width:_(s64) = G_CONSTANT i64 102495    ; UNKNOWN-NEXT: G_MEMSET %ptr(p0), %zero(s8), %width(s64), 0 :: (store (s32))96    ; UNKNOWN-NEXT: RET_ReallyLR97    %ptr:_(p0) = COPY $x098    %zero:_(s8) = G_CONSTANT i8 099    %width:_(s64) = G_CONSTANT i64 1024100    G_MEMSET %ptr(p0), %zero(s8), %width(s64), 0 :: (store (s32))101    RET_ReallyLR102...103---104name:            bzero_constant_width_minsize105tracksRegLiveness: true106body:             |107  bb.0:108    liveins: $x0, $x1109    ; With minsize, we should always use G_BZERO to avoid a copy from wzr.110 111    ; DARWIN-LABEL: name: bzero_constant_width_minsize112    ; DARWIN: liveins: $x0, $x1113    ; DARWIN-NEXT: {{  $}}114    ; DARWIN-NEXT: %ptr:_(p0) = COPY $x0115    ; DARWIN-NEXT: %width:_(s64) = G_CONSTANT i64 256116    ; DARWIN-NEXT: G_BZERO %ptr(p0), %width(s64), 0 :: (store (s32))117    ; DARWIN-NEXT: RET_ReallyLR118    ;119    ; UNKNOWN-LABEL: name: bzero_constant_width_minsize120    ; UNKNOWN: liveins: $x0, $x1121    ; UNKNOWN-NEXT: {{  $}}122    ; UNKNOWN-NEXT: %ptr:_(p0) = COPY $x0123    ; UNKNOWN-NEXT: %zero:_(s8) = G_CONSTANT i8 0124    ; UNKNOWN-NEXT: %width:_(s64) = G_CONSTANT i64 256125    ; UNKNOWN-NEXT: G_MEMSET %ptr(p0), %zero(s8), %width(s64), 0 :: (store (s32))126    ; UNKNOWN-NEXT: RET_ReallyLR127    %ptr:_(p0) = COPY $x0128    %zero:_(s8) = G_CONSTANT i8 0129    %width:_(s64) = G_CONSTANT i64 256130    G_MEMSET %ptr(p0), %zero(s8), %width(s64), 0 :: (store (s32))131    RET_ReallyLR132...133---134name:            not_zero135tracksRegLiveness: true136body:             |137  bb.0:138    liveins: $x0, $x1139    ; When the value isn't 0, don't create G_BZERO.140 141    ; DARWIN-LABEL: name: not_zero142    ; DARWIN: liveins: $x0, $x1143    ; DARWIN-NEXT: {{  $}}144    ; DARWIN-NEXT: %ptr:_(p0) = COPY $x0145    ; DARWIN-NEXT: %not_zero:_(s8) = G_CONSTANT i8 1146    ; DARWIN-NEXT: %width:_(s64) = G_CONSTANT i64 256147    ; DARWIN-NEXT: G_MEMSET %ptr(p0), %not_zero(s8), %width(s64), 0 :: (store (s32))148    ; DARWIN-NEXT: RET_ReallyLR149    ;150    ; UNKNOWN-LABEL: name: not_zero151    ; UNKNOWN: liveins: $x0, $x1152    ; UNKNOWN-NEXT: {{  $}}153    ; UNKNOWN-NEXT: %ptr:_(p0) = COPY $x0154    ; UNKNOWN-NEXT: %not_zero:_(s8) = G_CONSTANT i8 1155    ; UNKNOWN-NEXT: %width:_(s64) = G_CONSTANT i64 256156    ; UNKNOWN-NEXT: G_MEMSET %ptr(p0), %not_zero(s8), %width(s64), 0 :: (store (s32))157    ; UNKNOWN-NEXT: RET_ReallyLR158    %ptr:_(p0) = COPY $x0159    %not_zero:_(s8) = G_CONSTANT i8 1160    %width:_(s64) = G_CONSTANT i64 256161    G_MEMSET %ptr(p0), %not_zero(s8), %width(s64), 0 :: (store (s32))162    RET_ReallyLR163