[PATCH] D146164: Fix nomerge attribute not working with __builtin_trap().

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 16 06:17:13 PDT 2023


hans added a comment.

Since we're touching SelectionDAG, does GlobalISel also need updating?



================
Comment at: clang/test/CodeGen/attr-nomerge.cpp:44
+
+  [[clang::nomerge]] __builtin_trap();
 }
----------------
Maybe do __debugbreak() too since that's also mentioned on the debug.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:6853
       }
+      DAG.addNoMergeSiteInfo(Node.getNode(), I.hasFnAttr(Attribute::NoMerge));
+      DAG.setRoot(Node);
----------------
(I guess you could have used `DAG.getRoot()` instead of creating the `Node` variable.)


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:6856
       return;
     }
     TargetLowering::ArgListTy Args;
----------------
Do we need to handle this "else" branch too?

Or would it make sense to do the nomerge check in the caller of `visitIntrinsicCall` instead?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146164



More information about the cfe-commits mailing list