[llvm-dev] Incompatible type assertion from llvm-tblgen

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 4 12:07:52 PDT 2016


On 3 October 2016 at 17:16, Phil Tomson via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> As the comment says, I'm not sure what code should go into the case where
> it's possibly a load.idx - Base and Offset are SDValues not SDNodes so I
> don't see how I could modify the DAG here to eliminate the shl - any ideas?

The shift-handling code would go into a different complex pattern that
only ever applied to the instruction variant that did the shift
(SelectAddrShlImm in your case by the looks of it).

You don't need to actually change the DAG here, just set the Base and
Offset parameters correctly (after checking the shift amount matches
too!). The generic code will use those operands instead of the SHL in
the selected instruction, and if the SHL ends up unused (often the
case, but not always since a value can be used multiple times) it'll
just be dropped for the final output.

Tim.


More information about the llvm-dev mailing list