[PATCH] D74679: [SCCP] Skip unknown values depending on tracked functions.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 16 03:52:12 PST 2020


fhahn marked 2 inline comments as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SCCP.cpp:1446
 /// method should be use to handle this.  If this returns true, the solver
 /// should be rerun.
 ///
----------------
jdoerfert wrote:
> Out of scope: Isn't branch on `undef` UB?
I don't think so. `undef` just indicates that  `the user of the value may receive an unspecified bit-patter`'. IUUC we are only free to pick either the true/false destination, by replacing the condition with `true`/`false`. Note that we have to make sure we replace the undef if we make the assumption. If the branch on undef remains, the other branch might be (assumed as) taken, potentially leading to a contradiction further down the line.

Branches on poison values are UB.


================
Comment at: llvm/test/Transforms/SCCP/resolvedundefsin-tracked-fn.ll:1
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
 ; RUN: opt -ipsccp -S %s | FileCheck %s
----------------
jdoerfert wrote:
> Nit: You should probably do an NFC commit first to add the --function-signatures
I'll do that. Initially I just tweaked the check lines to include the define, because `update_test_checks.py` defaults just check for the function name, causing FIleCheck to fail unexpectedly  if the function is called before being defined. 

I only just discovered `--function-signature` does what I want :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74679/new/

https://reviews.llvm.org/D74679





More information about the llvm-commits mailing list