[all-commits] [llvm/llvm-project] 6bd127: [InstSimplify] use knownbits to fold more udiv/urem

Sanjay Patel via All-commits all-commits at lists.llvm.org
Wed Jan 12 12:07:19 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6bd127b07916015c8d4f603344f06836abba57d8
      https://github.com/llvm/llvm-project/commit/6bd127b07916015c8d4f603344f06836abba57d8
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-01-12 (Wed, 12 Jan 2022)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstSimplify/div.ll
    M llvm/test/Transforms/InstSimplify/rem.ll

  Log Message:
  -----------
  [InstSimplify] use knownbits to fold more udiv/urem

We could use knownbits on both operands for even more folds (and there are
already tests in place for that), but this is enough to recover the example
from:
https://github.com/llvm/llvm-project/issues/51934
(the tests are derived from the code in that example)

I am assuming no noticeable compile-time impact from this because udiv/urem
are rare opcodes.

Differential Revision: https://reviews.llvm.org/D116616




More information about the All-commits mailing list