[llvm] r215584 - [FastISel][ARM] Use MOVT/MOVW if the subtarget requests it.
Juergen Ributzka
juergen at apple.com
Wed Aug 13 14:42:19 PDT 2014
Author: ributzka
Date: Wed Aug 13 16:42:19 2014
New Revision: 215584
URL: http://llvm.org/viewvc/llvm-project?rev=215584&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
llvm/trunk/test/CodeGen/ARM/fast-isel-mvn.ll
Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=215584&r1=215583&r2=215584&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Wed Aug 13 16:42:19 2014
@@ -546,6 +546,9 @@ unsigned ARMFastISel::ARMMaterializeInt(
}
}
+ if (Subtarget->useMovt(*FuncInfo.MF))
+ return FastEmit_i(VT, VT, ISD::Constant, CI->getZExtValue());
+
// Load from constant pool. For now 32-bit only.
if (VT != MVT::i32)
return false;
Modified: llvm/trunk/test/CodeGen/ARM/fast-isel-mvn.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fast-isel-mvn.ll?rev=215584&r1=215583&r2=215584&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/fast-isel-mvn.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/fast-isel-mvn.ll Wed Aug 13 16:42:19 2014
@@ -1,5 +1,5 @@
-; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
-; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
+; 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
+; 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
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
; rdar://10412592
More information about the llvm-commits
mailing list