diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-07-02 20:36:18 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-07-02 20:36:18 +0000 |
commit | 0ce84486c382b9377ebeb993b0c262a70c72350a (patch) | |
tree | 4979ef37e4200aea13fa0cdbacd177bc5b5d2ea5 /llvm/lib/CodeGen | |
parent | c653d4c574fcfd9a14505cd75a803ae105c4c753 (diff) | |
download | bcm5719-llvm-0ce84486c382b9377ebeb993b0c262a70c72350a.tar.gz bcm5719-llvm-0ce84486c382b9377ebeb993b0c262a70c72350a.zip |
- Two-address pass should not assume unfolding is always successful.
- X86 unfolding should check if the instructions being unfolded has memoperands.
If there is no memoperands, then it must assume conservative alignment. If this
would introduce an expensive sse unaligned load / store, then unfoldMemoryOperand
etc. should not unfold the instruction.
llvm-svn: 107509
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp index 0c97dad48b8..62fa0fdb771 100644 --- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -926,14 +926,12 @@ TryInstructionTransform(MachineBasicBlock::iterator &mi, UnfoldTID.OpInfo[LoadRegIndex].getRegClass(TRI); unsigned Reg = MRI->createVirtualRegister(RC); SmallVector<MachineInstr *, 2> NewMIs; - bool Success = - TII->unfoldMemoryOperand(MF, mi, Reg, - /*UnfoldLoad=*/true, /*UnfoldStore=*/false, - NewMIs); - (void)Success; - assert(Success && - "unfoldMemoryOperand failed when getOpcodeAfterMemoryUnfold " - "succeeded!"); + if (!TII->unfoldMemoryOperand(MF, mi, Reg, + /*UnfoldLoad=*/true,/*UnfoldStore=*/false, + NewMIs)) { + DEBUG(dbgs() << "2addr: ABANDONING UNFOLD\n"); + return false; + } assert(NewMIs.size() == 2 && "Unfolded a load into multiple instructions!"); // The load was previously folded, so this is the only use. |