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? David
On 02/05/2014 05:53 AM, David Chisnall wrote:> 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? > > David > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >Hi, 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. http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140203/204018.html -Matt
On 5 Feb 2014, at 18:56, Matt Arsenault <Matthew.Arsenault at amd.com> wrote:> On 02/05/2014 05:53 AM, David Chisnall wrote: >> 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? >> >> David >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > Hi, > > 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. > > http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140203/204018.htmlThanks. 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). David