summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MILexer.cpp1
-rw-r--r--llvm/lib/CodeGen/MIRParser/MILexer.h4
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIParser.cpp5
-rw-r--r--llvm/lib/CodeGen/MIRPrinter.cpp4
4 files changed, 11 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.cpp b/llvm/lib/CodeGen/MIRParser/MILexer.cpp
index 47e55017f1e..310ac7b4d71 100644
--- a/llvm/lib/CodeGen/MIRParser/MILexer.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MILexer.cpp
@@ -176,6 +176,7 @@ static MIToken::TokenKind getIdentifierKind(StringRef Identifier) {
.Case("target-flags", MIToken::kw_target_flags)
.Case("volatile", MIToken::kw_volatile)
.Case("non-temporal", MIToken::kw_non_temporal)
+ .Case("invariant", MIToken::kw_invariant)
.Default(MIToken::Identifier);
}
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.h b/llvm/lib/CodeGen/MIRParser/MILexer.h
index 1ff7dda1151..79bcb7fce01 100644
--- a/llvm/lib/CodeGen/MIRParser/MILexer.h
+++ b/llvm/lib/CodeGen/MIRParser/MILexer.h
@@ -68,6 +68,7 @@ struct MIToken {
kw_target_flags,
kw_volatile,
kw_non_temporal,
+ kw_invariant,
// Identifier tokens
Identifier,
@@ -130,7 +131,8 @@ public:
}
bool isMemoryOperandFlag() const {
- return Kind == kw_volatile || Kind == kw_non_temporal;
+ return Kind == kw_volatile || Kind == kw_non_temporal ||
+ Kind == kw_invariant;
}
bool is(TokenKind K) const { return Kind == K; }
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
index 0c3f5ecce86..36460b3f3eb 100644
--- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
@@ -1066,8 +1066,11 @@ bool MIParser::parseMemoryOperandFlag(unsigned &Flags) {
case MIToken::kw_non_temporal:
Flags |= MachineMemOperand::MONonTemporal;
break;
+ case MIToken::kw_invariant:
+ Flags |= MachineMemOperand::MOInvariant;
+ break;
// TODO: report an error when we specify the same flag more than once.
- // TODO: parse the other memory operand flags.
+ // TODO: parse the target specific memory operand flags.
default:
llvm_unreachable("The current token should be a memory operand flag");
}
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index c84cec9ed2e..cc131bc4641 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -652,11 +652,13 @@ void MIPrinter::print(const MachineOperand &Op, const TargetRegisterInfo *TRI) {
void MIPrinter::print(const MachineMemOperand &Op) {
OS << '(';
- // TODO: Print operand's other flags.
+ // TODO: Print operand's target specific flags.
if (Op.isVolatile())
OS << "volatile ";
if (Op.isNonTemporal())
OS << "non-temporal ";
+ if (Op.isInvariant())
+ OS << "invariant ";
if (Op.isLoad())
OS << "load ";
else {
OpenPOWER on IntegriCloud