[PATCH] D20217: Add direct control of whether or not a symbol is preemtable at runtime

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Thu May 12 12:43:03 PDT 2016


joker.eph added a comment.

I agree with the general idea. I ranted about that in the past: I don't like the fact that a "default visibility" means different things depending on the object format or the platform. Whatever new attribute we come up with, it would be nice if it allows to simplifies the IR definition of "visibility" so that "default" would be "declaration is visible to other modules" and nothing more.

We should rethink the predicate we have based on the linkage in GlobalValue (things like `mayBeOverridden()`,  `isInterposable()`, etc.) in light of a new attribute such as what you're proposing here.


================
Comment at: lib/IR/Globals.cpp:55
@@ +54,3 @@
+  return Default;
+}
+
----------------
I'm not fond of "This bit is set when we want to mark the runtime preemption as being different from the link time one", I rather have a real flag on the global value that say "isRuntimePremptable()" and avoid doing complicated inference in `shouldAssumeDSOLocal()` or in LLParser.cpp. I.e. it seems to me that it is easier to think about it as an "absolute" instead of a "relative" concept.


http://reviews.llvm.org/D20217





More information about the llvm-commits mailing list