OLD | NEW |
1 //===-- X86MCInstLower.cpp - Convert X86 MachineInstr to an MCInst --------===// | 1 //===-- X86MCInstLower.cpp - Convert X86 MachineInstr to an MCInst --------===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file contains code to lower X86 MachineInstrs to their corresponding | 10 // This file contains code to lower X86 MachineInstrs to their corresponding |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 CS << "]"; | 1000 CS << "]"; |
1001 CS.flush(); | 1001 CS.flush(); |
1002 | 1002 |
1003 return Comment; | 1003 return Comment; |
1004 } | 1004 } |
1005 | 1005 |
1006 void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) { | 1006 void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) { |
1007 X86MCInstLower MCInstLowering(*MF, *this); | 1007 X86MCInstLower MCInstLowering(*MF, *this); |
1008 const X86RegisterInfo *RI = MF->getSubtarget<X86Subtarget>().getRegisterInfo()
; | 1008 const X86RegisterInfo *RI = MF->getSubtarget<X86Subtarget>().getRegisterInfo()
; |
1009 | 1009 |
| 1010 // @LOCALMOD-START |
| 1011 // MI Bundles are used to represent bundle-locked groups. |
| 1012 // MBB iterators skip bundles, so when we reach a bundle head, unpack it here. |
| 1013 if (MI->isBundle()) { |
| 1014 MachineBasicBlock::const_iterator MBBI(MI); |
| 1015 MachineBasicBlock::const_instr_iterator MII (MBBI.getInstrIterator()); |
| 1016 ++MBBI; |
| 1017 OutStreamer.EmitBundleLock(false); |
| 1018 while (++MII != MBBI) { |
| 1019 EmitInstruction(MII); |
| 1020 } |
| 1021 OutStreamer.EmitBundleUnlock(); |
| 1022 return; |
| 1023 } |
| 1024 // @LOCALMOD-END |
| 1025 |
1010 switch (MI->getOpcode()) { | 1026 switch (MI->getOpcode()) { |
1011 case TargetOpcode::DBG_VALUE: | 1027 case TargetOpcode::DBG_VALUE: |
1012 llvm_unreachable("Should be handled target independently"); | 1028 llvm_unreachable("Should be handled target independently"); |
1013 | 1029 |
1014 // Emit nothing here but a comment if we can. | 1030 // Emit nothing here but a comment if we can. |
1015 case X86::Int_MemBarrier: | 1031 case X86::Int_MemBarrier: |
1016 OutStreamer.emitRawComment("MEMBARRIER"); | 1032 OutStreamer.emitRawComment("MEMBARRIER"); |
1017 return; | 1033 return; |
1018 | 1034 |
1019 | 1035 |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 // Then flush the shadow so that we fill with nops before the call, not | 1331 // Then flush the shadow so that we fill with nops before the call, not |
1316 // after it. | 1332 // after it. |
1317 SMShadowTracker.emitShadowPadding(OutStreamer, getSubtargetInfo()); | 1333 SMShadowTracker.emitShadowPadding(OutStreamer, getSubtargetInfo()); |
1318 // Then emit the call | 1334 // Then emit the call |
1319 OutStreamer.EmitInstruction(TmpInst, getSubtargetInfo()); | 1335 OutStreamer.EmitInstruction(TmpInst, getSubtargetInfo()); |
1320 return; | 1336 return; |
1321 } | 1337 } |
1322 | 1338 |
1323 EmitAndCountInstruction(TmpInst); | 1339 EmitAndCountInstruction(TmpInst); |
1324 } | 1340 } |
OLD | NEW |