From 01cf1a3805a9bca3a947937ad42f991acb214cbd Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Sat, 11 Jan 2020 08:41:35 -0800 Subject: [PATCH] [X86] Adjust nop emission by compiler to consider target decode limitations The primary motivation of this change is to bring the code more closely in sync behavior wise with the assembler's version of nop emission. I'd like to eventually factor them into one, but that's hard to do when one has features the other doesn't. The longest encodeable nop on x86 is 15 bytes, but many processors - for instance all intel chips - can't decode the 15 byte form efficiently. On those processors, it's better to use either a 10 byte or 11 byte sequence depending. --- lib/Target/X86/X86MCInstLower.cpp | 17 + .../X86/align-branch-boundary-suppressions.ll | 6 +- test/CodeGen/X86/stackmap-nops.ll | 488 +++++++++++------- test/MC/X86/stackmap-nops.ll | 4 +- 4 files changed, 317 insertions(+), 198 deletions(-) diff --git a/lib/Target/X86/X86MCInstLower.cpp b/lib/Target/X86/X86MCInstLower.cpp index e20d1ee2ae5..2fc9a2af01d 100644 --- a/lib/Target/X86/X86MCInstLower.cpp +++ b/lib/Target/X86/X86MCInstLower.cpp @@ -1031,6 +1031,20 @@ void X86AsmPrinter::LowerTlsAddr(X86MCInstLower &MCInstLowering, } } +/// Return the longest nop which can be efficiently decoded for the given +/// target cpu. 15-bytes is the longest single NOP instruction, but some +/// platforms can't decode the longest forms efficiently. +static unsigned MaxLongNopLength(const MCSubtargetInfo &STI) { + uint64_t MaxNopLength = 10; + if (STI.getFeatureBits()[X86::ProcIntelSLM]) + MaxNopLength = 7; + else if (STI.getFeatureBits()[X86::FeatureFast15ByteNOP]) + MaxNopLength = 15; + else if (STI.getFeatureBits()[X86::FeatureFast11ByteNOP]) + MaxNopLength = 11; + return MaxNopLength; +} + /// Emit the largest nop instruction smaller than or equal to \p NumBytes /// bytes. Return the size of nop emitted. static unsigned EmitNop(MCStreamer &OS, unsigned NumBytes, bool Is64Bit, @@ -1041,6 +1055,9 @@ static unsigned EmitNop(MCStreamer &OS, unsigned NumBytes, bool Is64Bit, return 1; } + // Cap a single nop emission at the profitable value for the target + NumBytes = std::min(NumBytes, MaxLongNopLength(STI)); + unsigned NopSize; unsigned Opc, BaseReg, ScaleVal, IndexReg, Displacement, SegmentReg; IndexReg = Displacement = SegmentReg = 0; diff --git a/test/CodeGen/X86/align-branch-boundary-suppressions.ll b/test/CodeGen/X86/align-branch-boundary-suppressions.ll index 7db20187d45..292fa6b1822 100644 --- a/test/CodeGen/X86/align-branch-boundary-suppressions.ll +++ b/test/CodeGen/X86/align-branch-boundary-suppressions.ll @@ -69,12 +69,8 @@ define void @patchpoint(i64 %a, i64 %b) { ; CHECK-NEXT: .cfi_def_cfa_register %rbp ; CHECK-NEXT: #noautopadding ; CHECK-NEXT: .Ltmp2: -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 ; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopl 8(%rax,%rax) ; CHECK-NEXT: #autopadding ; CHECK-NEXT: popq %rbp ; CHECK-NEXT: .cfi_def_cfa %rsp, 8 diff --git a/test/CodeGen/X86/stackmap-nops.ll b/test/CodeGen/X86/stackmap-nops.ll index 08fee2ecd3e..e0f40d1d3ef 100644 --- a/test/CodeGen/X86/stackmap-nops.ll +++ b/test/CodeGen/X86/stackmap-nops.ll @@ -1,198 +1,304 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck %s +; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=znver1 | FileCheck --check-prefix=CHECK-AMD %s + +; Check that we get a fast sequence of nops on each platform. define void @nop_test() { -entry: ; CHECK-LABEL: nop_test: -; CHECK: nop -; CHECK: xchgw %ax, %ax -; CHECK: nopl (%rax) -; CHECK: nopl 8(%rax) -; CHECK: nopl 8(%rax,%rax) -; CHECK: nopw 8(%rax,%rax) -; CHECK: nopl 512(%rax) -; CHECK: nopl 512(%rax,%rax) -; CHECK: nopw 512(%rax,%rax) -; CHECK: nopw %cs:512(%rax,%rax) - -; 11 -; CHECK: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) - -; 12 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) - -; 13 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) - -; 14 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) - -; 15 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) - -; 16 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: nop - -; 17 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: xchgw %ax, %ax - -; 18 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: nopl (%rax) - -; 19 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: nopl 8(%rax) - -; 20 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: nopl 8(%rax,%rax) - -; 21 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: nopw 8(%rax,%rax) - -; 22 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: nopl 512(%rax) - -; 23 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: nopl 512(%rax,%rax) - -; 24 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: nopw 512(%rax,%rax) - -; 25 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: nopw %cs:512(%rax,%rax) - -; 26 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) - -; 27 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) - -; 28 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) - -;29 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) - -; 30 -; CHECK: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: .byte 102 -; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK: ## %bb.0: ## %entry +; CHECK-NEXT: pushq %rbp +; CHECK-NEXT: .cfi_def_cfa_offset 16 +; CHECK-NEXT: .cfi_offset %rbp, -16 +; CHECK-NEXT: movq %rsp, %rbp +; CHECK-NEXT: .cfi_def_cfa_register %rbp +; CHECK-NEXT: Ltmp0: +; CHECK-NEXT: Ltmp1: +; CHECK-NEXT: nop +; CHECK-NEXT: Ltmp2: +; CHECK-NEXT: xchgw %ax, %ax +; CHECK-NEXT: Ltmp3: +; CHECK-NEXT: nopl (%rax) +; CHECK-NEXT: Ltmp4: +; CHECK-NEXT: nopl 8(%rax) +; CHECK-NEXT: Ltmp5: +; CHECK-NEXT: nopl 8(%rax,%rax) +; CHECK-NEXT: Ltmp6: +; CHECK-NEXT: nopw 8(%rax,%rax) +; CHECK-NEXT: Ltmp7: +; CHECK-NEXT: nopl 512(%rax) +; CHECK-NEXT: Ltmp8: +; CHECK-NEXT: nopl 512(%rax,%rax) +; CHECK-NEXT: Ltmp9: +; CHECK-NEXT: nopw 512(%rax,%rax) +; CHECK-NEXT: Ltmp10: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: Ltmp11: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nop +; CHECK-NEXT: Ltmp12: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: xchgw %ax, %ax +; CHECK-NEXT: Ltmp13: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopl (%rax) +; CHECK-NEXT: Ltmp14: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopl 8(%rax) +; CHECK-NEXT: Ltmp15: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopl 8(%rax,%rax) +; CHECK-NEXT: Ltmp16: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw 8(%rax,%rax) +; CHECK-NEXT: Ltmp17: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopl 512(%rax) +; CHECK-NEXT: Ltmp18: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopl 512(%rax,%rax) +; CHECK-NEXT: Ltmp19: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw 512(%rax,%rax) +; CHECK-NEXT: Ltmp20: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: Ltmp21: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nop +; CHECK-NEXT: Ltmp22: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: xchgw %ax, %ax +; CHECK-NEXT: Ltmp23: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopl (%rax) +; CHECK-NEXT: Ltmp24: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopl 8(%rax) +; CHECK-NEXT: Ltmp25: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopl 8(%rax,%rax) +; CHECK-NEXT: Ltmp26: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw 8(%rax,%rax) +; CHECK-NEXT: Ltmp27: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopl 512(%rax) +; CHECK-NEXT: Ltmp28: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopl 512(%rax,%rax) +; CHECK-NEXT: Ltmp29: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw 512(%rax,%rax) +; CHECK-NEXT: Ltmp30: +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-NEXT: Ltmp31: +; CHECK-NEXT: popq %rbp +; CHECK-NEXT: retq +; +; CHECK-AMD-LABEL: nop_test: +; CHECK-AMD: ## %bb.0: ## %entry +; CHECK-AMD-NEXT: pushq %rbp +; CHECK-AMD-NEXT: .cfi_def_cfa_offset 16 +; CHECK-AMD-NEXT: .cfi_offset %rbp, -16 +; CHECK-AMD-NEXT: movq %rsp, %rbp +; CHECK-AMD-NEXT: .cfi_def_cfa_register %rbp +; CHECK-AMD-NEXT: Ltmp0: +; CHECK-AMD-NEXT: Ltmp1: +; CHECK-AMD-NEXT: nop +; CHECK-AMD-NEXT: Ltmp2: +; CHECK-AMD-NEXT: xchgw %ax, %ax +; CHECK-AMD-NEXT: Ltmp3: +; CHECK-AMD-NEXT: nopl (%rax) +; CHECK-AMD-NEXT: Ltmp4: +; CHECK-AMD-NEXT: nopl 8(%rax) +; CHECK-AMD-NEXT: Ltmp5: +; CHECK-AMD-NEXT: nopl 8(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp6: +; CHECK-AMD-NEXT: nopw 8(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp7: +; CHECK-AMD-NEXT: nopl 512(%rax) +; CHECK-AMD-NEXT: Ltmp8: +; CHECK-AMD-NEXT: nopl 512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp9: +; CHECK-AMD-NEXT: nopw 512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp10: +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp11: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp12: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp13: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp14: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp15: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp16: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: nop +; CHECK-AMD-NEXT: Ltmp17: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: xchgw %ax, %ax +; CHECK-AMD-NEXT: Ltmp18: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: nopl (%rax) +; CHECK-AMD-NEXT: Ltmp19: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: nopl 8(%rax) +; CHECK-AMD-NEXT: Ltmp20: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: nopl 8(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp21: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: nopw 8(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp22: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: nopl 512(%rax) +; CHECK-AMD-NEXT: Ltmp23: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: nopl 512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp24: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: nopw 512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp25: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp26: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp27: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp28: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp29: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp30: +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: .byte 102 +; CHECK-AMD-NEXT: nopw %cs:512(%rax,%rax) +; CHECK-AMD-NEXT: Ltmp31: +; CHECK-AMD-NEXT: popq %rbp +; CHECK-AMD-NEXT: retq +entry: tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 0, i32 0) tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 1, i32 1) tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 2, i32 2) diff --git a/test/MC/X86/stackmap-nops.ll b/test/MC/X86/stackmap-nops.ll index 97cef8bf7e2..26397d90e5f 100644 --- a/test/MC/X86/stackmap-nops.ll +++ b/test/MC/X86/stackmap-nops.ll @@ -1,5 +1,5 @@ -; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=corei7 -frame-pointer=all -filetype=obj %s -o - | llvm-objdump -d - | FileCheck %s -; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=corei7 -frame-pointer=all -filetype=asm %s -o - | llvm-mc -triple=x86_64-apple-darwin -mcpu=corei7 -filetype=obj - | llvm-objdump -d - | FileCheck %s +; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=znver1 -frame-pointer=all -filetype=obj %s -o - | llvm-objdump -d - | FileCheck %s +; RUN: llc -mtriple=x86_64-apple-darwin -mcpu=znver1 -frame-pointer=all -filetype=asm %s -o - | llvm-mc -triple=x86_64-apple-darwin -mcpu=znver1 -filetype=obj - | llvm-objdump -d - | FileCheck %s define void @nop_test() { entry: