[PATCH] D103968: [llvm][PowerPC] Add missing support for 'I' asm template argument modifiers
Timm Bäder via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 10 04:08:16 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa9e4f91adf59: [llvm][PPC] Add missing case for 'I' asm memory operands (authored by tbaeder).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103968/new/
https://reviews.llvm.org/D103968
Files:
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
llvm/test/CodeGen/PowerPC/asm-template-I.ll
Index: llvm/test/CodeGen/PowerPC/asm-template-I.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/PowerPC/asm-template-I.ll
@@ -0,0 +1,19 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-- | FileCheck %s
+; https://bugs.llvm.org/show_bug.cgi?id=50608
+
+define dso_local signext i32 @main(i32 signext %argc, i8** %argv) {
+; CHECK-LABEL: main:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: stw 3, -4(1)
+; CHECK-NEXT: li 3, 0
+; CHECK-NEXT: addi 4, 1, -4
+; CHECK-NEXT: #APP
+; CHECK-NEXT: .ascii "-1 at 0(4)"
+; CHECK-NEXT: .byte 0
+; CHECK-NEXT: #NO_APP
+; CHECK-NEXT: blr
+entry:
+ call void asm sideeffect " .asciz \22${0:n}@${1:I}$1\22 ", "n,nZr"(i32 1, i32 %argc)
+ ret i32 0
+}
Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
===================================================================
--- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -363,6 +363,12 @@
O << "0, ";
printOperand(MI, OpNo, O);
return false;
+ case 'I':
+ // Write 'i' if an integer constant, otherwise nothing. Used to print
+ // addi vs add, etc.
+ if (MI->getOperand(OpNo).isImm())
+ O << "i";
+ return false;
case 'U': // Print 'u' for update form.
case 'X': // Print 'x' for indexed form.
// FIXME: Currently for PowerPC memory operands are always loaded
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103968.351124.patch
Type: text/x-patch
Size: 1531 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210610/7e7222a1/attachment.bin>
More information about the llvm-commits
mailing list