[llvm-commits] [llvm] r51157 - in /llvm/trunk: include/llvm/Constants.h include/llvm/Instruction.def include/llvm/Instructions.h include/llvm/Support/InstVisitor.h lib/AsmParser/llvmAsmParser.cpp.cvs lib/AsmParser/llvmAsmParser.h.cvs lib/AsmParser/llvmAsmParser.y lib/AsmParser/llvmAsmParser.y.cvs lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/VMCore/ConstantFold.cpp lib/VMCore/ConstantFold.h lib/VMCore/Constants.cpp lib/VMCore/Instructions.cpp lib/VMCore/Verifier.cpp test/Verifier/2002-11-05-GetelementptrPointers.ll

Duncan Sands baldrick at free.fr
Fri May 16 12:39:40 PDT 2008


Hi Dan,

> > Do you want to allow this on VectorType?  ...
> 
> I don't know yet. It turns out that getelementptr works on vector types,
> and that made me think having extractelement/insertelement support them
> as well. It would make the IR more concise, because a single  
> extractevalue
> could be used where otherwise an extractvalue followed by an  
> extractelement
> would be needed. But it also means instcombine would have to do for
> extractvalue/insertvalue what it does for extractelement/insertelement.
> And there's no advantage for codegen.

it would be nice to get rid of VectorType and just use ArrayType.  What
used to be VectorType would just mean an ArrayType where the element type
is an integer or floating point type (so operations like adding vectors
make sense), and for these component-wise operations like addition would
allowed.  At codegen time, some ArrayType's would be lowered at once to
components (those which can't possibly benefit from machine vector
operations, such as arrays where the element type is neither integer nor
floating point), while the rest can be legalized like VectorType is now.

One problem with this scheme is that vector extractelement/insertelement
can take a non-constant index.  Is that actually useful?  If not, they
could be eliminated in favor of extractvalue/insertvalue.  Otherwise an
idea is needed to simplify this aspect :)

Ciao,

Duncan.



More information about the llvm-commits mailing list