Skip to content

[TwoAddressInstruction] Track MadeChange when eliminating REG_SEQUENCE#173535

Merged
TejaX-Alaghari merged 1 commit intollvm:mainfrom
TejaX-Alaghari:twoaddr-regsequence-madechange
Jan 13, 2026
Merged

[TwoAddressInstruction] Track MadeChange when eliminating REG_SEQUENCE#173535
TejaX-Alaghari merged 1 commit intollvm:mainfrom
TejaX-Alaghari:twoaddr-regsequence-madechange

Conversation

@TejaX-Alaghari
Copy link
Copy Markdown
Contributor

When eliminateRegSequence() is called, the pass modifies the MachineFunction but MadeChange was not being set to true.
This causes the pass to incorrectly return PreservedAnalyses::all() even though changes were made.

}

++NumTwoAddressInstrs;
MadeChange = true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be set down here?

Copy link
Copy Markdown
Contributor Author

@TejaX-Alaghari TejaX-Alaghari Dec 26, 2025

Choose a reason for hiding this comment

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

One corner case I can think of is -
If a function has only a REG_SEQUENCE and no other instructions with tied ops, collectTiedOperands() returns false, so we continue before reaching L#1899.

@TejaX-Alaghari TejaX-Alaghari force-pushed the twoaddr-regsequence-madechange branch from 77ace2e to 95656fe Compare January 12, 2026 16:27
@TejaX-Alaghari
Copy link
Copy Markdown
Contributor Author

Ping

@TejaX-Alaghari TejaX-Alaghari merged commit 9339d41 into llvm:main Jan 13, 2026
10 checks passed
c-rhodes pushed a commit that referenced this pull request Jan 13, 2026
#173535)

When `eliminateRegSequence()` is called, the pass modifies the
`MachineFunction` but `MadeChange` was not being set to true.
This causes the pass to incorrectly return `PreservedAnalyses::all()`
even though changes were made.
Priyanshu3820 pushed a commit to Priyanshu3820/llvm-project that referenced this pull request Jan 18, 2026
llvm#173535)

When `eliminateRegSequence()` is called, the pass modifies the
`MachineFunction` but `MadeChange` was not being set to true.
This causes the pass to incorrectly return `PreservedAnalyses::all()`
even though changes were made.
@TejaX-Alaghari TejaX-Alaghari deleted the twoaddr-regsequence-madechange branch January 31, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants