[PATCH] D38272: [SimplifyIndVar] Constant fold IV users

Hongbin Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 15:30:48 PDT 2017


etherzhhb created this revision.

This patch tries to transform cases like:

  for (unsigned i = 0; i < N; i += 2) {
    bool c0 = (i & 0x1) == 0;
    bool c1 = ((i + 1) & 0x1) == 1;
  }

To

  for (unsigned i = 0; i < N; i += 2) {
    bool c0 = true;
    bool c1 = true;
  }


Repository:
  rL LLVM

https://reviews.llvm.org/D38272

Files:
  lib/Transforms/Utils/SimplifyIndVar.cpp
  test/Transforms/IndVarSimplify/constant-fold.ll
  test/Transforms/IndVarSimplify/replace-srem-by-urem.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38272.116641.patch
Type: text/x-patch
Size: 3678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170926/707098c3/attachment.bin>


More information about the llvm-commits mailing list