From bigcheesegs at gmail.com Mon Oct 11 00:29:15 2010
From: bigcheesegs at gmail.com (Michael J. Spencer)
Date: Mon, 11 Oct 2010 05:29:15 -0000
Subject: [llvm-commits] [llvm] r116188 -
/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Message-ID: <20101011052915.432DD2A6C12E@llvm.org>
Author: mspencer
Date: Mon Oct 11 00:29:15 2010
New Revision: 116188
URL: http://llvm.org/viewvc/llvm-project?rev=116188&view=rev
Log:
X86: Call ulldiv and ftol2 on Windows instead of their libgcc eqivilents.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=116188&r1=116187&r2=116188&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Oct 11 00:29:15 2010
@@ -99,7 +99,11 @@
if (Subtarget->isTargetWindows() && !Subtarget->isTargetCygMing()) {
// Setup Windows compiler runtime calls.
setLibcallName(RTLIB::SDIV_I64, "_alldiv");
+ setLibcallName(RTLIB::UDIV_I64, "_aulldiv");
+ setLibcallName(RTLIB::FPTOUINT_F64_I64, "_ftol2");
setLibcallCallingConv(RTLIB::SDIV_I64, CallingConv::X86_StdCall);
+ setLibcallCallingConv(RTLIB::UDIV_I64, CallingConv::X86_StdCall);
+ setLibcallCallingConv(RTLIB::FPTOUINT_F64_I64, CallingConv::X86_StdCall);
}
if (Subtarget->isTargetDarwin()) {
From sabre at nondot.org Mon Oct 11 00:44:40 2010
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 11 Oct 2010 05:44:40 -0000
Subject: [llvm-commits] [llvm] r116190 - in /llvm/trunk: CMakeLists.txt
cmake/config-ix.cmake cmake/modules/LLVMLibDeps.cmake configure
docs/ReleaseNotes.html include/llvm/MC/MCSection.h
lib/CodeGen/VirtRegRewriter.cpp lib/Target/PIC16/ test/CodeGen/PIC16/
tools/llvmc/examples/Makefile tools/llvmc/examples/mcc16/
utils/GenLibDeps.pl
Message-ID: <20101011054441.2B24C2A6C12E@llvm.org>
Author: lattner
Date: Mon Oct 11 00:44:40 2010
New Revision: 116190
URL: http://llvm.org/viewvc/llvm-project?rev=116190&view=rev
Log:
Per discussion with Sanjiv, remove the PIC16 target from mainline. When/if
it comes back, it will be largely a rewrite, so keeping the old codebase
in tree isn't helping anyone.
Removed:
llvm/trunk/lib/Target/PIC16/
llvm/trunk/test/CodeGen/PIC16/
llvm/trunk/tools/llvmc/examples/mcc16/
Modified:
llvm/trunk/CMakeLists.txt
llvm/trunk/cmake/config-ix.cmake
llvm/trunk/cmake/modules/LLVMLibDeps.cmake
llvm/trunk/configure
llvm/trunk/docs/ReleaseNotes.html
llvm/trunk/include/llvm/MC/MCSection.h
llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp
llvm/trunk/tools/llvmc/examples/Makefile
llvm/trunk/utils/GenLibDeps.pl
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=116190&r1=116189&r2=116190&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Mon Oct 11 00:44:40 2010
@@ -64,7 +64,6 @@
Mips
MBlaze
MSP430
- PIC16
PowerPC
PTX
Sparc
@@ -342,11 +341,6 @@
set(CURRENT_LLVM_TARGET)
endforeach(t)
-# PIC16 contains an odd library:
-if( LLVM_TARGETS_TO_BUILD MATCHES ".*PIC16.*" )
- add_subdirectory(lib/Target/PIC16/PIC16Passes)
-endif()
-
# Produce llvm/Config/AsmPrinters.def
configure_file(
${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmPrinters.def.in
Modified: llvm/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=116190&r1=116189&r2=116190&view=diff
==============================================================================
--- llvm/trunk/cmake/config-ix.cmake (original)
+++ llvm/trunk/cmake/config-ix.cmake Mon Oct 11 00:44:40 2010
@@ -197,8 +197,6 @@
set(LLVM_NATIVE_ARCH ARM)
elseif (LLVM_NATIVE_ARCH MATCHES "mips")
set(LLVM_NATIVE_ARCH Mips)
-elseif (LLVM_NATIVE_ARCH MATCHES "pic16")
- set(LLVM_NATIVE_ARCH "PIC16")
elseif (LLVM_NATIVE_ARCH MATCHES "xcore")
set(LLVM_NATIVE_ARCH XCore)
elseif (LLVM_NATIVE_ARCH MATCHES "msp430")
Modified: llvm/trunk/cmake/modules/LLVMLibDeps.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMLibDeps.cmake?rev=116190&r1=116189&r2=116190&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVMLibDeps.cmake (original)
+++ llvm/trunk/cmake/modules/LLVMLibDeps.cmake Mon Oct 11 00:44:40 2010
@@ -34,7 +34,7 @@
set(MSVC_LIB_DEPS_LLVMMBlazeCodeGen LLVMCodeGen LLVMCore LLVMMBlazeInfo LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
set(MSVC_LIB_DEPS_LLVMMBlazeInfo LLVMSupport)
set(MSVC_LIB_DEPS_LLVMMC LLVMSupport LLVMSystem)
-set(MSVC_LIB_DEPS_LLVMMCDisassembler LLVMARMAsmParser LLVMARMCodeGen LLVMARMDisassembler LLVMARMInfo LLVMAlphaAsmPrinter LLVMAlphaCodeGen LLVMAlphaInfo LLVMBlackfinAsmPrinter LLVMBlackfinCodeGen LLVMBlackfinInfo LLVMCBackend LLVMCBackendInfo LLVMCellSPUAsmPrinter LLVMCellSPUCodeGen LLVMCellSPUInfo LLVMCppBackend LLVMCppBackendInfo LLVMMBlazeAsmPrinter LLVMMBlazeCodeGen LLVMMBlazeInfo LLVMMC LLVMMCParser LLVMMSP430CodeGen LLVMMSP430Info LLVMMipsAsmPrinter LLVMMipsCodeGen LLVMMipsInfo LLVMPIC16AsmPrinter LLVMPIC16CodeGen LLVMPIC16Info LLVMPTXAsmPrinter LLVMPTXCodeGen LLVMPTXInfo LLVMPowerPCAsmPrinter LLVMPowerPCCodeGen LLVMPowerPCInfo LLVMSparcAsmPrinter LLVMSparcCodeGen LLVMSparcInfo LLVMSupport LLVMSystem LLVMSystemZAsmPrinter LLVMSystemZCodeGen LLVMSystemZInfo LLVMX86AsmParser LLVMX86CodeGen LLVMX86Disassembler LLVMX86Info LLVMXCoreAsmPrinter LLVMXCoreCodeGen LLVMXCoreInfo)
+set(MSVC_LIB_DEPS_LLVMMCDisassembler LLVMARMAsmParser LLVMARMCodeGen LLVMARMDisassembler LLVMARMInfo LLVMAlphaAsmPrinter LLVMAlphaCodeGen LLVMAlphaInfo LLVMBlackfinAsmPrinter LLVMBlackfinCodeGen LLVMBlackfinInfo LLVMCBackend LLVMCBackendInfo LLVMCellSPUAsmPrinter LLVMCellSPUCodeGen LLVMCellSPUInfo LLVMCppBackend LLVMCppBackendInfo LLVMMBlazeAsmPrinter LLVMMBlazeCodeGen LLVMMBlazeInfo LLVMMC LLVMMCParser LLVMMSP430CodeGen LLVMMSP430Info LLVMMipsAsmPrinter LLVMMipsCodeGen LLVMMipsInfo LLVMPTXAsmPrinter LLVMPTXCodeGen LLVMPTXInfo LLVMPowerPCAsmPrinter LLVMPowerPCCodeGen LLVMPowerPCInfo LLVMSparcAsmPrinter LLVMSparcCodeGen LLVMSparcInfo LLVMSupport LLVMSystem LLVMSystemZAsmPrinter LLVMSystemZCodeGen LLVMSystemZInfo LLVMX86AsmParser LLVMX86CodeGen LLVMX86Disassembler LLVMX86Info LLVMXCoreAsmPrinter LLVMXCoreCodeGen LLVMXCoreInfo)
set(MSVC_LIB_DEPS_LLVMMCParser LLVMMC LLVMSupport)
set(MSVC_LIB_DEPS_LLVMMSP430AsmPrinter LLVMMC LLVMSupport)
set(MSVC_LIB_DEPS_LLVMMSP430CodeGen LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMSP430AsmPrinter LLVMMSP430Info LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
@@ -42,10 +42,6 @@
set(MSVC_LIB_DEPS_LLVMMipsAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMipsCodeGen LLVMMipsInfo LLVMSupport LLVMTarget)
set(MSVC_LIB_DEPS_LLVMMipsCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMMipsInfo LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
set(MSVC_LIB_DEPS_LLVMMipsInfo LLVMSupport)
-set(MSVC_LIB_DEPS_LLVMPIC16AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPIC16CodeGen LLVMPIC16Info LLVMSupport LLVMTarget)
-set(MSVC_LIB_DEPS_LLVMPIC16CodeGen LLVMAnalysis LLVMCodeGen LLVMCore LLVMMC LLVMPIC16Info LLVMSelectionDAG LLVMSupport LLVMTarget)
-set(MSVC_LIB_DEPS_LLVMPIC16Info LLVMSupport)
-set(MSVC_LIB_DEPS_LLVMPIC16Passes LLVMCore LLVMSupport LLVMSystem LLVMTransformUtils LLVMipa)
set(MSVC_LIB_DEPS_LLVMPTXAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMPTXCodeGen LLVMPTXInfo LLVMSupport)
set(MSVC_LIB_DEPS_LLVMPTXCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMPTXInfo LLVMSelectionDAG LLVMSupport LLVMTarget)
set(MSVC_LIB_DEPS_LLVMPTXInfo LLVMSupport)
Modified: llvm/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=116190&r1=116189&r2=116190&view=diff
==============================================================================
--- llvm/trunk/configure (original)
+++ llvm/trunk/configure Mon Oct 11 00:44:40 2010
@@ -2356,7 +2356,6 @@
alpha*-*) llvm_cv_target_arch="Alpha" ;;
arm*-*) llvm_cv_target_arch="ARM" ;;
mips-*) llvm_cv_target_arch="Mips" ;;
- pic16-*) llvm_cv_target_arch="PIC16" ;;
xcore-*) llvm_cv_target_arch="XCore" ;;
msp430-*) llvm_cv_target_arch="MSP430" ;;
s390x-*) llvm_cv_target_arch="SystemZ" ;;
@@ -4818,8 +4817,6 @@
;;
Mips) TARGET_HAS_JIT=0
;;
- PIC16) TARGET_HAS_JIT=0
- ;;
XCore) TARGET_HAS_JIT=0
;;
MSP430) TARGET_HAS_JIT=0
@@ -4959,7 +4956,7 @@
enableval=host
fi
case "$enableval" in
- all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend CppBackend MBlaze PTX" ;;
+ all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha ARM Mips CellSPU XCore MSP430 SystemZ Blackfin CBackend CppBackend MBlaze PTX" ;;
*)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
case "$a_target" in
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
@@ -4970,7 +4967,6 @@
arm) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
spu) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;;
- pic16) TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;;
xcore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;;
msp430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;;
systemz) TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;;
@@ -4989,7 +4985,6 @@
Mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
MBlaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
CellSPU|SPU) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;;
- PIC16) TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;;
XCore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;;
MSP430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;;
s390x) TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;;
Modified: llvm/trunk/docs/ReleaseNotes.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=116190&r1=116189&r2=116190&view=diff
==============================================================================
--- llvm/trunk/docs/ReleaseNotes.html (original)
+++ llvm/trunk/docs/ReleaseNotes.html Mon Oct 11 00:44:40 2010
@@ -1103,7 +1103,7 @@
href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVMdev list.
-- The Alpha, Blackfin, CellSPU, MicroBlaze, MSP430, MIPS, PIC16, SystemZ
+
- The Alpha, Blackfin, CellSPU, MicroBlaze, MSP430, MIPS, SystemZ
and XCore backends are experimental.
- llc "-filetype=obj" is experimental on all targets
other than darwin-i386 and darwin-x86_64.
Modified: llvm/trunk/include/llvm/MC/MCSection.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSection.h?rev=116190&r1=116189&r2=116190&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSection.h (original)
+++ llvm/trunk/include/llvm/MC/MCSection.h Mon Oct 11 00:44:40 2010
@@ -32,8 +32,7 @@
enum SectionVariant {
SV_COFF = 0,
SV_ELF,
- SV_MachO,
- SV_PIC16
+ SV_MachO
};
private:
Modified: llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp?rev=116190&r1=116189&r2=116190&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp Mon Oct 11 00:44:40 2010
@@ -297,7 +297,7 @@
const TargetLowering *TL = MF.getTarget().getTargetLowering();
if (!TL->isTypeLegal(TL->getPointerTy()))
- // Believe it or not, this is true on PIC16.
+ // Believe it or not, this is true on 16-bit targets like PIC16.
return InsertLoc;
const TargetRegisterClass *ptrRegClass =
Modified: llvm/trunk/tools/llvmc/examples/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/examples/Makefile?rev=116190&r1=116189&r2=116190&view=diff
==============================================================================
--- llvm/trunk/tools/llvmc/examples/Makefile (original)
+++ llvm/trunk/tools/llvmc/examples/Makefile Mon Oct 11 00:44:40 2010
@@ -9,6 +9,6 @@
LEVEL=../../..
-PARALLEL_DIRS := Hello Simple mcc16 Skeleton
+PARALLEL_DIRS := Hello Simple Skeleton
include $(LEVEL)/Makefile.common
Modified: llvm/trunk/utils/GenLibDeps.pl
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/GenLibDeps.pl?rev=116190&r1=116189&r2=116190&view=diff
==============================================================================
--- llvm/trunk/utils/GenLibDeps.pl (original)
+++ llvm/trunk/utils/GenLibDeps.pl Mon Oct 11 00:44:40 2010
@@ -107,7 +107,6 @@
$libpath =~ s/^TransformUtils/Transforms\/Utils/;
$libpath =~ s/^ipa/Analysis\/IPA/;
$libpath =~ s/^ipo/Transforms\/IPO/;
- $libpath =~ s/^pic16passes/Target\/PIC16\/PIC16Passes/;
$libpath = "lib/".$libpath."/";
open DEFS, "$nmPath -sg $Directory/$lib|";
while () {
@@ -150,7 +149,6 @@
$libpath =~ s/^TransformUtils/Transforms\/Utils/;
$libpath =~ s/^ipa/Analysis\/IPA/;
$libpath =~ s/^ipo/Transforms\/IPO/;
- $libpath =~ s/^pic16passes/Target\/PIC16\/PIC16Passes/;
$libpath = "lib/".$libpath."/";
open UDEFS, "$nmPath -Aup $Directory/$lib|";
while () {
From sabre at nondot.org Mon Oct 11 00:48:00 2010
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 11 Oct 2010 05:48:00 -0000
Subject: [llvm-commits] [llvm] r116192 -
/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
Message-ID: <20101011054800.9679F2A6C12E@llvm.org>
Author: lattner
Date: Mon Oct 11 00:48:00 2010
New Revision: 116192
URL: http://llvm.org/viewvc/llvm-project?rev=116192&view=rev
Log:
tweak comment.
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=116192&r1=116191&r2=116192&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Mon Oct 11 00:48:00 2010
@@ -92,8 +92,8 @@
/// IsLegalToFold - Returns true if the specific operand node N of
/// U can be folded during instruction selection that starts at Root.
- /// FIXME: This is a static member function because the PIC16 target,
- /// which uses it during lowering.
+ /// FIXME: This is a static member function because the MSP430/SystemZ/X86
+ /// targets, which uses it during isel. This could become a proper member.
static bool IsLegalToFold(SDValue N, SDNode *U, SDNode *Root,
CodeGenOpt::Level OptLevel,
bool IgnoreChains = false);
From sabre at nondot.org Mon Oct 11 00:49:47 2010
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 11 Oct 2010 05:49:47 -0000
Subject: [llvm-commits] [www] r116193 - /www/trunk/Features.html
Message-ID: <20101011054947.D0AE62A6C12E@llvm.org>
Author: lattner
Date: Mon Oct 11 00:49:47 2010
New Revision: 116193
URL: http://llvm.org/viewvc/llvm-project?rev=116193&view=rev
Log:
target removed.
Modified:
www/trunk/Features.html
Modified: www/trunk/Features.html
URL: http://llvm.org/viewvc/llvm-project/www/trunk/Features.html?rev=116193&r1=116192&r2=116193&view=diff
==============================================================================
--- www/trunk/Features.html (original)
+++ www/trunk/Features.html Mon Oct 11 00:49:47 2010
@@ -26,7 +26,7 @@
optimizations.
- An easily retargettable code generator, which currently supports X86,
- X86-64, PowerPC, PowerPC-64, ARM, Thumb, SPARC, Alpha, CellSPU, PIC16
+ X86-64, PowerPC, PowerPC-64, ARM, Thumb, SPARC, Alpha, CellSPU,
MIPS, MSP430, SystemZ, and XCore.
- A Just-In-Time (JIT) code generation system, which currently supports
From echristo at apple.com Mon Oct 11 03:27:59 2010
From: echristo at apple.com (Eric Christopher)
Date: Mon, 11 Oct 2010 08:27:59 -0000
Subject: [llvm-commits] [llvm] r116194 -
/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Message-ID: <20101011082759.2ED6C2A6C12E@llvm.org>
Author: echristo
Date: Mon Oct 11 03:27:59 2010
New Revision: 116194
URL: http://llvm.org/viewvc/llvm-project?rev=116194&view=rev
Log:
Implement select handling for ARM fast-isel.
Modified:
llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=116194&r1=116193&r2=116194&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Oct 11 03:27:59 2010
@@ -128,6 +128,7 @@
virtual bool SelectFPToSI(const Instruction *I);
virtual bool SelectSDiv(const Instruction *I);
virtual bool SelectCall(const Instruction *I);
+ virtual bool SelectSelect(const Instruction *I);
// Utility routines.
private:
@@ -1063,6 +1064,34 @@
return true;
}
+bool ARMFastISel::SelectSelect(const Instruction *I) {
+ EVT VT = TLI.getValueType(I->getType(), /*HandleUnknown=*/true);
+ if (VT == MVT::Other || !isTypeLegal(I->getType(), VT))
+ return false;
+
+ // Things need to be register sized for register moves.
+ if (VT.getSimpleVT().SimpleTy != MVT::i32) return false;
+ const TargetRegisterClass *RC = TLI.getRegClassFor(VT);
+
+ unsigned CondReg = getRegForValue(I->getOperand(0));
+ if (CondReg == 0) return false;
+ unsigned Op1Reg = getRegForValue(I->getOperand(1));
+ if (Op1Reg == 0) return false;
+ unsigned Op2Reg = getRegForValue(I->getOperand(2));
+ if (Op2Reg == 0) return false;
+
+ unsigned CmpOpc = isThumb ? ARM::t2TSTri : ARM::TSTri;
+ AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CmpOpc))
+ .addReg(CondReg).addImm(1));
+ unsigned ResultReg = createResultReg(RC);
+ unsigned MovCCOpc = isThumb ? ARM::t2MOVCCr : ARM::MOVCCr;
+ BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(MovCCOpc), ResultReg)
+ .addReg(Op1Reg).addReg(Op2Reg)
+ .addImm(ARMCC::EQ).addReg(ARM::CPSR);
+ UpdateValueMap(I, ResultReg);
+ return true;
+}
+
bool ARMFastISel::SelectSDiv(const Instruction *I) {
EVT VT;
const Type *Ty = I->getType();
@@ -1490,6 +1519,8 @@
return SelectSDiv(I);
case Instruction::Call:
return SelectCall(I);
+ case Instruction::Select:
+ return SelectSelect(I);
default: break;
}
return false;
From echristo at apple.com Mon Oct 11 03:31:54 2010
From: echristo at apple.com (Eric Christopher)
Date: Mon, 11 Oct 2010 08:31:54 -0000
Subject: [llvm-commits] [llvm] r116195 -
/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Message-ID: <20101011083154.AAF592A6C12E@llvm.org>
Author: echristo
Date: Mon Oct 11 03:31:54 2010
New Revision: 116195
URL: http://llvm.org/viewvc/llvm-project?rev=116195&view=rev
Log:
Add i8 sdiv support for ARM fast isel.
Modified:
llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=116195&r1=116194&r2=116195&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Oct 11 03:31:54 2010
@@ -1105,7 +1105,9 @@
// Otherwise emit a libcall.
RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
- if (VT == MVT::i16)
+ if (VT == MVT::i8)
+ LC = RTLIB::SDIV_I8;
+ else if (VT == MVT::i16)
LC = RTLIB::SDIV_I16;
else if (VT == MVT::i32)
LC = RTLIB::SDIV_I32;
From echristo at apple.com Mon Oct 11 03:37:26 2010
From: echristo at apple.com (Eric Christopher)
Date: Mon, 11 Oct 2010 08:37:26 -0000
Subject: [llvm-commits] [llvm] r116196 -
/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Message-ID: <20101011083726.9494A2A6C12E@llvm.org>
Author: echristo
Date: Mon Oct 11 03:37:26 2010
New Revision: 116196
URL: http://llvm.org/viewvc/llvm-project?rev=116196&view=rev
Log:
Add srem libcall support to ARM fast isel.
Modified:
llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=116196&r1=116195&r2=116196&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Oct 11 03:37:26 2010
@@ -127,6 +127,7 @@
virtual bool SelectSIToFP(const Instruction *I);
virtual bool SelectFPToSI(const Instruction *I);
virtual bool SelectSDiv(const Instruction *I);
+ virtual bool SelectSRem(const Instruction *I);
virtual bool SelectCall(const Instruction *I);
virtual bool SelectSelect(const Instruction *I);
@@ -1120,6 +1121,28 @@
return ARMEmitLibcall(I, LC);
}
+bool ARMFastISel::SelectSRem(const Instruction *I) {
+ EVT VT;
+ const Type *Ty = I->getType();
+ if (!isTypeLegal(Ty, VT))
+ return false;
+
+ RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
+ if (VT == MVT::i8)
+ LC = RTLIB::SREM_I8;
+ else if (VT == MVT::i16)
+ LC = RTLIB::SREM_I16;
+ else if (VT == MVT::i32)
+ LC = RTLIB::SREM_I32;
+ else if (VT == MVT::i64)
+ LC = RTLIB::SREM_I64;
+ else if (VT == MVT::i128)
+ LC = RTLIB::SREM_I128;
+ assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported SDIV!");
+
+ return ARMEmitLibcall(I, LC);
+}
+
bool ARMFastISel::SelectBinaryOp(const Instruction *I, unsigned ISDOpcode) {
EVT VT = TLI.getValueType(I->getType(), true);
@@ -1519,6 +1542,8 @@
return SelectBinaryOp(I, ISD::FMUL);
case Instruction::SDiv:
return SelectSDiv(I);
+ case Instruction::SRem:
+ return SelectSRem(I);
case Instruction::Call:
return SelectCall(I);
case Instruction::Select:
From echristo at apple.com Mon Oct 11 03:38:55 2010
From: echristo at apple.com (Eric Christopher)
Date: Mon, 11 Oct 2010 08:38:55 -0000
Subject: [llvm-commits] [llvm] r116197 -
/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Message-ID: <20101011083855.9F03E2A6C12E@llvm.org>
Author: echristo
Date: Mon Oct 11 03:38:55 2010
New Revision: 116197
URL: http://llvm.org/viewvc/llvm-project?rev=116197&view=rev
Log:
Whitespace cleanup in ARM fast isel.
Modified:
llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=116197&r1=116196&r2=116197&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Oct 11 03:38:55 2010
@@ -149,7 +149,7 @@
// Call handling routines.
private:
CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool Return);
- bool ProcessCallArgs(SmallVectorImpl &Args,
+ bool ProcessCallArgs(SmallVectorImpl &Args,
SmallVectorImpl &ArgRegs,
SmallVectorImpl &ArgVTs,
SmallVectorImpl &ArgFlags,
@@ -365,7 +365,7 @@
// checks from the various callers.
unsigned ARMFastISel::ARMMoveToFPReg(EVT VT, unsigned SrcReg) {
if (VT.getSimpleVT().SimpleTy == MVT::f64) return 0;
-
+
unsigned MoveReg = createResultReg(TLI.getRegClassFor(VT));
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(ARM::VMOVRS), MoveReg)
@@ -375,7 +375,7 @@
unsigned ARMFastISel::ARMMoveToIntReg(EVT VT, unsigned SrcReg) {
if (VT.getSimpleVT().SimpleTy == MVT::i64) return 0;
-
+
unsigned MoveReg = createResultReg(TLI.getRegClassFor(VT));
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(ARM::VMOVSR), MoveReg)
@@ -400,10 +400,10 @@
.addFPImm(CFP));
return DestReg;
}
-
+
// Require VFP2 for loading fp constants.
if (!Subtarget->hasVFP2()) return false;
-
+
// MachineConstantPool wants an explicit alignment.
unsigned Align = TD.getPrefTypeAlignment(CFP->getType());
if (Align == 0) {
@@ -413,7 +413,7 @@
unsigned Idx = MCP.getConstantPoolIndex(cast(CFP), Align);
unsigned DestReg = createResultReg(TLI.getRegClassFor(VT));
unsigned Opc = is64bit ? ARM::VLDRD : ARM::VLDRS;
-
+
// The extra reg is for addrmode5.
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(Opc),
DestReg)
@@ -423,10 +423,10 @@
}
unsigned ARMFastISel::ARMMaterializeInt(const Constant *C, EVT VT) {
-
+
// For now 32-bit only.
if (VT.getSimpleVT().SimpleTy != MVT::i32) return false;
-
+
// MachineConstantPool wants an explicit alignment.
unsigned Align = TD.getPrefTypeAlignment(C->getType());
if (Align == 0) {
@@ -435,7 +435,7 @@
}
unsigned Idx = MCP.getConstantPoolIndex(C, Align);
unsigned DestReg = createResultReg(TLI.getRegClassFor(VT));
-
+
if (isThumb)
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(ARM::t2LDRpci), DestReg)
@@ -453,29 +453,29 @@
unsigned ARMFastISel::ARMMaterializeGV(const GlobalValue *GV, EVT VT) {
// For now 32-bit only.
if (VT.getSimpleVT().SimpleTy != MVT::i32) return 0;
-
+
Reloc::Model RelocM = TM.getRelocationModel();
-
+
// TODO: No external globals for now.
if (Subtarget->GVIsIndirectSymbol(GV, RelocM)) return 0;
-
+
// TODO: Need more magic for ARM PIC.
if (!isThumb && (RelocM == Reloc::PIC_)) return 0;
-
+
// MachineConstantPool wants an explicit alignment.
unsigned Align = TD.getPrefTypeAlignment(GV->getType());
if (Align == 0) {
// TODO: Figure out if this is correct.
Align = TD.getTypeAllocSize(GV->getType());
}
-
+
// Grab index.
unsigned PCAdj = (RelocM != Reloc::PIC_) ? 0 : (Subtarget->isThumb() ? 4 : 8);
unsigned Id = AFI->createConstPoolEntryUId();
ARMConstantPoolValue *CPV = new ARMConstantPoolValue(GV, Id,
ARMCP::CPValue, PCAdj);
unsigned Idx = MCP.getConstantPoolIndex(CPV, Align);
-
+
// Load value.
MachineInstrBuilder MIB;
unsigned DestReg = createResultReg(TLI.getRegClassFor(VT));
@@ -508,17 +508,17 @@
return ARMMaterializeGV(GV, VT);
else if (isa(C))
return ARMMaterializeInt(C, VT);
-
+
return 0;
}
unsigned ARMFastISel::TargetMaterializeAlloca(const AllocaInst *AI) {
// Don't handle dynamic allocas.
if (!FuncInfo.StaticAllocaMap.count(AI)) return 0;
-
+
EVT VT;
if (!isTypeLegal(AI->getType(), VT)) return false;
-
+
DenseMap::iterator SI =
FuncInfo.StaticAllocaMap.find(AI);
@@ -534,7 +534,7 @@
.addImm(0));
return ResultReg;
}
-
+
return 0;
}
@@ -694,7 +694,7 @@
// For now with the additions above the offset should be zero - thus we
// can always fit into an i8.
assert(Offset == 0 && "Offset not zero!");
-
+
// The thumb and floating point instructions both take 2 operands, ARM takes
// another register.
if (isFloat || isThumb)
@@ -829,7 +829,7 @@
switch (Pred) {
// Needs two compares...
case CmpInst::FCMP_ONE:
- case CmpInst::FCMP_UEQ:
+ case CmpInst::FCMP_UEQ:
default:
assert(false && "Unhandled CmpInst::Predicate!");
return ARMCC::AL;
@@ -858,7 +858,7 @@
return ARMCC::PL;
case CmpInst::ICMP_SLT:
case CmpInst::FCMP_ULT:
- return ARMCC::LT;
+ return ARMCC::LT;
case CmpInst::ICMP_SLE:
case CmpInst::FCMP_ULE:
return ARMCC::LE;
@@ -886,13 +886,13 @@
unsigned CmpOpc = isThumb ? ARM::t2CMPri : ARM::CMPri;
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CmpOpc))
.addReg(CondReg).addImm(1));
-
+
unsigned BrOpc = isThumb ? ARM::t2Bcc : ARM::Bcc;
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(BrOpc))
.addMBB(TBB).addImm(ARMCC::EQ).addReg(ARM::CPSR);
FastEmitBranch(FBB, DL);
FuncInfo.MBB->addSuccessor(TBB);
- return true;
+ return true;
}
bool ARMFastISel::SelectCmp(const Instruction *I) {
@@ -928,7 +928,7 @@
// Get the compare predicate.
ARMCC::CondCodes ARMPred = getComparePred(CI->getPredicate());
-
+
// We may not handle every CC for now.
if (ARMPred == ARMCC::AL) return false;
@@ -950,10 +950,10 @@
// Now set a register based on the comparison. Explicitly set the predicates
// here.
unsigned MovCCOpc = isThumb ? ARM::t2MOVCCi : ARM::MOVCCi;
- TargetRegisterClass *RC = isThumb ? ARM::rGPRRegisterClass
+ TargetRegisterClass *RC = isThumb ? ARM::rGPRRegisterClass
: ARM::GPRRegisterClass;
unsigned DestReg = createResultReg(RC);
- Constant *Zero
+ Constant *Zero
= ConstantInt::get(Type::getInt32Ty(*Context), 0);
unsigned ZeroReg = TargetMaterializeConstant(Zero);
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(MovCCOpc), DestReg)
@@ -1005,25 +1005,25 @@
bool ARMFastISel::SelectSIToFP(const Instruction *I) {
// Make sure we have VFP.
if (!Subtarget->hasVFP2()) return false;
-
+
EVT DstVT;
const Type *Ty = I->getType();
if (!isTypeLegal(Ty, DstVT))
return false;
-
+
unsigned Op = getRegForValue(I->getOperand(0));
if (Op == 0) return false;
-
+
// The conversion routine works on fp-reg to fp-reg and the operand above
// was an integer, move it to the fp registers if possible.
unsigned FP = ARMMoveToFPReg(MVT::f32, Op);
if (FP == 0) return false;
-
+
unsigned Opc;
if (Ty->isFloatTy()) Opc = ARM::VSITOS;
else if (Ty->isDoubleTy()) Opc = ARM::VSITOD;
else return 0;
-
+
unsigned ResultReg = createResultReg(TLI.getRegClassFor(DstVT));
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(Opc),
ResultReg)
@@ -1035,32 +1035,32 @@
bool ARMFastISel::SelectFPToSI(const Instruction *I) {
// Make sure we have VFP.
if (!Subtarget->hasVFP2()) return false;
-
+
EVT DstVT;
const Type *RetTy = I->getType();
if (!isTypeLegal(RetTy, DstVT))
return false;
-
+
unsigned Op = getRegForValue(I->getOperand(0));
if (Op == 0) return false;
-
+
unsigned Opc;
const Type *OpTy = I->getOperand(0)->getType();
if (OpTy->isFloatTy()) Opc = ARM::VTOSIZS;
else if (OpTy->isDoubleTy()) Opc = ARM::VTOSIZD;
else return 0;
-
+
// f64->s32 or f32->s32 both need an intermediate f32 reg.
unsigned ResultReg = createResultReg(TLI.getRegClassFor(MVT::f32));
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(Opc),
ResultReg)
.addReg(Op));
-
+
// This result needs to be in an integer register, but the conversion only
// takes place in fp-regs.
unsigned IntReg = ARMMoveToIntReg(DstVT, ResultReg);
if (IntReg == 0) return false;
-
+
UpdateValueMap(I, IntReg);
return true;
}
@@ -1102,8 +1102,8 @@
// If we have integer div support we should have selected this automagically.
// In case we have a real miss go ahead and return false and we'll pick
// it up later.
- if (Subtarget->hasDivide()) return false;
-
+ if (Subtarget->hasDivide()) return false;
+
// Otherwise emit a libcall.
RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
if (VT == MVT::i8)
@@ -1117,7 +1117,7 @@
else if (VT == MVT::i128)
LC = RTLIB::SDIV_I128;
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported SDIV!");
-
+
return ARMEmitLibcall(I, LC);
}
@@ -1257,7 +1257,7 @@
return false;
}
}
-
+
return true;
}
@@ -1285,20 +1285,20 @@
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY),
Copy1).addReg(RVLocs[0].getLocReg());
UsedRegs.push_back(RVLocs[0].getLocReg());
-
+
unsigned Copy2 = createResultReg(CopyRC);
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY),
Copy2).addReg(RVLocs[1].getLocReg());
UsedRegs.push_back(RVLocs[1].getLocReg());
-
+
EVT DestVT = RVLocs[0].getValVT();
TargetRegisterClass* DstRC = TLI.getRegClassFor(DestVT);
unsigned ResultReg = createResultReg(DstRC);
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(ARM::VMOVDRR), ResultReg)
.addReg(Copy1).addReg(Copy2));
-
- // Finally update the result.
+
+ // Finally update the result.
UpdateValueMap(I, ResultReg);
} else {
assert(RVLocs.size() == 1 && "Can't handle non-double multi-reg retvals!");
@@ -1310,24 +1310,24 @@
ResultReg).addReg(RVLocs[0].getLocReg());
UsedRegs.push_back(RVLocs[0].getLocReg());
- // Finally update the result.
+ // Finally update the result.
UpdateValueMap(I, ResultReg);
}
}
- return true;
+ return true;
}
// A quick function that will emit a call for a named libcall in F with the
// vector of passed arguments for the Instruction in I. We can assume that we
-// can emit a call for any libcall we can produce. This is an abridged version
-// of the full call infrastructure since we won't need to worry about things
+// can emit a call for any libcall we can produce. This is an abridged version
+// of the full call infrastructure since we won't need to worry about things
// like computed function pointers or strange arguments at call sites.
// TODO: Try to unify this and the normal call bits for ARM, then try to unify
// with X86.
bool ARMFastISel::ARMEmitLibcall(const Instruction *I, RTLIB::Libcall Call) {
CallingConv::ID CC = TLI.getLibcallCallingConv(Call);
-
+
// Handle *simple* calls for now.
const Type *RetTy = I->getType();
EVT RetVT;
@@ -1335,10 +1335,10 @@
RetVT = MVT::isVoid;
else if (!isTypeLegal(RetTy, RetVT))
return false;
-
+
// For now we're using BLX etc on the assumption that we have v5t ops.
if (!Subtarget->hasV5TOps()) return false;
-
+
// Set up the argument vectors.
SmallVector Args;
SmallVector ArgRegs;
@@ -1352,29 +1352,29 @@
Value *Op = I->getOperand(i);
unsigned Arg = getRegForValue(Op);
if (Arg == 0) return false;
-
+
const Type *ArgTy = Op->getType();
EVT ArgVT;
if (!isTypeLegal(ArgTy, ArgVT)) return false;
-
+
ISD::ArgFlagsTy Flags;
unsigned OriginalAlignment = TD.getABITypeAlignment(ArgTy);
Flags.setOrigAlign(OriginalAlignment);
-
+
Args.push_back(Op);
ArgRegs.push_back(Arg);
ArgVTs.push_back(ArgVT);
ArgFlags.push_back(Flags);
}
-
+
// Handle the arguments now that we've gotten them.
SmallVector RegArgs;
unsigned NumBytes;
if (!ProcessCallArgs(Args, ArgRegs, ArgVTs, ArgFlags, RegArgs, CC, NumBytes))
return false;
-
+
// Issue the call, BLXr9 for darwin, BLX otherwise. This uses V5 ops.
- // TODO: Turn this into the table of arm call ops.
+ // TODO: Turn this into the table of arm call ops.
MachineInstrBuilder MIB;
unsigned CallOpc;
if(isThumb)
@@ -1383,18 +1383,18 @@
CallOpc = Subtarget->isTargetDarwin() ? ARM::BLr9 : ARM::BL;
MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CallOpc))
.addExternalSymbol(TLI.getLibcallName(Call));
-
+
// Add implicit physical register uses to the call.
for (unsigned i = 0, e = RegArgs.size(); i != e; ++i)
MIB.addReg(RegArgs[i]);
-
+
// Finish off the call including any return values.
- SmallVector UsedRegs;
+ SmallVector UsedRegs;
if (!FinishCall(RetVT, UsedRegs, I, CC, NumBytes)) return false;
-
+
// Set all unused physreg defs as dead.
static_cast(MIB)->setPhysRegsDeadExcept(UsedRegs, TRI);
-
+
return true;
}
@@ -1409,7 +1409,7 @@
const GlobalValue *GV = dyn_cast(Callee);
if (!GV || Subtarget->GVIsIndirectSymbol(GV, TM.getRelocationModel()))
return false;
-
+
// Check the calling convention.
ImmutableCallSite CS(CI);
CallingConv::ID CC = CS.getCallingConv();
@@ -1418,13 +1418,13 @@
// errs() << "Can't handle calling convention: " << CC << "\n";
return false;
}
-
+
// Let SDISel handle vararg functions.
const PointerType *PT = cast(CS.getCalledValue()->getType());
const FunctionType *FTy = cast(PT->getElementType());
if (FTy->isVarArg())
return false;
-
+
// Handle *simple* calls for now.
const Type *RetTy = I->getType();
EVT RetVT;
@@ -1432,11 +1432,11 @@
RetVT = MVT::isVoid;
else if (!isTypeLegal(RetTy, RetVT))
return false;
-
+
// For now we're using BLX etc on the assumption that we have v5t ops.
// TODO: Maybe?
if (!Subtarget->hasV5TOps()) return false;
-
+
// Set up the argument vectors.
SmallVector Args;
SmallVector ArgRegs;
@@ -1449,7 +1449,7 @@
for (ImmutableCallSite::arg_iterator i = CS.arg_begin(), e = CS.arg_end();
i != e; ++i) {
unsigned Arg = getRegForValue(*i);
-
+
if (Arg == 0)
return false;
ISD::ArgFlagsTy Flags;
@@ -1472,21 +1472,21 @@
return false;
unsigned OriginalAlignment = TD.getABITypeAlignment(ArgTy);
Flags.setOrigAlign(OriginalAlignment);
-
+
Args.push_back(*i);
ArgRegs.push_back(Arg);
ArgVTs.push_back(ArgVT);
ArgFlags.push_back(Flags);
}
-
+
// Handle the arguments now that we've gotten them.
SmallVector RegArgs;
unsigned NumBytes;
if (!ProcessCallArgs(Args, ArgRegs, ArgVTs, ArgFlags, RegArgs, CC, NumBytes))
return false;
-
+
// Issue the call, BLXr9 for darwin, BLX otherwise. This uses V5 ops.
- // TODO: Turn this into the table of arm call ops.
+ // TODO: Turn this into the table of arm call ops.
MachineInstrBuilder MIB;
unsigned CallOpc;
if(isThumb)
@@ -1495,20 +1495,20 @@
CallOpc = Subtarget->isTargetDarwin() ? ARM::BLr9 : ARM::BL;
MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CallOpc))
.addGlobalAddress(GV, 0, 0);
-
+
// Add implicit physical register uses to the call.
for (unsigned i = 0, e = RegArgs.size(); i != e; ++i)
MIB.addReg(RegArgs[i]);
-
+
// Finish off the call including any return values.
- SmallVector UsedRegs;
+ SmallVector UsedRegs;
if (!FinishCall(RetVT, UsedRegs, I, CC, NumBytes)) return false;
-
+
// Set all unused physreg defs as dead.
static_cast(MIB)->setPhysRegsDeadExcept(UsedRegs, TRI);
-
+
return true;
-
+
}
// TODO: SoftFP support.
From echristo at apple.com Mon Oct 11 03:40:06 2010
From: echristo at apple.com (Eric Christopher)
Date: Mon, 11 Oct 2010 08:40:06 -0000
Subject: [llvm-commits] [llvm] r116198 -
/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Message-ID: <20101011084006.1E2F92A6C12E@llvm.org>
Author: echristo
Date: Mon Oct 11 03:40:05 2010
New Revision: 116198
URL: http://llvm.org/viewvc/llvm-project?rev=116198&view=rev
Log:
Copy and pasteo.
Modified:
llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=116198&r1=116197&r2=116198&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Oct 11 03:40:05 2010
@@ -1138,7 +1138,7 @@
LC = RTLIB::SREM_I64;
else if (VT == MVT::i128)
LC = RTLIB::SREM_I128;
- assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported SDIV!");
+ assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported SREM!");
return ARMEmitLibcall(I, LC);
}
From anton at korobeynikov.info Mon Oct 11 04:35:12 2010
From: anton at korobeynikov.info (Anton Korobeynikov)
Date: Mon, 11 Oct 2010 13:35:12 +0400
Subject: [llvm-commits] [Review request] Tweak section names of linkonce
on PECOFF
In-Reply-To:
References:
Message-ID:
Hello Takumi,
> W/O this, linking against gcc/libstdc++ must fail.
It doesn't seem for me. E.g. llvm-gcc-built Qt linked w/o any problems.
Could you please indicate the version of binutils you're using? And
the error message you're seeing?
--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University
From pichet2000 at gmail.com Mon Oct 11 06:36:19 2010
From: pichet2000 at gmail.com (Francois Pichet)
Date: Mon, 11 Oct 2010 11:36:19 -0000
Subject: [llvm-commits] [llvm] r116201 -
/llvm/trunk/lib/Target/ARM/Disassembler/CMakeLists.txt
Message-ID: <20101011113619.365B72A6C12E@llvm.org>
Author: fpichet
Date: Mon Oct 11 06:36:19 2010
New Revision: 116201
URL: http://llvm.org/viewvc/llvm-project?rev=116201&view=rev
Log:
MSVC hangs on compilation of ARMDisassembler.cpp. PR6866 applied to ARM target.
Modified:
llvm/trunk/lib/Target/ARM/Disassembler/CMakeLists.txt
Modified: llvm/trunk/lib/Target/ARM/Disassembler/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/CMakeLists.txt?rev=116201&r1=116200&r2=116201&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/CMakeLists.txt (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/CMakeLists.txt Mon Oct 11 06:36:19 2010
@@ -4,5 +4,11 @@
ARMDisassembler.cpp
ARMDisassemblerCore.cpp
)
-
+# workaround for hanging compilation on MSVC9 and 10
+if( MSVC_VERSION EQUAL 1500 OR MSVC_VERSION EQUAL 1600 )
+set_property(
+ SOURCE ARMDisassembler.cpp
+ PROPERTY COMPILE_FLAGS "/Od"
+ )
+endif()
add_dependencies(LLVMARMDisassembler ARMCodeGenTable_gen)
From geek4civic at gmail.com Mon Oct 11 06:45:52 2010
From: geek4civic at gmail.com (NAKAMURA Takumi)
Date: Mon, 11 Oct 2010 20:45:52 +0900
Subject: [llvm-commits] [Review request] Tweak section names of linkonce
on PECOFF
In-Reply-To:
References:
Message-ID:
Good evening, Anton!
I have checked llvm-gcc42-2.8/mingw.
It seems llvm-g++/mingw has its own libstdc++ itself.
It has sections named ".text$linkonce_{mangled}" and marked as
LINK_ONCE_SAME_CONTENTS.
libstdc++, in My distro, msysgit, has sections " .text${mangled}" and
maked as LINK_ONCE_DISCARD.
(FYI, also in Cygwin)
It would be not a matter as far as we provide and ship libstdc++
compiled by llvm-gcc.
I don't know which would be *the right way*, but we should provide our
libstdc++ with clang++ in future ;)
(it should be "llvm-libcxx!")
..Takumi
2010/10/11 Anton Korobeynikov :
> Hello Takumi,
>
>> W/O this, linking against gcc/libstdc++ must fail.
> It doesn't seem for me. E.g. llvm-gcc-built Qt linked w/o any problems.
> Could you please indicate the version of binutils you're using? And
> the error message you're seeing?
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>
-------------- next part --------------
msysgit $ gcc -v
Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.4.0/configure --prefix=/mingw --build=mingw32 --enable-languages=c,ada,c++,fortran,objc,obj-c++ --disable-nls --disable-win32-registry --disable-werror --enable-threads --disable-ymvers --enable-cxx-flags='-fno-function-sections -fno-data-sections' --enable-fully-dynamic-string --enable-libgomp --enable-version-specific-runtime-libs --enable-sjlj-exceptions --with-pkgversion='TDM-1 mingw32' --with-bugurl=http://www.tdragon.net/recentgcc/bugs.php
Thread model: win32
gcc version 4.4.0 (TDM-1 mingw32)
msysgit $ ld --version
GNU ld (GNU Binutils) 2.19.1
cygwin-1.7 $ ld --version
GNU ld (GNU Binutils) 2.20.51.20100410
$(STAGE1)/Release+Asserts/bin/clang++.exe -I$(STAGE2)/include -I$(STAGE2)/utils/FileCheck -I$(LLVM)/include -I$(LLVM)/utils/FileCheck -DNDEBUG -D__NO_CTYPE_INLINE -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2 -fomit-frame-pointer -fno-exceptions -fno-rtti -Woverloaded-virtual -Wcast-qual -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -O2 -L$(STAGE2)/Release/lib -L$(STAGE2)/Release/lib -o $(STAGE2)/Release/bin/FileCheck.exe $(STAGE2)/utils/FileCheck/Release/FileCheck.o -lLLVMSupport -lLLVMSystem -lpthread -lpsapi -limagehlp -lm
c:/msysgit/mingw/bin/../lib/gcc/mingw32/4.4.0/libstdc++.a(string-inst.o):string-inst.cc:(.text$_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_[std::basic_string, std::allocator > std::operator+, std::allocator >(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)]+0x0): multiple definition of `std::basic_string, std::allocator > std::operator+, std::allocator >(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)'
$(STAGE2)/Release/lib/libLLVMSystem.a(Program.o):fake:(.text$linkonce__ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_+0x0): first defined here
c:/msysgit/mingw/bin/../lib/gcc/mingw32/4.4.0/libstdc++.a(string-inst.o):string-inst.cc:(.text$_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_[std::basic_string, std::allocator > std::operator+, std::allocator >(char const*, std::basic_string, std::allocator > const&)]+0x0): multiple definition of `std::basic_string, std::allocator > std::operator+, std::allocator >(char const*, std::basic_string, std::allocator > const&)'
$(STAGE2)/Release/lib/libLLVMSystem.a(Path.o):fake:(.text$linkonce__ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_+0x0): first defined here
collect2: ld returned 1 exit status
clang++: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
make[2]: *** [$(STAGE2)/Release/bin/FileCheck.exe] Error 1
make[2]: Leaving directory `$(STAGE2)/utils/FileCheck'
make[1]: *** [FileCheck/.makeall] Error 2
make[1]: Leaving directory `$(STAGE2)/utils'
From pdox at google.com Mon Oct 11 09:28:05 2010
From: pdox at google.com (David Meyer)
Date: Mon, 11 Oct 2010 07:28:05 -0700
Subject: [llvm-commits] PATCH: llvm-gcc option to emit "va_arg" instruction
Message-ID:
Hello LLVM,
Attached is a patch to add the option "-fuse-llvm-va-arg" to llvm-gcc. The
default behavior remains unchanged.
When this option is passed, invocations of __builtin_va_arg always emit the
LLVM va_arg instruction instead of being lowered to target-specific
operations.
Visual diff is available at: http://codereview.chromium.org/3694002/show
The code in this patch was originally provided by Alan Donovan of Google,
with contributions from Rafael Espindola and myself.
Thank you,
David M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101011/6f83281d/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-gcc-va-arg.patch
Type: application/octet-stream
Size: 5622 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101011/6f83281d/attachment.obj
From pdox at google.com Mon Oct 11 09:44:21 2010
From: pdox at google.com (David Meyer)
Date: Mon, 11 Oct 2010 07:44:21 -0700
Subject: [llvm-commits] PATCH: llvm-gcc option to emit "va_arg"
instruction
In-Reply-To:
References:
Message-ID:
I discovered I was missing some #ifdef's.
New patch is attached.
Updated visual at: http://codereview.chromium.org/3694002/show
- David M
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101011/d874b93f/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-gcc-va-arg-2.patch
Type: application/octet-stream
Size: 5753 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101011/d874b93f/attachment.obj
From pdox at google.com Mon Oct 11 10:13:30 2010
From: pdox at google.com (David Meyer)
Date: Mon, 11 Oct 2010 08:13:30 -0700
Subject: [llvm-commits] [patch] va_arg for X86-64
In-Reply-To:
References:
Message-ID:
Dan,
Thanks for taking a look.
Grepping for in the testsuite and running the tests
> that finds would be good.
I just submitted separately (to llvm-commits) a patch for llvm-gcc which
adds the option -fuse-llvm-va-arg. This causes llvm-gcc to always use the
va_arg instruction. I will also submit a patch to Clang for the same thing
when the first patch goes in.
It seems reasonable that I should add a new pass to the test-suite which
runs the va_arg() tests with -fuse-llvm-va-arg enabled. Would you prefer I
make that change and add it to this patch, or should I submit those
separately?
> > 3) Whether the default expansion of VAARG is actually suitable for Win64.
> > 4) Whether Darwin and Cygwin follow the same ABI.
>
> Darwin does (in this area). I don't know about Cygwin or Win64.
>
Just to be on the safe side, do you think I should leave an assertion in
place if va_arg is invoked for Cygwin, Win64, or MinGW?
(this isn't any worse than the current code state. Right now it asserts for
all x86-64 targets)
>
> > --- lib/Target/X86/X86ISelLowering.cpp (revision 115912)
> > +++ lib/Target/X86/X86ISelLowering.cpp (working copy)
>
> > - getPointerTy());
> > + MVT::i64);
>
> Is there any special significance to these edits, or are they just
> simplifications?
>
These snuck in, they are not critical for this patch. But there is some
significance. I'm working on Native Client code generation at Google,
which has the unusual condition that is64Bit() == true and
getPointerTy() == MVT::i32. This change was needed to keep the
va_list structure from changing.
(Eventually the entire Native Client target patch will be sent up, but for
now, I am starting with the general features, e.g., va_arg)
Would it be better if I removed it from this change?
> > + if (ArgVT == MVT::f64 || ArgVT == MVT::f128) {
>
> This should also check for f32. Even though f32 can't happen from
> C, it can happen in LLVM IR. Also, this code should check for the
> various XMM vector types -- v4f32 and friends.
>
> Also, this code shouldn't check for f128, since that type isn't
> legal on x86-64.
>
I will add f32.
The gcc on my system supports __float128, and it passes this value using xmm
registers.
I'm not sure what standard this is part of (GNU?), but is there any harm in
supporting it ?
>
> > + // Add the offset to the reg_save_area to get the final address.
> > + BuildMI(offsetMBB, DL, TII->get(X86::ADD64rr), OffsetDestReg)
> > + .addReg(RegSaveReg)
> > + .addReg(OffsetReg64);
>
> Since this is RegSaveReg's last use, it'd be slightly nicer to swap it
> and OffsetReg64 here, to save TwoAddressLowering the trouble.
>
I'm not sure I understand what you mean here. Are you suggesting this
instead?
BuildMI(offsetMBB, DL, TII->get(X86::ADD64rr), OffsetDestReg)
.addReg(OffsetReg64)
.addReg(RegSaveReg);
Thanks,
- David M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101011/e9258454/attachment.html
From criswell at uiuc.edu Mon Oct 11 10:44:10 2010
From: criswell at uiuc.edu (John Criswell)
Date: Mon, 11 Oct 2010 15:44:10 -0000
Subject: [llvm-commits] [poolalloc] r116204 -
/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
Message-ID: <20101011154410.396462A6C12E@llvm.org>
Author: criswell
Date: Mon Oct 11 10:44:10 2010
New Revision: 116204
URL: http://llvm.org/viewvc/llvm-project?rev=116204&view=rev
Log:
Record global pool descriptors for all DSNodes and not just for heap DSNodes.
This fixes a problem in SAFECode where stack objects weren't being registered
in their global pools properly.
Modified:
poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=116204&r1=116203&r2=116204&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Mon Oct 11 10:44:10 2010
@@ -1070,14 +1070,14 @@
// If the local DSNode was assigned a global pool, update the pool
// descriptors for the function
- if (N->isHeapNode() && GlobalNodes[N]) {
+ if (GlobalNodes[N]) {
FI.PoolDescriptors[N] = GlobalNodes[N];
}
// If a corresponding global DSNode was assigned a global pool, update the
// pool descriptors for the function
DSNode * GGN = GlobalsGraphNodeMapping[N].getNode();
- if (GGN && GGN->isHeapNode() && GlobalNodes[GGN]) {
+ if (GGN && GlobalNodes[GGN]) {
FI.PoolDescriptors[N] = GlobalNodes[GGN];
}
}
From grosbach at apple.com Mon Oct 11 11:20:30 2010
From: grosbach at apple.com (Jim Grosbach)
Date: Mon, 11 Oct 2010 09:20:30 -0700
Subject: [llvm-commits] Proof of concept patch for unifying the .s/ELF
emission of .ARM.attributes
In-Reply-To:
References:
<6D9C9A6C-872A-494D-A5F6-2523DD4CA5B6@apple.com>
Message-ID: <8FD08C3F-E6E1-448B-A384-7E5CF0763EC1@apple.com>
Hi Jason,
Glad to see this making progress. Here's a bit of general feedback. I'm not an expert on Linux ELF, so I can't really comment on that aspect of things, though.
> namespace ARMBuildAttrs {
> enum AttrType {
> + // For the .cpu asm construct
> + ARM_CPU,
> + // Rest correspond to ELF/.ARM.attributes
> File = 1,
> Section = 2,
> Symbol = 3,
Is this new attr distinct from the ones already there for the CPU? CPU_name, in particular, seems a likely candidate. It's hard to tell since the uses of the others don't appear to be implemented yet. In any case, if a new attr does need to be added, it should be consistent with the rest of them. No prefix, and just add the value onto the end (i.e., "Cpu = 71") of the list.
> +void ARMAsmPrinter::emitTextAttribute(ARMBuildAttrs::AttrType attr,
> + StringRef val) {
> + if (attr != ARMBuildAttrs::ARM_CPU) {
> + return;
> + }
> + if (OutStreamer.hasRawTextSupport()) {
> + if (val != "generic") {
> + OutStreamer.EmitRawText("\t.cpu " + val);
> + }
> + } else {
> + // FIXME: ELF
> + }
> +}
Since this looks like it'll be fleshed out to handle the other attributes as well, just make it a switch statement. That's more consistent with the rest of the LLVM codebase. Something like:
switch (attr) {
default:
assert(0 && "Unimplemented build attribute!");
break;
case ARMBuildAttrs::ARM_CPU: {
...
}
}
Regards,
Jim
On Oct 7, 2010, at 8:54 PM, Jason Kim wrote:
> Second set of ARM/MC/ELF changes.
>
> Added ARM specific ELF section types.
> Added AttributesSection to ARMElfTargetObject
> First step in unifying .cpu assembly tag with ELF/.o
> llc now asserts on actual ELF emission on -filetype=obj :-)
>
> Feedback, please!
>
> Thanks for reading!
>
> -Jason
>
From baldrick at free.fr Mon Oct 11 12:35:18 2010
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 11 Oct 2010 17:35:18 -0000
Subject: [llvm-commits] [dragonegg] r116208 - /dragonegg/trunk/Makefile
Message-ID: <20101011173518.84F352A6C12E@llvm.org>
Author: baldrick
Date: Mon Oct 11 12:35:18 2010
New Revision: 116208
URL: http://llvm.org/viewvc/llvm-project?rev=116208&view=rev
Log:
Remove -Wextra since it produces tons of warnings coming from LLVM
headers when LLVM is built in Release mode.
Modified:
dragonegg/trunk/Makefile
Modified: dragonegg/trunk/Makefile
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/Makefile?rev=116208&r1=116207&r2=116208&view=diff
==============================================================================
--- dragonegg/trunk/Makefile (original)
+++ dragonegg/trunk/Makefile Mon Oct 11 12:35:18 2010
@@ -17,7 +17,7 @@
QUIET:=@
endif
-COMMON_FLAGS=-Wall -Wextra -fvisibility=hidden
+COMMON_FLAGS=-Wall -fvisibility=hidden
CFLAGS+=$(COMMON_FLAGS) $(shell $(LLVM_CONFIG) --cflags)
CXXFLAGS+=$(COMMON_FLAGS) $(shell $(LLVM_CONFIG) --cxxflags)
From jasonwkim at google.com Mon Oct 11 12:39:12 2010
From: jasonwkim at google.com (Jason Kim)
Date: Mon, 11 Oct 2010 10:39:12 -0700
Subject: [llvm-commits] Proof of concept patch for unifying the .s/ELF
emission of .ARM.attributes
In-Reply-To: <8FD08C3F-E6E1-448B-A384-7E5CF0763EC1@apple.com>
References:
<6D9C9A6C-872A-494D-A5F6-2523DD4CA5B6@apple.com>
<8FD08C3F-E6E1-448B-A384-7E5CF0763EC1@apple.com>
Message-ID:
On Mon, Oct 11, 2010 at 9:20 AM, Jim Grosbach wrote:
> Hi Jason,
>
> Glad to see this making progress. Here's a bit of general feedback. I'm not an expert on Linux ELF, so I can't really comment on that aspect of things, though.
>
>> ?namespace ARMBuildAttrs {
>> ? ?enum AttrType {
>> + ? ?// For the .cpu asm construct
>> + ? ?ARM_CPU,
>> + ? ?// Rest correspond to ELF/.ARM.attributes
>> ? ? ?File ? ? ? ? ? ? ? ? ? ? ?= 1,
>> ? ? ?Section ? ? ? ? ? ? ? ? ? = 2,
>> ? ? ?Symbol ? ? ? ? ? ? ? ? ? ?= 3,
>
>
> Is this new attr distinct from the ones already there for the CPU? CPU_name, in particular, seems a likely candidate. It's hard to tell since the uses of the others don't appear to be implemented yet. In any case, if a new attr does need to be added, it should be consistent with the rest of them. No prefix, and just add the value onto the end (i.e., "Cpu = 71") of the list.
All of the other enums in the ARMBuildAttrs are specific part of (i.e.
can appear as markers in) the .ARM.attributes section.
The new one I added correspond to the .cpu asm attr, which translates
into one or more sequence of CPU_NAME, CPU_ARCH ... in the actual ELF
section, so I needed a way to get that done.
There is no neat correspondence between the asm attrs and what goes
into the .ARM.attributes. Certainly not for the .cpu attribute (its
one to many)
>
>> +void ARMAsmPrinter::emitTextAttribute(ARMBuildAttrs::AttrType attr,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?StringRef val) {
>> + ?if (attr != ARMBuildAttrs::ARM_CPU) {
>> + ? ?return;
>> + ?}
>> + ?if (OutStreamer.hasRawTextSupport()) {
>> + ? ?if (val != "generic") {
>> + ? ? ?OutStreamer.EmitRawText("\t.cpu " + val);
>> + ? ?}
>> + ?} else {
>> + ? ?// FIXME: ELF
>> + ?}
>> +}
>
>
> Since this looks like it'll be fleshed out to handle the other attributes as well, just make it a switch statement. That's more consistent with the rest of the LLVM codebase. Something like:
>
> switch (attr) {
> default:
> ?assert(0 && "Unimplemented build attribute!");
> ?break;
> case ARMBuildAttrs::ARM_CPU: {
> ?...
> }
> }
Hokay, at least this part I can do for the others (but prolly not
worth while for the new ARM_CPU tag.)
I'll make the special case transition clear and resend patch.
Thanks!
p.s. I have another patch waiting for this to land - I will be adding
just enough to get a basic two instruction function (thanks for new
scaffolding on EncodeInstuction() Jim!) output as ELF .o, and be
somewhat sane -
i.e. ARM/MC/ELF hello world ("misspelled, and broken" but at least it
will be a start. :-)
>
> Regards,
>
> ?Jim
>
>
>
> On Oct 7, 2010, at 8:54 PM, Jason Kim wrote:
>
>> Second set of ARM/MC/ELF changes.
>>
>> Added ARM specific ELF section types.
>> Added AttributesSection to ARMElfTargetObject
>> First step in unifying .cpu assembly tag with ELF/.o
>> llc now asserts on actual ELF emission on -filetype=obj :-)
>>
>> Feedback, please!
>>
>> Thanks for reading!
>>
>> -Jason
>>
>
>
From sabre at nondot.org Mon Oct 11 12:44:22 2010
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 11 Oct 2010 17:44:22 -0000
Subject: [llvm-commits] [llvm] r116209 -
/llvm/trunk/include/llvm-c/Transforms/Scalar.h
Message-ID: <20101011174422.673EB2A6C12E@llvm.org>
Author: lattner
Date: Mon Oct 11 12:44:22 2010
New Revision: 116209
URL: http://llvm.org/viewvc/llvm-project?rev=116209&view=rev
Log:
remove dead prototype, PR8351
Modified:
llvm/trunk/include/llvm-c/Transforms/Scalar.h
Modified: llvm/trunk/include/llvm-c/Transforms/Scalar.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Transforms/Scalar.h?rev=116209&r1=116208&r2=116209&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Transforms/Scalar.h (original)
+++ llvm/trunk/include/llvm-c/Transforms/Scalar.h Mon Oct 11 12:44:22 2010
@@ -52,9 +52,6 @@
/** See llvm::createLoopDeletionPass function. */
void LLVMAddLoopDeletionPass(LLVMPassManagerRef PM);
-/** See llvm::createLoopIndexSplitPass function. */
-void LLVMAddLoopIndexSplitPass(LLVMPassManagerRef PM);
-
/** See llvm::createLoopRotatePass function. */
void LLVMAddLoopRotatePass(LLVMPassManagerRef PM);
From stoklund at 2pi.dk Mon Oct 11 13:10:36 2010
From: stoklund at 2pi.dk (Jakob Stoklund Olesen)
Date: Mon, 11 Oct 2010 18:10:36 -0000
Subject: [llvm-commits] [llvm] r116210 -
/llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp
Message-ID: <20101011181036.C74672A6C12E@llvm.org>
Author: stoklund
Date: Mon Oct 11 13:10:36 2010
New Revision: 116210
URL: http://llvm.org/viewvc/llvm-project?rev=116210&view=rev
Log:
Properly handle reloading and spilling around partial redefines in
LocalRewriter.
This is a bit of a hack that adds an implicit use operand to model the
read-modify-write nature of a partial redef. Uses and defs are rewritten in
separate passes, and a single operand would never be processed twice.
Modified:
llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp
Modified: llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp?rev=116210&r1=116209&r2=116210&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp Mon Oct 11 13:10:36 2010
@@ -1894,6 +1894,20 @@
VirtUseOps.insert(VirtUseOps.begin(), i);
else
VirtUseOps.push_back(i);
+
+ // A partial def causes problems because the same operand both reads and
+ // writes the register. This rewriter is designed to rewrite uses and defs
+ // separately, so a partial def would already have been rewritten to a
+ // physreg by the time we get to processing defs.
+ // Add an implicit use operand to model the partial def.
+ if (MO.isDef() && MO.getSubReg() && MI.readsVirtualRegister(VirtReg) &&
+ MI.findRegisterUseOperandIdx(VirtReg) == -1) {
+ VirtUseOps.insert(VirtUseOps.begin(), MI.getNumOperands());
+ MI.addOperand(MachineOperand::CreateReg(VirtReg,
+ false, // isDef
+ true)); // isImplicit
+ DEBUG(dbgs() << "Partial redef: " << MI);
+ }
}
// Process all of the spilled uses and all non spilled reg references.
From grosbach at apple.com Mon Oct 11 13:25:51 2010
From: grosbach at apple.com (Jim Grosbach)
Date: Mon, 11 Oct 2010 18:25:51 -0000
Subject: [llvm-commits] [llvm] r116211 - in /llvm/trunk/utils/TableGen:
CodeEmitterGen.cpp CodeGenInstruction.cpp CodeGenInstruction.h
Message-ID: <20101011182551.385FB2A6C12E@llvm.org>
Author: grosbach
Date: Mon Oct 11 13:25:51 2010
New Revision: 116211
URL: http://llvm.org/viewvc/llvm-project?rev=116211&view=rev
Log:
When figuring out which operands match which encoding fields in an instruction,
try to match them by name first. If there is no by-name match, fall back to
assuming they are in order (this was the previous behavior).
Modified:
llvm/trunk/utils/TableGen/CodeEmitterGen.cpp
llvm/trunk/utils/TableGen/CodeGenInstruction.cpp
llvm/trunk/utils/TableGen/CodeGenInstruction.h
Modified: llvm/trunk/utils/TableGen/CodeEmitterGen.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeEmitterGen.cpp?rev=116211&r1=116210&r2=116211&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeEmitterGen.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeEmitterGen.cpp Mon Oct 11 13:25:51 2010
@@ -128,7 +128,7 @@
// Loop over all of the fields in the instruction, determining which are the
// operands to the instruction.
- unsigned op = 0;
+ unsigned NumberedOp = 0;
for (unsigned i = 0, e = Vals.size(); i != e; ++i) {
if (!Vals[i].getPrefix() && !Vals[i].getValue()->isComplete()) {
// Is the operand continuous? If so, we can just mask and OR it in
@@ -154,14 +154,25 @@
}
if (!gotOp) {
- /// If this operand is not supposed to be emitted by the generated
- /// emitter, skip it.
- while (CGI.isFlatOperandNotEmitted(op))
- ++op;
+
+ // If the operand matches by name, reference according to that
+ // operand number. Non-matching operands are assumed to be in
+ // order.
+ unsigned OpIdx;
+ if (CGI.hasOperandNamed(VarName, OpIdx)) {
+ assert (!CGI.isFlatOperandNotEmitted(OpIdx) &&
+ "Explicitly used operand also marked as not emitted!");
+ } else {
+ /// If this operand is not supposed to be emitted by the
+ /// generated emitter, skip it.
+ while (CGI.isFlatOperandNotEmitted(NumberedOp))
+ ++NumberedOp;
+ OpIdx = NumberedOp++;
+ }
Case += " // op: " + VarName + "\n"
+ " op = getMachineOpValue(MI, MI.getOperand("
- + utostr(op++) + "));\n";
+ + utostr(OpIdx) + "));\n";
gotOp = true;
}
Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.cpp?rev=116211&r1=116210&r2=116211&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenInstruction.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenInstruction.cpp Mon Oct 11 13:25:51 2010
@@ -234,13 +234,26 @@
/// specified name, throw an exception.
///
unsigned CodeGenInstruction::getOperandNamed(const std::string &Name) const {
- assert(!Name.empty() && "Cannot search for operand with no name!");
- for (unsigned i = 0, e = OperandList.size(); i != e; ++i)
- if (OperandList[i].Name == Name) return i;
+ unsigned OpIdx;
+ if (hasOperandNamed(Name, OpIdx)) return OpIdx;
throw "Instruction '" + TheDef->getName() +
"' does not have an operand named '$" + Name + "'!";
}
+/// hasOperandNamed - Query whether the instruction has an operand of the
+/// given name. If so, return true and set OpIdx to the index of the
+/// operand. Otherwise, return false.
+bool CodeGenInstruction::hasOperandNamed(const std::string &Name,
+ unsigned &OpIdx) const {
+ assert(!Name.empty() && "Cannot search for operand with no name!");
+ for (unsigned i = 0, e = OperandList.size(); i != e; ++i)
+ if (OperandList[i].Name == Name) {
+ OpIdx = i;
+ return true;
+ }
+ return false;
+}
+
std::pair
CodeGenInstruction::ParseOperandName(const std::string &Op,
bool AllowWholeOp) {
Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.h?rev=116211&r1=116210&r2=116211&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenInstruction.h (original)
+++ llvm/trunk/utils/TableGen/CodeGenInstruction.h Mon Oct 11 13:25:51 2010
@@ -186,6 +186,11 @@
/// specified name, throw an exception.
unsigned getOperandNamed(const std::string &Name) const;
+ /// hasOperandNamed - Query whether the instruction has an operand of the
+ /// given name. If so, return true and set OpIdx to the index of the
+ /// operand. Otherwise, return false.
+ bool hasOperandNamed(const std::string &Name, unsigned &OpIdx) const;
+
/// HasOneImplicitDefWithKnownVT - If the instruction has at least one
/// implicit def and it has a known VT, return the VT, otherwise return
/// MVT::Other.
From jasonwkim at google.com Mon Oct 11 13:28:46 2010
From: jasonwkim at google.com (Jason Kim)
Date: Mon, 11 Oct 2010 11:28:46 -0700
Subject: [llvm-commits] Proof of concept patch for unifying the .s/ELF
emission of .ARM.attributes
In-Reply-To:
References:
<6D9C9A6C-872A-494D-A5F6-2523DD4CA5B6@apple.com>
<8FD08C3F-E6E1-448B-A384-7E5CF0763EC1@apple.com>
Message-ID:
Hi everyone, please find enclosed updated version of arm-mc-elf-s05.patch.
On Mon, Oct 11, 2010 at 10:39 AM, Jason Kim wrote:
> On Mon, Oct 11, 2010 at 9:20 AM, Jim Grosbach wrote:
>> Hi Jason,
>>
>> Glad to see this making progress. Here's a bit of general feedback. I'm not an expert on Linux ELF, so I can't really comment on that aspect of things, though.
>>
>>> ?namespace ARMBuildAttrs {
>>> ? ?enum AttrType {
>>> + ? ?// For the .cpu asm construct
>>> + ? ?ARM_CPU,
>>> + ? ?// Rest correspond to ELF/.ARM.attributes
>>> ? ? ?File ? ? ? ? ? ? ? ? ? ? ?= 1,
>>> ? ? ?Section ? ? ? ? ? ? ? ? ? = 2,
>>> ? ? ?Symbol ? ? ? ? ? ? ? ? ? ?= 3,
>>
>>
>> Is this new attr distinct from the ones already there for the CPU? CPU_name, in particular, seems a likely candidate. It's hard to tell since the uses of the others don't appear to be implemented yet. In any case, if a new attr does need to be added, it should be consistent with the rest of them. No prefix, and just add the value onto the end (i.e., "Cpu = 71") of the list.
>
> All of the other enums in the ARMBuildAttrs are specific part of (i.e.
> can appear as markers in) the .ARM.attributes section.
> The new one I added correspond to the .cpu asm attr, which translates
> into one or more sequence of CPU_NAME, CPU_ARCH ... in the actual ELF
> section, so I needed a way to get that done.
> There is no neat correspondence between the asm attrs and what goes
> into the .ARM.attributes. Certainly not for the .cpu attribute (its
> one to many)
>
Jim, it turns out that the bulk of the attr emission is driven by a
bunch of bool flags from TargetMachine.
The individual ARMBuildAttrs::AttrType flags are not selected individually,
so there wasn't a real use for the llvm style switch except for the
new flag I added. (please see new comments in patch)
>
> p.s. I have another patch waiting for this to land - I will be adding
> just enough to get a basic two instruction function (thanks for new
> scaffolding on EncodeInstuction() ?Jim!) ?output as ELF .o, and be
> somewhat sane -
> i.e. ARM/MC/ELF hello world ("misspelled, and broken" but at least it
> will be a start. :-)
>
>
>>
>> Regards,
>>
>> ?Jim
>>
>>
>>
>> On Oct 7, 2010, at 8:54 PM, Jason Kim wrote:
>>
>>> Second set of ARM/MC/ELF changes.
>>>
>>> Added ARM specific ELF section types.
>>> Added AttributesSection to ARMElfTargetObject
>>> First step in unifying .cpu assembly tag with ELF/.o
>>> llc now asserts on actual ELF emission on -filetype=obj :-)
>>>
>>> Feedback, please!
>>>
>>> Thanks for reading!
>>>
>>> -Jason
>>>
>>
>>
>
Unless there is strong objection, I'd like to land this patch soon
(today if possible).
Thanks for reading!!
-jason
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm-mc-elf-s05.patch2
Type: application/octet-stream
Size: 6322 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101011/91c68cb0/attachment.obj
From jasonwkim at google.com Mon Oct 11 13:28:46 2010
From: jasonwkim at google.com (Jason Kim)
Date: Mon, 11 Oct 2010 11:28:46 -0700
Subject: [llvm-commits] Proof of concept patch for unifying the .s/ELF
emission of .ARM.attributes
In-Reply-To:
References:
<6D9C9A6C-872A-494D-A5F6-2523DD4CA5B6@apple.com>
<8FD08C3F-E6E1-448B-A384-7E5CF0763EC1@apple.com>
Message-ID:
Hi everyone, please find enclosed updated version of arm-mc-elf-s05.patch.
On Mon, Oct 11, 2010 at 10:39 AM, Jason Kim wrote:
> On Mon, Oct 11, 2010 at 9:20 AM, Jim Grosbach wrote:
>> Hi Jason,
>>
>> Glad to see this making progress. Here's a bit of general feedback. I'm not an expert on Linux ELF, so I can't really comment on that aspect of things, though.
>>
>>> ?namespace ARMBuildAttrs {
>>> ? ?enum AttrType {
>>> + ? ?// For the .cpu asm construct
>>> + ? ?ARM_CPU,
>>> + ? ?// Rest correspond to ELF/.ARM.attributes
>>> ? ? ?File ? ? ? ? ? ? ? ? ? ? ?= 1,
>>> ? ? ?Section ? ? ? ? ? ? ? ? ? = 2,
>>> ? ? ?Symbol ? ? ? ? ? ? ? ? ? ?= 3,
>>
>>
>> Is this new attr distinct from the ones already there for the CPU? CPU_name, in particular, seems a likely candidate. It's hard to tell since the uses of the others don't appear to be implemented yet. In any case, if a new attr does need to be added, it should be consistent with the rest of them. No prefix, and just add the value onto the end (i.e., "Cpu = 71") of the list.
>
> All of the other enums in the ARMBuildAttrs are specific part of (i.e.
> can appear as markers in) the .ARM.attributes section.
> The new one I added correspond to the .cpu asm attr, which translates
> into one or more sequence of CPU_NAME, CPU_ARCH ... in the actual ELF
> section, so I needed a way to get that done.
> There is no neat correspondence between the asm attrs and what goes
> into the .ARM.attributes. Certainly not for the .cpu attribute (its
> one to many)
>
Jim, it turns out that the bulk of the attr emission is driven by a
bunch of bool flags from TargetMachine.
The individual ARMBuildAttrs::AttrType flags are not selected individually,
so there wasn't a real use for the llvm style switch except for the
new flag I added. (please see new comments in patch)
>
> p.s. I have another patch waiting for this to land - I will be adding
> just enough to get a basic two instruction function (thanks for new
> scaffolding on EncodeInstuction() ?Jim!) ?output as ELF .o, and be
> somewhat sane -
> i.e. ARM/MC/ELF hello world ("misspelled, and broken" but at least it
> will be a start. :-)
>
>
>>
>> Regards,
>>
>> ?Jim
>>
>>
>>
>> On Oct 7, 2010, at 8:54 PM, Jason Kim wrote:
>>
>>> Second set of ARM/MC/ELF changes.
>>>
>>> Added ARM specific ELF section types.
>>> Added AttributesSection to ARMElfTargetObject
>>> First step in unifying .cpu assembly tag with ELF/.o
>>> llc now asserts on actual ELF emission on -filetype=obj :-)
>>>
>>> Feedback, please!
>>>
>>> Thanks for reading!
>>>
>>> -Jason
>>>
>>
>>
>
Unless there is strong objection, I'd like to land this patch soon
(today if possible).
Thanks for reading!!
-jason
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm-mc-elf-s05.patch2
Type: application/octet-stream
Size: 6322 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20101011/91c68cb0/attachment-0001.obj
From echristo at apple.com Mon Oct 11 13:48:18 2010
From: echristo at apple.com (Eric Christopher)
Date: Mon, 11 Oct 2010 18:48:18 -0000
Subject: [llvm-commits] [llvm] r116212 -
/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Message-ID: <20101011184818.E1D452A6C12E@llvm.org>
Author: echristo
Date: Mon Oct 11 13:48:18 2010
New Revision: 116212
URL: http://llvm.org/viewvc/llvm-project?rev=116212&view=rev
Log:
Turn on arm fast isel by default.
Modified:
llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=116212&r1=116211&r2=116212&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Oct 11 13:48:18 2010
@@ -48,7 +48,7 @@
static cl::opt
EnableARMFastISel("arm-fast-isel",
cl::desc("Turn on experimental ARM fast-isel support"),
- cl::init(false), cl::Hidden);
+ cl::init(true), cl::Hidden);
namespace {
From grosbach at apple.com Mon Oct 11 13:51:52 2010
From: grosbach at apple.com (Jim Grosbach)
Date: Mon, 11 Oct 2010 18:51:52 -0000
Subject: [llvm-commits] [llvm] r116213 - in /llvm/trunk/lib/Target/ARM:
ARMInstrFormats.td ARMInstrInfo.td
Message-ID: <20101011185152.237782A6C12E@llvm.org>
Author: grosbach
Date: Mon Oct 11 13:51:51 2010
New Revision: 116213
URL: http://llvm.org/viewvc/llvm-project?rev=116213&view=rev
Log:
More binary encoding stuff, taking advantage of the new "by name" operand
matching in tblgen to do the predicate operand.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrFormats.td
llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=116213&r1=116212&r2=116213&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Oct 11 13:51:51 2010
@@ -241,6 +241,8 @@
string opc, string asm, string cstr,
list pattern>
: InstARM {
+ bits<4> p;
+ let Inst{31-28} = p;
let OutOperandList = oops;
let InOperandList = !con(iops, (ins pred:$p));
let AsmString = !strconcat(opc, "${p}", asm);
@@ -270,6 +272,11 @@
string opc, string asm, string cstr,
list pattern>
: InstARM {
+ bits<4> p; // Predicate operand
+ let Inst{31-28} = p;
+ // FIXME: The 's' operand needs to be handled, but the current generic
+ // get-value handlers don't know how to deal with it.
+
let OutOperandList = oops;
let InOperandList = !con(iops, (ins pred:$p, cc_out:$s));
let AsmString = !strconcat(opc, "${p}${s}", asm);
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=116213&r1=116212&r2=116213&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Oct 11 13:51:51 2010
@@ -478,20 +478,18 @@
let Inst{25} = 1;
}
}
- def rr : AsI1 {
+ def rr : AsI1 {
bits<4> Rd;
bits<4> Rn;
bits<4> Rm;
- bits<4> Cond;
let Inst{11-4} = 0b00000000;
let Inst{25} = 0;
let isCommutable = Commutable;
let Inst{3-0} = Rm;
let Inst{15-12} = Rd;
let Inst{19-16} = Rn;
- let Inst{31-28} = Cond;
}
def rs : AsI1,
Requires<[IsARM, HasV4T]> {
- bits<4> Cond;
let Inst{3-0} = 0b1110;
let Inst{7-4} = 0b0001;
let Inst{19-8} = 0b111111111111;
let Inst{27-20} = 0b00010010;
- let Inst{31-28} = Cond;
}
// ARMV4 only
def MOVPCLR : AI<(outs), (ins), BrMiscFrm, IIC_Br,
"mov", "\tpc, lr", [(ARMretflag)]>,
Requires<[IsARM, NoV4T]> {
- bits<4> Cond;
let Inst{11-0} = 0b000000001110;
let Inst{15-12} = 0b1111;
let Inst{19-16} = 0b0000;
let Inst{27-20} = 0b00011010;
- let Inst{31-28} = Cond;
}
}
@@ -942,27 +936,25 @@
def BRIND : AXI<(outs), (ins GPR:$dst), BrMiscFrm, IIC_Br, "bx\t$dst",
[(brind GPR:$dst)]>,
Requires<[IsARM, HasV4T]> {
- bits<4> Rm;
-
+ bits<4> dst;
let Inst{7-4} = 0b0001;
let Inst{19-8} = 0b111111111111;
let Inst{27-20} = 0b00010010;
let Inst{31-28} = 0b1110;
- let Inst{3-0} = Rm;
+ let Inst{3-0} = dst;
}
// ARMV4 only
def MOVPCRX : AXI<(outs), (ins GPR:$dst), BrMiscFrm, IIC_Br, "mov\tpc, $dst",
[(brind GPR:$dst)]>,
Requires<[IsARM, NoV4T]> {
- bits<4> Rm;
-
+ bits<4> dst;
let Inst{11-4} = 0b00000000;
let Inst{15-12} = 0b1111;
let Inst{19-16} = 0b0000;
let Inst{27-20} = 0b00011010;
let Inst{31-28} = 0b1110;
- let Inst{3-0} = Rm;
+ let Inst{3-0} = dst;
}
}
@@ -999,11 +991,11 @@
IIC_Br, "blx\t$func",
[(ARMcall GPR:$func)]>,
Requires<[IsARM, HasV5T, IsNotDarwin]> {
- bits<4> Rm;
+ bits<4> func;
let Inst{7-4} = 0b0011;
let Inst{19-8} = 0b111111111111;
let Inst{27-20} = 0b00010010;
- let Inst{3-0} = Rm;
+ let Inst{3-0} = func;
}
// ARMv4T
@@ -1513,26 +1505,26 @@
let neverHasSideEffects = 1 in
def MOVr : AsI1<0b1101, (outs GPR:$dst), (ins GPR:$src), DPFrm, IIC_iMOVr,
"mov", "\t$dst, $src", []>, UnaryDP {
- bits<4> Rd;
- bits<4> Rm;
+ bits<4> dst;
+ bits<4> src;
let Inst{11-4} = 0b00000000;
let Inst{25} = 0;
- let Inst{3-0} = Rm;
- let Inst{15-12} = Rd;
+ let Inst{3-0} = src;
+ let Inst{15-12} = dst;
}
// A version for the smaller set of tail call registers.
let neverHasSideEffects = 1 in
def MOVr_TC : AsI1<0b1101, (outs tcGPR:$dst), (ins tcGPR:$src), DPFrm,
IIC_iMOVr, "mov", "\t$dst, $src", []>, UnaryDP {
- bits<4> Rd;
- bits<4> Rm;
+ bits<4> dst;
+ bits<4> src;
let Inst{11-4} = 0b00000000;
let Inst{25} = 0;
- let Inst{3-0} = Rm;
- let Inst{15-12} = Rd;
+ let Inst{3-0} = src;
+ let Inst{15-12} = dst;
}
def MOVs : AsI1<0b1101, (outs GPR:$dst), (ins so_reg:$src),
From atrick at apple.com Mon Oct 11 14:02:04 2010
From: atrick at apple.com (Andrew Trick)
Date: Mon, 11 Oct 2010 19:02:04 -0000
Subject: [llvm-commits] [llvm] r116214 - in /llvm/trunk:
lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/2010-10-08-cmpxchg8b.ll
Message-ID: <20101011190204.8C9412A6C12E@llvm.org>
Author: atrick
Date: Mon Oct 11 14:02:04 2010
New Revision: 116214
URL: http://llvm.org/viewvc/llvm-project?rev=116214&view=rev
Log:
Fixes bug 8297: i386 cmpxchg8b, missing MachineMemOperand
Added:
llvm/trunk/test/CodeGen/X86/2010-10-08-cmpxchg8b.ll
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=116214&r1=116213&r2=116214&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Oct 11 14:02:04 2010
@@ -8697,7 +8697,9 @@
N->getOperand(1),
swapInH.getValue(1) };
SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag);
- SDValue Result = DAG.getNode(X86ISD::LCMPXCHG8_DAG, dl, Tys, Ops, 3);
+ MachineMemOperand *MMO = cast(N)->getMemOperand();
+ SDValue Result = DAG.getMemIntrinsicNode(X86ISD::LCMPXCHG8_DAG, dl, Tys,
+ Ops, 3, T, MMO);
SDValue cpOutL = DAG.getCopyFromReg(Result.getValue(0), dl, X86::EAX,
MVT::i32, Result.getValue(1));
SDValue cpOutH = DAG.getCopyFromReg(cpOutL.getValue(1), dl, X86::EDX,
Added: llvm/trunk/test/CodeGen/X86/2010-10-08-cmpxchg8b.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-10-08-cmpxchg8b.ll?rev=116214&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2010-10-08-cmpxchg8b.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2010-10-08-cmpxchg8b.ll Mon Oct 11 14:02:04 2010
@@ -0,0 +1,28 @@
+; RUN: llc < %s -march=x86 -mtriple=i386-apple-darwin | FileCheck %s
+; bug 8297
+;
+; On i386, i64 cmpxchg is lowered during legalize types to extract the
+; 64-bit result into a pair of fixed regs. So creation of the DAG node
+; happens in a different place. See
+; X86TargetLowering::ReplaceNodeResults, case ATOMIC_CMP_SWAP.
+;
+; Neither Atomic-xx.ll nor atomic_op.ll cover this. Those tests were
+; autogenerated from C source before 64-bit variants were supported.
+;
+; Note that this case requires a loop around the cmpxchg to force
+; machine licm to query alias anlysis, exposing a bad
+; MachineMemOperand.
+define void @foo(i64* %ptr) nounwind inlinehint {
+entry:
+ br label %loop
+loop:
+; CHECK: lock
+; CHECK-NEXT: cmpxchg8b
+ %r = call i64 @llvm.atomic.cmp.swap.i64.p0i64(i64* %ptr, i64 0, i64 1)
+ %stored1 = icmp eq i64 %r, 0
+ br i1 %stored1, label %loop, label %continue
+continue:
+ ret void
+}
+
+declare i64 @llvm.atomic.cmp.swap.i64.p0i64(i64* nocapture, i64, i64) nounwind
From grosbach at apple.com Mon Oct 11 14:38:01 2010
From: grosbach at apple.com (Jim Grosbach)
Date: Mon, 11 Oct 2010 19:38:01 -0000
Subject: [llvm-commits] [llvm] r116215 -
/llvm/trunk/utils/TableGen/AsmWriterInst.h
Message-ID: <20101011193801.4E4272A6C12E@llvm.org>
Author: grosbach
Date: Mon Oct 11 14:38:01 2010
New Revision: 116215
URL: http://llvm.org/viewvc/llvm-project?rev=116215&view=rev
Log:
trailing whitespace cleanup
Modified:
llvm/trunk/utils/TableGen/AsmWriterInst.h
Modified: llvm/trunk/utils/TableGen/AsmWriterInst.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterInst.h?rev=116215&r1=116214&r2=116215&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterInst.h (original)
+++ llvm/trunk/utils/TableGen/AsmWriterInst.h Mon Oct 11 14:38:01 2010
@@ -23,51 +23,51 @@
namespace llvm {
class CodeGenInstruction;
class Record;
-
+
struct AsmWriterOperand {
enum OpType {
// Output this text surrounded by quotes to the asm.
- isLiteralTextOperand,
+ isLiteralTextOperand,
// This is the name of a routine to call to print the operand.
isMachineInstrOperand,
// Output this text verbatim to the asm writer. It is code that
// will output some text to the asm.
isLiteralStatementOperand
} OperandType;
-
+
/// Str - For isLiteralTextOperand, this IS the literal text. For
/// isMachineInstrOperand, this is the PrinterMethodName for the operand..
- /// For isLiteralStatementOperand, this is the code to insert verbatim
+ /// For isLiteralStatementOperand, this is the code to insert verbatim
/// into the asm writer.
std::string Str;
-
+
/// CGIOpNo - For isMachineInstrOperand, this is the index of the operand in
/// the CodeGenInstruction.
unsigned CGIOpNo;
-
+
/// MiOpNo - For isMachineInstrOperand, this is the operand number of the
/// machine instruction.
unsigned MIOpNo;
-
+
/// MiModifier - For isMachineInstrOperand, this is the modifier string for
/// an operand, specified with syntax like ${opname:modifier}.
std::string MiModifier;
-
+
// To make VS STL happy
AsmWriterOperand(OpType op = isLiteralTextOperand):OperandType(op) {}
-
+
AsmWriterOperand(const std::string &LitStr,
OpType op = isLiteralTextOperand)
: OperandType(op), Str(LitStr) {}
-
+
AsmWriterOperand(const std::string &Printer,
unsigned _CGIOpNo,
unsigned _MIOpNo,
const std::string &Modifier,
- OpType op = isMachineInstrOperand)
+ OpType op = isMachineInstrOperand)
: OperandType(op), Str(Printer), CGIOpNo(_CGIOpNo), MIOpNo(_MIOpNo),
MiModifier(Modifier) {}
-
+
bool operator!=(const AsmWriterOperand &Other) const {
if (OperandType != Other.OperandType || Str != Other.Str) return true;
if (OperandType == isMachineInstrOperand)
@@ -77,26 +77,26 @@
bool operator==(const AsmWriterOperand &Other) const {
return !operator!=(Other);
}
-
+
/// getCode - Return the code that prints this operand.
std::string getCode() const;
};
-
+
class AsmWriterInst {
public:
std::vector Operands;
const CodeGenInstruction *CGI;
-
- AsmWriterInst(const CodeGenInstruction &CGI,
+
+ AsmWriterInst(const CodeGenInstruction &CGI,
unsigned Variant,
int FirstOperandColumn,
int OperandSpacing);
-
+
/// MatchesAllButOneOp - If this instruction is exactly identical to the
/// specified instruction except for one differing operand, return the
/// differing operand number. Otherwise return ~0.
unsigned MatchesAllButOneOp(const AsmWriterInst &Other) const;
-
+
private:
void AddLiteralString(const std::string &Str) {
// If the last operand was already a literal text string, append this to
From bigcheesegs at gmail.com Mon Oct 11 14:55:38 2010
From: bigcheesegs at gmail.com (Michael J. Spencer)
Date: Mon, 11 Oct 2010 19:55:38 -0000
Subject: [llvm-commits] [llvm] r116216 - in /llvm/trunk: CMakeLists.txt
utils/KillTheDoctor/ utils/KillTheDoctor/CMakeLists.txt
utils/KillTheDoctor/KillTheDoctor.cpp utils/KillTheDoctor/system_error.cpp
utils/KillTheDoctor/system_error.h
Message-ID: <20101011195538.BB0D32A6C130@llvm.org>
Author: mspencer
Date: Mon Oct 11 14:55:38 2010
New Revision: 116216
URL: http://llvm.org/viewvc/llvm-project?rev=116216&view=rev
Log:
Add KillTheDoctor.
Added:
llvm/trunk/utils/KillTheDoctor/
llvm/trunk/utils/KillTheDoctor/CMakeLists.txt
llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp
llvm/trunk/utils/KillTheDoctor/system_error.cpp
llvm/trunk/utils/KillTheDoctor/system_error.h
Modified:
llvm/trunk/CMakeLists.txt
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=116216&r1=116215&r2=116216&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Mon Oct 11 14:55:38 2010
@@ -389,6 +389,11 @@
add_subdirectory(test)
add_subdirectory(utils/unittest)
add_subdirectory(unittests)
+ if (WIN32)
+ # This utility is used to prevent chrashing tests from calling Dr. Watson on
+ # Windows.
+ add_subdirectory(utils/KillTheDoctor)
+ endif()
endif()
add_subdirectory(cmake/modules)
Added: llvm/trunk/utils/KillTheDoctor/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/KillTheDoctor/CMakeLists.txt?rev=116216&view=auto
==============================================================================
--- llvm/trunk/utils/KillTheDoctor/CMakeLists.txt (added)
+++ llvm/trunk/utils/KillTheDoctor/CMakeLists.txt Mon Oct 11 14:55:38 2010
@@ -0,0 +1,6 @@
+add_executable(KillTheDoctor
+ KillTheDoctor.cpp
+ system_error.cpp
+ )
+
+target_link_libraries(KillTheDoctor LLVMSupport LLVMSystem)
Added: llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp?rev=116216&view=auto
==============================================================================
--- llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp (added)
+++ llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp Mon Oct 11 14:55:38 2010
@@ -0,0 +1,600 @@
+//===- KillTheDoctor - Prevent Dr. Watson from stopping tests ---*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This program provides an extremely hacky way to stop Dr. Watson from starting
+// due to unhandled exceptions in child processes.
+//
+// This simply starts the program named in the first positional argument with
+// the arguments following it under a debugger. All this debugger does is catch
+// any unhandled exceptions thrown in the child process and close the program
+// (and hopefully tells someone about it).
+//
+// This also provides another really hacky method to prevent assert dialog boxes
+// from poping up. When --no-user32 is passed, if any process loads user32.dll,
+// we assume it is trying to call MessageBoxEx and terminate it. The proper way
+// to do this would be to actually set a break point, but there's quite a bit
+// of code involved to get the address of MessageBoxEx in the remote process's
+// address space due to Address space layout randomization (ASLR). This can be
+// added if it's ever actually needed.
+//
+// If the subprocess exits for any reason other than sucessful termination, -1
+// is returned. If the process exits normally the value it returned is returned.
+//
+// I hate Windows.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/PrettyStackTrace.h"
+#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/type_traits.h"
+#include "llvm/System/Signals.h"
+#include "system_error.h"
+#include
+#include
+#include
+#include