[PATCH] D27449: [ARM] Implement execute-only support in CodeGen

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 06:59:32 PST 2016


rengolin added inline comments.


================
Comment at: lib/Target/ARM/ARM.td:267
+// Execute-only is also referred to as pure code by GCC
+def FeatureExecuteOnly : SubtargetFeature<"execute-only", "GenExecuteOnly", "true",
+                                        "Don't use data access to code sections">;
----------------
prakhar wrote:
> rengolin wrote:
> > grosbach wrote:
> > > Why use a Feature flag for this? This isn't an attribute of the CPU, but rather a code generation option, right?
> > > 
> > > Would a function attribute be sufficient? At first look, it seems all the decisions to be made are about how to handle any given function's constant data. That would have the added benefit of making LTO "just work" since function attributes propagate naturally.
> > Oh, I missed that one! Indeed, this is a codegen attribute, which is dependent on the platform, but not enough to be a sub-target feature.
> > 
> > I think the confusion is that Clang emits "-target-feature" "+execute-only", but those are different things.
> If I understand the concept correctly, then it sounds like execute-only is something that relates to codegen rather than an attribute of a CPU. How would I go about implementing a codegen option, and is there an example I can follow for this?
Have a look at `UseFusedMulOps` in `ARMSubtarget.cpp`. There are other examples in the CPP files that you can also take from.


https://reviews.llvm.org/D27449





More information about the llvm-commits mailing list