[ValueTracking] Fix isSafeToSpeculativelyExecute for sdiv (PR48778)
authorNikita Popov <nikita.ppv@gmail.com>
Sun, 17 Jan 2021 19:03:22 +0000 (20:03 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sun, 17 Jan 2021 19:06:17 +0000 (20:06 +0100)
commit4229b87ed36cf20b95b363393452aa4815e344e2
tree70c2a0bced2f1e6972daab71f8ab1fe4f6fb2df5
parent1cc477f030bdeb6de98c6bde89fa7850630def24
[ValueTracking] Fix isSafeToSpeculativelyExecute for sdiv (PR48778)

The != -1 check does not work correctly for all bitwidths. Use
isAllOnesValue() instead.
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Transforms/SimplifyCFG/pr48778-sdiv-speculation.ll