Skip to content

Commit 6c1a545

Browse files
authored
Merge pull request #18 from Disasm/riscv-lto-upstream
Unlock ThinLTO for RISC-V (second try)
2 parents 8538d56 + 0321498 commit 6c1a545

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

lld/ELF/InputFiles.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,9 @@ static uint8_t getBitcodeMachineKind(StringRef Path, const Triple &T) {
10861086
case Triple::ppc64:
10871087
case Triple::ppc64le:
10881088
return EM_PPC64;
1089+
case Triple::riscv32:
1090+
case Triple::riscv64:
1091+
return EM_RISCV;
10891092
case Triple::x86:
10901093
return T.isOSIAMCU() ? EM_IAMCU : EM_386;
10911094
case Triple::x86_64:

lld/test/ELF/lto/riscv32.ll

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
; REQUIRES: riscv
2+
3+
; RUN: llvm-as %s -o %t.o
4+
; RUN: ld.lld %t.o -o %t
5+
target datalayout = "e-m:e-p:32:32-i64:64-n32-S128"
6+
target triple = "riscv32-unknown-elf"
7+
8+
define void @f() {
9+
ret void
10+
}

lld/test/ELF/lto/riscv64.ll

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
; REQUIRES: riscv
2+
3+
; RUN: llvm-as %s -o %t.o
4+
; RUN: ld.lld %t.o -o %t
5+
target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"
6+
target triple = "riscv64-unknown-elf"
7+
8+
define void @f() {
9+
ret void
10+
}

0 commit comments

Comments
 (0)