79 lines · plain
1; RUN: llc -mtriple=xtensa -O1 -verify-machineinstrs < %s \2; RUN: | FileCheck %s -check-prefix=XTENSA3 4; Check placement of first 6 arguments in registers and 7th argument on stack5define dso_local i32 @test1(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, ptr nocapture noundef readonly byval(i32) align 4 %6) {6; XTENSA-LABEL: @test17; XTENSA: add a8, a7, a28; XTENSA: l32i a9, a1, 09; XTENSA: add a2, a8, a910; XTENSA: ret11 %8 = load i32, ptr %6, align 412 %9 = add nsw i32 %5, %013 %10 = add nsw i32 %9, %814 ret i32 %1015}16 17; Check placement of second i64 argument in registers18define dso_local i32 @test2(i32 noundef %0, i64 noundef %1, i32 noundef %2) {19; XTENSA-LABEL: @test220; XTENSA: add a8, a6, a221; XTENSA: add a2, a8, a422; XTENSA: ret23 %4 = trunc i64 %1 to i3224 %5 = add nsw i32 %2, %025 %6 = add nsw i32 %5, %426 ret i32 %627}28 29; Check placement of first argument typeof i8 in register30define dso_local i32 @test3(i8 noundef signext %0, i64 noundef %1, i32 noundef %2) {31; XTENSA-LABEL: @test332; XTENSA: add a8, a2, a633; XTENSA: add a2, a8, a434; XTENSA: ret35 %4 = trunc i64 %1 to i3236 %5 = sext i8 %0 to i3237 %6 = add nsw i32 %5, %238 %7 = add nsw i32 %6, %439 ret i32 %740}41 42; Check placement of 4th argument typeof i64 on stack43define dso_local i32 @test4(i8 noundef signext %0, i64 noundef %1, i32 noundef %2, ptr nocapture noundef readonly byval(i64) align 8 %3) {44; XTENSA-LABEL: @test445; XTENSA: add a8, a2, a646; XTENSA: add a8, a8, a447; XTENSA: l32i a9, a1, 048; XTENSA: add a2, a8, a949; XTENSA: ret50 %5 = load i64, ptr %3, align 851 %6 = trunc i64 %1 to i3252 %7 = trunc i64 %5 to i3253 %8 = sext i8 %0 to i3254 %9 = add nsw i32 %8, %255 %10 = add nsw i32 %9, %656 %11 = add nsw i32 %10, %757 ret i32 %1158}59 60; Check placement of 128 bit structure on registers61define dso_local i32 @test5([4 x i32] %0, i32 noundef %1) {62; XTENSA-LABEL: @test563; XTENSA: add a2, a2, a664; XTENSA: ret65 %3 = extractvalue [4 x i32] %0, 066 %4 = add nsw i32 %3, %167 ret i32 %468}69 70; Check placement of 128 bit structure on stack71define dso_local i32 @test6(i32 noundef %0, [4 x i32] %1) {72; XTENSA-LABEL: @test673; XTENSA: add a2, a3, a274; XTENSA: ret75 %3 = extractvalue [4 x i32] %1, 076 %4 = add nsw i32 %3, %077 ret i32 %478}79