[PATCH] D102275: [x86] try to use PCMPGT instead of not-of-PCMPEQ

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 12 01:28:09 PDT 2021


RKSimon accepted this revision.
RKSimon added a comment.

LGTM cheers

Is the inverse (known negative) case worth it do you think?

  ----------------------------------------
  define i1 @src(i32 %x) {
  %0:
    %ispos = icmp slt i32 %x, 0
    assume i1 %ispos
    %icmp = icmp ne i32 %x, 0
    ret i1 %icmp
  }
  =>
  define i1 @tgt(i32 %x) {
  %0:
    %icmp = icmp sgt i32 0, %x
    ret i1 %icmp
  }
  Transformation seems to be correct!


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

https://reviews.llvm.org/D102275



More information about the llvm-commits mailing list