Skip to content

Commit 884ed92

Browse files
Dimus77igcbot
authored andcommitted
Embargo code
1 parent 0708144 commit 884ed92

File tree

2 files changed

+0
-108
lines changed

2 files changed

+0
-108
lines changed

IGC/Compiler/CustomSafeOptPass.cpp

Lines changed: 0 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,114 +2278,7 @@ void GenSpecificPattern::visitBinaryOperator(BinaryOperator& I)
22782278
{
22792279
createBitcastExtractInsertPattern(I, nullptr, I.getOperand(0), 0, 1);
22802280
}
2281-
else
2282-
{
2283-
2284-
Instruction* AndSrc = nullptr;
2285-
ConstantInt* CI;
2286-
2287-
/*
2288-
From:
2289-
%28 = and i32 %24, 255
2290-
%29 = lshr i32 %24, 8
2291-
%30 = and i32 %29, 255
2292-
%31 = lshr i32 %24, 16
2293-
%32 = and i32 %31, 255
2294-
2295-
To:
2296-
%temp = bitcast i32 %24 to <4 x i8>
2297-
%ee1 = extractelement <4 x i8> %temp, i32 0
2298-
%ee2 = extractelement <4 x i8> %temp, i32 1
2299-
%ee3 = extractelement <4 x i8> %temp, i32 2
2300-
%28 = zext i8 %ee1 to i32
2301-
%30 = zext i8 %ee2 to i32
2302-
%32 = zext i8 %ee3 to i32
2303-
2304-
2305-
*/
2306-
auto pattern_And_0xFF = m_And(m_Instruction(AndSrc), m_SpecificInt(0xFF));
2307-
2308-
CodeGenContext* ctx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
2309-
bool bytesAllowed = IGC_IS_FLAG_ENABLED(EnableMixInt8Operands) && ctx->platform.supportByteALUOperation();
2310-
2311-
if (bytesAllowed && match(&I, pattern_And_0xFF) && I.getType()->isIntegerTy(32) && AndSrc->getType()->isIntegerTy(32))
2312-
{
2313-
Instruction* LhsSrc = nullptr;
2314-
2315-
auto LShr_Pattern = m_LShr(m_Instruction(LhsSrc), m_ConstantInt(CI));
2316-
bool LShrMatch = match(AndSrc, LShr_Pattern) && LhsSrc->getType()->isIntegerTy(32) && (CI->getZExtValue() % 8 == 0);
2317-
2318-
// in case there's no shr, it will be 0
2319-
uint32_t newIndex = 0;
2320-
2321-
if (LShrMatch) // extract inner
2322-
{
2323-
AndSrc = LhsSrc;
2324-
newIndex = (uint32_t)CI->getZExtValue() / 8;
2325-
}
2326-
2327-
llvm::IRBuilder<> builder(&I);
2328-
VectorType* vec4 = IGCLLVM::FixedVectorType::get(builder.getInt8Ty(), 4);
2329-
Value* BC = builder.CreateBitCast(AndSrc, vec4);
2330-
Value* EE = builder.CreateExtractElement(BC, builder.getInt32(newIndex));
2331-
Value* Zext = builder.CreateZExt(EE, builder.getInt32Ty());
2332-
I.replaceAllUsesWith(Zext);
2333-
I.eraseFromParent();
2334-
2335-
}
2336-
2337-
}
23382281
}
2339-
else if (I.getOpcode() == Instruction::AShr)
2340-
{
2341-
/*
2342-
From:
2343-
%129 = i32...
2344-
%Temp = shl i32 %129, 16
2345-
%132 = ashr exact i32 %Temp, 16
2346-
%133 = ashr i32 %129, 16
2347-
2348-
To:
2349-
%129 = i32...
2350-
%temp = bitcast i32 %129 to <2 x i16>
2351-
%ee1 = extractelement <2 x i16> %temp, i32 0
2352-
%ee2 = extractelement <2 x i16> %temp, i32 1
2353-
%132 = sext i8 %ee1 to i32
2354-
%133 = sext i8 %ee2 to i32
2355-
Which will end up as regioning instead of 2 isntr.
2356-
*/
2357-
using namespace llvm::PatternMatch;
2358-
2359-
Instruction* AShrSrc = nullptr;
2360-
auto pattern_1 = m_AShr(m_Instruction(AShrSrc), m_SpecificInt(16));
2361-
2362-
if (match(&I, pattern_1) && I.getType()->isIntegerTy(32) && AShrSrc->getType()->isIntegerTy(32))
2363-
{
2364-
Instruction* ShlSrc = nullptr;
2365-
2366-
auto Shl_Pattern = m_Shl(m_Instruction(ShlSrc), m_SpecificInt(16));
2367-
bool submatch = match(AShrSrc, Shl_Pattern) && ShlSrc->getType()->isIntegerTy(32);
2368-
2369-
// in case there's no shr, we take upper half
2370-
uint32_t newIndex = 1;
2371-
2372-
// if there was Shl, we take lower half
2373-
if (submatch)
2374-
{
2375-
AShrSrc = ShlSrc;
2376-
newIndex = 0;
2377-
}
2378-
2379-
llvm::IRBuilder<> builder(&I);
2380-
VectorType* vec2 = IGCLLVM::FixedVectorType::get(builder.getInt16Ty(), 2);
2381-
Value* BC = builder.CreateBitCast(AShrSrc, vec2);
2382-
Value* EE = builder.CreateExtractElement(BC, builder.getInt32(newIndex));
2383-
Value* Sext = builder.CreateSExt(EE, builder.getInt32Ty());
2384-
I.replaceAllUsesWith(Sext);
2385-
I.eraseFromParent();
2386-
}
2387-
}
2388-
23892282
}
23902283

23912284
void GenSpecificPattern::visitCmpInst(CmpInst& I)

IGC/common/igc_flags.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ DECLARE_IGC_REGKEY(bool, cl_khr_srgb_image_writes, false, "Enable cl_khr_sr
383383
DECLARE_IGC_REGKEY(bool, MSAA16BitPayloadEnable, true, "Enable support for MSAA 16 bit payload , a hardware DCN supporting this from ICL+ to improve perf on MSAA workloads", false)
384384
DECLARE_IGC_REGKEY(bool, EnableInsertElementScalarCoalescing, false, "Enable coalescing on the scalar operand of insertelement", false)
385385
DECLARE_IGC_REGKEY(bool, EnableMixIntOperands, true, "Enable generating mix-sized operands for int ALU", false)
386-
DECLARE_IGC_REGKEY(bool, EnableMixInt8Operands, true, "Enable generating bytes in mix-sized operands for int ALU", false)
387386
DECLARE_IGC_REGKEY(bool, PixelShaderDoNotAbortOnSpill, false, "Do not abort on a spill", false)
388387
DECLARE_IGC_REGKEY(DWORD, ForcePixelShaderSIMDMode, 0, "Setting it to values def in igc.h will force SIMD mode compilation for pixel shaders. Note that only SIMD8 is compiled unless other ForcePixelShaderSIMD* are also selected", false)
389388
DECLARE_IGC_REGKEY(DWORD, StagedCompilationExperiments, 0, "Experiment with staged compilation when != 0", false)

0 commit comments

Comments
 (0)