RedundantFlagCalculationElimination: do not eliminate if there are uses

we'll hit this with _ShiftFlags.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
Alyssa Rosenzweig 2024-04-05 18:18:01 -04:00
parent 90d5bd3aec
commit a99c48b7a3

View File

@ -366,7 +366,7 @@ bool DeadFlagCalculationEliminination::Run(IREmitter *IREmit) {
bool Eliminated = false;
if ((FlagsRead & Info.Write) == 0) {
if (Info.CanEliminate) {
if (Info.CanEliminate && CodeNode->GetUses() == 0) {
IREmit->Remove(CodeNode);
Eliminated = true;
Changed = true;