[SDAG] Build up a more rich set of APIs for querying build-vector SDAG
authorChandler Carruth <chandlerc@gmail.com>
Tue, 8 Jul 2014 07:19:55 +0000 (07:19 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 8 Jul 2014 07:19:55 +0000 (07:19 +0000)
commitb844e72e8548a4afc8b69664fef31d2672bae28c
treec443c4dd0b2912ed6e77b84fdf0fb827999548e9
parent3f0a360f1823927d4f2a85f4d9f10b56c9dcda0d
[SDAG] Build up a more rich set of APIs for querying build-vector SDAG
nodes about whether they are splats. This is factored out and improved
from r212324 which got reverted as it was far too aggressive. The new
API should help more conservatively handle buildvectors that are
a mixture of splatted and undef values.

No functionality change at this point. The hope is to slowly
re-introduce the undef-tolerant optimization of splats, but each time
being forced to make a concious decision about how to handle the undefs
in a way that doesn't lead to contradicting assumptions about the
collapsed value.

Hal has pointed out in discussions that this may not end up being the
desired API and instead it may be more convenient to get a mask of the
undef elements or something similar. I'm starting simple and will expand
the API as I adapt actual callers and see exactly what they need.

llvm-svn: 212514
llvm/include/llvm/CodeGen/SelectionDAGNodes.h
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp