[llvm-dev] ConstantFP and Use

via llvm-dev llvm-dev at lists.llvm.org
Tue Feb 6 12:56:30 PST 2018


Hi all,

I've run into an assert in LegalizeTypes that is puzzling.  It is in
NodeUpdateListener::NodeUpdated:

    void NodeUpdated(SDNode *N) override {
      // Node updates can mean pretty much anything.  It is possible that an
      // operand was set to something already processed (f.e.) in which case
      // this node could become ready.  Recompute its flags.
      assert(N->getNodeId() != DAGTypeLegalizer::ReadyToProcess &&
             N->getNodeId() != DAGTypeLegalizer::Processed &&
             "Invalid node ID for RAUW deletion!");
      N->setNodeId(DAGTypeLegalizer::NewNode);
      NodesToAnalyze.insert(N);
    }

First off, I wonder if this assert is actually valid.  NodeUpdated is
called for more than node deletion (in fact AFAICT it's called for
everything *but* deletion).  The NodeDeleted member right above it has
the exact same assert, with the same message, leading me to suspect a
cut-n-paste logical error.

But let's assume for the moment the assert is ok.  It's been there a
long time and I've not been able to find other reports about it.

In the asserting case, I have a ConstantFP node in a Use structure where
the used value is from a load.  This seems unusual to me.  Why would a
ConstantFP appear in a Use?  It's a leaf node.  I suspect this is the
root of the problem but I wanted to check to make sure there wasn't some
sublety about Use that would make ConstantFP's appearance there not
unexpected.

Are my assumptions correct?  Anyone else run into a similar situation?

Thanks for the help!

                            -David


More information about the llvm-dev mailing list