Skip to content

Commit e6e34cb

Browse files
committed
Resolve merge conflict (10/15/16)
2 parents 9b6e89d + 078218d commit e6e34cb

File tree

4 files changed

+17
-54
lines changed

4 files changed

+17
-54
lines changed

include/llvm/CodeGen/MachineMemOperand.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ class MachineMemOperand {
127127
/// For cmpxchg atomic operations, atomic ordering requirements when store
128128
/// does not occur.
129129
unsigned FailureOrdering : 4; // enum AtomicOrdering
130-
/// Reserved/unused.
131-
unsigned Reserved : 16;
132130
};
133131

134132
MachinePointerInfo PtrInfo;
@@ -139,17 +137,6 @@ class MachineMemOperand {
139137
AAMDNodes AAInfo;
140138
const MDNode *Ranges;
141139

142-
/// Initialize atomic information for this memory operation.
143-
void InitAtomicInfo(SynchronizationScope SynchScope, AtomicOrdering Ordering,
144-
AtomicOrdering FailureOrdering) {
145-
AtomicInfo.SynchScope = static_cast<unsigned>(SynchScope);
146-
assert(getSynchScope() == SynchScope && "Value truncated");
147-
AtomicInfo.Ordering = static_cast<unsigned>(Ordering);
148-
assert(getOrdering() == Ordering && "Value truncated");
149-
AtomicInfo.FailureOrdering = static_cast<unsigned>(FailureOrdering);
150-
assert(getFailureOrdering() == FailureOrdering && "Value truncated");
151-
}
152-
153140
public:
154141
/// Construct a MachineMemOperand object with the specified PtrInfo, flags,
155142
/// size, and base alignment. For atomic operations the synchronization scope

include/llvm/CodeGen/SelectionDAGNodes.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,23 +1196,28 @@ class AtomicSDNode : public MemSDNode {
11961196
const SDValue &getBasePtr() const { return getOperand(1); }
11971197
const SDValue &getVal() const { return getOperand(2); }
11981198

1199+
/// Returns true if this SDNode represents cmpxchg atomic operation, false
1200+
/// otherwise.
1201+
bool isCompareAndSwap() const {
1202+
unsigned Op = getOpcode();
1203+
return Op == ISD::ATOMIC_CMP_SWAP ||
1204+
Op == ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS;
1205+
}
1206+
11991207
/// For cmpxchg atomic operations, return the atomic ordering requirements
12001208
/// when store occurs.
12011209
AtomicOrdering getSuccessOrdering() const {
1210+
assert(isCompareAndSwap() && "Must be cmpxchg operation");
12021211
return MMO->getSuccessOrdering();
12031212
}
12041213

12051214
/// For cmpxchg atomic operations, return the atomic ordering requirements
12061215
/// when store does not occur.
12071216
AtomicOrdering getFailureOrdering() const {
1217+
assert(isCompareAndSwap() && "Must be cmpxchg operation");
12081218
return MMO->getFailureOrdering();
12091219
}
12101220

1211-
bool isCompareAndSwap() const {
1212-
unsigned Op = getOpcode();
1213-
return Op == ISD::ATOMIC_CMP_SWAP || Op == ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS;
1214-
}
1215-
12161221
// Methods to support isa and dyn_cast
12171222
static bool classof(const SDNode *N) {
12181223
return N->getOpcode() == ISD::ATOMIC_CMP_SWAP ||

lib/CodeGen/MachineInstr.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,13 @@ MachineMemOperand::MachineMemOperand(MachinePointerInfo ptrinfo, Flags f,
548548
"invalid pointer value");
549549
assert(getBaseAlignment() == a && "Alignment is not a power of 2!");
550550
assert((isLoad() || isStore()) && "Not a load/store!");
551-
InitAtomicInfo(SynchScope, Ordering, FailureOrdering);
551+
552+
AtomicInfo.SynchScope = static_cast<unsigned>(SynchScope);
553+
assert(getSynchScope() == SynchScope && "Value truncated");
554+
AtomicInfo.Ordering = static_cast<unsigned>(Ordering);
555+
assert(getOrdering() == Ordering && "Value truncated");
556+
AtomicInfo.FailureOrdering = static_cast<unsigned>(FailureOrdering);
557+
assert(getFailureOrdering() == FailureOrdering && "Value truncated");
552558
}
553559

554560
/// Profile - Gather unique data for the object.

lib/Target/ARM/ARMFastISel.cpp

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ class ARMFastISel final : public FastISel {
112112
const TargetRegisterClass *RC,
113113
unsigned Op0, bool Op0IsKill,
114114
uint64_t Imm);
115-
unsigned fastEmitInst_rri(unsigned MachineInstOpcode,
116-
const TargetRegisterClass *RC,
117-
unsigned Op0, bool Op0IsKill,
118-
unsigned Op1, bool Op1IsKill,
119-
uint64_t Imm);
120115
unsigned fastEmitInst_i(unsigned MachineInstOpcode,
121116
const TargetRegisterClass *RC,
122117
uint64_t Imm);
@@ -351,36 +346,6 @@ unsigned ARMFastISel::fastEmitInst_ri(unsigned MachineInstOpcode,
351346
return ResultReg;
352347
}
353348

354-
unsigned ARMFastISel::fastEmitInst_rri(unsigned MachineInstOpcode,
355-
const TargetRegisterClass *RC,
356-
unsigned Op0, bool Op0IsKill,
357-
unsigned Op1, bool Op1IsKill,
358-
uint64_t Imm) {
359-
unsigned ResultReg = createResultReg(RC);
360-
const MCInstrDesc &II = TII.get(MachineInstOpcode);
361-
362-
// Make sure the input operands are sufficiently constrained to be legal
363-
// for this instruction.
364-
Op0 = constrainOperandRegClass(II, Op0, 1);
365-
Op1 = constrainOperandRegClass(II, Op1, 2);
366-
if (II.getNumDefs() >= 1) {
367-
AddOptionalDefs(
368-
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, II, ResultReg)
369-
.addReg(Op0, Op0IsKill * RegState::Kill)
370-
.addReg(Op1, Op1IsKill * RegState::Kill)
371-
.addImm(Imm));
372-
} else {
373-
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, II)
374-
.addReg(Op0, Op0IsKill * RegState::Kill)
375-
.addReg(Op1, Op1IsKill * RegState::Kill)
376-
.addImm(Imm));
377-
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
378-
TII.get(TargetOpcode::COPY), ResultReg)
379-
.addReg(II.ImplicitDefs[0]));
380-
}
381-
return ResultReg;
382-
}
383-
384349
unsigned ARMFastISel::fastEmitInst_i(unsigned MachineInstOpcode,
385350
const TargetRegisterClass *RC,
386351
uint64_t Imm) {

0 commit comments

Comments
 (0)