[llvm-dev] BPF backend with vector operations - some strange error

RCU via llvm-dev llvm-dev at lists.llvm.org
Thu Jan 7 15:31:58 PST 2016


   Hello.
     I've tried to add some simple arithmetic vector operations to the BPF backend 
available in the LLVM repo. Because I added in BPFRegisterInfo.td another RegisterClass 
(taken from the Mips backend):
   def MSA128W: RegisterClass<"BPF", [v2i64, v2f64], 128,
                            (sequence "W%u", 0, 31)>;
in order to support vector for example, ADD operations, I get the following error when 
building llc:
   JEQ_ri:         (BPFbrcc i64:i64:$dst, (imm:i64)<<P:Predicate_i64immSExt32>>:$imm, 
(imm:{i64:v4i32})<<P:Predicate_BPF_CC_EQ>>, (bb:Other):$BrDst)
Included from ~/LLVM/llvm38Nov2016/llvm/lib/Target/BPF/BPF.td:14:
~/LLVM/llvm38Nov2016/llvm/lib/Target/BPF/BPFInstrInfo.td:131:1: error: In JEQ_ri: Could 
not infer all types in pattern!
   defm JEQ  : J<0x1, "jeq",  BPF_CC_EQ>;


   The error is a bit cryptic - basically it seems that we can have 2 different value 
types (i64 and v4i32) for immediate operand imm. I guess this is because in 
BPFRegisterInfo.td I define also another RegisterClass:
   def GPR : RegisterClass<"Connex", [i64], 64, (add (sequence "R%u", 0, 31))>;


   Can somebody tell me how can I get rid of this <<Could not infer all types in 
pattern!>> error message? (I can provide more info, if required.)

   Thank you,
     Alex


More information about the llvm-dev mailing list