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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 08:59:26 PST 2021


spatel added a comment.

In D115387#3182240 <https://reviews.llvm.org/D115387#3182240>, @lebedev.ri wrote:

> Whatever we choose will be wrong anyway so let's go for i32 unless we actually need those uppper 32 bits to be usable.

If no target has a chance of codegen'ing anything close to that limit, I'd go for i32. For example, this may not finish in any practical timeframe with llc?

  define void @f(<1048576 x i8>* %x) {
    %v = load <1048576 x i8>, <1048576 x i8>* %x
    %add = add <1048576 x i8> %v, %v
    store <1048576 x i8> %add, <1048576 x i8>* %x
    ret void
  }

No matter what value is chosen, we should make a helper function and/or give the bitwidth a name, so we're not using a magic constant in multiple places.


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