[llvm] 5348a25 - [llvm-exegesis][AArch64] Add return statement at the end of the snippet correctly
Pavel Kosov via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 6 04:57:50 PDT 2023
Author: Pavel Kosov
Date: 2023-04-06T14:56:53+03:00
New Revision: 5348a25377652c5e32f9a85754da7231cb9bf9f6
URL: https://github.com/llvm/llvm-project/commit/5348a25377652c5e32f9a85754da7231cb9bf9f6
DIFF: https://github.com/llvm/llvm-project/commit/5348a25377652c5e32f9a85754da7231cb9bf9f6.diff
LOG: [llvm-exegesis][AArch64] Add return statement at the end of the snippet 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
Added:
llvm/test/tools/llvm-exegesis/AArch64/add-return.s
Modified:
llvm/tools/llvm-exegesis/lib/Assembler.cpp
Removed:
################################################################################
diff --git a/llvm/test/tools/llvm-exegesis/AArch64/add-return.s b/llvm/test/tools/llvm-exegesis/AArch64/add-return.s
new file mode 100644
index 0000000000000..3d827d7f32bde
--- /dev/null
+++ b/llvm/test/tools/llvm-exegesis/AArch64/add-return.s
@@ -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
diff --git a/llvm/tools/llvm-exegesis/lib/Assembler.cpp b/llvm/tools/llvm-exegesis/lib/Assembler.cpp
index 0f8b765ab9613..ca882cf35acf5 100644
--- a/llvm/tools/llvm-exegesis/lib/Assembler.cpp
+++ b/llvm/tools/llvm-exegesis/lib/Assembler.cpp
@@ -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);
}
}
More information about the llvm-commits
mailing list