[PATCH] D39592: [ARM|GlobalISel] : Adding legalizer tests for Thumb

Diana Picus via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 03:05:38 PST 2017


rovka added inline comments.


================
Comment at: test/CodeGen/ARM/GlobalISel/legalize-divmod.mir:5
+# RUN: llc -mtriple arm-linux-gnu -mattr=-hwdiv-arm -global-isel -run-pass=legalizer %s -o - | FileCheck %s  -check-prefixes=CHECK,SOFT,SOFT-DEFAULT
+# RUN: llc -mtriple thumbv7-linux-gnueabi -mattr=+hwdiv-arm -global-isel -run-pass=legalizer %s -o - | FileCheck %s -check-prefixes=CHECK,HWDIV
+# RUN: llc -mtriple thumbv7-linux-gnueabi -mattr=-hwdiv-arm -global-isel -run-pass=legalizer %s -o - | FileCheck %s -check-prefixes=CHECK,SOFT,SOFT-AEABI
----------------
Thumb division is actually controlled by the hwdiv feature, not by hwdiv-arm. The test should expose that behaviour (you'll also need to update the LegalizerInfo code to make it pass, but it's going to be very similar to what already exists for ARM).


================
Comment at: test/CodeGen/ARM/GlobalISel/legalize-divmod.mir:53
+    ; SOFT-DAG: %r1 = COPY [[Y]]
+    ; SOFT-AEABI: BL $__aeabi_idiv, {{.*}}, implicit %r0, implicit %r1, implicit-def %r0
+    ; SOFT-AEABI: [[R:%[0-9]+]]:_(s32) = COPY %r0
----------------
Hmm, this shouldn't be a BL for Thumb. You'll have to update ARMCallLowering to handle Thumb before we can test this properly.


https://reviews.llvm.org/D39592





More information about the llvm-commits mailing list