[llvm-commits] [llvm] r71688 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
Dale Johannesen
dalej at apple.com
Wed May 13 13:27:15 PDT 2009
On May 13, 2009, at 1:24 PMPDT, Eli Friedman wrote:
> On Wed, May 13, 2009 at 1:18 PM, Dale Johannesen <dalej at apple.com>
> wrote:
>>
>> On May 13, 2009, at 1:15 PMPDT, Eli Friedman wrote:
>>
>>> On Wed, May 13, 2009 at 12:03 PM, Dale Johannesen <dalej at apple.com>
>>> wrote:
>>>> The previous test
>>>>
>>>>>> if (!isa<AllocaInst>(I->getOperand(0)) &&
>>>>>> !isa<Constant>(I->getOperand(0)))
>>>>>> return false;
>>>>
>>>> will reject GEP's won't it?
>>>
>>> It will reject GEP instructions, but not GEP constant expressions.
>>
>> Right, a couple people have explained that. However, the case we
>> want
>> to look for is a weak external, which is undefined and therefore
>> cannot be initialized. I think constant expressions can only arise
>> from initializers?
>
> Wrong; for example, take a testcase like the following:
> __attribute((weak)) extern int x[2];
> int a() { return x[0]; }
Yeah.
More information about the llvm-commits
mailing list