[llvm-dev] Help request about ReplaceNode in ISelDAGToDAG

Ben Shi via llvm-dev llvm-dev at lists.llvm.org
Sat Aug 7 09:04:25 PDT 2021


Hello,


I would like to make some DAG transform in RISCV's ISelDAGToDAG, but I find the ReplaceNode() requests


the new Node to be a MachineNode( usually created be curDAG->getMachineNode with the opcode set to RISCV::xxxx).


Can I just pass it a SDNode (with opcode set to anoher ISD::xxx, not RISCV::xxx) ? It seems LLVM will crash.


Because I want to change the opcode to ADD, can I avoid the complexity of selecting ADDW/ADDI/ADDIW for a machine node in different cases?


Ben Shi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210808/adc837f3/attachment.html>


More information about the llvm-dev mailing list