[PATCH] D63444: [ThinLTO] Optimize write-only globals out

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 17 10:56:59 PDT 2019


steven_wu added a comment.

Sounds like an interesting optimization. Is the global storage (from the other module) also eliminated in this case? If so, can you add a testcase for that?



================
Comment at: include/llvm/IR/ModuleSummaryIndex.h:165
 struct ValueInfo {
-  PointerIntPair<const GlobalValueSummaryMapTy::value_type *, 2, int>
+  enum Flags { HaveGV = 1, ReadOnly = 2, WriteOnly = 4 };
+  PointerIntPair<const GlobalValueSummaryMapTy::value_type *, 3, int>
----------------
Would it be cleaner if you create a new enum bitfield for access specifier?
```
enum Access { ReadWrite = 0, ReadOnly = 1, WriteOnly =2, Invalid =3 };
```
This should make all the method below a bit cleaner. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63444/new/

https://reviews.llvm.org/D63444





More information about the llvm-commits mailing list