]> granicus.if.org Git - llvm/commitdiff
[GlobalISel][X86] Fix G_TRUNC instruction selection.
authorIgor Breger <igor.breger@intel.com>
Sun, 21 May 2017 11:13:56 +0000 (11:13 +0000)
committerIgor Breger <igor.breger@intel.com>
Sun, 21 May 2017 11:13:56 +0000 (11:13 +0000)
Updated tests with -verify-machineinstrs flag.
It fixes 3 tests failed with machine verifier enabled and listed
in PR27481

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303502 91177308-0d34-0410-b5e6-96231b3b80d8

27 files changed:
lib/Target/X86/X86InstructionSelector.cpp
test/CodeGen/X86/GlobalISel/add-scalar.ll
test/CodeGen/X86/GlobalISel/add-vec.ll
test/CodeGen/X86/GlobalISel/binop.ll
test/CodeGen/X86/GlobalISel/br.ll
test/CodeGen/X86/GlobalISel/callingconv.ll
test/CodeGen/X86/GlobalISel/cmp.ll
test/CodeGen/X86/GlobalISel/constant.ll
test/CodeGen/X86/GlobalISel/ext-x86-64.ll
test/CodeGen/X86/GlobalISel/ext.ll
test/CodeGen/X86/GlobalISel/frameIndex.ll
test/CodeGen/X86/GlobalISel/gep.ll
test/CodeGen/X86/GlobalISel/memop-scalar-x32.ll
test/CodeGen/X86/GlobalISel/memop-scalar.ll
test/CodeGen/X86/GlobalISel/memop-vec.ll
test/CodeGen/X86/GlobalISel/mul-scalar.ll
test/CodeGen/X86/GlobalISel/mul-vec.ll
test/CodeGen/X86/GlobalISel/select-br.mir
test/CodeGen/X86/GlobalISel/select-cmp.mir
test/CodeGen/X86/GlobalISel/select-constant.mir
test/CodeGen/X86/GlobalISel/select-ext-x86-64.mir
test/CodeGen/X86/GlobalISel/select-ext.mir
test/CodeGen/X86/GlobalISel/select-frameIndex.mir
test/CodeGen/X86/GlobalISel/select-gep.mir
test/CodeGen/X86/GlobalISel/select-trunc.mir
test/CodeGen/X86/GlobalISel/sub-vec.ll
test/CodeGen/X86/GlobalISel/trunc.ll

index 5eb5ad52840adc35be2a60212f8bb8108aa723d0..61956f7418202ef2431b35643bff83749d616f5c 100644 (file)
@@ -449,24 +449,30 @@ bool X86InstructionSelector::selectTrunc(MachineInstr &I,
   if (!SrcRC)
     return false;
 
-  if (!RBI.constrainGenericRegister(SrcReg, *SrcRC, MRI) ||
-      !RBI.constrainGenericRegister(DstReg, *DstRC, MRI)) {
-    DEBUG(dbgs() << "Failed to constrain G_TRUNC\n");
-    return false;
-  }
-
+  unsigned SubIdx;
   if (DstRC == SrcRC) {
     // Nothing to be done
+    SubIdx = X86::NoSubRegister;
   } else if (DstRC == &X86::GR32RegClass) {
-    I.getOperand(1).setSubReg(X86::sub_32bit);
+    SubIdx = X86::sub_32bit;
   } else if (DstRC == &X86::GR16RegClass) {
-    I.getOperand(1).setSubReg(X86::sub_16bit);
+    SubIdx = X86::sub_16bit;
   } else if (DstRC == &X86::GR8RegClass) {
-    I.getOperand(1).setSubReg(X86::sub_8bit);
+    SubIdx = X86::sub_8bit;
   } else {
     return false;
   }
 
+  SrcRC = TRI.getSubClassWithSubReg(SrcRC, SubIdx);
+
+  if (!RBI.constrainGenericRegister(SrcReg, *SrcRC, MRI) ||
+      !RBI.constrainGenericRegister(DstReg, *DstRC, MRI)) {
+    DEBUG(dbgs() << "Failed to constrain G_TRUNC\n");
+    return false;
+  }
+
+  I.getOperand(1).setSubReg(SubIdx);
+
   I.setDesc(TII.get(X86::COPY));
   return true;
 }
index 85db1c0e7e7a27009b7d2671da8cd6773051b348..55c825464039c9ec70ead14da0a5d76f903a9e94 100644 (file)
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
-; RUN: llc -mtriple=i386-linux-gnu   -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32
+; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
+; RUN: llc -mtriple=i386-linux-gnu   -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32
 
 define i64 @test_add_i64(i64 %arg1, i64 %arg2) {
 ; X64-LABEL: test_add_i64:
index e9b4466943ddf155e73b34c053d3466e3784b399..679a49d733a2f11bd9a2a3002e2e44ad7e5f3bd1 100644 (file)
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=skx -global-isel < %s -o - | FileCheck %s --check-prefix=SKX
+; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=skx -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=SKX
 
 define <16 x i8> @test_add_v16i8(<16 x i8> %arg1, <16 x i8> %arg2) {
 ; SKX-LABEL: test_add_v16i8:
index 1aae1db8ab0768f174dab4d7549fc131c0ab1720..d7ae4435682f01be01797ee920c95f5e31bd78e2 100644 (file)
@@ -1,8 +1,8 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu                                  -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SSE
-; RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx                      -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=ALL_AVX --check-prefix=AVX
-; RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx512f                  -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=ALL_AVX --check-prefix=AVX512F
-; RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx512f -mattr=+avx512vl -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=ALL_AVX --check-prefix=AVX512VL
+; RUN: llc -mtriple=x86_64-linux-gnu                                  -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SSE
+; RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx                      -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=ALL_AVX --check-prefix=AVX
+; RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx512f                  -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=ALL_AVX --check-prefix=AVX512F
+; RUN: llc -mtriple=x86_64-linux-gnu -mattr=+avx512f -mattr=+avx512vl -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=ALL_AVX --check-prefix=AVX512VL
 
 define i64 @test_sub_i64(i64 %arg1, i64 %arg2) {
 ; ALL-LABEL: test_sub_i64:
index faa6a0350337392c7d05fc5a54548212e0fa6145..387e8797f0cd0906cf6cf2aaa3a5f5a5e0e74170 100644 (file)
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -O0 -mtriple=x86_64-linux-gnu    -global-isel %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X64
+; RUN: llc -O0 -mtriple=x86_64-linux-gnu    -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X64
 
 define void @uncondbr() {
 ; CHECK-LABEL: uncondbr:
index c7e4d91ac3c7b980ecbac73fdb26069d84aca103..997115d4d900e63211a2349d198e7a7d7675ba14 100644 (file)
@@ -1,8 +1,8 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=i386-linux-gnu -mattr=+sse2  -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32 --check-prefix=X32_GISEL
-; RUN: llc -mtriple=i386-linux-gnu -mattr=+sse2               < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32 --check-prefix=X32_ISEL
-; RUN: llc -mtriple=x86_64-linux-gnu             -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64 --check-prefix=X64_GISEL
-; RUN: llc -mtriple=x86_64-linux-gnu                          < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64 --check-prefix=X64_ISEL
+; RUN: llc -mtriple=i386-linux-gnu -mattr=+sse2  -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32 --check-prefix=X32_GISEL
+; RUN: llc -mtriple=i386-linux-gnu -mattr=+sse2               -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32 --check-prefix=X32_ISEL
+; RUN: llc -mtriple=x86_64-linux-gnu             -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64 --check-prefix=X64_GISEL
+; RUN: llc -mtriple=x86_64-linux-gnu                          -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64 --check-prefix=X64_ISEL
 
 define i32 @test_ret_i32() {
 ; X32-LABEL: test_ret_i32:
index 03692bb6b1de9dce7025fdb62efd4feb4b8628b8..39fee409d785a028ddde609a0e17d954bbd0941b 100644 (file)
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu    -global-isel < %s -o - | FileCheck %s --check-prefix=ALL
+; RUN: llc -mtriple=x86_64-linux-gnu    -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL
 
 define i32 @test_icmp_eq_i8(i8 %a, i8 %b) {
 ; ALL-LABEL: test_icmp_eq_i8:
index cab043a51f0526ce46607acddc4bf501cddd7013..b550bb0bc7be6d64a0ea4c88f290ae37cdfc12ec 100644 (file)
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
+; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
 
 define i8 @const_i8() {
 ; ALL-LABEL: const_i8:
index 64cd0e70a4fdd75f7b5cb6be0d5172345032ce7b..b08ac062fb4bbf63952543e0268dd47e547bfa3d 100644 (file)
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu    -global-isel < %s -o - | FileCheck %s --check-prefix=X64
+; RUN: llc -mtriple=x86_64-linux-gnu    -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X64
 
 ; TODO merge with ext.ll after i64 sext suported on 32bit platform
 
index 4d4e3b05ca28b6cbabf79470559195340d38fe12..27aecd118b385e73a4de718e0b28809d01c0444d 100644 (file)
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu    -global-isel < %s -o - | FileCheck %s --check-prefix=X64
-; RUN: llc -mtriple=i386-linux-gnu      -global-isel < %s -o - | FileCheck %s --check-prefix=X32
+; RUN: llc -mtriple=x86_64-linux-gnu    -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X64
+; RUN: llc -mtriple=i386-linux-gnu      -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X32
 
 define i32 @test_zext_i1(i32 %a) {
 ; X64-LABEL: test_zext_i1:
index 2bb11adcc3b562129aad1a2299b42d01c559ffcd..a9ec94defea87fa45447f2b09b4f0b850ba1dc5e 100644 (file)
@@ -1,10 +1,10 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu    -global-isel < %s -o - | FileCheck %s --check-prefix=X64
-; RUN: llc -mtriple=x86_64-linux-gnu                 < %s -o - | FileCheck %s --check-prefix=X64
-; RUN: llc -mtriple=i386-linux-gnu      -global-isel < %s -o - | FileCheck %s --check-prefix=X32
-; RUN: llc -mtriple=i386-linux-gnu                   < %s -o - | FileCheck %s --check-prefix=X32
-; RUN: llc -mtriple=x86_64-linux-gnux32 -global-isel < %s -o - | FileCheck %s --check-prefix=X32ABI
-; RUN: llc -mtriple=x86_64-linux-gnux32              < %s -o - | FileCheck %s --check-prefix=X32ABI
+; RUN: llc -mtriple=x86_64-linux-gnu    -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X64
+; RUN: llc -mtriple=x86_64-linux-gnu                 -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X64
+; RUN: llc -mtriple=i386-linux-gnu      -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X32
+; RUN: llc -mtriple=i386-linux-gnu                   -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X32
+; RUN: llc -mtriple=x86_64-linux-gnux32 -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X32ABI
+; RUN: llc -mtriple=x86_64-linux-gnux32              -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X32ABI
 
 define i32* @allocai32() {
 ; X64-LABEL: allocai32:
index bc5b0152b24ae260bac2f8a41a7cc79b7f39b42d..94da9fb46761b1855d828fe170e3b61efc15b612 100644 (file)
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64_GISEL
-; RUN: llc -mtriple=x86_64-linux-gnu              < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
+; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64_GISEL
+; RUN: llc -mtriple=x86_64-linux-gnu              -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
 
 define i32* @test_gep_i8(i32 *%arr, i8 %ind) {
 ; X64_GISEL-LABEL: test_gep_i8:
index 49a7fd79f8b241517c96ac5d49b9f50ca3b67158..5df52c5a058b5859203a852e8381015300ab182a 100644 (file)
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=i386-linux-gnu                       -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SSE --check-prefix=SSE_FAST
-; RUN: llc -mtriple=i386-linux-gnu -regbankselect-greedy -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SSE --check-prefix=SSE_GREEDY
+; RUN: llc -mtriple=i386-linux-gnu                       -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SSE --check-prefix=SSE_FAST
+; RUN: llc -mtriple=i386-linux-gnu -regbankselect-greedy -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SSE --check-prefix=SSE_GREEDY
 
 ;TODO merge with x86-64 tests (many operations not suppored yet)
 
index 3e45a9c9a49dd403c536c797a0ae454c115f7617..d3d4b297a80290c2d64771da520fc55a3764ecf5 100644 (file)
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu                       -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SSE_FAST
-; RUN: llc -mtriple=x86_64-linux-gnu -regbankselect-greedy -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SSE_GREEDY
+; RUN: llc -mtriple=x86_64-linux-gnu                       -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SSE_FAST
+; RUN: llc -mtriple=x86_64-linux-gnu -regbankselect-greedy -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SSE_GREEDY
 
 define i8 @test_load_i8(i8 * %p1) {
 ; ALL-LABEL: test_load_i8:
index e218fded4d5f75117ec67a5eb8d1e8604bbf189d..f1ffc15f4d0311a045345a43e0120a3c93db16c6 100644 (file)
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=skx                       -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SKX
-; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=skx -regbankselect-greedy -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SKX
+; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=skx                       -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SKX
+; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=skx -regbankselect-greedy -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=SKX
 
 define <4 x i32> @test_load_v4i32_noalign(<4 x i32> * %p1) {
 ; ALL-LABEL: test_load_v4i32_noalign:
index 529e81c43304b484ce4d5eb32ef9408cad537697..450c3839797cd6ba8d9aa95168baa43f1af0bfaa 100644 (file)
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu -global-isel < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
+; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
 
 ;TODO: instruction selection not supported yet
 ;define i8 @test_mul_i8(i8 %arg1, i8 %arg2) {
index 83615a718528f873ad190f8521e49226f2ddf960..b2e211470f393655596f13d1f0c00b9fcadc95bc 100644 (file)
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=skx -global-isel < %s -o - | FileCheck %s --check-prefix=SKX
+; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=skx -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=SKX
 
 define <8 x i16> @test_mul_v8i16(<8 x i16> %arg1, <8 x i16> %arg2) {
 ; SKX-LABEL: test_mul_v8i16:
index 6d8cd2b1367dd515098ac8ce7be663aa21a6e776..9d2a878e757542610730034e894c49c7b2dda6ef 100644 (file)
@@ -1,5 +1,5 @@
-# RUN: llc -mtriple=x86_64-linux-gnu    -global-isel -run-pass=instruction-select %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X64
-# RUN: llc -mtriple=i386-linux-gnu      -global-isel -run-pass=instruction-select %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X32
+# RUN: llc -mtriple=x86_64-linux-gnu    -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X64
+# RUN: llc -mtriple=i386-linux-gnu      -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X32
 
 --- |
   define void @uncondbr() {
index 1d3da6cb88b95fcf88f811183b125e132838424a..a92c388c1db96168705675a61e0a3099d299d27e 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select %s -o - | FileCheck %s --check-prefix=CHECK
+# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK
 
 --- |
   define i32 @test_icmp_eq_i8(i8 %a, i8 %b) {
index f6b97b578b9274c90f470224fe62515a0c7bf2d2..162de0264435b0a49ef24c673762cfda576b762d 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select %s -o - | FileCheck %s --check-prefix=CHECK
+# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK
 
 --- |
   define i8 @const_i8() {
index 0844701487bcc24369b6c34f908f9055feffe540..d1a3abfd0f936f73546ce5d37c2d89273c586d29 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
+# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
 
 --- |
   define i64 @test_zext_i1(i8 %a) {
index 831d6efb75f12b5a561d5af0752e9d1141803c2c..dccc20e571008d5e408f6a967f013dce5e75fe6b 100644 (file)
@@ -1,5 +1,5 @@
-# RUN: llc -mtriple=i386-linux-gnu   -global-isel -run-pass=instruction-select %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32
-# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
+# RUN: llc -mtriple=i386-linux-gnu   -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32
+# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
 
 --- |
   define i32 @test_zext_i1(i1 %a) {
index 2fa9ac23a7afa4501eb5552a79dc8a652b58b698..1d641ba279aff9333f6cb3f2025163340cecd7b3 100644 (file)
@@ -1,6 +1,6 @@
-# RUN: llc -mtriple=x86_64-linux-gnu    -global-isel -run-pass=instruction-select %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X64
-# RUN: llc -mtriple=i386-linux-gnu      -global-isel -run-pass=instruction-select %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X32
-# RUN: llc -mtriple=x86_64-linux-gnux32 -global-isel -run-pass=instruction-select %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X32ABI
+# RUN: llc -mtriple=x86_64-linux-gnu    -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X64
+# RUN: llc -mtriple=i386-linux-gnu      -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X32
+# RUN: llc -mtriple=x86_64-linux-gnux32 -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK --check-prefix=X32ABI
 
 --- |
   define i32* @allocai32() {
index 2c89b7057c3d2341269250d6bde5b169bf5bfdc3..c8a4dc80cb2cfa6ac8ae2a1a6c640c6f7a3edd20 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select %s -o - | FileCheck %s --check-prefix=CHECK
+# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK
 
 --- |
   define i32* @test_gep_i32(i32* %arr) {
index 714340248ff6fd5e58db5eb2e9946126e4ce9554..9b90543d6559616f7a2a09b2ab32a18de0d5ac62 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select %s -o - | FileCheck %s --check-prefix=CHECK
+# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK
 --- |
   define i1 @trunc_i32toi1(i32 %a) {
     %r = trunc i32 %a to i1
 ...
 ---
 name:            trunc_i32toi1
+# CHECK-LABEL: name:  trunc_i32toi1
 alignment:       4
 legalized:       true
 regBankSelected: true
-selected:        false
-# CHECK-LABEL: name:            trunc_i32toi1
-# CHECK: registers:
-# CHECK-NEXT:  - { id: 0, class: gr32 }
-# CHECK-NEXT:  - { id: 1, class: gr8 }
+# CHECK:      registers:
+# CHECK-NEXT:   - { id: 0, class: gr32 }
+# CHECK-NEXT:   - { id: 1, class: gr8 }
 registers:
   - { id: 0, class: gpr }
   - { id: 1, class: gpr }
-# CHECK:  body:
-# CHECK:    %1 = COPY %0.sub_8
+# CHECK:          %0 = COPY %edi
+# CHECK-NEXT:     %1 = COPY %0.sub_8bit
+# CHECK-NEXT:     %al = COPY %1
+# CHECK-NEXT:     RET 0, implicit %al
 body:             |
   bb.1 (%ir-block.0):
     liveins: %edi
@@ -58,19 +59,20 @@ body:             |
 ...
 ---
 name:            trunc_i32toi8
+# CHECK-LABEL: name:  trunc_i32toi8
 alignment:       4
 legalized:       true
 regBankSelected: true
-selected:        false
-# CHECK-LABEL: name:            trunc_i32toi8
-# CHECK: registers:
-# CHECK-NEXT:  - { id: 0, class: gr32 }
-# CHECK-NEXT:  - { id: 1, class: gr8 }
+# CHECK:      registers:
+# CHECK-NEXT:   - { id: 0, class: gr32 }
+# CHECK-NEXT:   - { id: 1, class: gr8 }
 registers:
   - { id: 0, class: gpr }
   - { id: 1, class: gpr }
-# CHECK:  body:
-# CHECK:    %1 = COPY %0.sub_8
+# CHECK:          %0 = COPY %edi
+# CHECK-NEXT:     %1 = COPY %0.sub_8bit
+# CHECK-NEXT:     %al = COPY %1
+# CHECK-NEXT:     RET 0, implicit %al
 body:             |
   bb.1 (%ir-block.0):
     liveins: %edi
@@ -83,19 +85,20 @@ body:             |
 ...
 ---
 name:            trunc_i32toi16
+# CHECK-LABEL: name:  trunc_i32toi16
 alignment:       4
 legalized:       true
 regBankSelected: true
-selected:        false
-# CHECK-LABEL: name:            trunc_i32toi16
-# CHECK: registers:
-# CHECK-NEXT:  - { id: 0, class: gr32 }
-# CHECK-NEXT:  - { id: 1, class: gr16 }
+# CHECK:      registers:
+# CHECK-NEXT:   - { id: 0, class: gr32 }
+# CHECK-NEXT:   - { id: 1, class: gr16 }
 registers:
   - { id: 0, class: gpr }
   - { id: 1, class: gpr }
-# CHECK:  body:
-# CHECK:    %1 = COPY %0.sub_16
+# CHECK:          %0 = COPY %edi
+# CHECK-NEXT:     %1 = COPY %0.sub_16bit
+# CHECK-NEXT:     %ax = COPY %1
+# CHECK-NEXT:     RET 0, implicit %ax
 body:             |
   bb.1 (%ir-block.0):
     liveins: %edi
@@ -108,19 +111,20 @@ body:             |
 ...
 ---
 name:            trunc_i64toi8
+# CHECK-LABEL: name:  trunc_i64toi8
 alignment:       4
 legalized:       true
 regBankSelected: true
-selected:        false
-# CHECK-LABEL: name:            trunc_i64toi8
-# CHECK: registers:
-# CHECK-NEXT:  - { id: 0, class: gr64 }
-# CHECK-NEXT:  - { id: 1, class: gr8 }
+# CHECK:      registers:
+# CHECK-NEXT:   - { id: 0, class: gr64_with_sub_8bit }
+# CHECK-NEXT:   - { id: 1, class: gr8 }
 registers:
   - { id: 0, class: gpr }
   - { id: 1, class: gpr }
-# CHECK:  body:
-# CHECK:    %1 = COPY %0.sub_8
+# CHECK:          %0 = COPY %rdi
+# CHECK-NEXT:     %1 = COPY %0.sub_8bit
+# CHECK-NEXT:     %al = COPY %1
+# CHECK-NEXT:     RET 0, implicit %al
 body:             |
   bb.1 (%ir-block.0):
     liveins: %rdi
@@ -133,19 +137,20 @@ body:             |
 ...
 ---
 name:            trunc_i64toi16
+# CHECK-LABEL: name:  trunc_i64toi16
 alignment:       4
 legalized:       true
 regBankSelected: true
-selected:        false
-# CHECK-LABEL: name:            trunc_i64toi16
-# CHECK: registers:
-# CHECK-NEXT:  - { id: 0, class: gr64 }
-# CHECK-NEXT:  - { id: 1, class: gr16 }
+# CHECK:      registers:
+# CHECK-NEXT:   - { id: 0, class: gr64 }
+# CHECK-NEXT:   - { id: 1, class: gr16 }
 registers:
   - { id: 0, class: gpr }
   - { id: 1, class: gpr }
-# CHECK:  body:
-# CHECK:    %1 = COPY %0.sub_16
+# CHECK:          %0 = COPY %rdi
+# CHECK-NEXT:     %1 = COPY %0.sub_16bit
+# CHECK-NEXT:     %ax = COPY %1
+# CHECK-NEXT:     RET 0, implicit %ax
 body:             |
   bb.1 (%ir-block.0):
     liveins: %rdi
@@ -158,19 +163,20 @@ body:             |
 ...
 ---
 name:            trunc_i64toi32
+# CHECK-LABEL: name:  trunc_i64toi32
 alignment:       4
 legalized:       true
 regBankSelected: true
-selected:        false
-# CHECK-LABEL: name:            trunc_i64toi32
-# CHECK: registers:
-# CHECK-NEXT:  - { id: 0, class: gr64 }
-# CHECK-NEXT:  - { id: 1, class: gr32 }
+# CHECK:      registers:
+# CHECK-NEXT:   - { id: 0, class: gr64 }
+# CHECK-NEXT:   - { id: 1, class: gr32 }
 registers:
   - { id: 0, class: gpr }
   - { id: 1, class: gpr }
-# CHECK:  body:
-# CHECK:    %1 = COPY %0.sub_32
+# CHECK:          %0 = COPY %rdi
+# CHECK-NEXT:     %1 = COPY %0.sub_32bit
+# CHECK-NEXT:     %eax = COPY %1
+# CHECK-NEXT:     RET 0, implicit %eax
 body:             |
   bb.1 (%ir-block.0):
     liveins: %rdi
index 3b2957793b3ec4f48bd01b3cacffe1299290f1d1..9caf18f0c0c7d3f044e4647acc9569af41d24384 100644 (file)
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=skx -global-isel < %s -o - | FileCheck %s --check-prefix=SKX
+; RUN: llc -mtriple=x86_64-linux-gnu -mcpu=skx -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=SKX
 
 define <16 x i8> @test_sub_v16i8(<16 x i8> %arg1, <16 x i8> %arg2) {
 ; SKX-LABEL: test_sub_v16i8:
index a56fc3b5a87f47711dbecc8843da51aef2c70454..6c0f01673afc0867232888134a07c50184e8ef52 100644 (file)
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu -global-isel < %s -o - | FileCheck %s --check-prefix=CHECK
+; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=CHECK
 
 define i1 @trunc_i32toi1(i32 %a) {
 ; CHECK-LABEL: trunc_i32toi1: