[PATCH] D87392: [JumpThreading] Fix an incorrect Modified status

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 09:30:33 PDT 2020


dstenb created this revision.
dstenb added reviewers: efriedma, kazu, wmi.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
dstenb requested review of this revision.

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. I assume that we in such cases don't want to
return true from ProcessBlock(), which would trigger another iteration
of the function. Instead, to solve this, this patch introduces a
{Unmodified, Modified, Threaded} tri-state in order to be able to keep
track of the modified status, but still bail out from the ProcessBlock()
loop.

      

This was caught using the check introduced by D80916 <https://reviews.llvm.org/D80916>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87392

Files:
  llvm/include/llvm/Transforms/Scalar/JumpThreading.h
  llvm/lib/Transforms/Scalar/JumpThreading.cpp
  llvm/test/Transforms/JumpThreading/constant-fold-status.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87392.290756.patch
Type: text/x-patch
Size: 8943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200909/8ed9bf94/attachment.bin>


More information about the llvm-commits mailing list