Skip to content

Commit 8eade27

Browse files
lwesiersZuul
authored andcommitted
Prepare IGC for LLVM10
Change-Id: I47fa3cde96463652fc6cacaeaf10173c6ee96518
1 parent 354256e commit 8eade27

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

IGC/Compiler/CustomSafeOptPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,7 @@ void GenSpecificPattern::visitCastInst(CastInst& I)
20052005
if ((srcVal = dyn_cast<Instruction>(srcVal->getOperand(0))))
20062006
{
20072007
// need fast math to know that we can ignore Nan
2008-
if (srcVal->isFast())
2008+
if (isa<FPMathOperator>(srcVal) && srcVal->isFast())
20092009
{
20102010
IRBuilder<> builder(&I);
20112011
Function* func = Intrinsic::getDeclaration(

IGC/Compiler/Legalizer/InstLegalChecker.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,3 +289,9 @@ LegalizeAction InstLegalChecker::visitLandingPadInst(LandingPadInst&) {
289289
// FIXME: Do we support it?
290290
return Legal;
291291
}
292+
293+
#if LLVM_VERSION_MAJOR >= 10
294+
LegalizeAction InstLegalChecker::visitFNeg(llvm::UnaryOperator& I) {
295+
return Legal;
296+
}
297+
#endif

IGC/Compiler/Legalizer/InstLegalChecker.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ namespace IGC {
110110
LegalizeAction visitExtractValueInst(ExtractValueInst& I);
111111
LegalizeAction visitInsertValueInst(InsertValueInst& I);
112112
LegalizeAction visitLandingPadInst(LandingPadInst&);
113+
#if LLVM_VERSION_MAJOR >= 10
114+
LegalizeAction visitFNeg(llvm::UnaryOperator& I);
115+
#endif
113116
};
114117

115118
} // End Legalizer namespace

0 commit comments

Comments
 (0)