[PATCH] D24280: [IndVarSimplify] Prefer sext over zext when widening IV if it is non-negative and has a GEP user

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 07:33:33 PDT 2016


reames added a comment.

Also, as a separate patch, it would be good to add optimizations which cleanup the poor IR generated without the patch.  In particular, we should be able to zext(trunc(sext(x))) and sext(trunc(zext(x)))) should be foldable when we know that x is a positive number within the range of the trunc output space.  Both InstCombine (ValueTracking) and CVP (LVI) should be able to handle these cases.  Same for the GEP cases.


https://reviews.llvm.org/D24280





More information about the llvm-commits mailing list