This is an archive of the discontinued LLVM Phabricator instance.

[GISel] Unify use of getStackGuard()
ClosedPublic

Authored by Kai on Jul 12 2022, 10:20 AM.

Details

Summary

Some rework of getStackGuard() based on comments in https://reviews.llvm.org/D129505.

  • getStackGuard() now returns the destination register, simplifying calls
  • passing the destination register is optional and only required for llvm.stackguard
  • removed PtrMemTy in emitSPDescriptorParent(), because this type is only used here when loading but not when storing the value

Diff Detail

Event Timeline

Kai created this revision.Jul 12 2022, 10:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2022, 10:20 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Kai requested review of this revision.Jul 12 2022, 10:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2022, 10:20 AM
Kai added a comment.Jul 12 2022, 10:23 AM

I'm not sure if all changes are really worthy. Especially the changed order of arguments in getStackGuard() feels strange.

However, I think that removing use of PtrMemTy makes sense, as this type is only used when loading the value in emitSPDescriptorParent(), but not when storing it,

arsenm added inline comments.Jul 12 2022, 10:26 AM
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
1636

Should use the pointer type / address space from the original IR instruction rather than re-figuring it out

2080

I don't see the point in calling getOrCreateVReg here

Kai added inline comments.Jul 12 2022, 10:42 AM
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
1636

Well, there is no original IR instruction for the call in emitSPDescriptorParent(), because the BB containing the check is completely generated in the IRTranslator.

2080

Agree, I'll change that,

Kai updated this revision to Diff 444042.Jul 12 2022, 12:12 PM

Pass existing type to getStackGuard() to avoid recomputation.

arsenm accepted this revision.Jul 12 2022, 1:05 PM
This revision is now accepted and ready to land.Jul 12 2022, 1:05 PM
This revision was landed with ongoing or failed builds.Jul 12 2022, 1:46 PM
This revision was automatically updated to reflect the committed changes.

Why was this reverted?

Kai added a comment.Sep 19 2022, 9:24 AM

The change creates some regressions on the buildbots which I was not yet able to reproduce.