130 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=aarch64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-SLOW3; RUN: llc < %s -mtriple=aarch64-linux-gnu -mattr=+alu-lsl-fast | FileCheck %s --check-prefixes=CHECK,CHECK-FAST4 5define i32 @testmul3(i32 noundef %x, i32 noundef %y, i32 noundef %z) {6; CHECK-SLOW-LABEL: testmul3:7; CHECK-SLOW: // %bb.0: // %entry8; CHECK-SLOW-NEXT: lsl w8, w0, #39; CHECK-SLOW-NEXT: add w9, w8, w110; CHECK-SLOW-NEXT: add w8, w8, w211; CHECK-SLOW-NEXT: mul w0, w8, w912; CHECK-SLOW-NEXT: ret13;14; CHECK-FAST-LABEL: testmul3:15; CHECK-FAST: // %bb.0: // %entry16; CHECK-FAST-NEXT: add w8, w1, w0, lsl #317; CHECK-FAST-NEXT: add w9, w2, w0, lsl #318; CHECK-FAST-NEXT: mul w0, w9, w819; CHECK-FAST-NEXT: ret20entry:21 %shl = shl i32 %x, 322 %add = add nsw i32 %shl, %y23 %add2 = add nsw i32 %shl, %z24 %mul = mul nsw i32 %add2, %add25 ret i32 %mul26}27 28define i32 @testvar(i32 noundef %x, i32 noundef %y, i32 noundef %z, i32 %zz) {29; CHECK-LABEL: testvar:30; CHECK: // %bb.0: // %entry31; CHECK-NEXT: lsl w8, w0, w332; CHECK-NEXT: add w9, w8, w133; CHECK-NEXT: add w8, w8, w234; CHECK-NEXT: mul w0, w8, w935; CHECK-NEXT: ret36entry:37 %shl = shl i32 %x, %zz38 %add = add nsw i32 %shl, %y39 %add2 = add nsw i32 %shl, %z40 %mul = mul nsw i32 %add2, %add41 ret i32 %mul42}43 44define i32 @testmul5(i32 noundef %x, i32 noundef %y, i32 noundef %z) {45; CHECK-LABEL: testmul5:46; CHECK: // %bb.0: // %entry47; CHECK-NEXT: lsl w8, w0, #548; CHECK-NEXT: add w9, w8, w149; CHECK-NEXT: add w8, w8, w250; CHECK-NEXT: mul w0, w8, w951; CHECK-NEXT: ret52entry:53 %shl = shl i32 %x, 554 %add = add nsw i32 %shl, %y55 %add2 = add nsw i32 %shl, %z56 %mul = mul nsw i32 %add2, %add57 ret i32 %mul58}59 60define i64 @testsext3(i32 noundef %x, i64 noundef %y, i64 noundef %z) {61; CHECK-LABEL: testsext3:62; CHECK: // %bb.0: // %entry63; CHECK-NEXT: // kill: def $w0 killed $w0 def $x064; CHECK-NEXT: sbfiz x8, x0, #3, #3265; CHECK-NEXT: add x9, x8, x166; CHECK-NEXT: add x8, x8, x267; CHECK-NEXT: mul x0, x9, x868; CHECK-NEXT: ret69entry:70 %conv = sext i32 %x to i6471 %shl = shl nsw i64 %conv, 372 %add = add nsw i64 %shl, %y73 %add3 = add nsw i64 %shl, %z74 %mul = mul nsw i64 %add, %add375 ret i64 %mul76}77 78define i64 @testzext3(i32 noundef %x, i64 noundef %y, i64 noundef %z) {79; CHECK-LABEL: testzext3:80; CHECK: // %bb.0: // %entry81; CHECK-NEXT: // kill: def $w0 killed $w0 def $x082; CHECK-NEXT: ubfiz x8, x0, #3, #3283; CHECK-NEXT: add x9, x8, x184; CHECK-NEXT: add x8, x8, x285; CHECK-NEXT: mul x0, x9, x886; CHECK-NEXT: ret87entry:88 %conv = zext i32 %x to i6489 %shl = shl nsw i64 %conv, 390 %add = add nsw i64 %shl, %y91 %add3 = add nsw i64 %shl, %z92 %mul = mul nsw i64 %add, %add393 ret i64 %mul94}95 96define i64 @test3sext(i32 noundef %x, i64 noundef %y, i64 noundef %z) {97; CHECK-LABEL: test3sext:98; CHECK: // %bb.0: // %entry99; CHECK-NEXT: lsl w8, w0, #3100; CHECK-NEXT: sxtw x8, w8101; CHECK-NEXT: add x9, x8, x1102; CHECK-NEXT: add x8, x8, x2103; CHECK-NEXT: mul x0, x9, x8104; CHECK-NEXT: ret105entry:106 %shl = shl i32 %x, 3107 %conv = sext i32 %shl to i64108 %add = add nsw i64 %conv, %y109 %add3 = add nsw i64 %conv, %z110 %mul = mul nsw i64 %add, %add3111 ret i64 %mul112}113 114define i64 @test3zext(i32 noundef %x, i64 noundef %y, i64 noundef %z) {115; CHECK-LABEL: test3zext:116; CHECK: // %bb.0: // %entry117; CHECK-NEXT: lsl w8, w0, #3118; CHECK-NEXT: add x9, x8, x1119; CHECK-NEXT: add x8, x8, x2120; CHECK-NEXT: mul x0, x9, x8121; CHECK-NEXT: ret122entry:123 %shl = shl i32 %x, 3124 %conv = zext i32 %shl to i64125 %add = add nsw i64 %conv, %y126 %add3 = add nsw i64 %conv, %z127 %mul = mul nsw i64 %add, %add3128 ret i64 %mul129}130