[PATCH] [IR] Make {extract, insert}element accept an index of any integer type.

Michael Spencer bigcheesegs at gmail.com
Tue Apr 29 12:27:07 PDT 2014


CCing Chris.
- Michael Spencer


On Tue, Apr 29, 2014 at 12:25 PM, Michael Spencer <bigcheesegs at gmail.com> wrote:
> Updated serialization.
>
> I audited all uses of {Insert,Extract}ElementInst and nothing makes assumptions about the type other than the bitcode reader/writer. There are lots of cases of generating a constant index, and these always use i32, but this is fine.
>
> There are no changes needed to selection dag because it is lowered with:
>
>   SDValue InIdx = DAG.getSExtOrTrunc(getValue(I.getOperand(1)),
>                                      getCurSDLoc(), TLI.getVectorIdxTy());
>
> So the rest of the backend already sees the type it is expecting.
>
> http://reviews.llvm.org/D3519
>
> Files:
>   docs/LangRef.rst
>   lib/Bitcode/Reader/BitcodeReader.cpp
>   lib/Bitcode/Writer/BitcodeWriter.cpp
>   lib/IR/Constants.cpp
>   lib/IR/Instructions.cpp
>   test/CodeGen/X86/vec_splat.ll
>   test/Feature/instructions.ll



More information about the llvm-commits mailing list