[PATCH] D76645: [GlobalOpt] Treat null-check of loaded value as use of global (PR35760)

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 23 16:54:05 PDT 2020


efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.

LGTM

We could theoretically optimize this to two globals: one for the actual allocation, and a boolean representing whether it's been allocated.  But that would be a different transform, and I don't expect you to implement it.



================
Comment at: llvm/test/Transforms/GlobalOpt/null-check-is-use-pr35760.ll:47
+!0 = !{i32 1, !"wchar_size", i32 4}
+!1 = !{!"clang version 11.0.0 (https://github.com/llvm/llvm-project.git 34c0759f846447454714c8faa0e1753a8713637b)"}
----------------
Please delete unnecessary metadata.


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

https://reviews.llvm.org/D76645





More information about the llvm-commits mailing list