Is it possible to use this operand class in an instruction that has a pattern defined? If so, can you write it with anything besides a ComplexPattern in the instruction's pattern DAG, to set it to a value? Can you refer to it at all? Or would it be added to the MachineInstr with the default value such that you could modify it later in the backend? If there is a non-ComplexPattern way to write this, can you provide an example? Thanks, Joe
On Fri, Feb 01, 2013 at 04:58:29PM -0800, Joe Matarazzo wrote:> Is it possible to use this operand class in an instruction that has a > pattern defined? If so, can you write it with anything besides a > ComplexPattern in the instruction's pattern DAG, to set it to a value? > Can you refer to it at all? Or would it be added to the MachineInstr > with the default value such that you could modify it later in the > backend? >You can use OperandWithDefaultOps in an instruction with a pattern. Take a look at the R600 target it has a lot of instructions that use this operand class. It's been a while since I looked at this, but I don't think you can reference a member of this operand class in the pattern, but you should try it out to be sure. -Tom> If there is a non-ComplexPattern way to write this, can you provide an example? > > Thanks, > Joe > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Thanks for the reply Tom. I saw the InOperandList references to this op class (like negate / "NEG", for example), but I could see any cases where you referred to it in the pattern. That's why I was curious. Hope someone can clarify. On Fri, Feb 1, 2013 at 5:20 PM, Tom Stellard <tom at stellard.net> wrote:> On Fri, Feb 01, 2013 at 04:58:29PM -0800, Joe Matarazzo wrote: >> Is it possible to use this operand class in an instruction that has a >> pattern defined? If so, can you write it with anything besides a >> ComplexPattern in the instruction's pattern DAG, to set it to a value? >> Can you refer to it at all? Or would it be added to the MachineInstr >> with the default value such that you could modify it later in the >> backend? >> > > You can use OperandWithDefaultOps in an instruction with a pattern. > Take a look at the R600 target it has a lot of instructions that use > this operand class. > > It's been a while since I looked at this, but I don't think you can > reference a member of this operand class in the pattern, but you > should try it out to be sure. > > -Tom > > >> If there is a non-ComplexPattern way to write this, can you provide an example? >> >> Thanks, >> Joe >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Apparently Analagous Threads
- [LLVMdev] OperandWithDefaultOps question
- [LLVMdev] Be Careful with Positionally-Encoded Operands (AArch64, Mips, AMDGPU, etc.)
- [LLVMdev] Be Careful with Positionally-Encoded Operands (AArch64, Mips, AMDGPU, etc.)
- Immediate operand for load instruction, in back end
- [LLVMdev] [PATCH] R600/SI: Embed disassembly in ELF object