From b68eeff05ca0e95f8b244edfcf21ad950896091b Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 27 Feb 2020 21:29:52 -0800 Subject: [PATCH] [X86] Cleanup a comment around bitcasting X86ISD::VBROADCAST_LOAD and add an assert to make sure memory VT size doesn't change. --- llvm/lib/Target/X86/X86ISelLowering.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 94216c0..d528e49 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -37138,10 +37138,12 @@ static SDValue combineBitcast(SDNode *N, SelectionDAG &DAG, DAG.getBitcast(MVT::i16, N0.getOperand(0))); // Combine (bitcast (vbroadcast_load)) -> (vbroadcast_load). The memory VT - // determines // the number of bits loaded. Remaining bits are zero. + // determines the number of bits loaded. if (N0.getOpcode() == X86ISD::VBROADCAST_LOAD && N0.hasOneUse() && VT.getScalarSizeInBits() == SrcVT.getScalarSizeInBits()) { auto *BCast = cast(N0); + assert(VT.getScalarSizeInBits() == BCast->getMemoryVT().getSizeInBits() && + "Unexpected load size!"); SDVTList Tys = DAG.getVTList(VT, MVT::Other); SDValue Ops[] = { BCast->getChain(), BCast->getBasePtr() }; SDValue ResNode = -- 2.7.4