[LLVMdev] Question regarding ReplaceValueWith and ReplaceNodeResults

Duncan Sands baldrick at free.fr
Sat Sep 1 06:16:44 PDT 2012

Hi Pranav,

> I am defining Hexagons version of ReplaceNodeResults to change the a node of
> the type
> A: i8 = INTRINSIC_WO_CHAIN ... , ... ,
> To

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.

Ciao, Duncan.

> 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 ?
> TIA,
> Pranav
> 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
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

More information about the llvm-dev mailing list