brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · b2ccbd8 Raw
49 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \3; RUN:   | FileCheck %s -check-prefix=RV32I4 5@a = global [4096 x i32] zeroinitializer, align 46@b = global [4096 x i32] zeroinitializer, align 47 8; This test demonstrates very slightly improved codegen in the case that9; a correct isLegalAddImmediate is implemented, thanks to LoopStrengthReduce.10 11define i32 @main() nounwind {12; RV32I-LABEL: main:13; RV32I:       # %bb.0: # %entry14; RV32I-NEXT:    li a0, 015; RV32I-NEXT:    lui a1, %hi(b)16; RV32I-NEXT:    addi a1, a1, %lo(b)17; RV32I-NEXT:    lui a2, %hi(a)18; RV32I-NEXT:    addi a2, a2, %lo(a)19; RV32I-NEXT:    lui a3, 120; RV32I-NEXT:  .LBB0_1: # %for.body21; RV32I-NEXT:    # =>This Inner Loop Header: Depth=122; RV32I-NEXT:    addi a4, a0, -204823; RV32I-NEXT:    sw a0, 0(a1)24; RV32I-NEXT:    addi a0, a0, 125; RV32I-NEXT:    addi a1, a1, 426; RV32I-NEXT:    sw a4, 0(a2)27; RV32I-NEXT:    addi a2, a2, 428; RV32I-NEXT:    bne a0, a3, .LBB0_129; RV32I-NEXT:  # %bb.2: # %for.end30; RV32I-NEXT:    li a0, 031; RV32I-NEXT:    ret32entry:33  br label %for.body34 35for.body:36  %i.08 = phi i32 [ 0, %entry ], [ %inc, %for.body ]37  %sub = add nsw i32 %i.08, -204838  %arrayidx = getelementptr inbounds [4096 x i32], ptr @a, i32 0, i32 %i.0839  store i32 %sub, ptr %arrayidx, align 440  %arrayidx1 = getelementptr inbounds [4096 x i32], ptr @b, i32 0, i32 %i.0841  store i32 %i.08, ptr %arrayidx1, align 442  %inc = add nuw nsw i32 %i.08, 143  %exitcond = icmp eq i32 %inc, 409644  br i1 %exitcond, label %for.end, label %for.body45 46for.end:47  ret i32 048}49