Instcombine will replace sdiv with udiv if it can prove the sign bit is
zero, but it isn't very good at analyzing induction variables; we might
be able to improve that.
There are also some related transforms in
lib/Transforms/Utils/SimplifyIndVar.cpp.
-Eli
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
I haven't really looked into it closely, but it seems to make sense.
-Eli
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
_______________________________________________
On 3/29/2017 1:05 PM, Hongbin Zheng wrote:
Hi Eli,
Thanks. Do you mean ideally we should extend SimplifyIndVar to do the sdiv->udiv replacement?
I haven't really looked into it closely, but it seems to make sense.
On Wed, Mar 29, 2017 at 2:15 PM, Friedman, Eli <efri...@codeaurora.org> wrote:
On 3/29/2017 1:05 PM, Hongbin Zheng wrote:
Hi Eli,
Thanks. Do you mean ideally we should extend SimplifyIndVar to do the sdiv->udiv replacement?
I haven't really looked into it closely, but it seems to make sense.Ok.
Once I extend SimplifyIndVar, e.g. the simplifyUsersOfIV function. How I can add a regression test for the extension? simplifyUsersOfIV is not a pass.