[PATCH] D39030: Don't crash when we see unallocatable registers in clobbers

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 12:41:53 PDT 2017


efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.

LGTM, with one minor adjustment.



================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:948
+      if (Regs[I] == SP) {
+        assert(DAG.getMachineFunction().getFrameInfo().hasOpaqueSPAdjustment());
+      }
----------------
Somehow you lost a comment from the original code.  Also, the if statement around the assertion is a little weird.  Maybe something like the following?

    assert((Regs[I] != SP ||
            DAG.getMachineFunction().getFrameInfo().hasOpaqueSPAdjustment()) &&
           "If we clobbered the stack pointer, MFI should know about it.")


https://reviews.llvm.org/D39030





More information about the llvm-commits mailing list