[PATCH] D98884: [IR] Add opt-in parameter to hasAddressTaken() to ignore bitcasts callee in callbase instruction

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 19 12:15:26 PDT 2021


rampitec added a comment.

In D98884#2638318 <https://reviews.llvm.org/D98884#2638318>, @madhur13490 wrote:

> In D98884#2635600 <https://reviews.llvm.org/D98884#2635600>, @rampitec wrote:
>
>> This test also does not really work until you add true argument to the call graph builder.
>
> I am not sure if I follow. I don't intend do any changes (at least for current patch) in the way call graph builder works because that will break a lot of things. (I tried adding "true" for call graph builder and call changed which was obvious.) FileCheck commands are just inline with what this opt with this patch would emit. Referring to https://reviews.llvm.org/D96087, would those test cases too won't work?

The problem is that test does not exercise your code unless it is enabled, so it does not test anything.
Remove the option though and do it always, a direct call through bitcast does not take function's address. That will make test functional as well.
Also a second call to the same bitcast which will test that all_of() in case it has more than one use.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98884



More information about the llvm-commits mailing list