[llvm-exegesis][AArch64] Add return statement at the end of the snippet correctly
authorPavel Kosov <kpdev42@gmail.com>
Thu, 6 Apr 2023 11:56:53 +0000 (14:56 +0300)
committerPavel Kosov <kpdev42@gmail.com>
Thu, 6 Apr 2023 11:56:53 +0000 (14:56 +0300)
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

llvm/test/tools/llvm-exegesis/AArch64/add-return.s [new file with mode: 0644]
llvm/tools/llvm-exegesis/lib/Assembler.cpp

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 (file)
index 0000000..3d827d7
--- /dev/null
@@ -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
index 0f8b765..ca882cf 100644 (file)
@@ -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);
   }
 }