riscv64 codegen isn't ready yet?

Kagamin spam at here.lot
Thu Nov 7 08:18:35 UTC 2019


tried to compile
---
int aaa(int a, int b)
{
	return a+b;
}
---
ldc2 --mtriple=riscv64-unknown-linux -c test3.d
---
LLVM ERROR: Cannot select: 0x216e5fd67a8: ch = store<(store 4 
into %ir.3), trunc to i32> 0x216e5ff6818, 0x216e5fd6128, 
FrameIndex:i64<0>, undef:i64
   0x216e5fd6128: i64,ch = CopyFromReg 0x216e5ff6818, Register:i64 
%1
     0x216e5fd60c0: i64 = Register %1
   0x216e5fd6400: i64 = FrameIndex<0>
   0x216e5fd64d0: i64 = undef
In function: _D5test33aaaFiiZi
---
; [#uses = 0]
define i32 @_D5test33aaaFiiZi(i32 %b_arg, i32 %a_arg) #0 comdat {
   %a = alloca i32, align 4                        ; [#uses = 2, 
size/byte = 4]
   %b = alloca i32, align 4                        ; [#uses = 2, 
size/byte = 4]
   store i32 %a_arg, i32* %a
   store i32 %b_arg, i32* %b
   %1 = load i32, i32* %a                          ; [#uses = 1]
   %2 = load i32, i32* %b                          ; [#uses = 1]
   %3 = add i32 %1, %2                             ; [#uses = 1]
   ret i32 %3
}
---
Works for riscv32.


More information about the digitalmars-d-ldc mailing list