This is an archive of the discontinued LLVM Phabricator instance.

[InferAddressSpaces] Enhance the handling of cosntexpr.
ClosedPublic

Authored by hliao on May 9 2019, 2:29 PM.

Details

Summary
  • Constant expressions may not be added in strict postorder as the forward instruction scan order. Thus, for a constant express (CE0), if its operand (CE1) is used in an previous instruction, they are not in postorder. However, different from cloneInstructionWithNewAddressSpace, cloneConstantExprWithNewAddressSpace doesn't bookkeep uninferred instructions for later resolving. That results in failure of inferring constant address.
  • This patch adds the support to infer constant expression operand recursively, since there won't be loop, if that operand is another constant expression.

Diff Detail

Repository
rL LLVM

Event Timeline

hliao created this revision.May 9 2019, 2:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2019, 2:29 PM
arsenm accepted this revision.May 10 2019, 7:42 AM

LGTM, though I’m not sure I follow the part of the message where you conclude there can’t be a loop. You can have cycles in constant expressions, which I thought this already handles correctly

This revision is now accepted and ready to land.May 10 2019, 7:42 AM
This revision was automatically updated to reflect the committed changes.