[PATCH] D48987: [InstCombine] drop poison flags for shuffle transforms with undefs
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 5 12:11:13 PDT 2018
spatel created this revision.
spatel added reviewers: nlopes, aqjune, lebedev.ri, efriedma.
Herald added a subscriber: mcrosier.
As discussed in https://reviews.llvm.org/D48893, we have an existing bug in the recent shuffle transforms when we combine poison flags with undefs in the shuffle mask.
There are 2 ways to solve that bug: (1) change the undef constants to safe constants (which we must do for div/rem because they have immediate UB potential), or (2) drop the poison flags.
I suggested using safe constants in https://reviews.llvm.org/D48893, but I changed my mind for 2 reasons: (1) we can't always be sure what qualifies as a safe constant (operand 0 of a binop?) and (2) undef vector lanes are likely more valuable for further analysis and vector transforms than any poison decorations.
https://reviews.llvm.org/D48987
Files:
include/llvm/IR/Constant.h
lib/IR/Constants.cpp
lib/Transforms/InstCombine/InstCombineVectorOps.cpp
test/Transforms/InstCombine/shuffle_select.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48987.154279.patch
Type: text/x-patch
Size: 5913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180705/03283c8a/attachment.bin>
More information about the llvm-commits
mailing list