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

Unified Diff: llvm/lib/Target/X86/X86FastISel.cpp

Issue 10808110: Fix cases where fast instruction selection generated both base and index registers (Closed)
Patch Set: Conditionalize code based on nacl target Created 8 years, 5 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 | llvm/lib/Target/X86/X86NaClRewritePass.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: llvm/lib/Target/X86/X86FastISel.cpp
===================================================================
--- a/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/llvm/lib/Target/X86/X86FastISel.cpp
@@ -578,6 +578,20 @@
// If all else fails, try to materialize the value in a register.
if (!AM.GV || !Subtarget->isPICStyleRIPRel()) {
+ // @LOCALMOD-START
+ if (Subtarget->isTargetNaCl()) {
+ // We can materialize into a memory address only if
+ // no registers have been defined (and hence, we
+ // aren't modifying an existing memory reference).
+ if ((AM.Base.Reg == 0) && (AM.IndexReg == 0)) {
+ // Put into index register so that the NaCl rewrite pass will
+ // convert this to a 64-bit address.
+ AM.IndexReg = getRegForValue(V);
+ return AM.IndexReg != 0;
+ }
+ return false;
+ }
+ // @LOCALMOD-END
if (AM.Base.Reg == 0) {
AM.Base.Reg = getRegForValue(V);
return AM.Base.Reg != 0;
« no previous file with comments | « no previous file | llvm/lib/Target/X86/X86NaClRewritePass.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698