diff --git a/IGC/VectorCompiler/lib/GenXCodeGen/GenXPatternMatch.cpp b/IGC/VectorCompiler/lib/GenXCodeGen/GenXPatternMatch.cpp index d7901d7e5b7c..c7b8aaa4c817 100644 --- a/IGC/VectorCompiler/lib/GenXCodeGen/GenXPatternMatch.cpp +++ b/IGC/VectorCompiler/lib/GenXCodeGen/GenXPatternMatch.cpp @@ -3311,17 +3311,11 @@ bool GenXPatternMatch::distributeIntegerMul(Function *F) { // where ShtAmt[0] is a constant vector and ShtAmt[i] are constant splats. static bool analyzeForShiftPattern(Constant *C, SmallVectorImpl &ShtAmt, - const DataLayout &DL, - const llvm::GenXSubtarget &Subtarget) { + const DataLayout &DL) { + unsigned Width = 8; auto *VT = dyn_cast(C->getType()); - if (!VT || VT->getScalarSizeInBits() == 1) + if (!VT || VT->getNumElements() <= Width || VT->getScalarSizeInBits() == 1) return false; - - unsigned ElmSz = VT->getScalarSizeInBits() / genx::ByteBits; - unsigned Width = Subtarget.getGRFByteSize() / ElmSz; - if (cast(VT)->getNumElements() <= Width) - return false; - unsigned NElts = VT->getNumElements(); if (NElts % Width != 0) return false; @@ -3394,9 +3388,6 @@ static bool analyzeForShiftPattern(Constant *C, } bool GenXPatternMatch::vectorizeConstants(Function *F) { - const GenXSubtarget *ST = &getAnalysis() - .getTM() - .getGenXSubtarget(); bool Changed = false; for (auto &BB : F->getBasicBlockList()) { for (auto I = BB.begin(); I != BB.end();) { @@ -3419,7 +3410,7 @@ bool GenXPatternMatch::vectorizeConstants(Function *F) { C->getSplatValue()) continue; SmallVector ShtAmt; - if (analyzeForShiftPattern(C, ShtAmt, *DL, *ST)) { + if (analyzeForShiftPattern(C, ShtAmt, *DL)) { // W1 = wrrregion(undef, ShtAmt[0], 0); // V2 = fadd ShtAmt[0], ShtAmt[1] // W2 = wrregion(W1, V2, Width)