Page MenuHomePhabricator

Fix the lowering issue of intrinsics llvm.localaddress on X86
ClosedPublic

Authored by LuoYuanke on Jan 30 2019, 11:47 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

LuoYuanke created this revision.Jan 30 2019, 11:47 PM
rnk added inline comments.Jan 31 2019, 6:07 PM
lib/Target/X86/X86ISelLowering.cpp
22363 ↗(On Diff #184459)

Why doesn't this already work? The comment exists just to point out that getPtrSizedFrameRegister will sometimes select SP based on exactly the condition you've listed here, unless I'm mistaken.

Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2019, 6:07 PM
LuoYuanke marked an inline comment as done.Jan 31 2019, 6:36 PM
LuoYuanke added inline comments.
lib/Target/X86/X86ISelLowering.cpp
22363 ↗(On Diff #184459)

I think when stack is realigned, compiler choose sp as base to access local variable, however bp is still used to recover sp when return from the function.

rnk accepted this revision.Feb 5 2019, 2:18 PM

lgtm

lib/Target/X86/X86ISelLowering.cpp
22363 ↗(On Diff #184459)

I see the issue, hasFP is true for this function, but SP is used to address local variables.

This revision is now accepted and ready to land.Feb 5 2019, 2:18 PM
This revision was automatically updated to reflect the committed changes.