llvm / llvm/llvm-project

llvm-diff Assertion `!Result && "structural differences second time around?"' failed.

Open
#222,926 0 comments 0 reactions 0 assignees View on GitHub
crash-on-valid llvm-tools
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

```llvm
;a.ll
define i1 @f(i32 %a, i32 %b) {
entry:
%x = icmp eq i32 %a, 0
%y = icmp eq i32 %b, 0
%and = and i1 %x, %y
ret i1 %and
}

;b.ll
define i1 @f(i32 %a, i32 %b) {
entry:
%x = icmp eq i32 %a, 0
%y = icmp eq i32 %b, 0
%and = and i1 %y, %x
ret i1 %and
}
```

```console
$ llvm-diff a.ll b.ll

in function f:
in block %entry:
in instruction %and / %and:
operands %x and %y differ
llvm-diff: llvm/tools/llvm-diff/lib/DifferenceEngine.cpp:268: void (anonymous namespace)::FunctionDifferenceEngine::unify(const Instruction *, const Instruction *): Assertion `!Result && "structural differences second time around?"' failed.
Aborted (core dumped)
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the crash with the provided a.ll and b.ll inputs using llvm-diff. Read llvm/tools/llvm-diff/lib/DifferenceEngine.cpp around line 268 and trace FunctionDifferenceEngine::unify; done means the operand-order difference is reported without triggering the assertion or aborting.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.