Skip to content

[TableGen] Ignore inaccessible memory when checking pattern flags #90061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3616,7 +3616,15 @@ class InstAnalyzer {
hasChain = true;

if (const CodeGenIntrinsic *IntInfo = N.getIntrinsicInfo(CDP)) {
ModRefInfo MR = IntInfo->ME.getModRef();
// Ignore reads/writes to inaccessible memory. These should not imply
// mayLoad/mayStore on the instruction because they are often used to
// model dependencies that Machine IR expresses as uses/defs of a
// special physical register.
ModRefInfo MR = ModRefInfo::NoModRef;
for (MemoryEffects::Location Loc : MemoryEffects::locations()) {
if (Loc != MemoryEffects::Location::InaccessibleMem)
MR |= IntInfo->ME.getModRef();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Silly typo here. It should have been:

Suggested change
MR |= IntInfo->ME.getModRef();
MR |= IntInfo->ME.getModRef(Loc);

Because of this the patch had no effect, and if I fix the typo then it causes some build failures.

I will revert and rethink.

}
// If this is an intrinsic, analyze it.
if (isRefSet(MR))
mayLoad = true; // These may load memory.
Expand Down
Loading