This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Fix bugs in inverted condition splitting code.
ClosedPublic

Authored by gberry on Feb 7 2017, 1:17 PM.

Details

Summary

Fix two bugs in SelectionDAGBuilder::FindMergedConditions reported by
Mikael Holmen. Handle non-canonicalized xor not operation
correctly (was assuming operand 0 was always the non-constant operand)
and check that the negated condition is also in the same block as the
original and/or instruction (as is done for and/or operands already)
before proceeding with optimization.

Diff Detail

Repository
rL LLVM

Event Timeline

gberry created this revision.Feb 7 2017, 1:17 PM
hans added a subscriber: hans.Feb 7 2017, 1:28 PM

Are there PRs for the reported bugs, or where were they reported? I'm trying to understand whether this is fixing a regression from 3.9 or not.

gberry added a comment.Feb 7 2017, 1:35 PM
In D29680#669885, @hans wrote:

Are there PRs for the reported bugs, or where were they reported? I'm trying to understand whether this is fixing a regression from 3.9 or not.

@hans Sorry for the noise, but I just checked and these bugs were introduced after the release_40 branch, so you can ignore my request to include this patch.

hans removed a subscriber: hans.Feb 7 2017, 3:21 PM
In D29680#669885, @hans wrote:

Are there PRs for the reported bugs, or where were they reported? I'm trying to understand whether this is fixing a regression from 3.9 or not.

@hans Sorry for the noise, but I just checked and these bugs were introduced after the release_40 branch, so you can ignore my request to include this patch.

OK, thanks.

I tried the patch and it solves the problem I saw.

I'm going to go ahead and check this in as an obvious fix since it fixes breakages for at least two targets.

This revision was automatically updated to reflect the committed changes.