[PATCH] D28126: [MemDep] Handle gep with zeros for invariant.group

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 29 16:06:56 PST 2016


reames added inline comments.


================
Comment at: lib/Analysis/MemoryDependenceAnalysis.cpp:392
+      // U = getelementptr Ptr, 0, 0...
+      if (auto *GEP = dyn_cast<GetElementPtrInst>(U)) {
+        if (GEP->hasAllZeroIndices()) {
----------------
minor: remove brackets for single statement ifs.  


================
Comment at: test/Transforms/GVN/invariant.group.ll:323
+; CHECK-LABEL: define void @_Z5testGv() {
+define void @_Z5testGv() {
+  %a = alloca %struct.A, align 8
----------------
you need a few more check statements here.  As written, I'm not sure what this test is testing by just reading it.

Also, can you strip away any of this?


https://reviews.llvm.org/D28126





More information about the llvm-commits mailing list