https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127073
Kael Franco <kaelfandrew at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://github.com/llvm/llv
| |m-project/issues/218553
--- Comment #2 from Kael Franco <kaelfandrew at gmail dot com> ---
(In reply to Robin Dapp from comment #1)
> Does llvm optimize the add case?
No. That would be https://github.com/llvm/llvm-project/issues/218553
https://godbolt.org/z/aah18xx7s
RISC-V 64 bit clang trunk with -O2:
src_add:
add a0, a0, a1
zext.b a0, a0
ret
LLVM IR -O2:
```
define dso_local noundef zeroext i8 @src_add(i8 noundef zeroext %x, i8 noundef
zeroext %y) local_unnamed_addr {
entry:
%and8 = and i8 %y, %x
%cmp.not = icmp eq i8 %and8, 0
tail call void @llvm.assume(i1 %cmp.not)
%add = add i8 %y, %x
ret i8 %add
}
```