Skip to content

Commit 800e36d

Browse files
krystian-andrzejewskiigcbot
authored andcommitted
Removing BoolOpPattern
This change is to remove BoolOpPattern which seems to be redundant because of vISA optimizations to reuse registers.
1 parent 30913bb commit 800e36d

File tree

3 files changed

+0
-62
lines changed

3 files changed

+0
-62
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15643,21 +15643,6 @@ void EmitPass::emitAtomicCounter(llvm::GenIntrinsicInst* pInsn)
1564315643
m_currShader->isMessageTargetDataCacheDataPort = true;
1564415644
}
1564515645

15646-
void EmitPass::CmpBoolOp(Pattern* cmpPattern,
15647-
llvm::BinaryOperator* inst,
15648-
const SSource& bitSource,
15649-
const DstModifier& modifier)
15650-
{
15651-
DstModifier init;
15652-
cmpPattern->Emit(this, init);
15653-
15654-
IGC_ASSERT(bitSource.mod == EMOD_NONE);
15655-
CVariable* boolOpSource = GetSrcVariable(bitSource);
15656-
m_encoder->SetDstModifier(modifier);
15657-
15658-
EmitSimpleAlu(inst, m_destination, m_destination, boolOpSource);
15659-
}
15660-
1566115646
void EmitPass::emitAluConditionMod(Pattern* aluPattern, Instruction* alu, CmpInst* cmp, int aluOprdNum)
1566215647
{
1566315648
CVariable* temp = m_currShader->GetNewVector(alu);

IGC/Compiler/CISACodeGen/EmitVISAPass.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,6 @@ class EmitPass : public llvm::FunctionPass
114114
void Alu(e_opcode opCode, const SSource sources[N], const DstModifier& modifier);
115115

116116
void BinaryUnary(llvm::Instruction* inst, const SSource source[2], const DstModifier& modifier);
117-
void CmpBoolOp(Pattern* cmpPattern,
118-
llvm::BinaryOperator* inst,
119-
const SSource& bitSource,
120-
const DstModifier& modifier);
121117
void emitAluConditionMod(Pattern* aluPattern, llvm::Instruction* alu, llvm::CmpInst* cmp, int aluOprdNum);
122118

123119
void EmitGenericPointersCmp(llvm::Instruction* inst, const SSource source[2], const DstModifier& modifier, uint8_t clearTagMask);

IGC/Compiler/CISACodeGen/PatternMatchPass.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,13 +1207,11 @@ namespace IGC
12071207
case Instruction::And:
12081208
match =
12091209
MatchBfn(I) ||
1210-
MatchBoolOp(I) ||
12111210
MatchLogicAlu(I);
12121211
break;
12131212
case Instruction::Or:
12141213
match =
12151214
MatchBfn(I) ||
1216-
MatchBoolOp(I) ||
12171215
MatchLogicAlu(I);
12181216
break;
12191217
case Instruction::Xor:
@@ -3998,47 +3996,6 @@ namespace IGC
39983996
return found;
39993997
}
40003998

4001-
// we match the following pattern
4002-
// %f = cmp %1 %2
4003-
// %o = or/and %f %g
4004-
bool CodeGenPatternMatch::MatchBoolOp(llvm::BinaryOperator& I)
4005-
{
4006-
struct BoolOpPattern : public Pattern
4007-
{
4008-
Pattern* cmpPattern;
4009-
llvm::BinaryOperator* boolOp;
4010-
SSource binarySource;
4011-
virtual void Emit(EmitPass* pass, const DstModifier& modifier)
4012-
{
4013-
pass->CmpBoolOp(cmpPattern, boolOp, binarySource, modifier);
4014-
}
4015-
};
4016-
4017-
IGC_ASSERT(I.getOpcode() == Instruction::Or || I.getOpcode() == Instruction::And);
4018-
bool found = false;
4019-
if (I.getType()->isIntegerTy(1))
4020-
{
4021-
for (uint i = 0; i < 2; i++)
4022-
{
4023-
if (CmpInst * cmp = llvm::dyn_cast<CmpInst>(I.getOperand(i)))
4024-
{
4025-
// only beneficial if the other operand only have one use
4026-
if (I.getOperand(1 - i)->hasOneUse())
4027-
{
4028-
BoolOpPattern* pattern = new (m_allocator) BoolOpPattern();
4029-
pattern->cmpPattern = Match(*cmp);
4030-
pattern->boolOp = &I;
4031-
pattern->binarySource = GetSource(I.getOperand(1 - i), false, false, IsSourceOfSample(&I));
4032-
AddPattern(pattern);
4033-
found = true;
4034-
break;
4035-
}
4036-
}
4037-
}
4038-
}
4039-
return found;
4040-
}
4041-
40423999
bool CodeGenPatternMatch::MatchFunnelShiftRotate(llvm::IntrinsicInst& I)
40434000
{
40444001
// Hanlde only funnel shift that can be turned into rotate.

0 commit comments

Comments
 (0)