xiangzhangllvm added inline comments.

================
Comment at: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:1759
   // It is widely common for MS InlineAsm to use a global variable and one/two
   // registers in a mmory expression, and though unaccessible via rip/eip.
   if (IsGlobalLV && (BaseReg || IndexReg)) {
----------------
Let me generally tell out my understand here, (If wrong PLS correct me)
Here from the comments we can see, the old code want to keep the origin symbol 
of global variable to let linker (relocation) handle it.  Here you describe it 
with a  pointer (with decl), it change to form of $ID <--> (decl), So which 
need constrain it with "*m". But if the pointer can not be access from 
BaseReg(Rip) + Index(Ip) how do you descript the pointer you generate out ?



================
Comment at: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:2554-2555
   unsigned IndexReg = SM.getIndexReg();
+  if (IndexReg && BaseReg == X86::RIP)
+    BaseReg = 0;
   unsigned Scale = SM.getScale();
----------------
The change here looks too arbitrary. For global address it is ok to drop the 
base, it mainly fetch from offset. but if here not global variable?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113096/new/

https://reviews.llvm.org/D113096

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to