MIR Serialization: Serialize the memory operand's noalias metadata node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245246 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alex Lorenz 2015-08-17 22:08:02 +00:00
parent ed8c969d30
commit 971d8c0000
5 changed files with 15 additions and 4 deletions

View File

@ -446,6 +446,7 @@ static MIToken::TokenKind getMetadataKeywordKind(StringRef Identifier) {
return StringSwitch<MIToken::TokenKind>(Identifier)
.Case("!tbaa", MIToken::md_tbaa)
.Case("!alias.scope", MIToken::md_alias_scope)
.Case("!noalias", MIToken::md_noalias)
.Default(MIToken::Error);
}

View File

@ -88,6 +88,7 @@ struct MIToken {
// Named metadata keywords
md_tbaa,
md_alias_scope,
md_noalias,
// Identifier tokens
Identifier,

View File

@ -1543,11 +1543,16 @@ bool MIParser::parseMachineMemoryOperand(MachineMemOperand *&Dest) {
if (parseMDNode(AAInfo.Scope))
return true;
break;
// TODO: Parse AA NoAlias metadata.
case MIToken::md_noalias:
lex();
if (parseMDNode(AAInfo.NoAlias))
return true;
break;
// TODO: Parse the ranges metadata.
// TODO: Report an error on duplicate metadata nodes.
default:
return error("expected 'align' or '!tbaa' or '!alias.scope'");
return error(
"expected 'align' or '!tbaa' or '!alias.scope' or '!noalias'");
}
}
if (expectAndConsume(MIToken::rparen))

View File

@ -786,7 +786,10 @@ void MIPrinter::print(const MachineMemOperand &Op) {
OS << ", !alias.scope ";
AAInfo.Scope->printAsOperand(OS, MST);
}
// TODO: Print AA NoAlias metadata.
if (AAInfo.NoAlias) {
OS << ", !noalias ";
AAInfo.NoAlias->printAsOperand(OS, MST);
}
// TODO: Print the ranges metadata.
OS << ')';
}

View File

@ -400,7 +400,8 @@ body: |
; CHECK-LABEL: name: aa_scope
; CHECK: %xmm0 = MOVSSrm %rsi, 1, _, 0, _ :: (load 4 from %ir.c, !alias.scope !9)
%xmm0 = MOVSSrm %rsi, 1, _, 0, _ :: (load 4 from %ir.c, !alias.scope !9)
MOVSSmr %rdi, 1, _, 20, _, killed %xmm0 :: (store 4 into %ir.arrayidx.i)
; CHECK-NEXT: MOVSSmr %rdi, 1, _, 20, _, killed %xmm0 :: (store 4 into %ir.arrayidx.i, !noalias !9)
MOVSSmr %rdi, 1, _, 20, _, killed %xmm0 :: (store 4 into %ir.arrayidx.i, !noalias !9)
%xmm0 = MOVSSrm killed %rsi, 1, _, 0, _ :: (load 4 from %ir.c)
MOVSSmr killed %rdi, 1, _, 28, _, killed %xmm0 :: (store 4 into %ir.arrayidx)
RETQ