aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2019-10-16 19:58:26 +0000
committerPhilip Reames <listmail@philipreames.com>2019-10-16 19:58:26 +0000
commitd4346584fa35232af286ededf9f01353d905ed9f (patch)
tree09ffcabe02e1a48ae84b813eb400637727494f92 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parent13993a6f8681ae40fa9b1ce690885e95119b6dbf (diff)
downloadllvm-d4346584fa35232af286ededf9f01353d905ed9f.zip
llvm-d4346584fa35232af286ededf9f01353d905ed9f.tar.gz
llvm-d4346584fa35232af286ededf9f01353d905ed9f.tar.bz2
[IndVars] Fix a miscompile in off-by-default loop predication implementation
The problem is that we can have two loop exits, 'a' and 'b', where 'a' and 'b' would exit at the same iteration, 'a' precedes 'b' along some path, and 'b' is predicated while 'a' is not. In this case (see the previously submitted test case), we causing the loop to exit through 'b' whereas it should have exited through 'a'. This only applies to loop exits where the exit counts are not provably inequal, but that isn't as much of a restriction as it appears. If we could order the exit counts, we'd have already removed one of the two exits. In theory, we might be able to prove inequality w/o ordering, but I didn't really explore that piece. Instead, I went for the obvious restriction and ensured we didn't predicate exits following non-predicateable exits. Credit goes to Evgeny Brevnov for figuring out the problematic case. Fuzzing probably also found it (failures seen), but due to some silly infrastructure problems I hadn't gotten to the results before Evgeny hand reduced it from a benchmark (he manually enabled the transform). Once this is fixed, I'll try to filter through the fuzzer failures to see if there's anything additional lurking. Differential Revision https://reviews.llvm.org/D68956 llvm-svn: 375038
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
0 files changed, 0 insertions, 0 deletions