[PATCH] D137934: [InstCombine] Fold extractelt with select of constants

Thomas Symalla via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 14 06:42:42 PST 2022


tsymalla added a comment.

In D137934#3924774 <https://reviews.llvm.org/D137934#3924774>, @foad wrote:

>> extractelt (select %cond, <vec1>, <vec2>), %c1, %c2 ->
>> select %cond, <vec1>[c1], <vec2>[c2]
>
> What are %c1 and %c2? Surely these is only one index?
>
> Also your description does not make it clear that you are only doing this for constant vectors. For general vectors it could be: extractelt (select %cond, <vec1>, <vec2>), %c -> select %cond, (extractelt <vec1>, %c), (extractelt <vec2>, %c)

You are right, there is only one constant. For now, I'm only handling constant vectors, therefore I'll adjust the comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137934



More information about the llvm-commits mailing list