[llvm] r204427 - This reverts commit r203762, "ARM: support emission of complex SO expressions".

Jiangning Liu jiangning.liu at arm.com
Thu Mar 20 19:51:01 PDT 2014


Author: jiangning
Date: Thu Mar 20 21:51:01 2014
New Revision: 204427

URL: http://llvm.org/viewvc/llvm-project?rev=204427&view=rev
Log:
This reverts commit r203762, "ARM: support emission of complex SO expressions".

The commit r203762 introduced silent failure for complext SO expression, and it's even worse than compiler crash.


Removed:
    llvm/trunk/test/MC/ARM/shift-offset-addressing-emission.s
Modified:
    llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp

Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp?rev=204427&r1=204426&r2=204427&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp Thu Mar 20 21:51:01 2014
@@ -271,20 +271,8 @@ public:
   unsigned getSOImmOpValue(const MCInst &MI, unsigned Op,
                            SmallVectorImpl<MCFixup> &Fixups,
                            const MCSubtargetInfo &STI) const {
-    int SoImmVal = -1;
-
-    const MCOperand &MO = MI.getOperand(Op);
-    if (MO.isImm()) {
-      SoImmVal = ARM_AM::getSOImmVal(MO.getImm());
-    } else if (MO.isExpr()) {
-      int64_t Value;
-      bool Invalid = MO.getExpr()->EvaluateAsAbsolute(Value);
-      (void) Invalid;
-      assert(!Invalid && "non-constant expression is not a valid SOImm operand");
-      assert((Value >= INT32_MIN && Value <= INT32_MAX) &&
-             "expression must be representable in 32 bits");
-      SoImmVal = Value;
-    }
+    unsigned SoImm = MI.getOperand(Op).getImm();
+    int SoImmVal = ARM_AM::getSOImmVal(SoImm);
     assert(SoImmVal != -1 && "Not a valid so_imm value!");
 
     // Encode rotate_imm.

Removed: llvm/trunk/test/MC/ARM/shift-offset-addressing-emission.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/shift-offset-addressing-emission.s?rev=204426&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/shift-offset-addressing-emission.s (original)
+++ llvm/trunk/test/MC/ARM/shift-offset-addressing-emission.s (removed)
@@ -1,9 +0,0 @@
-@ RUN: llvm-mc -triple armv7-elf -filetype obj -o - %s \
-@ RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
-
-	cmp r0, #(.L2 - .L1)
-.L1:
-.L2:
-
-@ CHECK: 0:	cmp	r0, #0
-





More information about the llvm-commits mailing list