[PATCH] D30331: [ImplicitNullCheck] Add alias analysis usage

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 21:31:39 PST 2017


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

lgtm with really minor tweaks



================
Comment at: lib/CodeGen/ImplicitNullChecks.cpp:168
+  /// they may alias and any further memory operation may alias with \p PrevMI.
+  ImplicitNullChecks::AliasResult areMemoryOpAliased(MachineInstr &MI,
+                                                     MachineInstr *PrevMI);
----------------
The ` ImplicitNullChecks::` is not needed here, is it?

Also, I'd prefer plural here, as `areMemoryOpsAliased`.


================
Comment at: lib/CodeGen/ImplicitNullChecks.cpp:309
+    return AR_NoAlias;
+  // We lost info, conservatively alias. if it was store then no sense to
+  // continue because we won't be able to check against it further.
----------------
s/if/If/


================
Comment at: lib/CodeGen/ImplicitNullChecks.cpp:324
+          return AR_MayAlias;
+        else
+          continue;
----------------
No need for the else.  That is, you can say:

```
if (...)
  return ...;
continue;
```



https://reviews.llvm.org/D30331





More information about the llvm-commits mailing list