<div dir="ltr">Hi, <div><br></div><div>I write a backend and come cross an abnormal problem. Here I give a example to describe it:</div><div><br></div><div>///////////////////////////////////////////////////////////////////////////////////////////</div>
<div style>// A simple C function</div><div style>int  foo()</div><div style>{</div><div style>  return 1234;</div><div style>}</div><div style>/////////////////////////////////////////////////////////////////////////////////////////</div>
<div style><br></div><div style>When compiling foo() into my target ISA, I would expect codes like:</div><div style><br></div><div style>/////////////////////////////////////////////////////////////////////////////////////////</div>
<div style>...</div><div style>movi  r0, #1234  // prepare r0 to return value 1234.</div><div style>...</div><div style>ret     // return to caller.</div><div style>////////////////////////////////////////////////////////////////////////////////////////</div>
<div style><br></div><div>The headache is when I pass option -O0 to llc, the generated codes are correct. However, if I omit -O0 and use default compiling options, the instruction "movi  r0, #1234" does not show.</div>
<div><br></div><div style>I have already checked DAGs using options -view-xxxxx-dags and they all seem OK.</div><div style><br></div><div style>I do not have any clue right now. Please help me.</div><div style><br></div><div style>
Thank you.</div><div><div><br></div>-- <br>杨勇勇 (Yang Yong-Yong)
</div></div>