Skip to content

Memory Transform Bug #592#595

Closed
JTrenerry wants to merge 5 commits intomainfrom
mem-transform-bug
Closed

Memory Transform Bug #592#595
JTrenerry wants to merge 5 commits intomainfrom
mem-transform-bug

Conversation

@JTrenerry
Copy link
Contributor

@JTrenerry JTrenerry commented Jan 28, 2026

Fixes #592.

Code is quiet ugly as Loads cannot be directly changed to a Extract, so BVSHL / BVLSHR are used instead to mediate this change.

TODO:

  • : Fix index to be dynamic
  • : Formating
  • : CustomSort and MapType
  • : Remove / simplify long comment explaining store process
  • : Find and Fix why tests fail

…r to int, may need a new IR operator to fix this but unsure at the moment
…ic offset from the addr, but the global offset
@JTrenerry JTrenerry self-assigned this Jan 28, 2026
@JTrenerry JTrenerry added the bug Something isn't working label Jan 28, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2026

scalafmt changes needed.

options to apply scalafmt changes:

run this command:

echo 'From cebe5b72396161763fb57851dc8d0fd89483e4ed Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
 <41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 28 Jan 2026 02:28:31 +0000
Subject: [PATCH] automated scalafmt

---
 src/main/scala/ir/transforms/MemoryTransform.scala | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/main/scala/ir/transforms/MemoryTransform.scala b/src/main/scala/ir/transforms/MemoryTransform.scala
index 8f7b364..0ed42db 100644
--- a/src/main/scala/ir/transforms/MemoryTransform.scala
+++ b/src/main/scala/ir/transforms/MemoryTransform.scala
@@ -190,8 +190,3 @@ class MemoryTransform(dsa: Map[Procedure, IntervalGraph], globals: Map[IntervalN
                 ChangeTo(List(LocalAssign(lhs, resBV, store.label)))
-              else
-                ChangeTo(
-                  List(
-                    LocalAssign(LocalVar(name, store.value.getType), store.value, store.label)
-                  )
-                )
+              else ChangeTo(List(LocalAssign(LocalVar(name, store.value.getType), store.value, store.label)))
             else if !flag.escapes || isGlobal(flag) then
-- 
2.52.0' | git am -3

or, trigger a workflow run on mem-transform-bug with autoformat=true, either by using the website or by using the gh tool:

gh workflow run format.yml --field "autoformat=true" --ref 'mem-transform-bug'

or, run the formatter locally:

./mill -i fmt

last updated at 55ce8c1 (logs).

@l-kent
Copy link
Contributor

l-kent commented Jan 28, 2026

This approach isn't going to do anything to address the problem here. A more detailed explanation is here: #592 (comment)

@JTrenerry
Copy link
Contributor Author

#592

@JTrenerry JTrenerry closed this Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory transform: Over simplification of IR

2 participants