[llvm] r214452 - Make classof in MemSDNode consistent with MemIntrinsicSDNode

Matt Arsenault arsenm2 at gmail.com
Mon Aug 4 17:51:57 PDT 2014


On Jul 31, 2014, at 3:31 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> Author: hfinkel
> Date: Thu Jul 31 17:31:33 2014
> New Revision: 214452
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=214452&view=rev
> Log:
> Make classof in MemSDNode consistent with MemIntrinsicSDNode
> 
> If INTRINSIC_W_CHAIN and INTRINSIC_VOID are MemIntrinsicSDNodes, and a
> MemIntrinsicSDNode is a MemSDNode, then INTRINSIC_W_CHAIN and INTRINSIC_VOID
> must be MemSDNodes too.
> 
> Noticed by inspection.
> 
> Modified:
>    llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
> 
> Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=214452&r1=214451&r2=214452&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Thu Jul 31 17:31:33 2014
> @@ -1158,6 +1158,8 @@ public:
>            N->getOpcode() == ISD::ATOMIC_LOAD_UMAX    ||
>            N->getOpcode() == ISD::ATOMIC_LOAD         ||
>            N->getOpcode() == ISD::ATOMIC_STORE        ||
> +           N->getOpcode() == ISD::INTRINSIC_W_CHAIN   ||
> +           N->getOpcode() == ISD::INTRINSIC_VOID      ||
>            N->isTargetMemoryOpcode();
>   }
> };
> 


This is breaking SI with -debug, trying to access a nonexistent memoperand:

  } else if (const MemSDNode* M = dyn_cast<MemSDNode>(this)) {
    OS << "<" << *M->getMemOperand() << ">";

If you run any test that uses some of the control flow intrinsics, this crashes when calling dump() on the node. These intrinsics have chains, but do not have any specific memory operand to be associated with. Is there something wrong with the current definitions for these? (e.g. int_SI_if)

To reproduce, run llc -debug -march=r600 -mcpu=tahiti test/CodeGen/R600/add.ll



More information about the llvm-commits mailing list