[PATCH] D77201: [CodeGen][SelectionDAG] Flip Booleans More Often
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 1 14:05:10 PDT 2020
efriedma added a comment.
We have to call getBooleanContents on the vector type, not the vector element type. On ARM, a boolean in a vector is ZeroOrNegativeOneBooleanContent. A scalar boolean on its own is ZeroOrOneBooleanContent. If you choose incorrectly, that's a potential miscompile. (Not sure why it isn't showing up as a regression test change for other targets; maybe the specific VSELECT pattern in question is rare after legalization.)
Maybe the code should be truncating the APInt before it checks isAllOnesValue(), though. For a boolean, isOne() and isAllOnesValue() should be equivalent.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77201/new/
https://reviews.llvm.org/D77201
More information about the llvm-commits
mailing list