This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Provide a generic interface to check live instructions
ClosedPublic

Authored by jdoerfert on Aug 4 2019, 3:38 PM.

Details

Summary

Similar to Attributor::checkForAllCallSites, we now provide such
functionality for instructions of a certain opcode through
Attributor::checkForAllInstructions and the convenient wrapper
Attributor::checkForAllCallLikeInstructions. This cleans up code,
avoids duplication, and simplifies the usage of liveness information.

Diff Detail

Repository
rL LLVM

Event Timeline

jdoerfert created this revision.Aug 4 2019, 3:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2019, 3:38 PM
sstefan1 accepted this revision.Aug 4 2019, 5:07 PM

LGTM.

This revision is now accepted and ready to land.Aug 4 2019, 5:07 PM
This revision was automatically updated to reflect the committed changes.
plotfi added a subscriber: plotfi.Aug 5 2019, 5:45 PM

This is build breaking on Linux and Darwin: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/15961/steps/build/logs/stdio

Reverting.

/Users/plotfi/Projects/llvm-project/llvm/lib/Transforms/IPO/Attributor.cpp:2263:63: error: binding value of type 'const llvm::Function' to reference to type 'llvm::Function' drops 'const' qualifier
  auto &OpcodeInstMap = InfoCache.getOpcodeInstMapForFunction(F);
                                                              ^
/Users/plotfi/Projects/llvm-project/llvm/include/llvm/Transforms/IPO/Attributor.h:336:58: note: passing argument to parameter 'F' here
  OpcodeInstMapTy &getOpcodeInstMapForFunction(Function &F) {
                                                         ^
1 error generated.
plotfi added a comment.Aug 5 2019, 5:47 PM

nvm, beat me to it! Thanks! :-)

nvm, beat me to it! Thanks! :-)

I tested locally, saw the error (due to some rebasing), fixed it, tested, commited, and realized I didn't add the stuff somehow when I was flooded by emails... sorry for the noise.