[PATCH] D76965: [FunctionAttrs][Mem2Reg] Handle Alloca passed as function call operand with function attributes

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 08:38:06 PDT 2020


jdoerfert added a comment.

I'm unsure about the scope of this. It seems to match a particular pattern and it is unclear this is the right place to do so. Have you considered doing this as part of `AAPrivatizablePtr` (or a new AbstractAttribute) in the Attributor?



================
Comment at: llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:317
   // Knowing that this alloca is promotable, we know that it's safe to kill all
   // instructions except for load and store.
-
----------------
This comment will be outdated.


================
Comment at: llvm/test/Transforms/Mem2Reg/fnattr.ll:1
+; RUN: opt -S < %s -mem2reg | FileCheck %s
+
----------------
If it is OK with you, please run `update_test_checks.py --function-signature --scrub-attributes` on this file to create the check lines. I personally find it way easier to read as almost complete check lines.


================
Comment at: llvm/test/Transforms/Mem2Reg/fnattr.ll:111
+    ret i32 %d
+}
----------------
We should do something with the return value of `is_same`, either here or in `is_same`. Dead code for testing is not always future proof. Similarly in other test cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76965





More information about the llvm-commits mailing list