[PATCH] D109054: Small improvement in SimplifyCFG.cpp

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 1 22:00:48 PDT 2021


mkazantsev added a comment.

Please make the description more informative.

For patch name, I'd suggest something like "[SImplifyCFG] Preserve knowledge about guarding condition by adding assume".

The description is also confusing. I think what you are aiming would be

  pred:
    x = 11
    cond = x > 10
    br cond, bb, other.succ
  
  bb:
    phi [nullptr, pred], ... // other possible preds
    load(phi) // UB if we came from pred
  
  other.succ:
    // here we know that x <= 10, but this knowledge is lost
    // after the branch is turned to unconditional unless we
    // preserve it with assume.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109054



More information about the llvm-commits mailing list