1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes='require<profile-summary>,function(codegenprepare)' < %s | FileCheck %s
3 ; REQUIRES: aarch64-registered-target
5 ; Check that we don't give up if unable to sink the first argument.
7 target triple = "aarch64-linux"
9 declare void @f(ptr, ptr) cold
11 define void @g(i1 %c1, ptr %p, i32 %i) {
14 ; CHECK-NEXT: [[A0:%.*]] = getelementptr ptr, ptr [[P:%.*]], i32 [[I:%.*]]
15 ; CHECK-NEXT: br i1 [[C1:%.*]], label [[IF_THEN:%.*]], label [[EXIT:%.*]]
17 ; CHECK-NEXT: [[SUNKADDR:%.*]] = getelementptr i8, ptr [[P]], i64 32
18 ; CHECK-NEXT: call void @f(ptr [[A0]], ptr [[SUNKADDR]])
19 ; CHECK-NEXT: br label [[EXIT]]
21 ; CHECK-NEXT: ret void
24 %a0 = getelementptr ptr, ptr %p, i32 %i
25 %a1 = getelementptr ptr, ptr %p, i32 4
26 br i1 %c1, label %if.then, label %exit
29 call void @f(ptr %a0, ptr %a1)