diff options
| author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2020-01-10 15:31:10 +0100 |
|---|---|---|
| committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2020-01-10 15:34:50 +0100 |
| commit | f0fd11df7d5488e2747f26a3bfcf62459fee54ad (patch) | |
| tree | 3930d42159159d66a3efeab601af1b3928d9e8a8 /llvm/lib/CodeGen | |
| parent | 3772ea9dd9368cfdc73595854c143bc3f16a5ade (diff) | |
| download | bcm5719-llvm-f0fd11df7d5488e2747f26a3bfcf62459fee54ad.tar.gz bcm5719-llvm-f0fd11df7d5488e2747f26a3bfcf62459fee54ad.zip | |
[FPEnv] Invert sense of MIFlag::FPExcept flag
In D71841 we inverted the sense of the SDNode-level flag to ensure all nodes
default to potentially raising FP exceptions unless otherwise specified --
i.e. if we forget to propagate the flag somewhere, the effect is now only
lost performance, not incorrect code.
However, the related flag at the MI level still defaults to nodes not raising
FP exceptions unless otherwise specified. To be fully on the (conservatively)
safe side, we should invert that flag as well.
This patch does so by replacing MIFlag::FPExcept with MIFlag::NoFPExcept.
(Note that this does also introduce an incompatible change in the MIR format.)
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D72466
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/MIRParser/MILexer.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MIRParser/MILexer.h | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIParser.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MIRPrinter.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 4 |
6 files changed, 11 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.cpp b/llvm/lib/CodeGen/MIRParser/MILexer.cpp index 0c35a91f828..5976f5da156 100644 --- a/llvm/lib/CodeGen/MIRParser/MILexer.cpp +++ b/llvm/lib/CodeGen/MIRParser/MILexer.cpp @@ -204,7 +204,7 @@ static MIToken::TokenKind getIdentifierKind(StringRef Identifier) { .Case("nuw" , MIToken::kw_nuw) .Case("nsw" , MIToken::kw_nsw) .Case("exact" , MIToken::kw_exact) - .Case("fpexcept", MIToken::kw_fpexcept) + .Case("nofpexcept", MIToken::kw_nofpexcept) .Case("debug-location", MIToken::kw_debug_location) .Case("same_value", MIToken::kw_cfi_same_value) .Case("offset", MIToken::kw_cfi_offset) diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.h b/llvm/lib/CodeGen/MIRParser/MILexer.h index af5327cacfe..aaffe4a4c91 100644 --- a/llvm/lib/CodeGen/MIRParser/MILexer.h +++ b/llvm/lib/CodeGen/MIRParser/MILexer.h @@ -73,7 +73,7 @@ struct MIToken { kw_nuw, kw_nsw, kw_exact, - kw_fpexcept, + kw_nofpexcept, kw_debug_location, kw_cfi_same_value, kw_cfi_offset, diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp index 11cab488e22..fbb834c4ceb 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -1185,7 +1185,7 @@ bool MIParser::parseInstruction(unsigned &OpCode, unsigned &Flags) { Token.is(MIToken::kw_nuw) || Token.is(MIToken::kw_nsw) || Token.is(MIToken::kw_exact) || - Token.is(MIToken::kw_fpexcept)) { + Token.is(MIToken::kw_nofpexcept)) { // Mine frame and fast math flags if (Token.is(MIToken::kw_frame_setup)) Flags |= MachineInstr::FrameSetup; @@ -1211,8 +1211,8 @@ bool MIParser::parseInstruction(unsigned &OpCode, unsigned &Flags) { Flags |= MachineInstr::NoSWrap; if (Token.is(MIToken::kw_exact)) Flags |= MachineInstr::IsExact; - if (Token.is(MIToken::kw_fpexcept)) - Flags |= MachineInstr::FPExcept; + if (Token.is(MIToken::kw_nofpexcept)) + Flags |= MachineInstr::NoFPExcept; lex(); } diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index 1d61fdbba4d..e8cd3d60ccb 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -752,8 +752,8 @@ void MIPrinter::print(const MachineInstr &MI) { OS << "nsw "; if (MI.getFlag(MachineInstr::IsExact)) OS << "exact "; - if (MI.getFlag(MachineInstr::FPExcept)) - OS << "fpexcept "; + if (MI.getFlag(MachineInstr::NoFPExcept)) + OS << "nofpexcept "; OS << TII->getName(MI.getOpcode()); if (I < E) diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index d3803b31f5c..c8e3e5bb01a 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -1538,8 +1538,8 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST, OS << "nsw "; if (getFlag(MachineInstr::IsExact)) OS << "exact "; - if (getFlag(MachineInstr::FPExcept)) - OS << "fpexcept "; + if (getFlag(MachineInstr::NoFPExcept)) + OS << "nofpexcept "; // Print the opcode name. if (TII) diff --git a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp index a0c8e83cd8a..c613c254062 100644 --- a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp @@ -882,8 +882,8 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned, if (Flags.hasExact()) MI->setFlag(MachineInstr::MIFlag::IsExact); - if (MI->getDesc().mayRaiseFPException() && !Flags.hasNoFPExcept()) - MI->setFlag(MachineInstr::MIFlag::FPExcept); + if (Flags.hasNoFPExcept()) + MI->setFlag(MachineInstr::MIFlag::NoFPExcept); } // Emit all of the actual operands of this instruction, adding them to the |

