[DAG] Add BuildVectorSDNode::getConstantRawBits helper
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 8 Nov 2021 12:07:26 +0000 (12:07 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 8 Nov 2021 12:07:38 +0000 (12:07 +0000)
commitf60d3ec0c7fd324bccf2275c8f28c390b2b5f069
tree592ee9b0c763dd75897cd9152e6bff5cb7bf6d08
parent1726c956aea0ec524dcd602b1add733cffebe2e9
[DAG] Add BuildVectorSDNode::getConstantRawBits helper

We have several places where we need to extract the raw bits data from a BUILD_VECTOR node, so consolidate this to a single helper function that handles Undefs and Integer/FP constants, including implicit truncation.

This should make it easier to extend D113202 to handle more constant folding of bitcasted constant data.

Differential Revision: https://reviews.llvm.org/D113351
llvm/include/llvm/CodeGen/SelectionDAGNodes.h
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp