[LLVMdev] Using branches in lowered operations

Eli Friedman eli.friedman at gmail.com
Tue Dec 15 20:36:27 PST 2009

On Tue, Dec 15, 2009 at 4:23 PM, Javier Martinez <javier at jmartinez.org> wrote:
> Hi Evan,
> Thanks for the useful pointer. When trying to implement the example to my
> situation I ran into a strange issue that I don't know how to resolve.
> My target doesn't support 64-bit operations and so far all operations have
> been expanded using LLVM except for division and remainder. For division,
> LLVM only gives you the option of either calling an external library or
> custom lowering the division. If the operation is custom lowered, because
> the return type (i64) is not legal, LLVM ends up calling into
> ReplaceNodeResults(). ReplaceNodeResults() has the restriction that the
> result has to have the same number of values and types. This forces the
> lowering function to return a target defined custom i64 node. At the next
> legalization cycle ExpandIntegerResults() is called to expand this node
> causing an assert because getOperationAction doesn't operate on custom
> nodes.

You should return a BUILD_PAIR of a custom node returning a split result.


More information about the llvm-dev mailing list