[MIR] Promote temps to alloca on multi-assignment

Fixes #31002
This commit is contained in:
Simonas Kazlauskas 2016-01-21 18:57:43 +02:00
parent c4c9628de7
commit e74aa2bdff
4 changed files with 44 additions and 9 deletions

View file

@ -24,12 +24,14 @@ impl BitVector {
(self.data[word] & mask) != 0
}
/// Returns true if the bit has changed.
pub fn insert(&mut self, bit: usize) -> bool {
let (word, mask) = word_mask(bit);
let data = &mut self.data[word];
let value = *data;
*data = value | mask;
(value | mask) != value
let new_value = value | mask;
*data = new_value;
new_value != value
}
pub fn insert_all(&mut self, all: &BitVector) -> bool {