[PATCH] D64203: [OpaquePtr] add Type parameter to Loads.h analysis API.

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 04:35:36 PDT 2019


t.p.northover marked an inline comment as done.
t.p.northover added a comment.

Thanks David. Committed with your suggestions as r365468.



================
Comment at: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:611-612
+    if (BaseTy && NewBaseTy != BaseTy)
+      return false;
+    else if (!BaseTy) {
+      BaseTy = NewBaseTy;
----------------
dblaikie wrote:
> Drop the 'else' after return?
> 
> (& potentially invert the second condition to use an early return & reduce indentation:  
> 
>   if (BaseTy)
>     return true;
> 
>   BaseTy = NewBaseTy;
>   if (allCallers(...)) {
>     ...
>   }
> 
>   return true;
I decided

    if (BaseTy)
      return BaseTy == NewBaseTy;

was even better.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64203





More information about the llvm-commits mailing list