a very strange question about adding new instrinsic.

Hi:
I want add new Instrinsic for my target. So I first do some test.

I add them in IntrinsicsPowerPC.td
//===--------------------===//
let TargetPrefix = “ppc” in {
def int_ppc_mytest : Intrinsic<[llvm_void_ty], [], [IntrWriteMem]>;
}
//===--------------------===//


I add them in PPCInstrInfo.td
//===--------------------===//
def MYTEST : XForm_24_sync<31, 599, (outs), (ins),
“mytest”, LdStSync,
[(int_ppc_mytest)]>;
//===--------------------===//



I insert them in mycase.ll
//===--------------------===//
call void @llvm.ppc.mytest()

declare void @llvm.ppc.mytest(…) nounwind
//===--------------------===//

then : llvm-as mycase.ll -o mycase.bc
llc -march=ppc32 mycase.bc -o mycase.s
I get in mycase.s :
stwx 4, 5, 3
62 la 3, .str@l(8)
63 mytest <----my test instruction.
64 creqv 0, 0, 0
65 li 30, 0

BUT when I implement them to my target, llc error:
llc: /backup/AndesCC/llvm/include/llvm/Support/Casting.h:199: typename llvm::cast_retty<To, From>::ret_type llvm::cast(const Y&) [with X = llvm::ConstantSDNode, Y = llvm::SDValue]: Assertion `isa(Val) && “cast() argument of incompatible type!”’ failed.

Why? I miss something??

Thanks

Ren Kun


|