https://llvm.org/bugs/show_bug.cgi?id=26291
Bug ID: 26291 Summary: MIPS back end performs inefficient subtraction of immediates Product: libraries Version: trunk Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: Backend: MIPS Assignee: unassignedb...@nondot.org Reporter: csda...@swan.ac.uk CC: llvm-bugs@lists.llvm.org Classification: Unclassified Simple C test case: int foo(char*,char*, char*); int main(void) { char z[1048576]; foo(z,z,z); } The key part of the IR: %z = alloca [1048576 x i8], align 1 This produces the following code for the stack pointer modification: daddiu $5, $zero, 1 dsll $5, $5, 44 daddiu $5, $5, -1 dsll $5, $5, 20 daddiu $5, $5, -48 daddu $sp, $sp, $5 This would be much simpler as lui $5, 16 dsubu $sp, $sp, $5 Even without rewriting the add as a subtraction, the constant could be materialised as: lui $5, 16 dsubu $5, $zero, $5 -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs