From cd847a8f3059d87cc6c5343d2dae7b25aacac322 Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Tue, 28 Mar 2017 20:11:52 +0000 Subject: [IR] Add AllowContract to FastMathFlags -ffp-contract=fast does not currently work with LTO because it's passed as a TargetOption to the backend rather than in the IR. This adds it to FastMathFlags. This is toward fixing PR25721 Differential Revision: https://reviews.llvm.org/D31164 llvm-svn: 298939 --- llvm/lib/AsmParser/LLLexer.cpp | 1 + llvm/lib/AsmParser/LLParser.h | 4 ++++ llvm/lib/AsmParser/LLToken.h | 1 + 3 files changed, 6 insertions(+) (limited to 'llvm/lib/AsmParser') diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp index 752942fc9fc..49a8ce4bed0 100644 --- a/llvm/lib/AsmParser/LLLexer.cpp +++ b/llvm/lib/AsmParser/LLLexer.cpp @@ -548,6 +548,7 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(ninf); KEYWORD(nsz); KEYWORD(arcp); + KEYWORD(contract); KEYWORD(fast); KEYWORD(nuw); KEYWORD(nsw); diff --git a/llvm/lib/AsmParser/LLParser.h b/llvm/lib/AsmParser/LLParser.h index 7dae33480ed..3a794142172 100644 --- a/llvm/lib/AsmParser/LLParser.h +++ b/llvm/lib/AsmParser/LLParser.h @@ -193,6 +193,10 @@ namespace llvm { case lltok::kw_ninf: FMF.setNoInfs(); Lex.Lex(); continue; case lltok::kw_nsz: FMF.setNoSignedZeros(); Lex.Lex(); continue; case lltok::kw_arcp: FMF.setAllowReciprocal(); Lex.Lex(); continue; + case lltok::kw_contract: + FMF.setAllowContract(true); + Lex.Lex(); + continue; default: return FMF; } return FMF; diff --git a/llvm/lib/AsmParser/LLToken.h b/llvm/lib/AsmParser/LLToken.h index 048aeee90b3..33f8e63daa0 100644 --- a/llvm/lib/AsmParser/LLToken.h +++ b/llvm/lib/AsmParser/LLToken.h @@ -98,6 +98,7 @@ enum Kind { kw_ninf, kw_nsz, kw_arcp, + kw_contract, kw_fast, kw_nuw, kw_nsw, -- cgit v1.2.3