Skip to content

Remove InitializeNonlocalInstruction#4558

Merged
dbartol merged 10 commits intogithub:mainfrom
rdmarsh2:rdmarsh2/cpp/remove-initialize-nonlocal
Nov 19, 2020
Merged

Remove InitializeNonlocalInstruction#4558
dbartol merged 10 commits intogithub:mainfrom
rdmarsh2:rdmarsh2/cpp/remove-initialize-nonlocal

Conversation

@rdmarsh2
Copy link
Contributor

This removes InitializeNonlocalInstruction from the IR, which should result in a small performance improvement in building the IR. I think the consistency checks need to be adjusted to handle phi nodes for global and static variables which don't have their address taken, but I'm not sure exactly how to identify those.

Robert Marsh added 2 commits October 21, 2020 12:12
Instead, have AliasedDefinition initialize read-only nonlocal memory
The conflation-related changes result from aliased accesses for which a
precise Phi node is generated.
Copy link
Contributor

@jbj jbj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great to see that this diff takes away more than it adds.

@MathiasVP
Copy link
Contributor

Yay for fewer instructions 🎉 ! Apparently, GitHub doesn't allow comments on collapsed lines, so I'm leaving this as a comment instead:

I guess now that we no longer have an InitializeNonLocal instruction this comment on the canDefineReadOnly override in AllNonLocalMemory doesn't make sense anymore, right?

  override predicate canDefineReadOnly() {
    // A "must" access that defines all non-local memory appears only on the `InitializeNonLocal`
    // instruction, which provides the initial definition for all memory outside of the current
    // function's stack frame. This memory includes string literals and other read-only globals, so
    // we allow such an access to be the definition for a use of a read-only location.
    not isMayAccess()
  }

@rdmarsh2
Copy link
Contributor Author

Yeah, I think I can just make that override predicate canDefineReadOnly() { none() } now.

@jbj
Copy link
Contributor

jbj commented Nov 3, 2020

The tests are passing. Is it time to take this out of draft mode?

Removes the IR consistency checks for conflated memory and marks
instructions that have a conflated result with a percent sign (%)
instead. This avoids reimplementing part of the alias analysis logic
in the consistency check.
@rdmarsh2 rdmarsh2 marked this pull request as ready for review November 10, 2020 17:15
@rdmarsh2 rdmarsh2 requested review from a team as code owners November 10, 2020 17:15
Accept test changes from IR temporaries and block ordering
dbartol
dbartol previously approved these changes Nov 18, 2020
Copy link

@dbartol dbartol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (@rdmarsh2 and I had already discussed most of these changes via Zoom).

@rdmarsh2 rdmarsh2 requested a review from dbartol November 18, 2020 21:21
Copy link

@dbartol dbartol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dbartol dbartol merged commit 08efd7f into github:main Nov 19, 2020
@rdmarsh2 rdmarsh2 deleted the rdmarsh2/cpp/remove-initialize-nonlocal branch November 19, 2020 01:43
MathiasVP added a commit to MathiasVP/ql that referenced this pull request Nov 25, 2020
…ove-initialize-nonlocal"

This reverts commit 08efd7f, reversing
changes made to cb8c5e8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants