Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/CodeGen/RISCV/split-offsets.ll
Show All 16 Lines | |||||
; RV32I-NEXT: add a1, a1, a2 | ; RV32I-NEXT: add a1, a1, a2 | ||||
; RV32I-NEXT: add a0, a0, a2 | ; RV32I-NEXT: add a0, a0, a2 | ||||
; RV32I-NEXT: addi a2, zero, 2 | ; RV32I-NEXT: addi a2, zero, 2 | ||||
; RV32I-NEXT: sw a2, 0(a0) | ; RV32I-NEXT: sw a2, 0(a0) | ||||
; RV32I-NEXT: addi a3, zero, 1 | ; RV32I-NEXT: addi a3, zero, 1 | ||||
; RV32I-NEXT: sw a3, 4(a0) | ; RV32I-NEXT: sw a3, 4(a0) | ||||
; RV32I-NEXT: sw a3, 0(a1) | ; RV32I-NEXT: sw a3, 0(a1) | ||||
; RV32I-NEXT: sw a2, 4(a1) | ; RV32I-NEXT: sw a2, 4(a1) | ||||
; RV32I-NEXT: .cfi_def_cfa_offset 0 | |||||
; RV32I-NEXT: ret | ; RV32I-NEXT: ret | ||||
; | ; | ||||
; RV64I-LABEL: test1: | ; RV64I-LABEL: test1: | ||||
; RV64I: # %bb.0: # %entry | ; RV64I: # %bb.0: # %entry | ||||
; RV64I-NEXT: ld a0, 0(a0) | ; RV64I-NEXT: ld a0, 0(a0) | ||||
; RV64I-NEXT: lui a2, 20 | ; RV64I-NEXT: lui a2, 20 | ||||
; RV64I-NEXT: addiw a2, a2, -1920 | ; RV64I-NEXT: addiw a2, a2, -1920 | ||||
; RV64I-NEXT: add a1, a1, a2 | ; RV64I-NEXT: add a1, a1, a2 | ||||
; RV64I-NEXT: add a0, a0, a2 | ; RV64I-NEXT: add a0, a0, a2 | ||||
; RV64I-NEXT: addi a2, zero, 2 | ; RV64I-NEXT: addi a2, zero, 2 | ||||
; RV64I-NEXT: sw a2, 0(a0) | ; RV64I-NEXT: sw a2, 0(a0) | ||||
; RV64I-NEXT: addi a3, zero, 1 | ; RV64I-NEXT: addi a3, zero, 1 | ||||
; RV64I-NEXT: sw a3, 4(a0) | ; RV64I-NEXT: sw a3, 4(a0) | ||||
; RV64I-NEXT: sw a3, 0(a1) | ; RV64I-NEXT: sw a3, 0(a1) | ||||
; RV64I-NEXT: sw a2, 4(a1) | ; RV64I-NEXT: sw a2, 4(a1) | ||||
; RV64I-NEXT: .cfi_def_cfa_offset 0 | |||||
; RV64I-NEXT: ret | ; RV64I-NEXT: ret | ||||
entry: | entry: | ||||
%s = load [65536 x i32]*, [65536 x i32]** %sp | %s = load [65536 x i32]*, [65536 x i32]** %sp | ||||
%gep0 = getelementptr [65536 x i32], [65536 x i32]* %s, i64 0, i32 20000 | %gep0 = getelementptr [65536 x i32], [65536 x i32]* %s, i64 0, i32 20000 | ||||
%gep1 = getelementptr [65536 x i32], [65536 x i32]* %s, i64 0, i32 20001 | %gep1 = getelementptr [65536 x i32], [65536 x i32]* %s, i64 0, i32 20001 | ||||
%gep2 = getelementptr [65536 x i32], [65536 x i32]* %t, i64 0, i32 20000 | %gep2 = getelementptr [65536 x i32], [65536 x i32]* %t, i64 0, i32 20000 | ||||
%gep3 = getelementptr [65536 x i32], [65536 x i32]* %t, i64 0, i32 20001 | %gep3 = getelementptr [65536 x i32], [65536 x i32]* %t, i64 0, i32 20001 | ||||
store i32 2, i32* %gep0 | store i32 2, i32* %gep0 | ||||
Show All 19 Lines | |||||
; RV32I-NEXT: addi a4, a3, 1 | ; RV32I-NEXT: addi a4, a3, 1 | ||||
; RV32I-NEXT: sw a4, 0(a1) | ; RV32I-NEXT: sw a4, 0(a1) | ||||
; RV32I-NEXT: sw a3, 4(a1) | ; RV32I-NEXT: sw a3, 4(a1) | ||||
; RV32I-NEXT: sw a4, 0(a0) | ; RV32I-NEXT: sw a4, 0(a0) | ||||
; RV32I-NEXT: sw a3, 4(a0) | ; RV32I-NEXT: sw a3, 4(a0) | ||||
; RV32I-NEXT: mv a3, a4 | ; RV32I-NEXT: mv a3, a4 | ||||
; RV32I-NEXT: blt a3, a2, .LBB1_1 | ; RV32I-NEXT: blt a3, a2, .LBB1_1 | ||||
; RV32I-NEXT: .LBB1_2: # %while_end | ; RV32I-NEXT: .LBB1_2: # %while_end | ||||
; RV32I-NEXT: .cfi_def_cfa_offset 0 | |||||
; RV32I-NEXT: ret | ; RV32I-NEXT: ret | ||||
; | ; | ||||
; RV64I-LABEL: test2: | ; RV64I-LABEL: test2: | ||||
; RV64I: # %bb.0: # %entry | ; RV64I: # %bb.0: # %entry | ||||
; RV64I-NEXT: mv a3, zero | ; RV64I-NEXT: mv a3, zero | ||||
; RV64I-NEXT: ld a4, 0(a0) | ; RV64I-NEXT: ld a4, 0(a0) | ||||
; RV64I-NEXT: lui a0, 20 | ; RV64I-NEXT: lui a0, 20 | ||||
; RV64I-NEXT: addiw a5, a0, -1920 | ; RV64I-NEXT: addiw a5, a0, -1920 | ||||
; RV64I-NEXT: add a0, a1, a5 | ; RV64I-NEXT: add a0, a1, a5 | ||||
; RV64I-NEXT: add a1, a4, a5 | ; RV64I-NEXT: add a1, a4, a5 | ||||
; RV64I-NEXT: sext.w a2, a2 | ; RV64I-NEXT: sext.w a2, a2 | ||||
; RV64I-NEXT: sext.w a4, a3 | ; RV64I-NEXT: sext.w a4, a3 | ||||
; RV64I-NEXT: bge a4, a2, .LBB1_2 | ; RV64I-NEXT: bge a4, a2, .LBB1_2 | ||||
; RV64I-NEXT: .LBB1_1: # %while_body | ; RV64I-NEXT: .LBB1_1: # %while_body | ||||
; RV64I-NEXT: # =>This Inner Loop Header: Depth=1 | ; RV64I-NEXT: # =>This Inner Loop Header: Depth=1 | ||||
; RV64I-NEXT: addi a4, a3, 1 | ; RV64I-NEXT: addi a4, a3, 1 | ||||
; RV64I-NEXT: sw a4, 0(a1) | ; RV64I-NEXT: sw a4, 0(a1) | ||||
; RV64I-NEXT: sw a3, 4(a1) | ; RV64I-NEXT: sw a3, 4(a1) | ||||
; RV64I-NEXT: sw a4, 0(a0) | ; RV64I-NEXT: sw a4, 0(a0) | ||||
; RV64I-NEXT: sw a3, 4(a0) | ; RV64I-NEXT: sw a3, 4(a0) | ||||
; RV64I-NEXT: mv a3, a4 | ; RV64I-NEXT: mv a3, a4 | ||||
; RV64I-NEXT: sext.w a4, a3 | ; RV64I-NEXT: sext.w a4, a3 | ||||
; RV64I-NEXT: blt a4, a2, .LBB1_1 | ; RV64I-NEXT: blt a4, a2, .LBB1_1 | ||||
; RV64I-NEXT: .LBB1_2: # %while_end | ; RV64I-NEXT: .LBB1_2: # %while_end | ||||
; RV64I-NEXT: .cfi_def_cfa_offset 0 | |||||
; RV64I-NEXT: ret | ; RV64I-NEXT: ret | ||||
entry: | entry: | ||||
%s = load [65536 x i32]*, [65536 x i32]** %sp | %s = load [65536 x i32]*, [65536 x i32]** %sp | ||||
br label %while_cond | br label %while_cond | ||||
while_cond: | while_cond: | ||||
%phi = phi i32 [ 0, %entry ], [ %i, %while_body ] | %phi = phi i32 [ 0, %entry ], [ %i, %while_body ] | ||||
%gep0 = getelementptr [65536 x i32], [65536 x i32]* %s, i64 0, i32 20000 | %gep0 = getelementptr [65536 x i32], [65536 x i32]* %s, i64 0, i32 20000 | ||||
%gep1 = getelementptr [65536 x i32], [65536 x i32]* %s, i64 0, i32 20001 | %gep1 = getelementptr [65536 x i32], [65536 x i32]* %s, i64 0, i32 20001 | ||||
Show All 16 Lines |