[JumpThreading] Fix an incorrect Modified status
authorDavid Stenberg <david.stenberg@ericsson.com>
Mon, 14 Sep 2020 07:38:54 +0000 (09:38 +0200)
committerDavid Stenberg <david.stenberg@ericsson.com>
Mon, 14 Sep 2020 08:36:13 +0000 (10:36 +0200)
commitbfcb824ba5287f96c5b9f1009d10af37b7eb9519
tree1add64b2f122668140183a256ff4d026a4d76428
parent0008fb343704bafc3469703be930b8a65d7c47fa
[JumpThreading] Fix an incorrect Modified status

This fixes PR47297.

When ProcessBlock() was able to constant fold the terminator's
condition, but not do any more transformations, the function would
return false, which would lead to the JumpThreading pass returning an
incorrect modified status. This patch makes so that ProcessBlock()
returns true in such cases. This will trigger an unnecessary invocation
of ProcessBlock() in such cases, but this should be rare to occur.

This was caught using the check introduced by D80916.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D87392
llvm/lib/Transforms/Scalar/JumpThreading.cpp
llvm/test/Transforms/JumpThreading/constant-fold-status.ll [new file with mode: 0644]