[PATCH] D113510: [InstCombine] Strip offset when folding and/or of icmps

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 10 07:58:03 PST 2021


spatel added a comment.

Nice!

I don't see any test diffs with 2 signed preds. Is there any value in adding a test like that to further exercise the range logic?

  define i1 @src(i64 %x) {
    %t1 = add i64 %x, 127
    %t2 = icmp slt i64 %t1, 1024
    %t3 = add i64 %x, 128
    %t4 = icmp slt i64 %t3, 256
    %t5 = and i1 %t2, %t4
    ret i1 %t5
  }



================
Comment at: llvm/test/Transforms/InstCombine/signed-truncation-check.ll:958
 
 ; I don't think this can be folded, at least not into single instruction.
 define i1 @two_signed_truncation_checks(i32 %arg) {
----------------
It's not a single instruction, but don't need this comment now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113510/new/

https://reviews.llvm.org/D113510



More information about the llvm-commits mailing list