[PATCH] D112721: [SCCP] Tune cast instruction handling for overdefined operand

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 8 04:18:46 PST 2021


fhahn added a comment.

Thanks for the update! I think with the latest changes applied, I noticed another potential simplification.



================
Comment at: llvm/lib/Transforms/Utils/SCCPSolver.cpp:818
     markConstant(&I, C);
-  } else if (OpSt.isConstantRange() && I.getDestTy()->isIntegerTy()) {
+  } else if ((OpSt.isConstantRange() || OpSt.isOverdefined()) &&
+             I.getDestTy()->isIntegerTy()) {
----------------
IIUC we need to check for range or overdefined here explicitly because we implicitly do not do anything for under or overdefined.

Could we instead add an early bail out on undeforunknown, only check for integer types here (and not constant range and overdefined) and drop the markOverdefined in the else of below?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112721



More information about the llvm-commits mailing list