Skip to content

Commit 01c97b4

Browse files
committed
MCA: Remove relaxInstruction call
MCA inappropriately called the internal MCAssembler API (https://reviews.llvm.org/D65948). In addition, most snippets are short. We should display the short form of span-dependent instructions
1 parent 2235e20 commit 01c97b4

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

llvm/lib/MCA/CodeEmitter.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,8 @@ CodeEmitter::EncodingInfo CodeEmitter::getOrCreateEncodingInfo(unsigned MCID) {
2222

2323
SmallVector<llvm::MCFixup, 2> Fixups;
2424
const MCInst &Inst = Sequence[MCID];
25-
MCInst Relaxed(Sequence[MCID]);
26-
if (MAB.mayNeedRelaxation(Inst, STI))
27-
MAB.relaxInstruction(Relaxed, STI);
28-
2925
EI.first = Code.size();
30-
MCE.encodeInstruction(Relaxed, Code, Fixups, STI);
26+
MCE.encodeInstruction(Inst, Code, Fixups, STI);
3127
EI.second = Code.size() - EI.first;
3228
return EI;
3329
}

llvm/test/tools/llvm-mca/X86/show-encoding.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@
7474
# WITHENCODINGS-NEXT: 1 1 0.50 6 c4 c1 30 c6 c1 ff vshufps $255, %xmm9, %xmm9, %xmm0
7575
# WITHENCODINGS-NEXT: 1 1 1.00 * 6 c4 01 78 11 0c 8b vmovups %xmm9, (%r11,%r9,4)
7676
# WITHENCODINGS-NEXT: 1 1 0.50 3 44 39 c6 cmpl %r8d, %esi
77-
# WITHENCODINGS-NEXT: 1 1 0.50 6 0f 8c 00 00 00 00 jl -90
77+
# WITHENCODINGS-NEXT: 1 1 0.50 2 7c 00 jl -90

0 commit comments

Comments
 (0)