[all-commits] [llvm/llvm-project] 766cf7: [InstSimplify] Fold division by zero to poison

Nikita Popov via All-commits all-commits at lists.llvm.org
Sun Jan 3 11:54:15 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 766cf7f32e4f0974dbccd9771317a102533aa0df
      https://github.com/llvm/llvm-project/commit/766cf7f32e4f0974dbccd9771317a102533aa0df
  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/add-shl-sdiv-to-srem.ll
    M llvm/test/Transforms/InstCombine/div.ll
    M llvm/test/Transforms/InstCombine/icmp-div-constant.ll
    M llvm/test/Transforms/InstCombine/inselt-binop-inseltpoison.ll
    M llvm/test/Transforms/InstCombine/inselt-binop.ll
    M llvm/test/Transforms/InstCombine/rem.ll
    M llvm/test/Transforms/InstCombine/sdiv-exact-by-negative-power-of-two.ll
    M llvm/test/Transforms/InstCombine/sdiv-exact-by-power-of-two.ll
    M llvm/test/Transforms/InstCombine/shift.ll
    M llvm/test/Transforms/InstCombine/vector-udiv.ll
    M llvm/test/Transforms/InstCombine/vector-urem.ll
    M llvm/test/Transforms/InstSimplify/div.ll
    M llvm/test/Transforms/InstSimplify/rem.ll
    M llvm/test/Transforms/InstSimplify/undef.ll
    M llvm/test/Transforms/SLPVectorizer/X86/alternate-int-inseltpoison.ll

  Log Message:
  -----------
  [InstSimplify] Fold division by zero to poison

Div/rem by zero is immediate undefined behavior and anything goes.
Currently we fold it to undef, this patch changes it to fold to
poison instead, which is slightly stronger.

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




More information about the All-commits mailing list