[llvm-branch-commits] [llvm-branch] r128207 - in /llvm/branches/release_29: ./ lib/Target/ARM/ARMBaseInstrInfo.cpp

Bill Wendling isanbard at gmail.com
Thu Mar 24 00:56:16 PDT 2011


Author: void
Date: Thu Mar 24 02:56:16 2011
New Revision: 128207

URL: http://llvm.org/viewvc/llvm-project?rev=128207&view=rev
Log:
--- Merging r128203 into '.':
U    lib/Target/ARM/ARMBaseInstrInfo.cpp


Modified:
    llvm/branches/release_29/   (props changed)
    llvm/branches/release_29/lib/Target/ARM/ARMBaseInstrInfo.cpp

Propchange: llvm/branches/release_29/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 24 02:56:16 2011
@@ -1,2 +1,2 @@
 /llvm/branches/Apple/Pertwee:110850,110961
-/llvm/trunk:127241,127263-127264,127298,127325,127328,127350-127351,127441,127464,127723,127780,127858,127871,127981,128041,128100,128194-128197
+/llvm/trunk:127241,127263-127264,127298,127325,127328,127350-127351,127441,127464,127723,127780,127858,127871,127981,128041,128100,128194-128197,128203

Modified: llvm/branches/release_29/lib/Target/ARM/ARMBaseInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_29/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=128207&r1=128206&r2=128207&view=diff
==============================================================================
--- llvm/branches/release_29/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
+++ llvm/branches/release_29/lib/Target/ARM/ARMBaseInstrInfo.cpp Thu Mar 24 02:56:16 2011
@@ -1080,11 +1080,18 @@
     int CPI1 = MO1.getIndex();
     const MachineConstantPoolEntry &MCPE0 = MCP->getConstants()[CPI0];
     const MachineConstantPoolEntry &MCPE1 = MCP->getConstants()[CPI1];
-    ARMConstantPoolValue *ACPV0 =
-      static_cast<ARMConstantPoolValue*>(MCPE0.Val.MachineCPVal);
-    ARMConstantPoolValue *ACPV1 =
-      static_cast<ARMConstantPoolValue*>(MCPE1.Val.MachineCPVal);
-    return ACPV0->hasSameValue(ACPV1);
+    bool isARMCP0 = MCPE0.isMachineConstantPoolEntry();
+    bool isARMCP1 = MCPE1.isMachineConstantPoolEntry();
+    if (isARMCP0 && isARMCP1) {
+      ARMConstantPoolValue *ACPV0 =
+        static_cast<ARMConstantPoolValue*>(MCPE0.Val.MachineCPVal);
+      ARMConstantPoolValue *ACPV1 =
+        static_cast<ARMConstantPoolValue*>(MCPE1.Val.MachineCPVal);
+      return ACPV0->hasSameValue(ACPV1);
+    } else if (!isARMCP0 && !isARMCP1) {
+      return MCPE0.Val.ConstVal == MCPE1.Val.ConstVal;
+    }
+    return false;
   } else if (Opcode == ARM::PICLDR) {
     if (MI1->getOpcode() != Opcode)
       return false;





More information about the llvm-branch-commits mailing list