Skip to content

Commit 5b2a411

Browse files
committed
Revert "Use the new TB_NOT_REVERSABLE flag instead of special ", which depends
on r116007, which I am about to revert. llvm-svn: 116032
1 parent efdf08b commit 5b2a411

File tree

1 file changed

+20
-26
lines changed

1 file changed

+20
-26
lines changed

llvm/lib/Target/X86/X86InstrInfo.cpp

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
263263
{ X86::DIV64r, X86::DIV64m, 1, 0 },
264264
{ X86::DIV8r, X86::DIV8m, 1, 0 },
265265
{ X86::EXTRACTPSrr, X86::EXTRACTPSmr, 0, 16 },
266-
{ X86::FsMOVAPDrr, X86::MOVSDmr | TB_NOT_REVERSABLE , 0, 0 },
267-
{ X86::FsMOVAPSrr, X86::MOVSSmr | TB_NOT_REVERSABLE , 0, 0 },
266+
{ X86::FsMOVAPDrr, X86::MOVSDmr, 0, 0 },
267+
{ X86::FsMOVAPSrr, X86::MOVSSmr, 0, 0 },
268268
{ X86::IDIV16r, X86::IDIV16m, 1, 0 },
269269
{ X86::IDIV32r, X86::IDIV32m, 1, 0 },
270270
{ X86::IDIV64r, X86::IDIV64m, 1, 0 },
@@ -323,22 +323,18 @@ X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
323323
};
324324

325325
for (unsigned i = 0, e = array_lengthof(OpTbl0); i != e; ++i) {
326-
unsigned RegOp = OpTbl0[i][0];
327-
unsigned MemOp = OpTbl0[i][1] & ~TB_FLAGS;
328-
unsigned FoldedLoad = OpTbl0[i][2];
329-
unsigned Align = OpTbl0[i][3];
326+
unsigned RegOp = OpTbl0[i][0];
327+
unsigned MemOp = OpTbl0[i][1];
328+
unsigned Align = OpTbl0[i][3];
330329
assert(!RegOp2MemOpTable0.count(RegOp) && "Duplicated entries?");
331-
RegOp2MemOpTable0[RegOp] = std::make_pair(MemOp, Align);
332-
333-
// If this is not a reversable operation (because there is a many->one)
334-
// mapping, don't insert the reverse of the operation into MemOp2RegOpTable.
335-
if (OpTbl0[i][1] & TB_NOT_REVERSABLE)
336-
continue;
337-
330+
RegOp2MemOpTable0[RegOp] = std::make_pair(MemOp,Align);
331+
unsigned FoldedLoad = OpTbl0[i][2];
338332
// Index 0, folded load or store.
339333
unsigned AuxInfo = 0 | (FoldedLoad << 4) | ((FoldedLoad^1) << 5);
340-
assert(!MemOp2RegOpTable.count(MemOp) && "Duplicated entries?");
341-
MemOp2RegOpTable[MemOp] = std::make_pair(RegOp, AuxInfo);
334+
if (RegOp != X86::FsMOVAPDrr && RegOp != X86::FsMOVAPSrr) {
335+
assert(!MemOp2RegOpTable.count(MemOp) && "Duplicated entries?");
336+
MemOp2RegOpTable[MemOp] = std::make_pair(RegOp, AuxInfo);
337+
}
342338
}
343339

344340
static const unsigned OpTbl1[][3] = {
@@ -356,8 +352,8 @@ X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
356352
{ X86::CVTTSD2SIrr, X86::CVTTSD2SIrm, 0 },
357353
{ X86::CVTTSS2SI64rr, X86::CVTTSS2SI64rm, 0 },
358354
{ X86::CVTTSS2SIrr, X86::CVTTSS2SIrm, 0 },
359-
{ X86::FsMOVAPDrr, X86::MOVSDrm | TB_NOT_REVERSABLE , 0 },
360-
{ X86::FsMOVAPSrr, X86::MOVSSrm | TB_NOT_REVERSABLE , 0 },
355+
{ X86::FsMOVAPDrr, X86::MOVSDrm, 0 },
356+
{ X86::FsMOVAPSrr, X86::MOVSSrm, 0 },
361357
{ X86::IMUL16rri, X86::IMUL16rmi, 0 },
362358
{ X86::IMUL16rri8, X86::IMUL16rmi8, 0 },
363359
{ X86::IMUL32rri, X86::IMUL32rmi, 0 },
@@ -453,20 +449,17 @@ X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
453449

454450
for (unsigned i = 0, e = array_lengthof(OpTbl1); i != e; ++i) {
455451
unsigned RegOp = OpTbl1[i][0];
456-
unsigned MemOp = OpTbl1[i][1] & ~TB_FLAGS;
452+
unsigned MemOp = OpTbl1[i][1];
457453
unsigned Align = OpTbl1[i][2];
458454
assert(!RegOp2MemOpTable1.count(RegOp) && "Duplicate entries");
459-
RegOp2MemOpTable1[RegOp] = std::make_pair(MemOp, Align);
460-
461-
// If this is not a reversable operation (because there is a many->one)
462-
// mapping, don't insert the reverse of the operation into MemOp2RegOpTable.
463-
if (OpTbl1[i][1] & TB_NOT_REVERSABLE)
464-
continue;
455+
RegOp2MemOpTable1[RegOp] = std::make_pair(MemOp,Align);
465456

466457
// Index 1, folded load
467458
unsigned AuxInfo = 1 | (1 << 4);
468-
assert(!MemOp2RegOpTable.count(MemOp) && "Duplicate entries");
469-
MemOp2RegOpTable[MemOp] = std::make_pair(RegOp, AuxInfo);
459+
if (RegOp != X86::FsMOVAPDrr && RegOp != X86::FsMOVAPSrr) {
460+
assert(!MemOp2RegOpTable.count(MemOp) && "Duplicate entries");
461+
MemOp2RegOpTable[MemOp] = std::make_pair(RegOp, AuxInfo);
462+
}
470463
}
471464

472465
static const unsigned OpTbl2[][3] = {
@@ -678,6 +671,7 @@ X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
678671
assert(!RegOp2MemOpTable2.count(RegOp) && "Duplicate entry!");
679672
RegOp2MemOpTable2[RegOp] = std::make_pair(MemOp, Align);
680673

674+
681675
// If this is not a reversable operation (because there is a many->one)
682676
// mapping, don't insert the reverse of the operation into MemOp2RegOpTable.
683677
if (OpTbl2[i][1] & TB_NOT_REVERSABLE)

0 commit comments

Comments
 (0)