Skip to content

Commit c5da639

Browse files
sys-igcigcbot
authored andcommitted
[Autobackout][FunctionalRegression]Revert of change: 9a7edea: Changes in code
Changes in code
1 parent 75d5cdc commit c5da639

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+87
-946
lines changed

IGC/AdaptorOCL/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set(IGC_BUILD__SRC__AdaptorOCL
2020
"${CMAKE_CURRENT_SOURCE_DIR}/LowerInvokeSIMD.cpp"
2121
"${CMAKE_CURRENT_SOURCE_DIR}/ResolveConstExprCalls.cpp"
2222
"${CMAKE_CURRENT_SOURCE_DIR}/preprocess_spvir/PreprocessSPVIR.cpp"
23-
"${CMAKE_CURRENT_SOURCE_DIR}/preprocess_spvir/PromoteSubByte.cpp"
23+
"${CMAKE_CURRENT_SOURCE_DIR}/preprocess_spvir/PromoteBools.cpp"
2424
"${CMAKE_CURRENT_SOURCE_DIR}/preprocess_spvir/HandleSPIRVDecorations/HandleSpirvDecorationMetadata.cpp"
2525
)
2626

@@ -89,7 +89,7 @@ set(IGC_BUILD__HDR__AdaptorOCL
8989
"${CMAKE_CURRENT_SOURCE_DIR}/MoveStaticAllocas.h"
9090
"${CMAKE_CURRENT_SOURCE_DIR}/LowerInvokeSIMD.hpp"
9191
"${CMAKE_CURRENT_SOURCE_DIR}/ResolveConstExprCalls.h"
92-
"${CMAKE_CURRENT_SOURCE_DIR}/preprocess_spvir/PromoteSubByte.h"
92+
"${CMAKE_CURRENT_SOURCE_DIR}/preprocess_spvir/PromoteBools.h"
9393
"${CMAKE_CURRENT_SOURCE_DIR}/preprocess_spvir/HandleSPIRVDecorations/HandleSpirvDecorationMetadata.h"
9494
"${CMAKE_CURRENT_SOURCE_DIR}/preprocess_spvir/PreprocessSPVIR.h"
9595

IGC/AdaptorOCL/UnifyIROCL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ SPDX-License-Identifier: MIT
115115
#include "MoveStaticAllocas.h"
116116
#include "preprocess_spvir/PreprocessSPVIR.h"
117117
#include "preprocess_spvir/ConvertUserSemanticDecoratorOnFunctions.h"
118-
#include "preprocess_spvir/PromoteSubByte.h"
118+
#include "preprocess_spvir/PromoteBools.h"
119119
#include "preprocess_spvir/HandleSPIRVDecorations/HandleSpirvDecorationMetadata.h"
120120
#include "LowerInvokeSIMD.hpp"
121121
#include "ResolveConstExprCalls.h"
@@ -276,7 +276,7 @@ static void CommonOCLBasedPasses(OpenCLProgramContext *pContext) {
276276

277277
IGCPassManager mpmSPIR(pContext, "Unify");
278278
mpmSPIR.add(new PreprocessSPVIR());
279-
mpmSPIR.add(new PromoteSubByte());
279+
mpmSPIR.add(new PromoteBools());
280280
mpmSPIR.add(new TypesLegalizationPass());
281281
mpmSPIR.add(new TargetLibraryInfoWrapperPass());
282282
mpmSPIR.add(new MetaDataUtilsWrapper(pMdUtils, pContext->getModuleMetaData()));

IGC/AdaptorOCL/preprocess_spvir/PromoteSubByte.cpp renamed to IGC/AdaptorOCL/preprocess_spvir/PromoteBools.cpp

Lines changed: 66 additions & 250 deletions
Large diffs are not rendered by default.

IGC/AdaptorOCL/preprocess_spvir/PromoteSubByte.h renamed to IGC/AdaptorOCL/preprocess_spvir/PromoteBools.h

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SPDX-License-Identifier: MIT
99
#pragma once
1010

1111
#include "common/LLVMWarningsPush.hpp"
12-
#include "llvmWrapper/IR/DerivedTypes.h"
12+
#include "llvmWrapper/IR/Module.h"
1313
#include <llvm/Pass.h>
1414
#include <llvm/IR/InstVisitor.h>
1515
#include <llvm/IR/IRBuilder.h>
@@ -24,14 +24,14 @@ SPDX-License-Identifier: MIT
2424
}
2525

2626
namespace IGC {
27-
class PromoteSubByte : public llvm::ModulePass, public llvm::InstVisitor<PromoteSubByte> {
27+
class PromoteBools : public llvm::ModulePass, public llvm::InstVisitor<PromoteBools> {
2828
public:
2929
static char ID;
3030

31-
PromoteSubByte();
32-
~PromoteSubByte() {}
31+
PromoteBools();
32+
~PromoteBools() {}
3333

34-
virtual llvm::StringRef getPassName() const override { return "PromoteSubByte"; }
34+
virtual llvm::StringRef getPassName() const override { return "PromoteBools"; }
3535

3636
virtual bool runOnModule(llvm::Module &module) override;
3737

@@ -44,15 +44,14 @@ class PromoteSubByte : public llvm::ModulePass, public llvm::InstVisitor<Promote
4444

4545
private:
4646
bool changed;
47-
llvm::Module *M = nullptr;
4847

49-
llvm::Value *convertI1ToI8(llvm::Value *argument, llvm::IRBuilder<> &builder);
48+
llvm::Value *convertI1ToI8(llvm::Value *argument, llvm::IRBuilder<>& builder);
5049
llvm::Value *convertI1ToI8(llvm::Value *argument, llvm::Instruction *insertBefore);
51-
llvm::Value *convertI8ToI1(llvm::Value *argument, llvm::IRBuilder<> &builder);
50+
llvm::Value *convertI8ToI1(llvm::Value *argument, llvm::IRBuilder<>& builder);
5251
llvm::Value *convertI8ToI1(llvm::Value *argument, llvm::Instruction *insertBefore);
53-
llvm::Value *castTo(llvm::Value *value, llvm::Type *desiredType, llvm::IRBuilder<> &builder);
52+
llvm::Value *castTo(llvm::Value *value, llvm::Type *desiredType, llvm::IRBuilder<>& builder);
5453
llvm::Value *castTo(llvm::Value *value, llvm::Type *desiredType, llvm::Instruction *insertBefore);
55-
llvm::Value *castAggregate(llvm::Value *value, llvm::Type *desiredType, llvm::IRBuilder<> &builder);
54+
llvm::Value *castAggregate(llvm::Value *value, llvm::Type *desiredType, llvm::IRBuilder<>& builder);
5655

5756
void cleanUp(llvm::Module &module);
5857

@@ -93,12 +92,7 @@ class PromoteSubByte : public llvm::ModulePass, public llvm::InstVisitor<Promote
9392
llvm::StoreInst *promoteStore(llvm::StoreInst *store);
9493
llvm::IntToPtrInst *promoteIntToPtr(llvm::IntToPtrInst *inttoptr);
9594
llvm::ExtractElementInst *promoteExtractElement(llvm::ExtractElementInst *extractElement);
96-
llvm::Value *promoteInsertElement(llvm::InsertElementInst *insertElement);
97-
llvm::Value *promoteShuffleVector(llvm::ShuffleVectorInst *shuffleVector);
98-
llvm::Value *promoteAndUnpackInt4Vector(llvm::Value *unpromotedInput, llvm::IRBuilder<> &builder);
99-
llvm::Value *packInt4Vector(llvm::Value *input, llvm::IRBuilder<> &builder);
100-
llvm::Constant *unpackConstantInt4Vector(llvm::Value *input, IGCLLVM::FixedVectorType *outputTy);
101-
llvm::Constant *packConstantInt4Vector(llvm::Value *input);
95+
llvm::InsertElementInst *promoteInsertElement(llvm::InsertElementInst *insertElement);
10296

10397
// Promoting values - helping vars
10498
llvm::DenseSet<llvm::PHINode *> visitedPHINodes;

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -8725,12 +8725,6 @@ void EmitPass::EmitGenIntrinsicMessage(llvm::GenIntrinsicInst *inst) {
87258725
case GenISAIntrinsic::GenISA_srnd_hftobf8:
87268726
emitSrnd(inst);
87278727
break;
8728-
case GenISAIntrinsic::GenISA_Int4VectorUnpack:
8729-
emitInt4VectorUnpack(inst);
8730-
break;
8731-
case GenISAIntrinsic::GenISA_Int4VectorPack:
8732-
emitInt4VectorPack(inst);
8733-
break;
87348728
case GenISAIntrinsic::GenISA_uavSerializeAll:
87358729
case GenISAIntrinsic::GenISA_uavSerializeOnResID:
87368730
emitUAVSerialize();
@@ -21265,83 +21259,6 @@ void EmitPass::emitSrnd(llvm::GenIntrinsicInst *GII) {
2126521259
}
2126621260
}
2126721261

21268-
void EmitPass::emitInt4VectorUnpack(llvm::GenIntrinsicInst *GII) {
21269-
Value *input = GII->getOperand(0);
21270-
CVariable *cinput = GetSymbol(input);
21271-
21272-
uint16_t inputNum = cinput->GetNumberElement();
21273-
uint16_t dstNum = m_destination->GetNumberElement();
21274-
21275-
IGC_ASSERT_MESSAGE(cinput->IsUniform() == m_destination->IsUniform(),
21276-
"Int4VectorUnpack expects both input and destination to have the same IsUniform state.");
21277-
uint16_t execSize = cinput->IsUniform() ? 1 : numLanes(m_currShader->m_SIMDSize);
21278-
m_encoder->SetSimdSize(lanesToSIMDMode(execSize));
21279-
21280-
// Round up to a multiple of inputNum.
21281-
uint16_t dstNumRoundedUp = ((dstNum + inputNum - 1) / inputNum) * inputNum;
21282-
if (inputNum * 2 != dstNumRoundedUp || cinput->GetElemSize() != 1 || m_destination->GetElemSize() != 1) {
21283-
IGC_ASSERT_MESSAGE(false, "Unexpected arguments in emitInt4VectorUnpack");
21284-
return;
21285-
}
21286-
21287-
CVariable *immFour = m_currShader->ImmToVariable(4, ISA_TYPE_UB);
21288-
CVariable *immMask4Bit = m_currShader->ImmToVariable(0b1111, ISA_TYPE_UB);
21289-
21290-
for (int rowOffset = 0; rowOffset < inputNum; rowOffset += execSize) {
21291-
CVariable *row = m_currShader->GetNewAlias(cinput, ISA_TYPE_UB, rowOffset, execSize);
21292-
CVariable *dst0 = m_currShader->GetNewAlias(m_destination, ISA_TYPE_UB, rowOffset * 2, execSize);
21293-
m_encoder->And(dst0, row, immMask4Bit);
21294-
21295-
if (rowOffset * 2 + execSize < dstNum) {
21296-
CVariable *dst1 = m_currShader->GetNewAlias(m_destination, ISA_TYPE_UB, rowOffset * 2 + execSize, execSize);
21297-
m_encoder->Shr(dst1, row, immFour);
21298-
}
21299-
}
21300-
21301-
m_encoder->Push();
21302-
}
21303-
21304-
void EmitPass::emitInt4VectorPack(llvm::GenIntrinsicInst *GII) {
21305-
Value *input = GII->getOperand(0);
21306-
CVariable *cinput = GetSymbol(input);
21307-
21308-
uint16_t inputNum = cinput->GetNumberElement();
21309-
uint16_t dstNum = m_destination->GetNumberElement();
21310-
21311-
IGC_ASSERT_MESSAGE(cinput->IsUniform() == m_destination->IsUniform(),
21312-
"Int4VectorUnpack expects both input and destination to have the same IsUniform state.");
21313-
uint16_t execSize = m_destination->IsUniform() ? 1 : numLanes(m_currShader->m_SIMDSize);
21314-
m_encoder->SetSimdSize(lanesToSIMDMode(execSize));
21315-
21316-
// Round up to a multiple of dstNum.
21317-
uint16_t inputNumRoundedUp = ((inputNum + dstNum - 1) / dstNum) * dstNum;
21318-
if (inputNumRoundedUp != dstNum * 2 || cinput->GetElemSize() != 1 || m_destination->GetElemSize() != 1) {
21319-
IGC_ASSERT_MESSAGE(false, "Unexpected arguments in Int4VectorPack");
21320-
return;
21321-
}
21322-
21323-
CVariable *immFour = m_currShader->ImmToVariable(4, ISA_TYPE_UB);
21324-
21325-
for (int rowOffset = 0; rowOffset < dstNum; rowOffset += execSize) {
21326-
CVariable *row0 = m_currShader->GetNewAlias(cinput, ISA_TYPE_UB, rowOffset * 2, execSize);
21327-
CVariable *dst = m_currShader->GetNewAlias(m_destination, ISA_TYPE_UB, rowOffset, execSize);
21328-
21329-
// There is an edge case where we pack <3 x i8> into <2 x i8>.
21330-
// The missing 4th i8 cannot be loaded.
21331-
if (rowOffset * 2 + execSize < cinput->GetNumberElement()) {
21332-
CVariable *row1 = m_currShader->GetNewAlias(cinput, ISA_TYPE_UB, rowOffset * 2 + execSize, execSize);
21333-
CVariable *shl4 = m_currShader->GetNewVariable(row1, "shl4");
21334-
m_encoder->Shl(shl4, row1, immFour);
21335-
m_encoder->Or(dst, row0, shl4);
21336-
} else {
21337-
// Due to missing last element pass row0 directly to dst.
21338-
m_encoder->Copy(dst, row0);
21339-
}
21340-
}
21341-
21342-
m_encoder->Push();
21343-
}
21344-
2134521262
LSC_CACHE_OPTS EmitPass::translateLSCCacheControlsEnum(LSC_L1_L3_CC l1l3cc, bool isLoad,
2134621263
const Value *warningContextValue) const {
2134721264
if (!m_pCtx->platform.isSupportedLSCCacheControlsEnum(l1l3cc, isLoad)) {

IGC/Compiler/CISACodeGen/EmitVISAPass.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,6 @@ class EmitPass : public llvm::FunctionPass {
576576
bool forceCacheCtrl(llvm::Instruction *vectorLdStInst = nullptr);
577577
uint32_t totalBytesToStoreOrLoad(llvm::Instruction *vectorLdStInst);
578578
void emitSrnd(llvm::GenIntrinsicInst *GII);
579-
void emitInt4VectorUnpack(llvm::GenIntrinsicInst *GII);
580-
void emitInt4VectorPack(llvm::GenIntrinsicInst *GII);
581579
void emitStaticConstantPatchValue(llvm::StaticConstantPatchIntrinsic *staticConstantPatch32);
582580
// Debug Built-Ins
583581
void emitStateRegID(uint32_t BitStart, uint32_t BitEnd);

IGC/Compiler/CISACodeGen/WIAnalysis.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,6 @@ WIAnalysis::WIDependancy WIAnalysisRunner::calculate_dep(const CallInst *inst) {
12401240
GII_id == GenISAIntrinsic::GenISA_2fto2bf || GII_id == GenISAIntrinsic::GenISA_dual_subslice_id ||
12411241
GII_id == GenISAIntrinsic::GenISA_hftobf8 || GII_id == GenISAIntrinsic::GenISA_bf8tohf ||
12421242
GII_id == GenISAIntrinsic::GenISA_srnd_ftohf || GII_id == GenISAIntrinsic::GenISA_srnd_hftobf8 ||
1243-
GII_id == GenISAIntrinsic::GenISA_Int4VectorUnpack || GII_id == GenISAIntrinsic::GenISA_Int4VectorPack ||
12441243
GII_id == GenISAIntrinsic::GenISA_hftohf8 || GII_id == GenISAIntrinsic::GenISA_hf8tohf ||
12451244
GII_id == GenISAIntrinsic::GenISA_ftotf32 || GII_id == GenISAIntrinsic::GenISA_GlobalBufferPointer ||
12461245
GII_id == GenISAIntrinsic::GenISA_LocalBufferPointer ||

IGC/Compiler/InitializePasses.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ void initializeLowerInvokeSIMDPass(llvm::PassRegistry &);
281281
void initializeRemoveCodeAssumptionsPass(llvm::PassRegistry &);
282282
void initializePreprocessSPVIRPass(llvm::PassRegistry &);
283283
void initializeConvertUserSemanticDecoratorOnFunctionsPass(llvm::PassRegistry &);
284-
void initializePromoteSubBytePass(llvm::PassRegistry &);
284+
void initializePromoteBoolsPass(llvm::PassRegistry &);
285285
void initializeResolveConstExprCallsPass(llvm::PassRegistry &);
286286
void initializeHandleSpirvDecorationMetadataPass(llvm::PassRegistry &);
287287
void initializeNontemporalLoadsAndStoresInAssertPass(llvm::PassRegistry &);

IGC/Compiler/tests/EmitVISAPass/emit-int4-vector/pack-3-to-2-uniform.ll

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

IGC/Compiler/tests/EmitVISAPass/emit-int4-vector/pack-4-to-2.ll

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

0 commit comments

Comments
 (0)