forked from OSchip/llvm-project
[ARM64] Correctly select ANDWri in FastISel.
http://reviews.llvm.org/D3598 llvm-svn: 207917
This commit is contained in:
parent
64425fe875
commit
b0afd1b929
|
@ -577,7 +577,8 @@ bool ARM64FastISel::EmitLoad(MVT VT, unsigned &ResultReg, Address Addr,
|
||||||
|
|
||||||
// Loading an i1 requires special handling.
|
// Loading an i1 requires special handling.
|
||||||
if (VTIsi1) {
|
if (VTIsi1) {
|
||||||
unsigned ANDReg = createResultReg(&ARM64::GPR32RegClass);
|
MRI.constrainRegClass(ResultReg, &ARM64::GPR32RegClass);
|
||||||
|
unsigned ANDReg = createResultReg(&ARM64::GPR32spRegClass);
|
||||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(ARM64::ANDWri),
|
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(ARM64::ANDWri),
|
||||||
ANDReg)
|
ANDReg)
|
||||||
.addReg(ResultReg)
|
.addReg(ResultReg)
|
||||||
|
@ -665,7 +666,8 @@ bool ARM64FastISel::EmitStore(MVT VT, unsigned SrcReg, Address Addr,
|
||||||
|
|
||||||
// Storing an i1 requires special handling.
|
// Storing an i1 requires special handling.
|
||||||
if (VTIsi1) {
|
if (VTIsi1) {
|
||||||
unsigned ANDReg = createResultReg(&ARM64::GPR32RegClass);
|
MRI.constrainRegClass(SrcReg, &ARM64::GPR32RegClass);
|
||||||
|
unsigned ANDReg = createResultReg(&ARM64::GPR32spRegClass);
|
||||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(ARM64::ANDWri),
|
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(ARM64::ANDWri),
|
||||||
ANDReg)
|
ANDReg)
|
||||||
.addReg(SrcReg)
|
.addReg(SrcReg)
|
||||||
|
@ -788,7 +790,8 @@ bool ARM64FastISel::SelectBranch(const Instruction *I) {
|
||||||
CondReg = FastEmitInst_extractsubreg(MVT::i32, CondReg, /*Kill=*/true,
|
CondReg = FastEmitInst_extractsubreg(MVT::i32, CondReg, /*Kill=*/true,
|
||||||
ARM64::sub_32);
|
ARM64::sub_32);
|
||||||
|
|
||||||
unsigned ANDReg = createResultReg(&ARM64::GPR32RegClass);
|
MRI.constrainRegClass(CondReg, &ARM64::GPR32RegClass);
|
||||||
|
unsigned ANDReg = createResultReg(&ARM64::GPR32spRegClass);
|
||||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(ARM64::ANDWri),
|
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(ARM64::ANDWri),
|
||||||
ANDReg)
|
ANDReg)
|
||||||
.addReg(CondReg)
|
.addReg(CondReg)
|
||||||
|
@ -1030,7 +1033,9 @@ bool ARM64FastISel::SelectSelect(const Instruction *I) {
|
||||||
if (FalseReg == 0)
|
if (FalseReg == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
unsigned ANDReg = createResultReg(&ARM64::GPR32RegClass);
|
|
||||||
|
MRI.constrainRegClass(CondReg, &ARM64::GPR32RegClass);
|
||||||
|
unsigned ANDReg = createResultReg(&ARM64::GPR32spRegClass);
|
||||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(ARM64::ANDWri),
|
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(ARM64::ANDWri),
|
||||||
ANDReg)
|
ANDReg)
|
||||||
.addReg(CondReg)
|
.addReg(CondReg)
|
||||||
|
@ -1669,8 +1674,9 @@ bool ARM64FastISel::SelectTrunc(const Instruction *I) {
|
||||||
// Issue an extract_subreg to get the lower 32-bits.
|
// Issue an extract_subreg to get the lower 32-bits.
|
||||||
unsigned Reg32 = FastEmitInst_extractsubreg(MVT::i32, SrcReg, /*Kill=*/true,
|
unsigned Reg32 = FastEmitInst_extractsubreg(MVT::i32, SrcReg, /*Kill=*/true,
|
||||||
ARM64::sub_32);
|
ARM64::sub_32);
|
||||||
|
MRI.constrainRegClass(Reg32, &ARM64::GPR32RegClass);
|
||||||
// Create the AND instruction which performs the actual truncation.
|
// Create the AND instruction which performs the actual truncation.
|
||||||
unsigned ANDReg = createResultReg(&ARM64::GPR32RegClass);
|
unsigned ANDReg = createResultReg(&ARM64::GPR32spRegClass);
|
||||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(ARM64::ANDWri),
|
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(ARM64::ANDWri),
|
||||||
ANDReg)
|
ANDReg)
|
||||||
.addReg(Reg32)
|
.addReg(Reg32)
|
||||||
|
@ -1691,7 +1697,8 @@ unsigned ARM64FastISel::Emiti1Ext(unsigned SrcReg, MVT DestVT, bool isZExt) {
|
||||||
DestVT = MVT::i32;
|
DestVT = MVT::i32;
|
||||||
|
|
||||||
if (isZExt) {
|
if (isZExt) {
|
||||||
unsigned ResultReg = createResultReg(&ARM64::GPR32RegClass);
|
MRI.constrainRegClass(SrcReg, &ARM64::GPR32RegClass);
|
||||||
|
unsigned ResultReg = createResultReg(&ARM64::GPR32spRegClass);
|
||||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(ARM64::ANDWri),
|
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(ARM64::ANDWri),
|
||||||
ResultReg)
|
ResultReg)
|
||||||
.addReg(SrcReg)
|
.addReg(SrcReg)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
; RUN: llc < %s -O0 -fast-isel-abort -mtriple=arm64-apple-darwin | FileCheck %s
|
; RUN: llc < %s -O0 -fast-isel-abort -verify-machineinstrs -mtriple=arm64-apple-darwin | FileCheck %s
|
||||||
|
|
||||||
define zeroext i1 @fcmp_float1(float %a) nounwind ssp {
|
define zeroext i1 @fcmp_float1(float %a) nounwind ssp {
|
||||||
entry:
|
entry:
|
||||||
|
|
Loading…
Reference in New Issue