[PATCH] D86460: [InstCombine] improve demanded element analysis for vector insert-of-extract

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 10:27:51 PDT 2020


aqjune added a comment.

Alive2's explanation is correct, `@ins_of_ext_wrong_demand` cannot be folded as written in the unit test.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:1168
+    Value *Vec;
+    if (PreInsertDemandedElts == 0 &&
+        match(I->getOperand(1),
----------------
lebedev.ri wrote:
> To check my understanding, `@ins_of_ext_wrong_demand` is fine
> because for it `PreInsertDemandedElts` is not `0`, right?
I think so - IIUC, each `insertelement` instruction zero-izes IdxNo bit of `PreInsertDemandedElts`, and in case of `@ins_of_ext_wrong_demand`, there aren't sufficient `insertelement`s to make `PreInsertDemandedElts` fully zero.


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

https://reviews.llvm.org/D86460



More information about the llvm-commits mailing list