[llvm] [IR] Add nowrap flags for trunc instruction (PR #85592)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 08:13:46 PDT 2024


antoniofrighetto wrote:

> @elhewaty There is a lot of possible followup work here, I think some of the most important piece would be:
> 
> * Implement inference for nuw/nsw flags in InstCombine
> * Implement zext(trunc nuw) and sext(trunc nsw) fold
> * Emit trunc nuw/nsw in SimplifyIndVars IV widening

@nikic, I'm taking a look at point 3. Not super familiar w/ IV widening, but I guess whenever the uses are truncated, we want to preserve the information that previously got lost? I'm mainly referring to `widenIVUse`/`truncateIVUse` and variants thereof (e.g., `widenWithVariantUse`) (cc/ @dtcxzyw).


https://github.com/llvm/llvm-project/pull/85592


More information about the llvm-commits mailing list