Wrong value for sext i1 true in BasicAliasAnalysis

Hal Finkel hfinkel at anl.gov
Tue Dec 9 10:21:09 PST 2014


Hi Yin,

Do you have a test case for this? I don't understand where this special case comes from. And if we do have a special case here, it seems this should be noted in the LangRef (which currently says only, "If the offsets have a different width from the pointer, they are sign-extended or truncated to the width of the pointer."). And, in fact, the LangRef documentation for the sext instructions says, "When sign extending from i1, the extension always results in -1 or 0."

Thanks again,
Hal

----- Original Message -----
> From: "Yin Ma" <yinma at codeaurora.org>
> To: llvm-commits at cs.uiuc.edu
> Cc: hfinkel at anl.gov
> Sent: Monday, December 8, 2014 4:49:34 PM
> Subject: Wrong value for sext i1 true in BasicAliasAnalysis
> 
> 
> 
> 
> Hi Hal,
> 
> 
> 
> How are you doing. For your patch db1e51359, you changed offset
> computation
> 
> from zext to sext. However, I came across a case that expression
> contains i1 true to i32.
> 
> true is value 1 for offset. if it is sext to 32bit, the result of
> sext will not be 1. Instead, it will
> 
> be -1. Sext true is a special case. This will make AA check failed
> when one GEP contains
> 
> i1 true to i32 expression but the other GEP doesn’t.
> 
> 
> 
> I attached my change. How do you think? If it is valid patch, please
> merge it to the tip.
> 
> 
> 
> Thanks,
> 
> 
> 
> Yin

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory




More information about the llvm-commits mailing list