Replace terminator-based const eval limit

- Remove logic that limits const eval based on terminators, and use the
  stable metric instead (back edges + fn calls)
- Add unstable flag `tiny-const-eval-limit` to add UI tests that do not
  have to go up to the regular 2M step limit
This commit is contained in:
Bryan Garza
2022-12-29 23:14:29 +00:00
parent 8d99b0fc8d
commit eea42733ac
17 changed files with 138 additions and 61 deletions

View File

@@ -62,8 +62,6 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
return Ok(true);
}
M::before_terminator(self)?;
let terminator = basic_block.terminator();
self.terminator(terminator)?;
Ok(true)
@@ -130,7 +128,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
Coverage(..) => {}
ConstEvalCounter => {
self.increment_const_eval_counter();
M::increment_const_eval_counter(self)?;
}
// Defined to do nothing. These are added by optimization passes, to avoid changing the