llvm-project
llvm-project copied to clipboard
Missed optimization: `scmp(sext(x))` can be folded to `scmp(x)`
https://godbolt.org/z/TT1e3P1h8
Final IR:
%_12 = tail call i32 @memcmp(ptr noundef nonnull dereferenceable(32) %x, ptr noundef nonnull dereferenceable(32) %y, i64 32)
%0 = sext i32 %_12 to i64
%_0 = tail call i8 @llvm.scmp.i8.i64(i64 %0, i64 0)
ret i8 %_0
Related:
- https://github.com/llvm/llvm-project/pull/191182
- https://github.com/llvm/llvm-project/pull/196847
These fold extend/trunc(scmp) rather than scmp(extend/trunc)
Hi, I've started working on this issue. Could you please assign this issue to me?
Hello. I know that iamaayushrivastava is assigned but I can try if needed and I have a PR ready.
Hello. I know that iamaayushrivastava is assigned but I can try if needed and I have a PR ready.
Hello @tadeuszjt, I forgot to push the fix earlier. I’ve already pushed it now and will be adding the PR shortly. Apologies for the oversight.