<div dir="ltr">Hi,<div><br></div><div>I have written a PassManager (IR) pass that seriously increases the size of the original IR code. </div><div>As a result it seems that the generated machine code is incorrect (as of LLVM 3.5): The AsmPrinter generates the following instruction :</div><div>adr r2, .LJTI4_0_0</div><div>when going through the MC streamer, I get a "fatal error: error in backend: out of range pc-relative fixup" .</div><div>Apparently, the fixup does not hold in the 12 bits we have available. I would have expected clang to perform relaxation on this instruction on that particular case. Using the flag mrelax-all does not help.</div><div>Is there a way in the PassManager::runOnFunction to anticipate that so that I can generate a IR code that would fit when converted to machine code?</div><div>Strangely enough, this is not happening when using llc to generate the code from the bc file, I get the object file.</div><div>The target is armv5e-none-linux-androideabi ( I used -mtriple with llc).</div><div>I have seen a similar thread in 2012 "<span style="font-family:Arial,Helvetica,sans-serif;font-size:18px"> </span><span style="font-family:Arial,Helvetica,sans-serif">Questions on MachineFunctionPass and relaxation of pcrel calls (ARM/thumb2)". Even though there have been improvements since them, I am concerned with the difference of behavior of the two tools.</span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif">Thanks for your help.</span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif">Eric</span></div></div>