Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Unified Diff: lib/Target/X86/X86MCInstLower.cpp

Issue 1137803004: Add support for using MI bundles as bundle-locked groups on x86 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: review Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/Target/X86/X86NaClRewritePass.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Target/X86/X86MCInstLower.cpp
diff --git a/lib/Target/X86/X86MCInstLower.cpp b/lib/Target/X86/X86MCInstLower.cpp
index 03d0ca6edd883e25b988f283ec7c6123e8d43656..12204b1b6711e16987166a0af9f08ab5544da559 100644
--- a/lib/Target/X86/X86MCInstLower.cpp
+++ b/lib/Target/X86/X86MCInstLower.cpp
@@ -1007,6 +1007,22 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
X86MCInstLower MCInstLowering(*MF, *this);
const X86RegisterInfo *RI = MF->getSubtarget<X86Subtarget>().getRegisterInfo();
+ // @LOCALMOD-START
+ // MI Bundles are used to represent bundle-locked groups.
+ // MBB iterators skip bundles, so when we reach a bundle head, unpack it here.
+ if (MI->isBundle()) {
+ MachineBasicBlock::const_iterator MBBI(MI);
+ MachineBasicBlock::const_instr_iterator MII (MBBI.getInstrIterator());
+ ++MBBI;
+ OutStreamer.EmitBundleLock(false);
+ while (++MII != MBBI) {
+ EmitInstruction(MII);
+ }
+ OutStreamer.EmitBundleUnlock();
+ return;
+ }
+ // @LOCALMOD-END
+
switch (MI->getOpcode()) {
case TargetOpcode::DBG_VALUE:
llvm_unreachable("Should be handled target independently");
« no previous file with comments | « no previous file | lib/Target/X86/X86NaClRewritePass.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698