Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
rikhuijzer committed Dec 20, 2024
1 parent df018c9 commit 000bc00
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions xrcf/src/ir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,8 @@ impl Block {
None
}
pub fn assignment_in_ops(&self, name: &str) -> Option<Arc<RwLock<Value>>> {
let ops = self.ops();
let ops = ops.rd();
for op in ops.iter() {
let op = op.rd();
let values = op.assignments();
assert!(values.is_ok());
let values = values.unwrap();
let values = values.vec();
let values = values.rd();
for value in values.iter() {
for op in self.ops().rd().iter() {
for value in op.rd().assignments().unwrap().into_iter() {
match &*value.rd() {
Value::BlockArgument(_block_argument) => {
// Ignore this case because we are looking for
Expand All @@ -241,10 +233,8 @@ impl Block {
Value::Constant(_) => continue,
Value::FuncResult(_) => return None,
Value::OpResult(op_result) => {
let current_name = op_result.name();
let current_name = current_name.rd();
if let Some(current_name) = &*current_name {
if current_name == name {
if let Some(curr) = &*op_result.name().rd() {
if curr == name {
return Some(value.clone());
}
}
Expand Down

0 comments on commit 000bc00

Please sign in to comment.