[llvm] r316420 - [ARM] Remove tCPS alias which just crashed

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 01:55:37 PDT 2017


Author: olista01
Date: Tue Oct 24 01:55:36 2017
New Revision: 316420

URL: http://llvm.org/viewvc/llvm-project?rev=316420&view=rev
Log:
[ARM] Remove tCPS alias which just crashed

This alias caused a crash when trying to print the "cps #0" instruction in a
diagnostic for thumbv6 (which doesn't have that instruction).
	    
The comment was incorrect, this instruction is UNPREDICTABLE if no flag bits
are set, so I don't think it's worth keeping.

Differential Revision: https://reviews.llvm.org/D39191


Modified:
    llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
    llvm/trunk/test/MC/ARM/cps.s

Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb.td?rev=316420&r1=316419&r2=316420&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb.td Tue Oct 24 01:55:36 2017
@@ -1671,13 +1671,6 @@ let isBranch = 1, isTerminator = 1, isBa
 def : InstAlias<"nop", (tMOVr R8, R8, 14, 0), 0>, Requires<[IsThumb, IsThumb1Only]>;
 
 
-// For round-trip assembly/disassembly, we have to handle a CPS instruction
-// without any iflags. That's not, strictly speaking, valid syntax, but it's
-// a useful extension and assembles to defined behaviour (the insn does
-// nothing).
-def : tInstAlias<"cps$imod", (tCPS imod_op:$imod, 0)>;
-def : tInstAlias<"cps$imod", (tCPS imod_op:$imod, 0)>;
-
 // "neg" is and alias for "rsb rd, rn, #0"
 def : tInstAlias<"neg${s}${p} $Rd, $Rm",
                  (tRSB tGPR:$Rd, s_cc_out:$s, tGPR:$Rm, pred:$p)>;

Modified: llvm/trunk/test/MC/ARM/cps.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/cps.s?rev=316420&r1=316419&r2=316420&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/cps.s (original)
+++ llvm/trunk/test/MC/ARM/cps.s Tue Oct 24 01:55:36 2017
@@ -3,6 +3,8 @@
 @ RUN: llvm-mc -triple=thumbv7r--none-eabi -show-encoding < %s | FileCheck %s
 @ RUN: llvm-mc -triple=thumbv8a--none-eabi -show-encoding < %s | FileCheck %s
 @ RUN: not llvm-mc -triple=thumbv7m--none-eabi -show-encoding < %s 2>&1 | FileCheck %s --check-prefix=UNDEF
+@ RUN: not llvm-mc -triple=thumbv6--none-eabi -show-encoding < %s 2>%t | FileCheck %s --check-prefix=V6
+@ RUN: FileCheck %s < %t --check-prefix=V6-ERRORS
 
   cpsie f
   cpsie i, #3
@@ -15,3 +17,15 @@
 @ UNDEF-DAG: cpsie f                         @ encoding: [0x61,0xb6]
 @ UNDEF-DAG: instruction requires:
 @ UNDEF-DAG: error: instruction 'cps' requires effect for M-class
+
+@ V6: cpsie f                         @ encoding: [0x61,0xb6]
+@ V6-ERRORS: error: invalid instruction, any one of the following would fix this:
+@ V6-ERRORS-NEXT: cpsie i, #3
+@ V6-ERRORS: note: instruction requires: thumb2
+@ V6-ERRORS: note: instruction requires: arm-mode
+@ V6-ERRORS: note: too many operands for instruction
+@ V6-ERRORS: error: invalid instruction, any one of the following would fix this:
+@ V6-ERRORS: cps #0
+@ V6-ERRORS: note: too few operands for instruction
+@ V6-ERRORS: note: instruction requires: arm-mode
+@ V6-ERRORS: note: instruction requires: thumb2




More information about the llvm-commits mailing list