[PATCH] D39808: [ARM GlobalISel] Fix call opcode for Thumb
Diana Picus via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 10 10:04:12 PST 2017
rovka added inline comments.
================
Comment at: lib/Target/ARM/ARMCallLowering.cpp:424
if (Subtarget->isThumb())
- return false;
+ return true;
----------------
This isn't correct, you're returning true as if you had lowered the arguments, but you actually haven't done anything with them. You should remove this check altogether.
================
Comment at: test/CodeGen/ARM/GlobalISel/arm-call-lowering.ll:1
-; RUN: llc -mtriple arm-unknown -mattr=-v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,NOV4T
-; RUN: llc -mtriple arm-unknown -mattr=+v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,V4T
-; RUN: llc -mtriple arm-unknown -mattr=+v5t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,V5T
+; RUN: llc -mtriple arm-unknown -mattr=-v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,DIREC-CALL-ARM,NOV4T
+; RUN: llc -mtriple arm-unknown -mattr=+v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,DIREC-CALL-ARM,V4T
----------------
Typo: DIRECT
Anyway, the "direct" is a property of the code snippet, not of the command line used to run it, so I'm not sure you should include it in the name of the checks. I think what you want here is actually ARM-NOV4T. Similarly below, you can have ARM-V5T and THUMB-V5T.
================
Comment at: test/CodeGen/ARM/GlobalISel/arm-call-lowering.ll:5
+
+; RUN: llc -mtriple thumb-unknown -mattr=+v5t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,V5T,DIRECT-CALL-THUMB,V5T-CALL-THUMB
----------------
You should also test for thumb + v4t.
================
Comment at: test/CodeGen/ARM/GlobalISel/arm-call-lowering.ll:30
+; DIRECT-CALL-THUMB: tBL @call_target, csr_aapcs, implicit-def %lr, implicit %sp
+; CALL-THUMB: BL @call_target, csr_aapcs, implicit-def %lr, implicit %sp
; CHECK: ADJCALLSTACKUP 0, 0, 14, _, implicit-def %sp, implicit %sp
----------------
The CALL-THUMB check seems wrong.
https://reviews.llvm.org/D39808
More information about the llvm-commits
mailing list