<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I'm adding MC support for a set of instructions containing braces and I'm<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">hitting an issue with InstAlias. I've reproduced it with the ldraa instruction -<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">the first AArch64 instruction I found in AArch64InstrFormats.td that uses<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">InstAlias.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The instruction takes a dst register, base address and optional offset. An<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">alias is used to implement no offset form:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> multiclass AuthLoad<bit M, string asm, Operand opr> {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> def indexed : BaseAuthLoad<M, 0, (outs GPR64:$Rt),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> (ins GPR64sp:$Rn, opr:$offset),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> asm, "\t$Rt, [$Rn, $offset]", "", opr>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> def writeback : BaseAuthLoad<M, 1, (outs GPR64sp:$wback, GPR64:$Rt),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> (ins GPR64sp:$Rn, opr:$offset),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> asm, "\t$Rt, [$Rn, $offset]!",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> "$Rn = $wback,@earlyclobber $wback", opr>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> def : InstAlias<asm # "\t$Rt, [$Rn]",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> (!cast<Instruction>(NAME # "indexed") GPR64:$Rt, GPR64sp:$Rn, 0)>; <-- HERE<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> def : InstAlias<asm # "\t$Rt, [$wback]!",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> (!cast<Instruction>(NAME # "writeback") GPR64sp:$wback, GPR64:$Rt, 0), 0>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Example usage:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $ echo "[0x20,0x04,0x20,0xf8]" | ./bin/llvm-mc -triple=aarch64 -show-encoding -mattr=+v8.3a -disassemble<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> .text<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ldraa x0, [x1] // encoding: [0x20,0x04,0x20,0xf8]<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">To recreate the issue I tried adding braces around the dst reg and base<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">address, e.g.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ldraa {x0, [x1]}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The first thing I tried was double braces "{{}}" which seems to work for the asm<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">string in an instruction definition, e.g.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> diff --git a/llvm/lib/Target/AArch64/AArch64InstrFormats.td b/llvm/lib/Target/AArch64/AArch64InstrFormats.td<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> index 6b23c7c..62bf67d 100644<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> --- a/llvm/lib/Target/AArch64/AArch64InstrFormats.td<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> +++ b/llvm/lib/Target/AArch64/AArch64InstrFormats.td<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> @@ -1632,7 +1632,7 @@ class BaseAuthLoad<bit M, bit W, dag oops, dag iops, string asm,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> multiclass AuthLoad<bit M, string asm, Operand opr> {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> def indexed : BaseAuthLoad<M, 0, (outs GPR64:$Rt),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> (ins GPR64sp:$Rn, opr:$offset),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> - asm, "\t$Rt, [$Rn, $offset]", "", opr>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> + asm, "\t{{$Rt, [$Rn, $offset]}}", "", opr>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> def writeback : BaseAuthLoad<M, 1, (outs GPR64sp:$wback, GPR64:$Rt),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> (ins GPR64sp:$Rn, opr:$offset),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> asm, "\t$Rt, [$Rn, $offset]!",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">but doesn't work when defining an InstAlias, e.g.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> diff --git a/llvm/lib/Target/AArch64/AArch64InstrFormats.td b/llvm/lib/Target/AArch64/AArch64InstrFormats.td<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> index 6b23c7c..44fb9a3 100644<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> --- a/llvm/lib/Target/AArch64/AArch64InstrFormats.td<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> +++ b/llvm/lib/Target/AArch64/AArch64InstrFormats.td<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> @@ -1638,7 +1638,7 @@ multiclass AuthLoad<bit M, string asm, Operand opr> {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> asm, "\t$Rt, [$Rn, $offset]!",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> "$Rn = $wback,@earlyclobber $wback", opr>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> - def : InstAlias<asm # "\t$Rt, [$Rn]",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> + def : InstAlias<asm # "\t{{$Rt, [$Rn]}}",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> (!cast<Instruction>(NAME # "indexed") GPR64:$Rt, GPR64sp:$Rn, 0)>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">where I'm see the following error from TableGen:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> [17/124] Building AArch64GenAsmMatcher.inc...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> FAILED: cd ./llvm-project/build && ./llvm-project/build/bin/llvm-tblgen -gen-asm-matcher -I ./llvm-project/llvm/lib/Target/AArch64 -I /usr/include/libxml2 -I ./llvm-project/build/include -I ./llvm-project/llvm/include
-I ./llvm-project/llvm/lib/Target ./llvm-project/llvm/lib/Target/AArch64/AArch64.td --write-if-changed -o lib/Target/AArch64/AArch64GenAsmMatcher.inc -d lib/Target/AArch64/AArch64GenAsmMatcher.inc.d<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> Included from ./llvm-project/llvm/lib/Target/AArch64/AArch64.td:431:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> Included from ./llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td:588:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ./llvm-project/llvm/lib/Target/AArch64/AArch64InstrFormats.td:1641:3: error: Instruction 'anonymous_2396' has operand 'Rt' that doesn't appear in asm string!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> def : InstAlias<asm # "\t{{$Rt, [$Rn]}}",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ^<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> Included from ./llvm-project/llvm/lib/Target/AArch64/AArch64.td:431:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ./llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.td:932:17: note: instantiated from multiclass<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> defm LDRAA : AuthLoad<0, "ldraa", simm10Scaled>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ^<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> [17/71] Building AArch64GenDAGISel.inc...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ninja: build stopped: subcommand failed.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">which led me to think it's trying to do some form of substitution for braces, so<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I tried the following hack using an OR where both sides are the same in the asm<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">string:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> diff --git a/llvm/lib/Target/AArch64/AArch64InstrFormats.td b/llvm/lib/Target/AArch64/AArch64InstrFormats.td<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> index 6b23c7c..97ed49e 100644<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> --- a/llvm/lib/Target/AArch64/AArch64InstrFormats.td<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> +++ b/llvm/lib/Target/AArch64/AArch64InstrFormats.td<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> @@ -1638,7 +1638,7 @@ multiclass AuthLoad<bit M, string asm, Operand opr> {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> asm, "\t$Rt, [$Rn, $offset]!",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> "$Rn = $wback,@earlyclobber $wback", opr>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> - def : InstAlias<asm # "\t$Rt, [$Rn]",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> + def : InstAlias<asm # "\t{{$Rt, [$Rn]}|{$Rt, [$Rn]}}",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> (!cast<Instruction>(NAME # "indexed") GPR64:$Rt, GPR64sp:$Rn, 0)>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> def : InstAlias<asm # "\t$Rt, [$wback]!",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Which seems to work fine.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Example usage:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> $ echo "[0x20,0x04,0x20,0xf8]" | ./bin/llvm-mc -triple=aarch64 -show-encoding -mattr=+v8.3a -disassemble<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> .text<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ldraa {x0, [x1]} // encoding: [0x20,0x04,0x20,0xf8]<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">FWIW I also tried double escaping, e.g.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> diff --git a/llvm/lib/Target/AArch64/AArch64InstrFormats.td b/llvm/lib/Target/AArch64/AArch64InstrFormats.td<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> index 6b23c7c..1d74aaf 100644<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> --- a/llvm/lib/Target/AArch64/AArch64InstrFormats.td<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> +++ b/llvm/lib/Target/AArch64/AArch64InstrFormats.td<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> @@ -1638,7 +1638,7 @@ multiclass AuthLoad<bit M, string asm, Operand opr> {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> asm, "\t$Rt, [$Rn, $offset]!",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> "$Rn = $wback,@earlyclobber $wback", opr>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> - def : InstAlias<asm # "\t$Rt, [$Rn]",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> + def : InstAlias<asm # "\t\\{$Rt, [$Rn]\\}",<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> (!cast<Instruction>(NAME # "indexed") GPR64:$Rt, GPR64sp:$Rn, 0)>;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Which actually worked on LLVM 9 but warnings are emitted:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> [20/70] Building CXX object lib/Target/AArch64/MCTargetDesc/CMakeFiles/LLVMAArch64Desc.dir/AArch64InstPrinter.cpp.o<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> In file included from ./llvm-project/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp:39:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> lib/Target/AArch64/AArch64GenAsmWriter.inc:23094:23: warning: use of non-standard escape character '\{' [-Wpedantic]<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> /* 7811 */ "ldraa \{$\x01, [$\x02]\}\0"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ^~<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">On upstream master I also hit a bunch of the following asserts, just to clarify<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">addv is unrelated and I made no changes there. This is just an example from one<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">of the many failures:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ********************<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> FAIL: LLVM :: CodeGen/AArch64/aarch64-addv.ll (6528 of 36856)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ******************** TEST 'LLVM :: CodeGen/AArch64/aarch64-addv.ll' FAILED ********************<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> Script:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> --<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> : 'RUN: at line 1'; ./llvm-project/build/bin/llc < ./llvm-project/llvm/test/CodeGen/AArch64/aarch64-addv.ll -mtriple=aarch64-eabi -aarch64-neon-syntax=generic | ./llvm-project/build/bin/FileCheck ./llvm-project/llvm/test/CodeGen/AArch64/aarch64-addv.ll<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> --<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> Exit Code: 2<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> Command Output (stderr):<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> --<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> llc: ./llvm-project/llvm/lib/MC/MCInstPrinter.cpp:168: const char *llvm::MCInstPrinter::matchAliasPatterns(const llvm::MCInst *, const llvm::MCSubtargetInfo *, const llvm::AliasMatchingData &): Assertion
`AsmStrOffset < M.AsmStrings.size() && (AsmStrOffset == 0 || M.AsmStrings[AsmStrOffset - 1] == '\0') && "bad asm string offset"' failed.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> Stack dump:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> 0. Program arguments: ./llvm-project/build/bin/llc -mtriple=aarch64-eabi -aarch64-neon-syntax=generic<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> 1. Running pass 'Function Pass Manager' on module '<stdin>'.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> 2. Running pass 'AArch64 Assembly Printer' on function '@add_B'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #0 0x00007f2bc94d2167 llvm::sys::PrintStackTrace(llvm::raw_ostream&) ./llvm-project/llvm/lib/Support/Unix/Signals.inc:564:11<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #1 0x00007f2bc94d2309 PrintStackTraceSignalHandler(void*) ./llvm-project/llvm/lib/Support/Unix/Signals.inc:625:1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #2 0x00007f2bc94d0b1b llvm::sys::RunSignalHandlers() ./llvm-project/llvm/lib/Support/Signals.cpp:67:5<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #3 0x00007f2bc94d2a55 SignalHandler(int) ./llvm-project/llvm/lib/Support/Unix/Signals.inc:406:1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #4 0x00007f2bc8695390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #5 0x00007f2bc79eb428 raise /build/glibc-LK5gWL/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #6 0x00007f2bc79ed02a abort /build/glibc-LK5gWL/glibc-2.23/stdlib/abort.c:91:0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #7 0x00007f2bc79e3bd7 __assert_fail_base /build/glibc-LK5gWL/glibc-2.23/assert/assert.c:92:0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #8 0x00007f2bc79e3c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #9 0x00007f2bca6a1a2b llvm::MCInstPrinter::matchAliasPatterns(llvm::MCInst const*, llvm::MCSubtargetInfo const*, llvm::AliasMatchingData const&) ./llvm-project/llvm/lib/MC/MCInstPrinter.cpp:169:10<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #10 0x00007f2bcd11b1be llvm::AArch64InstPrinter::printAliasInstr(llvm::MCInst const*, unsigned long, llvm::MCSubtargetInfo const&, llvm::raw_ostream&) ./llvm-project/build/lib/Target/AArch64/AArch64GenAsmWriter.inc:23456:15<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #11 0x00007f2bcd12373c llvm::AArch64InstPrinter::printInst(llvm::MCInst const*, unsigned long, llvm::StringRef, llvm::MCSubtargetInfo const&, llvm::raw_ostream&) ./llvm-project/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp:298:7<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #12 0x00007f2bca6c542f llvm::MCTargetStreamer::prettyPrintAsm(llvm::MCInstPrinter&, unsigned long, llvm::MCInst const&, llvm::MCSubtargetInfo const&, llvm::raw_ostream&) ./llvm-project/llvm/lib/MC/MCStreamer.cpp:979:1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #13 0x00007f2bca63d6b7 (anonymous namespace)::MCAsmStreamer::emitInstruction(llvm::MCInst const&, llvm::MCSubtargetInfo const&) ./llvm-project/llvm/lib/MC/MCAsmStreamer.cpp:1972:5<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #14 0x00007f2bcbf60c8c llvm::AsmPrinter::EmitToStreamer(llvm::MCStreamer&, llvm::MCInst const&) ./llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:235:1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #15 0x00007f2bcdc9d3e2 (anonymous namespace)::AArch64AsmPrinter::emitInstruction(llvm::MachineInstr const*) ./llvm-project/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp:1317:1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #16 0x00007f2bcbf65689 llvm::AsmPrinter::emitFunctionBody() ./llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1176:25<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #17 0x00007f2bcdc9af09 (anonymous namespace)::AArch64AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) ./llvm-project/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp:142:5<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #18 0x00007f2bcb96bd17 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) ./llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:73:8<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #19 0x00007f2bcae2750c llvm::FPPassManager::runOnFunction(llvm::Function&) ./llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1482:23<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #20 0x00007f2bcae27935 llvm::FPPassManager::runOnModule(llvm::Module&) ./llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1518:16<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #21 0x00007f2bcae28094 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) ./llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1583:23<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #22 0x00007f2bcae27bd8 llvm::legacy::PassManagerImpl::run(llvm::Module&) ./llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1695:16<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #23 0x00007f2bcae28631 llvm::legacy::PassManager::run(llvm::Module&) ./llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1726:3<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #24 0x000000000022237f compileModule(char**, llvm::LLVMContext&) ./llvm-project/llvm/tools/llc/llc.cpp:627:41<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #25 0x00000000002208df main ./llvm-project/llvm/tools/llc/llc.cpp:360:13<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #26 0x00007f2bc79d6830 __libc_start_main /build/glibc-LK5gWL/glibc-2.23/csu/../csu/libc-start.c:325:0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> #27 0x0000000000220029 _start (./llvm-project/build/bin/llc+0x220029)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> FileCheck error: '<stdin>' is empty.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> FileCheck command line: ./llvm-project/build/bin/FileCheck ./llvm-project/llvm/test/CodeGen/AArch64/aarch64-addv.ll<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> --<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I'm wondering if there is a better way to do this than the hack I came up with<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">or if this is a gap in InstAlias/TableGen?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Any ideas or thoughts would greatly appreciated.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Cullen<o:p></o:p></span></p>
</div>
</body>
</html>