This patch updates IRBuilder to create insertelement/shufflevector using poison as a placeholder.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/IR/IRBuilder.cpp | ||
---|---|---|
1019–1021 | while at it, don't you want to change this one to poison as well? |
llvm/lib/IR/IRBuilder.cpp | ||
---|---|---|
1019–1021 | It would be great, but there are many other places that create shufflevector with undef args (InstCombineCalls, etc). Since this and related patches are big changes, I think it might be good to land these first. |
llvm/lib/IR/IRBuilder.cpp | ||
---|---|---|
1019–1021 | If the relevant patches are to be landed at once, I think the series of patches are being too big to maintain... :( |
llvm/lib/IR/IRBuilder.cpp | ||
---|---|---|
1019–1021 | Okay, I'll copy tests that have poison as shufflevector's placeholder value as well (will have the *-inseltpoison.ll suffix too) & update this patch. |
clang/test/CodeGen/SystemZ/builtins-systemz-zvector-constrained.c | ||
---|---|---|
84 | These SystemZ zvector tests are still creating shufflevector with undef, and I couldn't find where they stem from. :/ |
llvm/include/llvm/IR/IRBuilder.h | ||
---|---|---|
2527 | update code comment: undefined -> poison | |
llvm/lib/IR/IRBuilder.cpp | ||
1019–1021 | I'm still catching up on reviews/mails, so ignore if this was already discussed: |
I have a babyism question, why poison is preferred to the undef in the pattern ConstantVector::getSplat ?
Hi Allen,
It is because folding poison is easier than folding undef. :)
For example, according to the poison propagating rule, 'and i32 poison, 1' can be simplified into 'i32 poison'. However, 'and undef, 1' cannot be folded into 'undef' since the mask enforces all bits but LSB 0.
This patch helps simplifications happen more easily.
llvm/test/Transforms/LoopVectorize/PowerPC/optimal-epilog-vectorization.ll | ||
---|---|---|
273–276 | It looks like someone manually hacked on the CHECK lines in a test marked "; NOTE: Assertions have been autogenerated by utils/update_test_checks.py". This is generally a bad idea... it makes it easy to miss lines like this. If CHECKs are manually written or modified, the NOTE should be removed as a warning to anyone modifying the test in the future. Not sure what the best solution is here... at minimum, I guess we can just drop the "autogenerated" note? |
llvm/test/Transforms/LoopVectorize/PowerPC/optimal-epilog-vectorization.ll | ||
---|---|---|
273–276 | Yes, I should have removed that comment (lesson learned), although that wouldn't necessarily have prevented the oversight. We cannot put those lines back until the regression I reported in https://reviews.llvm.org/D116479 is fixed. I can remove the autogen note at that point. |
These SystemZ zvector tests are still creating shufflevector with undef, and I couldn't find where they stem from. :/