How to lower a 'Store' node using the list<dag> pattern.

Hi,

I’m trying to complete the lowering for a new microcontroller. I’m using LLVM 3.8.

For now this lowering crashes on ‘Store’ node, which is actually not yet defined.

I’ve tried to map the ISel ‘Store’ node to architecture specific instructions.

I’ve define the following semantic to my architecture specific instructions:

def MOVSUTO_SU_rr : CLPSUInst_rr<0b1000001100,

(ins SURegisterOperand:$RegA),

(outs SURegisterOperand:$RegB),

[],

“movsuto_su\t$RegA,$RegB”,“RR”,

[(store (i16 SURegisterOperand:$RegA), i16:$RegB)], NoItinerary>

{

bits<9> RegA;

bits<9> RegB;

let Inst{19-11} = RegA;

let Inst{8-0} = RegB;

}

SURegisterOperand are 16 bits operands.

During the generation of ISelection matchers tables, I got the following assertion.

This assertion start to occur when the pattern is introduced on the MOVSUTO_SU_rr.

How to avoid such assertion? What is a concrete type? According to the definition of SURegisterOperand, these are 16 bits signed integer.

[ 33%] Building CLPGenDAGISel.inc…

llvm-tblgen: /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/utils/TableGen/CodeGenDAGPatterns.h:74: llvm::MVT::SimpleValueType llvm::EEVT::TypeSet::getConcrete() const: Assertion `isConcrete() && “Type isn’t concrete yet”’ failed.

#0 0x0000000000633741 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/lib/Support/Unix/Signals.inc:322:0

#1 0x0000000000633abd PrintStackTraceSignalHandler(void*) /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/lib/Support/Unix/Signals.inc:380:0

#2 0x0000000000632242 llvm::sys::RunSignalHandlers() /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/lib/Support/Signals.cpp:44:0

#3 0x0000000000633259 SignalHandler(int) /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/lib/Support/Unix/Signals.inc:210:0

#4 0x00000031fec0f790 __restore_rt (/lib64/libpthread.so.0+0x31fec0f790)

#5 0x00000031fe832625 __GI_raise (/lib64/libc.so.6+0x31fe832625)

#6 0x00000031fe833e05 __GI_abort (/lib64/libc.so.6+0x31fe833e05)

#7 0x00000031fe82b74e __assert_fail_base (/lib64/libc.so.6+0x31fe82b74e)

#8 0x00000031fe82b810 __GI___assert_perror_fail (/lib64/libc.so.6+0x31fe82b810)

#9 0x000000000047b8fe llvm::EEVT::TypeSet::getConcrete() const /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/utils/TableGen/CodeGenDAGPatterns.h:75:0

#10 0x000000000047be57 llvm::TreePatternNode::getType(unsigned int) const /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/utils/TableGen/CodeGenDAGPatterns.h:371:0

#11 0x0000000000523c1d (anonymous namespace)::MatcherGen::EmitResultInstructionAsOperand(llvm::TreePatternNode const*, llvm::SmallVectorImpl&) /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/utils/TableGen/DAGISelMatcherGen.cpp:844:0

#12 0x0000000000524608 (anonymous namespace)::MatcherGen::EmitResultOperand(llvm::TreePatternNode const*, llvm::SmallVectorImpl&) /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/utils/TableGen/DAGISelMatcherGen.cpp:942:0

#13 0x0000000000524768 (anonymous namespace)::MatcherGen::EmitResultCode() /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/utils/TableGen/DAGISelMatcherGen.cpp:966:0

#14 0x0000000000524b26 llvm::ConvertPatternToMatcher(llvm::PatternToMatch const&, unsigned int, llvm::CodeGenDAGPatterns const&) /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/utils/TableGen/DAGISelMatcherGen.cpp:1021:0

#15 0x0000000000510f36 (anonymous namespace)::DAGISelEmitter::run(llvm::raw_ostream&) /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/utils/TableGen/DAGISelEmitter.cpp:153:0

#16 0x0000000000511089 llvm::EmitDAGISel(llvm::RecordKeeper&, llvm::raw_ostream&) /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/utils/TableGen/DAGISelEmitter.cpp:171:0

#17 0x00000000005c74fd (anonymous namespace)::LLVMTableGenMain(llvm::raw_ostream&, llvm::RecordKeeper&) /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/utils/TableGen/TableGen.cpp:129:0

#18 0x000000000065016c llvm::TableGenMain(char*, bool (*)(llvm::raw_ostream&, llvm::RecordKeeper&)) /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/lib/TableGen/Main.cpp:109:0

#19 0x00000000005c79d5 main /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/utils/TableGen/TableGen.cpp:188:0

#20 0x00000031fe81ed5d __libc_start_main (/lib64/libc.so.6+0x31fe81ed5d)

#21 0x0000000000404fb9 _start (/home/dte/Projects/CLP/build_dir/bin/llvm-tblgen+0x404fb9)

Stack dump:

  1. Program arguments: …/…/…/bin/llvm-tblgen -gen-dag-isel -I /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/lib/Target/CLP -I /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/lib/Target -I /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/include /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/lib/Target/CLP/CLP.td -o /home/dte/Projects/CLP/build_dir/lib/Target/CLP/CLPGenDAGISel.inc.tmp

/bin/sh: line 1: 82456 Aborted (core dumped) …/…/…/bin/llvm-tblgen -gen-dag-isel -I /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/lib/Target/CLP -I /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/lib/Target -I /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/include /home/dte/Projects/CLP/clp-llvm/trunk/llvm-project/llvm/lib/Target/CLP/CLP.td -o /home/dte/Projects/CLP/build_dir/lib/Target/CLP/CLPGenDAGISel.inc.tmp

gmake[2]: *** [lib/Target/CLP/CLPGenDAGISel.inc.tmp] Error 134

gmake[1]: *** [lib/Target/CLP/CMakeFiles/CLPCommonTableGen.dir/all] Error 2

gmake: *** [all] Error 2

Hi Dominique,

This is generally a frontend-specific list. You should email to the llvm-dev (llvm-dev@lists.llvm.org) list if you have questions about SelectionDAG.

Alex