Don't perform gvn on instructions with other_side_effects().
This commit is contained in:
@@ -8,7 +8,7 @@ use std::collections::HashMap;
|
||||
/// Test whether the given opcode is unsafe to even consider for GVN.
|
||||
fn trivially_unsafe_for_gvn(opcode: Opcode) -> bool {
|
||||
opcode.is_call() || opcode.is_branch() || opcode.is_terminator() || opcode.is_return() ||
|
||||
opcode.can_trap()
|
||||
opcode.can_trap() || opcode.other_side_effects()
|
||||
}
|
||||
|
||||
/// Perform simple GVN on `func`.
|
||||
|
||||
Reference in New Issue
Block a user