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.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Paths
| Differential D93995
[InstSimplify] Fold division by zero to poison ClosedPublic Authored by nikic on Jan 3 2021, 9:39 AM.
Details Summary 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.
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Jan 3 2021, 11:51 AM Closed by commit rG766cf7f32e4f: [InstSimplify] Fold division by zero to poison (authored by nikic). · Explain WhyJan 3 2021, 11:54 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 314297 llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstCombine/add-shl-sdiv-to-srem.ll
llvm/test/Transforms/InstCombine/div.ll
llvm/test/Transforms/InstCombine/icmp-div-constant.ll
llvm/test/Transforms/InstCombine/inselt-binop-inseltpoison.ll
llvm/test/Transforms/InstCombine/inselt-binop.ll
llvm/test/Transforms/InstCombine/rem.ll
llvm/test/Transforms/InstCombine/sdiv-exact-by-negative-power-of-two.ll
llvm/test/Transforms/InstCombine/sdiv-exact-by-power-of-two.ll
llvm/test/Transforms/InstCombine/shift.ll
llvm/test/Transforms/InstCombine/vector-udiv.ll
llvm/test/Transforms/InstCombine/vector-urem.ll
llvm/test/Transforms/InstSimplify/div.ll
llvm/test/Transforms/InstSimplify/rem.ll
llvm/test/Transforms/InstSimplify/undef.ll
llvm/test/Transforms/SLPVectorizer/X86/alternate-int-inseltpoison.ll
|