[InstCombine] Preserve inbounds when folding select of GEP
The select base, (gep base, offset) to gep base, select (0, offset) fold used to drop inbounds, because the gep base, 0 this introduces might not be inbounds. After the semantics change in D154051, such a GEP is always considered inbounds, in which allows us to preserve the flag here. As the PhaseOrdering test demonstrates, this can result in major optimization improvements in some cases. Differential Revision: https://reviews.llvm.org/D154055
parent
99074aaf
Please register or sign in to comment