Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DAG] Assertion in DAGCombiner::visitADDLike - Binary operator types must match! #50582

Closed
RKSimon opened this issue Jul 28, 2021 · 5 comments
Closed
Labels
bugzilla Issues migrated from bugzilla llvm:codegen

Comments

@RKSimon
Copy link
Collaborator

RKSimon commented Jul 28, 2021

Bugzilla Link 51238
Resolution FIXED
Resolved on Oct 11, 2021 20:29
Version trunk
OS Windows NT
Blocks #51489
CC @LebedevRI,@rotateright
Fixed by commit(s) e427077 fa6b2c9 e6ca023 3bce613

Extended Description

Reduced from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36608

; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "llvm/test/Transforms/InstCombine/max-of-nots.ll"
target triple = "x86_64-unknown-linux-gnu"

define i8 @​umin3_not(i8 %x, i8 %y, i8 %z) {
bb:
%ny = xor i8 %y, -1
%nz = xor i8 %z, -1
%minxz = select i1 undef, i8 undef, i8 %nz
%cmpyz = icmp ult i8 %ny, %nz
%B1 = add i1 %cmpyz, true
%minyz = select i1 %B1, i8 0, i8 %nz
%r = select i1 undef, i8 %minxz, i8 %minyz
ret i8 %r
}

E:\llvm>ninja\bin\llc fuzz.ll -o -
.text
.file "max-of-nots.ll"
Assertion failed: N1.getValueType() == N2.getValueType() && N1.getValueType() == VT && "Binary operator types must match!", file E:\llvm\llvm-project\llvm\lib\CodeGen\SelectionDAG\SelectionDAG.cpp, line 5605

@rotateright
Copy link
Contributor

This DAG patch is responsible:
https://reviews.llvm.org/D58874

The logic seems right:
https://alive2.llvm.org/ce/z/vvdHT9

...and there's a seemingly simple fix, but the original patch didn't include any tests for UADDO / SADDO, so we could just remove those as the fast fix.

@rotateright
Copy link
Contributor

The fast fix might also be the better fix now that we have tests:
https://reviews.llvm.org/D106983

@rotateright
Copy link
Contributor

Added tests:
https://reviews.llvm.org/rGe427077ec10e

And changed the code:
https://reviews.llvm.org/rGfa6b2c9915ba

Leaving open to include as a bug fix for the 13.0 release branch.

@tstellar
Copy link
Collaborator

tstellar commented Aug 2, 2021

Merged: 3bce613

@tstellar
Copy link
Collaborator

mentioned in issue #51489

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla llvm:codegen
Projects
None yet
Development

No branches or pull requests

3 participants