llvm.org GIT mirror llvm / adc79ba
[BPF] fix indirect call assembly code Currently, for indirect call, the assembly code printed out as callx <imm> This is not right, it should be callx <reg> Fixed the issue with proper format. Differential Revision: https://reviews.llvm.org/D69229 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375386 91177308-0d34-0410-b5e6-96231b3b80d8 Yonghong Song 1 year, 1 month ago
2 changed file(s) with 21 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
472472 class CALLX
473473 : TYPE_ALU_JMP
474474 (outs),
475 (ins calltarget:$BrDst),
475 (ins GPR:$BrDst),
476476 !strconcat(OpcodeStr, " $BrDst"),
477477 []> {
478478 bits<32> BrDst;
0 ; RUN: llc < %s -march=bpfel | FileCheck %s
1 ; source:
2 ; int test(int (*f)(void)) { return f(); }
3
4 ; Function Attrs: nounwind
5 define dso_local i32 @test(i32 ()* nocapture %f) local_unnamed_addr #0 {
6 entry:
7 %call = tail call i32 %f() #1
8 ; CHECK: callx r{{[0-9]+}}
9 ret i32 %call
10 }
11
12 attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
13 attributes #1 = { nounwind }
14
15 !llvm.module.flags = !{!0}
16 !llvm.ident = !{!1}
17
18 !0 = !{i32 1, !"wchar_size", i32 4}
19 !1 = !{!"clang version 10.0.0 (https://github.com/llvm/llvm-project.git 7015a5c54b53d8d2297a3aa38bc32aab167bdcfc)"}