[PATCH] D115387: [instcombine] Canonicalize constant index type to i64 for extractelement/insertelement

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 8 13:39:08 PST 2021


reames added a comment.

In D115387#3180930 <https://reviews.llvm.org/D115387#3180930>, @nikic wrote:

> Hm, I see now that IRBuilder will use an i64 by default, which is presumably the reason for the choice.

Actually, the choice was much more arbitrary than that.  I tried both, and saw huge diffs with each.  Given that, I went with what I tend to write.

I could argue that this matches the canonicalization for GEP indices on most 64 bit targets, but really, I think this is pretty arbitrary.  If we were doing non-constants, we'd probably care a lot more about the choice, but with only constants we really shouldn't need to care as all the actual values are going to be extremely small (and thus representable with anything the target chooses pretty easily).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115387



More information about the llvm-commits mailing list