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

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: add test 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') | lib/Target/X86/X86NaClRewritePass.cpp » ('J')
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..12e2da6db10b34fc5d4a0d6bca7630be305a73f2 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++;
jvoung (off chromium) 2015/05/12 23:53:04 ++MBBI instead?
Derek Schuff 2015/05/13 00:44:50 Done.
+ 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') | lib/Target/X86/X86NaClRewritePass.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698