forked from OSchip/llvm-project
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:
parent
997415fa77
commit
2b902f1288
|
@ -254,28 +254,6 @@ public:
|
||||||
return result;
|
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
|
/// Creates a deep copy of the specified instruction, remapping any operands
|
||||||
/// that use values outside of the instruction using the map that is provided
|
/// that use values outside of the instruction using the map that is provided
|
||||||
/// ( leaving them alone if no entry is present). Replaces references to
|
/// ( leaving them alone if no entry is present). Replaces references to
|
||||||
|
|
|
@ -426,8 +426,7 @@ ForInst *mlir::insertBackwardComputationSlice(MemRefAccess *srcAccess,
|
||||||
// Sanity check.
|
// Sanity check.
|
||||||
unsigned sliceSurroundingLoopsSize = sliceSurroundingLoops.size();
|
unsigned sliceSurroundingLoopsSize = sliceSurroundingLoops.size();
|
||||||
(void)sliceSurroundingLoopsSize;
|
(void)sliceSurroundingLoopsSize;
|
||||||
unsigned sliceLoopLimit = dstLoopDepth + numSrcLoopIVs;
|
assert(dstLoopDepth + numSrcLoopIVs >= sliceSurroundingLoopsSize);
|
||||||
assert(sliceLoopLimit >= sliceSurroundingLoopsSize);
|
|
||||||
|
|
||||||
// Update loop bounds for loops in 'sliceLoopNest'.
|
// Update loop bounds for loops in 'sliceLoopNest'.
|
||||||
for (unsigned i = 0; i < srcLoopDepth; ++i) {
|
for (unsigned i = 0; i < srcLoopDepth; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue