Skip to content

Commit 5bc870c

Browse files
committed
--- Merging r128203 into '.':
U lib/Target/ARM/ARMBaseInstrInfo.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_29@128207 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 81d1e0b commit 5bc870c

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

lib/Target/ARM/ARMBaseInstrInfo.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,11 +1080,18 @@ bool ARMBaseInstrInfo::produceSameValue(const MachineInstr *MI0,
10801080
int CPI1 = MO1.getIndex();
10811081
const MachineConstantPoolEntry &MCPE0 = MCP->getConstants()[CPI0];
10821082
const MachineConstantPoolEntry &MCPE1 = MCP->getConstants()[CPI1];
1083-
ARMConstantPoolValue *ACPV0 =
1084-
static_cast<ARMConstantPoolValue*>(MCPE0.Val.MachineCPVal);
1085-
ARMConstantPoolValue *ACPV1 =
1086-
static_cast<ARMConstantPoolValue*>(MCPE1.Val.MachineCPVal);
1087-
return ACPV0->hasSameValue(ACPV1);
1083+
bool isARMCP0 = MCPE0.isMachineConstantPoolEntry();
1084+
bool isARMCP1 = MCPE1.isMachineConstantPoolEntry();
1085+
if (isARMCP0 && isARMCP1) {
1086+
ARMConstantPoolValue *ACPV0 =
1087+
static_cast<ARMConstantPoolValue*>(MCPE0.Val.MachineCPVal);
1088+
ARMConstantPoolValue *ACPV1 =
1089+
static_cast<ARMConstantPoolValue*>(MCPE1.Val.MachineCPVal);
1090+
return ACPV0->hasSameValue(ACPV1);
1091+
} else if (!isARMCP0 && !isARMCP1) {
1092+
return MCPE0.Val.ConstVal == MCPE1.Val.ConstVal;
1093+
}
1094+
return false;
10881095
} else if (Opcode == ARM::PICLDR) {
10891096
if (MI1->getOpcode() != Opcode)
10901097
return false;

0 commit comments

Comments
 (0)