brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.3 KiB · 52d0dff Raw
147 lines · plain
1# RUN: llc -O2 -o - %s -mtriple=aarch64-windows -start-before=shrink-wrap \2# RUN:   -stop-after=prologepilog | FileCheck %s --check-prefix=WIN643# RUN: llc -O2 -o - %s -mtriple=aarch64-linux -start-before=shrink-wrap \4# RUN:   -stop-after=prologepilog | FileCheck %s --check-prefix=LINUX5 6# This tests checks that shrink wrapping bails out on Windows AMR64 due to the7# use of Windows CFI.  We don't currently support fragments for WIndows EH on8# ARM64.9# The same test gets shrink wrapped on Linux ARM64.10 11# WIN64-LABEL: bb.0.entry:12# WIN64: early-clobber $sp = frame-setup STRXpre killed $x19, $sp, -3213# WIN64-LABEL: bb.1:14# WIN64-LABEL: bb.2.if.then:15 16# LINUX-LABEL: bb.0.entry:17# LINUX-LABEL: bb.1:18# LINUX-LABEL: bb.2.if.then:19# LINUX: early-clobber $sp = frame-setup STRXpre killed $fp, $sp, -3220--- |21  ; ModuleID = 'shrink.cpp'22  target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"23  target triple = "aarch64-unknown-windows-msvc19.11.0"24 25  define dso_local i32 @"?func@@YAHHH@Z"(i32 %a, i32 %b) local_unnamed_addr #0 {26  entry:27    %A = alloca [1000 x i32], align 428    %cmp = icmp sgt i32 %a, 129    br i1 %cmp, label %if.then, label %return30 31  if.then:                                          ; preds = %entry32    %0 = bitcast ptr %A to ptr33    call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %0) #334    %arraydecay2 = bitcast ptr %A to ptr35    call void @"?init@@YAXPEAH@Z"(ptr nonnull %arraydecay2)36    %arrayidx = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 10037    %1 = load i32, ptr %arrayidx, align 4, !tbaa !238    %add = add i32 %b, 139    %add1 = add i32 %add, %140    call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %0) #341    br label %return42 43  return:                                           ; preds = %entry, %if.then44    %retval.0 = phi i32 [ %add1, %if.then ], [ 0, %entry ]45    ret i32 %retval.046  }47 48  ; Function Attrs: argmemonly nounwind49  declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #150 51  declare dso_local void @"?init@@YAXPEAH@Z"(ptr) local_unnamed_addr #252 53  ; Function Attrs: argmemonly nounwind54  declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #155 56  ; Function Attrs: nounwind57  declare void @llvm.stackprotector(ptr, ptr) #358 59  attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+neon" "use-soft-float"="false" }60  attributes #1 = { argmemonly nounwind }61  attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+neon" "use-soft-float"="false" }62  attributes #3 = { nounwind }63 64  !llvm.module.flags = !{!0}65  !llvm.ident = !{!1}66 67  !0 = !{i32 1, !"wchar_size", i32 2}68  !1 = !{!"clang version 8.0.0"}69  !2 = !{!3, !3, i64 0}70  !3 = !{!"int", !4, i64 0}71  !4 = !{!"omnipotent char", !5, i64 0}72  !5 = !{!"Simple C++ TBAA"}73 74...75---76name:            '?func@@YAHHH@Z'77alignment:       478exposesReturnsTwice: false79legalized:       false80regBankSelected: false81selected:        false82failedISel:      false83tracksRegLiveness: true84registers:85liveins:86  - { reg: '$w0', virtual-reg: '' }87  - { reg: '$w1', virtual-reg: '' }88frameInfo:89  isFrameAddressTaken: false90  isReturnAddressTaken: false91  hasStackMap:     false92  hasPatchPoint:   false93  stackSize:       094  offsetAdjustment: 095  maxAlignment:    496  adjustsStack:    true97  hasCalls:        true98  stackProtector:  ''99  maxCallFrameSize: 0100  cvBytesOfCalleeSavedRegisters: 0101  hasOpaqueSPAdjustment: false102  hasVAStart:      false103  hasMustTailInVarArgFunc: false104  localFrameSize:  4000105  savePoint:       []106  restorePoint:    []107fixedStack:108stack:109  - { id: 0, name: A, type: default, offset: 0, size: 4000, alignment: 4,110      stack-id: default, callee-saved-register: '', callee-saved-restored: true,111      local-offset: -4000, debug-info-variable: '', debug-info-expression: '',112      debug-info-location: '' }113constants:114body:             |115  bb.0.entry:116    successors: %bb.2(0x40000000), %bb.1(0x40000000)117    liveins: $w0, $w1118 119    dead $wzr = SUBSWri killed renamable $w0, 2, 0, implicit-def $nzcv120    Bcc 10, %bb.2, implicit killed $nzcv121 122  bb.1:123    successors: %bb.3(0x80000000)124 125    renamable $w0 = COPY $wzr126    B %bb.3127 128  bb.2.if.then:129    successors: %bb.3(0x80000000)130    liveins: $w1131 132    renamable $w19 = COPY $w1133    ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp134    $x0 = ADDXri %stack.0.A, 0, 0135    BL @"?init@@YAXPEAH@Z", csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp136    ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp137    renamable $w8 = LDRWui %stack.0.A, 100 :: (dereferenceable load (s32) from %ir.arrayidx, !tbaa !2)138    renamable $w8 = ADDWrr killed renamable $w19, killed renamable $w8139    renamable $w0 = ADDWri killed renamable $w8, 1, 0140 141  bb.3.return:142    liveins: $w0143 144    RET_ReallyLR implicit $w0145 146...147