llvm.org GIT mirror llvm / d964285
Fix a significant code quality regression I introduced on PPC64 quite a while ago. We now produce: _foo: mflr r0 std r0, 16(r1) ld r2, 16(r1) std r2, 0(r3) ld r0, 16(r1) mtlr r0 blr instead of: _foo: mflr r0 std r0, 16(r1) lis r0, 0 ori r0, r0, 16 ldx r2, r1, r0 std r2, 0(r3) ld r0, 16(r1) mtlr r0 blr for: void foo(void **X) { *X = __builtin_return_address(0); } on ppc64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44701 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 12 years ago
2 changed file(s) with 2 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
816816 // clear can be encoded. This is extremely uncommon, because normally you
817817 // only "std" to a stack slot that is at least 4-byte aligned, but it can
818818 // happen in invalid code.
819 if (isInt16(Offset) && (!isIXAddr || (isIXAddr & 3) == 0)) {
819 if (isInt16(Offset) && (!isIXAddr || (Offset & 3) == 0)) {
820820 if (isIXAddr)
821821 Offset >>= 2; // The actual encoded value has the low two bits zero.
822822 MI.getOperand(OffsetOperandNo).ChangeToImmediate(Offset);
0 ; RUN: llvm-as < %s | llc -march=ppc32 | grep mflr
11 ; RUN: llvm-as < %s | llc -march=ppc32 | grep lwz
2 ; RUN: llvm-as < %s | llc -march=ppc64 | grep {ld r., 16(r1)}
23
34 target triple = "powerpc-apple-darwin8"
45