[PATCH] D43580: [ARM] FP16 constant pool fix

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 00:20:51 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL325754: [ARM] f16 constant pool fix (authored by SjoerdMeijer, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D43580?vs=135269&id=135367#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D43580

Files:
  llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
  llvm/trunk/test/CodeGen/ARM/constant-islands-cfg.mir
  llvm/trunk/test/CodeGen/ARM/fp16-litpool-arm.mir
  llvm/trunk/test/CodeGen/ARM/fp16-litpool-thumb.mir


Index: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
===================================================================
--- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -1425,10 +1425,6 @@
         assert(!isThumb || getITInstrPredicate(*MI, PredReg) == ARMCC::AL));
 
   NewMBB = splitBlockBeforeInstr(&*MI);
-
-  // 4 byte align the next block after the constant pool when the CPE is a
-  // 16-bit value in ARM mode, and 2 byte for Thumb.
-  NewMBB->setAlignment(isThumb ? 1 : 2);
 }
 
 /// handleConstantPoolUser - Analyze the specified user, checking to see if it
@@ -1489,6 +1485,8 @@
     // We are adding new water.  Update NewWaterList.
     NewWaterList.insert(NewIsland);
   }
+  // Always align the new block because CP entries can be smaller than 4 bytes.
+  NewMBB->setAlignment(isThumb ? 1 : 2);
 
   // Remove the original WaterList entry; we want subsequent insertions in
   // this vicinity to go after the one we're about to insert.  This
Index: llvm/trunk/test/CodeGen/ARM/fp16-litpool-arm.mir
===================================================================
--- llvm/trunk/test/CodeGen/ARM/fp16-litpool-arm.mir
+++ llvm/trunk/test/CodeGen/ARM/fp16-litpool-arm.mir
@@ -1,5 +1,7 @@
 # RUN: llc -mtriple=arm-none-eabi -run-pass=arm-cp-islands %s -o - | FileCheck %s
-
+#
+# This checks alignment of a new block when a big basic block is split up.
+#
 --- |
   ; ModuleID = '<stdin>'
   source_filename = "<stdin>"
Index: llvm/trunk/test/CodeGen/ARM/fp16-litpool-thumb.mir
===================================================================
--- llvm/trunk/test/CodeGen/ARM/fp16-litpool-thumb.mir
+++ llvm/trunk/test/CodeGen/ARM/fp16-litpool-thumb.mir
@@ -1,4 +1,7 @@
 # RUN: llc -mtriple=thumbv7-none-eabi -run-pass=arm-cp-islands %s -o - | FileCheck %s
+#
+# This checks alignment of a new block when a big basic block is split up.
+#
 --- |
   ; ModuleID = '<stdin>'
   source_filename = "<stdin>"
Index: llvm/trunk/test/CodeGen/ARM/constant-islands-cfg.mir
===================================================================
--- llvm/trunk/test/CodeGen/ARM/constant-islands-cfg.mir
+++ llvm/trunk/test/CodeGen/ARM/constant-islands-cfg.mir
@@ -39,7 +39,7 @@
 # CHECK:     successors: %[[LONG_BR_BB:bb.[0-9]+]](0x{{[0-9a-f]+}}), %[[DEST1:bb.[0-9]+]](0x{{[0-9a-f]+}}){{$}}
 # CHECK:     tBcc %[[LONG_BR_BB]], 0, $cpsr
 # CHECK:     tB %[[DEST1]]
-# CHECK: [[LONG_BR_BB]]:
+# CHECK: [[LONG_BR_BB]] (align 1):
 # CHECK:     successors: %[[DEST2:bb.[0-9]+]](0x{{[0-9a-f]+}}){{$}}
 # CHECK:     tB %[[DEST2]]
 # CHECK: [[DEST1]]:
@@ -52,7 +52,7 @@
     tBcc %bb.2, 1, killed $cpsr
     tB %bb.3, 14, $noreg
 
-  bb.1:
+  bb.1 (align 1):
     dead $r0 = SPACE 256, undef $r0
 
   bb.2:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43580.135367.patch
Type: text/x-patch
Size: 2774 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180222/bf65c3e7/attachment.bin>


More information about the llvm-commits mailing list