[LLVMdev] A problem on returning value for functions
triple.yang at gmail.com
Tue Jul 9 08:17:06 PDT 2013
Thank you, this is very instructive. I soon realized I forgot to add
SDNPVariadic in my node definition of return operator.
And thus even though the LowerReturn() is implemented properly, the
instructions for passing return value is eliminated.
2013/7/9 Tim Northover <t.p.northover at gmail.com>
> > 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.
> It's probably being eliminated as dead code. You want to make sure
> that during ISelLowering your RET instruction has %R0 as one of its
> operands (check in the -view-isel-dags step).
> That's the most likely cause anyway. If not, posting the DAG might
> help, or the output of "llc -debug" on an equivalent .ll file.
杨勇勇 (Yang Yong-Yong)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev