[all-commits] [llvm/llvm-project] b267d3: [InstCombine] avoid infinite loops from min/max ca...

RotateRight via All-commits all-commits at lists.llvm.org
Tue Aug 10 11:42:51 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b267d3ce8defa092600bda717ff18440d002f316
      https://github.com/llvm/llvm-project/commit/b267d3ce8defa092600bda717ff18440d002f316
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-08-10 (Tue, 10 Aug 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/select-min-max.ll

  Log Message:
  -----------
  [InstCombine] avoid infinite loops from min/max canonicalization

The intrinsics have an extra chunk of known bits logic
compared to the normal cmp+select idiom. That allows
folding the icmp in each case to something better, but
that then opposes the canonical form of min/max that
we try to form for a select.

I'm carving out a narrow exception to preserve all
existing regression tests while avoiding the inf-loop.
It seems unlikely that this is the only bug like this
left, but this should fix:
https://llvm.org/PR51419




More information about the All-commits mailing list