[llvm-commits] [PATCH] check for blockaddress in Function::hasAddressTaken

Jay Foad jay.foad at gmail.com
Sat May 12 01:32:01 PDT 2012


On 11 May 2012 22:40, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Fri, May 11, 2012 at 2:08 PM, Jay Foad <jay.foad at gmail.com> wrote:
>> The attached patch addresses a FIXME in Function::hasAddressTaken:
>>
>>    // FIXME: Check for blockaddress, which does not take the address.
>>
>> (Eli, you added this comment in r142572.)
>>
>> I've adjusted GlobalOpt, which was assuming that !F->hasAddressTaken()
>> implies that all users of F are Call or Invoke instructions. I suppose
>> it's possible that other out-of-tree code makes the same assumption
>> and will need adjusting. I've added a new test to check that
>> -globalopt can now work some of its magic on a function that contains
>> a blockaddress.
>>
>> Tested with "make check-all", LLVM and Clang, on Linux/x86-64. OK to commit?
>
> Please update the comment in Function.h to note this.
>
> It would be more clear in GlobalOpt to explicitly exclude
> BlockAddresses, rather than implicitly excluding them using the cast
> to Instruction*.
>
> Otherwise, this looks fine.

OK, committed with those changes in r156703. Thanks!

Jay.




More information about the llvm-commits mailing list