Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 0474237

Browse files
committed
[FastISel][ARM] Use MOVT/MOVW if the subtarget requests it.
This change is also in preparation for a future change to make sure that the constant materialization uses MOVT/MOVW when available and not a load from the constant pool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215584 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent c76c3fe commit 0474237

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/Target/ARM/ARMFastISel.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ unsigned ARMFastISel::ARMMaterializeInt(const Constant *C, MVT VT) {
546546
}
547547
}
548548

549+
if (Subtarget->useMovt(*FuncInfo.MF))
550+
return FastEmit_i(VT, VT, ISD::Constant, CI->getZExtValue());
551+
549552
// Load from constant pool. For now 32-bit only.
550553
if (VT != MVT::i32)
551554
return false;

test/CodeGen/ARM/fast-isel-mvn.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
2-
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
1+
; RUN: llc -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -arm-use-movt=false -mtriple=armv7-apple-ios < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ARM
2+
; RUN: llc -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -arm-use-movt=false -mtriple=armv7-linux-gnueabi < %s | FileCheck %s --check-prefix=CHECK --check-prefix=ARM
33
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
44
; rdar://10412592
55

0 commit comments

Comments
 (0)