Delete FuncBuilder::createChecked. It is perhaps still a good idea, but has no

clients.  Let's re-add it in the future if there is ever a reason to.  NFC.

Unrelatedly, add a use of a variable to unbreak the non-assert build.

PiperOrigin-RevId: 228284026
This commit is contained in:
Chris Lattner 2019-01-07 22:12:30 -08:00 committed by jpienaar
parent 997415fa77
commit 2b902f1288
2 changed files with 1 additions and 24 deletions

View File

@ -254,28 +254,6 @@ public:
return result;
}
/// Creates an operation of specific op type at the current insertion point.
/// If the result is an invalid op (the verifier hook fails), emit an error
/// and return null.
template <typename OpTy, typename... Args>
OpPointer<OpTy> createChecked(Location location, Args... args) {
OperationState state(getContext(), location, OpTy::getOperationName());
OpTy::build(this, &state, args...);
auto *inst = createOperation(state);
// If the OperationInst we produce is valid, return it.
if (!OpTy::verifyInvariants(inst)) {
auto result = inst->dyn_cast<OpTy>();
assert(result && "Builder didn't return the right type");
return result;
}
// Otherwise, the error message got emitted. Just remove the instruction
// we made.
inst->erase();
return OpPointer<OpTy>();
}
/// Creates a deep copy of the specified instruction, remapping any operands
/// that use values outside of the instruction using the map that is provided
/// ( leaving them alone if no entry is present). Replaces references to

View File

@ -426,8 +426,7 @@ ForInst *mlir::insertBackwardComputationSlice(MemRefAccess *srcAccess,
// Sanity check.
unsigned sliceSurroundingLoopsSize = sliceSurroundingLoops.size();
(void)sliceSurroundingLoopsSize;
unsigned sliceLoopLimit = dstLoopDepth + numSrcLoopIVs;
assert(sliceLoopLimit >= sliceSurroundingLoopsSize);
assert(dstLoopDepth + numSrcLoopIVs >= sliceSurroundingLoopsSize);
// Update loop bounds for loops in 'sliceLoopNest'.
for (unsigned i = 0; i < srcLoopDepth; ++i) {