HomePhabricator

[InstCombine] propagate 'nsw' on pointer difference of 'inbounds' geps

Authored by spatel on Nov 23 2020, 1:46 PM.

Description

[InstCombine] propagate 'nsw' on pointer difference of 'inbounds' geps

This is a retry of 324a53205. I cautiously reverted that at 6aa3fc4
because the rules about gep math were not clear. Since then, we
have added this line to LangRef for gep inbounds:
"The successive addition of offsets (without adding the base address)
does not wrap the pointer index type in a signed sense (nsw)."

See D90708 and post-commit comments on the revert patch for more details.

Details

Committed
spatelNov 23 2020, 1:50 PM
Parents
rGa1c342bf1146: [gn build] Port f6b02ecd027
Branches
Unknown
Tags
Unknown