[PATCH] D107593: [Lanai] fix MC / objdump
Serge Bazanski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 9 09:48:22 PDT 2021
q3k updated this revision to Diff 371637.
q3k marked 3 inline comments as done.
q3k added a comment.
Address review comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107593/new/
https://reviews.llvm.org/D107593
Files:
llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCTargetDesc.cpp
llvm/test/tools/llvm-objdump/ELF/Lanai/lit.local.cfg
llvm/test/tools/llvm-objdump/ELF/Lanai/smoketest.ll
Index: llvm/test/tools/llvm-objdump/ELF/Lanai/smoketest.ll
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-objdump/ELF/Lanai/smoketest.ll
@@ -0,0 +1,13 @@
+; RUN: llc -o %t.o -filetype=obj -mtriple=lanai %s
+; RUN: llvm-objdump -d -S %t.o | FileCheck %s
+
+;; Ensure that Lanai can be compiled using llc and then objdumped to
+;; assembly. This is a smoke test to exercise the basics of the MC
+;; implementation in Lanai.
+
+; CHECK-LABEL: smoketest
+; CHECK: st %fp, [--%sp]
+define i32 @smoketest(i32 %x, i32 %y) {
+ %z = add i32 %x, %y
+ ret i32 %z
+}
Index: llvm/test/tools/llvm-objdump/ELF/Lanai/lit.local.cfg
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-objdump/ELF/Lanai/lit.local.cfg
@@ -0,0 +1,4 @@
+import platform
+
+if not 'Lanai' in config.root.targets:
+ config.unsupported = True
Index: llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCTargetDesc.cpp
===================================================================
--- llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCTargetDesc.cpp
+++ llvm/lib/Target/Lanai/MCTargetDesc/LanaiMCTargetDesc.cpp
@@ -97,6 +97,9 @@
uint64_t &Target) const override {
if (Inst.getNumOperands() == 0)
return false;
+ if (!isConditionalBranch(Inst) && !isUnconditionalBranch(Inst) &&
+ !isCall(Inst))
+ return false;
if (Info->get(Inst.getOpcode()).OpInfo[0].OperandType ==
MCOI::OPERAND_PCREL) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107593.371637.patch
Type: text/x-patch
Size: 1525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210909/3165ae6b/attachment.bin>
More information about the llvm-commits
mailing list