Issue |
125469
|
Summary |
Missed optimization: fold zext nneg + GEP into direct GEP with the nneg index
|
Labels |
new issue
|
Assignees |
|
Reporter |
Cancelll
|
Example: https://godbolt.org/z/fh7WM5fKv
Alive2: https://alive2.llvm.org/ce/z/ChnMWA
```llvm
define ptr @src(ptr %2, i32 %idx) {
%idx.ext = zext nneg i32 %idx to i64
%add.ptr = getelementptr inbounds nuw i16, ptr %2, i64 %idx.ext
ret ptr %add.ptr
}
define ptr @tgt(ptr %2, i32 %idx) {
%add.ptr = getelementptr inbounds nuw i16, ptr %2, i32 %idx
ret ptr %add.ptr
}
```
I found this pattern in function `SSL_get_sigalgs` in `openssl/ssl/t1_lib.c`
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs