@@ -3311,17 +3311,11 @@ bool GenXPatternMatch::distributeIntegerMul(Function *F) {
3311
3311
// where ShtAmt[0] is a constant vector and ShtAmt[i] are constant splats.
3312
3312
static bool analyzeForShiftPattern (Constant *C,
3313
3313
SmallVectorImpl<Constant *> &ShtAmt,
3314
- const DataLayout &DL,
3315
- const llvm::GenXSubtarget &Subtarget) {
3314
+ const DataLayout &DL) {
3315
+ unsigned Width = 8 ;
3316
3316
auto *VT = dyn_cast<IGCLLVM::FixedVectorType>(C->getType ());
3317
- if (!VT || VT->getScalarSizeInBits () == 1 )
3317
+ if (!VT || VT->getNumElements () <= Width || VT-> getScalarSizeInBits () == 1 )
3318
3318
return false ;
3319
-
3320
- unsigned ElmSz = VT->getScalarSizeInBits () / genx::ByteBits;
3321
- unsigned Width = Subtarget.getGRFByteSize () / ElmSz;
3322
- if (cast<IGCLLVM::FixedVectorType>(VT)->getNumElements () <= Width)
3323
- return false ;
3324
-
3325
3319
unsigned NElts = VT->getNumElements ();
3326
3320
if (NElts % Width != 0 )
3327
3321
return false ;
@@ -3394,9 +3388,6 @@ static bool analyzeForShiftPattern(Constant *C,
3394
3388
}
3395
3389
3396
3390
bool GenXPatternMatch::vectorizeConstants (Function *F) {
3397
- const GenXSubtarget *ST = &getAnalysis<TargetPassConfig>()
3398
- .getTM <GenXTargetMachine>()
3399
- .getGenXSubtarget ();
3400
3391
bool Changed = false ;
3401
3392
for (auto &BB : F->getBasicBlockList ()) {
3402
3393
for (auto I = BB.begin (); I != BB.end ();) {
@@ -3419,7 +3410,7 @@ bool GenXPatternMatch::vectorizeConstants(Function *F) {
3419
3410
C->getSplatValue ())
3420
3411
continue ;
3421
3412
SmallVector<Constant *, 8 > ShtAmt;
3422
- if (analyzeForShiftPattern (C, ShtAmt, *DL, *ST )) {
3413
+ if (analyzeForShiftPattern (C, ShtAmt, *DL)) {
3423
3414
// W1 = wrrregion(undef, ShtAmt[0], 0);
3424
3415
// V2 = fadd ShtAmt[0], ShtAmt[1]
3425
3416
// W2 = wrregion(W1, V2, Width)
0 commit comments