diff options
author | Chris Lattner <sabre@nondot.org> | 2004-07-18 07:26:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-07-18 07:26:17 +0000 |
commit | 7330248482817762c810c0b20165f8f1b59af283 (patch) | |
tree | 15ea83536e0268a30e9480d29a1b25dce2a202b6 /lib/Target/Sparc/InstSelectSimple.cpp | |
parent | bff3984e252667b8befc20229513bfec9a26de77 (diff) |
CPR fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14960 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc/InstSelectSimple.cpp')
-rw-r--r-- | lib/Target/Sparc/InstSelectSimple.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Target/Sparc/InstSelectSimple.cpp b/lib/Target/Sparc/InstSelectSimple.cpp index bc1f6c40f7..ac33ef574b 100644 --- a/lib/Target/Sparc/InstSelectSimple.cpp +++ b/lib/Target/Sparc/InstSelectSimple.cpp @@ -288,14 +288,13 @@ void V8ISel::copyConstantToRegister(MachineBasicBlock *MBB, } else if (isa<ConstantPointerNull>(C)) { // Copy zero (null pointer) to the register. BuildMI (*MBB, IP, V8::ORri, 2, R).addReg (V8::G0).addSImm (0); - } else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(C)) { + } else if (GlobalValue *GV = dyn_cast<GlobalValue>(C)) { // Copy it with a SETHI/OR pair; the JIT + asmwriter should recognize // that SETHI %reg,global == SETHI %reg,%hi(global) and // OR %reg,global,%reg == OR %reg,%lo(global),%reg. unsigned TmpReg = makeAnotherReg (C->getType ()); - BuildMI (*MBB, IP, V8::SETHIi, 1, TmpReg).addGlobalAddress (CPR->getValue()); - BuildMI (*MBB, IP, V8::ORri, 2, R).addReg (TmpReg) - .addGlobalAddress (CPR->getValue ()); + BuildMI (*MBB, IP, V8::SETHIi, 1, TmpReg).addGlobalAddress(GV); + BuildMI (*MBB, IP, V8::ORri, 2, R).addReg(TmpReg).addGlobalAddress(GV); } else { std::cerr << "Offending constant: " << *C << "\n"; assert (0 && "Can't copy this kind of constant into register yet"); |