Cranelift: Add egraph rule to rewrite x * C ==> x << log2(C) when C is a power of two (#5647)

This commit is contained in:
Nick Fitzgerald
2023-01-31 10:04:17 -08:00
committed by GitHub
parent 61270cdaed
commit c9d1c068bc
6 changed files with 64 additions and 4 deletions

View File

@@ -107,6 +107,12 @@ pub trait SubTest {
/// Run filecheck on `text`, using directives extracted from `context`.
pub fn run_filecheck(text: &str, context: &Context) -> anyhow::Result<()> {
log::debug!(
"Filecheck Input:\n\
=======================\n\
{text}\n\
======================="
);
let checker = build_filechecker(context)?;
if checker
.check(text, NO_VARIABLES)