]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #104605 - RalfJung:clf_consts, r=bjorn3
authorMatthias Krüger <matthias.krueger@famsik.de>
Mon, 21 Nov 2022 13:11:12 +0000 (14:11 +0100)
committerGitHub <noreply@github.com>
Mon, 21 Nov 2022 13:11:12 +0000 (14:11 +0100)
commitd3817e23397bac109440383d845d29152f8bfa4e
tree423596c822c940c5ea71da2b0de960614195370a
parent5fd3e4dabbc4786a5b7dfc4a0efe1c2e865c719e
parenta3c89a7ade837cb3d64c17e0b58a67d2c57f2887
Rollup merge of #104605 - RalfJung:clf_consts, r=bjorn3

deduplicate constant evaluation in cranelift backend

The cranelift backend had two matches on `ConstantKind`, which can be avoided, and used this `eval_for_mir` that nothing else uses... this makes things more consistent with the (better-tested) LLVM backend.

I noticed this because cranelift was the only user of `eval_for_mir`. However `try_eval_for_mir` still has one other user in `eval`... the odd thing is that the interpreter has its own `eval_mir_constant` which seems to duplicate the same functionality and does not use `try_eval_for_mir`. No idea what is happening here.

r? ``@bjorn3``
Cc ``@lcnr``