Skip to content
Snippets Groups Projects
Commit b8c7ba22 authored by Owen Anderson's avatar Owen Anderson
Browse files

Fix the ordering of operands to the store (inverted relative to LLVM IR), and fix the testcase.

llvm-svn: 55777
parent 634412fe
No related branches found
No related tags found
No related merge requests found
...@@ -157,10 +157,10 @@ bool X86FastISel::X86SelectStore(Instruction* I) { ...@@ -157,10 +157,10 @@ bool X86FastISel::X86SelectStore(Instruction* I) {
X86AddressMode AM; X86AddressMode AM;
if (Op1) if (Op1)
// Address is in register. // Address is in register.
AM.Base.Reg = Op0; AM.Base.Reg = Op1;
else else
AM.GV = cast<GlobalValue>(V); AM.GV = cast<GlobalValue>(V);
addFullAddress(BuildMI(MBB, TII.get(Opc)), AM); addFullAddress(BuildMI(MBB, TII.get(Opc)), AM).addReg(Op0);
return true; return true;
} }
...@@ -255,6 +255,8 @@ X86FastISel::TargetSelectInstruction(Instruction *I) { ...@@ -255,6 +255,8 @@ X86FastISel::TargetSelectInstruction(Instruction *I) {
default: break; default: break;
case Instruction::Load: case Instruction::Load:
return X86SelectLoad(I); return X86SelectLoad(I);
case Instruction::Store:
return X86SelectStore(I);
} }
return false; return false;
......
; RUN: llvm-as < %s | llc -fast-isel -mtriple=i386-apple-darwin -mattr=sse2 | \ ; RUN: llvm-as < %s | llc -fast-isel -mtriple=i386-apple-darwin -mattr=sse2 | \
; RUN: grep mov | grep lazy_ptr | count 2 ; RUN: grep mov | grep lazy_ptr | count 1
@src = external global i32 @src = external global i32
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment