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

Finkel, Hal J. hfinkel at anl.gov
Wed Aug 6 09:22:05 PDT 2014


Hi Matt,

Thanks for pointing this out. Unfortunately, it looks like we'll need to do some cleanup here. The class hierarchy is what it is, and the debug code like this is going to need to be changed to not unconditionally dereference the MMO.

I'll fix it this weekend or early next week.

-Hal

Sent from my Verizon Wireless 4G LTE DROID


Matt Arsenault <arsenm2 at gmail.com> wrote:


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140806/8426c318/attachment.html>


More information about the llvm-commits mailing list