Skip to content

Commit 6bbc3a6

Browse files
tuStromaigcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 92d23bc
Add ZExt instruction on Cmp bool promotion After promoting Cmp instructions of type i1 all uses are replaced with extended to i8 value
1 parent a7bc5c8 commit 6bbc3a6

File tree

3 files changed

+0
-67
lines changed

3 files changed

+0
-67
lines changed

IGC/AdaptorOCL/preprocess_spvir/PromoteBools.cpp

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,6 @@ Value* PromoteBools::getOrCreatePromotedValue(Value* value)
412412
{
413413
newValue = promoteICmp(icmp);
414414
}
415-
else if (auto fcmp = dyn_cast<FCmpInst>(value))
416-
{
417-
newValue = promoteFCmp(fcmp);
418-
}
419415
else if (auto inlineAsm = dyn_cast<InlineAsm>(value))
420416
{
421417
newValue = promoteInlineAsm(inlineAsm);
@@ -485,17 +481,6 @@ Value* PromoteBools::getOrCreatePromotedValue(Value* value)
485481
}
486482
}
487483

488-
if (typeNeedsPromotion(newValue->getType()))
489-
{
490-
if (auto instruction = dyn_cast<Instruction>(newValue))
491-
{
492-
ZExtInst* zext = new ZExtInst(newValue, getOrCreatePromotedType(newValue->getType()), "");
493-
zext->insertAfter(instruction);
494-
if (newValue == value)
495-
return zext;
496-
}
497-
}
498-
499484
if (newValue != value)
500485
{
501486
promotedValuesCache[value] = newValue;
@@ -1024,35 +1009,6 @@ ICmpInst* PromoteBools::promoteICmp(ICmpInst* icmp)
10241009
return newICmp;
10251010
}
10261011

1027-
FCmpInst* PromoteBools::promoteFCmp(FCmpInst* fcmp)
1028-
{
1029-
if (!fcmp)
1030-
{
1031-
return nullptr;
1032-
}
1033-
1034-
auto op0 = fcmp->getOperand(0);
1035-
auto op1 = fcmp->getOperand(1);
1036-
1037-
if (!wasPromotedAnyOf(fcmp->operands()) && !typeNeedsPromotion(op0->getType()))
1038-
{
1039-
return fcmp;
1040-
}
1041-
1042-
auto promotedOp0 = convertI1ToI8(getOrCreatePromotedValue(op0), fcmp);
1043-
auto promotedOp1 = convertI1ToI8(getOrCreatePromotedValue(op1), fcmp);
1044-
1045-
auto newFCmp = new FCmpInst(
1046-
fcmp,
1047-
fcmp->getPredicate(),
1048-
promotedOp0,
1049-
promotedOp1,
1050-
""
1051-
);
1052-
newFCmp->setDebugLoc(fcmp->getDebugLoc());
1053-
return newFCmp;
1054-
}
1055-
10561012
InlineAsm* PromoteBools::promoteInlineAsm(InlineAsm* inlineAsm)
10571013
{
10581014
if (!inlineAsm || !typeNeedsPromotion(inlineAsm->getFunctionType()))

IGC/AdaptorOCL/preprocess_spvir/PromoteBools.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ namespace IGC
9393
llvm::ExtractValueInst* promoteExtractValue(llvm::ExtractValueInst* extractValue);
9494
llvm::GetElementPtrInst* promoteGetElementPtr(llvm::GetElementPtrInst* getElementPtr);
9595
llvm::ICmpInst* promoteICmp(llvm::ICmpInst* icmp);
96-
llvm::FCmpInst* promoteFCmp(llvm::FCmpInst* fcmp);
9796
llvm::InlineAsm* promoteInlineAsm(llvm::InlineAsm* inlineAsm);
9897
llvm::InsertValueInst* promoteInsertValue(llvm::InsertValueInst* insertValue);
9998
llvm::LoadInst* promoteLoad(llvm::LoadInst* load);

IGC/Compiler/tests/PromoteBools/fcmp.ll

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

0 commit comments

Comments
 (0)