[PATCH] D36656: [SCCP] Propagate integer range info for parameters in IPSCCP.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 27 07:25:48 PDT 2017


fhahn updated this revision to Diff 120592.
fhahn added a subscriber: bruno.
fhahn added a comment.

I finally managed to track down the crash with the clang-stage2-configure-Rlto bot, thanks to @bruno. The problem was that `tryToReplaceWithConstantRange` iterates over all the users of a value, and calls `Solver.getLatticeValueFor` for the operands of ICmp instructions (which asserts the operand has been added to the lattice). For Icmp instructions in unreachable blocks, this is not the case.

I've updated `tryToReplaceWithConstantRange` to only consider Icmp instructions in executable blocks. This fixes the crash. I also updated the code to use `insert`, as suggested by @dberlin. I think with the crash addressed, the patch should be ready for re-committing, unless there are any remaining objections.


https://reviews.llvm.org/D36656

Files:
  lib/Transforms/Scalar/SCCP.cpp
  test/Transforms/SCCP/ip-constan-ranges.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36656.120592.patch
Type: text/x-patch
Size: 10322 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171027/3f211ec7/attachment.bin>


More information about the llvm-commits mailing list