[llvm] r245085 - MIR Serialization: Serialize the 'internal' register operand flag.
Alex Lorenz via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 14 12:07:07 PDT 2015
Author: arphaman
Date: Fri Aug 14 14:07:07 2015
New Revision: 245085
URL: http://llvm.org/viewvc/llvm-project?rev=245085&view=rev
Log:
MIR Serialization: Serialize the 'internal' register operand flag.
Modified:
llvm/trunk/lib/CodeGen/MIRParser/MILexer.cpp
llvm/trunk/lib/CodeGen/MIRParser/MILexer.h
llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp
llvm/trunk/lib/CodeGen/MIRPrinter.cpp
llvm/trunk/test/CodeGen/MIR/ARM/bundled-instructions.mir
Modified: llvm/trunk/lib/CodeGen/MIRParser/MILexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRParser/MILexer.cpp?rev=245085&r1=245084&r2=245085&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRParser/MILexer.cpp (original)
+++ llvm/trunk/lib/CodeGen/MIRParser/MILexer.cpp Fri Aug 14 14:07:07 2015
@@ -191,6 +191,7 @@ static MIToken::TokenKind getIdentifierK
.Case("dead", MIToken::kw_dead)
.Case("killed", MIToken::kw_killed)
.Case("undef", MIToken::kw_undef)
+ .Case("internal", MIToken::kw_internal)
.Case("early-clobber", MIToken::kw_early_clobber)
.Case("debug-use", MIToken::kw_debug_use)
.Case("frame-setup", MIToken::kw_frame_setup)
Modified: llvm/trunk/lib/CodeGen/MIRParser/MILexer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRParser/MILexer.h?rev=245085&r1=245084&r2=245085&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRParser/MILexer.h (original)
+++ llvm/trunk/lib/CodeGen/MIRParser/MILexer.h Fri Aug 14 14:07:07 2015
@@ -52,6 +52,7 @@ struct MIToken {
kw_dead,
kw_killed,
kw_undef,
+ kw_internal,
kw_early_clobber,
kw_debug_use,
kw_frame_setup,
@@ -138,7 +139,8 @@ public:
bool isRegisterFlag() const {
return Kind == kw_implicit || Kind == kw_implicit_define ||
Kind == kw_dead || Kind == kw_killed || Kind == kw_undef ||
- Kind == kw_early_clobber || Kind == kw_debug_use;
+ Kind == kw_internal || Kind == kw_early_clobber ||
+ Kind == kw_debug_use;
}
bool isMemoryOperandFlag() const {
Modified: llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp?rev=245085&r1=245084&r2=245085&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp (original)
+++ llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp Fri Aug 14 14:07:07 2015
@@ -777,13 +777,15 @@ bool MIParser::parseRegisterFlag(unsigne
case MIToken::kw_undef:
Flags |= RegState::Undef;
break;
+ case MIToken::kw_internal:
+ Flags |= RegState::InternalRead;
+ break;
case MIToken::kw_early_clobber:
Flags |= RegState::EarlyClobber;
break;
case MIToken::kw_debug_use:
Flags |= RegState::Debug;
break;
- // TODO: parse the other register flags.
default:
llvm_unreachable("The current token should be a register flag");
}
@@ -828,7 +830,8 @@ bool MIParser::parseRegisterOperand(Mach
Dest = MachineOperand::CreateReg(
Reg, Flags & RegState::Define, Flags & RegState::Implicit,
Flags & RegState::Kill, Flags & RegState::Dead, Flags & RegState::Undef,
- Flags & RegState::EarlyClobber, SubReg, Flags & RegState::Debug);
+ Flags & RegState::EarlyClobber, SubReg, Flags & RegState::Debug,
+ Flags & RegState::InternalRead);
return false;
}
@@ -1235,6 +1238,7 @@ bool MIParser::parseMachineOperand(Machi
case MIToken::kw_dead:
case MIToken::kw_killed:
case MIToken::kw_undef:
+ case MIToken::kw_internal:
case MIToken::kw_early_clobber:
case MIToken::kw_debug_use:
case MIToken::underscore:
Modified: llvm/trunk/lib/CodeGen/MIRPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRPrinter.cpp?rev=245085&r1=245084&r2=245085&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/MIRPrinter.cpp Fri Aug 14 14:07:07 2015
@@ -617,9 +617,11 @@ void MIPrinter::print(const MachineOpera
printTargetFlags(Op);
switch (Op.getType()) {
case MachineOperand::MO_Register:
- // TODO: Print the other register flags.
+ // FIXME: Serialize the tied register.
if (Op.isImplicit())
OS << (Op.isDef() ? "implicit-def " : "implicit ");
+ if (Op.isInternalRead())
+ OS << "internal ";
if (Op.isDead())
OS << "dead ";
if (Op.isKill())
Modified: llvm/trunk/test/CodeGen/MIR/ARM/bundled-instructions.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/MIR/ARM/bundled-instructions.mir?rev=245085&r1=245084&r2=245085&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/MIR/ARM/bundled-instructions.mir (original)
+++ llvm/trunk/test/CodeGen/MIR/ARM/bundled-instructions.mir Fri Aug 14 14:07:07 2015
@@ -1,6 +1,6 @@
# RUN: llc -mtriple thumbv7-apple-ios -start-after block-placement -stop-after block-placement -o /dev/null %s | FileCheck %s
# This test ensures that the MIR parser parses the bundled machine instructions
-# correctly.
+# and 'internal' register flags correctly.
--- |
@@ -32,7 +32,7 @@ body: |
; CHECK-NEXT: t2CMNri killed %r0, 78, 14, _, implicit-def %cpsr
; CHECK-NEXT: BUNDLE implicit-def dead %itstate, implicit-def %r1, implicit killed %cpsr {
; CHECK-NEXT: t2IT 12, 8, implicit-def %itstate
- ; CHECK-NEXT: %r1 = t2MOVi 1, 12, killed %cpsr, _
+ ; CHECK-NEXT: %r1 = t2MOVi 1, 12, killed %cpsr, _, implicit internal killed %itstate
; CHECK-NEXT: }
; CHECK-NEXT: %r0 = tMOVr killed %r1, 14, _
; CHECK-NEXT: tBX_RET 14, _, implicit killed %r0
@@ -40,7 +40,7 @@ body: |
t2CMNri killed %r0, 78, 14, _, implicit-def %cpsr
BUNDLE implicit-def dead %itstate, implicit-def %r1, implicit killed %cpsr {
t2IT 12, 8, implicit-def %itstate
- %r1 = t2MOVi 1, 12, killed %cpsr, _
+ %r1 = t2MOVi 1, 12, killed %cpsr, _, implicit internal killed %itstate
}
%r0 = tMOVr killed %r1, 14, _
tBX_RET 14, _, implicit killed %r0
@@ -62,14 +62,14 @@ body: |
; CHECK-NEXT: t2CMNri killed %r0, 78, 14, _, implicit-def %cpsr
; CHECK-NEXT: BUNDLE implicit-def dead %itstate, implicit-def %r1, implicit killed %cpsr {
; CHECK-NEXT: t2IT 12, 8, implicit-def %itstate
- ; CHECK-NEXT: %r1 = t2MOVi 1, 12, killed %cpsr, _
+ ; CHECK-NEXT: %r1 = t2MOVi 1, 12, killed %cpsr, _, implicit internal killed %itstate
; CHECK-NEXT: }
; CHECK-NEXT: %r0 = tMOVr killed %r1, 14, _
; CHECK-NEXT: tBX_RET 14, _, implicit killed %r0
%r1 = t2MOVi 0, 14, _, _
t2CMNri killed %r0, 78, 14, _, implicit-def %cpsr
BUNDLE implicit-def dead %itstate, implicit-def %r1, implicit killed %cpsr { t2IT 12, 8, implicit-def %itstate
- %r1 = t2MOVi 1, 12, killed %cpsr, _
+ %r1 = t2MOVi 1, 12, killed %cpsr, _, internal implicit killed %itstate
} %r0 = tMOVr killed %r1, 14, _
tBX_RET 14, _, implicit killed %r0
...
More information about the llvm-commits
mailing list