HomePhabricator

[Statepoints] Fix a bug in statepoint lowering for functions w/no-realign-stack

Description

[Statepoints] Fix a bug in statepoint lowering for functions w/no-realign-stack

We were silently using the ABI alignment for all of the stores generated for deopt and gc values. We'd gotten the alignment of the stack slot itself properly reduced (via MachineFrameInfo's clamping), but having the MMO on the store incorrect was enough for us to generate an aligned store to a unaligned location.

The simplest fix would have been to just pass the alignment to the helper function, but once we do that, the helper function doesn't really help. So, inline it and directly call the MMO version of DAG.getStore with a properly constructed MMO.

Note that there's a separate performance possibility here. Even if we *can* realign stacks, we probably don't *want to* if all of the stores are in slowpaths. But that's a later patch, if at all. :)

Details

Committed
reamesJul 22 2019, 4:33 PM
Parents
rL366764: Fix pointer width in test from r366754.
Branches
Unknown
Tags
Unknown

Event Timeline

modocache added inline comments.
/llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
400

@lhames Apologies if this is already fixed or if I'm missing something, but: this patch references variable MFI, which I believe is only declared #ifndef NDEBUG above. I don't see any of the public buildbots failing, but I'm not sure why. Wouldn't release builds with asserts disabled fail to compile this patch?

400

Oh, I'm very sorry, I meant to @-mention @reames, I got the names confused.

smeenai added inline comments.
/llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
400
smeenai added inline comments.Jul 22 2019, 10:27 PM
/llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
400

rL366773 fixed this.

reames marked an inline comment as done.Jul 23 2019, 9:35 AM
reames added inline comments.
/llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
400

Thanks for doing so.

smeenai added a subscriber: rtrieu.Jul 23 2019, 9:53 AM
smeenai added inline comments.
/llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
400

Just to be clear, @rtrieu fixed it – I'm just the messenger :)