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

Xiang Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 18:00:14 PDT 2022


xiangzhangllvm added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/TargetLowering.h:3531
+  virtual bool
+  isInlineAsmTargetBranch(const SmallVectorImpl<StringRef> &AsmStrs,
+                          unsigned OpNo) const {
----------------
RKSimon wrote:
> Why not ArrayRef<StringRef> ?
Because we collect SmallVector<StringRef> AsmStrs in 
SelectionDAGBuilder.cpp: (line 8808)
```
   IA->collectAsmStrs(AsmStrs);
```
So here we keep use the same type for AsmStrs.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8724
+static bool isFunction(SDValue Op) {
+  if (Op.getNode() && Op.getOpcode() == ISD::GlobalAddress) {
+    if (auto *GA = dyn_cast<GlobalAddressSDNode>(Op)) {
----------------
RKSimon wrote:
> SDValue has a bool operator so we don't need to use getNode()
> ```
> if (Op && Op.getOpcode() == ISD::GlobalAddress) {
> ```
That is better, let me try, thanks so much!


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

https://reviews.llvm.org/D133914



More information about the llvm-commits mailing list