Move bitselect->vselect optimization to x64 back-end (#5191)
The simplifier was performing an optimization to replace bitselect with vselect if the all bytes of the condition mask could be shown to be all ones or all zeros. This optimization only ever made any difference in codegen on the x64 target. Therefore, move this optimization to the x64 back-end and perform it in ISLE instead. Resulting codegen should be unchanged, with slightly improved compile time. This also eliminates a few endian-dependent bitcast operations.
This commit is contained in:
@@ -713,6 +713,15 @@ impl Context for IsleContext<'_, '_, MInst, Flags, IsaFlags, 6> {
|
||||
targets.len() as u32
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn vconst_all_ones_or_all_zeros(&mut self, constant: Constant) -> Option<()> {
|
||||
let const_data = self.lower_ctx.get_constant_data(constant);
|
||||
if const_data.iter().all(|&b| b == 0 || b == 0xFF) {
|
||||
return Some(());
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn fcvt_uint_mask_const(&mut self) -> VCodeConstant {
|
||||
self.lower_ctx
|
||||
|
||||
Reference in New Issue
Block a user