[PATCH] D107593: [Lanai] fix MC / objdump
Serge Bazanski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 9 10:04:48 PDT 2021
q3k updated this revision to Diff 371641.
q3k marked an inline comment as done.
q3k added a comment.
Another review comment round.
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/smoke.ll
Index: llvm/test/tools/llvm-objdump/ELF/Lanai/smoke.ll
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-objdump/ELF/Lanai/smoke.ll
@@ -0,0 +1,13 @@
+; RUN: llc -o %t.bc -filetype=obj -mtriple=lanai %s
+; RUN: llvm-objdump -d -S %t.bc | 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.371641.patch
Type: text/x-patch
Size: 1517 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210909/fd3f2d7a/attachment.bin>
More information about the llvm-commits
mailing list