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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 19 15:22:37 PDT 2020


fhahn created this revision.
fhahn added reviewers: efriedma, davide, mssimpso.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
fhahn added parent revisions: D76453: [ConstantRange] Add initial support for binaryXor., D76446: [ConstantRange] Use APInt::or/APInt::and for single elements..

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.

This patch depends on a few ConstantRange improvements for all tests to
pass.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76459

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76459.251489.patch
Type: text/x-patch
Size: 4748 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200319/842d3d06/attachment-0001.bin>


More information about the llvm-commits mailing list