<div dir="ltr"><div>Hi,</div><div><br></div><div>Recently I hit an issue that LLJIT crashes when CodeGenOpt::Less or higher is given. <br></div><div>After investigation, it turned out that the issue is some global constant string in the IR, like</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>@.str.117 = private unnamed_addr constant [9 x i8] c"lineitem\00", align 1</div></blockquote><div>becomes an invalid pointer in the generated code. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>$1 = 0xf7fab054 <error: Cannot access memory at address 0xf7fab054></div></blockquote><div><br></div><div>The issue doesn't show up when CodeGenOpt::None is given. It also doesn't show up when the host program (which uses the LLVM library) is compiled with "-O0". So it looks like some kind of use-after-free issue.</div><div><br></div><div>Does any one have seen similar issues before, or have some idea on how to fix this?</div><div>Thanks!<br></div><div><br></div><div>Best,</div><div>Haoran<br></div><div><br></div></div>