diff options
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index b5940b1d780..246e494de78 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -5731,10 +5731,7 @@ static SDValue getShuffleVectorZeroOrUndef(SDValue V2, int Idx, return DAG.getVectorShuffle(VT, SDLoc(V2), V1, V2, MaskVec); } -static const Constant *getTargetConstantFromNode(SDValue Op) { - Op = peekThroughBitcasts(Op); - - auto *Load = dyn_cast<LoadSDNode>(Op); +static const Constant *getTargetConstantFromNode(LoadSDNode *Load) { if (!Load) return nullptr; @@ -5750,6 +5747,17 @@ static const Constant *getTargetConstantFromNode(SDValue Op) { return CNode->getConstVal(); } +static const Constant *getTargetConstantFromNode(SDValue Op) { + Op = peekThroughBitcasts(Op); + return getTargetConstantFromNode(dyn_cast<LoadSDNode>(Op)); +} + +const Constant * +X86TargetLowering::getTargetConstantFromLoad(LoadSDNode *LD) const { + assert(LD && "Unexpected null LoadSDNode"); + return getTargetConstantFromNode(LD); +} + // Extract raw constant bits from constant pools. static bool getTargetConstantBitsFromNode(SDValue Op, unsigned EltSizeInBits, APInt &UndefElts, |

