Skip to content

Commit ad75a20

Browse files
sys-igcigcbot
authored andcommitted
[Autobackout][FunctionalRegression]Revert of change: 3218302: Lower VNNI-transforming shufflevector pattern in VC
.
1 parent 67a6ce3 commit ad75a20

File tree

4 files changed

+1
-106
lines changed

4 files changed

+1
-106
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXLowering.cpp

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ class GenXLowering : public FunctionPass {
230230
void lowerShuffleSplat(ShuffleVectorInst *SI,
231231
ShuffleVectorAnalyzer::SplatInfo Splat);
232232
bool lowerShuffleToSelect(ShuffleVectorInst *Inst);
233-
bool lowerShuffleToVNNI(ShuffleVectorInst *Inst, unsigned ExecSize);
234233
void lowerShuffleToMove(ShuffleVectorInst *SI);
235234
bool lowerShr(Instruction *Inst);
236235
bool lowerExtractValue(ExtractValueInst *Inst);
@@ -3127,62 +3126,17 @@ void GenXLowering::lowerShuffleSplat(ShuffleVectorInst *SI,
31273126
* Any other shuffle is currently unsupported
31283127
*/
31293128
bool GenXLowering::lowerShuffle(ShuffleVectorInst *SI) {
3130-
ShuffleVectorAnalyzer SVA(SI);
3131-
3132-
auto Splat = SVA.getAsSplat();
3129+
auto Splat = ShuffleVectorAnalyzer(SI).getAsSplat();
31333130
if (Splat.Input) {
31343131
lowerShuffleSplat(SI, Splat);
31353132
return true;
31363133
}
31373134
if (lowerShuffleToSelect(SI))
31383135
return true;
3139-
3140-
if (auto ExecSize = ST->getGRFByteSize() / genx::DWordBytes;
3141-
SVA.isVNNIShuffle(ExecSize))
3142-
return lowerShuffleToVNNI(SI, ExecSize);
3143-
31443136
lowerShuffleToMove(SI);
31453137
return true;
31463138
}
31473139

3148-
bool GenXLowering::lowerShuffleToVNNI(ShuffleVectorInst *SI,
3149-
unsigned ExecSize) {
3150-
auto *Ty = cast<IGCLLVM::FixedVectorType>(SI->getType());
3151-
auto *EltTy = Ty->getElementType();
3152-
auto EltSize = DL->getTypeSizeInBits(EltTy);
3153-
3154-
auto VNNIFactor = genx::DWordBits / EltSize;
3155-
3156-
auto *Src = SI->getOperand(0);
3157-
Value *Res = UndefValue::get(Ty);
3158-
3159-
vc::Region ReadRgn(SI);
3160-
ReadRgn.VStride = ExecSize * VNNIFactor;
3161-
ReadRgn.Width = ExecSize;
3162-
ReadRgn.Stride = 1;
3163-
ReadRgn.Offset = 0;
3164-
3165-
vc::Region WriteRgn(SI);
3166-
WriteRgn.VStride = VNNIFactor;
3167-
WriteRgn.Width = 1;
3168-
WriteRgn.Stride = 0;
3169-
WriteRgn.Offset = 0;
3170-
3171-
for (int I = 0; I < VNNIFactor; I++) {
3172-
auto *Read = ReadRgn.createRdRegion(Src, "", SI, SI->getDebugLoc());
3173-
Res = WriteRgn.createWrRegion(Res, Read, "", SI, SI->getDebugLoc());
3174-
ReadRgn.Offset += ExecSize * ReadRgn.ElementBytes;
3175-
WriteRgn.Offset += WriteRgn.ElementBytes;
3176-
}
3177-
3178-
auto *NewInst = cast<Instruction>(Res);
3179-
NewInst->takeName(SI);
3180-
SI->replaceAllUsesWith(NewInst);
3181-
ToErase.push_back(SI);
3182-
3183-
return true;
3184-
}
3185-
31863140
// Lower those shufflevector that can be implemented efficiently as select.
31873141
bool GenXLowering::lowerShuffleToSelect(ShuffleVectorInst *SI) {
31883142
int NumElements =

IGC/VectorCompiler/lib/GenXCodeGen/GenXUtil.cpp

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -495,43 +495,6 @@ bool ShuffleVectorAnalyzer::isReplicatedSlice() const {
495495
return true;
496496
}
497497

498-
bool ShuffleVectorAnalyzer::isVNNIShuffle(unsigned ExecSize) const {
499-
IGC_ASSERT(SI);
500-
501-
if (!SI->isSingleSource())
502-
return false;
503-
504-
auto *Ty = cast<IGCLLVM::FixedVectorType>(SI->getType());
505-
auto *EltTy = Ty->getElementType();
506-
auto EltSize = EltTy->getPrimitiveSizeInBits();
507-
508-
if (EltSize != genx::WordBits && EltSize != genx::ByteBits)
509-
return false;
510-
511-
auto VNNIFactor = genx::DWordBits / EltSize;
512-
513-
auto RowSize = ExecSize * VNNIFactor;
514-
auto NumElts = Ty->getNumElements();
515-
516-
if (NumElts % ExecSize * VNNIFactor != 0)
517-
return false;
518-
519-
auto Rows = NumElts / RowSize;
520-
521-
for (unsigned R = 0; R < Rows; ++R) {
522-
for (unsigned I = 0; I < ExecSize; ++I) {
523-
for (unsigned J = 0; J < VNNIFactor; ++J) {
524-
auto Idx = R * RowSize + I * VNNIFactor + J;
525-
auto ExpectedVal = R * RowSize + ExecSize * J + I;
526-
if (SI->getMaskValue(Idx) != ExpectedVal)
527-
return false;
528-
}
529-
}
530-
}
531-
532-
return true;
533-
}
534-
535498
Value *genx::getMaskOperand(const Instruction *Inst) {
536499
IGC_ASSERT(Inst);
537500

IGC/VectorCompiler/lib/GenXCodeGen/GenXUtil.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,6 @@ class ShuffleVectorAnalyzer {
341341
return ShuffleVectorAnalyzer(SI).getReplicatedSliceDescriptor();
342342
}
343343

344-
bool isVNNIShuffle(unsigned ExecSize) const;
345-
346344
// getAsUnslice : see if the shufflevector is an
347345
// unslice where the "old value" is operand 0 and operand 1 is another
348346
// shufflevector and operand 0 of that is the "new value" Returns start

IGC/VectorCompiler/test/Lowering/shufflevector-vnni-case.ll

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)