[PATCH] D76923: [NFC] Improve performances of Value::getSingleUndroppableUse

Tyker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 28 05:55:37 PDT 2020


Tyker updated this revision to Diff 253334.
Tyker added a comment.

In D76923#1946433 <https://reviews.llvm.org/D76923#1946433>, @nikic wrote:

> I do wonder whether there's a middle ground here: Rather than adding a tag to `Use`, we could use a bit of subclass data on `CallInst` to indicate whether the call is droppable. That would reduce `User->isDroppable()` to a compare and mask check, and we could at least inline it.


from profiling i saw that most of the cost of getSingleUndroppableUse comes from Use::getUser (+0.16%) and not from User::isDroppable (+0.05%). so i don't think this would make the difference we want.

with this revision i moved the tag to the Prev pointer because it is accessed much less than Val and it already has a tag so i just added a bit to the tag.
maybe this revision has less overhead.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76923/new/

https://reviews.llvm.org/D76923

Files:
  llvm/include/llvm/IR/Use.h
  llvm/include/llvm/IR/User.h
  llvm/include/llvm/IR/Value.h
  llvm/lib/IR/Instructions.cpp
  llvm/lib/IR/Use.cpp
  llvm/lib/IR/User.cpp
  llvm/lib/IR/Value.cpp
  llvm/lib/Transforms/IPO/Attributor.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76923.253334.patch
Type: text/x-patch
Size: 7926 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200328/07e4e765/attachment-0001.bin>


More information about the llvm-commits mailing list