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

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 8 05:36:44 PST 2021


anton-afanasyev marked an inline comment as done.
anton-afanasyev added inline comments.


================
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()) {
----------------
fhahn wrote:
> 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?
Sure, thanks, dit it that way. Potentially this could be not NFC and improve handling of NotConstant operand, but SCCP doesn't use NotConstant state, so actually no change at all.


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