-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed as not planned
Labels
backend:RISC-VquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
Consider following LLVM IR
target datalayout = "e-m:e-p:32:64-p1:32:64-i64:64-i128:128-n32:64-S64"
target triple = "riscv64-unknown--elf"
; Function Attrs: minsize
define i256 @func0() #0 {
entry:
ret i256 0
}
; Function Attrs: minsize
define i256 @func1() #0 {
entry:
ret i256 0
}
attributes #0 = { minsize }
Compiling it with llc -O3 test.ll -o test.s makes Machine Outliner to construct a function OUTLINED_FUNCTION_0 and add tail call to it to func0 and func1. This generates ELF file without
0000000000000000 <func0>:
0: 00000317 auipc t1, 0x0
4: 01030067 jr 0x10(t1) <OUTLINED_FUNCTION_0>
0000000000000008 <func1>:
8: 00000317 auipc t1, 0x0
c: 00830067 jr 0x8(t1) <OUTLINED_FUNCTION_0>
which cannot be relaxed as lld expects R_RISCV_CALL_PLT to be set.
For me it looks like something is not correct here.
One option to fix this is to use linkodronce linkage type for outlined function as comments states
Metadata
Metadata
Assignees
Labels
backend:RISC-VquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!