[PATCH] PR18165: Fix overflow problem in LSR

Andrew Trick atrick at apple.com
Tue Feb 18 15:39:23 PST 2014


On Feb 18, 2014, at 12:49 PM, Michael Zolotukhin <mzolotukhin at apple.com> wrote:

> Hi,
> 
> Attached is a fix for PR18165.
> 
> This patch fixes the following problem in LSR: when LSR replaces uses of one IV with the other, it needs to adjust the corresponding offsets. Adjusting here means multiplication by the strides ratio (factor). In the test we had one IV of type i8, its offset was 128, and the factor for this IV and the base IV was 2. LSR got the adjusted offset of 128*2=256 which later was truncated to i8, resulting in incorrect comparison result.
> 
> The patch adds a check for the validity of such adjustment. Is it ok for trunk?
> 
> <pr18165.patch>


Thanks Michael. I can commit this for you, but let me give other reviewers some time first. If I forget, please ping me.

-Andy



More information about the llvm-commits mailing list