.Case("invariant", MIToken::kw_invariant)
.Case("align", MIToken::kw_align)
.Case("stack", MIToken::kw_stack)
+ .Case("got", MIToken::kw_got)
.Case("constant-pool", MIToken::kw_constant_pool)
.Case("liveout", MIToken::kw_liveout)
.Default(MIToken::Identifier);
kw_invariant,
kw_align,
kw_stack,
+ kw_got,
kw_constant_pool,
kw_liveout,
case MIToken::kw_stack:
PSV = MF.getPSVManager().getStack();
break;
+ case MIToken::kw_got:
+ PSV = MF.getPSVManager().getGOT();
+ break;
case MIToken::kw_constant_pool:
PSV = MF.getPSVManager().getConstantPool();
break;
}
bool MIParser::parseMachinePointerInfo(MachinePointerInfo &Dest) {
- if (Token.is(MIToken::kw_constant_pool) || Token.is(MIToken::kw_stack)) {
+ if (Token.is(MIToken::kw_constant_pool) || Token.is(MIToken::kw_stack) ||
+ Token.is(MIToken::kw_got)) {
const PseudoSourceValue *PSV = nullptr;
if (parseMemoryPseudoSourceValue(PSV))
return true;
case PseudoSourceValue::Stack:
OS << "stack";
break;
+ case PseudoSourceValue::GOT:
+ OS << "got";
+ break;
case PseudoSourceValue::ConstantPool:
OS << "constant-pool";
break;
attributes #0 = { readonly }
+ @G = external global i32
+
+ define i32 @got_psv() {
+ entry:
+ %a = load i32, i32* @G
+ %b = add i32 %a, 1
+ ret i32 %b
+ }
+
...
---
name: test
- '%rsp = ADD64ri8 %rsp, 24, implicit-def dead %eflags'
- RETQ
...
+---
+name: got_psv
+tracksRegLiveness: true
+body:
+ - id: 0
+ name: entry
+ instructions:
+# CHECK: name: got_psv
+# CHECK: %rax = MOV64rm %rip, 1, _, @G, _ :: (load 8 from got)
+ - '%rax = MOV64rm %rip, 1, _, @G, _ :: (load 8 from got)'
+ - '%eax = MOV32rm killed %rax, 1, _, 0, _'
+ - '%eax = INC32r killed %eax, implicit-def dead %eflags'
+ - 'RETQ %eax'
+...