[PATCH] D27169: [x86] Fix getAddressFromInstr
Michael LeMay via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 28 09:46:14 PST 2016
mlemay-intel created this revision.
mlemay-intel added reviewers: aivchenk, chandlerc, qcolombet, nadav, sunfish.
mlemay-intel added a subscriber: llvm-commits.
Fix getAddressFromInstr so that it copies displacements of global variable
references.
https://reviews.llvm.org/D27169
Files:
lib/Target/X86/X86InstrBuilder.h
Index: lib/Target/X86/X86InstrBuilder.h
===================================================================
--- lib/Target/X86/X86InstrBuilder.h
+++ lib/Target/X86/X86InstrBuilder.h
@@ -109,9 +109,11 @@
AM.IndexReg = Op2.getReg();
const MachineOperand &Op3 = MI->getOperand(Operand + 3);
- if (Op3.isGlobal())
+ // FIXME: Handle additional types of memory references below.
+ if (Op3.isGlobal()) {
AM.GV = Op3.getGlobal();
- else
+ AM.Disp = Op3.getOffset();
+ } else
AM.Disp = Op3.getImm();
return AM;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27169.79417.patch
Type: text/x-patch
Size: 534 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161128/77a34b26/attachment.bin>
More information about the llvm-commits
mailing list