rsmith added a comment.

FYI: this attribute appears to not work on (at least) x86 and arm currently, 
because the backend also does some merging: https://godbolt.org/z/d43M83oax



================
Comment at: clang/lib/CodeGen/CGExpr.cpp:3626-3627
   }
-
+  if (InNoMergeAttributedStmt)
+    TrapCall->addFnAttr(llvm::Attribute::NoMerge);
   return TrapCall;
----------------
There are 496 calls to `Builder.CreateCall` in clang's `CodeGen`. Do they all 
need this change? If not, how can we be confident we've found all the ones that 
do? (From a quick check, at least MSVC's `__fastfail` builtin seems like it 
would also benefit from this handling.)

Would it be reasonable to make clang's `CGBuilder` do this for every call 
instruction we create?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146164

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

Reply via email to