32 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=riscv64 | FileCheck %s3 4; Make sure we use lwu for the load, and don't emit5; a sext.w for the compare. This requires isTruncateFree6; to return true for i64->i32. Otherwise we emit a7; lw and a shift pair for the zext.8 9define void @foo(ptr %p, ptr %q, ptr %r) {10; CHECK-LABEL: foo:11; CHECK: # %bb.0:12; CHECK-NEXT: lwu a0, 0(a0)13; CHECK-NEXT: sd a0, 0(a1)14; CHECK-NEXT: beqz a0, .LBB0_215; CHECK-NEXT: # %bb.1: # %if16; CHECK-NEXT: sw a0, 0(a2)17; CHECK-NEXT: .LBB0_2: # %end18; CHECK-NEXT: ret19 %a = load i32, ptr %p20 %b = zext i32 %a to i6421 store i64 %b, ptr %q22 %c = icmp ne i32 %a, 023 br i1 %c, label %if, label %end24 25if:26 store i32 %a, ptr %r27 br label %end28 29end:30 ret void31}32