[PATCH] D22001: [DSE] Remove dead stores in end blocks containing fence

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 10:27:08 PDT 2016


reames added a comment.

In http://reviews.llvm.org/D22001#475099, @anna wrote:

> In http://reviews.llvm.org/D22001#474590, @dexonsmith wrote:
>
> >
>
>
> `isa` works on references as well as pointers, so this can just be
>
>   if (isa<FenceInst>(*BBI))
>   
>
> Agree with Duncan, but the llvm ref states that this implicit conversion comes at a cost, and at some point in time, may be reverted to mean what standard iterators are. So, I'll leave it as-is to avoid any fix-ups required in future.
>
> "Unfortunately, these implicit conversions come at a cost; they prevent these iterators from conforming to standard iterator conventions, and thus from being usable with standard algorithms and containers. Because of this, these implicit conversions may be removed some day, and operator* changed to return a pointer instead of a reference."
>  http://llvm.org/docs/ProgrammersManual.html#basic-inspection-and-traversal-routines


Given this usage is wide spread through the codebase and would need to be fixed in bulk anyways, I'd rather see the simpler code here.


http://reviews.llvm.org/D22001





More information about the llvm-commits mailing list