[PATCH] D133914: [InlineAsm][bugfix] Correct function addressing in inline asm

Xiang Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 9 23:27:39 PDT 2022


xiangzhangllvm added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8812
   for (SDISelAsmOperandInfo &OpInfo : ConstraintOperands) {
+    if (OpInfo.hasArg() || OpInfo.Type == InlineAsm::isOutput)
+      ArgNo++;
----------------
pengfei wrote:
> I see the GlobalISel handles argument and result separately https://github.com/llvm/llvm-project/blob/main/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp#L289-L290. No sure if there's problem to handle together here, e.g., a constrain is both argument and output https://godbolt.org/z/98sne5h4x or other corner cases?
Here ArgNo is different conception with the "ArgNo" in https://github.com/llvm/llvm-project/blob/main/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp#L289-L290. 
It mean the index of OpInfo, it both work for GlobalISel  and non-GlobalISel. 
Maybe "OpNo" is more clear. Let me rename it .


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

https://reviews.llvm.org/D133914



More information about the llvm-commits mailing list