[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp LegalizeDAG.cpp SelectionDAG.cpp SelectionDAGISel.cpp TargetLowering.cpp

Chris Lattner clattner at apple.com
Mon Jul 2 11:53:51 PDT 2007


On Jun 29, 2007, at 12:38 PM, Dan Gohman wrote:

>>> Just as there isn't a special ADD node kind for vectors -- just  
>>> an ADD
>>> kind with nodes that can have a vector ValueType, ConstantFP can  
>>> also
>>> be "vectorized". A ConstantFP with a vector ValueType is a vector
>>> constant,
>>> equivalent to what is currently represented as a splat BUILD_VECTOR,
>>> except that it's easier to work with :).
>>
>> I'm not opposed to doing this, but I don't think we should overload
>> ConstantFP() and getConstantFP() for this.  Could you make a new
>> VectorConstantFP or something?
>
> We overload ISD::FADD and quite a lot of others. Why not  
> ISD::ConstantFP too?

Fair enough, after pondering on it, I agree with you.  The proposed  
semantics are that a ConstantFP (and also a normal Constant?) produce  
the splatted immediate value?

If so, this sounds fine.  This should also reduce codegen memory  
usage for many common cases, a very nice bonus :)

Please add a dag combine xform from build_vector [c,c,c,c] ->  
constantfp and friends.

Thanks Dan,

-Chris



More information about the llvm-commits mailing list