[all-commits] [llvm/llvm-project] 903aa5: [InstCombine] try to fold icmp with mismatched ext...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Tue Apr 26 11:36:40 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 903aa5e0f80efd413624a59e37c6ace6cd3cf5cd
      https://github.com/llvm/llvm-project/commit/903aa5e0f80efd413624a59e37c6ace6cd3cf5cd
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-04-26 (Tue, 26 Apr 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
    M llvm/test/Transforms/InstCombine/icmp-ext-ext.ll

  Log Message:
  -----------
  [InstCombine] try to fold icmp with mismatched extended operands

If a value is known to be non-negative and zexted,
that's the same thing as sexted.

So for the purpose of looking past the casts with
an icmp, treat it as if it was a sext:
https://alive2.llvm.org/ce/z/_BDsGV

This is necessary, but not enough to solve the
motivating problem:
https://github.com/llvm/llvm-project/issues/55013

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




More information about the All-commits mailing list