This is an archive of the discontinued LLVM Phabricator instance.

[LLC][MIPS] Fix crash after enabling LLVM_ENABLE_EXPENSIVE_CHECKS
ClosedPublic

Authored by nitesh.jain on Dec 15 2016, 10:48 PM.

Details

Summary

With the LLVM_ENABLE_EXPENSIVE_CHECKS enabled, following sequence of passes are executed:

 …
Dominator Tree Construction
Basic Alias Analysis (stateless AA impl)
Function Alias Analysis Results
Natural Loop Information
Branch Probability Analysis
MIPS DAG->DAG Pattern Instruction Selection
Branch Probability Analysis
MIPS DAG->DAG Pattern Instruction Selection
Expand ISel Pseudo-instructions
Tail Duplication
 ….

The Dominator tree is the indirect require dependency of "MIPS DAG->DAG Pattern Instruction Selection" pass. The dominator tree construction pass is freed before the second pass of "MIPS DAG->DAG Pattern Instruction Selection". This causes code to crash when it verify the preserved analysis after the second pass is executed

Diff Detail

Event Timeline

nitesh.jain retitled this revision from to [LLC][MIPS] Fix crash after enabling LLVM_ENABLE_EXPENSIVE_CHECKS.
nitesh.jain updated this object.
nitesh.jain added a reviewer: sdardis.
nitesh.jain set the repository for this revision to rL LLVM.
sdardis accepted this revision.Dec 20 2016, 3:58 AM
sdardis edited edge metadata.

LGTM.

lib/Target/Mips/MipsSEISelDAGToDAG.cpp
35

This include should come after: #include "llvm/IR/CFG.h"

This revision is now accepted and ready to land.Dec 20 2016, 3:58 AM
nitesh.jain updated this revision to Diff 83017.Jan 4 2017, 1:24 AM
nitesh.jain edited edge metadata.
nitesh.jain removed rL LLVM as the repository for this revision.

Update Diff as per suggestion.

nitesh.jain marked an inline comment as done.Jan 4 2017, 1:37 AM
This revision was automatically updated to reflect the committed changes.