<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div>
<div>Hello,</div>
<div><br>
</div>
<div>I’m trying to build an "ADD with shift immediate" machine instruction (ADD(register) Encoding T3; item A7.7.4 of the ARMv7-M manual) in an ARM machine function pass. Here is my code</div>
<br>
<div>    BuildMI(...., TII->get(ARM:<span data-emoji-typing="true">:t2ADDrs),</span> r1).addReg(r1).addReg(r1).addReg(r2).addImm(imm);</div>
<br>
<div>This code can compile, but  I got a failed assertion </div>
<div>     Assertion `idx < size()' failed. </div>
<div>thrown by llvm/include/llvm/ADT/SmallVector.h. when I compile test program with the pass.</div>
<br>
<div>I tried to tweak the registers and immediates added to the BuildMI() but haven't succeeded.</div>
<br>
<div>Can anyone give me some direction on how to tackle this problem?</div>
<br>
<div>Also, can anyone explain to me what </div>
<div>    pred<span data-emoji-typing="true">:14</span></div>
<div>and </div>
<div>   pred<span data-emoji-typing="true">:%noreg</span></div>
<div>mean in ARM machine instructions? I see them everywhere.</div>
<br>
<div>Thanks,</div>
<div>-Jie</div>
</div>
<img class="mailspring-open" alt="Sent from Mailspring" width="0" height="0" style="border:0; width:0; height:0;" src="https://link.getmailspring.com/open/17F5FE65-D997-4D70-B9C5-01B7911D8F8C@cs.rochester.edu?recipient=bGx2bS1kZXZAbGlzdHMubGx2bS5vcmc%3D">
</body>
</html>