[PATCH] D88995: Support vectors in CastInst::isBitOrNoopPointerCastable

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 10 12:59:36 PDT 2020


reames added a comment.
Herald added a subscriber: arichardson.

Roman,

I think you're bringing in a concern to this review which does not belong here.  Simple load forwarding is a transformation we implement in multiple locations (GVN, EarlyCSE, InstCombine).  This patch doesn't even change how we handle inttoptrs.  Existing code today will forward an integer load to a pointer load and insert an inttoptr.  All this patch does is be consistent about handling the same cases for vectors.  I believe we should separate the concerns, and not commingle them.

To your actual question - which again, I believe is off topic for this review - we could consider extending the load transform to select the "better" of the two types, and potentially insert a cast for the former set of uses instead of the later.  If you want to avoid inttoptrs, we could canonicalize this case (consistently across the optimizer, not just here) to loading pointers and casting to ints.  I have to admit I don't fully understand the reasoning behind the desire to avoid inttoptr, so I'm not sure if this actually helps you or not.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88995



More information about the llvm-commits mailing list