[llvm-dev] RFC Storing BB order in llvm::Instruction for faster local dominance

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 25 20:10:51 PDT 2018


On Tue, Sep 25, 2018 at 2:35 PM Reid Kleckner <rnk at google.com> wrote:

> On Tue, Sep 25, 2018 at 12:16 PM Sanjoy Das <
> sanjoy at playingwithpointers.com> wrote:
>
>> Let's not assume a dichotomy between storing a int64 in
>> llvm::Instruction and bitwise tricks -- they're both ways of caching
>> position within llvm::Instruction.  I think we first need to establish
>> that we need such a cache in llvm::Instruction/llvm::BasicBlock at
>> all.
>>
>
After thinking more about this over the day, I thought about the bugs we
have when the cache isn't on the BasicBlock or Instruction. We have one
here: https://reviews.llvm.org/D50377

I would say that, while the expensive queries come from just a few passes
(DSE & memcpyopt), OrderedBasicBlock is widely used by more than just a few
transforms. Putting aside performance, the existence of all those
OrderedBasicBlock caches tells me that yes, we do need to cache this info,
and it is widely used. Maybe it doesn't need to live directly on
Instruction, but the cache should be maintained by BasicBlock.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180925/8c6d7bf2/attachment.html>


More information about the llvm-dev mailing list