Details
Details
- Reviewers
george.burgess.iv hfinkel asbirlea
Diff Detail
Diff Detail
Event Timeline
lib/Analysis/BasicAliasAnalysis.cpp | ||
---|---|---|
1016 | Constants should always have already been canonicalized to the RHS |
Comment Actions
I think we need to check whether shl/mul has nsw flag.
For example, 'shl i16 1024, 10' and 'shl i16 1024, 11' are both 0, so we need to check whether they don't overflow.
Comment Actions
Right. For my input there is no nsw flag but I guess one could equally well require more assumes on %X e.g. that it is in interval [a,b] and for this range the shl does not overflow.
edit: Or maybe if those assumes were already present some other pass would already have set a nsw flag on on the shl.
Comment Actions
Did some more experiments, trying to clean up the code and make it more generic.
Instead of only determining if X != 0 (which is clearly not sufficient) try to produce a value range for the variable and use that.
Constants should always have already been canonicalized to the RHS