[llvm-commits] [llvm] r89602 - /llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
Nick Lewycky
nicholas at mxc.ca
Sun Nov 22 12:20:02 PST 2009
Eli Friedman wrote:
> On Sun, Nov 22, 2009 at 2:54 PM, Eli Friedman<eli.friedman at gmail.com> wrote:
>> On Sun, Nov 22, 2009 at 11:16 AM, Chris Lattner<sabre at nondot.org> wrote:
>>> --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
>>> +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Sun Nov 22 10:16:48 2009
>>> @@ -263,6 +263,7 @@
>>> bool BasicAliasAnalysis::pointsToConstantMemory(const Value *P) {
>>> if (const GlobalVariable *GV =
>>> dyn_cast<GlobalVariable>(P->getUnderlyingObject()))
>>> + // FIXME: shouldn't this require GV to be "ODR"?
>>> return GV->isConstant();
>>> return false;
>>> }
>>
>> I don't think it legal for a non-constant to override a constant.
>> (This isn't looking at the initializer.)
>
> Erm, more precisely, it isn't legal to modify a global that is marked
> constant in any module.
So we could optimize GlobalVariables with constant initializers into
having _odr linkage (where applicable of course)?
Nick
More information about the llvm-commits
mailing list