-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[MIPS64] Failure to remove random NOPs in the middle of instructions #99783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-backend-mips Author: Gabriel Ravier (GabrielRavier)
```cpp
int f(int a, int b)
{
return (a ^ b) | ~(a | b);
}
```
When compiled with
whereas GCC manages (with
The |
Based on the final SelectionDAG, it appears those
|
Part of #99783 This test is meant to reflect the oncoming change as this test shows the unoptimized result with unnecessary SLLs.
Optimize '$dst = sign_extend (xor (trunc $src), imm)' to '$dst = sign_extend (trunc (xor $src, imm))'. Fix llvm#99783
Optimize '$dst = sign_extend (xor (trunc $src), imm)' to '$dst = sign_extend (trunc (xor $src, imm))'. Fix llvm#99783
Optimize '$dst = sign_extend (xor (trunc $src), imm)' to '$dst = sign_extend (trunc (xor $src, imm))'. Fix llvm#99783
Optimize '$dst = sign_extend (xor (trunc $src), imm)' to '$dst = sign_extend (trunc (xor $src, imm))'. Fix llvm#99783
The constant operand of the XOR is an i32, which makes the two operands being truncated to i32, and sign extended to i64 afterwards. Since both of the i32 operands are sign extended to i64 before performing the TRUNCATE operation, we just remove the unnecessary TRUNCATE and SIGN_EXTEND. Fix llvm#99783
… X, i32), imm) The constant operand of the XOR is an i32, which makes the two operands being truncated to i32, and sign extended to i64 afterwards. Since both of the i32 operands are sign extended to i64 before performing the TRUNCATE operation, we just remove the unnecessary TRUNCATE and SIGN_EXTEND. Fix llvm#99783
…inreg X, i32), imm) The constant operand of the XOR is an i32, which makes the two operands being truncated to i32, and sign extended to i64 afterwards. Since both of the i32 operands are sign extended to i64 before performing the TRUNCATE operation, we just remove the unnecessary TRUNCATE and SIGN_EXTEND. Fix llvm#99783
…inreg X, i32), imm) The constant operand of the XOR is an i32, which makes the two operands being truncated to i32, and sign extended to i64 afterwards. Since both of the i32 operands are sign extended to i64 before performing the TRUNCATE operation, we just remove the unnecessary TRUNCATE and SIGN_EXTEND. Fix llvm#99783
…9386) Optimize ((signext (xor (trunc X), imm)) to (xor (X, imm)). Fix llvm/llvm-project#99783
Optimize ((signext (xor (trunc X), imm)) to (xor (X, imm)). Fix llvm#99783
When compiled with
-O3 -target mips64el -fomit-frame-pointer
, LLVM outputs:whereas GCC manages (with
-O3
):The
sll
instructions seem entirely unnecessary as they are justnop
s from what I understand, and they don't seem required for any particular reason (using-target mipsel
instead of-target mips64el
also gets them removed, so this seems quite specific to 64-bit MIPS)The text was updated successfully, but these errors were encountered: