Skip to content

Commit 5a27fb6

Browse files
bgajdaINTCigcbot
authored andcommitted
Refactor flags to be early exits.
Refactor flags to be early exits.
1 parent 1cdca1b commit 5a27fb6

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5845,9 +5845,10 @@ void EmitPass::emitSimdShuffle(llvm::Instruction* inst)
58455845
// Enabling movi requires that first lane even inactive will be within bounds of register we want.
58465846
// It also is limited to accessing single GRF.
58475847
// For uniform channel which will be simd1 there's probably no gain in movi.
5848+
bool moviPromotionEnabled = IGC_GET_FLAG_VALUE(EnableEmitMoreMoviCases);
58485849
bool isSingleGrf = data->GetSize() <= (unsigned)getGRFSize();
58495850
bool platformMoviTypeCheck = m_currShader->m_Platform->allowsMoviForType(data->GetType());
5850-
bool forcePreventOOB = isSingleGrf && platformMoviTypeCheck && !channelUniform;
5851+
bool forcePreventOOB = isSingleGrf && moviPromotionEnabled && platformMoviTypeCheck && !channelUniform;
58515852

58525853
if (defaultConditions || forcePreventOOB)
58535854
{

IGC/Compiler/CISACodeGen/Platform.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1911,7 +1911,7 @@ bool allowProceedBasedApproachForRayQueryDynamicRayManagementMechanism() const
19111911
}
19121912

19131913
bool allowsMoviForType(VISA_Type type) const {
1914-
return IGC_GET_FLAG_VALUE(EnableEmitMoreMoviCases) && (type == ISA_TYPE_UD || type == ISA_TYPE_D);
1914+
return (type == ISA_TYPE_UD || type == ISA_TYPE_D);
19151915
}
19161916

19171917
};

IGC/Compiler/CustomSafeOptPass.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1951,7 +1951,13 @@ void CustomSafeOptPass::visitTruncInst(TruncInst& I)
19511951
To:
19521952
%335 = call i16 @llvm.genx.GenISA.WaveShuffleIndex.i16(i16 %orig, i32 %333, i32 0)
19531953
*/
1954-
if( I.getSrcTy()->isIntegerTy( 32 ) && I.getDestTy()->isIntegerTy( 16 ) && IGC_IS_FLAG_DISABLED(EnableEmitMoreMoviCases))
1954+
1955+
if (IGC_IS_FLAG_ENABLED(EnableEmitMoreMoviCases))
1956+
{
1957+
return;
1958+
}
1959+
1960+
if( I.getSrcTy()->isIntegerTy( 32 ) && I.getDestTy()->isIntegerTy( 16 ) )
19551961
{
19561962
// We know all variants of shuffle from zext are safe to demote. (unlike WaveAll which might not be)
19571963
if( auto* genIntr = dyn_cast<GenIntrinsicInst>( I.getOperand( 0 ) ); genIntr && isSubGroupShuffleVariant( genIntr ) && genIntr->hasOneUse() )

visa/ReduceExecSize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ bool HWConformity::evenlySplitInst(INST_LIST_ITER iter, G4_BB *bb,
12211221
} else if (srcs[j]->isScalarSrc() || (j == 0 && op == G4_line)) {
12221222
// no need to split, but need to duplicate
12231223
newInst->setSrc(builder.duplicateOperand(srcs[j]), j);
1224-
} else if (op == G4_movi && srcs[j]->asSrcRegRegion()->getRegion()->isRegion110()) {
1224+
} else if (op == G4_movi) {
12251225
// we create temp region which is in VxH format
12261226
RegionDesc VxHregionDesc = RegionDesc(UNDEFINED_SHORT, 1, 0);
12271227

0 commit comments

Comments
 (0)