[all-commits] [llvm/llvm-project] bb310b: Recommit "[SCCP] Remove forcedconstant, go to over...

Florian Hahn via All-commits all-commits at lists.llvm.org
Wed Feb 12 10:03:07 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: bb310b3f73dde5551bc2a0d564e88f7c831dfdb3
      https://github.com/llvm/llvm-project/commit/bb310b3f73dde5551bc2a0d564e88f7c831dfdb3
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-02-12 (Wed, 12 Feb 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/SCCP.cpp
    M llvm/test/Transforms/IPConstantProp/PR16052.ll
    M llvm/test/Transforms/IPConstantProp/PR26044.ll
    M llvm/test/Transforms/SCCP/2006-12-19-UndefBug.ll
    M llvm/test/Transforms/SCCP/apint-bigint2.ll
    M llvm/test/Transforms/SCCP/apint-ipsccp3.ll
    M llvm/test/Transforms/SCCP/apint-select.ll
    M llvm/test/Transforms/SCCP/ip-constant-ranges.ll
    M llvm/test/Transforms/SCCP/ipsccp-basic.ll
    M llvm/test/Transforms/SCCP/logical-nuke.ll
    A llvm/test/Transforms/SCCP/resolvedundefsin-tracked-fn.ll
    M llvm/test/Transforms/SCCP/switch-multiple-undef.ll
    M llvm/test/Transforms/SCCP/ub-shift.ll
    M llvm/test/Transforms/SCCP/undef-resolve.ll

  Log Message:
  -----------
  Recommit "[SCCP] Remove forcedconstant, go to overdefined instead"

This version includes a fix for a set of crashes caused by marking
values depending on a yet unknown & tracked call as overdefined.

In some cases, we would later discover that the call has a constant
result and try to mark a user of it as constant, although it was already
marked as overdefined. Most instruction handlers bail out early if the
instruction is already overdefined. But that is not necessary for
CastInsts for example. By skipping values that depend on skipped
calls, we resolve the crashes and also improve the precision in some
cases (see resolvedundefsin-tracked-fn.ll).

Note that we may not skip PHI nodes that may depend on a skipped call,
but they can be safely marked as overdefined, as we bail out early if
the PHI node is overdefined.

This reverts the revert commit
a74b31a3e9cd844c7ce2087978568e3f5ec8519.




More information about the All-commits mailing list