Skip to content

Commit

Permalink
[llvm-exegesis][AArch64] Add return statement at the end of the snipp…
Browse files Browse the repository at this point in the history
…et correctly

Currently llvm-exegesis fails to do this which causes every snippet to crash

~~

Huawei RRI, OS Lab

Reviewed By: courbet

Differential Revision: https://reviews.llvm.org/D147699
  • Loading branch information
kpdev committed Apr 6, 2023
1 parent ef1b22a commit 5348a25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions llvm/test/tools/llvm-exegesis/AArch64/add-return.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# RUN: llvm-exegesis --opcode-name=ADDv16i8 --mcpu=cortex-a78 --mtriple=aarch64-linux-gnu \
# RUN: --mode=latency --benchmark-phase=assemble-measured-code 2>&1 | FileCheck %s

# Check that we add ret (bx lr) instr to snippet
# CHECK: assembled_snippet: {{.*}}C0035FD6
4 changes: 2 additions & 2 deletions llvm/tools/llvm-exegesis/lib/Assembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ void BasicBlockFiller::addReturn(const DebugLoc &DL) {

FunctionLoweringInfo FuncInfo;
FuncInfo.CanLowerReturn = true;
MF.getSubtarget().getCallLowering()->lowerReturn(MIB, nullptr, {},
FuncInfo);
MF.getSubtarget().getCallLowering()->lowerReturn(MIB, nullptr, {}, FuncInfo,
0);
}
}

Expand Down

0 comments on commit 5348a25

Please sign in to comment.