[PATCH] D96087: Option to ignore llvm[.compiler].used uses in hasAddressTaken()

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 9 11:26:12 PST 2021


rampitec added inline comments.


================
Comment at: llvm/lib/IR/Function.cpp:1617
+                     (GV->getName().equals("llvm.compiler.used") ||
+                      GV->getName().equals("llvm.used"));
+            return false;
----------------
madhur13490 wrote:
> Can you please add a test which has non-bitcast value of function pointers? Something like below;
> 
> ```
> @llvm.used = appending global [2 x float()*] [void()* @foo, void()* @bar]
> ```
> 
> IIRC, the above simple cast to GlobalVariable is not sufficient in this case. You need to handle it with some more extra checks.
Does this really happen? My understanding these arrays shall have i8* type, so a function pointer always needs a bitcast.


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

https://reviews.llvm.org/D96087



More information about the llvm-commits mailing list