[PATCH] D149404: [ValueTracking][InstCombine] Add a new API to allow to ignore poison generating flags or metadatas when implying poison

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 30 22:03:47 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2938
+    SmallVector<Instruction *> DropFlags;
+    if (impliesPoisonIgnoreFlagsOrMetadatas(FalseVal, CondVal, DropFlags)) {
+      for (Instruction *I : DropFlags)
----------------
nikic wrote:
> goldstein.w.n wrote:
> > Will you ever not loop through instruction and do `dropPoisonGenerating...`? Maybe it should done by `impliesPoisonIgnore...` and if its not always with a `bool` to control it.
> If it's part of a larger transform, one may only want to drop the flags after additional conditions have been checked as well. Analysis utils generally aren't allowed to modify instructions.
then maybe an API in instcombine, or at least a static helper/lambda in the file.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149404



More information about the llvm-commits mailing list