Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: lib/Target/ARM/ARMFastISel.cpp

Issue 1158303004: Cherry-pick r236569 from upstream (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/CodeGen/ARM/fast-isel-select.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===-- ARMFastISel.cpp - ARM FastISel implementation ---------------------===// 1 //===-- ARMFastISel.cpp - ARM FastISel implementation ---------------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file defines the ARM-specific support for the FastISel class. Some 10 // This file defines the ARM-specific support for the FastISel class. Some
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 UseImm = isThumb2 ? (ARM_AM::getT2SOImmVal(Imm) != -1) : 1665 UseImm = isThumb2 ? (ARM_AM::getT2SOImmVal(Imm) != -1) :
1666 (ARM_AM::getSOImmVal(Imm) != -1); 1666 (ARM_AM::getSOImmVal(Imm) != -1);
1667 } 1667 }
1668 1668
1669 unsigned Op2Reg = 0; 1669 unsigned Op2Reg = 0;
1670 if (!UseImm) { 1670 if (!UseImm) {
1671 Op2Reg = getRegForValue(I->getOperand(2)); 1671 Op2Reg = getRegForValue(I->getOperand(2));
1672 if (Op2Reg == 0) return false; 1672 if (Op2Reg == 0) return false;
1673 } 1673 }
1674 1674
1675 unsigned CmpOpc = isThumb2 ? ARM::t2CMPri : ARM::CMPri; 1675 unsigned TstOpc = isThumb2 ? ARM::t2TSTri : ARM::TSTri;
1676 CondReg = constrainOperandRegClass(TII.get(CmpOpc), CondReg, 0); 1676 CondReg = constrainOperandRegClass(TII.get(TstOpc), CondReg, 0);
1677 AddOptionalDefs( 1677 AddOptionalDefs(
1678 BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(CmpOpc)) 1678 BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(TstOpc))
1679 .addReg(CondReg) 1679 .addReg(CondReg)
1680 .addImm(0)); 1680 .addImm(1));
1681 1681
1682 unsigned MovCCOpc; 1682 unsigned MovCCOpc;
1683 const TargetRegisterClass *RC; 1683 const TargetRegisterClass *RC;
1684 if (!UseImm) { 1684 if (!UseImm) {
1685 RC = isThumb2 ? &ARM::tGPRRegClass : &ARM::GPRRegClass; 1685 RC = isThumb2 ? &ARM::tGPRRegClass : &ARM::GPRRegClass;
1686 MovCCOpc = isThumb2 ? ARM::t2MOVCCr : ARM::MOVCCr; 1686 MovCCOpc = isThumb2 ? ARM::t2MOVCCr : ARM::MOVCCr;
1687 } else { 1687 } else {
1688 RC = isThumb2 ? &ARM::rGPRRegClass : &ARM::GPRRegClass; 1688 RC = isThumb2 ? &ARM::rGPRRegClass : &ARM::GPRRegClass;
1689 if (!isNegativeImm) 1689 if (!isNegativeImm)
1690 MovCCOpc = isThumb2 ? ARM::t2MOVCCi : ARM::MOVCCi; 1690 MovCCOpc = isThumb2 ? ARM::t2MOVCCi : ARM::MOVCCi;
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after
3089 // iOS always has a FP for backtracking, force other targets 3089 // iOS always has a FP for backtracking, force other targets
3090 // to keep their FP when doing FastISel. The emitted code is 3090 // to keep their FP when doing FastISel. The emitted code is
3091 // currently superior, and in cases like test-suite's lencod 3091 // currently superior, and in cases like test-suite's lencod
3092 // FastISel isn't quite correct when FP is eliminated. 3092 // FastISel isn't quite correct when FP is eliminated.
3093 TM.Options.NoFramePointerElim = true; 3093 TM.Options.NoFramePointerElim = true;
3094 return new ARMFastISel(funcInfo, libInfo); 3094 return new ARMFastISel(funcInfo, libInfo);
3095 } 3095 }
3096 return nullptr; 3096 return nullptr;
3097 } 3097 }
3098 } 3098 }
OLDNEW
« no previous file with comments | « no previous file | test/CodeGen/ARM/fast-isel-select.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698