Log name of the generated illegal operation name in DialectConversion debug mode

PiperOrigin-RevId: 268859399
This commit is contained in:
Smit Hinsu 2019-09-13 01:37:07 -07:00 committed by A. Unique TensorFlower
parent 2ccbb3f1ce
commit 1854c64c7c
1 changed files with 4 additions and 2 deletions

View File

@ -820,8 +820,10 @@ OperationLegalizer::legalizePattern(Operation *op, RewritePattern *pattern,
for (unsigned i = curState.numCreatedOperations,
e = rewriterImpl.createdOps.size();
i != e; ++i) {
if (failed(legalize(rewriterImpl.createdOps[i], rewriter))) {
LLVM_DEBUG(llvm::dbgs() << "-- FAIL: Generated operation was illegal.\n");
Operation *op = rewriterImpl.createdOps[i];
if (failed(legalize(op, rewriter))) {
LLVM_DEBUG(llvm::dbgs() << "-- FAIL: Generated operation '"
<< op->getName() << "' was illegal.\n");
return cleanupFailure();
}
}