[PATCH] D11685: cache OptSize and MinSize attributes in the DAG

Sanjay Patel spatel at rotateright.com
Mon Aug 3 10:08:48 PDT 2015


spatel added inline comments.

================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:943
@@ +942,3 @@
+  OptForSize = F->hasFnAttribute(Attribute::OptimizeForSize) ||
+               F->hasFnAttribute(Attribute::MinSize);
+  MinSize = F->hasFnAttribute(Attribute::MinSize);
----------------
mkuper wrote:
> Actually, can we split this into two commits - one NFC for the caching, and one that actually changes the behavior?
> 
> Also, I don't think this || really belongs in the DAG - it ought to be just querying the Function or the MachineFunction, and MinSize should imply OptForSize on that level. Is that what you're aiming at?
Yes - agree on both points. And if we have this interface/logic in the MachineFunction, then it probably obviates the need to cache these in the DAG entirely, so I'll most likely abandon this patch.


http://reviews.llvm.org/D11685







More information about the llvm-commits mailing list