[all-commits] [llvm/llvm-project] f094d6: [InstSimplify] Fix addo/subo with undef (PR43188)

Nikita Popov via All-commits all-commits at lists.llvm.org
Sun Jan 3 10:02:02 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f094d65beaa492e845b03561eddd75b5be653a01
      https://github.com/llvm/llvm-project/commit/f094d65beaa492e845b03561eddd75b5be653a01
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-01-03 (Sun, 03 Jan 2021)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstCombine/with_overflow.ll
    M llvm/test/Transforms/InstSimplify/call.ll

  Log Message:
  -----------
  [InstSimplify] Fix addo/subo with undef (PR43188)

We can't fold the first result to undef, because not all values
may be reachable under the constraint that no overflow occurred.
Use the same folds we do for saturated math instead.

Proofs:
uaddo: https://alive2.llvm.org/ce/z/zf55N_
saddo: https://alive2.llvm.org/ce/z/a_xPgS
usubo: https://alive2.llvm.org/ce/z/DmRqwt
ssubo: https://alive2.llvm.org/ce/z/8ag7U-




More information about the All-commits mailing list