[LLVMdev] Question regarding ReplaceValueWith and ReplaceNodeResults
baldrick at free.fr
Sat Sep 1 06:16:44 PDT 2012
> I am defining Hexagons version of ReplaceNodeResults to change the a node of
> the type
> A: i8 = INTRINSIC_WO_CHAIN ... , ... ,
> B: SIGN_EXTEND (A)
as well as what Eli said, ReplaceNodeResults requires (IIRC) the new node to
have the same type as the old node, which doesn't seem to be the case here.
> After returning from my function, the type legalizer calss
> ReplaceValuesUsesWith to replace the uses of A with B. Unfortunately, it
> replaces the use of A in the new node B too. So the node now is
> B: SIGN_EXTEND(B) , which is clearly bad and the compiler crashes.
> In the backend, I tried to create a whole new A, say A` using the operands
> of A. That didn’t work either, because DAG.getNode(INTRINSIC_WO_CHAIN, .. ,
> .., operands of A) returned a memorized version of A itself leading to the
> same problem.
> FWIW, ReplaceNodeResults returns new nodes (B in this case) in a vector. Is
> there something wrong I am doing vis-à-vis the expectations of the
> SelectionDAG from the backend ?
> Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> hosted by The Linux Foundation
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev