llvm-project
llvm-project copied to clipboard
assertion failing in multiple backends "We are expecting that A is always less than all-ones for SVT"
both the AArch64 and x86-64 backends assert out on this input:
define i32 @f(i1 %0) {
%new0 = srem i1 %0, true
%last = zext i1 %new0 to i32
%2 = icmp ne i32 %last, 0
%3 = select i1 %2, i32 0, i32 1
ret i32 %3
}
@llvm/issue-subscribers-backend-aarch64
Author: John Regehr (regehr)
both the AArch64 and x86-64 backends assert out on this input:
```
define i32 @f(i1 %0) {
%new0 = srem i1 %0, true
%last = zext i1 %new0 to i32
%2 = icmp ne i32 %last, 0
%3 = select i1 %2, i32 0, i32 1
ret i32 %3
}
```
@llvm/issue-subscribers-backend-x86
Author: John Regehr (regehr)
both the AArch64 and x86-64 backends assert out on this input:
```
define i32 @f(i1 %0) {
%new0 = srem i1 %0, true
%last = zext i1 %new0 to i32
%2 = icmp ne i32 %last, 0
%3 = select i1 %2, i32 0, i32 1
ret i32 %3
}
```
They appear to be failing in llvm::TargetLowering::prepareSREMEqFold https://clang.godbolt.org/z/Pjf8bnrnE
Bisected to #82706 cc: @resistor
Almost certainly the assertion just needs to be moved above the special case.