[llvm] AlignmentFromAssumptions should only track pointer operand users (PR #73370)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 05:38:09 PST 2023


================
@@ -266,22 +262,27 @@ bool AlignmentFromAssumptionsPass::processAssumption(CallInst *ACall,
 
     // Now that we've updated that use of the pointer, look for other uses of
     // the pointer to update.
-    Visited.insert(J);
-    for (User *UJ : J->users()) {
-      Instruction *K = cast<Instruction>(UJ);
-      if (!Visited.count(K))
-        WorkList.push_back(K);
-    }
+    if (auto UJ = dyn_cast<User>(J))
+      for (auto &U : UJ->uses()) {
+        if (U->getType()->isPointerTy()) {
+          if (AA->alias(U, AAPtr)) {
----------------
alex-t wrote:

Could you please explain you opinion? Why using AA "not appropriate"? Compile time issue?
Also, isa<PHINode> does not make any sense at all. See my explanation above.
So, given all the above my initial fix looks the easiest one.
Nothing except the load really need to be taken into account. 

https://github.com/llvm/llvm-project/pull/73370


More information about the llvm-commits mailing list