Get the store data, if any, from an instruction.
(func: &Function, inst: Inst)
| 137 | |
| 138 | /// Get the store data, if any, from an instruction. |
| 139 | pub fn inst_store_data(func: &Function, inst: Inst) -> Option<Value> { |
| 140 | match &func.dfg.insts[inst] { |
| 141 | InstructionData::Store { args, .. } | InstructionData::StoreNoOffset { args, .. } => { |
| 142 | Some(args[0]) |
| 143 | } |
| 144 | _ => None, |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | /// Determine whether this opcode behaves as a memory fence, i.e., |
| 149 | /// prohibits any moving of memory accesses across it. |