[LLVMdev] using the constant pool during select

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Sep 20 07:58:15 PDT 2006


In ARM, constants that are too large to be used as immediate are
usually placed in a constant pool and loaded.

What I am trying to do is to have a select function that checks the if
a constant can be an immediate and, if it can't, produces a load:

---------------------------------------------------------------------------------------
     const Type *OpNTy =  MVT::getTypeForValueType(MVT::i32);
      Constant *C = ConstantUInt::get(OpNTy, t);
      int alignment = 2;
      SDOperand Addr = CurDAG->getTargetConstantPool(C, MVT::i32, alignment);
      Arg =  CurDAG->getLoad(MVT::i32, CurDAG->getEntryNode(), Addr,
                             CurDAG->getSrcValue(NULL));
----------------------------------------------------------------------------------------

This fails with the assert "This target-independent node should have
been selected". It is illegal to create a load during select?

Should I write a lowering function to do this before the select phase?

Thanks,
Rafael



More information about the llvm-dev mailing list