brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · 480827b Raw
72 lines · plain
1; The purpose of the test case is to ensure that a spill that happens during2; intermediate calculations for a comparison performed in a GPR spills the3; full register. Some i32 comparisons performed in GPRs use code that uses4; the full 64-bits of the register in intermediate stages. Spilling such a value5; as a 32-bit value is incorrect.6; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \7; RUN:   -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \8; RUN:  --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl9; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \10; RUN:   -ppc-gpr-icmps=all -ppc-asm-full-reg-names -mcpu=pwr8 < %s | FileCheck %s \11; RUN:  --implicit-check-not cmpw --implicit-check-not cmpd --implicit-check-not cmpl12; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -O2 \13; RUN:     -ppc-asm-full-reg-names -mcpu=pwr10 < %s | \14; RUN:     FileCheck %s --check-prefix=CHECK-P1015; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -O2 \16; RUN:     -ppc-asm-full-reg-names -mcpu=pwr10 < %s | \17; RUN:     FileCheck %s --check-prefix=CHECK-P1018@glob = local_unnamed_addr global i64 0, align 819@.str = private unnamed_addr constant [12 x i8] c"Value = %d\0A\00", align 120 21; Function Attrs: noinline nounwind22define void @call(i64 %a) local_unnamed_addr #0 {23entry:24  store i64 %a, ptr @glob, align 825  tail call void asm sideeffect "#Do Nothing", "~{memory}"()26  ret void27}28 29; Function Attrs: noinline nounwind30define signext i32 @test(i32 signext %a, i32 signext %b, i32 signext %c) local_unnamed_addr #0 {31entry:32  %add = add nsw i32 %b, %a33  %sub = sub nsw i32 %add, %c34  %conv = sext i32 %sub to i6435  tail call void @call(i64 %conv)36  tail call void asm sideeffect "#Do Nothing", "~{r0},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{r16},~{r17},~{r18},~{r19},~{r20},~{r21},~{r22},~{r23},~{r24},~{r25},~{r26},~{r27},~{r28},~{r29},~{r30},~{r31}"()37  %cmp = icmp sle i32 %add, %c38  %conv1 = zext i1 %cmp to i3239  ret i32 %conv140; CHECK-LABEL: test41; CHECK: sub r3,42; CHECK: extsw r3,43; CHECK: bl call44; CHECK: sub r3,45; CHECK: std r3, [[OFF:[0-9]+]](r1)46; CHECK: #APP47; CHECK: ld r3, [[OFF]](r1)48; CHECK: rldicl r3, r3, 1, 6349; CHECK: xori r3, r3, 150; CHECK: blr51 52; CHECK-P10-LABEL: test53; CHECK-P10: sub r3,54; CHECK-P10: extsw r3,55; CHECK-P10: bl call56; CHECK-P10: cmpw r29, r3057; CHECK-P10: #APP58; CHECK-P10: setbcr r3, gt59; CHECK-P10: blr60}61 62; Function Attrs: nounwind63define signext i32 @main() local_unnamed_addr #1 {64entry:65  %call = tail call signext i32 @test(i32 signext 10, i32 signext -15, i32 signext 0)66  %call1 = tail call signext i32 (ptr, ...) @printf(ptr @.str, i32 signext %call)67  ret i32 068}69 70; Function Attrs: nounwind71declare signext i32 @printf(ptr nocapture readonly, ...) local_unnamed_addr #272