Pattern matching addrspacecast?

Hi all,

the addrspacecast stuff has landed and I'm now seeing failures in our back end because clang is emitting them, they're travelling through the IR to the SelectionDAG, and there's nothing to match them. Trying to match them, I get an error from TableGen saying:

Variable not defined: 'addrspacecast'

If I try to set a custom OperationAction in the target lowering class for ISD::ADDRSPACECAST, I never see LowerOperation invoked with that opcode (or with any other unknown operations). So what is the correct way of matching these nodes?



I haven't tried to use it either of those ways, and selected it manually. Here is a patch I started working on a while ago that haven't finished that does select it.


Thanks. It seems it does work if I set a custom operation action but don't have other bugs (too high a C++-to-coffee ratio yesterday, I suspect). It would be nice to be able to select it from TableGen, but I'm not sure how you'd express parameterised pattern matching in TableGen (i.e. use this instruction to cast from AS x to AS y, but this one for the converse).