[llvm] [InferAttrs] Mark floating-point libcalls as errno-writing (PR #124742)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 12 07:35:26 PDT 2025


================
@@ -922,6 +922,15 @@ void Function::setOnlyAccessesInaccessibleMemory() {
   setMemoryEffects(getMemoryEffects() & MemoryEffects::inaccessibleMemOnly());
 }
 
+/// Determine if the call can access only errno memory.
+bool Function::onlyAccessesErrnoMemory() const {
+  return getMemoryEffects().onlyAccessesErrnoMem();
+}
+void Function::setOnlyAccessesErrnoMemory() {
+  setMemoryEffects(getMemoryEffects() &
+                   MemoryEffects::errnoMemOnly(ModRefInfo::Mod));
----------------
nikic wrote:

I don't think hardcoding this Mod under an API with this name is okay. Please rebase over https://github.com/llvm/llvm-project/commit/a502c656881c8bc28b49a08c29421059d00aca26 and remove these Function APIs, keeping everything local to BuildLibCalls.

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


More information about the llvm-commits mailing list