[PATCH] D102476: [VectorCombine] Use constant range info for index scalarization legality.

Nuno Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 24 06:25:50 PDT 2021


nlopes added a comment.

This patch looks good if we want to go with the poison-on-OOB semantics.
I think it's important to settle that first, please see my bug report: https://bugs.llvm.org/show_bug.cgi?id=50382
The backend does this very same optimization but without paying attention to whether the index is in-bounds or not. Which effectively makes extractvalue similar to a load instruction, including all the restrictions around movement and so on. Is that what we want?
We need to either fix the backend and move on with this patch (poison on OOB), or fix langref and abandon this patch (UB on OOB).  Since I don't really know which frontend produces extractelement and from which code, I don't have an opinion either way, although usually UB is not a good idea.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102476



More information about the llvm-commits mailing list