[PATCH] D85684: [InstSimplify] Forbid undef folds in expandBinOp
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 11 06:32:30 PDT 2020
jdoerfert accepted this revision.
jdoerfert added a comment.
In D85684#2209084 <https://reviews.llvm.org/D85684#2209084>, @nikic wrote:
> In D85684#2208668 <https://reviews.llvm.org/D85684#2208668>, @aqjune wrote:
>
>> In D85684#2208630 <https://reviews.llvm.org/D85684#2208630>, @jdoerfert wrote:
>>
>>> Why is the test not part of this?
>>
>> Maybe it is because an operation on undef is already folded before expandBinOp is reached. Is it right @nikic? I think having a working test here likely means we found another miscompilation regarding undef and distributivity law.
>> If `select c, undef, x --> x` is disabled later, it will leave the undef constant, making the test at select.ll valid.
>
> That's right. I only added the test to make sure we don't miscompile it once the select fold is disabled. I don't know of a way to directly test this change right now.
That's unfortunate but the change looks harmless enough I guess.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85684/new/
https://reviews.llvm.org/D85684
More information about the llvm-commits
mailing list