[llvm] r321026 - [X86] Don't use NOPL when the assembler is passed an empty CPU string. Update tests to force a CPU with NOPL

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 18 13:37:27 PST 2017


Author: ctopper
Date: Mon Dec 18 13:37:27 2017
New Revision: 321026

URL: http://llvm.org/viewvc/llvm-project?rev=321026&view=rev
Log:
[X86] Don't use NOPL when the assembler is passed an empty CPU string. Update tests to force a CPU with NOPL

Empty string should be equivalent to "generic" which doesn't allow NOPL. Force tests to use specificy 'pentiumpro' to guarantee NOPL.

Fixes PR35686

Modified:
    llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
    llvm/trunk/test/MC/COFF/align-nops.s
    llvm/trunk/test/MC/ELF/align-nops.s
    llvm/trunk/test/MC/MachO/x86_32-optimal_nop.s
    llvm/trunk/test/MC/X86/AlignedBundling/different-sections.s
    llvm/trunk/test/MC/X86/AlignedBundling/long-nop-pad.s
    llvm/trunk/test/MC/X86/AlignedBundling/misaligned-bundle-group.s
    llvm/trunk/test/MC/X86/AlignedBundling/misaligned-bundle.s
    llvm/trunk/test/MC/X86/AlignedBundling/pad-align-to-bundle-end.s
    llvm/trunk/test/MC/X86/AlignedBundling/pad-bundle-groups.s
    llvm/trunk/test/MC/X86/AlignedBundling/relax-in-bundle-group.s
    llvm/trunk/test/MC/X86/AlignedBundling/single-inst-bundling.s
    llvm/trunk/test/MC/X86/x86_long_nop.s

Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp?rev=321026&r1=321025&r2=321026&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp Mon Dec 18 13:37:27 2017
@@ -78,7 +78,7 @@ public:
               CPU != "i586" && CPU != "pentium" && CPU != "pentium-mmx" &&
               CPU != "i686" && CPU != "k6" && CPU != "k6-2" && CPU != "k6-3" &&
               CPU != "geode" && CPU != "winchip-c6" && CPU != "winchip2" &&
-              CPU != "c3" && CPU != "c3-2" && CPU != "lakemont";
+              CPU != "c3" && CPU != "c3-2" && CPU != "lakemont" && CPU != "";
   }
 
   unsigned getNumFixupKinds() const override {

Modified: llvm/trunk/test/MC/COFF/align-nops.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/align-nops.s?rev=321026&r1=321025&r2=321026&view=diff
==============================================================================
--- llvm/trunk/test/MC/COFF/align-nops.s (original)
+++ llvm/trunk/test/MC/COFF/align-nops.s Mon Dec 18 13:37:27 2017
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -s -sd | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 -mcpu=pentiumpro %s | llvm-readobj -s -sd | FileCheck %s
 
 // Test that we get optimal nops in text
     .text

Modified: llvm/trunk/test/MC/ELF/align-nops.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/align-nops.s?rev=321026&r1=321025&r2=321026&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/align-nops.s (original)
+++ llvm/trunk/test/MC/ELF/align-nops.s Mon Dec 18 13:37:27 2017
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s -sd | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro %s -o - | llvm-readobj -s -sd | FileCheck %s
 
 // Test that we get optimal nops in text
     .text

Modified: llvm/trunk/test/MC/MachO/x86_32-optimal_nop.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/x86_32-optimal_nop.s?rev=321026&r1=321025&r2=321026&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/x86_32-optimal_nop.s (original)
+++ llvm/trunk/test/MC/MachO/x86_32-optimal_nop.s Mon Dec 18 13:37:27 2017
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -file-headers -s -sd -r -t -macho-segment -macho-dysymtab -macho-indirect-symbols | FileCheck %s
+// RUN: llvm-mc -triple i386-apple-darwin9 -mcpu=pentiumpro %s -filetype=obj -o - | llvm-readobj -file-headers -s -sd -r -t -macho-segment -macho-dysymtab -macho-indirect-symbols | FileCheck %s
 
 # 1 byte nop test
         .align 4, 0 # start with 16 byte alignment filled with zeros

Modified: llvm/trunk/test/MC/X86/AlignedBundling/different-sections.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/AlignedBundling/different-sections.s?rev=321026&r1=321025&r2=321026&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/AlignedBundling/different-sections.s (original)
+++ llvm/trunk/test/MC/X86/AlignedBundling/different-sections.s Mon Dec 18 13:37:27 2017
@@ -1,6 +1,6 @@
-# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
-# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mc-relax-all %s -o - \
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
 
 # Test two different executable sections with bundling.

Modified: llvm/trunk/test/MC/X86/AlignedBundling/long-nop-pad.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/AlignedBundling/long-nop-pad.s?rev=321026&r1=321025&r2=321026&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/AlignedBundling/long-nop-pad.s (original)
+++ llvm/trunk/test/MC/X86/AlignedBundling/long-nop-pad.s Mon Dec 18 13:37:27 2017
@@ -1,6 +1,6 @@
-# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
-# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mc-relax-all %s -o - \
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
 
 # Test that long nops are generated for padding where possible.

Modified: llvm/trunk/test/MC/X86/AlignedBundling/misaligned-bundle-group.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/AlignedBundling/misaligned-bundle-group.s?rev=321026&r1=321025&r2=321026&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/AlignedBundling/misaligned-bundle-group.s (original)
+++ llvm/trunk/test/MC/X86/AlignedBundling/misaligned-bundle-group.s Mon Dec 18 13:37:27 2017
@@ -1,7 +1,7 @@
-# RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu %s -o - \
+# RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu -mcpu=pentiumpro %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - \
 # RUN:   | FileCheck -check-prefix=CHECK -check-prefix=CHECK-OPT %s
-# RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu -mc-relax-all %s -o - \
+# RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - \
 # RUN:   | FileCheck -check-prefix=CHECK -check-prefix=CHECK-RELAX %s
 

Modified: llvm/trunk/test/MC/X86/AlignedBundling/misaligned-bundle.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/AlignedBundling/misaligned-bundle.s?rev=321026&r1=321025&r2=321026&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/AlignedBundling/misaligned-bundle.s (original)
+++ llvm/trunk/test/MC/X86/AlignedBundling/misaligned-bundle.s Mon Dec 18 13:37:27 2017
@@ -1,7 +1,7 @@
-# RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu %s -o - \
+# RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu -mcpu=pentiumpro %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - \
 # RUN:   | FileCheck -check-prefix=CHECK -check-prefix=CHECK-OPT %s
-# RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu -mc-relax-all %s -o - \
+# RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - \
 # RUN:   | FileCheck -check-prefix=CHECK -check-prefix=CHECK-RELAX %s
 

Modified: llvm/trunk/test/MC/X86/AlignedBundling/pad-align-to-bundle-end.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/AlignedBundling/pad-align-to-bundle-end.s?rev=321026&r1=321025&r2=321026&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/AlignedBundling/pad-align-to-bundle-end.s (original)
+++ llvm/trunk/test/MC/X86/AlignedBundling/pad-align-to-bundle-end.s Mon Dec 18 13:37:27 2017
@@ -1,6 +1,6 @@
-# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
-# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mc-relax-all %s -o - \
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
 
 # Test some variations of padding to the end of a bundle.

Modified: llvm/trunk/test/MC/X86/AlignedBundling/pad-bundle-groups.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/AlignedBundling/pad-bundle-groups.s?rev=321026&r1=321025&r2=321026&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/AlignedBundling/pad-bundle-groups.s (original)
+++ llvm/trunk/test/MC/X86/AlignedBundling/pad-bundle-groups.s Mon Dec 18 13:37:27 2017
@@ -1,6 +1,6 @@
-# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
-# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mc-relax-all %s -o - \
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
 
 # Test some variations of padding for bundle-locked groups.

Modified: llvm/trunk/test/MC/X86/AlignedBundling/relax-in-bundle-group.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/AlignedBundling/relax-in-bundle-group.s?rev=321026&r1=321025&r2=321026&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/AlignedBundling/relax-in-bundle-group.s (original)
+++ llvm/trunk/test/MC/X86/AlignedBundling/relax-in-bundle-group.s Mon Dec 18 13:37:27 2017
@@ -1,6 +1,6 @@
-# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro %s -o - \
 # RUN:   | llvm-objdump -disassemble - | FileCheck %s
-# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mc-relax-all %s -o - \
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
 # RUN:   | llvm-objdump -disassemble - | FileCheck %s
 
 # Test that instructions inside bundle-locked groups are relaxed even if their

Modified: llvm/trunk/test/MC/X86/AlignedBundling/single-inst-bundling.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/AlignedBundling/single-inst-bundling.s?rev=321026&r1=321025&r2=321026&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/AlignedBundling/single-inst-bundling.s (original)
+++ llvm/trunk/test/MC/X86/AlignedBundling/single-inst-bundling.s Mon Dec 18 13:37:27 2017
@@ -1,6 +1,6 @@
-# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck -check-prefix=CHECK -check-prefix=CHECK-OPT %s
-# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mc-relax-all %s -o - \
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
 # RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck -check-prefix=CHECK -check-prefix=CHECK-RELAX %s
 
 # Test simple NOP insertion for single instructions.

Modified: llvm/trunk/test/MC/X86/x86_long_nop.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86_long_nop.s?rev=321026&r1=321025&r2=321026&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86_long_nop.s (original)
+++ llvm/trunk/test/MC/X86/x86_long_nop.s Mon Dec 18 13:37:27 2017
@@ -1,7 +1,7 @@
-# RUN: llvm-mc -filetype=obj -arch=x86 -triple=x86_64-pc-linux-gnu %s | llvm-objdump -d -no-show-raw-insn - | FileCheck %s
-# RUN: llvm-mc -filetype=obj -arch=x86 -triple=i686-pc-linux-gnu %s | llvm-objdump -d -no-show-raw-insn - | FileCheck %s
-# RUN: llvm-mc -filetype=obj -arch=x86 -triple=x86_64-apple-darwin10.0 %s | llvm-objdump -d -no-show-raw-insn - | FileCheck %s
-# RUN: llvm-mc -filetype=obj -arch=x86 -triple=i686-apple-darwin8 %s | llvm-objdump -d -no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -arch=x86 -triple=x86_64-pc-linux-gnu -mcpu=pentiumpro %s | llvm-objdump -d -no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -arch=x86 -triple=i686-pc-linux-gnu %s -mcpu=pentiumpro | llvm-objdump -d -no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -arch=x86 -triple=x86_64-apple-darwin10.0 -mcpu=pentiumpro %s | llvm-objdump -d -no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -arch=x86 -triple=i686-apple-darwin8 -mcpu=pentiumpro %s | llvm-objdump -d -no-show-raw-insn - | FileCheck %s
 # RUN: llvm-mc -filetype=obj -arch=x86 -triple=i686-pc-linux-gnu -mcpu=slm %s | llvm-objdump -d -no-show-raw-insn - | FileCheck --check-prefix=LNOP7 %s
 # RUN: llvm-mc -filetype=obj -arch=x86 -triple=i686-pc-linux-gnu -mcpu=silvermont %s | llvm-objdump -d -no-show-raw-insn - | FileCheck --check-prefix=LNOP7 %s
 # RUN: llvm-mc -filetype=obj -arch=x86 -triple=i686-pc-linux-gnu -mcpu=lakemont %s | llvm-objdump -d -no-show-raw-insn - | FileCheck --check-prefix=NOP1 %s




More information about the llvm-commits mailing list