Revert "[X86][MS-InlineAsm] Use exact conditions to recognize MS global variables"

This reverts commit 682d01a1c1.

Revert for buildbot fails.
This commit is contained in:
Phoebe Wang 2021-12-23 12:44:33 +08:00
parent 94a47dfde2
commit a954558e87
3 changed files with 6 additions and 6 deletions

View File

@ -39,7 +39,7 @@ int bar() {
int baz() {
// CHECK-LABEL: _baz:
__asm mov eax, k;
// CHECK: movl _k, %eax
// CHECK: movl k, %eax
__asm mov eax, kptr;
// CHECK: movl _kptr, %eax
}

View File

@ -1759,8 +1759,7 @@ bool X86AsmParser::CreateMemForMSInlineAsm(
// registers in a mmory expression, and though unaccessible via rip/eip.
if (IsGlobalLV && (BaseReg || IndexReg)) {
Operands.push_back(X86Operand::CreateMem(getPointerWidth(), Disp, Start,
End, Size, Identifier, Decl,
FrontendSize));
End, Size, Identifier, Decl));
return false;
}
// Otherwise, we set the base register to a non-zero value

View File

@ -286,9 +286,10 @@ struct X86Operand final : public MCParsedAsmOperand {
bool isOffsetOfLocal() const override { return isImm() && Imm.LocalRef; }
bool isMemPlaceholder(const MCInstrDesc &Desc) const override {
// Only MS InlineAsm uses global variables with registers rather than
// rip/eip.
return !Mem.DefaultBaseReg && Mem.FrontendSize;
// Add more restrictions to avoid the use of global symbols. This helps
// with reducing the code size.
return !Desc.isRematerializable() && !Desc.isCall() && isMem() &&
!Mem.BaseReg && !Mem.IndexReg;
}
bool needAddressOf() const override { return AddressOf; }