[all-commits] [llvm/llvm-project] 1a02aa: [SCCP] Use SimplifyBinOp for non-integer constant/...

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Apr 10 03:05:22 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1a02aaeaa4f8675490da38ee8cb0d4a6d39815dd
      https://github.com/llvm/llvm-project/commit/1a02aaeaa4f8675490da38ee8cb0d4a6d39815dd
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-04-10 (Fri, 10 Apr 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/SCCP.cpp
    M llvm/test/Transforms/SCCP/ub-shift.ll
    M llvm/test/Transforms/SCCP/vector-bitcast.ll

  Log Message:
  -----------
  [SCCP] Use SimplifyBinOp for non-integer constant/expressions & overdef.

For non-integer constants/expressions and overdefined, I think we can
just use SimplifyBinOp to do common folds. By just passing a context
with the DL, SimplifyBinOp should not try to get additional information
from looking at definitions.

For overdefined values, it should be enough to just pass the original
operand.

Note: The comment before the `if (isconstant(V1State)...` was wrong
originally: isConstant() also matches integer ranges with a single
element. It is correct now.

Reviewers: efriedma, davide, mssimpso, aartbik

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D76459




More information about the All-commits mailing list