This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fix the bug of pr62625
ClosedPublic

Authored by LuoYuanke on May 14 2023, 4:03 AM.

Details

Summary

We should not call tryOptimizeLEAtoMOV() in eliminateFrameIndex() when
the base register is a virtual register, because tryOptimizeLEAtoMOV
would assume the base register be physical register. Although we can
also optimize LEA to MOV with virtual register, I'd like to leave the
optimization in another patch.

Diff Detail

Event Timeline

LuoYuanke created this revision.May 14 2023, 4:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 14 2023, 4:03 AM
LuoYuanke requested review of this revision.May 14 2023, 4:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 14 2023, 4:03 AM
LuoYuanke edited the summary of this revision. (Show Details)May 14 2023, 4:06 AM
pengfei accepted this revision.May 14 2023, 5:40 AM

LGTM.

llvm/test/CodeGen/X86/x86-64-baseptr.ll
310

This can be void

This revision is now accepted and ready to land.May 14 2023, 5:40 AM
RKSimon accepted this revision.May 14 2023, 6:45 AM
RKSimon added a subscriber: RKSimon.

LGTM

llvm/test/CodeGen/X86/x86-64-baseptr.ll
310

You can probably add nounwind to strip some cfi noise

LuoYuanke updated this revision to Diff 522000.May 14 2023, 6:50 AM

Address Phoebe and Simon's comments.

This revision was landed with ongoing or failed builds.May 14 2023, 7:08 AM
This revision was automatically updated to reflect the committed changes.