diff options
| author | Chris Lattner <sabre@nondot.org> | 2011-01-14 00:01:01 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2011-01-14 00:01:01 +0000 |
| commit | 0c34cb429ed90af168b1c2a8384401feb2e0085f (patch) | |
| tree | aa24bdb6242d5b2eeba7eb4abc054b224b2dbadd /llvm/lib | |
| parent | 088b30aa48aa8951ddfc04a23499671198b132f6 (diff) | |
| download | bcm5719-llvm-0c34cb429ed90af168b1c2a8384401feb2e0085f.tar.gz bcm5719-llvm-0c34cb429ed90af168b1c2a8384401feb2e0085f.zip | |
fix PR8961 - a fast isel miscompilation where we'd insert a new instruction
after sext's generated for addressing that got folded. Previously we compiled
test5 into:
_test5: ## @test5
## BB#0:
movq -8(%rsp), %rax ## 8-byte Reload
movq (%rdi,%rax), %rdi
addq %rdx, %rdi
movslq %esi, %rax
movq %rax, -8(%rsp) ## 8-byte Spill
movq %rdi, %rax
ret
which is insane and wrong. Now we produce:
_test5: ## @test5
## BB#0:
movslq %esi, %rax
movq (%rdi,%rax), %rax
addq %rdx, %rax
ret
llvm-svn: 123414
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86FastISel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp index f29d127c85d..9d42ac2e470 100644 --- a/llvm/lib/Target/X86/X86FastISel.cpp +++ b/llvm/lib/Target/X86/X86FastISel.cpp @@ -1933,7 +1933,7 @@ bool X86FastISel::TryToFoldLoad(MachineInstr *MI, unsigned OpNo, XII.foldMemoryOperandImpl(*FuncInfo.MF, MI, OpNo, AddrOps, Size, Alignment); if (Result == 0) return false; - MI->getParent()->insert(MI, Result); + FuncInfo.MBB->insert(FuncInfo.InsertPt, Result); MI->eraseFromParent(); return true; } |

