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

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 14 22:21:47 PDT 2023


StephenFan added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2938
+    SmallVector<Instruction *> DropFlags;
+    if (impliesPoisonIgnoreFlagsOrMetadatas(FalseVal, CondVal, DropFlags)) {
+      for (Instruction *I : DropFlags)
----------------
goldstein.w.n wrote:
> 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.
I am sorry that I ignored your comment.


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