[llvm] [MC/DC][Coverage] Split out Read-modfy-Write to rmw_or(ptr, i8) (PR #96040)

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 16:48:44 PDT 2024


================
@@ -937,6 +949,44 @@ Value *InstrLowerer::getCounterAddress(InstrProfCntrInstBase *I) {
   return Builder.CreateIntToPtr(Add, Addr->getType());
 }
 
+Function *InstrLowerer::createRMWOrFunc() {
+  auto &Ctx = M.getContext();
+  auto *Int8Ty = Type::getInt8Ty(Ctx);
+  // void alwaysinline rmw_or(ptr, i8)
+  Function *Fn = Function::Create(
+      FunctionType::get(Type::getVoidTy(Ctx),
+                        {PointerType::getUnqual(Ctx), Int8Ty}, false),
+      Function::LinkageTypes::PrivateLinkage, "rmw_or", M);
----------------
chapuni wrote:

I've reconfirmed this won't clash. If I called `createRMWOrFunc()` twice, I got both `@rmw_or` and `@rmw_or.1`.

This may work with unnamed.

https://github.com/llvm/llvm-project/pull/96040


More information about the llvm-commits mailing list