diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-10-18 18:16:27 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-10-18 18:16:27 +0000 |
commit | ff89dcb06fbd103373436e2d0ae85f252fae2254 (patch) | |
tree | a9c2c0c4ab7512a79f6bd15d41caa381e2cccf7c /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 20270c909357e5e501cac1f5393430dfacfc57d8 (diff) |
-Revert parts of 84326 and 84411. Distinquishing between fixed and non-fixed
stack slots and giving them different PseudoSourceValue's did not fix the
problem of post-alloc scheduling miscompiling llvm itself.
- Apply Dan's conservative workaround by assuming any non fixed stack slots can
alias other memory locations. This means a load from spill slot #1 cannot
move above a store of spill slot #2.
- Enable post-alloc scheduling for x86 at optimization leverl Default and above.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84424 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 56 |
1 files changed, 15 insertions, 41 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index cd7e1fd5f2..8bd0370cc6 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -3507,22 +3507,16 @@ SDValue SelectionDAG::getAtomic(unsigned Opcode, DebugLoc dl, EVT MemVT, SDValue Ptr, SDValue Cmp, SDValue Swp, const Value* PtrVal, unsigned Alignment) { - MachineFunction &MF = getMachineFunction(); - MachineFrameInfo *FrameInfo = MF.getFrameInfo(); - if (Alignment == 0) // Ensure that codegen never sees alignment 0 Alignment = getEVTAlignment(MemVT); // Check if the memory reference references a frame index if (!PtrVal) if (const FrameIndexSDNode *FI = - dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) { - if (FrameInfo->isFixedObjectIndex(FI->getIndex())) - PtrVal = PseudoSourceValue::getFixedStack(FI->getIndex()); - else - PtrVal = PseudoSourceValue::getStack(); - } + dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) + PtrVal = PseudoSourceValue::getFixedStack(FI->getIndex()); + MachineFunction &MF = getMachineFunction(); unsigned Flags = MachineMemOperand::MOLoad | MachineMemOperand::MOStore; // For now, atomics are considered to be volatile always. @@ -3566,21 +3560,16 @@ SDValue SelectionDAG::getAtomic(unsigned Opcode, DebugLoc dl, EVT MemVT, SDValue Ptr, SDValue Val, const Value* PtrVal, unsigned Alignment) { - MachineFunction &MF = getMachineFunction(); - MachineFrameInfo *FrameInfo = MF.getFrameInfo(); - if (Alignment == 0) // Ensure that codegen never sees alignment 0 Alignment = getEVTAlignment(MemVT); // Check if the memory reference references a frame index if (!PtrVal) if (const FrameIndexSDNode *FI = - dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) - if (FrameInfo->isFixedObjectIndex(FI->getIndex())) - PtrVal = PseudoSourceValue::getFixedStack(FI->getIndex()); - else - PtrVal = PseudoSourceValue::getStack(); + dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) + PtrVal = PseudoSourceValue::getFixedStack(FI->getIndex()); + MachineFunction &MF = getMachineFunction(); unsigned Flags = MachineMemOperand::MOLoad | MachineMemOperand::MOStore; // For now, atomics are considered to be volatile always. @@ -3718,21 +3707,16 @@ SelectionDAG::getLoad(ISD::MemIndexedMode AM, DebugLoc dl, SDValue Ptr, SDValue Offset, const Value *SV, int SVOffset, EVT MemVT, bool isVolatile, unsigned Alignment) { - MachineFunction &MF = getMachineFunction(); - MachineFrameInfo *FrameInfo = MF.getFrameInfo(); - if (Alignment == 0) // Ensure that codegen never sees alignment 0 Alignment = getEVTAlignment(VT); // Check if the memory reference references a frame index if (!SV) if (const FrameIndexSDNode *FI = - dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) - if (FrameInfo->isFixedObjectIndex(FI->getIndex())) - SV = PseudoSourceValue::getFixedStack(FI->getIndex()); - else - SV = PseudoSourceValue::getStack(); + dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) + SV = PseudoSourceValue::getFixedStack(FI->getIndex()); + MachineFunction &MF = getMachineFunction(); unsigned Flags = MachineMemOperand::MOLoad; if (isVolatile) Flags |= MachineMemOperand::MOVolatile; @@ -3822,21 +3806,16 @@ SelectionDAG::getIndexedLoad(SDValue OrigLoad, DebugLoc dl, SDValue Base, SDValue SelectionDAG::getStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr, const Value *SV, int SVOffset, bool isVolatile, unsigned Alignment) { - MachineFunction &MF = getMachineFunction(); - MachineFrameInfo *FrameInfo = MF.getFrameInfo(); - if (Alignment == 0) // Ensure that codegen never sees alignment 0 Alignment = getEVTAlignment(Val.getValueType()); // Check if the memory reference references a frame index if (!SV) if (const FrameIndexSDNode *FI = - dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) - if (FrameInfo->isFixedObjectIndex(FI->getIndex())) - SV = PseudoSourceValue::getFixedStack(FI->getIndex()); - else - SV = PseudoSourceValue::getStack(); + dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) + SV = PseudoSourceValue::getFixedStack(FI->getIndex()); + MachineFunction &MF = getMachineFunction(); unsigned Flags = MachineMemOperand::MOStore; if (isVolatile) Flags |= MachineMemOperand::MOVolatile; @@ -3873,21 +3852,16 @@ SDValue SelectionDAG::getTruncStore(SDValue Chain, DebugLoc dl, SDValue Val, SDValue Ptr, const Value *SV, int SVOffset, EVT SVT, bool isVolatile, unsigned Alignment) { - MachineFunction &MF = getMachineFunction(); - MachineFrameInfo *FrameInfo = MF.getFrameInfo(); - if (Alignment == 0) // Ensure that codegen never sees alignment 0 Alignment = getEVTAlignment(SVT); // Check if the memory reference references a frame index if (!SV) if (const FrameIndexSDNode *FI = - dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) - if (FrameInfo->isFixedObjectIndex(FI->getIndex())) - SV = PseudoSourceValue::getFixedStack(FI->getIndex()); - else - SV = PseudoSourceValue::getStack(); + dyn_cast<const FrameIndexSDNode>(Ptr.getNode())) + SV = PseudoSourceValue::getFixedStack(FI->getIndex()); + MachineFunction &MF = getMachineFunction(); unsigned Flags = MachineMemOperand::MOStore; if (isVolatile) Flags |= MachineMemOperand::MOVolatile; |