PATCH + test for PR18032 (InstCombine issue)
stpworld at narod.ru
Fri Dec 20 03:45:56 PST 2013
Please find in attachment my PR18032 fix for review.
InstCombine Pass emits wrong alignment for 'load' instruction with 'null' as
Problem was in Local.cpp, llvm::getOrEnforceKnownAlignment method.
Method analyzes trailing zeroes in address values and suggest its own
For example: for address 0x123123a8 we have 3 binary trailing zeroes, and
thus, method will suggest you 8 bytes alignment.
Doing same logic, it will suggest you maximum possible alignment (2^29) for
Then InstCombiner::visitLoadInst method will select maximum alignment of
was given in IR and what was suggested by getOrEnforceKnownAlignment; these
if (KnownAlign > EffectiveLoadAlign)
So, finally we got align of 536870912 bytes:
Add one more special case for getOrEnforceKnownAlignment. If address is 0,
we don't need to anylize trailing zeroes,
just return alignment known already (PrefAlign value).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2784 bytes
Desc: not available
More information about the llvm-commits