[llvm] r178147 - Cleanup the simplify_type implementation.

Eli Friedman eli.friedman at gmail.com
Wed Jul 17 13:25:35 PDT 2013


On Tue, Jul 16, 2013 at 8:16 PM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
>>>> In terms of the patch itself, if I recall correctly, the enable_ifs
>>>> you're removing are necessary to reject a T* where T is simplifiable.
>>>> I could be wrong, though.
>>>
>>> Sorry, can you give an example of what you want to reject?
>>
>> Something like the following (there are probably better examples, but
>> I can't remember off the top of my head):
>>
>>     llvm::Value *V;
>>     llvm::Use *U = &V->use_begin().getUse();
>>     llvm::Constant *XXX = cast<llvm::Constant>(U);
>
> We used to accept
>
> Constant *foobar(Use *U) {
>   return cast<Constant>(U);
> }
>
> before r178147. Why would you want to reject it?

We want to reject it because it implicitly dereferences the pointer.

IIRC, we still accept the given example if you replace "Use *U" with
"Use ****U".

-Eli




More information about the llvm-commits mailing list