From natebegeman at mac.com Mon Feb 4 00:00:24 2008
From: natebegeman at mac.com (Nate Begeman)
Date: Mon, 04 Feb 2008 06:00:24 -0000
Subject: [llvm-commits] [llvm] r46697 -
/llvm/trunk/lib/Target/X86/X86InstrSSE.td
Message-ID: <200802040600.m1460OOG024698@zion.cs.uiuc.edu>
Author: sampo
Date: Mon Feb 4 00:00:24 2008
New Revision: 46697
URL: http://llvm.org/viewvc/llvm-project?rev=46697&view=rev
Log:
The rest of the SSE4.1 intrinsic patterns that are obvious to me. Getting
Evan's help with the rest.
Modified:
llvm/trunk/lib/Target/X86/X86InstrSSE.td
Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=46697&r1=46696&r2=46697&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Mon Feb 4 00:00:24 2008
@@ -3066,7 +3066,7 @@
Intrinsic V2F64Int> {
// Intrinsic operation, reg.
def SSr_Int : SS4AI,
@@ -3074,7 +3074,7 @@
// Intrinsic operation, mem.
def SSm_Int : SS4AI,
@@ -3082,7 +3082,7 @@
// Vector intrinsic operation, reg
def PSr_Int : SS4AI,
@@ -3090,7 +3090,7 @@
// Vector intrinsic operation, mem
def PSm_Int : SS4AI,
@@ -3098,7 +3098,7 @@
// Intrinsic operation, reg.
def SDr_Int : SS4AI,
@@ -3106,7 +3106,7 @@
// Intrinsic operation, mem.
def SDm_Int : SS4AI,
@@ -3114,7 +3114,7 @@
// Vector intrinsic operation, reg
def PDr_Int : SS4AI,
@@ -3122,7 +3122,7 @@
// Vector intrinsic operation, mem
def PDm_Int : SS4AI,
@@ -3196,3 +3196,40 @@
int_x86_sse41_pmulld, 1>;
defm PMULDQ : SS41I_binop_rm_int<0x28, "pmuldq",
int_x86_sse41_pmuldq, 1>;
+
+/// SS41I_binop_rmi_int - SSE 4.1 binary operator with immediate
+let isTwoAddress = 1 in {
+ multiclass SS41I_binop_rmi_int opc, string OpcodeStr,
+ Intrinsic IntId128, bit Commutable = 0> {
+ def rri128 : SS4AI,
+ OpSize {
+ let isCommutable = Commutable;
+ }
+ def rmi128 : SS4AI,
+ OpSize;
+ }
+}
+
+defm BLENDPS : SS41I_binop_rmi_int<0x0C, "blendps",
+ int_x86_sse41_blendps, 0>;
+defm BLENDPD : SS41I_binop_rmi_int<0x0D, "blendpd",
+ int_x86_sse41_blendpd, 0>;
+defm PBLENDW : SS41I_binop_rmi_int<0x0E, "pblendw",
+ int_x86_sse41_pblendw, 0>;
+defm DPPS : SS41I_binop_rmi_int<0x40, "dpps",
+ int_x86_sse41_dpps, 1>;
+defm DPPD : SS41I_binop_rmi_int<0x41, "dppd",
+ int_x86_sse41_dppd, 1>;
+defm MPSADBW : SS41I_binop_rmi_int<0x42, "mpsadbw",
+ int_x86_sse41_mpsadbw, 0>;
From tonic at nondot.org Mon Feb 4 00:17:47 2008
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 04 Feb 2008 06:17:47 -0000
Subject: [llvm-commits] [llvm] r46698 - in
/llvm/branches/release_22/lib/Target/X86: X86RegisterInfo.cpp
X86RegisterInfo.h X86RegisterInfo.td
Message-ID: <200802040617.m146HlbR025216@zion.cs.uiuc.edu>
Author: tbrethou
Date: Mon Feb 4 00:17:46 2008
New Revision: 46698
URL: http://llvm.org/viewvc/llvm-project?rev=46698&view=rev
Log:
Merge from mainline.
Provide correct DWARF register numbering for debug information emission on x86-32/Darwin.
This should fix bunch of issues.
Modified:
llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.cpp
llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.h
llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.td
Modified: llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.cpp?rev=46698&r1=46697&r2=46698&view=diff
==============================================================================
--- llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.cpp Mon Feb 4 00:17:46 2008
@@ -64,12 +64,15 @@
unsigned Flavour = DWARFFlavour::X86_64;
if (!Subtarget->is64Bit()) {
if (Subtarget->isTargetDarwin()) {
- Flavour = DWARFFlavour::X86_32_Darwin;
+ if (isEH)
+ Flavour = DWARFFlavour::X86_32_DarwinEH;
+ else
+ Flavour = DWARFFlavour::X86_32_Generic;
} else if (Subtarget->isTargetCygMing()) {
// Unsupported by now, just quick fallback
- Flavour = DWARFFlavour::X86_32_ELF;
+ Flavour = DWARFFlavour::X86_32_Generic;
} else {
- Flavour = DWARFFlavour::X86_32_ELF;
+ Flavour = DWARFFlavour::X86_32_Generic;
}
}
Modified: llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.h?rev=46698&r1=46697&r2=46698&view=diff
==============================================================================
--- llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.h (original)
+++ llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.h Mon Feb 4 00:17:46 2008
@@ -36,7 +36,7 @@
///
namespace DWARFFlavour {
enum {
- X86_64 = 0, X86_32_Darwin = 1, X86_32_ELF = 2
+ X86_64 = 0, X86_32_DarwinEH = 1, X86_32_Generic = 2
};
}
Modified: llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.td?rev=46698&r1=46697&r2=46698&view=diff
==============================================================================
--- llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.td (original)
+++ llvm/branches/release_22/lib/Target/X86/X86RegisterInfo.td Mon Feb 4 00:17:46 2008
@@ -25,11 +25,8 @@
// Dwarf numbering is different for 32-bit and 64-bit, and there are
// variations by target as well. Currently the first entry is for X86-64,
- // second - for X86-32/Darwin and third for X86-32/Linux
-
- // FIXME: Comments in gcc indicate that Darwin uses different numbering
- // for debug info and exception handling info:( The numbering here is
- // for exception handling.
+ // second - for EH on X86-32/Darwin and third is 'generic' one (X86-32/Linux
+ // and debug information on X86-32/Darwin)
// 8-bit registers
// Low registers
From tonic at nondot.org Mon Feb 4 00:29:05 2008
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 04 Feb 2008 06:29:05 -0000
Subject: [llvm-commits] [llvm] r46699 -
/llvm/branches/release_22/lib/CodeGen/ShadowStackCollector.cpp
Message-ID: <200802040629.m146T5ib025512@zion.cs.uiuc.edu>
Author: tbrethou
Date: Mon Feb 4 00:29:04 2008
New Revision: 46699
URL: http://llvm.org/viewvc/llvm-project?rev=46699&view=rev
Log:
Merge from mainline.
Don't dump the function!
Modified:
llvm/branches/release_22/lib/CodeGen/ShadowStackCollector.cpp
Modified: llvm/branches/release_22/lib/CodeGen/ShadowStackCollector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_22/lib/CodeGen/ShadowStackCollector.cpp?rev=46699&r1=46698&r2=46699&view=diff
==============================================================================
--- llvm/branches/release_22/lib/CodeGen/ShadowStackCollector.cpp (original)
+++ llvm/branches/release_22/lib/CodeGen/ShadowStackCollector.cpp Mon Feb 4 00:29:04 2008
@@ -426,8 +426,6 @@
Roots[I].second->eraseFromParent();
}
- F.dump();
-
Roots.clear();
return true;
}
From tonic at nondot.org Mon Feb 4 00:46:24 2008
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 04 Feb 2008 06:46:24 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46700 - in
/llvm-gcc-4.2/branches/release_22/gcc/config/arm: arm.c arm.h bpabi.h
Message-ID: <200802040646.m146kOFk026292@zion.cs.uiuc.edu>
Author: tbrethou
Date: Mon Feb 4 00:46:23 2008
New Revision: 46700
URL: http://llvm.org/viewvc/llvm-project?rev=46700&view=rev
Log:
Merge from mainline.
Fix the build for arm-linux-gnueabi.
Modified:
llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c
llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.h
llvm-gcc-4.2/branches/release_22/gcc/config/arm/bpabi.h
Modified: llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c?rev=46700&r1=46699&r2=46700&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c (original)
+++ llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c Mon Feb 4 00:46:23 2008
@@ -15165,13 +15165,14 @@
const char *function_name;
/* Darwin/mach-o: use a stub for dynamic references. */
- if (TARGET_MACHO
- && (flag_pic || MACHO_DYNAMIC_NO_PIC_P)
+#if TARGET_MACHO
+ if ((flag_pic || MACHO_DYNAMIC_NO_PIC_P)
&& ! machopic_data_defined_p (function_rtx))
function_name =
machopic_indirection_name (function_rtx, true);
- else
- function_name = XSTR (function_rtx, 0);
+#else
+ function_name = XSTR (function_rtx, 0);
+#endif
/* APPLE LOCAL ARM end 4745175 */
if (mi_delta < 0)
Modified: llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.h?rev=46700&r1=46699&r2=46700&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.h (original)
+++ llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.h Mon Feb 4 00:46:23 2008
@@ -31,6 +31,9 @@
#ifndef TARGET_MACHO
#define TARGET_MACHO 0
#endif
+#ifndef MACHO_DYNAMIC_NO_PIC_P
+#define MACHO_DYNAMIC_NO_PIC_P 0
+#endif
/* APPLE LOCAL end ARM darwin target */
/* APPLE LOCAL ARM interworking */
@@ -1830,9 +1833,15 @@
#define SHORT_CALL_FLAG_CHAR '^'
#define LONG_CALL_FLAG_CHAR '#'
+#define ENCODED_SHORT_CALL_ATTR_P(SYMBOL_NAME) \
+ (*(SYMBOL_NAME) == SHORT_CALL_FLAG_CHAR)
+
#define SYMBOL_SHORT_CALL_ATTR_P(SYMBOL) \
(SYMBOL_REF_FLAGS (SYMBOL) & SYMBOL_SHORT_CALL)
+#define ENCODED_LONG_CALL_ATTR_P(SYMBOL_NAME) \
+ (*(SYMBOL_NAME) == LONG_CALL_FLAG_CHAR)
+
#define SYMBOL_LONG_CALL_ATTR_P(SYMBOL) \
(SYMBOL_REF_FLAGS (SYMBOL) & SYMBOL_LONG_CALL)
Modified: llvm-gcc-4.2/branches/release_22/gcc/config/arm/bpabi.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/release_22/gcc/config/arm/bpabi.h?rev=46700&r1=46699&r2=46700&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/release_22/gcc/config/arm/bpabi.h (original)
+++ llvm-gcc-4.2/branches/release_22/gcc/config/arm/bpabi.h Mon Feb 4 00:46:23 2008
@@ -35,7 +35,9 @@
/* EABI targets should enable interworking by default. */
#undef TARGET_DEFAULT
-#define TARGET_DEFAULT MASK_INTERWORK
+/* LLVM Local begin */
+#define TARGET_DEFAULT (0)
+/* LLVM Local end */
/* The ARM BPABI functions return a boolean; they use no special
calling convention. */
From tonic at nondot.org Mon Feb 4 00:47:14 2008
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 04 Feb 2008 06:47:14 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46701 -
/llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c
Message-ID: <200802040647.m146lEtG026334@zion.cs.uiuc.edu>
Author: tbrethou
Date: Mon Feb 4 00:47:14 2008
New Revision: 46701
URL: http://llvm.org/viewvc/llvm-project?rev=46701&view=rev
Log:
Merge from mainline.
Fix my previous patch. It changed the behavior on TARGET_MACHO.
Modified:
llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c
Modified: llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c?rev=46701&r1=46700&r2=46701&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c (original)
+++ llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c Mon Feb 4 00:47:14 2008
@@ -15167,9 +15167,11 @@
/* Darwin/mach-o: use a stub for dynamic references. */
#if TARGET_MACHO
if ((flag_pic || MACHO_DYNAMIC_NO_PIC_P)
- && ! machopic_data_defined_p (function_rtx))
- function_name =
- machopic_indirection_name (function_rtx, true);
+ && ! machopic_data_defined_p (function_rtx))
+ function_name =
+ machopic_indirection_name (function_rtx, true);
+ else
+ function_name = XSTR (function_rtx, 0);
#else
function_name = XSTR (function_rtx, 0);
#endif
From tonic at nondot.org Mon Feb 4 00:48:51 2008
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 04 Feb 2008 06:48:51 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46702 -
/llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c
Message-ID: <200802040648.m146mpNk026396@zion.cs.uiuc.edu>
Author: tbrethou
Date: Mon Feb 4 00:48:51 2008
New Revision: 46702
URL: http://llvm.org/viewvc/llvm-project?rev=46702&view=rev
Log:
Merge from mainline.
Eliminate a compilation warning.
Modified:
llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c
Modified: llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c?rev=46702&r1=46701&r2=46702&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c (original)
+++ llvm-gcc-4.2/branches/release_22/gcc/config/arm/arm.c Mon Feb 4 00:48:51 2008
@@ -15233,11 +15233,14 @@
(inter-module thumbness is fixed up by the linker). */
rtx tem = gen_rtx_SYMBOL_REF (Pmode, function_name);
- if (TARGET_MACHO
- && ! machopic_data_defined_p (function_rtx))
+#if TARGET_MACHO
+ if (! machopic_data_defined_p (function_rtx))
tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-8));
else
tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7));
+#else
+ tem = gen_rtx_PLUS (GET_MODE (tem), tem, GEN_INT (-7));
+#endif
/* APPLE LOCAL end ARM 4745175 */
tem = gen_rtx_MINUS (GET_MODE (tem),
From tonic at nondot.org Mon Feb 4 01:03:17 2008
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 04 Feb 2008 07:03:17 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46703 -
/llvm-gcc-4.2/branches/release_22/gcc/llvm-types.cpp
Message-ID: <200802040703.m1473HWr026934@zion.cs.uiuc.edu>
Author: tbrethou
Date: Mon Feb 4 01:03:17 2008
New Revision: 46703
URL: http://llvm.org/viewvc/llvm-project?rev=46703&view=rev
Log:
Patch to not turn gcc's pure/const markings into readonly/readnone if a parameter has a byval attribute.
Modified:
llvm-gcc-4.2/branches/release_22/gcc/llvm-types.cpp
Modified: llvm-gcc-4.2/branches/release_22/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/release_22/gcc/llvm-types.cpp?rev=46703&r1=46702&r2=46703&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/release_22/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/branches/release_22/gcc/llvm-types.cpp Mon Feb 4 01:03:17 2008
@@ -1123,18 +1123,17 @@
// accepts it). But llvm IR does not allow both, so
// set only ReadNone.
if (flags & ECF_CONST)
- // Since they write the return value through a pointer,
- // 'sret' functions cannot be 'readnone'.
- if (!ABIConverter.isStructReturn())
- RAttributes |= ParamAttr::ReadNone;
+ RAttributes |= ParamAttr::ReadNone;
// Check for 'readonly' function attribute.
if (flags & ECF_PURE && !(flags & ECF_CONST))
- // Since they write the return value through a pointer,
- // 'sret' functions cannot be 'readonly'.
- if (!ABIConverter.isStructReturn())
- RAttributes |= ParamAttr::ReadOnly;
+ RAttributes |= ParamAttr::ReadOnly;
+ // Since they write the return value through a pointer,
+ // 'sret' functions cannot be 'readnone' or 'readonly'.
+ if (ABIConverter.isStructReturn())
+ RAttributes &= ~(ParamAttr::ReadNone|ParamAttr::ReadOnly);
+
// Compute whether the result needs to be zext or sext'd.
RAttributes |= HandleArgumentExtension(TREE_TYPE(type));
@@ -1162,6 +1161,9 @@
LLVM_TARGET_INIT_REGPARM(local_regparam, type);
#endif // LLVM_TARGET_ENABLE_REGPARM
+ // Keep track of whether we see a byval argument.
+ bool HasByVal = false;
+
// Check if we have a corresponding decl to inspect.
tree DeclArgs = (decl) ? DECL_ARGUMENTS(decl) : NULL;
// Loop over all of the arguments, adding them as we go.
@@ -1208,13 +1210,27 @@
local_regparam);
#endif // LLVM_TARGET_ENABLE_REGPARM
- if (Attributes != ParamAttr::None)
+ if (Attributes != ParamAttr::None) {
+ HasByVal |= Attributes & ParamAttr::ByVal;
Attrs.push_back(ParamAttrsWithIndex::get(ArgTypes.size(), Attributes));
+ }
if (DeclArgs)
DeclArgs = TREE_CHAIN(DeclArgs);
}
+ // If there is a byval argument then it is not safe to mark the function
+ // 'readnone' or 'readonly': gcc permits a 'const' or 'pure' function to
+ // write to struct arguments passed by value, but in LLVM this becomes a
+ // write through the byval pointer argument, which LLVM does not allow for
+ // readonly/readnone functions.
+ if (HasByVal && Attrs[0].index == 0) {
+ uint16_t &RAttrs = Attrs[0].attrs;
+ RAttrs &= ~(ParamAttr::ReadNone | ParamAttr::ReadOnly);
+ if (RAttrs == ParamAttr::None)
+ Attrs.erase(Attrs.begin());
+ }
+
// If the argument list ends with a void type node, it isn't vararg.
isVarArg = (Args == 0);
assert(RetTy && "Return type not specified!");
From tonic at nondot.org Mon Feb 4 01:16:42 2008
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 04 Feb 2008 07:16:42 -0000
Subject: [llvm-commits] [llvm-gcc-4.0] r46704 -
/llvm-gcc-4.0/branches/release_22/gcc/llvm-types.cpp
Message-ID: <200802040716.m147GgvZ027616@zion.cs.uiuc.edu>
Author: tbrethou
Date: Mon Feb 4 01:16:40 2008
New Revision: 46704
URL: http://llvm.org/viewvc/llvm-project?rev=46704&view=rev
Log:
Patch to not turn gcc's pure/const markings into readonly/readnone if a parameter has a byval attribute.
Modified:
llvm-gcc-4.0/branches/release_22/gcc/llvm-types.cpp
Modified: llvm-gcc-4.0/branches/release_22/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/branches/release_22/gcc/llvm-types.cpp?rev=46704&r1=46703&r2=46704&view=diff
==============================================================================
--- llvm-gcc-4.0/branches/release_22/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.0/branches/release_22/gcc/llvm-types.cpp Mon Feb 4 01:16:40 2008
@@ -1043,17 +1043,16 @@
// Check for 'readnone' function attribute.
if (flags & ECF_CONST)
- // Since they write the return value through a pointer,
- // 'sret' functions cannot be 'readnone'.
- if (!ABIConverter.isStructReturn())
- RAttributes |= ParamAttr::ReadNone;
+ RAttributes |= ParamAttr::ReadNone;
// Check for 'readonly' function attribute.
- if (flags & ECF_PURE)
- // Since they write the return value through a pointer,
- // 'sret' functions cannot be 'readonly'.
- if (!ABIConverter.isStructReturn())
- RAttributes |= ParamAttr::ReadOnly;
+ if (flags & ECF_PURE && !(flags & ECF_CONST))
+ RAttributes |= ParamAttr::ReadOnly;
+
+ // Since they write the return value through a pointer,
+ // 'sret' functions cannot be 'readnone' or 'readonly'.
+ if (ABIConverter.isStructReturn())
+ RAttributes &= ~(ParamAttr::ReadNone|ParamAttr::ReadOnly);
// Compute whether the result needs to be zext or sext'd.
RAttributes |= HandleArgumentExtension(TREE_TYPE(type));
@@ -1082,6 +1081,9 @@
LLVM_TARGET_INIT_REGPARM(local_regparam, type);
#endif // LLVM_TARGET_ENABLE_REGPARM
+ // Keep track of whether we see a byval argument.
+ bool HasByVal = false;
+
// Check if we have a corresponding decl to inspect.
tree DeclArgs = (decl) ? DECL_ARGUMENTS(decl) : NULL;
// Loop over all of the arguments, adding them as we go.
@@ -1128,13 +1130,27 @@
local_regparam);
#endif // LLVM_TARGET_ENABLE_REGPARM
- if (Attributes != ParamAttr::None)
+ if (Attributes != ParamAttr::None) {
+ HasByVal |= Attributes & ParamAttr::ByVal;
Attrs.push_back(ParamAttrsWithIndex::get(ArgTypes.size(), Attributes));
+ }
if (DeclArgs)
DeclArgs = TREE_CHAIN(DeclArgs);
}
+ // If there is a byval argument then it is not safe to mark the function
+ // 'readnone' or 'readonly': gcc permits a 'const' or 'pure' function to
+ // write to struct arguments passed by value, but in LLVM this becomes a
+ // write through the byval pointer argument, which LLVM does not allow for
+ // readonly/readnone functions.
+ if (HasByVal && Attrs[0].index == 0) {
+ uint16_t &RAttrs = Attrs[0].attrs;
+ RAttrs &= ~(ParamAttr::ReadNone | ParamAttr::ReadOnly);
+ if (RAttrs == ParamAttr::None)
+ Attrs.erase(Attrs.begin());
+ }
+
// If the argument list ends with a void type node, it isn't vararg.
isVarArg = (Args == 0);
assert(RetTy && "Return type not specified!");
From baldrick at free.fr Mon Feb 4 03:29:18 2008
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 04 Feb 2008 09:29:18 -0000
Subject: [llvm-commits] [llvm] r46705 -
/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
Message-ID: <200802040929.m149TIBt008573@zion.cs.uiuc.edu>
Author: baldrick
Date: Mon Feb 4 03:29:17 2008
New Revision: 46705
URL: http://llvm.org/viewvc/llvm-project?rev=46705&view=rev
Log:
I don't see how NodeUpdated can be called with a
ReadyToProcess node - add an assertion to check
this. Add an assertion to NodeDeleted that checks
that processed/ready nodes are indeed not deleted.
It is because they are never deleted that none of
the maps can have a deleted node as the source of
a mapping. It does however seem to be possible in
theory to have a deleted value as the target of a
mapping, however this has not yet been spotted in
the wild. Still mulling on what to do about this.
[The theoretical situation is this: a node A is
expanded/promoted/whatever to a newly created node
B. Thus A->B is added to a map. When the subtree
rooted at B is legalized it is conceivable that B
is deleted due to RAUW on a node somewhere above
it].
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=46705&r1=46704&r2=46705&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Mon Feb 4 03:29:17 2008
@@ -220,22 +220,27 @@
namespace {
/// NodeUpdateListener - This class is a DAGUpdateListener that listens for
/// updates to nodes and recomputes their ready state.
- class VISIBILITY_HIDDEN NodeUpdateListener :
+ class VISIBILITY_HIDDEN NodeUpdateListener :
public SelectionDAG::DAGUpdateListener {
DAGTypeLegalizer &DTL;
public:
NodeUpdateListener(DAGTypeLegalizer &dtl) : DTL(dtl) {}
-
+
virtual void NodeDeleted(SDNode *N) {
// Ignore deletes.
+ assert(N->getNodeId() != DAGTypeLegalizer::Processed &&
+ N->getNodeId() != DAGTypeLegalizer::ReadyToProcess &&
+ "RAUW deleted processed node!");
}
-
+
virtual void NodeUpdated(SDNode *N) {
// Node updates can mean pretty much anything. It is possible that an
// operand was set to something already processed (f.e.) in which case
// this node could become ready. Recompute its flags.
- if (N->getNodeId() != DAGTypeLegalizer::ReadyToProcess)
- DTL.ReanalyzeNodeFlags(N);
+ assert(N->getNodeId() != DAGTypeLegalizer::Processed &&
+ N->getNodeId() != DAGTypeLegalizer::ReadyToProcess &&
+ "RAUW updated processed node!");
+ DTL.ReanalyzeNodeFlags(N);
}
};
}
From baldrick at free.fr Mon Feb 4 03:40:27 2008
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 04 Feb 2008 09:40:27 -0000
Subject: [llvm-commits] [llvm] r46706 -
/llvm/trunk/test/CodeGen/Generic/2008-01-30-LoadCrash.ll
Message-ID: <200802040940.m149eSx4008857@zion.cs.uiuc.edu>
Author: baldrick
Date: Mon Feb 4 03:40:27 2008
New Revision: 46706
URL: http://llvm.org/viewvc/llvm-project?rev=46706&view=rev
Log:
Crashed the new type legalizer. Not likely to catch
any bugs in the future since to get the crash you also
need hacked in fake libcall support (which creates odd
but legal trees), but since adding it doesn't hurt...
Thanks to Chris for this ultimately reduced version.
Added:
llvm/trunk/test/CodeGen/Generic/2008-01-30-LoadCrash.ll
Added: llvm/trunk/test/CodeGen/Generic/2008-01-30-LoadCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2008-01-30-LoadCrash.ll?rev=46706&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Generic/2008-01-30-LoadCrash.ll (added)
+++ llvm/trunk/test/CodeGen/Generic/2008-01-30-LoadCrash.ll Mon Feb 4 03:40:27 2008
@@ -0,0 +1,21 @@
+; RUN: llvm-as < %s | llc
+
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
+target triple = "i686-pc-linux-gnu"
+ at letters.3100 = external constant [63 x i8] ; <[63 x i8]*> [#uses=2]
+
+define i32 @mkstemps(i8* %pattern, i32 %suffix_len, i64 %tmp42.rle) nounwind {
+bb20:
+ br label %bb41
+
+bb41: ; preds = %bb20
+ %tmp8182 = trunc i64 %tmp42.rle to i32 ; [#uses=1]
+ %tmp83 = getelementptr [63 x i8]* @letters.3100, i32 0, i32 %tmp8182 ; [#uses=1]
+ %tmp84 = load i8* %tmp83, align 1 ; [#uses=1]
+ store i8 %tmp84, i8* null, align 1
+ %tmp90 = urem i64 %tmp42.rle, 62 ; [#uses=1]
+ %tmp9091 = trunc i64 %tmp90 to i32 ; [#uses=1]
+ %tmp92 = getelementptr [63 x i8]* @letters.3100, i32 0, i32 %tmp9091 ; [#uses=1]
+ store i8* %tmp92, i8** null, align 1
+ ret i32 -1
+}
From kremenek at apple.com Mon Feb 4 10:57:38 2008
From: kremenek at apple.com (Ted Kremenek)
Date: Mon, 04 Feb 2008 16:57:38 -0000
Subject: [llvm-commits] [llvm] r46707 - /llvm/trunk/include/llvm/ADT/APSInt.h
Message-ID: <200802041657.m14GvjA9025374@zion.cs.uiuc.edu>
Author: kremenek
Date: Mon Feb 4 10:57:26 2008
New Revision: 46707
URL: http://llvm.org/viewvc/llvm-project?rev=46707&view=rev
Log:
constified operator~().
Modified:
llvm/trunk/include/llvm/ADT/APSInt.h
Modified: llvm/trunk/include/llvm/ADT/APSInt.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APSInt.h?rev=46707&r1=46706&r2=46707&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/APSInt.h (original)
+++ llvm/trunk/include/llvm/ADT/APSInt.h Mon Feb 4 10:57:26 2008
@@ -223,7 +223,7 @@
assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
return APSInt(static_cast(*this) - RHS, IsUnsigned);
}
- APSInt operator~() {
+ APSInt operator~() const {
return APSInt(~static_cast(*this), IsUnsigned);
}
From kremenek at apple.com Mon Feb 4 11:14:46 2008
From: kremenek at apple.com (Ted Kremenek)
Date: Mon, 04 Feb 2008 17:14:46 -0000
Subject: [llvm-commits] [llvm] r46709 -
/llvm/trunk/lib/Support/FoldingSet.cpp
Message-ID: <200802041714.m14HErbS025926@zion.cs.uiuc.edu>
Author: kremenek
Date: Mon Feb 4 11:14:20 2008
New Revision: 46709
URL: http://llvm.org/viewvc/llvm-project?rev=46709&view=rev
Log:
Fixed 80 col. violation.
Modified:
llvm/trunk/lib/Support/FoldingSet.cpp
Modified: llvm/trunk/lib/Support/FoldingSet.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FoldingSet.cpp?rev=46709&r1=46708&r2=46709&view=diff
==============================================================================
--- llvm/trunk/lib/Support/FoldingSet.cpp (original)
+++ llvm/trunk/lib/Support/FoldingSet.cpp Mon Feb 4 11:14:20 2008
@@ -221,8 +221,10 @@
/// FindNodeOrInsertPos - Look up the node specified by ID. If it exists,
/// return it. If not, return the insertion token that will make insertion
/// faster.
-FoldingSetImpl::Node *FoldingSetImpl::FindNodeOrInsertPos(const FoldingSetNodeID &ID,
- void *&InsertPos) {
+FoldingSetImpl::Node
+*FoldingSetImpl::FindNodeOrInsertPos(const FoldingSetNodeID &ID,
+ void *&InsertPos) {
+
void **Bucket = GetBucketFor(ID, Buckets, NumBuckets);
void *Probe = *Bucket;
From baldrick at free.fr Mon Feb 4 11:21:43 2008
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 04 Feb 2008 17:21:43 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46710 - in /llvm-gcc-4.2/trunk/gcc:
llvm-convert.cpp llvm-internal.h
Message-ID: <200802041721.m14HLmaG026157@zion.cs.uiuc.edu>
Author: baldrick
Date: Mon Feb 4 11:21:32 2008
New Revision: 46710
URL: http://llvm.org/viewvc/llvm-project?rev=46710&view=rev
Log:
Fix PR1942, hopefully correctly. This is the same
as the previous fix except that a temporary buffer
is not used if CALL_EXPR_RETURN_SLOT_OPT is true.
This flag is sometimes used to indicate front-end
semantic requirements and cannot be ignored. Also,
unlike in the previous fixes, keep the mucking around
with RESULT_DECL in EmitMODIFY_EXPR, only tweak it to
match the logic in expand_assignment (expr.c). While
there I introduced some symbolic names, tweaked some
existing names and cleaned up trailing whitespace.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.2/trunk/gcc/llvm-internal.h
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=46710&r1=46709&r2=46710&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Feb 4 11:21:32 2008
@@ -2308,6 +2308,7 @@
CallingConv::ID &CallingConvention;
LLVMBuilder &Builder;
const MemRef *DestLoc;
+ MemRef BufLoc;
std::vector LocStack;
FunctionCallArgumentConversion(tree exp, SmallVector &ops,
@@ -2339,7 +2340,19 @@
assert(LocStack.size() == 1 && "Imbalance!");
LocStack.clear();
}
-
+
+ // CopyOutResult - If the (aggregate) return result was redirected to a
+ // buffer, copy it to the final destination.
+ void CopyOutResult(tree result_type) {
+ if (BufLoc.Ptr && DestLoc) {
+ // A buffer was used for the aggregate return result. Copy it out now.
+ assert(ConvertType(result_type) ==
+ cast(BufLoc.Ptr->getType())->getElementType() &&
+ "Inconsistent result types!");
+ TheTreeToLLVM->EmitAggregateCopy(*DestLoc, BufLoc, result_type);
+ }
+ }
+
/// HandleScalarResult - This callback is invoked if the function returns a
/// simple scalar result value.
void HandleScalarResult(const Type *RetTy) {
@@ -2354,27 +2367,34 @@
void HandleAggregateResultAsScalar(const Type *ScalarTy) {
// There is nothing to do here.
}
-
+
/// HandleAggregateShadowArgument - This callback is invoked if the function
/// returns an aggregate value by using a "shadow" first parameter. If
/// RetPtr is set to true, the pointer argument itself is returned from the
/// function.
void HandleAggregateShadowArgument(const PointerType *PtrArgTy,
bool RetPtr) {
- // We need to pass a buffer to return into. If the caller uses the
- // result, DestLoc will be set. If it ignores it, it could be unset,
- // in which case we need to create a dummy buffer.
- // FIXME: The alignment and volatility of the buffer are being ignored!
- Value *DestPtr;
+ // We need to pass memory to write the return value into.
+ // FIXME: alignment and volatility are being ignored!
+ assert(!DestLoc || PtrArgTy == DestLoc->Ptr->getType());
+
if (DestLoc == 0) {
- DestPtr = TheTreeToLLVM->CreateTemporary(PtrArgTy->getElementType());
+ // The result is unused, but still needs to be stored somewhere.
+ Value *Buf = TheTreeToLLVM->CreateTemporary(PtrArgTy->getElementType());
+ CallOperands.push_back(Buf);
+ } else if (CALL_EXPR_RETURN_SLOT_OPT(CallExpression)) {
+ // Letting the call write directly to the final destination is safe and
+ // may be required. Do not use a buffer.
+ CallOperands.push_back(DestLoc->Ptr);
} else {
- DestPtr = DestLoc->Ptr;
- assert(PtrArgTy == DestPtr->getType());
+ // Letting the call write directly to the final destination may not be
+ // safe (eg: if DestLoc aliases a parameter) and is not required - pass
+ // a buffer and copy it to DestLoc after the call.
+ BufLoc = TheTreeToLLVM->CreateTempLoc(PtrArgTy->getElementType());
+ CallOperands.push_back(BufLoc.Ptr);
}
- CallOperands.push_back(DestPtr);
}
-
+
void HandleScalarArgument(const llvm::Type *LLVMTy, tree type) {
assert(!LocStack.empty());
Value *Loc = LocStack.back();
@@ -2543,7 +2563,9 @@
cast(Call)->setParamAttrs(PAL);
EmitBlock(NextBlock);
}
-
+
+ Client.CopyOutResult(TREE_TYPE(exp));
+
if (Call->getType() == Type::VoidTy)
return 0;
@@ -2626,50 +2648,48 @@
/// EmitMODIFY_EXPR - Note that MODIFY_EXPRs are rvalues only!
///
Value *TreeToLLVM::EmitMODIFY_EXPR(tree exp, const MemRef *DestLoc) {
+ tree lhs = TREE_OPERAND (exp, 0);
+ tree rhs = TREE_OPERAND (exp, 1);
+
// If this is the definition of an SSA variable, set its DECL_LLVM to the
// RHS.
- bool Op0Signed = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0)));
- bool Op1Signed = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 1)));
- if (isGCC_SSA_Temporary(TREE_OPERAND(exp, 0))) {
+ bool LHSSigned = !TYPE_UNSIGNED(TREE_TYPE(lhs));
+ bool RHSSigned = !TYPE_UNSIGNED(TREE_TYPE(rhs));
+ if (isGCC_SSA_Temporary(lhs)) {
// If DECL_LLVM is already set, this is a multiply defined GCC temporary.
- if (DECL_LLVM_SET_P(TREE_OPERAND(exp, 0))) {
- HandleMultiplyDefinedGCCTemp(TREE_OPERAND(exp, 0));
+ if (DECL_LLVM_SET_P(lhs)) {
+ HandleMultiplyDefinedGCCTemp(lhs);
return EmitMODIFY_EXPR(exp, DestLoc);
}
-
- Value *RHS = Emit(TREE_OPERAND(exp, 1), 0);
- RHS = CastToAnyType(RHS, Op1Signed,
- ConvertType(TREE_TYPE(TREE_OPERAND(exp, 0))),
- Op0Signed);
- SET_DECL_LLVM(TREE_OPERAND(exp, 0), RHS);
+
+ Value *RHS = Emit(rhs, 0);
+ RHS = CastToAnyType(RHS, RHSSigned, ConvertType(TREE_TYPE(lhs)), LHSSigned);
+ SET_DECL_LLVM(lhs, RHS);
return RHS;
- } else if (TREE_CODE(TREE_OPERAND(exp, 0)) == VAR_DECL &&
- DECL_REGISTER(TREE_OPERAND(exp, 0)) &&
- TREE_STATIC(TREE_OPERAND(exp, 0))) {
+ } else if (TREE_CODE(lhs) == VAR_DECL && DECL_REGISTER(lhs) &&
+ TREE_STATIC(lhs)) {
// If this is a store to a register variable, EmitLV can't handle the dest
// (there is no l-value of a register variable). Emit an inline asm node
// that copies the value into the specified register.
- Value *RHS = Emit(TREE_OPERAND(exp, 1), 0);
- RHS = CastToAnyType(RHS, Op1Signed,
- ConvertType(TREE_TYPE(TREE_OPERAND(exp, 0))),
- Op0Signed);
- EmitModifyOfRegisterVariable(TREE_OPERAND(exp, 0), RHS);
+ Value *RHS = Emit(rhs, 0);
+ RHS = CastToAnyType(RHS, RHSSigned, ConvertType(TREE_TYPE(lhs)), LHSSigned);
+ EmitModifyOfRegisterVariable(lhs, RHS);
return RHS;
}
-
- LValue LV = EmitLV(TREE_OPERAND(exp, 0));
- bool isVolatile = TREE_THIS_VOLATILE(TREE_OPERAND(exp, 0));
- unsigned Alignment = expr_align(TREE_OPERAND(exp, 0)) / 8;
+
+ LValue LV = EmitLV(lhs);
+ bool isVolatile = TREE_THIS_VOLATILE(lhs);
+ unsigned Alignment = expr_align(lhs) / 8;
if (!LV.isBitfield()) {
- const Type *ValTy = ConvertType(TREE_TYPE(TREE_OPERAND(exp, 1)));
+ const Type *ValTy = ConvertType(TREE_TYPE(rhs));
if (ValTy->isFirstClassType()) {
// Non-bitfield, scalar value. Just emit a store.
- Value *RHS = Emit(TREE_OPERAND(exp, 1), 0);
+ Value *RHS = Emit(rhs, 0);
// Convert RHS to the right type if we can, otherwise convert the pointer.
const PointerType *PT = cast(LV.Ptr->getType());
if (PT->getElementType()->canLosslesslyBitCastTo(RHS->getType()))
- RHS = CastToAnyType(RHS, Op1Signed, PT->getElementType(), Op0Signed);
+ RHS = CastToAnyType(RHS, RHSSigned, PT->getElementType(), LHSSigned);
else
LV.Ptr = BitCastToType(LV.Ptr, PointerType::getUnqual(RHS->getType()));
StoreInst *SI = Builder.CreateStore(RHS, LV.Ptr, isVolatile);
@@ -2680,27 +2700,27 @@
// Non-bitfield aggregate value.
MemRef NewLoc(LV.Ptr, Alignment, isVolatile);
- if (DestLoc) {
- Emit(TREE_OPERAND(exp, 1), &NewLoc);
- EmitAggregateCopy(*DestLoc, NewLoc, TREE_TYPE(exp));
- } else if (TREE_CODE(TREE_OPERAND(exp, 0)) != RESULT_DECL) {
- Emit(TREE_OPERAND(exp, 1), &NewLoc);
+ // In case we are returning the contents of an object which overlaps
+ // the place the value is being stored, use a safe function when copying
+ // a value through a pointer into a structure value return block.
+ if (TREE_CODE (lhs) == RESULT_DECL && TREE_CODE (rhs) == INDIRECT_REF) {
+ MemRef Tmp = CreateTempLoc(ConvertType(TREE_TYPE(rhs)));
+ Emit(rhs, &Tmp);
+ EmitAggregateCopy(NewLoc, Tmp, TREE_TYPE(rhs));
} else {
- // We do this for stores into RESULT_DECL because it is possible for that
- // memory area to overlap with the object being stored into it; see
- // gcc.c-torture/execute/20010124-1.c.
-
- MemRef Tmp = CreateTempLoc(ConvertType(TREE_TYPE(TREE_OPERAND(exp,1))));
- Emit(TREE_OPERAND(exp, 1), &Tmp);
- EmitAggregateCopy(NewLoc, Tmp, TREE_TYPE(TREE_OPERAND(exp,1)));
+ Emit(rhs, &NewLoc);
}
+
+ if (DestLoc)
+ EmitAggregateCopy(*DestLoc, NewLoc, TREE_TYPE(exp));
+
return 0;
}
- // Last case, this is a store to a bitfield, so we have to emit a
+ // Last case, this is a store to a bitfield, so we have to emit a
// read/modify/write sequence.
- Value *RHS = Emit(TREE_OPERAND(exp, 1), 0);
+ Value *RHS = Emit(rhs, 0);
if (!LV.BitSize)
return RHS;
@@ -2716,7 +2736,7 @@
assert(ValSizeInBits >= LV.BitSize && "Bad bitfield lvalue!");
assert(2*ValSizeInBits > LV.BitSize+LV.BitStart && "Bad bitfield lvalue!");
- Value *BitSource = CastToAnyType(RHS, Op1Signed, ValTy, Op0Signed);
+ Value *BitSource = CastToAnyType(RHS, RHSSigned, ValTy, LHSSigned);
for (unsigned I = 0; I < Strides; I++) {
unsigned Index = BYTES_BIG_ENDIAN ? Strides - I - 1 : I; // LSB first
Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=46710&r1=46709&r2=46710&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Mon Feb 4 11:21:32 2008
@@ -386,6 +386,13 @@
/// instruction's type is a pointer to the specified type.
AllocaInst *CreateTemporary(const Type *Ty);
+ /// CreateTempLoc - Like CreateTemporary, but returns a MemRef.
+ MemRef CreateTempLoc(const Type *Ty);
+
+ /// EmitAggregateCopy - Copy the elements from SrcLoc to DestLoc, using the
+ /// GCC type specified by GCCType to know which elements to copy.
+ void EmitAggregateCopy(MemRef DestLoc, MemRef SrcLoc, tree_node *GCCType);
+
private: // Helper functions.
/// StartFunctionBody - Start the emission of 'fndecl', outputing all
@@ -406,10 +413,6 @@
/// the previous block falls through into it, add an explicit branch.
void EmitBlock(BasicBlock *BB);
- /// EmitAggregateCopy - Copy the elements from SrcLoc to DestLoc, using the
- /// GCC type specified by GCCType to know which elements to copy.
- void EmitAggregateCopy(MemRef DestLoc, MemRef SrcLoc, tree_node *GCCType);
-
/// EmitAggregateZero - Zero the elements of DestLoc.
///
void EmitAggregateZero(MemRef DestLoc, tree_node *GCCType);
@@ -443,9 +446,6 @@
BasicBlock *getPostPad(unsigned RegionNo);
private:
- /// CreateTempLoc - Like CreateTemporary, but returns a MemRef.
- MemRef CreateTempLoc(const Type *Ty);
-
void EmitAutomaticVariableDecl(tree_node *decl);
/// isNoopCast - Return true if a cast from V to Ty does not change any bits.
From clattner at apple.com Mon Feb 4 12:00:48 2008
From: clattner at apple.com (Chris Lattner)
Date: Mon, 4 Feb 2008 10:00:48 -0800
Subject: [llvm-commits] [llvm] r46681 - in /llvm/trunk:
include/llvm/IntrinsicsX86.td lib/Target/X86/X86.td
lib/Target/X86/X86Instr64bit.td
lib/Target/X86/X86InstrInfo.td lib/Target/X86/X86InstrSSE.td
lib/Target/X86/X86Subtarget.cpp lib/Target/X86/X86Subtarget.h
In-Reply-To: <200802030718.m137IsIO014453@zion.cs.uiuc.edu>
References: <200802030718.m137IsIO014453@zion.cs.uiuc.edu>
Message-ID:
On Feb 2, 2008, at 11:18 PM, Nate Begeman wrote:
> +// Vector insert
> +let TargetPrefix = "x86" in { // All intrinsics start with
> "llvm.x86.".
> + def int_x86_sse41_pinsrb :
> GCCBuiltin<"__builtin_ia32_vec_set_v16qi">,
> + Intrinsic<[llvm_v16i8_ty, llvm_v16i8_ty, llvm_i32_ty,
> llvm_i32_ty]>;
> + def int_x86_sse41_pinsrd :
> GCCBuiltin<"__builtin_ia32_vec_set_v4si">,
> + Intrinsic<[llvm_v4i32_ty, llvm_v4i32_ty, llvm_i32_ty,
> llvm_i32_ty]>;
> + def int_x86_sse41_pinsrq :
> GCCBuiltin<"__builtin_ia32_vec_set_v2di">,
> + Intrinsic<[llvm_v2i64_ty, llvm_v2i64_ty, llvm_i64_ty,
> llvm_i32_ty]>;
> + def int_x86_sse41_insertps :
> GCCBuiltin<"__builtin_ia32_insertps128">,
> + Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty,
> llvm_i32_ty]>;
> +}
Hey Nate,
I think that some of these should be lowered in the front-end into the
corresponding llvm instruction. For example, I think these should
turn into insertelement instructions, and some of the other shuffles
should turn into vector_shuffle instructions. This relies on the code
generator to match the operations and turn them back into the "right
thing" which ensures that the code generator aggressively matches the
'non intrinsic' forms of these operations when possible.
-Chris
From sabre at nondot.org Mon Feb 4 12:02:40 2008
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 04 Feb 2008 18:02:40 -0000
Subject: [llvm-commits] [llvm] r46711 -
/llvm/trunk/test/CodeGen/Generic/2008-01-30-LoadCrash.ll
Message-ID: <200802041802.m14I2fUd028493@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Feb 4 12:02:37 2008
New Revision: 46711
URL: http://llvm.org/viewvc/llvm-project?rev=46711&view=rev
Log:
remove target triple to make this test more "generic"
Modified:
llvm/trunk/test/CodeGen/Generic/2008-01-30-LoadCrash.ll
Modified: llvm/trunk/test/CodeGen/Generic/2008-01-30-LoadCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2008-01-30-LoadCrash.ll?rev=46711&r1=46710&r2=46711&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Generic/2008-01-30-LoadCrash.ll (original)
+++ llvm/trunk/test/CodeGen/Generic/2008-01-30-LoadCrash.ll Mon Feb 4 12:02:37 2008
@@ -1,7 +1,5 @@
; RUN: llvm-as < %s | llc
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i686-pc-linux-gnu"
@letters.3100 = external constant [63 x i8] ; <[63 x i8]*> [#uses=2]
define i32 @mkstemps(i8* %pattern, i32 %suffix_len, i64 %tmp42.rle) nounwind {
From clattner at apple.com Mon Feb 4 12:04:24 2008
From: clattner at apple.com (Chris Lattner)
Date: Mon, 4 Feb 2008 10:04:24 -0800
Subject: [llvm-commits] [llvm] r46705 -
/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
In-Reply-To: <200802040929.m149TIBt008573@zion.cs.uiuc.edu>
References: <200802040929.m149TIBt008573@zion.cs.uiuc.edu>
Message-ID: <8DD5228B-EF6C-4F2F-8303-243A09E4C703@apple.com>
On Feb 4, 2008, at 1:29 AM, Duncan Sands wrote:
> Author: baldrick
> Date: Mon Feb 4 03:29:17 2008
> New Revision: 46705
>
> URL: http://llvm.org/viewvc/llvm-project?rev=46705&view=rev
> Log:
> I don't see how NodeUpdated can be called with a
> ReadyToProcess node - add an assertion to check
> this. Add an assertion to NodeDeleted that checks
The assertion seems correct to me, thanks Duncan!
-Chris
From baldrick at free.fr Mon Feb 4 12:05:43 2008
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 04 Feb 2008 18:05:43 -0000
Subject: [llvm-commits] [llvm] r46712 -
/llvm/trunk/test/CodeGen/Generic/2008-02-04-ExtractSubvector.ll
Message-ID: <200802041805.m14I5hXa028649@zion.cs.uiuc.edu>
Author: baldrick
Date: Mon Feb 4 12:05:42 2008
New Revision: 46712
URL: http://llvm.org/viewvc/llvm-project?rev=46712&view=rev
Log:
Crashes LegalizeTypes with "Do not know how to split
this operator's operand" (node: extract_subvector).
Added:
llvm/trunk/test/CodeGen/Generic/2008-02-04-ExtractSubvector.ll
Added: llvm/trunk/test/CodeGen/Generic/2008-02-04-ExtractSubvector.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2008-02-04-ExtractSubvector.ll?rev=46712&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Generic/2008-02-04-ExtractSubvector.ll (added)
+++ llvm/trunk/test/CodeGen/Generic/2008-02-04-ExtractSubvector.ll Mon Feb 4 12:05:42 2008
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc
+
+define i32 @main() nounwind {
+entry:
+ br label %bb15
+
+bb15: ; preds = %bb15, %entry
+ %tmp21 = add <8 x double> zeroinitializer, zeroinitializer ; <<8 x double>> [#uses=1]
+ br i1 false, label %bb30, label %bb15
+
+bb30: ; preds = %bb15
+ store <8 x double> %tmp21, <8 x double>* null, align 64
+ ret i32 0
+}
From baldrick at free.fr Mon Feb 4 12:07:03 2008
From: baldrick at free.fr (Duncan Sands)
Date: Mon, 04 Feb 2008 18:07:03 -0000
Subject: [llvm-commits] [llvm] r46713 -
/llvm/trunk/test/CodeGen/Generic/2008-02-04-Ctlz.ll
Message-ID: <200802041807.m14I73W0028700@zion.cs.uiuc.edu>
Author: baldrick
Date: Mon Feb 4 12:07:02 2008
New Revision: 46713
URL: http://llvm.org/viewvc/llvm-project?rev=46713&view=rev
Log:
Crashes LegalizeTypes with "Do not know how to
expand the result of this operator!" (node: ctlz).
Added:
llvm/trunk/test/CodeGen/Generic/2008-02-04-Ctlz.ll
Added: llvm/trunk/test/CodeGen/Generic/2008-02-04-Ctlz.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2008-02-04-Ctlz.ll?rev=46713&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Generic/2008-02-04-Ctlz.ll (added)
+++ llvm/trunk/test/CodeGen/Generic/2008-02-04-Ctlz.ll Mon Feb 4 12:07:02 2008
@@ -0,0 +1,22 @@
+; RUN: llvm-as < %s | llc
+
+ at .str3 = external constant [56 x i8] ; <[56 x i8]*> [#uses=1]
+
+define i32 @main() nounwind {
+entry:
+ br label %bb30
+
+bb30: ; preds = %bb30, %entry
+ %l.024 = phi i64 [ -10000, %entry ], [ 0, %bb30 ] ; [#uses=2]
+ %tmp37 = tail call i64 @llvm.ctlz.i64( i64 %l.024 ) ; [#uses=1]
+ trunc i64 %tmp37 to i32 ; :0 [#uses=1]
+ %tmp40 = tail call i32 (i8*, ...)* @printf( i8* noalias getelementptr ([56 x i8]* @.str3, i32 0, i32 0), i64 %l.024, i32 %0, i32 0, i32 0 ) nounwind ; [#uses=0]
+ br i1 false, label %bb30, label %bb9.i
+
+bb9.i: ; preds = %bb30
+ ret i32 0
+}
+
+declare i32 @printf(i8* noalias , ...) nounwind
+
+declare i64 @llvm.ctlz.i64(i64) nounwind readnone
From sabre at nondot.org Mon Feb 4 13:02:12 2008
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 04 Feb 2008 19:02:12 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46714 -
/llvm-gcc-4.2/trunk/README.LLVM
Message-ID: <200802041902.m14J2Egs027941@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Feb 4 13:01:58 2008
New Revision: 46714
URL: http://llvm.org/viewvc/llvm-project?rev=46714&view=rev
Log:
An additional symlink is required to find libstdc++.
Modified:
llvm-gcc-4.2/trunk/README.LLVM
Modified: llvm-gcc-4.2/trunk/README.LLVM
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/README.LLVM?rev=46714&r1=46713&r2=46714&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/README.LLVM (original)
+++ llvm-gcc-4.2/trunk/README.LLVM Mon Feb 4 13:01:58 2008
@@ -127,6 +127,7 @@
$ make $BUILDOPTIONS
$ make install
$ ln -sf /usr/lib/libstdc++.6.dylib `pwd`/../install/lib
+$ ln -sf /usr/lib/libstdc++.6.dylib `pwd`/../install/lib/libstdc++.dylib
That last step, "ln -sf ..." is required so that the linker (collect2) can find
libstdc++ ('-lstdc++') and subsequently link C++ executables correctly.
From dpatel at apple.com Mon Feb 4 14:58:06 2008
From: dpatel at apple.com (Devang Patel)
Date: Mon, 04 Feb 2008 20:58:06 -0000
Subject: [llvm-commits] [llvm] r46715 -
/llvm/trunk/lib/System/Unix/Program.inc
Message-ID: <200802042058.m14Kw7xj016312@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Feb 4 14:57:54 2008
New Revision: 46715
URL: http://llvm.org/viewvc/llvm-project?rev=46715&view=rev
Log:
Set error message.
Patch by Shantonu Sen.
Modified:
llvm/trunk/lib/System/Unix/Program.inc
Modified: llvm/trunk/lib/System/Unix/Program.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Program.inc?rev=46715&r1=46714&r2=46715&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Program.inc (original)
+++ llvm/trunk/lib/System/Unix/Program.inc Mon Feb 4 14:57:54 2008
@@ -242,9 +242,11 @@
// Wait for child to die
if (wait(&status) != child)
MakeErrMsg(ErrMsg, "Child timed out but wouldn't die");
-
+ else
+ MakeErrMsg(ErrMsg, "Child timed out", 0);
+
return -1; // Timeout detected
- } else {
+ } else if (errno != EINTR) {
MakeErrMsg(ErrMsg, "Error waiting for child process");
return -1;
}
From kremenek at apple.com Mon Feb 4 15:11:34 2008
From: kremenek at apple.com (Ted Kremenek)
Date: Mon, 04 Feb 2008 21:11:34 -0000
Subject: [llvm-commits] [llvm] r46716 - in /llvm/trunk:
include/llvm/ADT/FoldingSet.h lib/Support/FoldingSet.cpp
Message-ID: <200802042111.m14LBaHo016736@zion.cs.uiuc.edu>
Author: kremenek
Date: Mon Feb 4 15:11:17 2008
New Revision: 46716
URL: http://llvm.org/viewvc/llvm-project?rev=46716&view=rev
Log:
Added "bucket_iterators" to FoldingSet. Bucket iterators allow iteration
over all the nodes in a particular bucket.
Modified:
llvm/trunk/include/llvm/ADT/FoldingSet.h
llvm/trunk/lib/Support/FoldingSet.cpp
Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=46716&r1=46715&r2=46716&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/FoldingSet.h (original)
+++ llvm/trunk/include/llvm/ADT/FoldingSet.h Mon Feb 4 15:11:17 2008
@@ -224,6 +224,7 @@
// Convenience type to hide the implementation of the folding set.
typedef FoldingSetImpl::Node FoldingSetNode;
template class FoldingSetIterator;
+template class FoldingSetBucketIterator;
//===----------------------------------------------------------------------===//
/// FoldingSetTrait - This trait class is used to define behavior of how
@@ -265,6 +266,16 @@
const_iterator begin() const { return const_iterator(Buckets); }
const_iterator end() const { return const_iterator(Buckets+NumBuckets); }
+ typedef FoldingSetBucketIterator bucket_iterator;
+
+ bucket_iterator bucket_begin(unsigned hash) {
+ return bucket_iterator(Buckets + (hash & (NumBuckets-1)));
+ }
+
+ bucket_iterator bucket_end(unsigned hash) {
+ return bucket_iterator(Buckets + (hash & (NumBuckets-1)), true);
+ }
+
/// GetOrInsertNode - If there is an existing simple Node exactly
/// equal to the specified node, return it. Otherwise, insert 'N' and
/// return it instead.
@@ -322,6 +333,57 @@
};
//===----------------------------------------------------------------------===//
+/// FoldingSetBucketIteratorImpl - This is the common bucket iterator support
+/// shared by all folding sets, which knows how to walk a particular bucket
+/// of a folding set hash table.
+
+class FoldingSetBucketIteratorImpl {
+protected:
+ void *Ptr;
+
+ FoldingSetBucketIteratorImpl(void **Bucket);
+
+ FoldingSetBucketIteratorImpl(void **Bucket, bool)
+ : Ptr(reinterpret_cast(Bucket)) {}
+
+ void advance() {
+ void *Probe = static_cast(Ptr)->getNextInBucket();
+ uintptr_t x = reinterpret_cast(Probe) & ~0x1;
+ Ptr = reinterpret_cast(x);
+ }
+
+public:
+ bool operator==(const FoldingSetBucketIteratorImpl &RHS) const {
+ return Ptr == RHS.Ptr;
+ }
+ bool operator!=(const FoldingSetBucketIteratorImpl &RHS) const {
+ return Ptr != RHS.Ptr;
+ }
+};
+
+
+template
+class FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl {
+public:
+ FoldingSetBucketIterator(void **Bucket) :
+ FoldingSetBucketIteratorImpl(Bucket) {}
+
+ FoldingSetBucketIterator(void **Bucket, bool) :
+ FoldingSetBucketIteratorImpl(Bucket, true) {}
+
+ T& operator*() const { return *static_cast(Ptr); }
+ T* operator->() const { return static_cast(Ptr); }
+
+ inline FoldingSetBucketIterator& operator++() { // Preincrement
+ advance();
+ return *this;
+ }
+ FoldingSetBucketIterator operator++(int) { // Postincrement
+ FoldingSetBucketIterator tmp = *this; ++*this; return tmp;
+ }
+};
+
+//===----------------------------------------------------------------------===//
/// FoldingSetNodeWrapper - This template class is used to "wrap" arbitrary
/// types in an enclosing object so that they can be inserted into FoldingSets.
template
Modified: llvm/trunk/lib/Support/FoldingSet.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FoldingSet.cpp?rev=46716&r1=46715&r2=46716&view=diff
==============================================================================
--- llvm/trunk/lib/Support/FoldingSet.cpp (original)
+++ llvm/trunk/lib/Support/FoldingSet.cpp Mon Feb 4 15:11:17 2008
@@ -148,7 +148,7 @@
return static_cast(NextInBucketPtr);
}
-/// GetBucketPtr - Provides a casting of a bucket pointer for isNode
+
/// testing.
static void **GetBucketPtr(void *NextInBucketPtr) {
intptr_t Ptr = reinterpret_cast(NextInBucketPtr);
@@ -358,3 +358,9 @@
}
}
+//===----------------------------------------------------------------------===//
+// FoldingSetBucketIteratorImpl Implementation
+
+FoldingSetBucketIteratorImpl::FoldingSetBucketIteratorImpl(void **Bucket) {
+ Ptr = (*Bucket == 0 || GetNextPtr(*Bucket) == 0) ? (void*) Bucket : *Bucket;
+}
From kremenek at apple.com Mon Feb 4 15:15:32 2008
From: kremenek at apple.com (Ted Kremenek)
Date: Mon, 04 Feb 2008 21:15:32 -0000
Subject: [llvm-commits] [llvm] r46717 -
/llvm/trunk/include/llvm/ADT/ImmutableSet.h
Message-ID: <200802042115.m14LFXKR016855@zion.cs.uiuc.edu>
Author: kremenek
Date: Mon Feb 4 15:15:24 2008
New Revision: 46717
URL: http://llvm.org/viewvc/llvm-project?rev=46717&view=rev
Log:
Modified node creation of ImutAVLTree to do a hash lookup for an existing
node in the FoldingSet of nodes held by the Factory object. If we
we find a node with a matching hash, we do a full structural comparison.
Nodes are also now inserted into the FoldingSet only when we mark them
Immutable, as their children can change during intermediate-rebalancing.
The 'Profile' method for ImutAVLTree is no longer used when looking up
existing ImutAVLTrees with a given set of contents; instead the Profile method
is used by other clients that wish to insert such a tree into a folding set.
This means that we are not using FoldingSet in ImutAVLTreeFactory in the way
it was intended, but instead are using it as an opaque hashtable.
Modified:
llvm/trunk/include/llvm/ADT/ImmutableSet.h
Modified: llvm/trunk/include/llvm/ADT/ImmutableSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableSet.h?rev=46717&r1=46716&r2=46717&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableSet.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableSet.h Mon Feb 4 15:15:24 2008
@@ -25,8 +25,8 @@
//===----------------------------------------------------------------------===//
template class ImutAVLFactory;
-
template class ImutAVLTreeInOrderIterator;
+template class ImutAVLTreeGenericIterator;
template
class ImutAVLTree : public FoldingSetNode {
@@ -38,6 +38,9 @@
typedef ImutAVLFactory Factory;
friend class ImutAVLFactory;
+ friend class ImutAVLTreeGenericIterator;
+ friend class FoldingSet;
+
typedef ImutAVLTreeInOrderIterator iterator;
//===----------------------------------------------------===//
@@ -102,6 +105,24 @@
/// end - Returns an iterator for the tree that denotes the end of an
/// inorder traversal.
iterator end() const { return iterator(); }
+
+ bool ElementEqual(value_type_ref V) const {
+ // Compare the keys.
+ if (!ImutInfo::isEqual(ImutInfo::KeyOfValue(getValue()),
+ ImutInfo::KeyOfValue(V)))
+ return false;
+
+ // Also compare the data values.
+ if (!ImutInfo::isDataEqual(ImutInfo::DataOfValue(getValue()),
+ ImutInfo::DataOfValue(V)))
+ return false;
+
+ return true;
+ }
+
+ bool ElementEqual(const ImutAVLTree* RHS) const {
+ return ElementEqual(RHS->getValue());
+ }
/// isEqual - Compares two trees for structural equality and returns true
/// if they are equal. This worst case performance of this operation is
@@ -120,14 +141,7 @@
continue;
}
- // Compare the keys.
- if (!ImutInfo::isEqual(ImutInfo::KeyOfValue(LItr->getValue()),
- ImutInfo::KeyOfValue(RItr->getValue())))
- return false;
-
- // Also compare the data values.
- if (!ImutInfo::isDataEqual(ImutInfo::DataOfValue(LItr->getValue()),
- ImutInfo::DataOfValue(RItr->getValue())))
+ if (!LItr->ElementEqual(*RItr))
return false;
++LItr;
@@ -187,7 +201,15 @@
&& "Current value is not less that value of right child.");
return getHeight();
- }
+ }
+
+ /// Profile - Profiling for ImutAVLTree. This is not used by the
+ // Factory object (which internally uses a FoldingSet), but can
+ // be used by external clients that wish to insert an ImutAVLTree
+ // object into a FoldingSet.
+ void Profile(llvm::FoldingSetNodeID& ID) const {
+ ID.AddPointer(this);
+ }
//===----------------------------------------------------===//
// Internal Values.
@@ -200,70 +222,14 @@
value_type Value;
unsigned Hash;
- //===----------------------------------------------------===//
- // Profiling or FoldingSet.
- //===----------------------------------------------------===//
-
-private:
-
- static inline
- unsigned ComputeHash(ImutAVLTree* L, ImutAVLTree* R, value_type_ref V) {
- FoldingSetNodeID ID;
-
- if (L) ID.AddInteger(L->ComputeHash());
- ImutInfo::Profile(ID,V);
-
- // Compute the "intermediate" hash. Basically, we want the net profile to
- // be: H(H(....H(H(H(item0),item1),item2)...),itemN), where
- // H(item) is the hash of the data item and H(hash,item) is a hash
- // of the last item hash and the the next item.
-
- unsigned X = ID.ComputeHash();
-
- if (R) {
- ID.clear();
- ID.AddInteger(X);
- ID.AddInteger(R->ComputeHash());
- X = ID.ComputeHash();
- }
-
- return X;
- }
-
- inline unsigned ComputeHash() {
- if (Hash) return Hash;
-
- unsigned X = ComputeHash(getSafeLeft(), getRight(), getValue());
- if (!isMutable()) Hash = X;
-
- return X;
- }
-
- /// Profile - Generates a FoldingSet profile for a tree node before it is
- /// created. This is used by the ImutAVLFactory when creating
- /// trees.
- static inline
- void Profile(FoldingSetNodeID& ID, ImutAVLTree* L, ImutAVLTree* R,
- value_type_ref V) {
-
- ID.AddInteger(ComputeHash(L, R, V));
- }
-
-public:
-
- /// Profile - Generates a FoldingSet profile for an existing tree node.
- void Profile(FoldingSetNodeID& ID) {
- ID.AddInteger(ComputeHash());
- }
-
//===----------------------------------------------------===//
// Internal methods (node manipulation; used by Factory).
//===----------------------------------------------------===//
-
+
private:
enum { Mutable = 0x1 };
-
+
/// ImutAVLTree - Internal constructor that is only called by
/// ImutAVLFactory.
ImutAVLTree(ImutAVLTree* l, ImutAVLTree* r, value_type_ref v, unsigned height)
@@ -330,6 +296,33 @@
assert (isMutable() && "Only a mutable tree can have its height changed.");
Height = h;
}
+
+
+ static inline
+ unsigned ComputeHash(ImutAVLTree* L, ImutAVLTree* R, value_type_ref V) {
+ unsigned hash = 0;
+
+ if (L) hash += L->ComputeHash();
+
+ { // Compute hash of stored data.
+ FoldingSetNodeID ID;
+ ImutInfo::Profile(ID,V);
+ hash += ID.ComputeHash();
+ }
+
+ if (R) hash += R->ComputeHash();
+
+ return hash;
+ }
+
+ inline unsigned ComputeHash() {
+ if (Hash) return Hash;
+
+ unsigned X = ComputeHash(getSafeLeft(), getRight(), getValue());
+ if (!isMutable()) Hash = X;
+
+ return X;
+ }
};
//===----------------------------------------------------------------------===//
@@ -390,6 +383,20 @@
return ( hl > hr ? hl : hr ) + 1;
}
+
+ static bool CompareTreeWithSection(TreeTy* T,
+ typename TreeTy::iterator& TI,
+ typename TreeTy::iterator& TE) {
+
+ typename TreeTy::iterator I = T->begin(), E = T->end();
+
+ for ( ; I!=E ; ++I, ++TI)
+ if (TI == TE || !I->ElementEqual(*TI))
+ return false;
+
+ return true;
+ }
+
//===--------------------------------------------------===//
// "CreateNode" is used to generate new tree roots that link
// to other trees. The functon may also simply move links
@@ -401,21 +408,57 @@
//===--------------------------------------------------===//
TreeTy* CreateNode(TreeTy* L, value_type_ref V, TreeTy* R) {
- FoldingSetNodeID ID;
- TreeTy::Profile(ID,L,R,V);
- void* InsertPos;
+ // Search the FoldingSet bucket for a Tree with the same hash.
+ unsigned hash = TreeTy::ComputeHash(L, R, V);
+ typename CacheTy::bucket_iterator I = Cache.bucket_begin(hash);
+ typename CacheTy::bucket_iterator E = Cache.bucket_end(hash);
- if (TreeTy* T = Cache.FindNodeOrInsertPos(ID,InsertPos))
+ for (; I != E; ++I) {
+ TreeTy* T = &*I;
+
+ if (T->ComputeHash() != hash)
+ continue;
+
+ // We found a collision. Perform a comparison of Contents('T')
+ // with Contents('L')+'V'+Contents('R').
+
+ typename TreeTy::iterator TI = T->begin(), TE = T->end();
+
+ // First compare Contents('L') with the (initial) contents of T.
+ if (!CompareTreeWithSection(L, TI, TE))
+ continue;
+
+ // Now compare the new data element.
+ if (TI == TE || !TI->ElementEqual(V))
+ continue;
+
+ ++TI;
+
+ // Now compare the remainder of 'T' with 'R'.
+ if (!CompareTreeWithSection(R, TI, TE))
+ continue;
+
+ if (TI != TE) // Contents('R') did not match suffix of 'T'.
+ continue;
+
+ // Trees did match! Return 'T'.
return T;
+ }
- assert (InsertPos != NULL);
-
+ // No tree with the contents: Contents('L')+'V'+Contents('R').
+ // Create it.
+
// Allocate the new tree node and insert it into the cache.
TreeTy* T = (TreeTy*) Allocator.Allocate();
new (T) TreeTy(L,R,V,IncrementHeight(L,R));
- Cache.InsertNode(T,InsertPos);
- return T;
+ // We do not insert 'T' into the FoldingSet here. This is because
+ // this tree is still mutable and things may get rebalanced.
+ // Because our hash is associative and based on the contents of
+ // the set, this should hopefully not cause any strange bugs.
+ // 'T' is inserted by 'MarkImmutable'.
+
+ return T;
}
TreeTy* CreateNode(TreeTy* L, TreeTy* OldTree, TreeTy* R) {
@@ -546,6 +589,10 @@
T->MarkImmutable();
MarkImmutable(Left(T));
MarkImmutable(Right(T));
+
+ // Now that the node is immutable it can safely be inserted
+ // into the node cache.
+ Cache.InsertNode(T, (void*) &*Cache.bucket_end(T->ComputeHash()));
}
};
@@ -626,7 +673,7 @@
switch (getVisitState()) {
case VisitedNone:
- if (TreeTy* L = Current->getLeft())
+ if (TreeTy* L = Current->getSafeLeft())
stack.push_back(reinterpret_cast(L));
else
stack.back() |= VisitedLeft;
From dpatel at apple.com Mon Feb 4 15:16:10 2008
From: dpatel at apple.com (Devang Patel)
Date: Mon, 04 Feb 2008 21:16:10 -0000
Subject: [llvm-commits] [llvm] r46718 - /llvm/trunk/tools/lto/lto.cpp
Message-ID: <200802042116.m14LGBXR016885@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Feb 4 15:16:10 2008
New Revision: 46718
URL: http://llvm.org/viewvc/llvm-project?rev=46718&view=rev
Log:
Do not set time out, lets assume assembler will do its job in reasonable amount of time.
Modified:
llvm/trunk/tools/lto/lto.cpp
Modified: llvm/trunk/tools/lto/lto.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.cpp?rev=46718&r1=46717&r2=46718&view=diff
==============================================================================
--- llvm/trunk/tools/lto/lto.cpp (original)
+++ llvm/trunk/tools/lto/lto.cpp Mon Feb 4 15:16:10 2008
@@ -516,7 +516,7 @@
args.push_back(tmpAsmFilePath.c_str());
args.push_back(0);
- if (sys::Program::ExecuteAndWait(gcc, &args[0], 0, 0, 1, 0, &ErrMsg)) {
+ if (sys::Program::ExecuteAndWait(gcc, &args[0], 0, 0, 0, 0, &ErrMsg)) {
cerr << "lto: " << ErrMsg << "\n";
return LTO_ASM_FAILURE;
}
From kremenek at apple.com Mon Feb 4 15:17:05 2008
From: kremenek at apple.com (Ted Kremenek)
Date: Mon, 04 Feb 2008 21:17:05 -0000
Subject: [llvm-commits] [llvm] r46719 -
/llvm/trunk/include/llvm/ADT/ImmutableMap.h
Message-ID: <200802042117.m14LH64J016988@zion.cs.uiuc.edu>
Author: kremenek
Date: Mon Feb 4 15:17:02 2008
New Revision: 46719
URL: http://llvm.org/viewvc/llvm-project?rev=46719&view=rev
Log:
Modified 'Profile' method of ImmutableMap to use the 'Profile' method
of the contained ImutAVLTree root.
Modified:
llvm/trunk/include/llvm/ADT/ImmutableMap.h
Modified: llvm/trunk/include/llvm/ADT/ImmutableMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableMap.h?rev=46719&r1=46718&r2=46719&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableMap.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableMap.h Mon Feb 4 15:17:02 2008
@@ -205,8 +205,8 @@
inline unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
- static inline void Profile(FoldingSetNodeID& ID, const ImmutableMap& M) {
- ID.AddPointer(M.Root);
+ static inline void Profile(FoldingSetNodeID& ID, const ImmutableMap& M) {
+ M.Root->Profile(ID);
}
inline void Profile(FoldingSetNodeID& ID) const {
From natebegeman at mac.com Mon Feb 4 15:44:13 2008
From: natebegeman at mac.com (Nate Begeman)
Date: Mon, 04 Feb 2008 21:44:13 -0000
Subject: [llvm-commits] [llvm] r46720 -
/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
Message-ID: <200802042144.m14LiFMI017965@zion.cs.uiuc.edu>
Author: sampo
Date: Mon Feb 4 15:44:06 2008
New Revision: 46720
URL: http://llvm.org/viewvc/llvm-project?rev=46720&view=rev
Log:
Eliminate some redundant code.
Modified:
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=46720&r1=46719&r2=46720&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Mon Feb 4 15:44:06 2008
@@ -203,7 +203,7 @@
setOperationAction(ISD::MEMMOVE , MVT::Other, Expand);
// Use the default implementation.
- setOperationAction(ISD::VASTART , MVT::Other, Expand);
+ setOperationAction(ISD::VASTART , MVT::Other, Custom);
setOperationAction(ISD::VAARG , MVT::Other, Expand);
setOperationAction(ISD::VACOPY , MVT::Other, Expand);
setOperationAction(ISD::VAEND , MVT::Other, Expand);
@@ -240,12 +240,6 @@
setOperationAction(ISD::BR_CC , MVT::f64, Custom);
setOperationAction(ISD::BR_JT , MVT::Other, Custom);
- setOperationAction(ISD::VASTART, MVT::Other, Custom);
- setOperationAction(ISD::VACOPY, MVT::Other, Expand);
- setOperationAction(ISD::VAEND, MVT::Other, Expand);
- setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
- setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
-
// FP Constants can't be immediates.
setOperationAction(ISD::ConstantFP, MVT::f64, Expand);
setOperationAction(ISD::ConstantFP, MVT::f32, Expand);
From dpatel at apple.com Mon Feb 4 15:50:23 2008
From: dpatel at apple.com (Devang Patel)
Date: Mon, 4 Feb 2008 13:50:23 -0800
Subject: [llvm-commits] [llvm-gcc-4.2] r46670 - in
/llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp llvm-convert.cpp
In-Reply-To: <200802022023.m12KNSV7027714@zion.cs.uiuc.edu>
References: <200802022023.m12KNSV7027714@zion.cs.uiuc.edu>
Message-ID: <1AB86B5D-BCA8-43D5-8A03-BC96537D82DE@apple.com>
Please update associated comments also.
Thanks!
-
Devang
On Feb 2, 2008, at 12:23 PM, Duncan Sands wrote:
> Author: baldrick
> Date: Sat Feb 2 14:23:27 2008
> New Revision: 46670
>
> URL: http://llvm.org/viewvc/llvm-project?rev=46670&view=rev
> Log:
> Use alignment zero if the gcc alignment is less
> than the ABI alignment, not just when it is equal
> to it.
>
> Modified:
> llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
> llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
>
> Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=46670&r1=46669&r2=46670&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
> +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Sat Feb 2 14:23:27 2008
> @@ -969,7 +969,7 @@
> unsigned TargetAlign =
> getTargetData().getABITypeAlignment(GV->getType()-
> >getElementType());
> if (DECL_USER_ALIGN(decl) ||
> - TargetAlign != (unsigned)DECL_ALIGN_UNIT(decl))
> + TargetAlign < (unsigned)DECL_ALIGN_UNIT(decl))
> GV->setAlignment(DECL_ALIGN_UNIT(decl));
> }
>
>
> Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=46670&r1=46669&r2=46670&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
> +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Sat Feb 2 14:23:27 2008
> @@ -1589,7 +1589,7 @@
> // 2) DECL_ALIGN is set by user.
> if (DECL_ALIGN_UNIT(decl)) {
> unsigned TargetAlign = getTargetData().getABITypeAlignment(Ty);
> - if (DECL_USER_ALIGN(decl) || TargetAlign !=
> (unsigned)DECL_ALIGN_UNIT(decl))
> + if (DECL_USER_ALIGN(decl) || TargetAlign <
> (unsigned)DECL_ALIGN_UNIT(decl))
> Alignment = DECL_ALIGN_UNIT(decl);
> }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-
Devang
From natebegeman at mac.com Mon Feb 4 17:04:38 2008
From: natebegeman at mac.com (Nate Begeman)
Date: Mon, 04 Feb 2008 23:04:38 -0000
Subject: [llvm-commits] [llvm] r46723 -
/llvm/trunk/lib/Target/ARM/ARMISelLowering.h
Message-ID: <200802042304.m14N4gtm020320@zion.cs.uiuc.edu>
Author: sampo
Date: Mon Feb 4 17:04:24 2008
New Revision: 46723
URL: http://llvm.org/viewvc/llvm-project?rev=46723&view=rev
Log:
This method should be virtual
Modified:
llvm/trunk/lib/Target/ARM/ARMISelLowering.h
Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=46723&r1=46722&r2=46723&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Mon Feb 4 17:04:24 2008
@@ -78,7 +78,7 @@
virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
virtual SDNode *ExpandOperationResult(SDNode *N, SelectionDAG &DAG);
- SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
+ virtual SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
virtual const char *getTargetNodeName(unsigned Opcode) const;
From evan.cheng at apple.com Mon Feb 4 17:06:58 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 04 Feb 2008 23:06:58 -0000
Subject: [llvm-commits] [llvm] r46724 - in /llvm/trunk:
lib/CodeGen/AsmPrinter.cpp lib/Target/ARM/ARMISelDAGToDAG.cpp
lib/Target/Alpha/AlphaISelDAGToDAG.cpp
lib/Target/CellSPU/SPUISelDAGToDAG.cpp lib/Target/IA64/IA64ISelDAGToDAG.cpp
lib/Target/Mips/MipsISelDAGToDAG.cpp lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/Sparc/SparcISelDAGToDAG.cpp lib/Target/X86/X86ISelDAGToDAG.cpp
utils/TableGen/DAGISelEmitter.cpp
Message-ID: <200802042307.m14N71uV020412@zion.cs.uiuc.edu>
Author: evancheng
Date: Mon Feb 4 17:06:48 2008
New Revision: 46724
URL: http://llvm.org/viewvc/llvm-project?rev=46724&view=rev
Log:
Dwarf requires variable entries to be in the source order. Right now, since we are recording variable information at isel time this means parameters would appear in the reverse order. The short term fix is to issue recordVariable() at asm printing time instead.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter.cpp
llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp
llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp
llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp
llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp
llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=46724&r1=46723&r2=46724&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Mon Feb 4 17:06:48 2008
@@ -118,9 +118,8 @@
SwitchToDataSection(""); // Reset back to no section.
- if (MachineModuleInfo *MMI = getAnalysisToUpdate()) {
- MMI->AnalyzeModule(M);
- }
+ MMI = getAnalysisToUpdate();
+ if (MMI) MMI->AnalyzeModule(M);
return false;
}
@@ -1291,8 +1290,12 @@
/// printDeclare - This method prints a local variable declaration used by
/// debug tables.
+/// FIXME: It doesn't really print anything rather it inserts a DebugVariable
+/// entry into dwarf table.
void AsmPrinter::printDeclare(const MachineInstr *MI) const {
- // Do nothing.
+ int FI = MI->getOperand(0).getIndex();
+ GlobalValue *GV = MI->getOperand(1).getGlobal();
+ MMI->RecordVariable(GV, FI);
}
/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=46724&r1=46723&r2=46724&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Mon Feb 4 17:06:48 2008
@@ -23,7 +23,6 @@
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/Target/TargetLowering.h"
Modified: llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp?rev=46724&r1=46723&r2=46724&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Mon Feb 4 17:06:48 2008
@@ -18,7 +18,6 @@
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=46724&r1=46723&r2=46724&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Mon Feb 4 17:06:48 2008
@@ -20,7 +20,6 @@
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/Target/TargetOptions.h"
Modified: llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp?rev=46724&r1=46723&r2=46724&view=diff
==============================================================================
--- llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp Mon Feb 4 17:06:48 2008
@@ -18,7 +18,6 @@
#include "IA64ISelLowering.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/Target/TargetOptions.h"
Modified: llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp?rev=46724&r1=46723&r2=46724&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp Mon Feb 4 17:06:48 2008
@@ -27,7 +27,6 @@
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/Target/TargetMachine.h"
Modified: llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp?rev=46724&r1=46723&r2=46724&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Mon Feb 4 17:06:48 2008
@@ -20,7 +20,6 @@
#include "PPCHazardRecognizers.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=46724&r1=46723&r2=46724&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Mon Feb 4 17:06:48 2008
@@ -19,7 +19,6 @@
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=46724&r1=46723&r2=46724&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Feb 4 17:06:48 2008
@@ -29,7 +29,6 @@
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/Target/TargetMachine.h"
Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=46724&r1=46723&r2=46724&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Mon Feb 4 17:06:48 2008
@@ -1780,7 +1780,6 @@
<< "}\n\n";
OS << "SDNode *Select_DECLARE(const SDOperand &N) {\n"
- << " MachineModuleInfo *MMI = CurDAG->getMachineModuleInfo();\n"
<< " SDOperand Chain = N.getOperand(0);\n"
<< " SDOperand N1 = N.getOperand(1);\n"
<< " SDOperand N2 = N.getOperand(2);\n"
@@ -1791,8 +1790,6 @@
<< " }\n"
<< " int FI = cast(N1)->getIndex();\n"
<< " GlobalValue *GV = cast(N2)->getGlobal();\n"
- << " // FIXME. Handle variable declarations later since it lives on.\n"
- << " MMI->RecordVariable(GV, FI);\n"
<< " SDOperand Tmp1 = "
<< "CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());\n"
<< " SDOperand Tmp2 = "
From evan.cheng at apple.com Mon Feb 4 17:10:38 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 04 Feb 2008 23:10:38 -0000
Subject: [llvm-commits] [llvm] r46725 - in /llvm/trunk:
include/llvm/CodeGen/SelectionDAGNodes.h
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Message-ID: <200802042310.m14NAcIO020582@zion.cs.uiuc.edu>
Author: evancheng
Date: Mon Feb 4 17:10:38 2008
New Revision: 46725
URL: http://llvm.org/viewvc/llvm-project?rev=46725&view=rev
Log:
Typo.
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=46725&r1=46724&r2=46725&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Feb 4 17:10:38 2008
@@ -598,7 +598,7 @@
bool isBuildVectorAllZeros(const SDNode *N);
/// isDebugLabel - Return true if the specified node represents a debug
- /// label (i.e. ISD::LABEL or TargetInstrInfo::LANEL node and third operand
+ /// label (i.e. ISD::LABEL or TargetInstrInfo::LABEL node and third operand
/// is 0).
bool isDebugLabel(const SDNode *N);
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=46725&r1=46724&r2=46725&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Feb 4 17:10:38 2008
@@ -176,7 +176,7 @@
}
/// isDebugLabel - Return true if the specified node represents a debug
-/// label (i.e. ISD::LABEL or TargetInstrInfo::LANEL node and third operand
+/// label (i.e. ISD::LABEL or TargetInstrInfo::LABEL node and third operand
/// is 0).
bool ISD::isDebugLabel(const SDNode *N) {
SDOperand Zero;
From dpatel at apple.com Mon Feb 4 17:24:44 2008
From: dpatel at apple.com (Devang Patel)
Date: Mon, 04 Feb 2008 23:24:44 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46726 -
/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Message-ID: <200802042324.m14NOiBg021071@zion.cs.uiuc.edu>
Author: dpatel
Date: Mon Feb 4 17:24:43 2008
New Revision: 46726
URL: http://llvm.org/viewvc/llvm-project?rev=46726&view=rev
Log:
Use appropriate alignment while handling packed struct member.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=46726&r1=46725&r2=46726&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Feb 4 17:24:43 2008
@@ -2148,6 +2148,13 @@
bool isVolatile = TREE_THIS_VOLATILE(exp);
const Type *Ty = ConvertType(TREE_TYPE(exp));
unsigned Alignment = expr_align(exp) / 8;
+ if (TREE_CODE(exp) == COMPONENT_REF)
+ if (const StructType *STy =
+ dyn_cast(ConvertType(TREE_TYPE(TREE_OPERAND(exp, 0)))))
+ if (STy->isPacked())
+ // Packed struct members use 1 byte alignment
+ Alignment = 1;
+
if (!LV.isBitfield()) {
if (!DestLoc) {
@@ -2680,6 +2687,12 @@
LValue LV = EmitLV(lhs);
bool isVolatile = TREE_THIS_VOLATILE(lhs);
unsigned Alignment = expr_align(lhs) / 8;
+ if (TREE_CODE(lhs) == COMPONENT_REF)
+ if (const StructType *STy =
+ dyn_cast(ConvertType(TREE_TYPE(TREE_OPERAND(lhs, 0)))))
+ if (STy->isPacked())
+ // Packed struct members use 1 byte alignment
+ Alignment = 1;
if (!LV.isBitfield()) {
const Type *ValTy = ConvertType(TREE_TYPE(rhs));
From dalej at apple.com Mon Feb 4 17:27:29 2008
From: dalej at apple.com (Dale Johannesen)
Date: Mon, 04 Feb 2008 23:27:29 -0000
Subject: [llvm-commits] [llvm] r46727 -
/llvm/trunk/include/llvm/IntrinsicsX86.td
Message-ID: <200802042327.m14NRT7G021211@zion.cs.uiuc.edu>
Author: johannes
Date: Mon Feb 4 17:27:29 2008
New Revision: 46727
URL: http://llvm.org/viewvc/llvm-project?rev=46727&view=rev
Log:
Do not unconditionally redefine vec_ext_v16qi and
vec_ext_v4si builtins. This is a hack; they should
be defined here, then resolved in the X86 BE.
However there is enough other stuff missing in the
X86 BE for SSE41 that this will do for now.
Modified:
llvm/trunk/include/llvm/IntrinsicsX86.td
Modified: llvm/trunk/include/llvm/IntrinsicsX86.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=46727&r1=46726&r2=46727&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IntrinsicsX86.td (original)
+++ llvm/trunk/include/llvm/IntrinsicsX86.td Mon Feb 4 17:27:29 2008
@@ -764,9 +764,9 @@
// Vector extract
let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_pextrb : GCCBuiltin<"__builtin_ia32_vec_ext_v16qi">,
+ def int_x86_sse41_pextrb :
Intrinsic<[llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty]>;
- def int_x86_sse41_pextrd : GCCBuiltin<"__builtin_ia32_vec_ext_v4si">,
+ def int_x86_sse41_pextrd :
Intrinsic<[llvm_i32_ty, llvm_v4i32_ty, llvm_i32_ty]>;
def int_x86_sse41_pextrq : GCCBuiltin<"__builtin_ia32_vec_ext_v2di">,
Intrinsic<[llvm_i64_ty, llvm_v2i64_ty, llvm_i32_ty]>;
From baldrick at free.fr Mon Feb 4 18:06:31 2008
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 05 Feb 2008 00:06:31 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46728 - in /llvm-gcc-4.2/trunk/gcc:
llvm-backend.cpp llvm-convert.cpp
Message-ID: <200802050006.m1506VKv022472@zion.cs.uiuc.edu>
Author: baldrick
Date: Mon Feb 4 18:06:31 2008
New Revision: 46728
URL: http://llvm.org/viewvc/llvm-project?rev=46728&view=rev
Log:
Update comments.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=46728&r1=46727&r2=46728&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Mon Feb 4 18:06:31 2008
@@ -963,7 +963,7 @@
}
// Set the alignment for the global if one of the following condition is met
- // 1) DECL_ALIGN_UNIT does not match alignment as per ABI specification
+ // 1) DECL_ALIGN_UNIT is better than the alignment as per ABI specification
// 2) DECL_ALIGN is set by user.
if (DECL_ALIGN_UNIT(decl)) {
unsigned TargetAlign =
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=46728&r1=46727&r2=46728&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Feb 4 18:06:31 2008
@@ -1583,7 +1583,7 @@
unsigned Alignment = 0; // Alignment in bytes.
// Set the alignment for the local if one of the following condition is met
- // 1) DECL_ALIGN_UNIT does not match alignment as per ABI specification
+ // 1) DECL_ALIGN_UNIT is better than the alignment as per ABI specification
// 2) DECL_ALIGN is set by user.
if (DECL_ALIGN_UNIT(decl)) {
unsigned TargetAlign = getTargetData().getABITypeAlignment(Ty);
From baldrick at free.fr Mon Feb 4 18:06:49 2008
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 5 Feb 2008 01:06:49 +0100
Subject: [llvm-commits] [llvm-gcc-4.2] r46670 - in
/llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp llvm-convert.cpp
In-Reply-To: <1AB86B5D-BCA8-43D5-8A03-BC96537D82DE@apple.com>
References: <200802022023.m12KNSV7027714@zion.cs.uiuc.edu>
<1AB86B5D-BCA8-43D5-8A03-BC96537D82DE@apple.com>
Message-ID: <200802050106.50268.baldrick@free.fr>
On Monday 4 February 2008 22:50:23 Devang Patel wrote:
> Please update associated comments also.
Sorry about that - done now.
Ciao,
Duncan.
From evan.cheng at apple.com Mon Feb 4 18:25:13 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 05 Feb 2008 00:25:13 -0000
Subject: [llvm-commits] [llvm] r46729 -
/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
Message-ID: <200802050025.m150PD4n022977@zion.cs.uiuc.edu>
Author: evancheng
Date: Mon Feb 4 18:25:13 2008
New Revision: 46729
URL: http://llvm.org/viewvc/llvm-project?rev=46729&view=rev
Log:
Unbreak teh build.
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=46729&r1=46728&r2=46729&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Mon Feb 4 18:25:13 2008
@@ -27,6 +27,7 @@
class GlobalAlias;
class MachineConstantPoolEntry;
class MachineConstantPoolValue;
+ class MachineModuleInfo;
class Mangler;
class TargetAsmInfo;
class Type;
@@ -43,6 +44,11 @@
///
unsigned FunctionNumber;
+ /// MachineModuleInfo - This is needed because printDeclare() has to insert
+ /// DebugVariable entries into the dwarf table. This is a short term hack
+ /// that ought be fixed soon.
+ MachineModuleInfo *MMI;
+
protected:
// Necessary for external weak linkage support
std::set ExtWeakSymbols;
From evan.cheng at apple.com Mon Feb 4 18:25:31 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 05 Feb 2008 00:25:31 -0000
Subject: [llvm-commits] [llvm] r46730 -
/llvm/trunk/test/C++Frontend/2006-11-06-StackTrace.cpp
Message-ID: <200802050025.m150PVXZ022997@zion.cs.uiuc.edu>
Author: evancheng
Date: Mon Feb 4 18:25:31 2008
New Revision: 46730
URL: http://llvm.org/viewvc/llvm-project?rev=46730&view=rev
Log:
This should also work on x86 now.
Modified:
llvm/trunk/test/C++Frontend/2006-11-06-StackTrace.cpp
Modified: llvm/trunk/test/C++Frontend/2006-11-06-StackTrace.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/C%2B%2BFrontend/2006-11-06-StackTrace.cpp?rev=46730&r1=46729&r2=46730&view=diff
==============================================================================
--- llvm/trunk/test/C++Frontend/2006-11-06-StackTrace.cpp (original)
+++ llvm/trunk/test/C++Frontend/2006-11-06-StackTrace.cpp Mon Feb 4 18:25:31 2008
@@ -9,8 +9,8 @@
// RUN: gdb -q -batch -n -x %t.in %t.exe | \
// RUN: grep {#7 0x.* in main.*(argc=\[12\],.*argv=.*)}
-// Only works on ppc. Should generalize?
-// XFAIL: i[1-9]86|alpha|ia64|arm|x86_64|amd64
+// Only works on ppc and x86. Should generalize?
+// XFAIL: alpha|ia64|arm|x86_64|amd64
#include
From dalej at apple.com Mon Feb 4 19:12:10 2008
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 05 Feb 2008 01:12:10 -0000
Subject: [llvm-commits] [llvm] r46733 -
/llvm/trunk/include/llvm/IntrinsicsX86.td
Message-ID: <200802050112.m151CBfH015222@zion.cs.uiuc.edu>
Author: johannes
Date: Mon Feb 4 19:12:10 2008
New Revision: 46733
URL: http://llvm.org/viewvc/llvm-project?rev=46733&view=rev
Log:
Missed one.
Modified:
llvm/trunk/include/llvm/IntrinsicsX86.td
Modified: llvm/trunk/include/llvm/IntrinsicsX86.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=46733&r1=46732&r2=46733&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IntrinsicsX86.td (original)
+++ llvm/trunk/include/llvm/IntrinsicsX86.td Mon Feb 4 19:12:10 2008
@@ -764,11 +764,11 @@
// Vector extract
let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse41_pextrb :
+ def int_x86_sse41_pextrb :
Intrinsic<[llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty]>;
- def int_x86_sse41_pextrd :
+ def int_x86_sse41_pextrd :
Intrinsic<[llvm_i32_ty, llvm_v4i32_ty, llvm_i32_ty]>;
- def int_x86_sse41_pextrq : GCCBuiltin<"__builtin_ia32_vec_ext_v2di">,
+ def int_x86_sse41_pextrq :
Intrinsic<[llvm_i64_ty, llvm_v2i64_ty, llvm_i32_ty]>;
def int_x86_sse41_extractps : GCCBuiltin<"__builtin_ia32_extractps128">,
Intrinsic<[llvm_i32_ty, llvm_v4f32_ty, llvm_i32_ty]>;
From resistor at mac.com Mon Feb 4 22:34:04 2008
From: resistor at mac.com (Owen Anderson)
Date: Tue, 05 Feb 2008 04:34:04 -0000
Subject: [llvm-commits] [llvm] r46738 -
/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
Message-ID: <200802050434.m154Y4xN005797@zion.cs.uiuc.edu>
Author: resistor
Date: Mon Feb 4 22:34:03 2008
New Revision: 46738
URL: http://llvm.org/viewvc/llvm-project?rev=46738&view=rev
Log:
Fix an obscure read-after-free bug that Duncan found.
Modified:
llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=46738&r1=46737&r2=46738&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Mon Feb 4 22:34:03 2008
@@ -463,15 +463,17 @@
reverseDep[depGraphLocal[rem].first].erase(rem);
if (depGraphEntry->second.first != NonLocal &&
+ depGraphEntry->second.first != None &&
depGraphEntry->second.second) {
// If we have dep info for rem, set them to it
BasicBlock::iterator RI = depGraphEntry->second.first;
RI++;
newDep = RI;
- } else if (depGraphEntry->second.first == NonLocal &&
+ } else if ( (depGraphEntry->second.first == NonLocal ||
+ depGraphEntry->second.first == None ) &&
depGraphEntry->second.second ) {
// If we have a confirmed non-local flag, use it
- newDep = NonLocal;
+ newDep = depGraphEntry->second.first;
} else {
// Otherwise, use the immediate successor of rem
// NOTE: This is because, when getDependence is called, it will first
@@ -480,14 +482,22 @@
RI++;
newDep = RI;
}
-
- SmallPtrSet& set = reverseDep[rem];
- for (SmallPtrSet::iterator I = set.begin(), E = set.end();
- I != E; ++I) {
- // Insert the new dependencies
- // Mark it as unconfirmed as long as it is not the non-local flag
- depGraphLocal[*I] = std::make_pair(newDep, !newDep);
- }
+ } else {
+ // Otherwise, use the immediate successor of rem
+ // NOTE: This is because, when getDependence is called, it will first
+ // check the immediate predecessor of what is in the cache.
+ BasicBlock::iterator RI = rem;
+ RI++;
+ newDep = RI;
+ }
+
+ SmallPtrSet& set = reverseDep[rem];
+ for (SmallPtrSet::iterator I = set.begin(), E = set.end();
+ I != E; ++I) {
+ // Insert the new dependencies
+ // Mark it as unconfirmed as long as it is not the non-local flag
+ depGraphLocal[*I] = std::make_pair(newDep, (newDep == NonLocal ||
+ newDep == None));
}
depGraphLocal.erase(rem);
From sabre at nondot.org Mon Feb 4 22:45:35 2008
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 05 Feb 2008 04:45:35 -0000
Subject: [llvm-commits] [llvm] r46739 - in /llvm/trunk:
lib/Transforms/Scalar/InstructionCombining.cpp
test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll
Message-ID: <200802050445.m154jaYY006291@zion.cs.uiuc.edu>
Author: lattner
Date: Mon Feb 4 22:45:32 2008
New Revision: 46739
URL: http://llvm.org/viewvc/llvm-project?rev=46739&view=rev
Log:
Fix a bug compiling PR1978 (perhaps not the only one though) which
was incorrectly simplifying "x == (gep x, 1, i)" into false, even
though i could be negative. As it turns out, all the code to
handle this already existed, we just need to disable the incorrect
optimization case and let the general case handle it.
Added:
llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=46739&r1=46738&r2=46739&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Feb 4 22:45:32 2008
@@ -4629,60 +4629,11 @@
Value *PtrBase = GEPLHS->getOperand(0);
if (PtrBase == RHS) {
- // As an optimization, we don't actually have to compute the actual value of
- // OFFSET if this is a icmp_eq or icmp_ne comparison, just return whether
- // each index is zero or not.
- if (Cond == ICmpInst::ICMP_EQ || Cond == ICmpInst::ICMP_NE) {
- Instruction *InVal = 0;
- gep_type_iterator GTI = gep_type_begin(GEPLHS);
- for (unsigned i = 1, e = GEPLHS->getNumOperands(); i != e; ++i, ++GTI) {
- bool EmitIt = true;
- if (Constant *C = dyn_cast(GEPLHS->getOperand(i))) {
- if (isa(C)) // undef index -> undef.
- return ReplaceInstUsesWith(I, UndefValue::get(I.getType()));
- if (C->isNullValue())
- EmitIt = false;
- else if (TD->getABITypeSize(GTI.getIndexedType()) == 0) {
- EmitIt = false; // This is indexing into a zero sized array?
- } else if (isa(C))
- return ReplaceInstUsesWith(I, // No comparison is needed here.
- ConstantInt::get(Type::Int1Ty,
- Cond == ICmpInst::ICMP_NE));
- }
-
- if (EmitIt) {
- Instruction *Comp =
- new ICmpInst(Cond, GEPLHS->getOperand(i),
- Constant::getNullValue(GEPLHS->getOperand(i)->getType()));
- if (InVal == 0)
- InVal = Comp;
- else {
- InVal = InsertNewInstBefore(InVal, I);
- InsertNewInstBefore(Comp, I);
- if (Cond == ICmpInst::ICMP_NE) // True if any are unequal
- InVal = BinaryOperator::createOr(InVal, Comp);
- else // True if all are equal
- InVal = BinaryOperator::createAnd(InVal, Comp);
- }
- }
- }
-
- if (InVal)
- return InVal;
- else
- // No comparison is needed here, all indexes = 0
- ReplaceInstUsesWith(I, ConstantInt::get(Type::Int1Ty,
- Cond == ICmpInst::ICMP_EQ));
- }
-
- // Only lower this if the icmp is the only user of the GEP or if we expect
- // the result to fold to a constant!
- if (isa(GEPLHS) || GEPLHS->hasOneUse()) {
- // ((gep Ptr, OFFSET) cmp Ptr) ---> (OFFSET cmp 0).
- Value *Offset = EmitGEPOffset(GEPLHS, I, *this);
- return new ICmpInst(ICmpInst::getSignedPredicate(Cond), Offset,
- Constant::getNullValue(Offset->getType()));
- }
+ // ((gep Ptr, OFFSET) cmp Ptr) ---> (OFFSET cmp 0).
+ // This transformation is valid because we know pointers can't overflow.
+ Value *Offset = EmitGEPOffset(GEPLHS, I, *this);
+ return new ICmpInst(ICmpInst::getSignedPredicate(Cond), Offset,
+ Constant::getNullValue(Offset->getType()));
} else if (User *GEPRHS = dyn_castGetElementPtr(RHS)) {
// If the base pointers are different, but the indices are the same, just
// compare the base pointer.
Added: llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll?rev=46739&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll (added)
+++ llvm/trunk/test/Transforms/InstCombine/2008-02-04-GEPIdxBug.ll Mon Feb 4 22:45:32 2008
@@ -0,0 +1,33 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp eq i32 %indvar, 0}
+; PR1978
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
+target triple = "i686-apple-darwin8"
+ %struct.x = type <{ i8 }>
+ at .str = internal constant [6 x i8] c"Main!\00" ; <[6 x i8]*> [#uses=1]
+ at .str1 = internal constant [12 x i8] c"destroy %p\0A\00" ; <[12 x i8]*> [#uses=1]
+
+define i32 @main() nounwind {
+entry:
+ %orientations = alloca [1 x [1 x %struct.x]] ; <[1 x [1 x %struct.x]]*> [#uses=2]
+ %tmp3 = call i32 @puts( i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0) ) nounwind ; [#uses=0]
+ %tmp45 = getelementptr [1 x [1 x %struct.x]]* %orientations, i32 1, i32 0, i32 0 ; <%struct.x*> [#uses=1]
+ %orientations62 = getelementptr [1 x [1 x %struct.x]]* %orientations, i32 0, i32 0, i32 0 ; <%struct.x*> [#uses=1]
+ br label %bb10
+
+bb10: ; preds = %bb10, %entry
+ %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb10 ] ; [#uses=2]
+ %tmp.0.reg2mem.0.rec = mul i32 %indvar, -1 ; [#uses=1]
+ %tmp12.rec = add i32 %tmp.0.reg2mem.0.rec, -1 ; [#uses=1]
+ %tmp12 = getelementptr %struct.x* %tmp45, i32 %tmp12.rec ; <%struct.x*> [#uses=2]
+ %tmp16 = call i32 (i8*, ...)* @printf( i8* getelementptr ([12 x i8]* @.str1, i32 0, i32 0), %struct.x* %tmp12 ) nounwind ; [#uses=0]
+ %tmp84 = icmp eq %struct.x* %tmp12, %orientations62 ; [#uses=1]
+ %indvar.next = add i32 %indvar, 1 ; [#uses=1]
+ br i1 %tmp84, label %bb17, label %bb10
+
+bb17: ; preds = %bb10
+ ret i32 0
+}
+
+declare i32 @puts(i8*)
+
+declare i32 @printf(i8*, ...)
From clattner at apple.com Mon Feb 4 23:07:08 2008
From: clattner at apple.com (Chris Lattner)
Date: Mon, 4 Feb 2008 21:07:08 -0800
Subject: [llvm-commits] [llvm] r46727 -
/llvm/trunk/include/llvm/IntrinsicsX86.td
In-Reply-To: <200802042327.m14NRT7G021211@zion.cs.uiuc.edu>
References: <200802042327.m14NRT7G021211@zion.cs.uiuc.edu>
Message-ID: <9642BC09-56CD-4C7C-9294-0E5EA9D99F3E@apple.com>
On Feb 4, 2008, at 3:27 PM, Dale Johannesen wrote:
> Author: johannes
> Date: Mon Feb 4 17:27:29 2008
> New Revision: 46727
>
> URL: http://llvm.org/viewvc/llvm-project?rev=46727&view=rev
> Log:
> Do not unconditionally redefine vec_ext_v16qi and
> vec_ext_v4si builtins. This is a hack; they should
> be defined here, then resolved in the X86 BE.
> However there is enough other stuff missing in the
> X86 BE for SSE41 that this will do for now.
I think these are in the category of builtins that should be expanded
by the FE, and thus should be removed. Nate, thoughts?
-Chris
>
>
> Modified:
> llvm/trunk/include/llvm/IntrinsicsX86.td
>
> Modified: llvm/trunk/include/llvm/IntrinsicsX86.td
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=46727&r1=46726&r2=46727&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/IntrinsicsX86.td (original)
> +++ llvm/trunk/include/llvm/IntrinsicsX86.td Mon Feb 4 17:27:29 2008
> @@ -764,9 +764,9 @@
>
> // Vector extract
> let TargetPrefix = "x86" in { // All intrinsics start with
> "llvm.x86.".
> - def int_x86_sse41_pextrb :
> GCCBuiltin<"__builtin_ia32_vec_ext_v16qi">,
> + def int_x86_sse41_pextrb :
> Intrinsic<[llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty]>;
> - def int_x86_sse41_pextrd :
> GCCBuiltin<"__builtin_ia32_vec_ext_v4si">,
> + def int_x86_sse41_pextrd :
> Intrinsic<[llvm_i32_ty, llvm_v4i32_ty, llvm_i32_ty]>;
> def int_x86_sse41_pextrq :
> GCCBuiltin<"__builtin_ia32_vec_ext_v2di">,
> Intrinsic<[llvm_i64_ty, llvm_v2i64_ty, llvm_i32_ty]>;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From sabre at nondot.org Tue Feb 5 00:18:42 2008
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 05 Feb 2008 06:18:42 -0000
Subject: [llvm-commits] [llvm] r46741 - in /llvm/trunk/docs/tutorial:
LangImpl4.html LangImpl5.html LangImpl6.html LangImpl7.html
Message-ID: <200802050618.m156IgGf009108@zion.cs.uiuc.edu>
Author: lattner
Date: Tue Feb 5 00:18:42 2008
New Revision: 46741
URL: http://llvm.org/viewvc/llvm-project?rev=46741&view=rev
Log:
dump the module *before* we delete it, not after.
Modified:
llvm/trunk/docs/tutorial/LangImpl4.html
llvm/trunk/docs/tutorial/LangImpl5.html
llvm/trunk/docs/tutorial/LangImpl6.html
llvm/trunk/docs/tutorial/LangImpl7.html
Modified: llvm/trunk/docs/tutorial/LangImpl4.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl4.html?rev=46741&r1=46740&r2=46741&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl4.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl4.html Tue Feb 5 00:18:42 2008
@@ -1109,11 +1109,11 @@
MainLoop();
TheFPM = 0;
- } // Free module provider and pass manager.
-
+
+ // Print out all of the generated code.
+ TheModule->dump();
+ } // Free module provider (and thus the module) and pass manager.
- // Print out all of the generated code.
- TheModule->dump();
return 0;
}
Modified: llvm/trunk/docs/tutorial/LangImpl5.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl5.html?rev=46741&r1=46740&r2=46741&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl5.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl5.html Tue Feb 5 00:18:42 2008
@@ -1735,11 +1735,11 @@
MainLoop();
TheFPM = 0;
- } // Free module provider and pass manager.
-
+
+ // Print out all of the generated code.
+ TheModule->dump();
+ } // Free module provider (and thus the module) and pass manager.
- // Print out all of the generated code.
- TheModule->dump();
return 0;
}
Modified: llvm/trunk/docs/tutorial/LangImpl6.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl6.html?rev=46741&r1=46740&r2=46741&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl6.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl6.html Tue Feb 5 00:18:42 2008
@@ -1774,11 +1774,11 @@
MainLoop();
TheFPM = 0;
- } // Free module provider and pass manager.
-
-
- // Print out all of the generated code.
- TheModule->dump();
+
+ // Print out all of the generated code.
+ TheModule->dump();
+ } // Free module provider (and thus the module) and pass manager.
+
return 0;
}
Modified: llvm/trunk/docs/tutorial/LangImpl7.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl7.html?rev=46741&r1=46740&r2=46741&view=diff
==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl7.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl7.html Tue Feb 5 00:18:42 2008
@@ -2129,11 +2129,12 @@
MainLoop();
TheFPM = 0;
- } // Free module provider and pass manager.
-
-
- // Print out all of the generated code.
- TheModule->dump();
+
+ // Print out all of the generated code.
+ TheModule->dump();
+
+ } // Free module provider (and thus the module) and pass manager.
+
return 0;
}
From baldrick at free.fr Tue Feb 5 01:18:05 2008
From: baldrick at free.fr (Duncan Sands)
Date: Tue, 5 Feb 2008 08:18:05 +0100
Subject: [llvm-commits] [llvm-gcc-4.2] r46726 -
/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
In-Reply-To: <200802042324.m14NOiBg021071@zion.cs.uiuc.edu>
References: <200802042324.m14NOiBg021071@zion.cs.uiuc.edu>
Message-ID: <200802050818.06207.baldrick@free.fr>
Hi Devang,
> Use appropriate alignment while handling packed struct member.
do you have a testcase for this?
Thanks,
Duncan.
From natebegeman at mac.com Tue Feb 5 02:49:10 2008
From: natebegeman at mac.com (Nate Begeman)
Date: Tue, 05 Feb 2008 08:49:10 -0000
Subject: [llvm-commits] [llvm] r46746 -
/llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
Message-ID: <200802050849.m158nB2A021724@zion.cs.uiuc.edu>
Author: sampo
Date: Tue Feb 5 02:49:09 2008
New Revision: 46746
URL: http://llvm.org/viewvc/llvm-project?rev=46746&view=rev
Log:
Ident mnemonics appropriately
Modified:
llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp?rev=46746&r1=46745&r2=46746&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Tue Feb 5 02:49:09 2008
@@ -514,10 +514,10 @@
unsigned char MB = MI->getOperand(3).getImm();
unsigned char ME = MI->getOperand(4).getImm();
if (SH <= 31 && MB == 0 && ME == (31-SH)) {
- O << "slwi "; FoundMnemonic = true;
+ O << "\tslwi "; FoundMnemonic = true;
}
if (SH <= 31 && MB == (32-SH) && ME == 31) {
- O << "srwi "; FoundMnemonic = true;
+ O << "\tsrwi "; FoundMnemonic = true;
SH = 32-SH;
}
if (FoundMnemonic) {
@@ -529,7 +529,7 @@
}
} else if (MI->getOpcode() == PPC::OR || MI->getOpcode() == PPC::OR8) {
if (MI->getOperand(1).getReg() == MI->getOperand(2).getReg()) {
- O << "mr ";
+ O << "\tmr ";
printOperand(MI, 0);
O << ", ";
printOperand(MI, 1);
@@ -541,7 +541,7 @@
unsigned char ME = MI->getOperand(3).getImm();
// rldicr RA, RS, SH, 63-SH == sldi RA, RS, SH
if (63-SH == ME) {
- O << "sldi ";
+ O << "\tsldi ";
printOperand(MI, 0);
O << ", ";
printOperand(MI, 1);
From isanbard at gmail.com Tue Feb 5 03:46:25 2008
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 05 Feb 2008 09:46:25 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46747 - in /llvm-gcc-4.2/trunk/gcc:
config/darwin.c config/rs6000/rs6000.c varasm.c
Message-ID: <200802050946.m159kPRM023332@zion.cs.uiuc.edu>
Author: void
Date: Tue Feb 5 03:46:24 2008
New Revision: 46747
URL: http://llvm.org/viewvc/llvm-project?rev=46747&view=rev
Log:
maybe_assemble_visibility issues a warning if the visibility isn't supported on
a particular platform. A configuration might check for visibility. A warning in
this case indicates that it's not supported. So this warning is actually
important.
Make it so!
Modified:
llvm-gcc-4.2/trunk/gcc/config/darwin.c
llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c
llvm-gcc-4.2/trunk/gcc/varasm.c
Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.c?rev=46747&r1=46746&r2=46747&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin.c Tue Feb 5 03:46:24 2008
@@ -1988,6 +1988,19 @@
extern". There is no MACH-O equivalent of ELF's
VISIBILITY_INTERNAL or VISIBILITY_PROTECTED. */
+/* LLVM LOCAL begin */
+#ifdef ENABLE_LLVM
+void
+darwin_assemble_visibility (tree decl ATTRIBUTE_UNUSED, int vis)
+{
+ /* Emit a warning if the visibility isn't supported with this
+ configuration. We don't want to output anything to the ASM file, of
+ course. */
+ if (!(vis == VISIBILITY_DEFAULT || vis == VISIBILITY_HIDDEN))
+ warning (OPT_Wattributes, "internal and protected visibility attributes "
+ "not supported in this configuration; ignored");
+}
+#else
void
darwin_assemble_visibility (tree decl, int vis)
{
@@ -2004,6 +2017,8 @@
warning (OPT_Wattributes, "internal and protected visibility attributes "
"not supported in this configuration; ignored");
}
+#endif
+/* LLVM LOCAL end */
/* Output a difference of two labels that will be an assembly time
constant if the two labels are local. (.long lab1-lab2 will be
Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c?rev=46747&r1=46746&r2=46747&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c Tue Feb 5 03:46:24 2008
@@ -944,10 +944,14 @@
#undef TARGET_ASM_INTEGER
#define TARGET_ASM_INTEGER rs6000_assemble_integer
+/* LLVM LOCAL - Use default assemble_visibility */
+#ifndef ENABLE_LLVM
#ifdef HAVE_GAS_HIDDEN
#undef TARGET_ASM_ASSEMBLE_VISIBILITY
#define TARGET_ASM_ASSEMBLE_VISIBILITY rs6000_assemble_visibility
#endif
+/* LLVM LOCAL - Use default assemble_visibility */
+#endif
#undef TARGET_HAVE_TLS
#define TARGET_HAVE_TLS HAVE_AS_TLS
Modified: llvm-gcc-4.2/trunk/gcc/varasm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/varasm.c?rev=46747&r1=46746&r2=46747&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/varasm.c (original)
+++ llvm-gcc-4.2/trunk/gcc/varasm.c Tue Feb 5 03:46:24 2008
@@ -1889,7 +1889,15 @@
fprintf(stderr, "LLVM must emit the data!");
abort();
}
+
emit_global_to_llvm(decl);
+
+ /* The "make_assemble_visibility" method may issue a warning if the visibility
+ attribute isn't supported in a configuration. This is all done through a
+ call-back. We want to issue this same warning when needed. */
+ if (TREE_PUBLIC (decl))
+ maybe_assemble_visibility (decl);
+
return;
#endif
/* LLVM LOCAL end */
@@ -5307,7 +5315,8 @@
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
type = visibility_types[vis];
-#ifdef HAVE_GAS_HIDDEN
+
+#if !defined(ENABLE_LLVM) && defined(HAVE_GAS_HIDDEN)
fprintf (asm_out_file, "\t.%s\t", type);
assemble_name (asm_out_file, name);
fprintf (asm_out_file, "\n");
From isanbard at gmail.com Tue Feb 5 03:52:54 2008
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 05 Feb 2008 09:52:54 -0000
Subject: [llvm-commits] [llvm] r46748 - /llvm/tags/Apple/llvmCore-2015/
Message-ID: <200802050952.m159qsrc023513@zion.cs.uiuc.edu>
Author: void
Date: Tue Feb 5 03:52:54 2008
New Revision: 46748
URL: http://llvm.org/viewvc/llvm-project?rev=46748&view=rev
Log:
Creating llvmCore-2015 branch
Added:
llvm/tags/Apple/llvmCore-2015/
- copied from r46747, llvm/trunk/
From isanbard at gmail.com Tue Feb 5 03:53:01 2008
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 05 Feb 2008 09:53:01 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46749 -
/llvm-gcc-4.2/tags/Apple/llvmgcc42-2015/
Message-ID: <200802050953.m159r1Nt023534@zion.cs.uiuc.edu>
Author: void
Date: Tue Feb 5 03:53:01 2008
New Revision: 46749
URL: http://llvm.org/viewvc/llvm-project?rev=46749&view=rev
Log:
Creating llvmgcc42-2015 branch
Added:
llvm-gcc-4.2/tags/Apple/llvmgcc42-2015/
- copied from r46748, llvm-gcc-4.2/trunk/
From kremenek at apple.com Tue Feb 5 11:30:43 2008
From: kremenek at apple.com (Ted Kremenek)
Date: Tue, 05 Feb 2008 17:30:43 -0000
Subject: [llvm-commits] [llvm] r46753 - in /llvm/trunk/include/llvm/ADT:
ImmutableMap.h ImmutableSet.h
Message-ID: <200802051730.m15HUhgH004956@zion.cs.uiuc.edu>
Author: kremenek
Date: Tue Feb 5 11:30:43 2008
New Revision: 46753
URL: http://llvm.org/viewvc/llvm-project?rev=46753&view=rev
Log:
Changed profiling method for ImmutableMap to once again just use its
unique ImutAVLTree* for profiling.
Modified ImutAVLTree:
(1) changed ComputeHash() to ComputeDigest() and
(2) changed Profile() to use the computed digest and
(3) modified insertion of IMutAVLTree into the FoldingSet owned by
the ImutAVLTreeFactory object to use profiling instead of computing
a direct hash. This fixes a bug where our abuse of the FoldingSet would
not work when the FoldingSet was resized.
Modified:
llvm/trunk/include/llvm/ADT/ImmutableMap.h
llvm/trunk/include/llvm/ADT/ImmutableSet.h
Modified: llvm/trunk/include/llvm/ADT/ImmutableMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableMap.h?rev=46753&r1=46752&r2=46753&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableMap.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableMap.h Tue Feb 5 11:30:43 2008
@@ -206,7 +206,7 @@
inline unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
static inline void Profile(FoldingSetNodeID& ID, const ImmutableMap& M) {
- M.Root->Profile(ID);
+ ID.AddPointer(M.Root);
}
inline void Profile(FoldingSetNodeID& ID) const {
Modified: llvm/trunk/include/llvm/ADT/ImmutableSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableSet.h?rev=46753&r1=46752&r2=46753&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableSet.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableSet.h Tue Feb 5 11:30:43 2008
@@ -203,13 +203,10 @@
return getHeight();
}
- /// Profile - Profiling for ImutAVLTree. This is not used by the
- // Factory object (which internally uses a FoldingSet), but can
- // be used by external clients that wish to insert an ImutAVLTree
- // object into a FoldingSet.
- void Profile(llvm::FoldingSetNodeID& ID) const {
- ID.AddPointer(this);
- }
+ /// Profile - Profiling for ImutAVLTree.
+ void Profile(llvm::FoldingSetNodeID& ID) {
+ ID.AddInteger(ComputeDigest());
+ }
//===----------------------------------------------------===//
// Internal Values.
@@ -220,7 +217,7 @@
ImutAVLTree* Right;
unsigned Height;
value_type Value;
- unsigned Hash;
+ unsigned Digest;
//===----------------------------------------------------===//
// Internal methods (node manipulation; used by Factory).
@@ -234,7 +231,7 @@
/// ImutAVLFactory.
ImutAVLTree(ImutAVLTree* l, ImutAVLTree* r, value_type_ref v, unsigned height)
: Left(reinterpret_cast(l) | Mutable),
- Right(r), Height(height), Value(v), Hash(0) {}
+ Right(r), Height(height), Value(v), Digest(0) {}
/// isMutable - Returns true if the left and right subtree references
@@ -299,27 +296,27 @@
static inline
- unsigned ComputeHash(ImutAVLTree* L, ImutAVLTree* R, value_type_ref V) {
- unsigned hash = 0;
+ unsigned ComputeDigest(ImutAVLTree* L, ImutAVLTree* R, value_type_ref V) {
+ unsigned digest = 0;
- if (L) hash += L->ComputeHash();
+ if (L) digest += L->ComputeDigest();
- { // Compute hash of stored data.
+ { // Compute digest of stored data.
FoldingSetNodeID ID;
ImutInfo::Profile(ID,V);
- hash += ID.ComputeHash();
+ digest += ID.ComputeHash();
}
- if (R) hash += R->ComputeHash();
+ if (R) digest += R->ComputeDigest();
- return hash;
+ return digest;
}
- inline unsigned ComputeHash() {
- if (Hash) return Hash;
+ inline unsigned ComputeDigest() {
+ if (Digest) return Digest;
- unsigned X = ComputeHash(getSafeLeft(), getRight(), getValue());
- if (!isMutable()) Hash = X;
+ unsigned X = ComputeDigest(getSafeLeft(), getRight(), getValue());
+ if (!isMutable()) Digest = X;
return X;
}
@@ -408,15 +405,19 @@
//===--------------------------------------------------===//
TreeTy* CreateNode(TreeTy* L, value_type_ref V, TreeTy* R) {
- // Search the FoldingSet bucket for a Tree with the same hash.
- unsigned hash = TreeTy::ComputeHash(L, R, V);
+ // Search the FoldingSet bucket for a Tree with the same digest.
+ FoldingSetNodeID ID;
+ unsigned digest = TreeTy::ComputeDigest(L, R, V);
+ ID.AddInteger(digest);
+ unsigned hash = ID.ComputeHash();
+
typename CacheTy::bucket_iterator I = Cache.bucket_begin(hash);
typename CacheTy::bucket_iterator E = Cache.bucket_end(hash);
for (; I != E; ++I) {
TreeTy* T = &*I;
- if (T->ComputeHash() != hash)
+ if (T->ComputeDigest() != digest)
continue;
// We found a collision. Perform a comparison of Contents('T')
@@ -454,7 +455,7 @@
// We do not insert 'T' into the FoldingSet here. This is because
// this tree is still mutable and things may get rebalanced.
- // Because our hash is associative and based on the contents of
+ // Because our digest is associative and based on the contents of
// the set, this should hopefully not cause any strange bugs.
// 'T' is inserted by 'MarkImmutable'.
@@ -592,7 +593,9 @@
// Now that the node is immutable it can safely be inserted
// into the node cache.
- Cache.InsertNode(T, (void*) &*Cache.bucket_end(T->ComputeHash()));
+ llvm::FoldingSetNodeID ID;
+ ID.AddInteger(T->ComputeDigest());
+ Cache.InsertNode(T, (void*) &*Cache.bucket_end(ID.ComputeHash()));
}
};
From dalej at apple.com Tue Feb 5 11:43:00 2008
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 5 Feb 2008 09:43:00 -0800
Subject: [llvm-commits] [llvm] r46727 -
/llvm/trunk/include/llvm/IntrinsicsX86.td
In-Reply-To: <9642BC09-56CD-4C7C-9294-0E5EA9D99F3E@apple.com>
References: <200802042327.m14NRT7G021211@zion.cs.uiuc.edu>
<9642BC09-56CD-4C7C-9294-0E5EA9D99F3E@apple.com>
Message-ID: <80FF2637-CEA7-46E1-8078-8C7EDAED9CD1@apple.com>
On Feb 4, 2008, at 9:07 PM, Chris Lattner wrote:
>
> On Feb 4, 2008, at 3:27 PM, Dale Johannesen wrote:
>
>> Author: johannes
>> Date: Mon Feb 4 17:27:29 2008
>> New Revision: 46727
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=46727&view=rev
>> Log:
>> Do not unconditionally redefine vec_ext_v16qi and
>> vec_ext_v4si builtins. This is a hack; they should
>> be defined here, then resolved in the X86 BE.
>> However there is enough other stuff missing in the
>> X86 BE for SSE41 that this will do for now.
>
> I think these are in the category of builtins that should be expanded
> by the FE, and thus should be removed. Nate, thoughts?
>
> -Chris
That means you have to know whether you've got SSE4.1 in the FE.
This is not an insuperable obstacle, but I think it's better to leave
target
dependencies in the BE when possible.
>> Modified:
>> llvm/trunk/include/llvm/IntrinsicsX86.td
>>
>> Modified: llvm/trunk/include/llvm/IntrinsicsX86.td
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=46727&r1=46726&r2=46727&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- llvm/trunk/include/llvm/IntrinsicsX86.td (original)
>> +++ llvm/trunk/include/llvm/IntrinsicsX86.td Mon Feb 4 17:27:29 2008
>> @@ -764,9 +764,9 @@
>>
>> // Vector extract
>> let TargetPrefix = "x86" in { // All intrinsics start with
>> "llvm.x86.".
>> - def int_x86_sse41_pextrb :
>> GCCBuiltin<"__builtin_ia32_vec_ext_v16qi">,
>> + def int_x86_sse41_pextrb :
>> Intrinsic<[llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty]>;
>> - def int_x86_sse41_pextrd :
>> GCCBuiltin<"__builtin_ia32_vec_ext_v4si">,
>> + def int_x86_sse41_pextrd :
>> Intrinsic<[llvm_i32_ty, llvm_v4i32_ty, llvm_i32_ty]>;
>> def int_x86_sse41_pextrq :
>> GCCBuiltin<"__builtin_ia32_vec_ext_v2di">,
>> Intrinsic<[llvm_i64_ty, llvm_v2i64_ty, llvm_i32_ty]>;
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From asl at math.spbu.ru Tue Feb 5 12:38:29 2008
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Tue, 05 Feb 2008 21:38:29 +0300
Subject: [llvm-commits] [llvm] r46730
- /llvm/trunk/test/C++Frontend/2006-11-06-StackTrace.cpp
In-Reply-To: <200802050025.m150PVXZ022997@zion.cs.uiuc.edu>
References: <200802050025.m150PVXZ022997@zion.cs.uiuc.edu>
Message-ID: <1202236709.17220.19.camel@asl.dorms.spbu.ru>
Evan,
> This should also work on x86 now.
But this this worked on PPC before then?
--
With best regards, Anton Korobeynikov.
Faculty of Mathematics & Mechanics, Saint Petersburg State University.
From kremenek at apple.com Tue Feb 5 12:50:25 2008
From: kremenek at apple.com (Ted Kremenek)
Date: Tue, 05 Feb 2008 18:50:25 -0000
Subject: [llvm-commits] [llvm] r46757 -
/llvm/trunk/include/llvm/ADT/ImmutableSet.h
Message-ID: <200802051850.m15IoPvF008002@zion.cs.uiuc.edu>
Author: kremenek
Date: Tue Feb 5 12:50:25 2008
New Revision: 46757
URL: http://llvm.org/viewvc/llvm-project?rev=46757&view=rev
Log:
Added FoldingSet profiling support to ImmutableSet.
Modified:
llvm/trunk/include/llvm/ADT/ImmutableSet.h
Modified: llvm/trunk/include/llvm/ADT/ImmutableSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableSet.h?rev=46757&r1=46756&r2=46757&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableSet.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableSet.h Tue Feb 5 12:50:25 2008
@@ -1012,11 +1012,24 @@
iterator end() const { return iterator(); }
//===--------------------------------------------------===//
+ // Utility methods.
+ //===--------------------------------------------------===//
+
+ inline unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
+
+ static inline void Profile(FoldingSetNodeID& ID, const ImmutableSet& S) {
+ ID.AddPointer(S.Root);
+ }
+
+ inline void Profile(FoldingSetNodeID& ID) const {
+ return Profile(ID,*this);
+ }
+
+ //===--------------------------------------------------===//
// For testing.
//===--------------------------------------------------===//
void verify() const { if (Root) Root->verify(); }
- unsigned getHeight() const { return Root ? Root->getHeight() : 0; }
};
} // end namespace llvm
From evan.cheng at apple.com Tue Feb 5 13:37:23 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 5 Feb 2008 11:37:23 -0800
Subject: [llvm-commits] [llvm] r46727 -
/llvm/trunk/include/llvm/IntrinsicsX86.td
In-Reply-To: <80FF2637-CEA7-46E1-8078-8C7EDAED9CD1@apple.com>
References: <200802042327.m14NRT7G021211@zion.cs.uiuc.edu>
<9642BC09-56CD-4C7C-9294-0E5EA9D99F3E@apple.com>
<80FF2637-CEA7-46E1-8078-8C7EDAED9CD1@apple.com>
Message-ID: <95A45B70-64AB-4283-815A-14CB22ECAA17@apple.com>
On Feb 5, 2008, at 9:43 AM, Dale Johannesen wrote:
>
> On Feb 4, 2008, at 9:07 PM, Chris Lattner wrote:
>
>>
>> On Feb 4, 2008, at 3:27 PM, Dale Johannesen wrote:
>>
>>> Author: johannes
>>> Date: Mon Feb 4 17:27:29 2008
>>> New Revision: 46727
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=46727&view=rev
>>> Log:
>>> Do not unconditionally redefine vec_ext_v16qi and
>>> vec_ext_v4si builtins. This is a hack; they should
>>> be defined here, then resolved in the X86 BE.
>>> However there is enough other stuff missing in the
>>> X86 BE for SSE41 that this will do for now.
>>
>> I think these are in the category of builtins that should be expanded
>> by the FE, and thus should be removed. Nate, thoughts?
>>
>> -Chris
>
> That means you have to know whether you've got SSE4.1 in the FE.
> This is not an insuperable obstacle, but I think it's better to leave
> target
> dependencies in the BE when possible.
Even with SSE4.1, it's a good idea to lower them to extract element
instructions. X86ISelLoweringhas all the information necessary to
determine what instructions to they should be selected to.
Evan
>
>
>>> Modified:
>>> llvm/trunk/include/llvm/IntrinsicsX86.td
>>>
>>> Modified: llvm/trunk/include/llvm/IntrinsicsX86.td
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=46727&r1=46726&r2=46727&view=diff
>>>
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> ====================================================================
>>> --- llvm/trunk/include/llvm/IntrinsicsX86.td (original)
>>> +++ llvm/trunk/include/llvm/IntrinsicsX86.td Mon Feb 4 17:27:29
>>> 2008
>>> @@ -764,9 +764,9 @@
>>>
>>> // Vector extract
>>> let TargetPrefix = "x86" in { // All intrinsics start with
>>> "llvm.x86.".
>>> - def int_x86_sse41_pextrb :
>>> GCCBuiltin<"__builtin_ia32_vec_ext_v16qi">,
>>> + def int_x86_sse41_pextrb :
>>> Intrinsic<[llvm_i32_ty, llvm_v16i8_ty, llvm_i32_ty]>;
>>> - def int_x86_sse41_pextrd :
>>> GCCBuiltin<"__builtin_ia32_vec_ext_v4si">,
>>> + def int_x86_sse41_pextrd :
>>> Intrinsic<[llvm_i32_ty, llvm_v4i32_ty, llvm_i32_ty]>;
>>> def int_x86_sse41_pextrq :
>>> GCCBuiltin<"__builtin_ia32_vec_ext_v2di">,
>>> Intrinsic<[llvm_i64_ty, llvm_v2i64_ty, llvm_i32_ty]>;
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From evan.cheng at apple.com Tue Feb 5 13:37:47 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 5 Feb 2008 11:37:47 -0800
Subject: [llvm-commits] [llvm] r46730 -
/llvm/trunk/test/C++Frontend/2006-11-06-StackTrace.cpp
In-Reply-To: <1202236709.17220.19.camel@asl.dorms.spbu.ru>
References: <200802050025.m150PVXZ022997@zion.cs.uiuc.edu>
<1202236709.17220.19.camel@asl.dorms.spbu.ru>
Message-ID: <8B7F6F6E-8E1C-4C19-945D-17E91BF2F0FB@apple.com>
Yes it did.
Evan
On Feb 5, 2008, at 10:38 AM, Anton Korobeynikov wrote:
> Evan,
>
>> This should also work on x86 now.
> But this this worked on PPC before then?
>
> --
> With best regards, Anton Korobeynikov.
>
> Faculty of Mathematics & Mechanics, Saint Petersburg State University.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From clattner at apple.com Tue Feb 5 13:39:43 2008
From: clattner at apple.com (Chris Lattner)
Date: Tue, 5 Feb 2008 11:39:43 -0800
Subject: [llvm-commits] [llvm] r46727 -
/llvm/trunk/include/llvm/IntrinsicsX86.td
In-Reply-To: <95A45B70-64AB-4283-815A-14CB22ECAA17@apple.com>
References: <200802042327.m14NRT7G021211@zion.cs.uiuc.edu>
<9642BC09-56CD-4C7C-9294-0E5EA9D99F3E@apple.com>
<80FF2637-CEA7-46E1-8078-8C7EDAED9CD1@apple.com>
<95A45B70-64AB-4283-815A-14CB22ECAA17@apple.com>
Message-ID: <15D95739-61E8-4952-B170-06A6FB1A3716@apple.com>
On Feb 5, 2008, at 11:37 AM, Evan Cheng wrote:
>> That means you have to know whether you've got SSE4.1 in the FE.
>> This is not an insuperable obstacle, but I think it's better to leave
>> target
>> dependencies in the BE when possible.
>
> Even with SSE4.1, it's a good idea to lower them to extract element
> instructions. X86ISelLoweringhas all the information necessary to
> determine what instructions to they should be selected to.
Do you mean 'even without SSE4.1'?
-Chris
From evan.cheng at apple.com Tue Feb 5 13:41:07 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 5 Feb 2008 11:41:07 -0800
Subject: [llvm-commits] [llvm] r46727 -
/llvm/trunk/include/llvm/IntrinsicsX86.td
In-Reply-To: <15D95739-61E8-4952-B170-06A6FB1A3716@apple.com>
References: <200802042327.m14NRT7G021211@zion.cs.uiuc.edu>
<9642BC09-56CD-4C7C-9294-0E5EA9D99F3E@apple.com>
<80FF2637-CEA7-46E1-8078-8C7EDAED9CD1@apple.com>
<95A45B70-64AB-4283-815A-14CB22ECAA17@apple.com>
<15D95739-61E8-4952-B170-06A6FB1A3716@apple.com>
Message-ID: <72BEB2A5-7674-43F4-9101-86C018AC62A7@apple.com>
With or without...
On Feb 5, 2008, at 11:39 AM, Chris Lattner wrote:
>
> On Feb 5, 2008, at 11:37 AM, Evan Cheng wrote:
>
>>> That means you have to know whether you've got SSE4.1 in the FE.
>>> This is not an insuperable obstacle, but I think it's better to
>>> leave
>>> target
>>> dependencies in the BE when possible.
>>
>> Even with SSE4.1, it's a good idea to lower them to extract element
>> instructions. X86ISelLoweringhas all the information necessary to
>> determine what instructions to they should be selected to.
>
> Do you mean 'even without SSE4.1'?
>
> -Chris
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From sabre at nondot.org Tue Feb 5 13:43:41 2008
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 05 Feb 2008 19:43:41 -0000
Subject: [llvm-commits] [llvm] r46760 - in /llvm/trunk: Makefile.rules
autoconf/configure.ac
Message-ID: <200802051943.m15Jhflj013152@zion.cs.uiuc.edu>
Author: lattner
Date: Tue Feb 5 13:43:40 2008
New Revision: 46760
URL: http://llvm.org/viewvc/llvm-project?rev=46760&view=rev
Log:
Make the check for GCC version more robust, fix shared library
dependencies in makefile, and fix llvm_cv_no_link_all_option
on darwin.
Patch by Shantonu Sen, more info here:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-February/012410.html
Modified:
llvm/trunk/Makefile.rules
llvm/trunk/autoconf/configure.ac
Modified: llvm/trunk/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=46760&r1=46759&r2=46760&view=diff
==============================================================================
--- llvm/trunk/Makefile.rules (original)
+++ llvm/trunk/Makefile.rules Tue Feb 5 13:43:40 2008
@@ -805,7 +805,7 @@
else
SharedLibKindMessage := "Shared Library"
endif
-$(LibName.LA): $(ObjectsLO) $(LibDir)/.dir
+$(LibName.LA): $(ObjectsLO) $(ProjLibsPaths) $(LLVMLibsPaths) $(LibDir)/.dir
$(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
$(LIBRARYNAME)$(SHLIBEXT)
$(Verb) $(LTLink) -o $@ $(ObjectsLO) $(ProjLibsOptions) \
Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=46760&r1=46759&r2=46760&view=diff
==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Tue Feb 5 13:43:40 2008
@@ -119,7 +119,7 @@
llvm_cv_platform_type="Unix" ;;
*-*-darwin*)
llvm_cv_link_all_option="-Wl,-all_load"
- llvm_cv_link_all_option="-Wl,-noall_load"
+ llvm_cv_no_link_all_option="-Wl,-noall_load"
llvm_cv_os_type="Darwin"
llvm_cv_platform_type="Unix" ;;
*-*-freebsd*)
@@ -656,11 +656,10 @@
dnl Verify that GCC is version 3.0 or higher
if test "$GCC" = "yes"
then
- gccmajor=`$CC --version | head -n 1 | sed 's/[[^0-9]]*\([[0-9.]]\).*/\1/'`
- if test "$gccmajor" -lt "3"
- then
- AC_MSG_ERROR([gcc 3.x required, but you have a lower version])
- fi
+ AC_COMPILE_IFELSE([[#if !defined(__GNUC__) || __GNUC__ < 3
+#error Unsupported GCC version
+#endif
+]], [], [AC_MSG_ERROR([gcc 3.x required, but you have a lower version])])
fi
dnl Check for GNU Make. We use its extensions, so don't build without it
From sabre at nondot.org Tue Feb 5 13:43:53 2008
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 05 Feb 2008 19:43:53 -0000
Subject: [llvm-commits] [llvm] r46761 - /llvm/trunk/configure
Message-ID: <200802051943.m15Jhs5S013171@zion.cs.uiuc.edu>
Author: lattner
Date: Tue Feb 5 13:43:53 2008
New Revision: 46761
URL: http://llvm.org/viewvc/llvm-project?rev=46761&view=rev
Log:
regenerate
Modified:
llvm/trunk/configure
Modified: llvm/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=46761&r1=46760&r2=46761&view=diff
==============================================================================
--- llvm/trunk/configure (original)
+++ llvm/trunk/configure Tue Feb 5 13:43:53 2008
@@ -2263,7 +2263,7 @@
llvm_cv_platform_type="Unix" ;;
*-*-darwin*)
llvm_cv_link_all_option="-Wl,-all_load"
- llvm_cv_link_all_option="-Wl,-noall_load"
+ llvm_cv_no_link_all_option="-Wl,-noall_load"
llvm_cv_os_type="Darwin"
llvm_cv_platform_type="Unix" ;;
*-*-freebsd*)
@@ -26953,13 +26953,57 @@
if test "$GCC" = "yes"
then
- gccmajor=`$CC --version | head -n 1 | sed 's/[^0-9]*\([0-9.]\).*/\1/'`
- if test "$gccmajor" -lt "3"
- then
- { { echo "$as_me:$LINENO: error: gcc 3.x required, but you have a lower version" >&5
+ cat >conftest.$ac_ext <<_ACEOF
+#if !defined(__GNUC__) || __GNUC__ < 3
+#error Unsupported GCC version
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { { echo "$as_me:$LINENO: error: gcc 3.x required, but you have a lower version" >&5
echo "$as_me: error: gcc 3.x required, but you have a lower version" >&2;}
{ (exit 1); exit 1; }; }
- fi
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test -z "$llvm_cv_gnu_make_command"
From evan.cheng at apple.com Tue Feb 5 14:04:18 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 05 Feb 2008 20:04:18 -0000
Subject: [llvm-commits] [llvm] r46763 - in /llvm/trunk:
lib/CodeGen/LiveVariables.cpp
test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll
Message-ID: <200802052004.m15K4I28014352@zion.cs.uiuc.edu>
Author: evancheng
Date: Tue Feb 5 14:04:18 2008
New Revision: 46763
URL: http://llvm.org/viewvc/llvm-project?rev=46763&view=rev
Log:
If a vr is already marked alive in a bb, then it has PHI uses that are visited earlier, then it is not killed in the def block (i.e. not dead).
Added:
llvm/trunk/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll
Modified:
llvm/trunk/lib/CodeGen/LiveVariables.cpp
Modified: llvm/trunk/lib/CodeGen/LiveVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveVariables.cpp?rev=46763&r1=46762&r2=46763&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveVariables.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveVariables.cpp Tue Feb 5 14:04:18 2008
@@ -436,8 +436,9 @@
if (MO.isRegister() && MO.isDef() && MO.getReg()) {
if (MRegisterInfo::isVirtualRegister(MO.getReg())) {
VarInfo &VRInfo = getVarInfo(MO.getReg());
- // Defaults to dead
- VRInfo.Kills.push_back(MI);
+ if (VRInfo.AliveBlocks.none())
+ // If vr is not alive in any block, then defaults to dead.
+ VRInfo.Kills.push_back(MI);
} else if (MRegisterInfo::isPhysicalRegister(MO.getReg()) &&
!ReservedRegisters[MO.getReg()]) {
HandlePhysRegDef(MO.getReg(), MI);
Added: llvm/trunk/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll?rev=46763&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll (added)
+++ llvm/trunk/test/CodeGen/PowerPC/2008-02-05-LiveIntervalsAssert.ll Tue Feb 5 14:04:18 2008
@@ -0,0 +1,67 @@
+; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin
+
+ %struct.Handle = type { %struct.oopDesc** }
+ %struct.JNI_ArgumentPusher = type { %struct.SignatureIterator, %struct.JavaCallArguments* }
+ %struct.JNI_ArgumentPusherArray = type { %struct.JNI_ArgumentPusher, %struct.JvmtiEventEnabled* }
+ %struct.JavaCallArguments = type { [9 x i32], [9 x i32], i32*, i32*, i32, i32, i32 }
+ %struct.JvmtiEventEnabled = type { i64 }
+ %struct.KlassHandle = type { %struct.Handle }
+ %struct.SignatureIterator = type { i32 (...)**, %struct.KlassHandle, i32, i32, i32 }
+ %struct.instanceOopDesc = type { %struct.oopDesc }
+ %struct.oopDesc = type { %struct.instanceOopDesc*, %struct.instanceOopDesc* }
+ at .str = external constant [44 x i8] ; <[44 x i8]*> [#uses=1]
+
+define void @_ZN23JNI_ArgumentPusherArray7iterateEy(%struct.JNI_ArgumentPusherArray* %this, i64 %fingerprint) nounwind {
+entry:
+ br label %bb113
+
+bb22.preheader: ; preds = %bb113
+ ret void
+
+bb32.preheader: ; preds = %bb113
+ ret void
+
+bb42.preheader: ; preds = %bb113
+ ret void
+
+bb52: ; preds = %bb113
+ br label %bb113
+
+bb62.preheader: ; preds = %bb113
+ ret void
+
+bb72.preheader: ; preds = %bb113
+ ret void
+
+bb82: ; preds = %bb113
+ br label %bb113
+
+bb93: ; preds = %bb113
+ br label %bb113
+
+bb103.preheader: ; preds = %bb113
+ ret void
+
+bb113: ; preds = %bb113, %bb93, %bb82, %bb52, %entry
+ %fingerprint_addr.0.reg2mem.9 = phi i64 [ 0, %entry ], [ 0, %bb52 ], [ 0, %bb82 ], [ 0, %bb93 ], [ %tmp118, %bb113 ] ; [#uses=1]
+ tail call void @_Z28report_should_not_reach_herePKci( i8* getelementptr ([44 x i8]* @.str, i32 0, i32 0), i32 817 ) nounwind
+ %tmp118 = lshr i64 %fingerprint_addr.0.reg2mem.9, 4 ; [#uses=2]
+ %tmp21158 = and i64 %tmp118, 15 ; [#uses=1]
+ switch i64 %tmp21158, label %bb113 [
+ i64 1, label %bb22.preheader
+ i64 2, label %bb52
+ i64 3, label %bb32.preheader
+ i64 4, label %bb42.preheader
+ i64 5, label %bb62.preheader
+ i64 6, label %bb82
+ i64 7, label %bb93
+ i64 8, label %bb103.preheader
+ i64 9, label %bb72.preheader
+ i64 10, label %UnifiedReturnBlock
+ ]
+
+UnifiedReturnBlock: ; preds = %bb113
+ ret void
+}
+
+declare void @_Z28report_should_not_reach_herePKci(i8*, i32)
From dalej at apple.com Tue Feb 5 14:46:33 2008
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 05 Feb 2008 20:46:33 -0000
Subject: [llvm-commits] [llvm] r46764 - in /llvm/trunk:
include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86ISelLowering.cpp
Message-ID: <200802052046.m15KkXq0016743@zion.cs.uiuc.edu>
Author: johannes
Date: Tue Feb 5 14:46:33 2008
New Revision: 46764
URL: http://llvm.org/viewvc/llvm-project?rev=46764&view=rev
Log:
Implement sseregparm.
Modified:
llvm/trunk/include/llvm/CallingConv.h
llvm/trunk/lib/Target/X86/X86CallingConv.td
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/include/llvm/CallingConv.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CallingConv.h?rev=46764&r1=46763&r2=46764&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CallingConv.h (original)
+++ llvm/trunk/include/llvm/CallingConv.h Tue Feb 5 14:46:33 2008
@@ -57,7 +57,11 @@
/// X86_FastCall - 'fast' analog of X86_StdCall. Passes first two arguments
/// in ECX:EDX registers, others - via stack. Callee is responsible for
/// stack cleaning.
- X86_FastCall = 65
+ X86_FastCall = 65,
+
+ /// X86_SSEreg - The standard convention except that float and double
+ /// values are returned in XMM0 if SSE support is available.
+ X86_SSECall = 66
};
} // End CallingConv namespace
Modified: llvm/trunk/lib/Target/X86/X86CallingConv.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CallingConv.td?rev=46764&r1=46763&r2=46764&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CallingConv.td (original)
+++ llvm/trunk/lib/Target/X86/X86CallingConv.td Tue Feb 5 14:46:33 2008
@@ -61,6 +61,15 @@
CCDelegateTo
]>;
+// X86-32 SSEregparm return-value convention.
+def RetCC_X86_32_SSE : CallingConv<[
+ // The X86-32 sseregparm calling convention returns FP values in XMM0 if the
+ // target has SSE2, otherwise it is the C calling convention.
+ CCIfType<[f32], CCIfSubtarget<"hasSSE2()", CCAssignToReg<[XMM0]>>>,
+ CCIfType<[f64], CCIfSubtarget<"hasSSE2()", CCAssignToReg<[XMM0]>>>,
+ CCDelegateTo
+]>;
+
// X86-64 C return-value convention.
def RetCC_X86_64_C : CallingConv<[
// The X86-64 calling convention always returns FP values in XMM0.
@@ -69,12 +78,12 @@
CCDelegateTo
]>;
-
-
// This is the root return-value convention for the X86-32 backend.
def RetCC_X86_32 : CallingConv<[
// If FastCC, use RetCC_X86_32_Fast.
CCIfCC<"CallingConv::Fast", CCDelegateTo>,
+ // If SSECC, use RetCC_X86_32_SSE.
+ CCIfCC<"CallingConv::X86_SSECall", CCDelegateTo>,
// Otherwise, use RetCC_X86_32_C.
CCDelegateTo
]>;
@@ -179,6 +188,11 @@
// Handles byval parameters.
CCIfByVal>,
+ // The first 3 float or double arguments, if marked 'inreg' and if the call
+ // is not a vararg call and if SSE2 is available, are passed in SSE registers.
+ CCIfNotVarArg>>>>,
+
// Integer/Float values get stored in stack slots that are 4 bytes in
// size and 4-byte aligned.
CCIfType<[i32, f32], CCAssignToStack<4, 4>>,
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=46764&r1=46763&r2=46764&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Feb 5 14:46:33 2008
@@ -1137,9 +1137,9 @@
RC = X86::GR32RegisterClass;
else if (Is64Bit && RegVT == MVT::i64)
RC = X86::GR64RegisterClass;
- else if (Is64Bit && RegVT == MVT::f32)
+ else if (RegVT == MVT::f32)
RC = X86::FR32RegisterClass;
- else if (Is64Bit && RegVT == MVT::f64)
+ else if (RegVT == MVT::f64)
RC = X86::FR64RegisterClass;
else {
assert(MVT::isVector(RegVT));
From dalej at apple.com Tue Feb 5 14:48:34 2008
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 05 Feb 2008 20:48:34 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46765 - in /llvm-gcc-4.2/trunk/gcc:
config/i386/llvm-i386-target.h llvm-types.cpp
Message-ID: <200802052048.m15KmZSl016808@zion.cs.uiuc.edu>
Author: johannes
Date: Tue Feb 5 14:48:34 2008
New Revision: 46765
URL: http://llvm.org/viewvc/llvm-project?rev=46765&view=rev
Log:
Implement sseregparm in llvm.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h?rev=46765&r1=46764&r2=46765&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h Tue Feb 5 14:48:34 2008
@@ -28,8 +28,11 @@
CC = CallingConv::X86_StdCall; \
} else if (lookup_attribute("fastcall", type_attributes)) { \
CC = CallingConv::X86_FastCall; \
+ } else if (!TARGET_64BIT && \
+ lookup_attribute("sseregparm", type_attributes)){\
+ CC = CallingConv::X86_SSECall; \
} \
- } \
+ }
/* LLVM specific stuff for converting gcc's `regparm` attribute to LLVM's
`inreg` parameter attribute */
@@ -37,28 +40,46 @@
extern int ix86_regparm;
-#define LLVM_TARGET_INIT_REGPARM(local_regparm, type) \
+#define LLVM_TARGET_INIT_REGPARM(local_regparm, local_fp_regparm, type) \
{ \
tree attr; \
local_regparm = ix86_regparm; \
+ local_fp_regparm = TARGET_SSEREGPARM ? 3 : 0; \
attr = lookup_attribute ("regparm", \
TYPE_ATTRIBUTES (type)); \
if (attr) { \
local_regparm = TREE_INT_CST_LOW (TREE_VALUE \
(TREE_VALUE (attr))); \
} \
+ attr = lookup_attribute("sseregparm", \
+ TYPE_ATTRIBUTES (type)); \
+ if (attr) \
+ local_fp_regparm = 3; \
}
-#define LLVM_ADJUST_REGPARM_ATTRIBUTE(Attribute, Size, \
- local_regparm) \
+#define LLVM_ADJUST_REGPARM_ATTRIBUTE(Attribute, Type, Size, \
+ local_regparm, \
+ local_fp_regparm) \
{ \
if (!TARGET_64BIT) { \
- int words = (Size + BITS_PER_WORD - 1) / BITS_PER_WORD; \
- local_regparm -= words; \
- if (local_regparm>=0) { \
- Attribute |= ParamAttr::InReg; \
- } else \
- local_regparm = 0; \
+ if (TREE_CODE(Type) == REAL_TYPE && \
+ (TYPE_PRECISION(Type)==32 || \
+ TYPE_PRECISION(Type)==64)) { \
+ local_fp_regparm -= 1; \
+ if (local_fp_regparm >= 0) \
+ Attribute |= ParamAttr::InReg; \
+ else \
+ local_fp_regparm = 0; \
+ } else if (TREE_CODE(Type) == INTEGER_TYPE || \
+ TREE_CODE(Type) == ENUMERAL_TYPE) { \
+ int words = \
+ (Size + BITS_PER_WORD - 1) / BITS_PER_WORD; \
+ local_regparm -= words; \
+ if (local_regparm>=0) \
+ Attribute |= ParamAttr::InReg; \
+ else \
+ local_regparm = 0; \
+ } \
} \
}
Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=46765&r1=46764&r2=46765&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Tue Feb 5 14:48:34 2008
@@ -1161,8 +1161,9 @@
// If the target has regparam parameters, allow it to inspect the function
// type.
int local_regparam = 0;
+ int local_fp_regparam = 0;
#ifdef LLVM_TARGET_ENABLE_REGPARM
- LLVM_TARGET_INIT_REGPARM(local_regparam, type);
+ LLVM_TARGET_INIT_REGPARM(local_regparam, local_fp_regparam, type);
#endif // LLVM_TARGET_ENABLE_REGPARM
// Keep track of whether we see a byval argument.
@@ -1208,10 +1209,11 @@
#ifdef LLVM_TARGET_ENABLE_REGPARM
// Allow the target to mark this as inreg.
- if (TREE_CODE(ArgTy) == INTEGER_TYPE || TREE_CODE(ArgTy) == POINTER_TYPE)
- LLVM_ADJUST_REGPARM_ATTRIBUTE(Attributes,
+ if (TREE_CODE(ArgTy) == INTEGER_TYPE || TREE_CODE(ArgTy) == POINTER_TYPE ||
+ TREE_CODE(ArgTy) == REAL_TYPE)
+ LLVM_ADJUST_REGPARM_ATTRIBUTE(Attributes, ArgTy,
TREE_INT_CST_LOW(TYPE_SIZE(ArgTy)),
- local_regparam);
+ local_regparam, local_fp_regparam);
#endif // LLVM_TARGET_ENABLE_REGPARM
if (Attributes != ParamAttr::None) {
From sabre at nondot.org Tue Feb 5 15:26:24 2008
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 05 Feb 2008 21:26:24 -0000
Subject: [llvm-commits] [llvm] r46767 -
/llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
Message-ID: <200802052126.m15LQOrh017838@zion.cs.uiuc.edu>
Author: lattner
Date: Tue Feb 5 15:26:23 2008
New Revision: 46767
URL: http://llvm.org/viewvc/llvm-project?rev=46767&view=rev
Log:
Make RenamePass faster by making the 'is this a new phi node'
check more intelligent. This speeds up mem2reg from 5.29s to
0.79s on a synthetic testcase with tons of predecessors and
phi nodes.
Modified:
llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
Modified: llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp?rev=46767&r1=46766&r2=46767&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Tue Feb 5 15:26:23 2008
@@ -849,7 +849,6 @@
return true;
}
-
// RenamePass - Recursively traverse the CFG of the function, renaming loads and
// stores to the allocas which we are promoting. IncomingVals indicates what
// value each Alloca contains on exit from the predecessor block Pred.
@@ -877,6 +876,14 @@
// If we have PHI nodes to update, compute the number of edges from Pred to
// BB.
if (!HasPredEntries) {
+ // We want to be able to distinguish between PHI nodes being inserted by
+ // this invocation of mem2reg from those phi nodes that already existed in
+ // the IR before mem2reg was run. We determine that APN is being inserted
+ // because it is missing incoming edges. All other PHI nodes being
+ // inserted by this pass of mem2reg will have the same number of incoming
+ // operands so far. Remember this count.
+ unsigned NewPHINumOperands = APN->getNumOperands();
+
TerminatorInst *PredTerm = Pred->getTerminator();
unsigned NumEdges = 0;
for (unsigned i = 0, e = PredTerm->getNumSuccessors(); i != e; ++i) {
@@ -902,16 +909,9 @@
APN = dyn_cast(PNI);
if (APN == 0) break;
- // Verify it doesn't already have entries for Pred. If it does, it is
- // not being inserted by this mem2reg invocation.
- HasPredEntries = false;
- for (unsigned i = 0, e = APN->getNumIncomingValues(); i != e; ++i) {
- if (APN->getIncomingBlock(i) == Pred) {
- HasPredEntries = true;
- break;
- }
- }
- } while (!HasPredEntries);
+ // Verify that it is missing entries. If not, it is not being inserted
+ // by this mem2reg invocation so we want to ignore it.
+ } while (APN->getNumOperands() == NewPHINumOperands);
}
}
From asl at math.spbu.ru Tue Feb 5 15:56:53 2008
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Wed, 06 Feb 2008 00:56:53 +0300
Subject: [llvm-commits] [llvm-gcc-4.2] r46765 -
in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386-target.h
llvm-types.cpp
In-Reply-To: <200802052048.m15KmZSl016808@zion.cs.uiuc.edu>
References: <200802052048.m15KmZSl016808@zion.cs.uiuc.edu>
Message-ID: <1202248613.17220.31.camel@asl.dorms.spbu.ru>
Hi Dale,
Looks like there is some desynchronization here now:
> + } else if (TREE_CODE(Type) == INTEGER_TYPE || \
> + TREE_CODE(Type) == ENUMERAL_TYPE) { \
Shouldn't be POINTER_TYPE here also?
> + if (TREE_CODE(ArgTy) == INTEGER_TYPE || TREE_CODE(ArgTy) == POINTER_TYPE ||
> + TREE_CODE(ArgTy) == REAL_TYPE)
And ENUMERAL_TYPE here?
--
With best regards, Anton Korobeynikov.
Faculty of Mathematics & Mechanics, Saint Petersburg State University.
From dalej at apple.com Tue Feb 5 16:16:30 2008
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 5 Feb 2008 14:16:30 -0800
Subject: [llvm-commits] [llvm-gcc-4.2] r46765
- in /llvm-gcc-4.2/trunk/gcc:
config/i386/llvm-i386-target.h llvm-types.cpp
In-Reply-To: <1202248613.17220.31.camel@asl.dorms.spbu.ru>
References: <200802052048.m15KmZSl016808@zion.cs.uiuc.edu>
<1202248613.17220.31.camel@asl.dorms.spbu.ru>
Message-ID:
On Feb 5, 2008, at 1:56 PM, Anton Korobeynikov wrote:
> Hi Dale,
>
> Looks like there is some desynchronization here now:
>
>> + } else if (TREE_CODE(Type) == INTEGER_TYPE || \
>> + TREE_CODE(Type) == ENUMERAL_TYPE) { \
> Shouldn't be POINTER_TYPE here also?
>
>> + if (TREE_CODE(ArgTy) == INTEGER_TYPE || TREE_CODE(ArgTy) ==
>> POINTER_TYPE ||
>> + TREE_CODE(ArgTy) == REAL_TYPE)
> And ENUMERAL_TYPE here?
Oops, I meant POINTER throughout, as it was before. Will fix, thanks.
From clattner at apple.com Tue Feb 5 16:19:12 2008
From: clattner at apple.com (Chris Lattner)
Date: Tue, 5 Feb 2008 14:19:12 -0800
Subject: [llvm-commits] [llvm] r46727 -
/llvm/trunk/include/llvm/IntrinsicsX86.td
In-Reply-To: <72BEB2A5-7674-43F4-9101-86C018AC62A7@apple.com>
References: <200802042327.m14NRT7G021211@zion.cs.uiuc.edu>
<9642BC09-56CD-4C7C-9294-0E5EA9D99F3E@apple.com>
<80FF2637-CEA7-46E1-8078-8C7EDAED9CD1@apple.com>
<95A45B70-64AB-4283-815A-14CB22ECAA17@apple.com>
<15D95739-61E8-4952-B170-06A6FB1A3716@apple.com>
<72BEB2A5-7674-43F4-9101-86C018AC62A7@apple.com>
Message-ID: <483704A9-E821-436F-9BDC-97BB1188F38C@apple.com>
On Feb 5, 2008, at 11:41 AM, Evan Cheng wrote:
> With or without...
Right, I agree. The f.e. should do this unconditionally,
-Chris
>
>
> On Feb 5, 2008, at 11:39 AM, Chris Lattner wrote:
>
>>
>> On Feb 5, 2008, at 11:37 AM, Evan Cheng wrote:
>>
>>>> That means you have to know whether you've got SSE4.1 in the FE.
>>>> This is not an insuperable obstacle, but I think it's better to
>>>> leave
>>>> target
>>>> dependencies in the BE when possible.
>>>
>>> Even with SSE4.1, it's a good idea to lower them to extract element
>>> instructions. X86ISelLoweringhas all the information necessary to
>>> determine what instructions to they should be selected to.
>>
>> Do you mean 'even without SSE4.1'?
>>
>> -Chris
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From dalej at apple.com Tue Feb 5 16:22:24 2008
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 05 Feb 2008 22:22:24 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46773 -
/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
Message-ID: <200802052222.m15MMO5D019349@zion.cs.uiuc.edu>
Author: johannes
Date: Tue Feb 5 16:22:23 2008
New Revision: 46773
URL: http://llvm.org/viewvc/llvm-project?rev=46773&view=rev
Log:
Fix per review feedback.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h?rev=46773&r1=46772&r2=46773&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h Tue Feb 5 16:22:23 2008
@@ -71,7 +71,7 @@
else \
local_fp_regparm = 0; \
} else if (TREE_CODE(Type) == INTEGER_TYPE || \
- TREE_CODE(Type) == ENUMERAL_TYPE) { \
+ TREE_CODE(Type) == POINTER_TYPE) { \
int words = \
(Size + BITS_PER_WORD - 1) / BITS_PER_WORD; \
local_regparm -= words; \
From dalej at apple.com Tue Feb 5 16:23:51 2008
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 5 Feb 2008 14:23:51 -0800
Subject: [llvm-commits] [llvm-gcc-4.2] r46765
- in /llvm-gcc-4.2/trunk/gcc:
config/i386/llvm-i386-target.h llvm-types.cpp
In-Reply-To:
References: <200802052048.m15KmZSl016808@zion.cs.uiuc.edu>
<1202248613.17220.31.camel@asl.dorms.spbu.ru>
Message-ID:
On Feb 5, 2008, at 2:16 PM, Dale Johannesen wrote:
>
> On Feb 5, 2008, at 1:56 PM, Anton Korobeynikov wrote:
>
>> Hi Dale,
>>
>> Looks like there is some desynchronization here now:
>>
>>> + } else if (TREE_CODE(Type) == INTEGER_TYPE || \
>>> + TREE_CODE(Type) == ENUMERAL_TYPE) { \
>> Shouldn't be POINTER_TYPE here also?
>>
>>> + if (TREE_CODE(ArgTy) == INTEGER_TYPE || TREE_CODE(ArgTy) ==
>>> POINTER_TYPE ||
>>> + TREE_CODE(ArgTy) == REAL_TYPE)
>> And ENUMERAL_TYPE here?
>
> Oops, I meant POINTER throughout, as it was before. Will fix, thanks.
Fixed. There is something wrong with the dependencies. I had to
remove llvm-types.o to get it to recompile.
From clattner at apple.com Tue Feb 5 16:25:12 2008
From: clattner at apple.com (Chris Lattner)
Date: Tue, 5 Feb 2008 14:25:12 -0800
Subject: [llvm-commits] [llvm] r46764 - in /llvm/trunk:
include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86ISelLowering.cpp
In-Reply-To: <200802052046.m15KkXq0016743@zion.cs.uiuc.edu>
References: <200802052046.m15KkXq0016743@zion.cs.uiuc.edu>
Message-ID: <0D34AD0E-E368-4E71-9E90-345AFC264D83@apple.com>
On Feb 5, 2008, at 12:46 PM, Dale Johannesen wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=46764&view=rev
> Log:
> Implement sseregparm.
Very nice.
One thought about X86_SSECall: if it is only used to return float/
double in an xmm reg, you could get the same effect by having the CFE
lower ssecall functions to return <4x f32> and <2 x f64> instead of
float/double. On the callee, you'd end up with an "ret insertelement
undef, fpval" and on the caller side you'd get an extract element.
I think the calling convention stuff that Evan has been working on is
powerful enough to model though sort of stuff, but might need minor
extensions. Do you think it would be reasonable do use this
approach? Doing so would eliminate a "magic" calling convention,
which would be nice :)
-Chris
From asl at math.spbu.ru Tue Feb 5 16:27:00 2008
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Wed, 06 Feb 2008 01:27:00 +0300
Subject: [llvm-commits] [llvm-gcc-4.2] r46773
- /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
In-Reply-To: <200802052222.m15MMO5D019349@zion.cs.uiuc.edu>
References: <200802052222.m15MMO5D019349@zion.cs.uiuc.edu>
Message-ID: <1202250420.17220.38.camel@asl.dorms.spbu.ru>
> URL: http://llvm.org/viewvc/llvm-project?rev=46773&view=rev
> Log:
> Fix per review feedback.
Thanks!
--
With best regards, Anton Korobeynikov.
Faculty of Mathematics & Mechanics, Saint Petersburg State University.
From gohman at apple.com Tue Feb 5 15:53:12 2008
From: gohman at apple.com (Dan Gohman)
Date: Tue, 5 Feb 2008 13:53:12 -0800
Subject: [llvm-commits] [llvm] r46556 - in /llvm/trunk:
include/llvm/CodeGen/PseudoSourceValue.h include/llvm/Value.h
lib/CodeGen/PseudoSourceValue.cpp
Message-ID:
> Some comments on the patch:
> > + > + // Save loads/stores matched by a pattern.
> + if (!N->isLeaf() && N->getName().empty() &&
> + ((N->getOperator()->getName() == "ld") ||
> + (N->getOperator()->getName() == "st") ||
> + (N->getOperator()->getName() == "ist"))) {
> + LSI.push_back(RootName); > + }
> +
>
> I am not sure about this. Perhaps it should be similar to
> what
> InstrInfoEmitter.cpp is doing?
The MayStore and MayLoad properties are per-instruction; the code
above needs to know which specific SDNodes in the pattern will be
represented with StoreSDNode or LoadSDNode.
An alternative to checking for "st" and friends would be to check if
the node's Opcode field is one of the strings "ISD::STORE" or
"ISD::LOAD"; I guess that's a little more flexible.
> + static const char *PSVNames[] = {
> + "FPRel", > + "SPRel", > + "GPRel",
> + "TPRel",
> + "CPRel",
> + "JTRel"
> + };
>
> I am taking exception to the names. FPRel looks too much like it has
> something to do with FP register, GPRel looks like it is referring to
> general purpose register. How about just spill it out? e.g.
> StackObjRel, FixedStackObjRel, GOTRel, ThreadPtrRel,
> ConstPoolRel, JumpTabRel?
Sounds reasonable to me. I'll update this before committing.
Dan
From dalej at apple.com Tue Feb 5 16:31:13 2008
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 5 Feb 2008 14:31:13 -0800
Subject: [llvm-commits] [llvm] r46764 - in /llvm/trunk:
include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86ISelLowering.cpp
In-Reply-To: <0D34AD0E-E368-4E71-9E90-345AFC264D83@apple.com>
References: <200802052046.m15KkXq0016743@zion.cs.uiuc.edu>
<0D34AD0E-E368-4E71-9E90-345AFC264D83@apple.com>
Message-ID: <61A65A2A-8D56-4CAA-8A0A-095A85626BB5@apple.com>
On Feb 5, 2008, at 2:25 PM, Chris Lattner wrote:
> On Feb 5, 2008, at 12:46 PM, Dale Johannesen wrote:
>> URL: http://llvm.org/viewvc/llvm-project?rev=46764&view=rev
>> Log:
>> Implement sseregparm.
>
> Very nice.
>
> One thought about X86_SSECall: if it is only used to return float/
> double in an xmm reg, you could get the same effect by having the CFE
> lower ssecall functions to return <4x f32> and <2 x f64> instead of
> float/double. On the callee, you'd end up with an "ret insertelement
> undef, fpval" and on the caller side you'd get an extract element.
>
> I think the calling convention stuff that Evan has been working on is
> powerful enough to model though sort of stuff, but might need minor
> extensions. Do you think it would be reasonable do use this
> approach? Doing so would eliminate a "magic" calling convention,
> which would be nice :)
It would, but coercing standard types to a different type strikes me
as worse.
The IR really ought to be able to handle standard types without
obfuscation.
What I really wanted was to put InReg on the return value.
From clattner at apple.com Tue Feb 5 16:34:05 2008
From: clattner at apple.com (Chris Lattner)
Date: Tue, 5 Feb 2008 14:34:05 -0800
Subject: [llvm-commits] [llvm] r46764 - in /llvm/trunk:
include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86ISelLowering.cpp
In-Reply-To: <61A65A2A-8D56-4CAA-8A0A-095A85626BB5@apple.com>
References: <200802052046.m15KkXq0016743@zion.cs.uiuc.edu>
<0D34AD0E-E368-4E71-9E90-345AFC264D83@apple.com>
<61A65A2A-8D56-4CAA-8A0A-095A85626BB5@apple.com>
Message-ID: <9624F9F3-E870-4832-BAA0-4591C872DC0D@apple.com>
On Feb 5, 2008, at 2:31 PM, Dale Johannesen wrote:
>> I think the calling convention stuff that Evan has been working on is
>> powerful enough to model though sort of stuff, but might need minor
>> extensions. Do you think it would be reasonable do use this
>> approach? Doing so would eliminate a "magic" calling convention,
>> which would be nice :)
>
> It would, but coercing standard types to a different type strikes me
> as worse.
> The IR really ought to be able to handle standard types without
> obfuscation.
I don't think it would be a problem in this specific case, but I
understand what you mean.
> What I really wanted was to put InReg on the return value.
Ah, that's a good idea. Why not do that? :) Generally, putting the
attribute on argument "#0" means that the attribute applies to the
function or the return value. Given that 'inreg' doesn't make any
sense for a function, it would be fine to overload it for this, what
do you think?
-Chris
From dalej at apple.com Tue Feb 5 16:36:28 2008
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 5 Feb 2008 14:36:28 -0800
Subject: [llvm-commits] [llvm] r46764 - in /llvm/trunk:
include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86ISelLowering.cpp
In-Reply-To: <9624F9F3-E870-4832-BAA0-4591C872DC0D@apple.com>
References: <200802052046.m15KkXq0016743@zion.cs.uiuc.edu>
<0D34AD0E-E368-4E71-9E90-345AFC264D83@apple.com>
<61A65A2A-8D56-4CAA-8A0A-095A85626BB5@apple.com>
<9624F9F3-E870-4832-BAA0-4591C872DC0D@apple.com>
Message-ID:
On Feb 5, 2008, at 2:34 PM, Chris Lattner wrote:
> On Feb 5, 2008, at 2:31 PM, Dale Johannesen wrote:
>>> I think the calling convention stuff that Evan has been working on
>>> is
>>> powerful enough to model though sort of stuff, but might need minor
>>> extensions. Do you think it would be reasonable do use this
>>> approach? Doing so would eliminate a "magic" calling convention,
>>> which would be nice :)
>>
>> It would, but coercing standard types to a different type strikes me
>> as worse.
>> The IR really ought to be able to handle standard types without
>> obfuscation.
>
> I don't think it would be a problem in this specific case, but I
> understand what you mean.
>
>> What I really wanted was to put InReg on the return value.
>
> Ah, that's a good idea. Why not do that? :) Generally, putting the
> attribute on argument "#0" means that the attribute applies to the
> function or the return value. Given that 'inreg' doesn't make any
> sense for a function, it would be fine to overload it for this, what
> do you think?
Sound good if it's that simple. It looked more complicated, but I
was probably missing something. I'll look again.
From dalej at apple.com Tue Feb 5 16:40:30 2008
From: dalej at apple.com (Dale Johannesen)
Date: Tue, 5 Feb 2008 14:40:30 -0800
Subject: [llvm-commits] [llvm] r46727 -
/llvm/trunk/include/llvm/IntrinsicsX86.td
In-Reply-To: <483704A9-E821-436F-9BDC-97BB1188F38C@apple.com>
References: <200802042327.m14NRT7G021211@zion.cs.uiuc.edu>
<9642BC09-56CD-4C7C-9294-0E5EA9D99F3E@apple.com>
<80FF2637-CEA7-46E1-8078-8C7EDAED9CD1@apple.com>
<95A45B70-64AB-4283-815A-14CB22ECAA17@apple.com>
<15D95739-61E8-4952-B170-06A6FB1A3716@apple.com>
<72BEB2A5-7674-43F4-9101-86C018AC62A7@apple.com>
<483704A9-E821-436F-9BDC-97BB1188F38C@apple.com>
Message-ID: <34696A8C-0C4F-4E4E-9E2B-7724804D54F2@apple.com>
On Feb 5, 2008, at 2:19 PM, Chris Lattner wrote:
> On Feb 5, 2008, at 11:41 AM, Evan Cheng wrote:
>> With or without...
>
> Right, I agree. The f.e. should do this unconditionally,
>
> -Chris
OK, maybe so. The trouble is people use those builtins that are
linked to a
particular instruction, and expect to get that instruction and nothing
else.
But I don't have much sympathy for those people:)
>> On Feb 5, 2008, at 11:39 AM, Chris Lattner wrote:
>>> On Feb 5, 2008, at 11:37 AM, Evan Cheng wrote:
>>>
>>>>> That means you have to know whether you've got SSE4.1 in the FE.
>>>>> This is not an insuperable obstacle, but I think it's better to
>>>>> leave
>>>>> target
>>>>> dependencies in the BE when possible.
>>>>
>>>> Even with SSE4.1, it's a good idea to lower them to extract element
>>>> instructions. X86ISelLoweringhas all the information necessary to
>>>> determine what instructions to they should be selected to.
>>>
>>> Do you mean 'even without SSE4.1'?
>>>
>>> -Chris
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From evan.cheng at apple.com Tue Feb 5 16:44:07 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 05 Feb 2008 22:44:07 -0000
Subject: [llvm-commits] [llvm] r46775 -
/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
Message-ID: <200802052244.m15Mi7TI020034@zion.cs.uiuc.edu>
Author: evancheng
Date: Tue Feb 5 16:44:06 2008
New Revision: 46775
URL: http://llvm.org/viewvc/llvm-project?rev=46775&view=rev
Log:
Move to getCALLSEQ_END to ensure CALLSEQ_END node produces a flag. This is consistent with the definition in td file.
Modified:
llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=46775&r1=46774&r2=46775&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Tue Feb 5 16:44:06 2008
@@ -1227,6 +1227,13 @@
Chain = DAG.getNode(CallOpc, NodeTys, &Ops[0], Ops.size());
InFlag = Chain.getValue(1);
+ Chain = DAG.getCALLSEQ_END(Chain,
+ DAG.getConstant(NumStackBytes, PtrVT),
+ DAG.getConstant(0, PtrVT),
+ InFlag);
+ if (Op.Val->getValueType(0) != MVT::Other)
+ InFlag = Chain.getValue(1);
+
SDOperand ResultVals[3];
unsigned NumResults = 0;
NodeTys.clear();
@@ -1278,8 +1285,6 @@
break;
}
- Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
- DAG.getConstant(NumStackBytes, PtrVT));
NodeTys.push_back(MVT::Other);
// If the function returns void, just return the chain.
From evan.cheng at apple.com Tue Feb 5 16:50:29 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 05 Feb 2008 22:50:29 -0000
Subject: [llvm-commits] [llvm] r46776 - in /llvm/trunk:
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
test/CodeGen/X86/2008-02-05-ISelCrash.ll utils/TableGen/DAGISelEmitter.cpp
Message-ID: <200802052250.m15MoTAi020239@zion.cs.uiuc.edu>
Author: evancheng
Date: Tue Feb 5 16:50:29 2008
New Revision: 46776
URL: http://llvm.org/viewvc/llvm-project?rev=46776&view=rev
Log:
Fix PR1975: dag isel emitter produces patterns that isel wrong flag result.
Added:
llvm/trunk/test/CodeGen/X86/2008-02-05-ISelCrash.ll
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=46776&r1=46775&r2=46776&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Feb 5 16:50:29 2008
@@ -3183,10 +3183,6 @@
void SelectionDAG::ReplaceAllUsesWith(SDOperand FromN, SDOperand To,
DAGUpdateListener *UpdateListener) {
SDNode *From = FromN.Val;
- // FIXME: This works around a dag isel emitter bug.
- if (From->getNumValues() == 1 && FromN.ResNo != 0)
- return; // FIXME: THIS IS BOGUS
-
assert(From->getNumValues() == 1 && FromN.ResNo == 0 &&
"Cannot replace with this method!");
assert(From != To.Val && "Cannot replace uses of with self");
Added: llvm/trunk/test/CodeGen/X86/2008-02-05-ISelCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-02-05-ISelCrash.ll?rev=46776&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2008-02-05-ISelCrash.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2008-02-05-ISelCrash.ll Tue Feb 5 16:50:29 2008
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llc -march=x86
+; PR1975
+
+ at nodes = external global i64 ; [#uses=2]
+
+define fastcc i32 @ab(i32 %alpha, i32 %beta) nounwind {
+entry:
+ %tmp1 = load i64* @nodes, align 8 ; [#uses=1]
+ %tmp2 = add i64 %tmp1, 1 ; [#uses=1]
+ store i64 %tmp2, i64* @nodes, align 8
+ ret i32 0
+}
Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=46776&r1=46775&r2=46776&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Tue Feb 5 16:50:29 2008
@@ -305,6 +305,8 @@
std::map VariableMap;
// Node to operator mapping
std::map OperatorMap;
+ // Name of the folded node which produces a flag.
+ std::pair FoldedFlag;
// Names of all the folded nodes which produce chains.
std::vector > FoldedChains;
// Original input chain(s).
@@ -587,8 +589,17 @@
emitCheck(RootName + ".getOpcode() == " +
CInfo.getEnumName());
EmitMatchCode(Child, Parent, RootName, ChainSuffix, FoundChain);
- if (NodeHasProperty(Child, SDNPHasChain, CGP))
+ bool HasChain = false;
+ if (NodeHasProperty(Child, SDNPHasChain, CGP)) {
+ HasChain = true;
FoldedChains.push_back(std::make_pair(RootName, CInfo.getNumResults()));
+ }
+ if (NodeHasProperty(Child, SDNPOutFlag, CGP)) {
+ assert(FoldedFlag.first == "" && FoldedFlag.second == 0 &&
+ "Pattern folded multiple nodes which produce flags?");
+ FoldedFlag = std::make_pair(RootName,
+ CInfo.getNumResults() + (unsigned)HasChain);
+ }
} else {
// If this child has a name associated with it, capture it in VarMap. If
// we already saw this in the pattern, emit code to verify dagness.
@@ -1105,9 +1116,15 @@
}
if (NodeHasOutFlag) {
- emitCode("ReplaceUses(SDOperand(N.Val, " +
- utostr(NumPatResults + (unsigned)InputHasChain)
- +"), InFlag);");
+ if (FoldedFlag.first != "") {
+ emitCode("ReplaceUses(SDOperand(" + FoldedFlag.first + ".Val, " +
+ utostr(FoldedFlag.second) + "), InFlag);");
+ } else {
+ assert(NodeHasProperty(Pattern, SDNPOutFlag, CGP));
+ emitCode("ReplaceUses(SDOperand(N.Val, " +
+ utostr(NumPatResults + (unsigned)InputHasChain)
+ +"), InFlag);");
+ }
NeedReplace = true;
}
From isanbard at gmail.com Tue Feb 5 16:50:40 2008
From: isanbard at gmail.com (Bill Wendling)
Date: Tue, 5 Feb 2008 14:50:40 -0800
Subject: [llvm-commits] [llvm] r46727 -
/llvm/trunk/include/llvm/IntrinsicsX86.td
In-Reply-To: <34696A8C-0C4F-4E4E-9E2B-7724804D54F2@apple.com>
References: <200802042327.m14NRT7G021211@zion.cs.uiuc.edu>
<9642BC09-56CD-4C7C-9294-0E5EA9D99F3E@apple.com>
<80FF2637-CEA7-46E1-8078-8C7EDAED9CD1@apple.com>
<95A45B70-64AB-4283-815A-14CB22ECAA17@apple.com>
<15D95739-61E8-4952-B170-06A6FB1A3716@apple.com>
<72BEB2A5-7674-43F4-9101-86C018AC62A7@apple.com>
<483704A9-E821-436F-9BDC-97BB1188F38C@apple.com>
<34696A8C-0C4F-4E4E-9E2B-7724804D54F2@apple.com>
Message-ID: <16e5fdf90802051450l17b20593rf8218bf21e901112@mail.gmail.com>
On Feb 5, 2008 2:40 PM, Dale Johannesen wrote:
>
> On Feb 5, 2008, at 2:19 PM, Chris Lattner wrote:
>
> > On Feb 5, 2008, at 11:41 AM, Evan Cheng wrote:
> >> With or without...
> >
> > Right, I agree. The f.e. should do this unconditionally,
> >
> > -Chris
>
> OK, maybe so. The trouble is people use those builtins that are
> linked to a
> particular instruction, and expect to get that instruction and nothing
> else.
> But I don't have much sympathy for those people:)
>
That's when we point them to the docs on inline ASM ;-)
-bw
From asl at math.spbu.ru Tue Feb 5 17:34:41 2008
From: asl at math.spbu.ru (Anton Korobeynikov)
Date: Tue, 05 Feb 2008 23:34:41 -0000
Subject: [llvm-commits] [llvm] r46781 -
/llvm/trunk/include/llvm/ADT/StringMap.h
Message-ID: <200802052334.m15NYfoM021622@zion.cs.uiuc.edu>
Author: asl
Date: Tue Feb 5 17:34:40 2008
New Revision: 46781
URL: http://llvm.org/viewvc/llvm-project?rev=46781&view=rev
Log:
Don't dereference an invalid pointer if string is empty.
Modified:
llvm/trunk/include/llvm/ADT/StringMap.h
Modified: llvm/trunk/include/llvm/ADT/StringMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringMap.h?rev=46781&r1=46780&r2=46781&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringMap.h (original)
+++ llvm/trunk/include/llvm/ADT/StringMap.h Tue Feb 5 17:34:40 2008
@@ -273,7 +273,7 @@
return find(Key, Key + strlen(Key));
}
iterator find(const std::string &Key) {
- const char* key_start = &Key[0];
+ const char* key_start = (Key.empty() ? NULL : &Key[0]);
return find(key_start, key_start + Key.size());
}
@@ -286,7 +286,7 @@
return find(Key, Key + strlen(Key));
}
const_iterator find(const std::string &Key) const {
- const char* key_start = &Key[0];
+ const char* key_start = (Key.empty() ? NULL : &Key[0]);
return find(key_start, key_start + Key.size());
}
@@ -295,7 +295,7 @@
return entry.getValue();
}
ValueTy& operator[](const std::string &Key) {
- const char* key_start = &Key[0];
+ const char* key_start = (Key.empty() ? NULL : &Key[0]);
value_type& entry = GetOrCreateValue(key_start, key_start + Key.size());
return entry.getValue();
}
@@ -307,7 +307,7 @@
return count(Key, Key + strlen(Key));
}
size_type count(const std::string &Key) const {
- const char* key_start = &Key[0];
+ const char* key_start = (Key.empty() ? NULL : &Key[0]);
return count(key_start, key_start + Key.size());
}
From tonic at nondot.org Tue Feb 5 18:54:55 2008
From: tonic at nondot.org (Tanya Lattner)
Date: Wed, 06 Feb 2008 00:54:55 -0000
Subject: [llvm-commits] [llvm] r46790 -
/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
Message-ID: <200802060054.m160stK3023791@zion.cs.uiuc.edu>
Author: tbrethou
Date: Tue Feb 5 18:54:55 2008
New Revision: 46790
URL: http://llvm.org/viewvc/llvm-project?rev=46790&view=rev
Log:
Throttle the non-local dependence analysis for basic blocks with more than 50 predecessors. Added command line option to play with this threshold.
Modified:
llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=46790&r1=46789&r2=46790&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Feb 5 18:54:55 2008
@@ -20,6 +20,7 @@
#include "llvm/Function.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Support/CFG.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetData.h"
#include "llvm/ADT/Statistic.h"
@@ -27,6 +28,15 @@
using namespace llvm;
+namespace {
+ // Control the calculation of non-local dependencies by only examining the
+ // predecessors if the basic block has less than X amount (50 by default).
+ cl::opt
+ PredLimit("nonlocaldep-threshold", cl::Hidden, cl::init(50),
+ cl::desc("Control the calculation of non-local"
+ "dependencies (default = 50)"));
+}
+
STATISTIC(NumCacheNonlocal, "Number of cached non-local responses");
STATISTIC(NumUncacheNonlocal, "Number of uncached non-local responses");
@@ -211,15 +221,18 @@
}
// If we didn't find anything, recurse on the precessors of this block
+ // Only do this for blocks with a small number of predecessors.
bool predOnStack = false;
bool inserted = false;
- for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB);
- PI != PE; ++PI)
- if (!visited.count(*PI)) {
- stack.push_back(*PI);
- inserted = true;
- } else
- predOnStack = true;
+ if (std::distance(pred_begin(BB), pred_end(BB)) <= PredLimit) {
+ for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB);
+ PI != PE; ++PI)
+ if (!visited.count(*PI)) {
+ stack.push_back(*PI);
+ inserted = true;
+ } else
+ predOnStack = true;
+ }
// If we inserted a new predecessor, then we'll come back to this block
if (inserted)
From resistor at mac.com Tue Feb 5 21:28:55 2008
From: resistor at mac.com (Owen Anderson)
Date: Tue, 5 Feb 2008 21:28:55 -0600
Subject: [llvm-commits] [llvm] r46790 -
/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
In-Reply-To: <200802060054.m160stK3023791@zion.cs.uiuc.edu>
References: <200802060054.m160stK3023791@zion.cs.uiuc.edu>
Message-ID: <6887BD71-4476-4914-81C2-90E2AD8765E7@mac.com>
Wow, that must be one hell of a CFG you're dealing with. ;-)
--Owen
On Feb 5, 2008, at 6:54 PM, Tanya Lattner wrote:
> Author: tbrethou
> Date: Tue Feb 5 18:54:55 2008
> New Revision: 46790
>
> URL: http://llvm.org/viewvc/llvm-project?rev=46790&view=rev
> Log:
> Throttle the non-local dependence analysis for basic blocks with
> more than 50 predecessors. Added command line option to play with
> this threshold.
>
> Modified:
> llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
>
> Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=46790&r1=46789&r2=46790&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
> +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Feb 5
> 18:54:55 2008
> @@ -20,6 +20,7 @@
> #include "llvm/Function.h"
> #include "llvm/Analysis/AliasAnalysis.h"
> #include "llvm/Support/CFG.h"
> +#include "llvm/Support/CommandLine.h"
> #include "llvm/Target/TargetData.h"
> #include "llvm/ADT/Statistic.h"
>
> @@ -27,6 +28,15 @@
>
> using namespace llvm;
>
> +namespace {
> + // Control the calculation of non-local dependencies by only
> examining the
> + // predecessors if the basic block has less than X amount (50 by
> default).
> + cl::opt
> + PredLimit("nonlocaldep-threshold", cl::Hidden, cl::init(50),
> + cl::desc("Control the calculation of non-local"
> + "dependencies (default = 50)"));
> +}
> +
> STATISTIC(NumCacheNonlocal, "Number of cached non-local responses");
> STATISTIC(NumUncacheNonlocal, "Number of uncached non-local
> responses");
>
> @@ -211,15 +221,18 @@
> }
>
> // If we didn't find anything, recurse on the precessors of this
> block
> + // Only do this for blocks with a small number of predecessors.
> bool predOnStack = false;
> bool inserted = false;
> - for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB);
> - PI != PE; ++PI)
> - if (!visited.count(*PI)) {
> - stack.push_back(*PI);
> - inserted = true;
> - } else
> - predOnStack = true;
> + if (std::distance(pred_begin(BB), pred_end(BB)) <= PredLimit) {
> + for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB);
> + PI != PE; ++PI)
> + if (!visited.count(*PI)) {
> + stack.push_back(*PI);
> + inserted = true;
> + } else
> + predOnStack = true;
> + }
>
> // If we inserted a new predecessor, then we'll come back to
> this block
> if (inserted)
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2555 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080205/41d83392/attachment.bin
From sabre at nondot.org Wed Feb 6 00:30:34 2008
From: sabre at nondot.org (Chris Lattner)
Date: Wed, 06 Feb 2008 06:30:34 -0000
Subject: [llvm-commits] [llvm] r46810 - /llvm/trunk/docs/ReleaseNotes.html
Message-ID: <200802060630.m166UYm3000469@zion.cs.uiuc.edu>
Author: lattner
Date: Wed Feb 6 00:30:34 2008
New Revision: 46810
URL: http://llvm.org/viewvc/llvm-project?rev=46810&view=rev
Log:
a starter shell for 2.2 release notes
Modified:
llvm/trunk/docs/ReleaseNotes.html
Modified: llvm/trunk/docs/ReleaseNotes.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=46810&r1=46809&r2=46810&view=diff
==============================================================================
--- llvm/trunk/docs/ReleaseNotes.html (original)
+++ llvm/trunk/docs/ReleaseNotes.html Wed Feb 6 00:30:34 2008
@@ -4,11 +4,11 @@
- LLVM 2.1 Release Notes
+ LLVM 2.2 Release Notes
-
This document contains the release notes for the LLVM compiler
-infrastructure, release 2.1. Here we describe the status of LLVM, including
+infrastructure, release 2.2. Here we describe the status of LLVM, including
major improvements from the previous release and any known problems. All LLVM
releases may be downloaded from the LLVM
releases web site.
@@ -58,31 +58,35 @@
-
This is the twelfth public release of the LLVM Compiler Infrastructure.
-It includes many features and refinements from LLVM 2.0.
+
This is the thirteenth public release of the LLVM Compiler Infrastructure.
+It includes many features and refinements from LLVM 2.1.
LLVM 2.1 brings two new beta C front-ends. First, a new version of llvm-gcc
-based on GCC 4.2, innovatively called "llvm-gcc-4.2". This promises to bring
-FORTRAN and Ada support to LLVM as well as features like atomic builtins and
-OpenMP. None of these actually work yet, but don't let that stop you checking
-it out!
-
-
Second, LLVM now includes its own native C and Objective-C front-end (C++ is
-in progress, but is not very far along) code named "clang". This front-end has a number of great
-features, primarily aimed at source-level analysis and speeding up compile-time.
-At this point though, the LLVM Code Generator component is still very early in
-development, so it's mostly useful for people looking to build source-level
-analysis tools or source-to-source translators.
+
LLVM 2.2 fully supports both the llvm-gcc 4.0 and llvm-gcc 4.2 front-ends (in
+LLVM 2.1, llvm-gcc 4.2 was beta). Since LLVM 2.1, the llvm-gcc 4.2 front-end
+has made leaps and bounds and is now at least as good as 4.0 in virtually every
+area, and is better in several areas (for example, exception handling
+correctness). We strongly recommend that you migrate from llvm-gcc 4.0 to
+llvm-gcc 4.2 in this release cycle because LLVM 2.2 is the last release
+that will support llvm-gcc 4.0: LLVM 2.3 will only support the llvm-gcc
+4.2 front-end.
+
+
The clang project is an effort
+to build a set of new front-end technology for the LLVM optimizer and code
+generator. Currently, its C and Objective-C support is maturing nicely, and it
+has advanced source-to-source analysis and transformation capabilities. If you
+are interested in building source-level tools for C and Objective-C (and
+eventually C++), you should take a look. However, note that clang is not an
+official part of the LLVM 2.2 release. If you are interested in this project,
+please see the web site and check it out from SVN head.
@@ -98,24 +102,7 @@
-
Owen Anderson wrote the new MemoryDependenceAnalysis pass, which provides
- a lazy, caching layer on top of AliasAnalysis. He then used it to rewrite
- DeadStoreElimination which resulted in significantly better compile time in
- common cases,
-
Owen implemented the new GVN pass, which is also based on
- MemoryDependenceAnalysis. This pass replaces GCSE/LoadVN in the standard
- set of passes, providing more aggressive optimization at a some-what
- improved compile-time cost.
-
Owen implemented GVN-PRE, a partial redundancy elimination algorithm that
- shares some details with the new GVN pass. It is still in need of compile
- time tuning, and is not turned on by default.
-
Devang merged ETForest and DomTree into a single easier to use data
- structure. This makes it more obvious which datastructure to choose
- (because there is only one) and makes the compiler more memory and time
- efficient (less stuff to keep up-to-date).
-
Nick Lewycky improved loop trip count analysis to handle many more common
- cases.
+
.
@@ -133,38 +120,7 @@
-
Dale finished up the Tail Merging optimization in the code generator, and
- enabled it by default. This produces smaller code that is also faster in
- some cases.
-
-
Christopher Lamb implemented support for virtual register sub-registers,
- which can be used to better model many forms of subregisters. As an example
- use, he modified the X86 backend to use this to model truncates and
- extends more accurately (leading to better code).
-
-
Dan Gohman changed the way we represent vectors before legalization,
- significantly simplifying the SelectionDAG representation for these and
- making the code generator faster for vector code.
-
-
Evan contributed a new target independent if-converter. While it is
- target independent, so far only the ARM backend uses it.
-
-
Evan rewrote the way the register allocator handles rematerialization,
- allowing it to be much more effective on two-address targets like X86,
- and taught it to fold loads away when possible (also a big win on X86).
-
-
Dan Gohman contributed support for better alignment and volatility handling
- in the code generator, and significantly enhanced alignment analysis for SSE
- load/store instructions. With his changes, an insufficiently-aligned SSE
- load instruction turns into movups, for example.
-
-
Duraid Madina contributed a new "bigblock" register allocator, and Roman
- Levenstein contributed several big improvements. BigBlock is optimized for
- code that uses very large basic blocks. It is slightly slower than the
- "local" allocator, but produces much better code.
-
-
David Greene refactored the register allocator to split coalescing out from
- allocation, making coalescers pluggable.
+
.
@@ -181,19 +137,7 @@
-
Bruno Cardoso Lopes contributed initial MIPS support. It is sufficient to
- run many small programs, but is still incomplete and is not yet
- fully performant.
-
-
Bill Wendling added SSSE3 support to the X86 backend.
-
-
Nicholas Geoffray contributed improved linux/ppc ABI and JIT support.
-
-
Dale Johannesen rewrote handling of 32-bit float values in the X86 backend
- when using the floating point stack, fixing several nasty bugs.
-
-
Dan contributed rematerialization support for the X86 backend, in addition
- to several X86-specific micro optimizations.
+
.
@@ -209,28 +153,7 @@
-
Duncan and Anton made significant progress chasing down a number of problems
- with C++ Zero-Cost exception handling in llvm-gcc 4.0 and 4.2. It is now at
- the point where it "just works" on linux/X86-32 and has partial support on
- other targets.
-
-
Devang and Duncan fixed a huge number of bugs relating to bitfields, pragma
- pack, and variable sized fields in structures.
-
-
Tanya implemented support for __attribute__((noinline)) in
- llvm-gcc, and added support for generic variable annotations which are
- propagated into the LLVM IR, e.g.
- "int X __attribute__((annotate("myproperty")));".
-
-
Sheng Zhou and Christopher Lamb implemented alias analysis support for
-"restrict" pointer arguments to functions.
-
-
Duncan contributed support for trampolines (taking the address of a nested
- function). Currently this is only supported on the X86-32 target.
-
-
Lauro Ramos Venancio contributed support to encode alignment info in
- load and store instructions, the foundation for other alignment-related
- work.
+
.
@@ -246,22 +169,7 @@
-
Neil Booth contributed a new "APFloat" class, which ensures that floating
- point representation and constant folding is not dependent on the host
- architecture that builds the application. This support is the foundation
- for "long double" support that will be wrapped up in LLVM 2.2.
-
-
Based on the APFloat class, Dale redesigned the internals of the ConstantFP
- class and has been working on extending the core and optimizer components to
- support various target-specific 'long double's. We expect this work to be
- completed in LLVM 2.2.
-
-
LLVM now provides an LLVMBuilder class, which makes it significantly easier
- to create LLVM IR instructions.
-
-
Reid contributed support for intrinsics that take arbitrary integer typed
- arguments. Dan Gohman and Chandler extended it to support arbitrary
- floating point arguments and vectors.
+
.
@@ -276,13 +184,7 @@
-
Sterling Stein contributed a new BrainF frontend, located in llvm/examples.
- This shows a some of the more modern APIs for building a front-end, and
- demonstrates JIT compiler support.
-
-
David Green contributed a new --enable-expensive-checks configure
- option which enables STL checking, and fixed several bugs exposed by
- it.
+
.
@@ -300,7 +202,7 @@
Intel and AMD machines running Red Hat Linux, Fedora Core and FreeBSD
(and probably other unix-like systems).
-
PowerPC and X86-based Mac OS X systems, running 10.2 and above in 32-bit and
+
PowerPC and X86-based Mac OS X systems, running 10.3 and above in 32-bit and
64-bit modes.
Intel and AMD machines running on Win32 using MinGW libraries (native)
Intel and AMD machines running on Win32 with the Cygwin libraries (limited
@@ -350,11 +252,10 @@
The -cee pass is known to be buggy, and may be removed in a
future release.
-
The MSIL backend is experimental.
-
The IA64 code generator is experimental.
-
The Alpha backend is experimental.
-
"-filetype=asm" (the default) is the only supported value for the
- -filetype llc option.
+
The MSIL, IA64, Alpha, and MIPS backends are experimental.
+
The LLC "-filetype=asm" (the default) is the only supported
+ value for this option.
The Linux PPC32/ABI support needs testing for the interpreter and static
compilation, and lacks support for debug information.
@@ -515,10 +414,6 @@
-
"long double" is silently transformed by the front-end into "double". There
-is no support for floating point data types of any size other than 32 and 64
-bits.
-
llvm-gcc does not support __builtin_apply yet.
See Constructing Calls: Dispatching a call to another function.
@@ -623,29 +518,7 @@
itself, Qt, Mozilla, etc.
-
Exception handling only works well on the linux/X86-32 target.
-In some cases, illegally throwing an exception does not result
-in a call to terminate.
-
-
+
Exception handling only works well on the X86 and PowerPC targets.
From evan.cheng at apple.com Wed Feb 6 02:00:32 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 06 Feb 2008 08:00:32 -0000
Subject: [llvm-commits] [llvm] r46813 -
/llvm/trunk/lib/CodeGen/RegAllocLocal.cpp
Message-ID: <200802060800.m1680WmO002729@zion.cs.uiuc.edu>
Author: evancheng
Date: Wed Feb 6 02:00:32 2008
New Revision: 46813
URL: http://llvm.org/viewvc/llvm-project?rev=46813&view=rev
Log:
RegAllocaLocal still *requires* LiveVariables since it runs PHIElimination, followed by TwoAddress which requires LiveVariables. We cannot run LiveVariables on non-SSA code.
Modified:
llvm/trunk/lib/CodeGen/RegAllocLocal.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocLocal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLocal.cpp?rev=46813&r1=46812&r2=46813&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocLocal.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocLocal.cpp Wed Feb 6 02:00:32 2008
@@ -14,11 +14,12 @@
#define DEBUG_TYPE "regalloc"
#include "llvm/BasicBlock.h"
-#include "llvm/CodeGen/Passes.h"
+#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/RegAllocRegistry.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
@@ -146,6 +147,7 @@
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.addRequired();
AU.addRequiredID(PHIEliminationID);
AU.addRequiredID(TwoAddressInstructionPassID);
MachineFunctionPass::getAnalysisUsage(AU);
From gabor at mac.com Wed Feb 6 07:33:06 2008
From: gabor at mac.com (Gabor Greif)
Date: Wed, 06 Feb 2008 14:33:06 +0100
Subject: [llvm-commits] [llvm] r46810 - /llvm/trunk/docs/ReleaseNotes.html
Message-ID: <47A9B712.8050301@mac.com>
Here my 2 cent:
+
The clang project is an effort
+to build a set of new front-end technology for the LLVM optimizer and code
^
technologies
+generator. Currently, its C and Objective-C support is maturing nicely, and it
+has advanced source-to-source analysis and transformation capabilities. If you
+are interested in building source-level tools for C and Objective-C (and
+eventually C++), you should take a look. However, note that clang is not an
+official part of the LLVM 2.2 release. If you are interested in this project,
+please see the web site and check it out from SVN head.
Comment that it is developed in sync with llvm SVN head ?
In the doc:
"main focuses" --?--> "main foci" ?
"using MinGW libraries (native)" --> "using MinGW libraries (native)."
"The -cee pass is known to be buggy, and may be removed in a future release."
Is it already gone in 2.2 or on SVN head?
"The Linux PPC32/ABI support needs testing for the interpreter and static compilation, and lacks support for debug information."
IIRC this has been fixed.
"llvm-gcc4 does"
llvm-gcc4.0 or llvm-gcc4.2 ?
Cheers,
Gabor
From sabre at nondot.org Wed Feb 6 12:00:07 2008
From: sabre at nondot.org (Chris Lattner)
Date: Wed, 06 Feb 2008 18:00:07 -0000
Subject: [llvm-commits] [llvm] r46816 - /llvm/trunk/docs/ReleaseNotes.html
Message-ID: <200802061800.m16I07hk027721@zion.cs.uiuc.edu>
Author: lattner
Date: Wed Feb 6 12:00:06 2008
New Revision: 46816
URL: http://llvm.org/viewvc/llvm-project?rev=46816&view=rev
Log:
add a bunch of random notes and fix some issues noticed by Gabor.
This is not ready for review or hacking, this is a work in progress :)
Modified:
llvm/trunk/docs/ReleaseNotes.html
Modified: llvm/trunk/docs/ReleaseNotes.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=46816&r1=46815&r2=46816&view=diff
==============================================================================
--- llvm/trunk/docs/ReleaseNotes.html (original)
+++ llvm/trunk/docs/ReleaseNotes.html Wed Feb 6 12:00:06 2008
@@ -79,14 +79,38 @@
that will support llvm-gcc 4.0: LLVM 2.3 will only support the llvm-gcc
4.2 front-end.
-
The clang project is an effort
-to build a set of new front-end technology for the LLVM optimizer and code
-generator. Currently, its C and Objective-C support is maturing nicely, and it
-has advanced source-to-source analysis and transformation capabilities. If you
-are interested in building source-level tools for C and Objective-C (and
-eventually C++), you should take a look. However, note that clang is not an
-official part of the LLVM 2.2 release. If you are interested in this project,
-please see the web site and check it out from SVN head.
+
The clang project is an effort to build
+a set of new 'llvm native' front-end technologies for the LLVM optimizer
+and code generator. Currently, its C and Objective-C support is maturing
+nicely, and it has advanced source-to-source analysis and transformation
+capabilities. If you are interested in building source-level tools for C and
+Objective-C (and eventually C++), you should take a look. However, note that
+clang is not an official part of the LLVM 2.2 release. If you are interested in
+this project, please see the web site.
Dale contributed full support for long double on x86/x86-64 (where it is 80
+bits) and on Darwin PPC/PPC64 (where it is 128 bits).
+
+
Ada, gfortran
+
+
+debug improvements -O0
+EH.
+
+Gordon: GC Revamp. docs/GarbageCollection.html
+
+Kaleidescope: docs/tutorial
+
+Gordon: C and Ocaml Bindings
@@ -102,8 +126,12 @@
-
.
+
Daniel Berlin and (?) rewrote Andersen's alias analysis (which is not
+enabled by default) to be several orders of magnitude faster, implmented Offline
+Variable Substitution.
+
+Devang: LoopIndexSplit is enabled by default.
@@ -115,13 +143,17 @@
-
One of the main focuses of this release was performance tuning and bug
+
foci of this release was performance tuning and bug
fixing. In addition to these, several new major changes occurred:
-
.
+
Owen contributed Machine Loop info, domintors, etc.
+
Dan added support for emitting debug information with .file and .loc on
+targets that support it
+
+
Evan physical register dependencies in the BURR scheduler
@@ -137,7 +169,8 @@
-
.
+
Evan X86 now models EFLAGS in instructions.
+
Evan: If conversion on by default for ARM.
@@ -204,7 +237,7 @@
(and probably other unix-like systems).
PowerPC and X86-based Mac OS X systems, running 10.3 and above in 32-bit and
64-bit modes.
-
Intel and AMD machines running on Win32 using MinGW libraries (native)
+
Intel and AMD machines running on Win32 using MinGW libraries (native).
Intel and AMD machines running on Win32 with the Cygwin libraries (limited
support is available for native builds with Visual C++).
Sun UltraSPARC workstations running Solaris 8.
@@ -250,8 +283,8 @@
components, please contact us on the LLVMdev list.
-
The -cee pass is known to be buggy, and may be removed in a
- future release.
+
The -cee pass is known to be buggy and will be removed in
+ LLVM 2.3.
The MSIL, IA64, Alpha, and MIPS backends are experimental.
The LLC "-filetype=asm" (the default) is the only supported
value for this option.
@@ -400,8 +433,8 @@
-
llvm-gcc4 does not currently support Link-Time
-Optimization on most platforms "out-of-the-box". Please inquire on the
+
llvm-gcc does not currently support Link-Time
+Optimization on most platforms "out-of-the-box". Please inquire on the
llvmdev mailing list if you are interested.
From sabre at nondot.org Wed Feb 6 12:00:48 2008
From: sabre at nondot.org (Chris Lattner)
Date: Wed, 06 Feb 2008 18:00:48 -0000
Subject: [llvm-commits] [llvm] r46817 - /llvm/trunk/docs/ReleaseNotes.html
Message-ID: <200802061800.m16I0mHx027755@zion.cs.uiuc.edu>
Author: lattner
Date: Wed Feb 6 12:00:48 2008
New Revision: 46817
URL: http://llvm.org/viewvc/llvm-project?rev=46817&view=rev
Log:
make it clear :)
Modified:
llvm/trunk/docs/ReleaseNotes.html
Modified: llvm/trunk/docs/ReleaseNotes.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=46817&r1=46816&r2=46817&view=diff
==============================================================================
--- llvm/trunk/docs/ReleaseNotes.html (original)
+++ llvm/trunk/docs/ReleaseNotes.html Wed Feb 6 12:00:48 2008
@@ -23,6 +23,9 @@
THIS IS A WORK IN PROGRESS FOR THE LLVM 2.2
+RELEASE
+
Introduction
From clattner at apple.com Wed Feb 6 12:02:02 2008
From: clattner at apple.com (Chris Lattner)
Date: Wed, 6 Feb 2008 10:02:02 -0800
Subject: [llvm-commits] [llvm] r46810 -
/llvm/trunk/docs/ReleaseNotes.html
In-Reply-To: <47A9B712.8050301@mac.com>
References: <47A9B712.8050301@mac.com>
Message-ID: <2417D7F3-9342-4F66-906D-DCFEFD7483CB@apple.com>
On Feb 6, 2008, at 5:33 AM, Gabor Greif wrote:
> Here my 2 cent:
Thanks Gabor. I wasn't really ready for review, but I appreciate it :)
> +
The clang project is an
> effort
> +to build a set of new front-end technology for the LLVM optimizer
> and code
> ^
> technologies
Fixed.
> +generator. Currently, its C and Objective-C support is maturing
> nicely, and it
> +has advanced source-to-source analysis and transformation
> capabilities. If you
> +are interested in building source-level tools for C and Objective-C
> (and
> +eventually C++), you should take a look. However, note that clang
> is not an
> +official part of the LLVM 2.2 release. If you are interested in
> this project,
> +please see the web site and check it out from SVN head.
>
> Comment that it is developed in sync with llvm SVN head ?
I just removed where the check it out.
> In the doc:
> "main focuses" --?--> "main foci" ?
> "using MinGW libraries (native)" --> "using MinGW libraries (native)."
Ok.
> "The -cee pass is known to be buggy, and may be removed in a future
> release."
> Is it already gone in 2.2 or on SVN head?
SVN Head, I clarified.
> "The Linux PPC32/ABI support needs testing for the interpreter and
> static compilation, and lacks support for debug information."
> IIRC this has been fixed.
I'm pretty sure there are still significant issues, with varargs for
example.
> "llvm-gcc4 does"
> llvm-gcc4.0 or llvm-gcc4.2 ?
Fixed. Neither!
-Chris
From echristo at apple.com Wed Feb 6 12:13:57 2008
From: echristo at apple.com (Eric Christopher)
Date: Wed, 6 Feb 2008 10:13:57 -0800
Subject: [llvm-commits] [llvm] r46817 -
/llvm/trunk/docs/ReleaseNotes.html
In-Reply-To: <200802061800.m16I0mHx027755@zion.cs.uiuc.edu>
References: <200802061800.m16I0mHx027755@zion.cs.uiuc.edu>
Message-ID: <7B278341-4325-450B-8EFA-B8A401480642@apple.com>
>
> +
THIS IS A WORK IN PROGRESS FOR THE LLVM 2.2
> +RELEASE
> +
You forgot the blink tag :)
-eric
From clattner at apple.com Wed Feb 6 12:17:44 2008
From: clattner at apple.com (Chris Lattner)
Date: Wed, 6 Feb 2008 10:17:44 -0800
Subject: [llvm-commits] [llvm] r46817
- /llvm/trunk/docs/ReleaseNotes.html
In-Reply-To: <7B278341-4325-450B-8EFA-B8A401480642@apple.com>
References: <200802061800.m16I0mHx027755@zion.cs.uiuc.edu>
<7B278341-4325-450B-8EFA-B8A401480642@apple.com>
Message-ID:
On Feb 6, 2008, at 10:13 AM, Eric Christopher wrote:
>>
>> +
THIS IS A WORK IN PROGRESS FOR THE LLVM 2.2
>> +RELEASE
>> +
>
> You forgot the blink tag :)
How about a javascript animation using canvas!? :)
-Chris
From dalej at apple.com Wed Feb 6 12:18:14 2008
From: dalej at apple.com (Dale Johannesen)
Date: Wed, 6 Feb 2008 10:18:14 -0800
Subject: [llvm-commits] [llvm] r46764 - in /llvm/trunk:
include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86ISelLowering.cpp
In-Reply-To:
References: <200802052046.m15KkXq0016743@zion.cs.uiuc.edu>
<0D34AD0E-E368-4E71-9E90-345AFC264D83@apple.com>
<61A65A2A-8D56-4CAA-8A0A-095A85626BB5@apple.com>
<9624F9F3-E870-4832-BAA0-4591C872DC0D@apple.com>
Message-ID: <4A426418-DFAF-4344-AA68-BF5121A88514@apple.com>
On Feb 5, 2008, at 2:36 PM, Dale Johannesen wrote:
> On Feb 5, 2008, at 2:34 PM, Chris Lattner wrote:
>> On Feb 5, 2008, at 2:31 PM, Dale Johannesen wrote:
>>>> I think the calling convention stuff that Evan has been working
>>>> on is
>>>> powerful enough to model though sort of stuff, but might need minor
>>>> extensions. Do you think it would be reasonable do use this
>>>> approach? Doing so would eliminate a "magic" calling convention,
>>>> which would be nice :)
>>>
>>> It would, but coercing standard types to a different type strikes me
>>> as worse.
>>> The IR really ought to be able to handle standard types without
>>> obfuscation.
>>
>> I don't think it would be a problem in this specific case, but I
>> understand what you mean.
>>
>>> What I really wanted was to put InReg on the return value.
>>
>> Ah, that's a good idea. Why not do that? :) Generally, putting the
>> attribute on argument "#0" means that the attribute applies to the
>> function or the return value. Given that 'inreg' doesn't make any
>> sense for a function, it would be fine to overload it for this, what
>> do you think?
>
> Sound good if it's that simple. It looked more complicated, but I
> was probably missing something. I'll look again.
Attaching this to the Function node went smoothly enough, but I
actually need it on the Return node, which it appears isn't supported
in the current IR, but is in the the machine-level RET node. I could
transfer the info from the Function node to the RET node at some
point, or even reference the Function node from the code that handles
RET I suppose, but it seems cleaner to change the IR; which would
break binary compatibility. Considering that this works as is and is
not all that important to begin with, I'm thinking it's best to wait
until we can change the IR and do it right. Thoughts?
From clattner at apple.com Wed Feb 6 12:25:12 2008
From: clattner at apple.com (Chris Lattner)
Date: Wed, 6 Feb 2008 10:25:12 -0800
Subject: [llvm-commits] [llvm] r46764 - in /llvm/trunk:
include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86ISelLowering.cpp
In-Reply-To: <4A426418-DFAF-4344-AA68-BF5121A88514@apple.com>
References: <200802052046.m15KkXq0016743@zion.cs.uiuc.edu>
<0D34AD0E-E368-4E71-9E90-345AFC264D83@apple.com>
<61A65A2A-8D56-4CAA-8A0A-095A85626BB5@apple.com>
<9624F9F3-E870-4832-BAA0-4591C872DC0D@apple.com>
<4A426418-DFAF-4344-AA68-BF5121A88514@apple.com>
Message-ID:
>>>
>>> Ah, that's a good idea. Why not do that? :) Generally, putting the
>>> attribute on argument "#0" means that the attribute applies to the
>>> function or the return value. Given that 'inreg' doesn't make any
>>> sense for a function, it would be fine to overload it for this, what
>>> do you think?
>>
>> Sound good if it's that simple. It looked more complicated, but I
>> was probably missing something. I'll look again.
>
> Attaching this to the Function node went smoothly enough, but I
> actually need it on the Return node, which it appears isn't
> supported in the current IR, but is in the the machine-level RET
> node. I could transfer the info from the Function node to the RET
> node at some point, or even reference the Function node from the
> code that handles RET I suppose, but it seems cleaner to change the
> IR; which would break binary compatibility. Considering that this
> works as is and is not all that important to begin with, I'm
> thinking it's best to wait until we can change the IR and do it
> right. Thoughts?
From the current SelectionDAG you can get a pointer to the Function
object, which should have the attribute. Lowering for an ISD::RET can
thus getting it from following this chain,
-Chris
From sabre at nondot.org Wed Feb 6 12:32:06 2008
From: sabre at nondot.org (Chris Lattner)
Date: Wed, 06 Feb 2008 18:32:06 -0000
Subject: [llvm-commits] [llvm] r46818 - /llvm/trunk/docs/ReleaseNotes.html
Message-ID: <200802061832.m16IW6VH028654@zion.cs.uiuc.edu>
Author: lattner
Date: Wed Feb 6 12:32:06 2008
New Revision: 46818
URL: http://llvm.org/viewvc/llvm-project?rev=46818&view=rev
Log:
some more notes.
Modified:
llvm/trunk/docs/ReleaseNotes.html
Modified: llvm/trunk/docs/ReleaseNotes.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=46818&r1=46817&r2=46818&view=diff
==============================================================================
--- llvm/trunk/docs/ReleaseNotes.html (original)
+++ llvm/trunk/docs/ReleaseNotes.html Wed Feb 6 12:32:06 2008
@@ -129,7 +129,7 @@
-
Daniel Berlin and (?) rewrote Andersen's alias analysis (which is not
+
Daniel Berlin and (Curtis?) rewrote Andersen's alias analysis (which is not
enabled by default) to be several orders of magnitude faster, implmented Offline
Variable Substitution.
@@ -151,12 +151,15 @@
-
Owen contributed Machine Loop info, domintors, etc.
+
Owen contributed Machine Loop info, domintors, etc. Merged dom and
+ postdom.
Dan added support for emitting debug information with .file and .loc on
targets that support it
Evan physical register dependencies in the BURR scheduler
+
+
Evan EXTRACT_SUBREG coalescing support
@@ -174,6 +177,8 @@
Evan X86 now models EFLAGS in instructions.
Evan: If conversion on by default for ARM.
+
Bruno: MIPS PIC support.
+
Arnold Schwaighofer: X86 tail call support.
@@ -205,7 +210,8 @@
-
.
+
Devang added LLVMFoldingBuilder.
+
Dan added support for vector sin, cos, and pow intrinsics.
From dalej at apple.com Wed Feb 6 12:36:24 2008
From: dalej at apple.com (Dale Johannesen)
Date: Wed, 6 Feb 2008 10:36:24 -0800
Subject: [llvm-commits] [llvm] r46764 - in /llvm/trunk:
include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86ISelLowering.cpp
In-Reply-To:
References: <200802052046.m15KkXq0016743@zion.cs.uiuc.edu>
<0D34AD0E-E368-4E71-9E90-345AFC264D83@apple.com>
<61A65A2A-8D56-4CAA-8A0A-095A85626BB5@apple.com>
<9624F9F3-E870-4832-BAA0-4591C872DC0D@apple.com>
<4A426418-DFAF-4344-AA68-BF5121A88514@apple.com>
Message-ID:
On Feb 6, 2008, at 10:25 AM, Chris Lattner wrote:
>>>>
>>>> Ah, that's a good idea. Why not do that? :) Generally, putting
>>>> the
>>>> attribute on argument "#0" means that the attribute applies to the
>>>> function or the return value. Given that 'inreg' doesn't make any
>>>> sense for a function, it would be fine to overload it for this,
>>>> what
>>>> do you think?
>>>
>>> Sound good if it's that simple. It looked more complicated, but I
>>> was probably missing something. I'll look again.
>>
>> Attaching this to the Function node went smoothly enough, but I
>> actually need it on the Return node, which it appears isn't
>> supported in the current IR, but is in the the machine-level RET
>> node. I could transfer the info from the Function node to the RET
>> node at some point, or even reference the Function node from the
>> code that handles RET I suppose, but it seems cleaner to change the
>> IR; which would break binary compatibility. Considering that this
>> works as is and is not all that important to begin with, I'm
>> thinking it's best to wait until we can change the IR and do it
>> right. Thoughts?
>
> From the current SelectionDAG you can get a pointer to the Function
> object, which should have the attribute. Lowering for an ISD::RET
> can thus getting it from following this chain,
I know, I just don't think that's the right way to do it.
From clattner at apple.com Wed Feb 6 12:48:51 2008
From: clattner at apple.com (Chris Lattner)
Date: Wed, 6 Feb 2008 10:48:51 -0800
Subject: [llvm-commits] [llvm] r46764 - in /llvm/trunk:
include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86ISelLowering.cpp
In-Reply-To:
References: <200802052046.m15KkXq0016743@zion.cs.uiuc.edu>
<0D34AD0E-E368-4E71-9E90-345AFC264D83@apple.com>
<61A65A2A-8D56-4CAA-8A0A-095A85626BB5@apple.com>
<9624F9F3-E870-4832-BAA0-4591C872DC0D@apple.com>
<4A426418-DFAF-4344-AA68-BF5121A88514@apple.com>
Message-ID:
>>> Attaching this to the Function node went smoothly enough, but I
>>> actually need it on the Return node, which it appears isn't
>>> supported in the current IR, but is in the the machine-level RET
>>> node. I could transfer the info from the Function node to the RET
>>> node at some point, or even reference the Function node from the
>>> code that handles RET I suppose, but it seems cleaner to change the
>>> IR; which would break binary compatibility. Considering that this
>>> works as is and is not all that important to begin with, I'm
>>> thinking it's best to wait until we can change the IR and do it
>>> right. Thoughts?
>>
>> From the current SelectionDAG you can get a pointer to the Function
>> object, which should have the attribute. Lowering for an ISD::RET
>> can thus getting it from following this chain,
>
> I know, I just don't think that's the right way to do it.
Why not?
-Chris
From isanbard at gmail.com Wed Feb 6 13:05:56 2008
From: isanbard at gmail.com (Bill Wendling)
Date: Wed, 06 Feb 2008 19:05:56 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46820 -
/llvm-gcc-4.2/trunk/gcc/varasm.c
Message-ID: <200802061905.m16J5uql029640@zion.cs.uiuc.edu>
Author: void
Date: Wed Feb 6 13:05:56 2008
New Revision: 46820
URL: http://llvm.org/viewvc/llvm-project?rev=46820&view=rev
Log:
I meant to retain the behavior when ENABLE_LLVM wasn't defined, but not output
to the ASM file. My patch was wrong because it issued the warning
unconditionally when ENABLE_LLVM was defined. This should enable the old
behavior when ENABLE_LLVM is undefined and give us the warning when
HAVE_GAS_HIDDEN isn't defined.
Modified:
llvm-gcc-4.2/trunk/gcc/varasm.c
Modified: llvm-gcc-4.2/trunk/gcc/varasm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/varasm.c?rev=46820&r1=46819&r2=46820&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/varasm.c (original)
+++ llvm-gcc-4.2/trunk/gcc/varasm.c Wed Feb 6 13:05:56 2008
@@ -5316,10 +5316,13 @@
type = visibility_types[vis];
-#if !defined(ENABLE_LLVM) && defined(HAVE_GAS_HIDDEN)
+#ifdef HAVE_GAS_HIDDEN
+#ifndef ENABLE_LLVM
fprintf (asm_out_file, "\t.%s\t", type);
assemble_name (asm_out_file, name);
fprintf (asm_out_file, "\n");
+ /* LLVM LOCAL */
+#endif
#else
warning (OPT_Wattributes, "visibility attribute not supported "
"in this configuration; ignored");
From dalej at apple.com Wed Feb 6 13:07:12 2008
From: dalej at apple.com (Dale Johannesen)
Date: Wed, 6 Feb 2008 11:07:12 -0800
Subject: [llvm-commits] [llvm] r46764 - in /llvm/trunk:
include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86ISelLowering.cpp
In-Reply-To:
References: <200802052046.m15KkXq0016743@zion.cs.uiuc.edu>
<0D34AD0E-E368-4E71-9E90-345AFC264D83@apple.com>
<61A65A2A-8D56-4CAA-8A0A-095A85626BB5@apple.com>
<9624F9F3-E870-4832-BAA0-4591C872DC0D@apple.com>
<4A426418-DFAF-4344-AA68-BF5121A88514@apple.com>
Message-ID: <0E37AD98-1897-4AC7-A202-9FFB8223B6C9@apple.com>
On Feb 6, 2008, at 10:48 AM, Chris Lattner wrote:
>>>> Attaching this to the Function node went smoothly enough, but I
>>>> actually need it on the Return node, which it appears isn't
>>>> supported in the current IR, but is in the the machine-level RET
>>>> node. I could transfer the info from the Function node to the RET
>>>> node at some point, or even reference the Function node from the
>>>> code that handles RET I suppose, but it seems cleaner to change the
>>>> IR; which would break binary compatibility. Considering that this
>>>> works as is and is not all that important to begin with, I'm
>>>> thinking it's best to wait until we can change the IR and do it
>>>> right. Thoughts?
>>>
>>> From the current SelectionDAG you can get a pointer to the Function
>>> object, which should have the attribute. Lowering for an ISD::RET
>>> can thus getting it from following this chain,
>>
>> I know, I just don't think that's the right way to do it.
>
> Why not?
Everywhere else we use ParamAttrs they're on the node where you need
them. We could make the actual parameters get them from the callee
prototype too, but we don't do that, we put the attributes right on
the actual parameters.
From clattner at apple.com Wed Feb 6 13:11:07 2008
From: clattner at apple.com (Chris Lattner)
Date: Wed, 6 Feb 2008 11:11:07 -0800
Subject: [llvm-commits] [llvm] r46764 - in /llvm/trunk:
include/llvm/CallingConv.h lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86ISelLowering.cpp
In-Reply-To: <0E37AD98-1897-4AC7-A202-9FFB8223B6C9@apple.com>
References: <200802052046.m15KkXq0016743@zion.cs.uiuc.edu>
<0D34AD0E-E368-4E71-9E90-345AFC264D83@apple.com>
<61A65A2A-8D56-4CAA-8A0A-095A85626BB5@apple.com>
<9624F9F3-E870-4832-BAA0-4591C872DC0D@apple.com>
<4A426418-DFAF-4344-AA68-BF5121A88514@apple.com>
<0E37AD98-1897-4AC7-A202-9FFB8223B6C9@apple.com>
Message-ID:
>>>> From the current SelectionDAG you can get a pointer to the Function
>>>> object, which should have the attribute. Lowering for an ISD::RET
>>>> can thus getting it from following this chain,
>>>
>>> I know, I just don't think that's the right way to do it.
>>
>> Why not?
>
> Everywhere else we use ParamAttrs they're on the node where you need
> them. We could make the actual parameters get them from the callee
> prototype too, but we don't do that, we put the attributes right on
> the actual parameters.
Is that also true for sext/zext attributes on the result? Inreg seems
like a very similar issue to them.
-Chris
From evan.cheng at apple.com Wed Feb 6 13:16:53 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 06 Feb 2008 19:16:53 -0000
Subject: [llvm-commits] [llvm] r46821 - in /llvm/trunk:
lib/CodeGen/RegAllocLocal.cpp
test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll
Message-ID: <200802061916.m16JGrdD029950@zion.cs.uiuc.edu>
Author: evancheng
Date: Wed Feb 6 13:16:53 2008
New Revision: 46821
URL: http://llvm.org/viewvc/llvm-project?rev=46821&view=rev
Log:
Fix a number of local register allocator issues: PR1609.
Added:
llvm/trunk/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll
Modified:
llvm/trunk/lib/CodeGen/RegAllocLocal.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocLocal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLocal.cpp?rev=46821&r1=46820&r2=46821&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocLocal.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocLocal.cpp Wed Feb 6 13:16:53 2008
@@ -29,6 +29,7 @@
#include "llvm/ADT/IndexedMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
+#include "llvm/ADT/STLExtras.h"
#include
using namespace llvm;
@@ -296,16 +297,24 @@
std::pair &LastUse = getVirtRegLastUse(VirtReg);
if (LastUse.first)
LastUse.first->getOperand(LastUse.second).setIsKill();
- }
-
- // Otherwise, there is a virtual register corresponding to this physical
- // register. We only need to spill it into its stack slot if it has been
- // modified.
- if (isVirtRegModified(VirtReg)) {
+ } else {
+ // Otherwise, there is a virtual register corresponding to this physical
+ // register. We only need to spill it into its stack slot if it has been
+ // modified.
const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(VirtReg);
int FrameIndex = getStackSpaceFor(VirtReg, RC);
DOUT << " to stack slot #" << FrameIndex;
TII->storeRegToStackSlot(MBB, I, PhysReg, true, FrameIndex, RC);
+
+ // If the instruction reads the register that's spilled, (e.g. this can
+ // happen if it is a move to a physical register), then the spill
+ // instruction is not a kill.
+ if (I != MBB.end() && I->findRegisterUseOperandIdx(PhysReg) != -1) {
+ MachineBasicBlock::iterator StoreMI = prior(I);
+ int Idx = StoreMI->findRegisterUseOperandIdx(PhysReg, true);
+ assert(Idx != -1 && "Unrecognized spill instruction!");
+ StoreMI->getOperand(Idx).setIsKill(false);
+ }
++NumStores; // Update statistics
}
@@ -494,12 +503,6 @@
// If we can fold this spill into this instruction, do so now.
SmallVector Ops;
Ops.push_back(OpNum);
- if (MachineInstr* FMI = TII->foldMemoryOperand(MI, Ops, FrameIndex)) {
- ++NumFolded;
- // Update kill/dead flags.
- FMI->copyKillDeadInfo(MI);
- return MBB.insert(MBB.erase(MI), FMI);
- }
// It looks like we can't fold this virtual register load into this
// instruction. Force some poor hapless value out of the register file to
@@ -775,9 +778,8 @@
// Finally, if this is a noop copy instruction, zap it.
unsigned SrcReg, DstReg;
- if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg) {
+ if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg)
MBB.erase(MI);
- }
}
MachineBasicBlock::iterator MI = MBB.getFirstTerminator();
Added: llvm/trunk/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll?rev=46821&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll Wed Feb 6 13:16:53 2008
@@ -0,0 +1,19 @@
+; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi -regalloc=local
+; PR1609
+
+ %struct.encode_aux_nearestmatch = type { i32*, i32*, i32*, i32*, i32, i32 }
+ %struct.encode_aux_pigeonhole = type { float, float, i32, i32, i32*, i32, i32*, i32*, i32* }
+ %struct.encode_aux_threshmatch = type { float*, i32*, i32, i32 }
+ %struct.oggpack_buffer = type { i32, i32, i8*, i8*, i32 }
+ %struct.static_codebook = type { i32, i32, i32*, i32, i32, i32, i32, i32, i32*, %struct.encode_aux_nearestmatch*, %struct.encode_aux_threshmatch*, %struct.encode_aux_pigeonhole*, i32 }
+
+define i32 @vorbis_staticbook_pack(%struct.static_codebook* %c, %struct.oggpack_buffer* %opb) {
+entry:
+ %opb_addr = alloca %struct.oggpack_buffer* ; <%struct.oggpack_buffer**> [#uses=1]
+ %tmp1 = load %struct.oggpack_buffer** %opb_addr, align 4 ; <%struct.oggpack_buffer*> [#uses=1]
+ call void @oggpack_write( %struct.oggpack_buffer* %tmp1, i32 5653314, i32 24 ) nounwind
+ call void @oggpack_write( %struct.oggpack_buffer* null, i32 0, i32 24 ) nounwind
+ unreachable
+}
+
+declare void @oggpack_write(%struct.oggpack_buffer*, i32, i32)
From lauro.venancio at gmail.com Wed Feb 6 13:53:21 2008
From: lauro.venancio at gmail.com (Lauro Ramos Venancio)
Date: Wed, 6 Feb 2008 16:53:21 -0300
Subject: [llvm-commits] [llvm] r46821 - in /llvm/trunk:
lib/CodeGen/RegAllocLocal.cpp
test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll
In-Reply-To: <200802061916.m16JGrdD029950@zion.cs.uiuc.edu>
References: <200802061916.m16JGrdD029950@zion.cs.uiuc.edu>
Message-ID: <9c10c9f0802061153h6787e8ddoddcd4b2d6b732b0c@mail.gmail.com>
==============================================================================
> --- llvm/trunk/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll (added)
> +++ llvm/trunk/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll Wed Feb 6 13:16:53 2008
> @@ -0,0 +1,19 @@
> +; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi -regalloc=local
> +; PR1609
> +
I think it should be PR1925.
Lauro
From isanbard at gmail.com Wed Feb 6 14:03:07 2008
From: isanbard at gmail.com (Bill Wendling)
Date: Wed, 06 Feb 2008 20:03:07 -0000
Subject: [llvm-commits] [llvm] r46822 - in /llvm/trunk:
lib/Transforms/Scalar/GVN.cpp test/Transforms/GVN/memcpy.ll
Message-ID: <200802062003.m16K37Q3031580@zion.cs.uiuc.edu>
Author: void
Date: Wed Feb 6 14:03:07 2008
New Revision: 46822
URL: http://llvm.org/viewvc/llvm-project?rev=46822&view=rev
Log:
Temporarily reverting:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080128/057882.html
This is causing a miscompilation on PPC G5 and just now seeing it on iMac x86-64.
Modified:
llvm/trunk/lib/Transforms/Scalar/GVN.cpp
llvm/trunk/test/Transforms/GVN/memcpy.ll
Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=46822&r1=46821&r2=46822&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Wed Feb 6 14:03:07 2008
@@ -19,7 +19,6 @@
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
-#include "llvm/IntrinsicInst.h"
#include "llvm/Instructions.h"
#include "llvm/Value.h"
#include "llvm/ADT/BitVector.h"
@@ -737,7 +736,6 @@
SmallVector& toErase);
bool processNonLocalLoad(LoadInst* L,
SmallVector& toErase);
- bool processMemCpy(MemCpyInst* M, SmallVector& toErase);
Value *GetValueForBlock(BasicBlock *BB, LoadInst* orig,
DenseMap &Phis,
bool top_level = false);
@@ -1019,84 +1017,6 @@
return deletedLoad;
}
-/// processMemCpy - perform simplication of memcpy's. If we have memcpy A which
-/// copies X to Y, and memcpy B which copies Y to Z, then we can rewrite B to be
-/// a memcpy from X to Z (or potentially a memmove, depending on circumstances).
-/// This allows later passes to remove the first memcpy altogether.
-bool GVN::processMemCpy(MemCpyInst* M,
- SmallVector& toErase) {
- MemoryDependenceAnalysis& MD = getAnalysis();
-
- // First, we have to check that the dependency is another memcpy
- Instruction* dep = MD.getDependency(M);
- if (dep == MemoryDependenceAnalysis::None ||
- dep == MemoryDependenceAnalysis::NonLocal ||
- !isa(dep))
- return false;
-
- // We can only transforms memcpy's where the dest of one is the source of the
- // other
- MemCpyInst* MDep = cast(dep);
- if (M->getSource() != MDep->getDest())
- return false;
-
- // Second, the length of the memcpy's must be the same, or the preceeding one
- // must be larger than the following one.
- Value* DepLength = MDep->getLength();
- uint64_t CpySize = ~0UL;
- uint64_t DepSize = ~0UL;
- if (isa(DepLength)) {
- if (isa(M->getLength())) {
- if (cast(DepLength)->getLimitedValue() <
- cast(M->getLength())->getLimitedValue()) {
- return false;
- } else {
- CpySize = cast(M->getLength())->getLimitedValue();
- DepSize = cast(DepLength)->getLimitedValue();
- }
- } else {
- return false;
- }
- } else {
- return false;
- }
-
- // Finally, we have to make sure that the dest of the second does not
- // alias the source of the first
- AliasAnalysis& AA = getAnalysis();
- if (AA.alias(M->getRawDest(), CpySize, MDep->getRawSource(), DepSize) !=
- AliasAnalysis::NoAlias) {
- // If they don't, we can still make the transformation by first turning M
- // into a memmove rather than a memcpy.
- bool is32bit = M->getIntrinsicID() == Intrinsic::memcpy_i32;
- Function* MemMoveFun = Intrinsic::getDeclaration(
- M->getParent()->getParent()->getParent(),
- is32bit ? Intrinsic::memmove_i32 :
- Intrinsic::memmove_i64);
-
- std::vector args;
- args.push_back(M->getRawDest());
- args.push_back(MDep->getRawSource());
- args.push_back(M->getLength());
- args.push_back(M->getAlignment());
-
- new CallInst(MemMoveFun, args.begin(), args.end(), "", M);
-
- MD.removeInstruction(M);
- toErase.push_back(M);
-
- return true;
- }
-
- // If all checks passed, then we can transform these memcpy's
- M->setSource(MDep->getRawSource());
-
- // Reset dependence information for the memcpy
- MD.removeInstruction(M);
-
- return true;
-}
-
/// processInstruction - When calculating availability, handle an instruction
/// by inserting it into the appropriate sets
bool GVN::processInstruction(Instruction* I,
@@ -1105,8 +1025,6 @@
SmallVector& toErase) {
if (LoadInst* L = dyn_cast(I)) {
return processLoad(L, lastSeenLoad, toErase);
- } else if (MemCpyInst* M = dyn_cast(I)) {
- return processMemCpy(M, toErase);
}
unsigned num = VN.lookup_or_add(I);
Modified: llvm/trunk/test/Transforms/GVN/memcpy.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/memcpy.ll?rev=46822&r1=46821&r2=46822&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/GVN/memcpy.ll (original)
+++ llvm/trunk/test/Transforms/GVN/memcpy.ll Wed Feb 6 14:03:07 2008
@@ -1,4 +1,5 @@
; RUN: llvm-as < %s | opt -gvn -dse | llvm-dis | grep memcpy | count 2
+; XFAIL: *
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i686-apple-darwin9"
From isanbard at gmail.com Wed Feb 6 15:34:01 2008
From: isanbard at gmail.com (Bill Wendling)
Date: Wed, 06 Feb 2008 21:34:01 -0000
Subject: [llvm-commits] [llvm] r46824 - /llvm/branches/Apple/Zim/
Message-ID: <200802062134.m16LY1fp001790@zion.cs.uiuc.edu>
Author: void
Date: Wed Feb 6 15:34:01 2008
New Revision: 46824
URL: http://llvm.org/viewvc/llvm-project?rev=46824&view=rev
Log:
Creating Zim branch based on llvmCore-2015
Added:
llvm/branches/Apple/Zim/
- copied from r46823, llvm/tags/Apple/llvmCore-2015/
From evan.cheng at apple.com Wed Feb 6 16:07:17 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Wed, 06 Feb 2008 22:07:17 -0000
Subject: [llvm-commits] [llvm] r46825 -
/llvm/trunk/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll
Message-ID: <200802062207.m16M7IXL002708@zion.cs.uiuc.edu>
Author: evancheng
Date: Wed Feb 6 16:07:17 2008
New Revision: 46825
URL: http://llvm.org/viewvc/llvm-project?rev=46825&view=rev
Log:
It's PR1925, not PR1609.
Modified:
llvm/trunk/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll
Modified: llvm/trunk/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll?rev=46825&r1=46824&r2=46825&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/2008-02-04-LocalRegAllocBug.ll Wed Feb 6 16:07:17 2008
@@ -1,5 +1,5 @@
; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi -regalloc=local
-; PR1609
+; PR1925
%struct.encode_aux_nearestmatch = type { i32*, i32*, i32*, i32*, i32, i32 }
%struct.encode_aux_pigeonhole = type { float, float, i32, i32, i32*, i32, i32*, i32*, i32* }
From isanbard at gmail.com Wed Feb 6 16:18:16 2008
From: isanbard at gmail.com (Bill Wendling)
Date: Wed, 06 Feb 2008 22:18:16 -0000
Subject: [llvm-commits] [llvm] r46826 - in /llvm/branches/Apple/Zim:
lib/Transforms/Scalar/GVN.cpp test/Transforms/GVN/memcpy.ll
Message-ID: <200802062218.m16MIG0d003067@zion.cs.uiuc.edu>
Author: void
Date: Wed Feb 6 16:18:16 2008
New Revision: 46826
URL: http://llvm.org/viewvc/llvm-project?rev=46826&view=rev
Log:
[From mainline]
Temporarily reverting:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080128/057882.html
This is causing a miscompilation on PPC G5 and just now seeing it on iMac x86-64.
Modified:
llvm/branches/Apple/Zim/lib/Transforms/Scalar/GVN.cpp
llvm/branches/Apple/Zim/test/Transforms/GVN/memcpy.ll
Modified: llvm/branches/Apple/Zim/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zim/lib/Transforms/Scalar/GVN.cpp?rev=46826&r1=46825&r2=46826&view=diff
==============================================================================
--- llvm/branches/Apple/Zim/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/branches/Apple/Zim/lib/Transforms/Scalar/GVN.cpp Wed Feb 6 16:18:16 2008
@@ -19,7 +19,6 @@
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
-#include "llvm/IntrinsicInst.h"
#include "llvm/Instructions.h"
#include "llvm/Value.h"
#include "llvm/ADT/BitVector.h"
@@ -737,7 +736,6 @@
SmallVector& toErase);
bool processNonLocalLoad(LoadInst* L,
SmallVector& toErase);
- bool processMemCpy(MemCpyInst* M, SmallVector& toErase);
Value *GetValueForBlock(BasicBlock *BB, LoadInst* orig,
DenseMap &Phis,
bool top_level = false);
@@ -1019,84 +1017,6 @@
return deletedLoad;
}
-/// processMemCpy - perform simplication of memcpy's. If we have memcpy A which
-/// copies X to Y, and memcpy B which copies Y to Z, then we can rewrite B to be
-/// a memcpy from X to Z (or potentially a memmove, depending on circumstances).
-/// This allows later passes to remove the first memcpy altogether.
-bool GVN::processMemCpy(MemCpyInst* M,
- SmallVector& toErase) {
- MemoryDependenceAnalysis& MD = getAnalysis();
-
- // First, we have to check that the dependency is another memcpy
- Instruction* dep = MD.getDependency(M);
- if (dep == MemoryDependenceAnalysis::None ||
- dep == MemoryDependenceAnalysis::NonLocal ||
- !isa(dep))
- return false;
-
- // We can only transforms memcpy's where the dest of one is the source of the
- // other
- MemCpyInst* MDep = cast(dep);
- if (M->getSource() != MDep->getDest())
- return false;
-
- // Second, the length of the memcpy's must be the same, or the preceeding one
- // must be larger than the following one.
- Value* DepLength = MDep->getLength();
- uint64_t CpySize = ~0UL;
- uint64_t DepSize = ~0UL;
- if (isa(DepLength)) {
- if (isa(M->getLength())) {
- if (cast(DepLength)->getLimitedValue() <
- cast(M->getLength())->getLimitedValue()) {
- return false;
- } else {
- CpySize = cast(M->getLength())->getLimitedValue();
- DepSize = cast(DepLength)->getLimitedValue();
- }
- } else {
- return false;
- }
- } else {
- return false;
- }
-
- // Finally, we have to make sure that the dest of the second does not
- // alias the source of the first
- AliasAnalysis& AA = getAnalysis();
- if (AA.alias(M->getRawDest(), CpySize, MDep->getRawSource(), DepSize) !=
- AliasAnalysis::NoAlias) {
- // If they don't, we can still make the transformation by first turning M
- // into a memmove rather than a memcpy.
- bool is32bit = M->getIntrinsicID() == Intrinsic::memcpy_i32;
- Function* MemMoveFun = Intrinsic::getDeclaration(
- M->getParent()->getParent()->getParent(),
- is32bit ? Intrinsic::memmove_i32 :
- Intrinsic::memmove_i64);
-
- std::vector args;
- args.push_back(M->getRawDest());
- args.push_back(MDep->getRawSource());
- args.push_back(M->getLength());
- args.push_back(M->getAlignment());
-
- new CallInst(MemMoveFun, args.begin(), args.end(), "", M);
-
- MD.removeInstruction(M);
- toErase.push_back(M);
-
- return true;
- }
-
- // If all checks passed, then we can transform these memcpy's
- M->setSource(MDep->getRawSource());
-
- // Reset dependence information for the memcpy
- MD.removeInstruction(M);
-
- return true;
-}
-
/// processInstruction - When calculating availability, handle an instruction
/// by inserting it into the appropriate sets
bool GVN::processInstruction(Instruction* I,
@@ -1105,8 +1025,6 @@
SmallVector& toErase) {
if (LoadInst* L = dyn_cast(I)) {
return processLoad(L, lastSeenLoad, toErase);
- } else if (MemCpyInst* M = dyn_cast(I)) {
- return processMemCpy(M, toErase);
}
unsigned num = VN.lookup_or_add(I);
Modified: llvm/branches/Apple/Zim/test/Transforms/GVN/memcpy.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zim/test/Transforms/GVN/memcpy.ll?rev=46826&r1=46825&r2=46826&view=diff
==============================================================================
--- llvm/branches/Apple/Zim/test/Transforms/GVN/memcpy.ll (original)
+++ llvm/branches/Apple/Zim/test/Transforms/GVN/memcpy.ll Wed Feb 6 16:18:16 2008
@@ -1,4 +1,5 @@
; RUN: llvm-as < %s | opt -gvn -dse | llvm-dis | grep memcpy | count 2
+; XFAIL: *
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i686-apple-darwin9"
From gohman at apple.com Wed Feb 6 16:27:42 2008
From: gohman at apple.com (Dan Gohman)
Date: Wed, 06 Feb 2008 22:27:42 -0000
Subject: [llvm-commits] [llvm] r46827 - in /llvm/trunk: include/llvm/
include/llvm/CodeGen/ lib/CodeGen/ lib/CodeGen/SelectionDAG/
lib/Target/ARM/ lib/Target/Alpha/ lib/Target/IA64/ lib/Target/PowerPC/
lib/Target/Sparc/ lib/Target/X86/ utils/TableGen/
Message-ID: <200802062227.m16MRhjU003393@zion.cs.uiuc.edu>
Author: djg
Date: Wed Feb 6 16:27:42 2008
New Revision: 46827
URL: http://llvm.org/viewvc/llvm-project?rev=46827&view=rev
Log:
Re-apply the memory operand changes, with a fix for the static
initializer problem, a minor tweak to the way the
DAGISelEmitter finds load/store nodes, and a renaming of the
new PseudoSourceValue objects.
Modified:
llvm/trunk/include/llvm/CodeGen/MachineInstr.h
llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
llvm/trunk/include/llvm/CodeGen/MemOperand.h
llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h
llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
llvm/trunk/include/llvm/Value.h
llvm/trunk/lib/CodeGen/MachineInstr.cpp
llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp
llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Wed Feb 6 16:27:42 2008
@@ -17,6 +17,7 @@
#define LLVM_CODEGEN_MACHINEINSTR_H
#include "llvm/CodeGen/MachineOperand.h"
+#include "llvm/CodeGen/MemOperand.h"
namespace llvm {
@@ -35,6 +36,7 @@
// are determined at construction time).
std::vector Operands; // the operands
+ std::vector MemOperands; // information on memory references
MachineInstr *Prev, *Next; // Links for MBB's intrusive list.
MachineBasicBlock *Parent; // Pointer to the owning basic block.
@@ -94,6 +96,18 @@
///
unsigned getNumExplicitOperands() const;
+ /// Access to memory operands of the instruction
+ unsigned getNumMemOperands() const { return MemOperands.size(); }
+
+ const MemOperand& getMemOperand(unsigned i) const {
+ assert(i < getNumMemOperands() && "getMemOperand() out of range!");
+ return MemOperands[i];
+ }
+ MemOperand& getMemOperand(unsigned i) {
+ assert(i < getNumMemOperands() && "getMemOperand() out of range!");
+ return MemOperands[i];
+ }
+
/// isIdenticalTo - Return true if this instruction is identical to (same
/// opcode and same operands as) the specified instruction.
bool isIdenticalTo(const MachineInstr *Other) const {
@@ -196,6 +210,12 @@
///
void RemoveOperand(unsigned i);
+ /// addMemOperand - Add a MemOperand to the machine instruction, referencing
+ /// arbitrary storage.
+ void addMemOperand(const MemOperand &MO) {
+ MemOperands.push_back(MO);
+ }
+
private:
/// getRegInfo - If this instruction is embedded into a MachineFunction,
/// return the MachineRegisterInfo object for the current function, otherwise
Modified: llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h Wed Feb 6 16:27:42 2008
@@ -83,6 +83,12 @@
MI->addOperand(MachineOperand::CreateES(FnName, 0));
return *this;
}
+
+ /// addMemOperand - Add a memory operand to the machine instruction.
+ const MachineInstrBuilder &addMemOperand(const MemOperand &MO) const {
+ MI->addMemOperand(MO);
+ return *this;
+ }
};
/// BuildMI - Builder interface. Specify how to create the initial instruction
Modified: llvm/trunk/include/llvm/CodeGen/MemOperand.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MemOperand.h?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MemOperand.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MemOperand.h Wed Feb 6 16:27:42 2008
@@ -0,0 +1,82 @@
+//===-- llvm/CodeGen/MemOperand.h - MemOperand class ------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains the declaration of the MemOperand class, which is a
+// description of a memory reference. It is used to help track dependencies
+// in the backend.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CODEGEN_MEMOPERAND_H
+#define LLVM_CODEGEN_MEMOPERAND_H
+
+namespace llvm {
+
+class Value;
+
+//===----------------------------------------------------------------------===//
+/// MemOperand - A description of a memory reference used in the backend.
+/// Instead of holding a StoreInst or LoadInst, this class holds the address
+/// Value of the reference along with a byte size and offset. This allows it
+/// to describe lowered loads and stores. Also, the special PseudoSourceValue
+/// objects can be used to represent loads and stores to memory locations
+/// that aren't explicit in the regular LLVM IR.
+///
+class MemOperand {
+ const Value *V;
+ unsigned int Flags;
+ int Offset;
+ int Size;
+ unsigned int Alignment;
+
+public:
+ /// Flags values. These may be or'd together.
+ enum MemOperandFlags {
+ /// The memory access reads data.
+ MOLoad = 1,
+ /// The memory access writes data.
+ MOStore = 2,
+ /// The memory access is volatile.
+ MOVolatile = 4
+ };
+
+ /// MemOperand - Construct an MemOperand object with the specified
+ /// address Value, flags, offset, size, and alignment.
+ MemOperand(const Value *v, unsigned int f, int o, int s, unsigned int a)
+ : V(v), Flags(f), Offset(o), Size(s), Alignment(a) {}
+
+ /// getValue - Return the base address of the memory access.
+ /// Special values are PseudoSourceValue::FPRel, PseudoSourceValue::SPRel,
+ /// and the other PseudoSourceValue members which indicate references to
+ /// frame/stack pointer relative references and other special references.
+ const Value *getValue() const { return V; }
+
+ /// getFlags - Return the raw flags of the source value, \see MemOperandFlags.
+ unsigned int getFlags() const { return Flags; }
+
+ /// getOffset - For normal values, this is a byte offset added to the base
+ /// address. For PseudoSourceValue::FPRel values, this is the FrameIndex
+ /// number.
+ int getOffset() const { return Offset; }
+
+ /// getSize - Return the size in bytes of the memory reference.
+ int getSize() const { return Size; }
+
+ /// getAlignment - Return the minimum known alignment in bytes of the
+ /// memory reference.
+ unsigned int getAlignment() const { return Alignment; }
+
+ bool isLoad() const { return Flags & MOLoad; }
+ bool isStore() const { return Flags & MOStore; }
+ bool isVolatile() const { return Flags & MOVolatile; }
+};
+
+} // End llvm namespace
+
+#endif
Modified: llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h (original)
+++ llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h Wed Feb 6 16:27:42 2008
@@ -0,0 +1,58 @@
+//===-- llvm/CodeGen/PseudoSourceValue.h ------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains the declaration of the PseudoSourceValue class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
+#define LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
+
+#include "llvm/Value.h"
+
+namespace llvm {
+ /// PseudoSourceValue - Special value supplied for machine level alias
+ /// analysis. It indicates that the a memory access references the functions
+ /// stack frame (e.g., a spill slot), below the stack frame (e.g., argument
+ /// space), or constant pool.
+ class PseudoSourceValue : public Value {
+ public:
+ PseudoSourceValue();
+
+ virtual void print(std::ostream &OS) const;
+
+ /// classof - Methods for support type inquiry through isa, cast, and
+ /// dyn_cast:
+ ///
+ static inline bool classof(const PseudoSourceValue *) { return true; }
+ static inline bool classof(const Value *V) {
+ return V->getValueID() == PseudoSourceValueVal;
+ }
+
+ /// A pseudo source value referencing to the stack frame of a function,
+ /// e.g., a spill slot.
+ static const PseudoSourceValue &getFixedStack();
+
+ /// A source value referencing the area below the stack frame of a function,
+ /// e.g., the argument space.
+ static const PseudoSourceValue &getStack();
+
+ /// A source value referencing the global offset table (or something the
+ /// like).
+ static const PseudoSourceValue &getGOT();
+
+ /// A SV referencing the constant pool
+ static const PseudoSourceValue &getConstantPool();
+
+ /// A SV referencing the jump table
+ static const PseudoSourceValue &getJumpTable();
+ };
+} // End llvm namespace
+
+#endif
Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Wed Feb 6 16:27:42 2008
@@ -279,6 +279,7 @@
if (isa(Node)) return true;
if (isa(Node)) return true;
if (isa(Node)) return true;
+ if (isa(Node)) return true;
return false;
}
@@ -312,11 +313,15 @@
/// (which do not go into the machine instrs.)
static unsigned CountResults(SDNode *Node);
- /// CountOperands The inputs to target nodes have any actual inputs first,
- /// followed by an optional chain operand, then flag operands. Compute the
- /// number of actual operands that will go into the machine instr.
+ /// CountOperands - The inputs to target nodes have any actual inputs first,
+ /// followed by optional memory operands chain operand, then flag operands.
+ /// Compute the number of actual operands that will go into the machine
+ /// instr.
static unsigned CountOperands(SDNode *Node);
+ /// CountMemOperands - Find the index of the last MemOperandSDNode
+ static unsigned CountMemOperands(SDNode *Node);
+
/// EmitNode - Generate machine code for an node and needed dependencies.
/// VRBaseMap contains, for each already emitted node, the first virtual
/// register number for the results of the node.
@@ -357,6 +362,8 @@
void AddOperand(MachineInstr *MI, SDOperand Op, unsigned IIOpNum,
const TargetInstrDesc *II,
DenseMap &VRBaseMap);
+
+ void AddMemOperand(MachineInstr *MI, const MemOperand &MO);
};
/// createBURRListDAGScheduler - This creates a bottom up register usage
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Wed Feb 6 16:27:42 2008
@@ -376,8 +376,12 @@
SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base,
SDOperand Offset, ISD::MemIndexedMode AM);
- // getSrcValue - construct a node to track a Value* through the backend
- SDOperand getSrcValue(const Value* I, int offset = 0);
+ // getSrcValue - Construct a node to track a Value* through the backend.
+ SDOperand getSrcValue(const Value *v);
+
+ // getMemOperand - Construct a node to track a memory reference
+ // through the backend.
+ SDOperand getMemOperand(const MemOperand &MO);
/// UpdateNodeOperands - *Mutate* the specified node in-place to have the
/// specified operands. If the resultant node already exists in the DAG,
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Wed Feb 6 16:27:42 2008
@@ -25,6 +25,7 @@
#include "llvm/ADT/iterator"
#include "llvm/ADT/APFloat.h"
#include "llvm/CodeGen/ValueTypes.h"
+#include "llvm/CodeGen/MemOperand.h"
#include "llvm/Support/DataTypes.h"
#include
@@ -542,11 +543,15 @@
// pointer, and a SRCVALUE.
VAEND, VASTART,
- // SRCVALUE - This corresponds to a Value*, and is used to associate memory
- // locations with their value. This allows one use alias analysis
- // information in the backend.
+ // SRCVALUE - This is a node type that holds a Value* that is used to
+ // make reference to a value in the LLVM IR.
SRCVALUE,
+ // MEMOPERAND - This is a node that contains a MemOperand which records
+ // information about a memory reference. This is used to make AliasAnalysis
+ // queries from the backend.
+ MEMOPERAND,
+
// PCMARKER - This corresponds to the pcmarker intrinsic.
PCMARKER,
@@ -1391,17 +1396,16 @@
class SrcValueSDNode : public SDNode {
const Value *V;
- int offset;
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
protected:
friend class SelectionDAG;
- SrcValueSDNode(const Value* v, int o)
- : SDNode(ISD::SRCVALUE, getSDVTList(MVT::Other)), V(v), offset(o) {
- }
+ /// Create a SrcValue for a general value.
+ explicit SrcValueSDNode(const Value *v)
+ : SDNode(ISD::SRCVALUE, getSDVTList(MVT::Other)), V(v) {}
public:
+ /// getValue - return the contained Value.
const Value *getValue() const { return V; }
- int getOffset() const { return offset; }
static bool classof(const SrcValueSDNode *) { return true; }
static bool classof(const SDNode *N) {
@@ -1410,6 +1414,29 @@
};
+/// MemOperandSDNode - An SDNode that holds a MemOperand. This is
+/// used to represent a reference to memory after ISD::LOAD
+/// and ISD::STORE have been lowered.
+///
+class MemOperandSDNode : public SDNode {
+ virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
+protected:
+ friend class SelectionDAG;
+ /// Create a MemOperand node
+ explicit MemOperandSDNode(MemOperand mo)
+ : SDNode(ISD::MEMOPERAND, getSDVTList(MVT::Other)), MO(mo) {}
+
+public:
+ /// MO - The contained MemOperand.
+ const MemOperand MO;
+
+ static bool classof(const MemOperandSDNode *) { return true; }
+ static bool classof(const SDNode *N) {
+ return N->getOpcode() == ISD::MEMOPERAND;
+ }
+};
+
+
class RegisterSDNode : public SDNode {
unsigned Reg;
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
@@ -1559,6 +1586,10 @@
/// isUnindexed - Return true if this is NOT a pre/post inc/dec load/store.
bool isUnindexed() const { return AddrMode == ISD::UNINDEXED; }
+ /// getMemOperand - Return a MemOperand object describing the memory
+ /// reference performed by this load or store.
+ MemOperand getMemOperand() const;
+
static bool classof(const LSBaseSDNode *N) { return true; }
static bool classof(const SDNode *N) {
return N->getOpcode() == ISD::LOAD ||
Modified: llvm/trunk/include/llvm/Value.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Value.h (original)
+++ llvm/trunk/include/llvm/Value.h Wed Feb 6 16:27:42 2008
@@ -187,6 +187,7 @@
ConstantVectorVal, // This is an instance of ConstantVector
ConstantPointerNullVal, // This is an instance of ConstantPointerNull
InlineAsmVal, // This is an instance of InlineAsm
+ PseudoSourceValueVal, // This is an instance of PseudoSourceValue
InstructionVal, // This is an instance of Instruction
// Markers:
Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Wed Feb 6 16:27:42 2008
@@ -15,6 +15,8 @@
#include "llvm/Value.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/CodeGen/PseudoSourceValue.h"
+#include "llvm/CodeGen/SelectionDAGNodes.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetInstrDesc.h"
@@ -292,6 +294,7 @@
TID = &MI.getDesc();
NumImplicitOps = MI.NumImplicitOps;
Operands.reserve(MI.getNumOperands());
+ MemOperands = MI.MemOperands;
// Add operands
for (unsigned i = 0; i != MI.getNumOperands(); ++i) {
@@ -627,6 +630,34 @@
getOperand(i).print(OS, TM);
}
+ if (getNumMemOperands() > 0) {
+ OS << ", SV:";
+ for (unsigned i = 0; i < getNumMemOperands(); i++) {
+ const MemOperand &MRO = getMemOperand(i);
+ const Value *V = MRO.getValue();
+
+ assert(V && "SV missing.");
+ assert((MRO.isLoad() || MRO.isStore()) &&
+ "SV has to be a load, store or both.");
+
+ if (MRO.isVolatile())
+ OS << "Volatile ";
+ if (MRO.isLoad())
+ OS << "LD ";
+ if (MRO.isStore())
+ OS << "ST ";
+
+ OS << MRO.getSize();
+
+ if (!V->getName().empty())
+ OS << "[" << V->getName() << " + " << MRO.getOffset() << "]";
+ else if (isa(V))
+ OS << "[" << *V << " + " << MRO.getOffset() << "]";
+ else
+ OS << "[" << V << " + " << MRO.getOffset() << "]";
+ }
+ }
+
OS << "\n";
}
Modified: llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp (original)
+++ llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp Wed Feb 6 16:27:42 2008
@@ -0,0 +1,41 @@
+//===-- llvm/CodeGen/PseudoSourceValue.cpp ----------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the PseudoSourceValue class.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/CodeGen/PseudoSourceValue.h"
+#include "llvm/DerivedTypes.h"
+#include "llvm/Support/ManagedStatic.h"
+
+namespace llvm {
+ static ManagedStatic PSVs;
+
+ const PseudoSourceValue &PseudoSourceValue::getFixedStack() { return (*PSVs)[0]; }
+ const PseudoSourceValue &PseudoSourceValue::getStack() { return (*PSVs)[1]; }
+ const PseudoSourceValue &PseudoSourceValue::getGOT() { return (*PSVs)[2]; }
+ const PseudoSourceValue &PseudoSourceValue::getConstantPool() { return (*PSVs)[3]; }
+ const PseudoSourceValue &PseudoSourceValue::getJumpTable() { return (*PSVs)[4]; }
+
+ static const char *PSVNames[] = {
+ "FixedStack",
+ "Stack",
+ "GOT",
+ "ConstantPool",
+ "JumpTable"
+ };
+
+ PseudoSourceValue::PseudoSourceValue() :
+ Value(PointerType::getUnqual(Type::Int8Ty), PseudoSourceValueVal) {}
+
+ void PseudoSourceValue::print(std::ostream &OS) const {
+ OS << PSVNames[this - *PSVs];
+ }
+}
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Feb 6 16:27:42 2008
@@ -16,6 +16,7 @@
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetData.h"
@@ -509,9 +510,11 @@
SDOperand CPIdx = DAG.getConstantPool(LLVMC, TLI.getPointerTy());
if (Extend) {
return DAG.getExtLoad(ISD::EXTLOAD, MVT::f64, DAG.getEntryNode(),
- CPIdx, NULL, 0, MVT::f32);
+ CPIdx, &PseudoSourceValue::getConstantPool(),
+ 0, MVT::f32);
} else {
- return DAG.getLoad(VT, DAG.getEntryNode(), CPIdx, NULL, 0);
+ return DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
+ &PseudoSourceValue::getConstantPool(), 0);
}
}
@@ -796,6 +799,7 @@
case ISD::TargetExternalSymbol:
case ISD::VALUETYPE:
case ISD::SRCVALUE:
+ case ISD::MEMOPERAND:
case ISD::STRING:
case ISD::CONDCODE:
// Primitives must all be legal.
@@ -1316,8 +1320,15 @@
MVT::ValueType IdxVT = Tmp3.getValueType();
MVT::ValueType PtrVT = TLI.getPointerTy();
SDOperand StackPtr = DAG.CreateStackTemporary(VT);
+
+ FrameIndexSDNode *StackPtrFI = dyn_cast(StackPtr.Val);
+ assert(StackPtrFI);
+ int SPFI = StackPtrFI->getIndex();
+
// Store the vector.
- SDOperand Ch = DAG.getStore(DAG.getEntryNode(), Tmp1, StackPtr, NULL, 0);
+ SDOperand Ch = DAG.getStore(DAG.getEntryNode(), Tmp1, StackPtr,
+ &PseudoSourceValue::getFixedStack(),
+ SPFI);
// Truncate or zero extend offset to target pointer type.
unsigned CastOpc = (IdxVT > PtrVT) ? ISD::TRUNCATE : ISD::ZERO_EXTEND;
@@ -1327,9 +1338,11 @@
Tmp3 = DAG.getNode(ISD::MUL, IdxVT, Tmp3,DAG.getConstant(EltSize, IdxVT));
SDOperand StackPtr2 = DAG.getNode(ISD::ADD, IdxVT, Tmp3, StackPtr);
// Store the scalar value.
- Ch = DAG.getStore(Ch, Tmp2, StackPtr2, NULL, 0);
+ Ch = DAG.getStore(Ch, Tmp2, StackPtr2,
+ &PseudoSourceValue::getFixedStack(), SPFI);
// Load the updated vector.
- Result = DAG.getLoad(VT, Ch, StackPtr, NULL, 0);
+ Result = DAG.getLoad(VT, Ch, StackPtr,
+ &PseudoSourceValue::getFixedStack(), SPFI);
break;
}
}
@@ -1678,8 +1691,10 @@
SDOperand LD;
switch (EntrySize) {
default: assert(0 && "Size of jump table not supported yet."); break;
- case 4: LD = DAG.getLoad(MVT::i32, Chain, Addr, NULL, 0); break;
- case 8: LD = DAG.getLoad(MVT::i64, Chain, Addr, NULL, 0); break;
+ case 4: LD = DAG.getLoad(MVT::i32, Chain, Addr,
+ &PseudoSourceValue::getJumpTable(), 0); break;
+ case 8: LD = DAG.getLoad(MVT::i64, Chain, Addr,
+ &PseudoSourceValue::getJumpTable(), 0); break;
}
Addr = LD;
@@ -3240,16 +3255,14 @@
}
break;
case TargetLowering::Expand: {
- SrcValueSDNode *SV = cast(Node->getOperand(2));
- SDOperand VAList = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp2,
- SV->getValue(), SV->getOffset());
+ const Value *V = cast(Node->getOperand(2))->getValue();
+ SDOperand VAList = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp2, V, 0);
// Increment the pointer, VAList, to the next vaarg
Tmp3 = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList,
DAG.getConstant(MVT::getSizeInBits(VT)/8,
TLI.getPointerTy()));
// Store the incremented VAList to the legalized pointer
- Tmp3 = DAG.getStore(VAList.getValue(1), Tmp3, Tmp2, SV->getValue(),
- SV->getOffset());
+ Tmp3 = DAG.getStore(VAList.getValue(1), Tmp3, Tmp2, V, 0);
// Load the actual argument out of the pointer VAList
Result = DAG.getLoad(VT, Tmp3, VAList, NULL, 0);
Tmp1 = LegalizeOp(Result.getValue(1));
@@ -3285,12 +3298,10 @@
case TargetLowering::Expand:
// This defaults to loading a pointer from the input and storing it to the
// output, returning the chain.
- SrcValueSDNode *SVD = cast(Node->getOperand(3));
- SrcValueSDNode *SVS = cast(Node->getOperand(4));
- Tmp4 = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp3, SVD->getValue(),
- SVD->getOffset());
- Result = DAG.getStore(Tmp4.getValue(1), Tmp4, Tmp2, SVS->getValue(),
- SVS->getOffset());
+ const Value *VD = cast(Node->getOperand(3))->getValue();
+ const Value *VS = cast(Node->getOperand(4))->getValue();
+ Tmp4 = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp3, VD, 0);
+ Result = DAG.getStore(Tmp4.getValue(1), Tmp4, Tmp2, VS, 0);
break;
}
break;
@@ -4285,16 +4296,14 @@
Tmp3 = DAG.getVAArg(VT, Tmp1, Tmp2, Node->getOperand(2));
Result = TLI.CustomPromoteOperation(Tmp3, DAG);
} else {
- SrcValueSDNode *SV = cast(Node->getOperand(2));
- SDOperand VAList = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp2,
- SV->getValue(), SV->getOffset());
+ const Value *V = cast(Node->getOperand(2))->getValue();
+ SDOperand VAList = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp2, V, 0);
// Increment the pointer, VAList, to the next vaarg
Tmp3 = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList,
DAG.getConstant(MVT::getSizeInBits(VT)/8,
TLI.getPointerTy()));
// Store the incremented VAList to the legalized pointer
- Tmp3 = DAG.getStore(VAList.getValue(1), Tmp3, Tmp2, SV->getValue(),
- SV->getOffset());
+ Tmp3 = DAG.getStore(VAList.getValue(1), Tmp3, Tmp2, V, 0);
// Load the actual argument out of the pointer VAList
Result = DAG.getExtLoad(ISD::EXTLOAD, NVT, Tmp3, VAList, NULL, 0, VT);
}
@@ -4750,6 +4759,10 @@
// Create the stack frame object.
SDOperand FIPtr = DAG.CreateStackTemporary(SlotVT);
+ FrameIndexSDNode *StackPtrFI = dyn_cast(FIPtr);
+ assert(StackPtrFI);
+ int SPFI = StackPtrFI->getIndex();
+
unsigned SrcSize = MVT::getSizeInBits(SrcOp.getValueType());
unsigned SlotSize = MVT::getSizeInBits(SlotVT);
unsigned DestSize = MVT::getSizeInBits(DestVT);
@@ -4758,10 +4771,14 @@
// later than DestVT.
SDOperand Store;
if (SrcSize > SlotSize)
- Store = DAG.getTruncStore(DAG.getEntryNode(), SrcOp, FIPtr, NULL, 0,SlotVT);
+ Store = DAG.getTruncStore(DAG.getEntryNode(), SrcOp, FIPtr,
+ &PseudoSourceValue::getFixedStack(),
+ SPFI, SlotVT);
else {
assert(SrcSize == SlotSize && "Invalid store");
- Store = DAG.getStore(DAG.getEntryNode(), SrcOp, FIPtr, NULL, 0);
+ Store = DAG.getStore(DAG.getEntryNode(), SrcOp, FIPtr,
+ &PseudoSourceValue::getFixedStack(),
+ SPFI, SlotVT);
}
// Result is a load from the stack slot.
@@ -4776,9 +4793,15 @@
// Create a vector sized/aligned stack slot, store the value to element #0,
// then load the whole vector back out.
SDOperand StackPtr = DAG.CreateStackTemporary(Node->getValueType(0));
+
+ FrameIndexSDNode *StackPtrFI = dyn_cast(StackPtr);
+ assert(StackPtrFI);
+ int SPFI = StackPtrFI->getIndex();
+
SDOperand Ch = DAG.getStore(DAG.getEntryNode(), Node->getOperand(0), StackPtr,
- NULL, 0);
- return DAG.getLoad(Node->getValueType(0), Ch, StackPtr, NULL, 0);
+ &PseudoSourceValue::getFixedStack(), SPFI);
+ return DAG.getLoad(Node->getValueType(0), Ch, StackPtr,
+ &PseudoSourceValue::getFixedStack(), SPFI);
}
@@ -4842,7 +4865,8 @@
}
Constant *CP = ConstantVector::get(CV);
SDOperand CPIdx = DAG.getConstantPool(CP, TLI.getPointerTy());
- return DAG.getLoad(VT, DAG.getEntryNode(), CPIdx, NULL, 0);
+ return DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
+ &PseudoSourceValue::getConstantPool(), 0);
}
if (SplatValue.Val) { // Splat of one value?
@@ -5184,11 +5208,14 @@
CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx, CstOffset);
SDOperand FudgeInReg;
if (DestTy == MVT::f32)
- FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx, NULL, 0);
+ FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx,
+ &PseudoSourceValue::getConstantPool(), 0);
else if (MVT::getSizeInBits(DestTy) > MVT::getSizeInBits(MVT::f32))
// FIXME: Avoid the extend by construction the right constantpool?
FudgeInReg = DAG.getExtLoad(ISD::EXTLOAD, DestTy, DAG.getEntryNode(),
- CPIdx, NULL, 0, MVT::f32);
+ CPIdx,
+ &PseudoSourceValue::getConstantPool(), 0,
+ MVT::f32);
else
assert(0 && "Unexpected conversion");
@@ -5330,11 +5357,14 @@
CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx, CstOffset);
SDOperand FudgeInReg;
if (DestVT == MVT::f32)
- FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx, NULL, 0);
+ FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx,
+ &PseudoSourceValue::getConstantPool(), 0);
else {
- FudgeInReg = LegalizeOp(DAG.getExtLoad(ISD::EXTLOAD, DestVT,
- DAG.getEntryNode(), CPIdx,
- NULL, 0, MVT::f32));
+ FudgeInReg =
+ LegalizeOp(DAG.getExtLoad(ISD::EXTLOAD, DestVT,
+ DAG.getEntryNode(), CPIdx,
+ &PseudoSourceValue::getConstantPool(), 0,
+ MVT::f32));
}
return DAG.getNode(ISD::FADD, DestVT, Tmp1, FudgeInReg);
@@ -6743,10 +6773,16 @@
// Lower to a store/load so that it can be split.
// FIXME: this could be improved probably.
SDOperand Ptr = DAG.CreateStackTemporary(InOp.getValueType());
+ FrameIndexSDNode *FI = dyn_cast(Ptr.Val);
+ assert(FI && "Expecting CreateStackTemporary to return a frame index.\n");
SDOperand St = DAG.getStore(DAG.getEntryNode(),
- InOp, Ptr, NULL, 0);
- InOp = DAG.getLoad(Op.getValueType(), St, Ptr, NULL, 0);
+ InOp, Ptr,
+ &PseudoSourceValue::getFixedStack(),
+ FI->getIndex());
+ InOp = DAG.getLoad(Op.getValueType(), St, Ptr,
+ &PseudoSourceValue::getFixedStack(),
+ FI->getIndex());
}
// Split the vector and convert each of the pieces now.
SplitVectorOp(InOp, Lo, Hi);
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Wed Feb 6 16:27:42 2008
@@ -277,15 +277,27 @@
return N;
}
-/// CountOperands The inputs to target nodes have any actual inputs first,
-/// followed by an optional chain operand, then flag operands. Compute the
-/// number of actual operands that will go into the machine instr.
+/// CountOperands - The inputs to target nodes have any actual inputs first,
+/// followed by optional memory operands chain operand, then flag operands.
+/// Compute the number of actual operands that will go into the machine istr.
unsigned ScheduleDAG::CountOperands(SDNode *Node) {
unsigned N = Node->getNumOperands();
while (N && Node->getOperand(N - 1).getValueType() == MVT::Flag)
--N;
if (N && Node->getOperand(N - 1).getValueType() == MVT::Other)
--N; // Ignore chain if it exists.
+ while (N && MemOperandSDNode::classof(Node->getOperand(N - 1).Val))
+ --N; // Ignore MemOperand nodes
+ return N;
+}
+
+/// CountMemOperands - Find the index of the last MemOperandSDNode operand
+unsigned ScheduleDAG::CountMemOperands(SDNode *Node) {
+ unsigned N = Node->getNumOperands();
+ while (N && Node->getOperand(N - 1).getValueType() == MVT::Flag)
+ --N;
+ if (N && Node->getOperand(N - 1).getValueType() == MVT::Other)
+ --N; // Ignore chain if it exists.
return N;
}
@@ -517,6 +529,10 @@
}
+void ScheduleDAG::AddMemOperand(MachineInstr *MI, const MemOperand &MO) {
+ MI->addMemOperand(MO);
+}
+
// Returns the Register Class of a subregister
static const TargetRegisterClass *getSubRegisterRegClass(
const TargetRegisterClass *TRC,
@@ -675,6 +691,7 @@
unsigned NumResults = CountResults(Node);
unsigned NodeOperands = CountOperands(Node);
+ unsigned NodeMemOperands = CountMemOperands(Node);
unsigned NumMIOperands = NodeOperands + NumResults;
bool HasPhysRegOuts = (NumResults > II.getNumDefs()) &&
II.getImplicitDefs() != 0;
@@ -697,6 +714,10 @@
for (unsigned i = 0; i != NodeOperands; ++i)
AddOperand(MI, Node->getOperand(i), i+II.getNumDefs(), &II, VRBaseMap);
+ // Emit all of the memory operands of this instruction
+ for (unsigned i = NodeOperands; i != NodeMemOperands; ++i)
+ AddMemOperand(MI, cast(Node->getOperand(i))->MO);
+
// Commute node if it has been determined to be profitable.
if (CommuteSet.count(Node)) {
MachineInstr *NewMI = TII->commuteInstruction(MI);
@@ -737,6 +758,7 @@
case ISD::TokenFactor:
case ISD::LABEL:
case ISD::DECLARE:
+ case ISD::SRCVALUE:
break;
case ISD::CopyToReg: {
unsigned InReg;
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Feb 6 16:27:42 2008
@@ -21,6 +21,7 @@
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Target/MRegisterInfo.h"
#include "llvm/Target/TargetData.h"
@@ -361,10 +362,16 @@
case ISD::Register:
ID.AddInteger(cast(N)->getReg());
break;
- case ISD::SRCVALUE: {
- SrcValueSDNode *SV = cast(N);
- ID.AddPointer(SV->getValue());
- ID.AddInteger(SV->getOffset());
+ case ISD::SRCVALUE:
+ ID.AddPointer(cast(N)->getValue());
+ break;
+ case ISD::MEMOPERAND: {
+ const MemOperand &MO = cast(N)->MO;
+ ID.AddPointer(MO.getValue());
+ ID.AddInteger(MO.getFlags());
+ ID.AddInteger(MO.getOffset());
+ ID.AddInteger(MO.getSize());
+ ID.AddInteger(MO.getAlignment());
break;
}
case ISD::FrameIndex:
@@ -937,18 +944,42 @@
return SDOperand(N, 0);
}
-SDOperand SelectionDAG::getSrcValue(const Value *V, int Offset) {
+SDOperand SelectionDAG::getSrcValue(const Value *V) {
assert((!V || isa(V->getType())) &&
"SrcValue is not a pointer?");
FoldingSetNodeID ID;
AddNodeIDNode(ID, ISD::SRCVALUE, getVTList(MVT::Other), 0, 0);
ID.AddPointer(V);
- ID.AddInteger(Offset);
+
void *IP = 0;
if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
return SDOperand(E, 0);
- SDNode *N = new SrcValueSDNode(V, Offset);
+
+ SDNode *N = new SrcValueSDNode(V);
+ CSEMap.InsertNode(N, IP);
+ AllNodes.push_back(N);
+ return SDOperand(N, 0);
+}
+
+SDOperand SelectionDAG::getMemOperand(const MemOperand &MO) {
+ const Value *v = MO.getValue();
+ assert((!v || isa(v->getType())) &&
+ "SrcValue is not a pointer?");
+
+ FoldingSetNodeID ID;
+ AddNodeIDNode(ID, ISD::MEMOPERAND, getVTList(MVT::Other), 0, 0);
+ ID.AddPointer(v);
+ ID.AddInteger(MO.getFlags());
+ ID.AddInteger(MO.getOffset());
+ ID.AddInteger(MO.getSize());
+ ID.AddInteger(MO.getAlignment());
+
+ void *IP = 0;
+ if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
+ return SDOperand(E, 0);
+
+ SDNode *N = new MemOperandSDNode(MO);
CSEMap.InsertNode(N, IP);
AllNodes.push_back(N);
return SDOperand(N, 0);
@@ -3479,6 +3510,7 @@
void ConstantPoolSDNode::ANCHOR() {}
void BasicBlockSDNode::ANCHOR() {}
void SrcValueSDNode::ANCHOR() {}
+void MemOperandSDNode::ANCHOR() {}
void RegisterSDNode::ANCHOR() {}
void ExternalSymbolSDNode::ANCHOR() {}
void CondCodeSDNode::ANCHOR() {}
@@ -3503,6 +3535,26 @@
TheGlobal = const_cast(GA);
}
+/// getMemOperand - Return a MemOperand object describing the memory
+/// reference performed by this load or store.
+MemOperand LSBaseSDNode::getMemOperand() const {
+ int Size = (MVT::getSizeInBits(getMemoryVT()) + 7) >> 3;
+ int Flags =
+ getOpcode() == ISD::LOAD ? MemOperand::MOLoad : MemOperand::MOStore;
+ if (IsVolatile) Flags |= MemOperand::MOVolatile;
+
+ // Check if the load references a frame index, and does not have
+ // an SV attached.
+ const FrameIndexSDNode *FI =
+ dyn_cast(getBasePtr().Val);
+ if (!getSrcValue() && FI)
+ return MemOperand(&PseudoSourceValue::getFixedStack(), Flags,
+ FI->getIndex(), Size, Alignment);
+ else
+ return MemOperand(getSrcValue(), Flags,
+ getSrcValueOffset(), Size, Alignment);
+}
+
/// Profile - Gather unique data for the node.
///
void SDNode::Profile(FoldingSetNodeID &ID) {
@@ -3695,6 +3747,7 @@
case ISD::PCMARKER: return "PCMarker";
case ISD::READCYCLECOUNTER: return "ReadCycleCounter";
case ISD::SRCVALUE: return "SrcValue";
+ case ISD::MEMOPERAND: return "MemOperand";
case ISD::EntryToken: return "EntryToken";
case ISD::TokenFactor: return "TokenFactor";
case ISD::AssertSext: return "AssertSext";
@@ -4000,9 +4053,14 @@
cerr << "'" << ES->getSymbol() << "'";
} else if (const SrcValueSDNode *M = dyn_cast(this)) {
if (M->getValue())
- cerr << "<" << M->getValue() << ":" << M->getOffset() << ">";
+ cerr << "<" << M->getValue() << ">";
+ else
+ cerr << "";
+ } else if (const MemOperandSDNode *M = dyn_cast(this)) {
+ if (M->MO.getValue())
+ cerr << "<" << M->MO.getValue() << ":" << M->MO.getOffset() << ">";
else
- cerr << "getOffset() << ">";
+ cerr << "MO.getOffset() << ">";
} else if (const VTSDNode *N = dyn_cast(this)) {
cerr << ":" << MVT::getValueTypeString(N->getVT());
} else if (const LoadSDNode *LD = dyn_cast(this)) {
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Wed Feb 6 16:27:42 2008
@@ -142,9 +142,14 @@
Op += "'" + std::string(ES->getSymbol()) + "'";
} else if (const SrcValueSDNode *M = dyn_cast(Node)) {
if (M->getValue())
- Op += "<" + M->getValue()->getName() + ":" + itostr(M->getOffset()) + ">";
+ Op += "<" + M->getValue()->getName() + ">";
else
- Op += "getOffset()) + ">";
+ Op += "";
+ } else if (const MemOperandSDNode *M = dyn_cast(Node)) {
+ if (M->MO.getValue())
+ Op += "<" + M->MO.getValue()->getName() + ":" + itostr(M->MO.getOffset()) + ">";
+ else
+ Op += "MO.getOffset()) + ">";
} else if (const VTSDNode *N = dyn_cast(Node)) {
Op = Op + " VT=" + MVT::getValueTypeString(N->getVT());
} else if (const StringSDNode *N = dyn_cast(Node)) {
Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Feb 6 16:27:42 2008
@@ -905,9 +905,8 @@
// memory location argument.
MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, PtrVT);
- SrcValueSDNode *SV = cast(Op.getOperand(2));
- return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV->getValue(),
- SV->getOffset());
+ const Value *SV = cast(Op.getOperand(2))->getValue();
+ return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV, 0);
}
static SDOperand LowerFORMAL_ARGUMENT(SDOperand Op, SelectionDAG &DAG,
Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Wed Feb 6 16:27:42 2008
@@ -491,10 +491,9 @@
case ISD::VAARG: {
SDOperand Chain = Op.getOperand(0);
SDOperand VAListP = Op.getOperand(1);
- SrcValueSDNode *VAListS = cast(Op.getOperand(2));
+ const Value *VAListS = cast(Op.getOperand(2))->getValue();
- SDOperand Base = DAG.getLoad(MVT::i64, Chain, VAListP, VAListS->getValue(),
- VAListS->getOffset());
+ SDOperand Base = DAG.getLoad(MVT::i64, Chain, VAListP, VAListS, 0);
SDOperand Tmp = DAG.getNode(ISD::ADD, MVT::i64, VAListP,
DAG.getConstant(8, MVT::i64));
SDOperand Offset = DAG.getExtLoad(ISD::SEXTLOAD, MVT::i64, Base.getValue(1),
@@ -527,13 +526,11 @@
SDOperand Chain = Op.getOperand(0);
SDOperand DestP = Op.getOperand(1);
SDOperand SrcP = Op.getOperand(2);
- SrcValueSDNode *DestS = cast(Op.getOperand(3));
- SrcValueSDNode *SrcS = cast(Op.getOperand(4));
+ const Value *DestS = cast(Op.getOperand(3))->getValue();
+ const Value *SrcS = cast(Op.getOperand(4))->getValue();
- SDOperand Val = DAG.getLoad(getPointerTy(), Chain, SrcP,
- SrcS->getValue(), SrcS->getOffset());
- SDOperand Result = DAG.getStore(Val.getValue(1), Val, DestP, DestS->getValue(),
- DestS->getOffset());
+ SDOperand Val = DAG.getLoad(getPointerTy(), Chain, SrcP, SrcS, 0);
+ SDOperand Result = DAG.getStore(Val.getValue(1), Val, DestP, DestS, 0);
SDOperand NP = DAG.getNode(ISD::ADD, MVT::i64, SrcP,
DAG.getConstant(8, MVT::i64));
Val = DAG.getExtLoad(ISD::SEXTLOAD, MVT::i64, Result, NP, NULL,0, MVT::i32);
@@ -544,12 +541,11 @@
case ISD::VASTART: {
SDOperand Chain = Op.getOperand(0);
SDOperand VAListP = Op.getOperand(1);
- SrcValueSDNode *VAListS = cast(Op.getOperand(2));
+ const Value *VAListS = cast(Op.getOperand(2))->getValue();
// vastart stores the address of the VarArgsBase and VarArgsOffset
SDOperand FR = DAG.getFrameIndex(VarArgsBase, MVT::i64);
- SDOperand S1 = DAG.getStore(Chain, FR, VAListP, VAListS->getValue(),
- VAListS->getOffset());
+ SDOperand S1 = DAG.getStore(Chain, FR, VAListP, VAListS, 0);
SDOperand SA2 = DAG.getNode(ISD::ADD, MVT::i64, VAListP,
DAG.getConstant(8, MVT::i64));
return DAG.getTruncStore(S1, DAG.getConstant(VarArgsOffset, MVT::i64),
Modified: llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp Wed Feb 6 16:27:42 2008
@@ -581,16 +581,16 @@
}
case ISD::VAARG: {
MVT::ValueType VT = getPointerTy();
- SrcValueSDNode *SV = cast(Op.getOperand(2));
+ const Value *SV = cast(Op.getOperand(2))->getValue();
SDOperand VAList = DAG.getLoad(VT, Op.getOperand(0), Op.getOperand(1),
- SV->getValue(), SV->getOffset());
+ SV, 0);
// Increment the pointer, VAList, to the next vaarg
SDOperand VAIncr = DAG.getNode(ISD::ADD, VT, VAList,
DAG.getConstant(MVT::getSizeInBits(VT)/8,
VT));
// Store the incremented VAList to the legalized pointer
VAIncr = DAG.getStore(VAList.getValue(1), VAIncr,
- Op.getOperand(1), SV->getValue(), SV->getOffset());
+ Op.getOperand(1), SV, 0);
// Load the actual argument out of the pointer VAList
return DAG.getLoad(Op.getValueType(), VAIncr, VAList, NULL, 0);
}
@@ -598,9 +598,8 @@
// vastart just stores the address of the VarArgsFrameIndex slot into the
// memory location argument.
SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, MVT::i64);
- SrcValueSDNode *SV = cast(Op.getOperand(2));
- return DAG.getStore(Op.getOperand(0), FR,
- Op.getOperand(1), SV->getValue(), SV->getOffset());
+ const Value *SV = cast(Op.getOperand(2))->getValue();
+ return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV, 0);
}
// Frame & Return address. Currently unimplemented
case ISD::RETURNADDR: break;
Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Wed Feb 6 16:27:42 2008
@@ -24,6 +24,7 @@
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/Constants.h"
#include "llvm/Function.h"
@@ -1175,9 +1176,8 @@
// memory location argument.
MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, PtrVT);
- SrcValueSDNode *SV = cast(Op.getOperand(2));
- return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV->getValue(),
- SV->getOffset());
+ const Value *SV = cast(Op.getOperand(2))->getValue();
+ return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV, 0);
}
// For ELF 32 ABI we follow the layout of the va_list struct.
@@ -1211,37 +1211,41 @@
MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
- SDOperand StackOffset = DAG.getFrameIndex(VarArgsStackOffset, PtrVT);
+ SDOperand StackOffsetFI = DAG.getFrameIndex(VarArgsStackOffset, PtrVT);
SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, PtrVT);
- SDOperand ConstFrameOffset = DAG.getConstant(MVT::getSizeInBits(PtrVT)/8,
- PtrVT);
- SDOperand ConstStackOffset = DAG.getConstant(MVT::getSizeInBits(PtrVT)/8 - 1,
- PtrVT);
- SDOperand ConstFPROffset = DAG.getConstant(1, PtrVT);
+ uint64_t FrameOffset = MVT::getSizeInBits(PtrVT)/8;
+ SDOperand ConstFrameOffset = DAG.getConstant(FrameOffset, PtrVT);
+
+ uint64_t StackOffset = MVT::getSizeInBits(PtrVT)/8 - 1;
+ SDOperand ConstStackOffset = DAG.getConstant(StackOffset, PtrVT);
+
+ uint64_t FPROffset = 1;
+ SDOperand ConstFPROffset = DAG.getConstant(FPROffset, PtrVT);
- SrcValueSDNode *SV = cast(Op.getOperand(2));
+ const Value *SV = cast(Op.getOperand(2))->getValue();
// Store first byte : number of int regs
SDOperand firstStore = DAG.getStore(Op.getOperand(0), ArgGPR,
- Op.getOperand(1), SV->getValue(),
- SV->getOffset());
+ Op.getOperand(1), SV, 0);
+ uint64_t nextOffset = FPROffset;
SDOperand nextPtr = DAG.getNode(ISD::ADD, PtrVT, Op.getOperand(1),
ConstFPROffset);
// Store second byte : number of float regs
- SDOperand secondStore = DAG.getStore(firstStore, ArgFPR, nextPtr,
- SV->getValue(), SV->getOffset());
+ SDOperand secondStore =
+ DAG.getStore(firstStore, ArgFPR, nextPtr, SV, nextOffset);
+ nextOffset += StackOffset;
nextPtr = DAG.getNode(ISD::ADD, PtrVT, nextPtr, ConstStackOffset);
// Store second word : arguments given on stack
- SDOperand thirdStore = DAG.getStore(secondStore, StackOffset, nextPtr,
- SV->getValue(), SV->getOffset());
+ SDOperand thirdStore =
+ DAG.getStore(secondStore, StackOffsetFI, nextPtr, SV, nextOffset);
+ nextOffset += FrameOffset;
nextPtr = DAG.getNode(ISD::ADD, PtrVT, nextPtr, ConstFrameOffset);
// Store third word : arguments given in registers
- return DAG.getStore(thirdStore, FR, nextPtr, SV->getValue(),
- SV->getOffset());
+ return DAG.getStore(thirdStore, FR, nextPtr, SV, nextOffset);
}
@@ -2199,9 +2203,11 @@
Op.getOperand(0));
// STD the extended value into the stack slot.
+ MemOperand MO(&PseudoSourceValue::getFixedStack(),
+ MemOperand::MOStore, FrameIdx, 8, 8);
SDOperand Store = DAG.getNode(PPCISD::STD_32, MVT::Other,
DAG.getEntryNode(), Ext64, FIdx,
- DAG.getSrcValue(NULL));
+ DAG.getMemOperand(MO));
// Load the value as a double.
SDOperand Ld = DAG.getLoad(MVT::f64, Store, FIdx, NULL, 0);
@@ -3300,11 +3306,11 @@
std::vector VTs;
VTs.push_back(MVT::i32);
VTs.push_back(MVT::Other);
- SDOperand SV = DAG.getSrcValue(LD->getSrcValue(), LD->getSrcValueOffset());
+ SDOperand MO = DAG.getMemOperand(LD->getMemOperand());
SDOperand Ops[] = {
LD->getChain(), // Chain
LD->getBasePtr(), // Ptr
- SV, // SrcValue
+ MO, // MemOperand
DAG.getValueType(N->getValueType(0)) // VT
};
SDOperand BSLoad = DAG.getNode(PPCISD::LBRX, VTs, Ops, 4);
Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Wed Feb 6 16:27:42 2008
@@ -805,25 +805,23 @@
SDOperand Offset = DAG.getNode(ISD::ADD, MVT::i32,
DAG.getRegister(SP::I6, MVT::i32),
DAG.getConstant(VarArgsFrameOffset, MVT::i32));
- SrcValueSDNode *SV = cast(Op.getOperand(2));
- return DAG.getStore(Op.getOperand(0), Offset,
- Op.getOperand(1), SV->getValue(), SV->getOffset());
+ const Value *SV = cast(Op.getOperand(2))->getValue();
+ return DAG.getStore(Op.getOperand(0), Offset, Op.getOperand(1), SV, 0);
}
case ISD::VAARG: {
SDNode *Node = Op.Val;
MVT::ValueType VT = Node->getValueType(0);
SDOperand InChain = Node->getOperand(0);
SDOperand VAListPtr = Node->getOperand(1);
- SrcValueSDNode *SV = cast(Node->getOperand(2));
- SDOperand VAList = DAG.getLoad(getPointerTy(), InChain, VAListPtr,
- SV->getValue(), SV->getOffset());
+ const Value *SV = cast(Node->getOperand(2))->getValue();
+ SDOperand VAList = DAG.getLoad(getPointerTy(), InChain, VAListPtr, SV, 0);
// Increment the pointer, VAList, to the next vaarg
SDOperand NextPtr = DAG.getNode(ISD::ADD, getPointerTy(), VAList,
DAG.getConstant(MVT::getSizeInBits(VT)/8,
getPointerTy()));
// Store the incremented VAList to the legalized pointer
InChain = DAG.getStore(VAList.getValue(1), NextPtr,
- VAListPtr, SV->getValue(), SV->getOffset());
+ VAListPtr, SV, 0);
// Load the actual argument out of the pointer VAList, unless this is an
// f64 load.
if (VT != MVT::f64) {
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Feb 6 16:27:42 2008
@@ -32,6 +32,7 @@
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Debug.h"
@@ -1089,7 +1090,8 @@
SDOperand FIN = DAG.getFrameIndex(FI, getPointerTy());
if (isByVal)
return FIN;
- return DAG.getLoad(VA.getValVT(), Root, FIN, NULL, 0);
+ return DAG.getLoad(VA.getValVT(), Root, FIN,
+ &PseudoSourceValue::getFixedStack(), FI);
}
SDOperand
@@ -1217,7 +1219,10 @@
unsigned VReg = AddLiveIn(MF, GPR64ArgRegs[NumIntRegs],
X86::GR64RegisterClass);
SDOperand Val = DAG.getCopyFromReg(Root, VReg, MVT::i64);
- SDOperand Store = DAG.getStore(Val.getValue(1), Val, FIN, NULL, 0);
+ SDOperand Store =
+ DAG.getStore(Val.getValue(1), Val, FIN,
+ &PseudoSourceValue::getFixedStack(),
+ RegSaveFrameIndex);
MemOps.push_back(Store);
FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN,
DAG.getIntPtrConstant(8));
@@ -1230,7 +1235,10 @@
unsigned VReg = AddLiveIn(MF, XMMArgRegs[NumXMMRegs],
X86::VR128RegisterClass);
SDOperand Val = DAG.getCopyFromReg(Root, VReg, MVT::v4f32);
- SDOperand Store = DAG.getStore(Val.getValue(1), Val, FIN, NULL, 0);
+ SDOperand Store =
+ DAG.getStore(Val.getValue(1), Val, FIN,
+ &PseudoSourceValue::getFixedStack(),
+ RegSaveFrameIndex);
MemOps.push_back(Store);
FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN,
DAG.getIntPtrConstant(16));
@@ -1559,7 +1567,9 @@
Flags, DAG));
} else {
// Store relative to framepointer.
- MemOpChains2.push_back(DAG.getStore(Chain, Source, FIN, NULL, 0));
+ MemOpChains2.push_back(
+ DAG.getStore(Chain, Source, FIN,
+ &PseudoSourceValue::getFixedStack(), FI));
}
}
}
@@ -3788,7 +3798,8 @@
// the GV offset field. Platform check is inside GVRequiresExtraLoad() call
// The same applies for external symbols during PIC codegen
if (Subtarget->GVRequiresExtraLoad(GV, getTargetMachine(), false))
- Result = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), Result, NULL, 0);
+ Result = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), Result,
+ &PseudoSourceValue::getGOT(), 0);
return Result;
}
@@ -3846,7 +3857,8 @@
SDOperand Offset = DAG.getNode(X86ISD::Wrapper, PtrVT, TGA);
if (GA->getGlobal()->isDeclaration()) // initial exec TLS model
- Offset = DAG.getLoad(PtrVT, DAG.getEntryNode(), Offset, NULL, 0);
+ Offset = DAG.getLoad(PtrVT, DAG.getEntryNode(), Offset,
+ &PseudoSourceValue::getGOT(), 0);
// The address of the thread local variable is the add of the thread
// pointer with the offset of the variable.
@@ -3978,7 +3990,9 @@
int SSFI = MF.getFrameInfo()->CreateStackObject(Size, Size);
SDOperand StackSlot = DAG.getFrameIndex(SSFI, getPointerTy());
SDOperand Chain = DAG.getStore(DAG.getEntryNode(), Op.getOperand(0),
- StackSlot, NULL, 0);
+ StackSlot,
+ &PseudoSourceValue::getFixedStack(),
+ SSFI);
// These are really Legal; caller falls through into that case.
if (SrcVT == MVT::i32 && isScalarFPTypeInSSEReg(Op.getValueType()))
@@ -4019,7 +4033,8 @@
Ops.push_back(DAG.getValueType(Op.getValueType()));
Ops.push_back(InFlag);
Chain = DAG.getNode(X86ISD::FST, Tys, &Ops[0], Ops.size());
- Result = DAG.getLoad(Op.getValueType(), Chain, StackSlot, NULL, 0);
+ Result = DAG.getLoad(Op.getValueType(), Chain, StackSlot,
+ &PseudoSourceValue::getFixedStack(), SSFI);
}
return Result;
@@ -4057,7 +4072,8 @@
SDOperand Value = Op.getOperand(0);
if (isScalarFPTypeInSSEReg(Op.getOperand(0).getValueType())) {
assert(Op.getValueType() == MVT::i64 && "Invalid FP_TO_SINT to lower!");
- Chain = DAG.getStore(Chain, Value, StackSlot, NULL, 0);
+ Chain = DAG.getStore(Chain, Value, StackSlot,
+ &PseudoSourceValue::getFixedStack(), SSFI);
SDVTList Tys = DAG.getVTList(Op.getOperand(0).getValueType(), MVT::Other);
SDOperand Ops[] = {
Chain, StackSlot, DAG.getValueType(Op.getOperand(0).getValueType())
@@ -4116,7 +4132,8 @@
}
Constant *C = ConstantVector::get(CV);
SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
- SDOperand Mask = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx, NULL, 0,
+ SDOperand Mask = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
+ &PseudoSourceValue::getConstantPool(), 0,
false, 16);
return DAG.getNode(X86ISD::FAND, VT, Op.getOperand(0), Mask);
}
@@ -4144,7 +4161,8 @@
}
Constant *C = ConstantVector::get(CV);
SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
- SDOperand Mask = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx, NULL, 0,
+ SDOperand Mask = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
+ &PseudoSourceValue::getConstantPool(), 0,
false, 16);
if (MVT::isVector(VT)) {
return DAG.getNode(ISD::BIT_CONVERT, VT,
@@ -4192,7 +4210,8 @@
}
Constant *C = ConstantVector::get(CV);
SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
- SDOperand Mask1 = DAG.getLoad(SrcVT, DAG.getEntryNode(), CPIdx, NULL, 0,
+ SDOperand Mask1 = DAG.getLoad(SrcVT, DAG.getEntryNode(), CPIdx,
+ &PseudoSourceValue::getConstantPool(), 0,
false, 16);
SDOperand SignBit = DAG.getNode(X86ISD::FAND, SrcVT, Op1, Mask1);
@@ -4220,7 +4239,8 @@
}
C = ConstantVector::get(CV);
CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
- SDOperand Mask2 = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx, NULL, 0,
+ SDOperand Mask2 = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
+ &PseudoSourceValue::getConstantPool(), 0,
false, 16);
SDOperand Val = DAG.getNode(X86ISD::FAND, VT, Op0, Mask2);
@@ -4676,14 +4696,13 @@
}
SDOperand X86TargetLowering::LowerVASTART(SDOperand Op, SelectionDAG &DAG) {
- SrcValueSDNode *SV = cast(Op.getOperand(2));
+ const Value *SV = cast(Op.getOperand(2))->getValue();
if (!Subtarget->is64Bit()) {
// vastart just stores the address of the VarArgsFrameIndex slot into the
// memory location argument.
SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, getPointerTy());
- return DAG.getStore(Op.getOperand(0), FR,Op.getOperand(1), SV->getValue(),
- SV->getOffset());
+ return DAG.getStore(Op.getOperand(0), FR,Op.getOperand(1), SV, 0);
}
// __va_list_tag:
@@ -4696,28 +4715,26 @@
// Store gp_offset
SDOperand Store = DAG.getStore(Op.getOperand(0),
DAG.getConstant(VarArgsGPOffset, MVT::i32),
- FIN, SV->getValue(), SV->getOffset());
+ FIN, SV, 0);
MemOps.push_back(Store);
// Store fp_offset
FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN, DAG.getIntPtrConstant(4));
Store = DAG.getStore(Op.getOperand(0),
DAG.getConstant(VarArgsFPOffset, MVT::i32),
- FIN, SV->getValue(), SV->getOffset());
+ FIN, SV, 0);
MemOps.push_back(Store);
// Store ptr to overflow_arg_area
FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN, DAG.getIntPtrConstant(4));
SDOperand OVFIN = DAG.getFrameIndex(VarArgsFrameIndex, getPointerTy());
- Store = DAG.getStore(Op.getOperand(0), OVFIN, FIN, SV->getValue(),
- SV->getOffset());
+ Store = DAG.getStore(Op.getOperand(0), OVFIN, FIN, SV, 0);
MemOps.push_back(Store);
// Store ptr to reg_save_area.
FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN, DAG.getIntPtrConstant(8));
SDOperand RSFIN = DAG.getFrameIndex(RegSaveFrameIndex, getPointerTy());
- Store = DAG.getStore(Op.getOperand(0), RSFIN, FIN, SV->getValue(),
- SV->getOffset());
+ Store = DAG.getStore(Op.getOperand(0), RSFIN, FIN, SV, 0);
MemOps.push_back(Store);
return DAG.getNode(ISD::TokenFactor, MVT::Other, &MemOps[0], MemOps.size());
}
@@ -4727,18 +4744,15 @@
SDOperand Chain = Op.getOperand(0);
SDOperand DstPtr = Op.getOperand(1);
SDOperand SrcPtr = Op.getOperand(2);
- SrcValueSDNode *DstSV = cast(Op.getOperand(3));
- SrcValueSDNode *SrcSV = cast(Op.getOperand(4));
+ const Value *DstSV = cast(Op.getOperand(3))->getValue();
+ const Value *SrcSV = cast(Op.getOperand(4))->getValue();
- SrcPtr = DAG.getLoad(getPointerTy(), Chain, SrcPtr,
- SrcSV->getValue(), SrcSV->getOffset());
+ SrcPtr = DAG.getLoad(getPointerTy(), Chain, SrcPtr, SrcSV, 0);
Chain = SrcPtr.getValue(1);
for (unsigned i = 0; i < 3; ++i) {
- SDOperand Val = DAG.getLoad(MVT::i64, Chain, SrcPtr,
- SrcSV->getValue(), SrcSV->getOffset());
+ SDOperand Val = DAG.getLoad(MVT::i64, Chain, SrcPtr, SrcSV, 0);
Chain = Val.getValue(1);
- Chain = DAG.getStore(Chain, Val, DstPtr,
- DstSV->getValue(), DstSV->getOffset());
+ Chain = DAG.getStore(Chain, Val, DstPtr, DstSV, 0);
if (i == 2)
break;
SrcPtr = DAG.getNode(ISD::ADD, getPointerTy(), SrcPtr,
@@ -4918,7 +4932,7 @@
SDOperand FPtr = Op.getOperand(2); // nested function
SDOperand Nest = Op.getOperand(3); // 'nest' parameter value
- SrcValueSDNode *TrmpSV = cast(Op.getOperand(4));
+ const Value *TrmpAddr = cast(Op.getOperand(4))->getValue();
const X86InstrInfo *TII =
((X86TargetMachine&)getTargetMachine()).getInstrInfo();
@@ -4942,33 +4956,31 @@
unsigned OpCode = ((MOV64ri | N86R11) << 8) | REX_WB; // movabsq r11
SDOperand Addr = Trmp;
OutChains[0] = DAG.getStore(Root, DAG.getConstant(OpCode, MVT::i16), Addr,
- TrmpSV->getValue(), TrmpSV->getOffset());
+ TrmpAddr, 0);
Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(2, MVT::i64));
- OutChains[1] = DAG.getStore(Root, FPtr, Addr, TrmpSV->getValue(),
- TrmpSV->getOffset() + 2, false, 2);
+ OutChains[1] = DAG.getStore(Root, FPtr, Addr, TrmpAddr, 2, false, 2);
// Load the 'nest' parameter value into R10.
// R10 is specified in X86CallingConv.td
OpCode = ((MOV64ri | N86R10) << 8) | REX_WB; // movabsq r10
Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(10, MVT::i64));
OutChains[2] = DAG.getStore(Root, DAG.getConstant(OpCode, MVT::i16), Addr,
- TrmpSV->getValue(), TrmpSV->getOffset() + 10);
+ TrmpAddr, 10);
Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(12, MVT::i64));
- OutChains[3] = DAG.getStore(Root, Nest, Addr, TrmpSV->getValue(),
- TrmpSV->getOffset() + 12, false, 2);
+ OutChains[3] = DAG.getStore(Root, Nest, Addr, TrmpAddr, 12, false, 2);
// Jump to the nested function.
OpCode = (JMP64r << 8) | REX_WB; // jmpq *...
Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(20, MVT::i64));
OutChains[4] = DAG.getStore(Root, DAG.getConstant(OpCode, MVT::i16), Addr,
- TrmpSV->getValue(), TrmpSV->getOffset() + 20);
+ TrmpAddr, 20);
unsigned char ModRM = N86R11 | (4 << 3) | (3 << 6); // ...r11
Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(22, MVT::i64));
OutChains[5] = DAG.getStore(Root, DAG.getConstant(ModRM, MVT::i8), Addr,
- TrmpSV->getValue(), TrmpSV->getOffset() + 22);
+ TrmpAddr, 22);
SDOperand Ops[] =
{ Trmp, DAG.getNode(ISD::TokenFactor, MVT::Other, OutChains, 6) };
@@ -5026,20 +5038,18 @@
const unsigned char N86Reg =
((X86RegisterInfo*)RegInfo)->getX86RegNum(NestReg);
OutChains[0] = DAG.getStore(Root, DAG.getConstant(MOV32ri|N86Reg, MVT::i8),
- Trmp, TrmpSV->getValue(), TrmpSV->getOffset());
+ Trmp, TrmpAddr, 0);
Addr = DAG.getNode(ISD::ADD, MVT::i32, Trmp, DAG.getConstant(1, MVT::i32));
- OutChains[1] = DAG.getStore(Root, Nest, Addr, TrmpSV->getValue(),
- TrmpSV->getOffset() + 1, false, 1);
+ OutChains[1] = DAG.getStore(Root, Nest, Addr, TrmpAddr, 1, false, 1);
const unsigned char JMP = TII->getBaseOpcodeFor(X86::JMP);
Addr = DAG.getNode(ISD::ADD, MVT::i32, Trmp, DAG.getConstant(5, MVT::i32));
OutChains[2] = DAG.getStore(Root, DAG.getConstant(JMP, MVT::i8), Addr,
- TrmpSV->getValue() + 5, TrmpSV->getOffset());
+ TrmpAddr, 5, false, 1);
Addr = DAG.getNode(ISD::ADD, MVT::i32, Trmp, DAG.getConstant(6, MVT::i32));
- OutChains[3] = DAG.getStore(Root, Disp, Addr, TrmpSV->getValue(),
- TrmpSV->getOffset() + 6, false, 1);
+ OutChains[3] = DAG.getStore(Root, Disp, Addr, TrmpAddr, 6, false, 1);
SDOperand Ops[] =
{ Trmp, DAG.getNode(ISD::TokenFactor, MVT::Other, OutChains, 4) };
Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=46827&r1=46826&r2=46827&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Wed Feb 6 16:27:42 2008
@@ -313,6 +313,12 @@
std::vector > OrigChains;
std::set Duplicates;
+ /// LSI - Load/Store information.
+ /// Save loads/stores matched by a pattern, and generate a MemOperandSDNode
+ /// for each memory access. This facilitates the use of AliasAnalysis in
+ /// the backend.
+ std::vector LSI;
+
/// GeneratedCode - This is the buffer that we emit code to. The first int
/// indicates whether this is an exit predicate (something that should be
/// tested, and if true, the match fails) [when 1], or normal code to emit
@@ -373,6 +379,16 @@
void EmitMatchCode(TreePatternNode *N, TreePatternNode *P,
const std::string &RootName, const std::string &ChainSuffix,
bool &FoundChain) {
+
+ // Save loads/stores matched by a pattern.
+ if (!N->isLeaf() && N->getName().empty()) {
+ std::string EnumName = N->getOperator()->getValueAsString("Opcode");
+ if (EnumName == "ISD::LOAD" ||
+ EnumName == "ISD::STORE") {
+ LSI.push_back(RootName);
+ }
+ }
+
bool isRoot = (P == NULL);
// Emit instruction predicates. Each predicate is just a string for now.
if (isRoot) {
@@ -944,6 +960,18 @@
}
}
+ // Generate MemOperandSDNodes nodes for each memory accesses covered by this
+ // pattern.
+ if (isRoot) {
+ std::vector::const_iterator mi, mie;
+ for (mi = LSI.begin(), mie = LSI.end(); mi != mie; ++mi) {
+ emitCode("SDOperand LSI_" + *mi + " = "
+ "CurDAG->getMemOperand(cast(" +
+ *mi + ")->getMemOperand());");
+ AllOps.push_back("LSI_" + *mi);
+ }
+ }
+
// Emit all the chain and CopyToReg stuff.
bool ChainEmitted = NodeHasChain;
if (NodeHasChain)
From isanbard at gmail.com Wed Feb 6 16:33:59 2008
From: isanbard at gmail.com (Bill Wendling)
Date: Wed, 06 Feb 2008 22:33:59 -0000
Subject: [llvm-commits] [llvm] r46828 -
/llvm/branches/Apple/Zim/lib/CodeGen/RegAllocLocal.cpp
Message-ID: <200802062233.m16MXxdb003570@zion.cs.uiuc.edu>
Author: void
Date: Wed Feb 6 16:33:59 2008
New Revision: 46828
URL: http://llvm.org/viewvc/llvm-project?rev=46828&view=rev
Log:
[From mainline]
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080204/057964.html
RegAllocaLocal still *requires* LiveVariables since it runs PHIElimination,
followed by TwoAddress which requires LiveVariables. We cannot run
LiveVariables on non-SSA code.
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080204/057979.html
Fix a number of local register allocator issues: PR1609.
Modified:
llvm/branches/Apple/Zim/lib/CodeGen/RegAllocLocal.cpp
Modified: llvm/branches/Apple/Zim/lib/CodeGen/RegAllocLocal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zim/lib/CodeGen/RegAllocLocal.cpp?rev=46828&r1=46827&r2=46828&view=diff
==============================================================================
--- llvm/branches/Apple/Zim/lib/CodeGen/RegAllocLocal.cpp (original)
+++ llvm/branches/Apple/Zim/lib/CodeGen/RegAllocLocal.cpp Wed Feb 6 16:33:59 2008
@@ -14,11 +14,12 @@
#define DEBUG_TYPE "regalloc"
#include "llvm/BasicBlock.h"
-#include "llvm/CodeGen/Passes.h"
+#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/RegAllocRegistry.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
@@ -28,6 +29,7 @@
#include "llvm/ADT/IndexedMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
+#include "llvm/ADT/STLExtras.h"
#include
using namespace llvm;
@@ -146,6 +148,7 @@
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.addRequired();
AU.addRequiredID(PHIEliminationID);
AU.addRequiredID(TwoAddressInstructionPassID);
MachineFunctionPass::getAnalysisUsage(AU);
@@ -294,16 +297,24 @@
std::pair &LastUse = getVirtRegLastUse(VirtReg);
if (LastUse.first)
LastUse.first->getOperand(LastUse.second).setIsKill();
- }
-
- // Otherwise, there is a virtual register corresponding to this physical
- // register. We only need to spill it into its stack slot if it has been
- // modified.
- if (isVirtRegModified(VirtReg)) {
+ } else {
+ // Otherwise, there is a virtual register corresponding to this physical
+ // register. We only need to spill it into its stack slot if it has been
+ // modified.
const TargetRegisterClass *RC = MF->getRegInfo().getRegClass(VirtReg);
int FrameIndex = getStackSpaceFor(VirtReg, RC);
DOUT << " to stack slot #" << FrameIndex;
TII->storeRegToStackSlot(MBB, I, PhysReg, true, FrameIndex, RC);
+
+ // If the instruction reads the register that's spilled, (e.g. this can
+ // happen if it is a move to a physical register), then the spill
+ // instruction is not a kill.
+ if (I != MBB.end() && I->findRegisterUseOperandIdx(PhysReg) != -1) {
+ MachineBasicBlock::iterator StoreMI = prior(I);
+ int Idx = StoreMI->findRegisterUseOperandIdx(PhysReg, true);
+ assert(Idx != -1 && "Unrecognized spill instruction!");
+ StoreMI->getOperand(Idx).setIsKill(false);
+ }
++NumStores; // Update statistics
}
@@ -492,12 +503,6 @@
// If we can fold this spill into this instruction, do so now.
SmallVector Ops;
Ops.push_back(OpNum);
- if (MachineInstr* FMI = TII->foldMemoryOperand(MI, Ops, FrameIndex)) {
- ++NumFolded;
- // Update kill/dead flags.
- FMI->copyKillDeadInfo(MI);
- return MBB.insert(MBB.erase(MI), FMI);
- }
// It looks like we can't fold this virtual register load into this
// instruction. Force some poor hapless value out of the register file to
@@ -773,9 +778,8 @@
// Finally, if this is a noop copy instruction, zap it.
unsigned SrcReg, DstReg;
- if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg) {
+ if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg)
MBB.erase(MI);
- }
}
MachineBasicBlock::iterator MI = MBB.getFirstTerminator();
From isanbard at gmail.com Wed Feb 6 16:35:09 2008
From: isanbard at gmail.com (Bill Wendling)
Date: Wed, 06 Feb 2008 22:35:09 -0000
Subject: [llvm-commits] [llvm] r46829 - /llvm/tags/Apple/llvmCore-2016/
Message-ID: <200802062235.m16MZ9GL003606@zion.cs.uiuc.edu>
Author: void
Date: Wed Feb 6 16:35:09 2008
New Revision: 46829
URL: http://llvm.org/viewvc/llvm-project?rev=46829&view=rev
Log:
Creating llvmCore-2016 tag from Zim branch
Added:
llvm/tags/Apple/llvmCore-2016/
- copied from r46828, llvm/branches/Apple/Zim/
From resistor at mac.com Wed Feb 6 17:08:59 2008
From: resistor at mac.com (Owen Anderson)
Date: Wed, 6 Feb 2008 17:08:59 -0600
Subject: [llvm-commits] [llvm] r46828 -
/llvm/branches/Apple/Zim/lib/CodeGen/RegAllocLocal.cpp
In-Reply-To: <200802062233.m16MXxdb003570@zion.cs.uiuc.edu>
References: <200802062233.m16MXxdb003570@zion.cs.uiuc.edu>
Message-ID:
I should clarify that, in a general sense, RegAllocLocal does not
depend on LiveVariables, but declaring it as such seems to be
necessary to obtain a working pass ordering.
--Owen
On Feb 6, 2008, at 4:33 PM, Bill Wendling wrote:
> Author: void
> Date: Wed Feb 6 16:33:59 2008
> New Revision: 46828
>
> URL: http://llvm.org/viewvc/llvm-project?rev=46828&view=rev
> Log:
> [From mainline]
>
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080204/057964.html
>
> RegAllocaLocal still *requires* LiveVariables since it runs
> PHIElimination,
> followed by TwoAddress which requires LiveVariables. We cannot run
> LiveVariables on non-SSA code.
>
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080204/057979.html
>
> Fix a number of local register allocator issues: PR1609.
>
>
> Modified:
> llvm/branches/Apple/Zim/lib/CodeGen/RegAllocLocal.cpp
>
> Modified: llvm/branches/Apple/Zim/lib/CodeGen/RegAllocLocal.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zim/lib/CodeGen/RegAllocLocal.cpp?rev=46828&r1=46827&r2=46828&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/branches/Apple/Zim/lib/CodeGen/RegAllocLocal.cpp (original)
> +++ llvm/branches/Apple/Zim/lib/CodeGen/RegAllocLocal.cpp Wed Feb 6
> 16:33:59 2008
> @@ -14,11 +14,12 @@
>
> #define DEBUG_TYPE "regalloc"
> #include "llvm/BasicBlock.h"
> -#include "llvm/CodeGen/Passes.h"
> +#include "llvm/CodeGen/LiveVariables.h"
> #include "llvm/CodeGen/MachineFunctionPass.h"
> #include "llvm/CodeGen/MachineInstr.h"
> #include "llvm/CodeGen/MachineFrameInfo.h"
> #include "llvm/CodeGen/MachineRegisterInfo.h"
> +#include "llvm/CodeGen/Passes.h"
> #include "llvm/CodeGen/RegAllocRegistry.h"
> #include "llvm/Target/TargetInstrInfo.h"
> #include "llvm/Target/TargetMachine.h"
> @@ -28,6 +29,7 @@
> #include "llvm/ADT/IndexedMap.h"
> #include "llvm/ADT/SmallVector.h"
> #include "llvm/ADT/Statistic.h"
> +#include "llvm/ADT/STLExtras.h"
> #include
> using namespace llvm;
>
> @@ -146,6 +148,7 @@
> }
>
> virtual void getAnalysisUsage(AnalysisUsage &AU) const {
> + AU.addRequired();
> AU.addRequiredID(PHIEliminationID);
> AU.addRequiredID(TwoAddressInstructionPassID);
> MachineFunctionPass::getAnalysisUsage(AU);
> @@ -294,16 +297,24 @@
> std::pair &LastUse =
> getVirtRegLastUse(VirtReg);
> if (LastUse.first)
> LastUse.first->getOperand(LastUse.second).setIsKill();
> - }
> -
> - // Otherwise, there is a virtual register corresponding to this
> physical
> - // register. We only need to spill it into its stack slot if it
> has been
> - // modified.
> - if (isVirtRegModified(VirtReg)) {
> + } else {
> + // Otherwise, there is a virtual register corresponding to this
> physical
> + // register. We only need to spill it into its stack slot if
> it has been
> + // modified.
> const TargetRegisterClass *RC = MF-
> >getRegInfo().getRegClass(VirtReg);
> int FrameIndex = getStackSpaceFor(VirtReg, RC);
> DOUT << " to stack slot #" << FrameIndex;
> TII->storeRegToStackSlot(MBB, I, PhysReg, true, FrameIndex, RC);
> +
> + // If the instruction reads the register that's spilled, (e.g.
> this can
> + // happen if it is a move to a physical register), then the spill
> + // instruction is not a kill.
> + if (I != MBB.end() && I->findRegisterUseOperandIdx(PhysReg) !=
> -1) {
> + MachineBasicBlock::iterator StoreMI = prior(I);
> + int Idx = StoreMI->findRegisterUseOperandIdx(PhysReg, true);
> + assert(Idx != -1 && "Unrecognized spill instruction!");
> + StoreMI->getOperand(Idx).setIsKill(false);
> + }
> ++NumStores; // Update statistics
> }
>
> @@ -492,12 +503,6 @@
> // If we can fold this spill into this instruction, do so now.
> SmallVector Ops;
> Ops.push_back(OpNum);
> - if (MachineInstr* FMI = TII->foldMemoryOperand(MI, Ops,
> FrameIndex)) {
> - ++NumFolded;
> - // Update kill/dead flags.
> - FMI->copyKillDeadInfo(MI);
> - return MBB.insert(MBB.erase(MI), FMI);
> - }
>
> // It looks like we can't fold this virtual register load into
> this
> // instruction. Force some poor hapless value out of the
> register file to
> @@ -773,9 +778,8 @@
>
> // Finally, if this is a noop copy instruction, zap it.
> unsigned SrcReg, DstReg;
> - if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg) {
> + if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg)
> MBB.erase(MI);
> - }
> }
>
> MachineBasicBlock::iterator MI = MBB.getFirstTerminator();
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2555 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080206/03a0342e/attachment.bin
From gohman at apple.com Wed Feb 6 17:09:16 2008
From: gohman at apple.com (Dan Gohman)
Date: Wed, 06 Feb 2008 23:09:16 -0000
Subject: [llvm-commits] [llvm] r46833 - in /llvm/trunk:
include/llvm/ADT/FoldingSet.h lib/Support/FoldingSet.cpp
Message-ID: <200802062309.m16N9GRB004607@zion.cs.uiuc.edu>
Author: djg
Date: Wed Feb 6 17:09:15 2008
New Revision: 46833
URL: http://llvm.org/viewvc/llvm-project?rev=46833&view=rev
Log:
Add support to FoldingSet for hashing APInt objects.
Modified:
llvm/trunk/include/llvm/ADT/FoldingSet.h
llvm/trunk/lib/Support/FoldingSet.cpp
Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=46833&r1=46832&r2=46833&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/FoldingSet.h (original)
+++ llvm/trunk/include/llvm/ADT/FoldingSet.h Wed Feb 6 17:09:15 2008
@@ -22,6 +22,7 @@
namespace llvm {
class APFloat;
+ class APInt;
/// This folding set used for two purposes:
/// 1. Given information about a node we want to create, look up the unique
@@ -206,6 +207,7 @@
void AddFloat(float F);
void AddDouble(double D);
void AddAPFloat(const APFloat& apf);
+ void AddAPInt(const APInt& api);
void AddString(const std::string &String);
/// clear - Clear the accumulated profile, allowing this FoldingSetNodeID
Modified: llvm/trunk/lib/Support/FoldingSet.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FoldingSet.cpp?rev=46833&r1=46832&r2=46833&view=diff
==============================================================================
--- llvm/trunk/lib/Support/FoldingSet.cpp (original)
+++ llvm/trunk/lib/Support/FoldingSet.cpp Wed Feb 6 17:09:15 2008
@@ -16,6 +16,7 @@
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/APFloat.h"
+#include "llvm/ADT/APInt.h"
#include "llvm/Support/MathExtras.h"
#include
using namespace llvm;
@@ -59,6 +60,9 @@
}
void FoldingSetNodeID::AddAPFloat(const APFloat& apf) {
APInt api = apf.convertToAPInt();
+ AddAPInt(api);
+}
+void FoldingSetNodeID::AddAPInt(const APInt& api) {
const uint64_t *p = api.getRawData();
for (unsigned i=0; i
Author: johannes
Date: Wed Feb 6 17:26:23 2008
New Revision: 46834
URL: http://llvm.org/viewvc/llvm-project?rev=46834&view=rev
Log:
Make TARGET_PIM_ALTIVEC actually reflect -mpim-altivec.
This means vector constants using the PIM syntax will be
splatted as they're supposed to be, rather than zero-filled.
Modified:
llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c
Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c?rev=46834&r1=46833&r2=46834&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c Wed Feb 6 17:26:23 2008
@@ -1486,8 +1486,11 @@
{
flag_disable_opts_for_faltivec = 1;
/* APPLE LOCAL radar 4161346 */
- target_flags |= (MASK_ALTIVEC | MASK_PIM_ALTIVEC);
+/* LLVM LOCAL begin handle -mpim-altivec correctly */
+ target_flags |= MASK_ALTIVEC;
}
+ target_flags |= MASK_PIM_ALTIVEC;
+/* LLVM LOCAL begin handle -mpim-altivec correctly */
}
/* APPLE LOCAL end AltiVec */
From dpatel at apple.com Wed Feb 6 17:27:03 2008
From: dpatel at apple.com (Devang Patel)
Date: Wed, 6 Feb 2008 15:27:03 -0800
Subject: [llvm-commits] [llvm] r46828 -
/llvm/branches/Apple/Zim/lib/CodeGen/RegAllocLocal.cpp
In-Reply-To:
References: <200802062233.m16MXxdb003570@zion.cs.uiuc.edu>
Message-ID:
On Feb 6, 2008, at 3:08 PM, Owen Anderson wrote:
> I should clarify that, in a general sense, RegAllocLocal does not
> depend on LiveVariables, but declaring it as such seems to be
> necessary to obtain a working pass ordering.
hmmm, then LiveVariables pass should be inserted in the pass queue,
before RegAllocLocal pass, using PassManager->addPass().
-
Devang
From gohman at apple.com Wed Feb 6 20:30:40 2008
From: gohman at apple.com (Dan Gohman)
Date: Thu, 07 Feb 2008 02:30:40 -0000
Subject: [llvm-commits] [llvm] r46836 - /llvm/trunk/lib/VMCore/Constants.cpp
Message-ID: <200802070230.m172UehQ010487@zion.cs.uiuc.edu>
Author: djg
Date: Wed Feb 6 20:30:40 2008
New Revision: 46836
URL: http://llvm.org/viewvc/llvm-project?rev=46836&view=rev
Log:
Fix a typo in a comment.
Modified:
llvm/trunk/lib/VMCore/Constants.cpp
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=46836&r1=46835&r2=46836&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Wed Feb 6 20:30:40 2008
@@ -225,7 +225,7 @@
}
// Get a ConstantInt from an APInt. Note that the value stored in the DenseMap
-// as the key, is a DensMapAPIntKeyInfo::KeyTy which has provided the
+// as the key, is a DenseMapAPIntKeyInfo::KeyTy which has provided the
// operator== and operator!= to ensure that the DenseMap doesn't attempt to
// compare APInt's of different widths, which would violate an APInt class
// invariant which generates an assertion.
From isanbard at gmail.com Wed Feb 6 23:45:14 2008
From: isanbard at gmail.com (Bill Wendling)
Date: Thu, 07 Feb 2008 05:45:14 -0000
Subject: [llvm-commits] [llvm-gcc-4.2] r46842 - in /llvm-gcc-4.2/trunk/gcc:
config/darwin.c config/rs6000/rs6000.c varasm.c
Message-ID: <200802070545.m175jFpf016054@zion.cs.uiuc.edu>
Author: void
Date: Wed Feb 6 23:45:10 2008
New Revision: 46842
URL: http://llvm.org/viewvc/llvm-project?rev=46842&view=rev
Log:
Clean up the patch about visibility. Only block out the parts LLVM
doesn't want to do instead of creating new functions and making life
miserable for everyone on the planet.
Modified:
llvm-gcc-4.2/trunk/gcc/config/darwin.c
llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c
llvm-gcc-4.2/trunk/gcc/varasm.c
Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.c?rev=46842&r1=46841&r2=46842&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin.c Wed Feb 6 23:45:10 2008
@@ -1988,19 +1988,6 @@
extern". There is no MACH-O equivalent of ELF's
VISIBILITY_INTERNAL or VISIBILITY_PROTECTED. */
-/* LLVM LOCAL begin */
-#ifdef ENABLE_LLVM
-void
-darwin_assemble_visibility (tree decl ATTRIBUTE_UNUSED, int vis)
-{
- /* Emit a warning if the visibility isn't supported with this
- configuration. We don't want to output anything to the ASM file, of
- course. */
- if (!(vis == VISIBILITY_DEFAULT || vis == VISIBILITY_HIDDEN))
- warning (OPT_Wattributes, "internal and protected visibility attributes "
- "not supported in this configuration; ignored");
-}
-#else
void
darwin_assemble_visibility (tree decl, int vis)
{
@@ -2008,17 +1995,19 @@
;
else if (vis == VISIBILITY_HIDDEN)
{
+/* LLVM LOCAL */
+#ifndef ENABLE_LLVM
fputs ("\t.private_extern ", asm_out_file);
assemble_name (asm_out_file,
(IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))));
fputs ("\n", asm_out_file);
+/* LLVM LOCAL */
+#endif
}
else
warning (OPT_Wattributes, "internal and protected visibility attributes "
"not supported in this configuration; ignored");
}
-#endif
-/* LLVM LOCAL end */
/* Output a difference of two labels that will be an assembly time
constant if the two labels are local. (.long lab1-lab2 will be
Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c?rev=46842&r1=46841&r2=46842&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/rs6000/rs6000.c Wed Feb 6 23:45:10 2008
@@ -944,14 +944,10 @@
#undef TARGET_ASM_INTEGER
#define TARGET_ASM_INTEGER rs6000_assemble_integer
-/* LLVM LOCAL - Use default assemble_visibility */
-#ifndef ENABLE_LLVM
#ifdef HAVE_GAS_HIDDEN
#undef TARGET_ASM_ASSEMBLE_VISIBILITY
#define TARGET_ASM_ASSEMBLE_VISIBILITY rs6000_assemble_visibility
#endif
-/* LLVM LOCAL - Use default assemble_visibility */
-#endif
#undef TARGET_HAVE_TLS
#define TARGET_HAVE_TLS HAVE_AS_TLS
@@ -13108,6 +13104,8 @@
&& DOT_SYMBOLS
&& TREE_CODE (decl) == FUNCTION_DECL)
{
+/* LLVM LOCAL */
+#ifndef ENABLE_LLVM
static const char * const visibility_types[] = {
NULL, "internal", "hidden", "protected"
};
@@ -13120,6 +13118,8 @@
fprintf (asm_out_file, "\t.%s\t%s\n", type, name);
fprintf (asm_out_file, "\t.%s\t.%s\n", type, name);
+/* LLVM LOCAL */
+#endif
}
else
default_assemble_visibility (decl, vis);
Modified: llvm-gcc-4.2/trunk/gcc/varasm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/varasm.c?rev=46842&r1=46841&r2=46842&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/varasm.c (original)
+++ llvm-gcc-4.2/trunk/gcc/varasm.c Wed Feb 6 23:45:10 2008
@@ -5317,11 +5317,12 @@
#ifdef HAVE_GAS_HIDDEN
+/* LLVM LOCAL */
#ifndef ENABLE_LLVM
fprintf (asm_out_file, "\t.%s\t", type);
assemble_name (asm_out_file, name);
fprintf (asm_out_file, "\n");
- /* LLVM LOCAL */
+/* LLVM LOCAL */
#endif
#else
warning (OPT_Wattributes, "visibility attribute not supported "
From nicholas at mxc.ca Thu Feb 7 00:36:27 2008
From: nicholas at mxc.ca (Nick Lewycky)
Date: Thu, 07 Feb 2008 06:36:27 -0000
Subject: [llvm-commits] [llvm] r46848 -
/llvm/trunk/lib/CodeGen/AsmPrinter.cpp
Message-ID: <200802070636.m176aRAR017458@zion.cs.uiuc.edu>
Author: nicholas
Date: Thu Feb 7 00:36:26 2008
New Revision: 46848
URL: http://llvm.org/viewvc/llvm-project?rev=46848&view=rev
Log:
Don't make up new directives. (".set_foobar")
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=46848&r1=46847&r2=46848&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Thu Feb 7 00:36:26 2008
@@ -157,7 +157,7 @@
else if (!I->hasInternalLinkage())
assert(0 && "Invalid alias linkage");
- O << TAI->getSetDirective() << Name << ", " << Target << "\n";
+ O << TAI->getSetDirective() << ' ' << Name << ", " << Target << "\n";
// If the aliasee has external weak linkage it can be referenced only by
// alias itself. In this case it can be not in ExtWeakSymbols list. Emit
From evan.cheng at apple.com Thu Feb 7 02:29:53 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Thu, 07 Feb 2008 08:29:53 -0000
Subject: [llvm-commits] [llvm] r46849 -
/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Message-ID: <200802070829.m178Trmk020622@zion.cs.uiuc.edu>
Author: evancheng
Date: Thu Feb 7 02:29:53 2008
New Revision: 46849
URL: http://llvm.org/viewvc/llvm-project?rev=46849&view=rev
Log:
In some cases, e.g. ADD32ri, no transformation is made. Guide against it.
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=46849&r1=46848&r2=46849&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Thu Feb 7 02:29:53 2008
@@ -1011,6 +1011,8 @@
}
}
+ if (!NewMI) return 0;
+
NewMI->copyKillDeadInfo(MI);
LV.instructionChanged(MI, NewMI); // Update live variables
MFI->insert(MBBI, NewMI); // Insert the new inst
From evan.cheng at apple.com Thu Feb 7 02:32:31 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Thu, 7 Feb 2008 00:32:31 -0800
Subject: [llvm-commits] [llvm] r46827 - in /llvm/trunk: include/llvm/
include/llvm/CodeGen/ lib/CodeGen/ lib/CodeGen/SelectionDAG/
lib/Target/ARM/ lib/Target/Alpha/ lib/Target/IA64/
lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/
utils/TableGen/
In-Reply-To: <200802062227.m16MRhjU003393@zion.cs.uiuc.edu>
References: <200802062227.m16MRhjU003393@zion.cs.uiuc.edu>
Message-ID:
Hi Dan,
This seems to be breaking -print-machineinstrs. Try test/CodeGen/X86/
pic_jumptable.ll:
bb2: 0x1204da0, LLVM BB @0x1201c20, ID#1:
Predecessors according to CFG: 0x12026c0 (#5)
ADJCALLSTACKDOWN 4, %ESP, %EFLAGS, %ESP
%reg1029 = MOV32rr %ESP
MOV32mi %reg1029, 1, %reg0, 0, 1, SV:Assertion failed: (V &&
"SV missing."), function print, file MachineInstr.cpp, line 639.
Thanks,
Evan
On Feb 6, 2008, at 2:27 PM, Dan Gohman wrote:
> Author: djg
> Date: Wed Feb 6 16:27:42 2008
> New Revision: 46827
>
> URL: http://llvm.org/viewvc/llvm-project?rev=46827&view=rev
> Log:
> Re-apply the memory operand changes, with a fix for the static
> initializer problem, a minor tweak to the way the
> DAGISelEmitter finds load/store nodes, and a renaming of the
> new PseudoSourceValue objects.
>
> Modified:
> llvm/trunk/include/llvm/CodeGen/MachineInstr.h
> llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
> llvm/trunk/include/llvm/CodeGen/MemOperand.h
> llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h
> llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
> llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
> llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
> llvm/trunk/include/llvm/Value.h
> llvm/trunk/lib/CodeGen/MachineInstr.cpp
> llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp
> llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
> llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
> llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
> llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
> llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
> llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp
> llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp
> llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
> llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp
> llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
> llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
>
> Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Wed Feb 6
> 16:27:42 2008
> @@ -17,6 +17,7 @@
> #define LLVM_CODEGEN_MACHINEINSTR_H
>
> #include "llvm/CodeGen/MachineOperand.h"
> +#include "llvm/CodeGen/MemOperand.h"
>
> namespace llvm {
>
> @@ -35,6 +36,7 @@
> // are determined at
> construction time).
>
> std::vector Operands; // the operands
> + std::vector MemOperands; // information on memory
> references
> MachineInstr *Prev, *Next; // Links for MBB's intrusive
> list.
> MachineBasicBlock *Parent; // Pointer to the owning
> basic block.
>
> @@ -94,6 +96,18 @@
> ///
> unsigned getNumExplicitOperands() const;
>
> + /// Access to memory operands of the instruction
> + unsigned getNumMemOperands() const { return MemOperands.size(); }
> +
> + const MemOperand& getMemOperand(unsigned i) const {
> + assert(i < getNumMemOperands() && "getMemOperand() out of
> range!");
> + return MemOperands[i];
> + }
> + MemOperand& getMemOperand(unsigned i) {
> + assert(i < getNumMemOperands() && "getMemOperand() out of
> range!");
> + return MemOperands[i];
> + }
> +
> /// isIdenticalTo - Return true if this instruction is identical
> to (same
> /// opcode and same operands as) the specified instruction.
> bool isIdenticalTo(const MachineInstr *Other) const {
> @@ -196,6 +210,12 @@
> ///
> void RemoveOperand(unsigned i);
>
> + /// addMemOperand - Add a MemOperand to the machine instruction,
> referencing
> + /// arbitrary storage.
> + void addMemOperand(const MemOperand &MO) {
> + MemOperands.push_back(MO);
> + }
> +
> private:
> /// getRegInfo - If this instruction is embedded into a
> MachineFunction,
> /// return the MachineRegisterInfo object for the current
> function, otherwise
>
> Modified: llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h Wed Feb 6
> 16:27:42 2008
> @@ -83,6 +83,12 @@
> MI->addOperand(MachineOperand::CreateES(FnName, 0));
> return *this;
> }
> +
> + /// addMemOperand - Add a memory operand to the machine
> instruction.
> + const MachineInstrBuilder &addMemOperand(const MemOperand &MO)
> const {
> + MI->addMemOperand(MO);
> + return *this;
> + }
> };
>
> /// BuildMI - Builder interface. Specify how to create the initial
> instruction
>
> Modified: llvm/trunk/include/llvm/CodeGen/MemOperand.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MemOperand.h?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/CodeGen/MemOperand.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/MemOperand.h Wed Feb 6 16:27:42
> 2008
> @@ -0,0 +1,82 @@
> +//===-- llvm/CodeGen/MemOperand.h - MemOperand class ------------*-
> C++ -*-===//
> +//
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open
> Source
> +// License. See LICENSE.TXT for details.
> +//
> +//
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> +//
> +// This file contains the declaration of the MemOperand class,
> which is a
> +// description of a memory reference. It is used to help track
> dependencies
> +// in the backend.
> +//
> +//
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> +
> +#ifndef LLVM_CODEGEN_MEMOPERAND_H
> +#define LLVM_CODEGEN_MEMOPERAND_H
> +
> +namespace llvm {
> +
> +class Value;
> +
> +//
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> +/// MemOperand - A description of a memory reference used in the
> backend.
> +/// Instead of holding a StoreInst or LoadInst, this class holds
> the address
> +/// Value of the reference along with a byte size and offset. This
> allows it
> +/// to describe lowered loads and stores. Also, the special
> PseudoSourceValue
> +/// objects can be used to represent loads and stores to memory
> locations
> +/// that aren't explicit in the regular LLVM IR.
> +///
> +class MemOperand {
> + const Value *V;
> + unsigned int Flags;
> + int Offset;
> + int Size;
> + unsigned int Alignment;
> +
> +public:
> + /// Flags values. These may be or'd together.
> + enum MemOperandFlags {
> + /// The memory access reads data.
> + MOLoad = 1,
> + /// The memory access writes data.
> + MOStore = 2,
> + /// The memory access is volatile.
> + MOVolatile = 4
> + };
> +
> + /// MemOperand - Construct an MemOperand object with the specified
> + /// address Value, flags, offset, size, and alignment.
> + MemOperand(const Value *v, unsigned int f, int o, int s, unsigned
> int a)
> + : V(v), Flags(f), Offset(o), Size(s), Alignment(a) {}
> +
> + /// getValue - Return the base address of the memory access.
> + /// Special values are PseudoSourceValue::FPRel,
> PseudoSourceValue::SPRel,
> + /// and the other PseudoSourceValue members which indicate
> references to
> + /// frame/stack pointer relative references and other special
> references.
> + const Value *getValue() const { return V; }
> +
> + /// getFlags - Return the raw flags of the source value, \see
> MemOperandFlags.
> + unsigned int getFlags() const { return Flags; }
> +
> + /// getOffset - For normal values, this is a byte offset added to
> the base
> + /// address. For PseudoSourceValue::FPRel values, this is the
> FrameIndex
> + /// number.
> + int getOffset() const { return Offset; }
> +
> + /// getSize - Return the size in bytes of the memory reference.
> + int getSize() const { return Size; }
> +
> + /// getAlignment - Return the minimum known alignment in bytes of
> the
> + /// memory reference.
> + unsigned int getAlignment() const { return Alignment; }
> +
> + bool isLoad() const { return Flags & MOLoad; }
> + bool isStore() const { return Flags & MOStore; }
> + bool isVolatile() const { return Flags & MOVolatile; }
> +};
> +
> +} // End llvm namespace
> +
> +#endif
>
> Modified: llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h Wed Feb 6
> 16:27:42 2008
> @@ -0,0 +1,58 @@
> +//===-- llvm/CodeGen/PseudoSourceValue.h ------------------------*-
> C++ -*-===//
> +//
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open
> Source
> +// License. See LICENSE.TXT for details.
> +//
> +//
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> +//
> +// This file contains the declaration of the PseudoSourceValue class.
> +//
> +//
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> +
> +#ifndef LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
> +#define LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
> +
> +#include "llvm/Value.h"
> +
> +namespace llvm {
> + /// PseudoSourceValue - Special value supplied for machine level
> alias
> + /// analysis. It indicates that the a memory access references
> the functions
> + /// stack frame (e.g., a spill slot), below the stack frame
> (e.g., argument
> + /// space), or constant pool.
> + class PseudoSourceValue : public Value {
> + public:
> + PseudoSourceValue();
> +
> + virtual void print(std::ostream &OS) const;
> +
> + /// classof - Methods for support type inquiry through isa,
> cast, and
> + /// dyn_cast:
> + ///
> + static inline bool classof(const PseudoSourceValue *) { return
> true; }
> + static inline bool classof(const Value *V) {
> + return V->getValueID() == PseudoSourceValueVal;
> + }
> +
> + /// A pseudo source value referencing to the stack frame of a
> function,
> + /// e.g., a spill slot.
> + static const PseudoSourceValue &getFixedStack();
> +
> + /// A source value referencing the area below the stack frame
> of a function,
> + /// e.g., the argument space.
> + static const PseudoSourceValue &getStack();
> +
> + /// A source value referencing the global offset table (or
> something the
> + /// like).
> + static const PseudoSourceValue &getGOT();
> +
> + /// A SV referencing the constant pool
> + static const PseudoSourceValue &getConstantPool();
> +
> + /// A SV referencing the jump table
> + static const PseudoSourceValue &getJumpTable();
> + };
> +} // End llvm namespace
> +
> +#endif
>
> Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Wed Feb 6
> 16:27:42 2008
> @@ -279,6 +279,7 @@
> if (isa(Node)) return true;
> if (isa(Node)) return true;
> if (isa(Node)) return true;
> + if (isa(Node)) return true;
> return false;
> }
>
> @@ -312,11 +313,15 @@
> /// (which do not go into the machine instrs.)
> static unsigned CountResults(SDNode *Node);
>
> - /// CountOperands The inputs to target nodes have any actual
> inputs first,
> - /// followed by an optional chain operand, then flag operands.
> Compute the
> - /// number of actual operands that will go into the machine
> instr.
> + /// CountOperands - The inputs to target nodes have any actual
> inputs first,
> + /// followed by optional memory operands chain operand, then
> flag operands.
> + /// Compute the number of actual operands that will go into
> the machine
> + /// instr.
> static unsigned CountOperands(SDNode *Node);
>
> + /// CountMemOperands - Find the index of the last
> MemOperandSDNode
> + static unsigned CountMemOperands(SDNode *Node);
> +
> /// EmitNode - Generate machine code for an node and needed
> dependencies.
> /// VRBaseMap contains, for each already emitted node, the first
> virtual
> /// register number for the results of the node.
> @@ -357,6 +362,8 @@
> void AddOperand(MachineInstr *MI, SDOperand Op, unsigned IIOpNum,
> const TargetInstrDesc *II,
> DenseMap &VRBaseMap);
> +
> + void AddMemOperand(MachineInstr *MI, const MemOperand &MO);
> };
>
> /// createBURRListDAGScheduler - This creates a bottom up register
> usage
>
> Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Wed Feb 6
> 16:27:42 2008
> @@ -376,8 +376,12 @@
> SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base,
> SDOperand Offset, ISD::MemIndexedMode AM);
>
> - // getSrcValue - construct a node to track a Value* through the
> backend
> - SDOperand getSrcValue(const Value* I, int offset = 0);
> + // getSrcValue - Construct a node to track a Value* through the
> backend.
> + SDOperand getSrcValue(const Value *v);
> +
> + // getMemOperand - Construct a node to track a memory reference
> + // through the backend.
> + SDOperand getMemOperand(const MemOperand &MO);
>
> /// UpdateNodeOperands - *Mutate* the specified node in-place to
> have the
> /// specified operands. If the resultant node already exists in
> the DAG,
>
> Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Wed Feb 6
> 16:27:42 2008
> @@ -25,6 +25,7 @@
> #include "llvm/ADT/iterator"
> #include "llvm/ADT/APFloat.h"
> #include "llvm/CodeGen/ValueTypes.h"
> +#include "llvm/CodeGen/MemOperand.h"
> #include "llvm/Support/DataTypes.h"
> #include
>
> @@ -542,11 +543,15 @@
> // pointer, and a SRCVALUE.
> VAEND, VASTART,
>
> - // SRCVALUE - This corresponds to a Value*, and is used to
> associate memory
> - // locations with their value. This allows one use alias
> analysis
> - // information in the backend.
> + // SRCVALUE - This is a node type that holds a Value* that is
> used to
> + // make reference to a value in the LLVM IR.
> SRCVALUE,
>
> + // MEMOPERAND - This is a node that contains a MemOperand which
> records
> + // information about a memory reference. This is used to make
> AliasAnalysis
> + // queries from the backend.
> + MEMOPERAND,
> +
> // PCMARKER - This corresponds to the pcmarker intrinsic.
> PCMARKER,
>
> @@ -1391,17 +1396,16 @@
>
> class SrcValueSDNode : public SDNode {
> const Value *V;
> - int offset;
> virtual void ANCHOR(); // Out-of-line virtual method to give
> class a home.
> protected:
> friend class SelectionDAG;
> - SrcValueSDNode(const Value* v, int o)
> - : SDNode(ISD::SRCVALUE, getSDVTList(MVT::Other)), V(v),
> offset(o) {
> - }
> + /// Create a SrcValue for a general value.
> + explicit SrcValueSDNode(const Value *v)
> + : SDNode(ISD::SRCVALUE, getSDVTList(MVT::Other)), V(v) {}
>
> public:
> + /// getValue - return the contained Value.
> const Value *getValue() const { return V; }
> - int getOffset() const { return offset; }
>
> static bool classof(const SrcValueSDNode *) { return true; }
> static bool classof(const SDNode *N) {
> @@ -1410,6 +1414,29 @@
> };
>
>
> +/// MemOperandSDNode - An SDNode that holds a MemOperand. This is
> +/// used to represent a reference to memory after ISD::LOAD
> +/// and ISD::STORE have been lowered.
> +///
> +class MemOperandSDNode : public SDNode {
> + virtual void ANCHOR(); // Out-of-line virtual method to give
> class a home.
> +protected:
> + friend class SelectionDAG;
> + /// Create a MemOperand node
> + explicit MemOperandSDNode(MemOperand mo)
> + : SDNode(ISD::MEMOPERAND, getSDVTList(MVT::Other)), MO(mo) {}
> +
> +public:
> + /// MO - The contained MemOperand.
> + const MemOperand MO;
> +
> + static bool classof(const MemOperandSDNode *) { return true; }
> + static bool classof(const SDNode *N) {
> + return N->getOpcode() == ISD::MEMOPERAND;
> + }
> +};
> +
> +
> class RegisterSDNode : public SDNode {
> unsigned Reg;
> virtual void ANCHOR(); // Out-of-line virtual method to give
> class a home.
> @@ -1559,6 +1586,10 @@
> /// isUnindexed - Return true if this is NOT a pre/post inc/dec
> load/store.
> bool isUnindexed() const { return AddrMode == ISD::UNINDEXED; }
>
> + /// getMemOperand - Return a MemOperand object describing the
> memory
> + /// reference performed by this load or store.
> + MemOperand getMemOperand() const;
> +
> static bool classof(const LSBaseSDNode *N) { return true; }
> static bool classof(const SDNode *N) {
> return N->getOpcode() == ISD::LOAD ||
>
> Modified: llvm/trunk/include/llvm/Value.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/Value.h (original)
> +++ llvm/trunk/include/llvm/Value.h Wed Feb 6 16:27:42 2008
> @@ -187,6 +187,7 @@
> ConstantVectorVal, // This is an instance of ConstantVector
> ConstantPointerNullVal, // This is an instance of
> ConstantPointerNull
> InlineAsmVal, // This is an instance of InlineAsm
> + PseudoSourceValueVal, // This is an instance of
> PseudoSourceValue
> InstructionVal, // This is an instance of Instruction
>
> // Markers:
>
> Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Wed Feb 6 16:27:42 2008
> @@ -15,6 +15,8 @@
> #include "llvm/Value.h"
> #include "llvm/CodeGen/MachineFunction.h"
> #include "llvm/CodeGen/MachineRegisterInfo.h"
> +#include "llvm/CodeGen/PseudoSourceValue.h"
> +#include "llvm/CodeGen/SelectionDAGNodes.h"
> #include "llvm/Target/TargetMachine.h"
> #include "llvm/Target/TargetInstrInfo.h"
> #include "llvm/Target/TargetInstrDesc.h"
> @@ -292,6 +294,7 @@
> TID = &MI.getDesc();
> NumImplicitOps = MI.NumImplicitOps;
> Operands.reserve(MI.getNumOperands());
> + MemOperands = MI.MemOperands;
>
> // Add operands
> for (unsigned i = 0; i != MI.getNumOperands(); ++i) {
> @@ -627,6 +630,34 @@
> getOperand(i).print(OS, TM);
> }
>
> + if (getNumMemOperands() > 0) {
> + OS << ", SV:";
> + for (unsigned i = 0; i < getNumMemOperands(); i++) {
> + const MemOperand &MRO = getMemOperand(i);
> + const Value *V = MRO.getValue();
> +
> + assert(V && "SV missing.");
> + assert((MRO.isLoad() || MRO.isStore()) &&
> + "SV has to be a load, store or both.");
> +
> + if (MRO.isVolatile())
> + OS << "Volatile ";
> + if (MRO.isLoad())
> + OS << "LD ";
> + if (MRO.isStore())
> + OS << "ST ";
> +
> + OS << MRO.getSize();
> +
> + if (!V->getName().empty())
> + OS << "[" << V->getName() << " + " << MRO.getOffset() << "]";
> + else if (isa(V))
> + OS << "[" << *V << " + " << MRO.getOffset() << "]";
> + else
> + OS << "[" << V << " + " << MRO.getOffset() << "]";
> + }
> + }
> +
> OS << "\n";
> }
>
>
> Modified: llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp (original)
> +++ llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp Wed Feb 6 16:27:42
> 2008
> @@ -0,0 +1,41 @@
> +//===-- llvm/CodeGen/PseudoSourceValue.cpp ----------------------*-
> C++ -*-===//
> +//
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open
> Source
> +// License. See LICENSE.TXT for details.
> +//
> +//
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> +//
> +// This file implements the PseudoSourceValue class.
> +//
> +//
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
> +
> +#include "llvm/CodeGen/PseudoSourceValue.h"
> +#include "llvm/DerivedTypes.h"
> +#include "llvm/Support/ManagedStatic.h"
> +
> +namespace llvm {
> + static ManagedStatic PSVs;
> +
> + const PseudoSourceValue &PseudoSourceValue::getFixedStack()
> { return (*PSVs)[0]; }
> + const PseudoSourceValue &PseudoSourceValue::getStack() { return
> (*PSVs)[1]; }
> + const PseudoSourceValue &PseudoSourceValue::getGOT() { return
> (*PSVs)[2]; }
> + const PseudoSourceValue &PseudoSourceValue::getConstantPool()
> { return (*PSVs)[3]; }
> + const PseudoSourceValue &PseudoSourceValue::getJumpTable()
> { return (*PSVs)[4]; }
> +
> + static const char *PSVNames[] = {
> + "FixedStack",
> + "Stack",
> + "GOT",
> + "ConstantPool",
> + "JumpTable"
> + };
> +
> + PseudoSourceValue::PseudoSourceValue() :
> + Value(PointerType::getUnqual(Type::Int8Ty),
> PseudoSourceValueVal) {}
> +
> + void PseudoSourceValue::print(std::ostream &OS) const {
> + OS << PSVNames[this - *PSVs];
> + }
> +}
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Feb 6
> 16:27:42 2008
> @@ -16,6 +16,7 @@
> #include "llvm/CodeGen/MachineFrameInfo.h"
> #include "llvm/CodeGen/MachineJumpTableInfo.h"
> #include "llvm/CodeGen/MachineModuleInfo.h"
> +#include "llvm/CodeGen/PseudoSourceValue.h"
> #include "llvm/Target/TargetFrameInfo.h"
> #include "llvm/Target/TargetLowering.h"
> #include "llvm/Target/TargetData.h"
> @@ -509,9 +510,11 @@
> SDOperand CPIdx = DAG.getConstantPool(LLVMC, TLI.getPointerTy());
> if (Extend) {
> return DAG.getExtLoad(ISD::EXTLOAD, MVT::f64, DAG.getEntryNode(),
> - CPIdx, NULL, 0, MVT::f32);
> + CPIdx,
> &PseudoSourceValue::getConstantPool(),
> + 0, MVT::f32);
> } else {
> - return DAG.getLoad(VT, DAG.getEntryNode(), CPIdx, NULL, 0);
> + return DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
> + &PseudoSourceValue::getConstantPool(), 0);
> }
> }
>
> @@ -796,6 +799,7 @@
> case ISD::TargetExternalSymbol:
> case ISD::VALUETYPE:
> case ISD::SRCVALUE:
> + case ISD::MEMOPERAND:
> case ISD::STRING:
> case ISD::CONDCODE:
> // Primitives must all be legal.
> @@ -1316,8 +1320,15 @@
> MVT::ValueType IdxVT = Tmp3.getValueType();
> MVT::ValueType PtrVT = TLI.getPointerTy();
> SDOperand StackPtr = DAG.CreateStackTemporary(VT);
> +
> + FrameIndexSDNode *StackPtrFI =
> dyn_cast(StackPtr.Val);
> + assert(StackPtrFI);
> + int SPFI = StackPtrFI->getIndex();
> +
> // Store the vector.
> - SDOperand Ch = DAG.getStore(DAG.getEntryNode(), Tmp1,
> StackPtr, NULL, 0);
> + SDOperand Ch = DAG.getStore(DAG.getEntryNode(), Tmp1, StackPtr,
> +
> &PseudoSourceValue::getFixedStack(),
> + SPFI);
>
> // Truncate or zero extend offset to target pointer type.
> unsigned CastOpc = (IdxVT > PtrVT) ? ISD::TRUNCATE :
> ISD::ZERO_EXTEND;
> @@ -1327,9 +1338,11 @@
> Tmp3 = DAG.getNode(ISD::MUL, IdxVT,
> Tmp3,DAG.getConstant(EltSize, IdxVT));
> SDOperand StackPtr2 = DAG.getNode(ISD::ADD, IdxVT, Tmp3,
> StackPtr);
> // Store the scalar value.
> - Ch = DAG.getStore(Ch, Tmp2, StackPtr2, NULL, 0);
> + Ch = DAG.getStore(Ch, Tmp2, StackPtr2,
> + &PseudoSourceValue::getFixedStack(), SPFI);
> // Load the updated vector.
> - Result = DAG.getLoad(VT, Ch, StackPtr, NULL, 0);
> + Result = DAG.getLoad(VT, Ch, StackPtr,
> + &PseudoSourceValue::getFixedStack(),
> SPFI);
> break;
> }
> }
> @@ -1678,8 +1691,10 @@
> SDOperand LD;
> switch (EntrySize) {
> default: assert(0 && "Size of jump table not supported yet.");
> break;
> - case 4: LD = DAG.getLoad(MVT::i32, Chain, Addr, NULL, 0);
> break;
> - case 8: LD = DAG.getLoad(MVT::i64, Chain, Addr, NULL, 0);
> break;
> + case 4: LD = DAG.getLoad(MVT::i32, Chain, Addr,
> + &PseudoSourceValue::getJumpTable(),
> 0); break;
> + case 8: LD = DAG.getLoad(MVT::i64, Chain, Addr,
> + &PseudoSourceValue::getJumpTable(),
> 0); break;
> }
>
> Addr = LD;
> @@ -3240,16 +3255,14 @@
> }
> break;
> case TargetLowering::Expand: {
> - SrcValueSDNode *SV = cast(Node->getOperand(2));
> - SDOperand VAList = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp2,
> - SV->getValue(), SV-
> >getOffset());
> + const Value *V = cast(Node->getOperand(2))-
> >getValue();
> + SDOperand VAList = DAG.getLoad(TLI.getPointerTy(), Tmp1,
> Tmp2, V, 0);
> // Increment the pointer, VAList, to the next vaarg
> Tmp3 = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList,
> DAG.getConstant(MVT::getSizeInBits(VT)/8,
> TLI.getPointerTy()));
> // Store the incremented VAList to the legalized pointer
> - Tmp3 = DAG.getStore(VAList.getValue(1), Tmp3, Tmp2, SV-
> >getValue(),
> - SV->getOffset());
> + Tmp3 = DAG.getStore(VAList.getValue(1), Tmp3, Tmp2, V, 0);
> // Load the actual argument out of the pointer VAList
> Result = DAG.getLoad(VT, Tmp3, VAList, NULL, 0);
> Tmp1 = LegalizeOp(Result.getValue(1));
> @@ -3285,12 +3298,10 @@
> case TargetLowering::Expand:
> // This defaults to loading a pointer from the input and
> storing it to the
> // output, returning the chain.
> - SrcValueSDNode *SVD = cast(Node-
> >getOperand(3));
> - SrcValueSDNode *SVS = cast(Node-
> >getOperand(4));
> - Tmp4 = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp3, SVD-
> >getValue(),
> - SVD->getOffset());
> - Result = DAG.getStore(Tmp4.getValue(1), Tmp4, Tmp2, SVS-
> >getValue(),
> - SVS->getOffset());
> + const Value *VD = cast(Node->getOperand(3))-
> >getValue();
> + const Value *VS = cast(Node->getOperand(4))-
> >getValue();
> + Tmp4 = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp3, VD, 0);
> + Result = DAG.getStore(Tmp4.getValue(1), Tmp4, Tmp2, VS, 0);
> break;
> }
> break;
> @@ -4285,16 +4296,14 @@
> Tmp3 = DAG.getVAArg(VT, Tmp1, Tmp2, Node->getOperand(2));
> Result = TLI.CustomPromoteOperation(Tmp3, DAG);
> } else {
> - SrcValueSDNode *SV = cast(Node->getOperand(2));
> - SDOperand VAList = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp2,
> - SV->getValue(), SV-
> >getOffset());
> + const Value *V = cast(Node->getOperand(2))-
> >getValue();
> + SDOperand VAList = DAG.getLoad(TLI.getPointerTy(), Tmp1,
> Tmp2, V, 0);
> // Increment the pointer, VAList, to the next vaarg
> Tmp3 = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList,
> DAG.getConstant(MVT::getSizeInBits(VT)/8,
> TLI.getPointerTy()));
> // Store the incremented VAList to the legalized pointer
> - Tmp3 = DAG.getStore(VAList.getValue(1), Tmp3, Tmp2, SV-
> >getValue(),
> - SV->getOffset());
> + Tmp3 = DAG.getStore(VAList.getValue(1), Tmp3, Tmp2, V, 0);
> // Load the actual argument out of the pointer VAList
> Result = DAG.getExtLoad(ISD::EXTLOAD, NVT, Tmp3, VAList, NULL,
> 0, VT);
> }
> @@ -4750,6 +4759,10 @@
> // Create the stack frame object.
> SDOperand FIPtr = DAG.CreateStackTemporary(SlotVT);
>
> + FrameIndexSDNode *StackPtrFI = dyn_cast(FIPtr);
> + assert(StackPtrFI);
> + int SPFI = StackPtrFI->getIndex();
> +
> unsigned SrcSize = MVT::getSizeInBits(SrcOp.getValueType());
> unsigned SlotSize = MVT::getSizeInBits(SlotVT);
> unsigned DestSize = MVT::getSizeInBits(DestVT);
> @@ -4758,10 +4771,14 @@
> // later than DestVT.
> SDOperand Store;
> if (SrcSize > SlotSize)
> - Store = DAG.getTruncStore(DAG.getEntryNode(), SrcOp, FIPtr,
> NULL, 0,SlotVT);
> + Store = DAG.getTruncStore(DAG.getEntryNode(), SrcOp, FIPtr,
> + &PseudoSourceValue::getFixedStack(),
> + SPFI, SlotVT);
> else {
> assert(SrcSize == SlotSize && "Invalid store");
> - Store = DAG.getStore(DAG.getEntryNode(), SrcOp, FIPtr, NULL, 0);
> + Store = DAG.getStore(DAG.getEntryNode(), SrcOp, FIPtr,
> + &PseudoSourceValue::getFixedStack(),
> + SPFI, SlotVT);
> }
>
> // Result is a load from the stack slot.
> @@ -4776,9 +4793,15 @@
> // Create a vector sized/aligned stack slot, store the value to
> element #0,
> // then load the whole vector back out.
> SDOperand StackPtr = DAG.CreateStackTemporary(Node-
> >getValueType(0));
> +
> + FrameIndexSDNode *StackPtrFI =
> dyn_cast(StackPtr);
> + assert(StackPtrFI);
> + int SPFI = StackPtrFI->getIndex();
> +
> SDOperand Ch = DAG.getStore(DAG.getEntryNode(), Node-
> >getOperand(0), StackPtr,
> - NULL, 0);
> - return DAG.getLoad(Node->getValueType(0), Ch, StackPtr, NULL, 0);
> + &PseudoSourceValue::getFixedStack(),
> SPFI);
> + return DAG.getLoad(Node->getValueType(0), Ch, StackPtr,
> + &PseudoSourceValue::getFixedStack(), SPFI);
> }
>
>
> @@ -4842,7 +4865,8 @@
> }
> Constant *CP = ConstantVector::get(CV);
> SDOperand CPIdx = DAG.getConstantPool(CP, TLI.getPointerTy());
> - return DAG.getLoad(VT, DAG.getEntryNode(), CPIdx, NULL, 0);
> + return DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
> + &PseudoSourceValue::getConstantPool(), 0);
> }
>
> if (SplatValue.Val) { // Splat of one value?
> @@ -5184,11 +5208,14 @@
> CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx,
> CstOffset);
> SDOperand FudgeInReg;
> if (DestTy == MVT::f32)
> - FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx,
> NULL, 0);
> + FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx,
> +
> &PseudoSourceValue::getConstantPool(), 0);
> else if (MVT::getSizeInBits(DestTy) >
> MVT::getSizeInBits(MVT::f32))
> // FIXME: Avoid the extend by construction the right
> constantpool?
> FudgeInReg = DAG.getExtLoad(ISD::EXTLOAD, DestTy,
> DAG.getEntryNode(),
> - CPIdx, NULL, 0, MVT::f32);
> + CPIdx,
> +
> &PseudoSourceValue::getConstantPool(), 0,
> + MVT::f32);
> else
> assert(0 && "Unexpected conversion");
>
> @@ -5330,11 +5357,14 @@
> CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx, CstOffset);
> SDOperand FudgeInReg;
> if (DestVT == MVT::f32)
> - FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx,
> NULL, 0);
> + FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx,
> + &PseudoSourceValue::getConstantPool(),
> 0);
> else {
> - FudgeInReg = LegalizeOp(DAG.getExtLoad(ISD::EXTLOAD, DestVT,
> - DAG.getEntryNode(), CPIdx,
> - NULL, 0, MVT::f32));
> + FudgeInReg =
> + LegalizeOp(DAG.getExtLoad(ISD::EXTLOAD, DestVT,
> + DAG.getEntryNode(), CPIdx,
> +
> &PseudoSourceValue::getConstantPool(), 0,
> + MVT::f32));
> }
>
> return DAG.getNode(ISD::FADD, DestVT, Tmp1, FudgeInReg);
> @@ -6743,10 +6773,16 @@
> // Lower to a store/load so that it can be split.
> // FIXME: this could be improved probably.
> SDOperand Ptr = DAG.CreateStackTemporary(InOp.getValueType());
> + FrameIndexSDNode *FI = dyn_cast(Ptr.Val);
> + assert(FI && "Expecting CreateStackTemporary to return a
> frame index.\n");
>
> SDOperand St = DAG.getStore(DAG.getEntryNode(),
> - InOp, Ptr, NULL, 0);
> - InOp = DAG.getLoad(Op.getValueType(), St, Ptr, NULL, 0);
> + InOp, Ptr,
> +
> &PseudoSourceValue::getFixedStack(),
> + FI->getIndex());
> + InOp = DAG.getLoad(Op.getValueType(), St, Ptr,
> + &PseudoSourceValue::getFixedStack(),
> + FI->getIndex());
> }
> // Split the vector and convert each of the pieces now.
> SplitVectorOp(InOp, Lo, Hi);
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Wed Feb 6
> 16:27:42 2008
> @@ -277,15 +277,27 @@
> return N;
> }
>
> -/// CountOperands The inputs to target nodes have any actual
> inputs first,
> -/// followed by an optional chain operand, then flag operands.
> Compute the
> -/// number of actual operands that will go into the machine instr.
> +/// CountOperands - The inputs to target nodes have any actual
> inputs first,
> +/// followed by optional memory operands chain operand, then flag
> operands.
> +/// Compute the number of actual operands that will go into the
> machine istr.
> unsigned ScheduleDAG::CountOperands(SDNode *Node) {
> unsigned N = Node->getNumOperands();
> while (N && Node->getOperand(N - 1).getValueType() == MVT::Flag)
> --N;
> if (N && Node->getOperand(N - 1).getValueType() == MVT::Other)
> --N; // Ignore chain if it exists.
> + while (N && MemOperandSDNode::classof(Node->getOperand(N - 1).Val))
> + --N; // Ignore MemOperand nodes
> + return N;
> +}
> +
> +/// CountMemOperands - Find the index of the last MemOperandSDNode
> operand
> +unsigned ScheduleDAG::CountMemOperands(SDNode *Node) {
> + unsigned N = Node->getNumOperands();
> + while (N && Node->getOperand(N - 1).getValueType() == MVT::Flag)
> + --N;
> + if (N && Node->getOperand(N - 1).getValueType() == MVT::Other)
> + --N; // Ignore chain if it exists.
> return N;
> }
>
> @@ -517,6 +529,10 @@
>
> }
>
> +void ScheduleDAG::AddMemOperand(MachineInstr *MI, const MemOperand
> &MO) {
> + MI->addMemOperand(MO);
> +}
> +
> // Returns the Register Class of a subregister
> static const TargetRegisterClass *getSubRegisterRegClass(
> const TargetRegisterClass *TRC,
> @@ -675,6 +691,7 @@
>
> unsigned NumResults = CountResults(Node);
> unsigned NodeOperands = CountOperands(Node);
> + unsigned NodeMemOperands = CountMemOperands(Node);
> unsigned NumMIOperands = NodeOperands + NumResults;
> bool HasPhysRegOuts = (NumResults > II.getNumDefs()) &&
> II.getImplicitDefs() != 0;
> @@ -697,6 +714,10 @@
> for (unsigned i = 0; i != NodeOperands; ++i)
> AddOperand(MI, Node->getOperand(i), i+II.getNumDefs(), &II,
> VRBaseMap);
>
> + // Emit all of the memory operands of this instruction
> + for (unsigned i = NodeOperands; i != NodeMemOperands; ++i)
> + AddMemOperand(MI, cast(Node->getOperand(i))-
> >MO);
> +
> // Commute node if it has been determined to be profitable.
> if (CommuteSet.count(Node)) {
> MachineInstr *NewMI = TII->commuteInstruction(MI);
> @@ -737,6 +758,7 @@
> case ISD::TokenFactor:
> case ISD::LABEL:
> case ISD::DECLARE:
> + case ISD::SRCVALUE:
> break;
> case ISD::CopyToReg: {
> unsigned InReg;
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Feb 6
> 16:27:42 2008
> @@ -21,6 +21,7 @@
> #include "llvm/CodeGen/MachineConstantPool.h"
> #include "llvm/CodeGen/MachineFrameInfo.h"
> #include "llvm/CodeGen/MachineModuleInfo.h"
> +#include "llvm/CodeGen/PseudoSourceValue.h"
> #include "llvm/Support/MathExtras.h"
> #include "llvm/Target/MRegisterInfo.h"
> #include "llvm/Target/TargetData.h"
> @@ -361,10 +362,16 @@
> case ISD::Register:
> ID.AddInteger(cast(N)->getReg());
> break;
> - case ISD::SRCVALUE: {
> - SrcValueSDNode *SV = cast(N);
> - ID.AddPointer(SV->getValue());
> - ID.AddInteger(SV->getOffset());
> + case ISD::SRCVALUE:
> + ID.AddPointer(cast(N)->getValue());
> + break;
> + case ISD::MEMOPERAND: {
> + const MemOperand &MO = cast(N)->MO;
> + ID.AddPointer(MO.getValue());
> + ID.AddInteger(MO.getFlags());
> + ID.AddInteger(MO.getOffset());
> + ID.AddInteger(MO.getSize());
> + ID.AddInteger(MO.getAlignment());
> break;
> }
> case ISD::FrameIndex:
> @@ -937,18 +944,42 @@
> return SDOperand(N, 0);
> }
>
> -SDOperand SelectionDAG::getSrcValue(const Value *V, int Offset) {
> +SDOperand SelectionDAG::getSrcValue(const Value *V) {
> assert((!V || isa(V->getType())) &&
> "SrcValue is not a pointer?");
>
> FoldingSetNodeID ID;
> AddNodeIDNode(ID, ISD::SRCVALUE, getVTList(MVT::Other), 0, 0);
> ID.AddPointer(V);
> - ID.AddInteger(Offset);
> +
> void *IP = 0;
> if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
> return SDOperand(E, 0);
> - SDNode *N = new SrcValueSDNode(V, Offset);
> +
> + SDNode *N = new SrcValueSDNode(V);
> + CSEMap.InsertNode(N, IP);
> + AllNodes.push_back(N);
> + return SDOperand(N, 0);
> +}
> +
> +SDOperand SelectionDAG::getMemOperand(const MemOperand &MO) {
> + const Value *v = MO.getValue();
> + assert((!v || isa(v->getType())) &&
> + "SrcValue is not a pointer?");
> +
> + FoldingSetNodeID ID;
> + AddNodeIDNode(ID, ISD::MEMOPERAND, getVTList(MVT::Other), 0, 0);
> + ID.AddPointer(v);
> + ID.AddInteger(MO.getFlags());
> + ID.AddInteger(MO.getOffset());
> + ID.AddInteger(MO.getSize());
> + ID.AddInteger(MO.getAlignment());
> +
> + void *IP = 0;
> + if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
> + return SDOperand(E, 0);
> +
> + SDNode *N = new MemOperandSDNode(MO);
> CSEMap.InsertNode(N, IP);
> AllNodes.push_back(N);
> return SDOperand(N, 0);
> @@ -3479,6 +3510,7 @@
> void ConstantPoolSDNode::ANCHOR() {}
> void BasicBlockSDNode::ANCHOR() {}
> void SrcValueSDNode::ANCHOR() {}
> +void MemOperandSDNode::ANCHOR() {}
> void RegisterSDNode::ANCHOR() {}
> void ExternalSymbolSDNode::ANCHOR() {}
> void CondCodeSDNode::ANCHOR() {}
> @@ -3503,6 +3535,26 @@
> TheGlobal = const_cast(GA);
> }
>
> +/// getMemOperand - Return a MemOperand object describing the memory
> +/// reference performed by this load or store.
> +MemOperand LSBaseSDNode::getMemOperand() const {
> + int Size = (MVT::getSizeInBits(getMemoryVT()) + 7) >> 3;
> + int Flags =
> + getOpcode() == ISD::LOAD ? MemOperand::MOLoad :
> MemOperand::MOStore;
> + if (IsVolatile) Flags |= MemOperand::MOVolatile;
> +
> + // Check if the load references a frame index, and does not have
> + // an SV attached.
> + const FrameIndexSDNode *FI =
> + dyn_cast(getBasePtr().Val);
> + if (!getSrcValue() && FI)
> + return MemOperand(&PseudoSourceValue::getFixedStack(), Flags,
> + FI->getIndex(), Size, Alignment);
> + else
> + return MemOperand(getSrcValue(), Flags,
> + getSrcValueOffset(), Size, Alignment);
> +}
> +
> /// Profile - Gather unique data for the node.
> ///
> void SDNode::Profile(FoldingSetNodeID &ID) {
> @@ -3695,6 +3747,7 @@
> case ISD::PCMARKER: return "PCMarker";
> case ISD::READCYCLECOUNTER: return "ReadCycleCounter";
> case ISD::SRCVALUE: return "SrcValue";
> + case ISD::MEMOPERAND: return "MemOperand";
> case ISD::EntryToken: return "EntryToken";
> case ISD::TokenFactor: return "TokenFactor";
> case ISD::AssertSext: return "AssertSext";
> @@ -4000,9 +4053,14 @@
> cerr << "'" << ES->getSymbol() << "'";
> } else if (const SrcValueSDNode *M =
> dyn_cast(this)) {
> if (M->getValue())
> - cerr << "<" << M->getValue() << ":" << M->getOffset() << ">";
> + cerr << "<" << M->getValue() << ">";
> + else
> + cerr << "";
> + } else if (const MemOperandSDNode *M =
> dyn_cast(this)) {
> + if (M->MO.getValue())
> + cerr << "<" << M->MO.getValue() << ":" << M->MO.getOffset()
> << ">";
> else
> - cerr << "getOffset() << ">";
> + cerr << "MO.getOffset() << ">";
> } else if (const VTSDNode *N = dyn_cast(this)) {
> cerr << ":" << MVT::getValueTypeString(N->getVT());
> } else if (const LoadSDNode *LD = dyn_cast(this)) {
>
> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
> (original)
> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Wed
> Feb 6 16:27:42 2008
> @@ -142,9 +142,14 @@
> Op += "'" + std::string(ES->getSymbol()) + "'";
> } else if (const SrcValueSDNode *M =
> dyn_cast(Node)) {
> if (M->getValue())
> - Op += "<" + M->getValue()->getName() + ":" + itostr(M-
> >getOffset()) + ">";
> + Op += "<" + M->getValue()->getName() + ">";
> else
> - Op += "getOffset()) + ">";
> + Op += "";
> + } else if (const MemOperandSDNode *M =
> dyn_cast(Node)) {
> + if (M->MO.getValue())
> + Op += "<" + M->MO.getValue()->getName() + ":" + itostr(M-
> >MO.getOffset()) + ">";
> + else
> + Op += "MO.getOffset()) + ">";
> } else if (const VTSDNode *N = dyn_cast(Node)) {
> Op = Op + " VT=" + MVT::getValueTypeString(N->getVT());
> } else if (const StringSDNode *N = dyn_cast(Node)) {
>
> Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Feb 6
> 16:27:42 2008
> @@ -905,9 +905,8 @@
> // memory location argument.
> MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
> SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, PtrVT);
> - SrcValueSDNode *SV = cast(Op.getOperand(2));
> - return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV-
> >getValue(),
> - SV->getOffset());
> + const Value *SV = cast(Op.getOperand(2))-
> >getValue();
> + return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV, 0);
> }
>
> static SDOperand LowerFORMAL_ARGUMENT(SDOperand Op, SelectionDAG &DAG,
>
> Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Wed Feb 6
> 16:27:42 2008
> @@ -491,10 +491,9 @@
> case ISD::VAARG: {
> SDOperand Chain = Op.getOperand(0);
> SDOperand VAListP = Op.getOperand(1);
> - SrcValueSDNode *VAListS = cast(Op.getOperand(2));
> + const Value *VAListS = cast(Op.getOperand(2))-
> >getValue();
>
> - SDOperand Base = DAG.getLoad(MVT::i64, Chain, VAListP, VAListS-
> >getValue(),
> - VAListS->getOffset());
> + SDOperand Base = DAG.getLoad(MVT::i64, Chain, VAListP, VAListS,
> 0);
> SDOperand Tmp = DAG.getNode(ISD::ADD, MVT::i64, VAListP,
> DAG.getConstant(8, MVT::i64));
> SDOperand Offset = DAG.getExtLoad(ISD::SEXTLOAD, MVT::i64,
> Base.getValue(1),
> @@ -527,13 +526,11 @@
> SDOperand Chain = Op.getOperand(0);
> SDOperand DestP = Op.getOperand(1);
> SDOperand SrcP = Op.getOperand(2);
> - SrcValueSDNode *DestS = cast(Op.getOperand(3));
> - SrcValueSDNode *SrcS = cast(Op.getOperand(4));
> + const Value *DestS = cast(Op.getOperand(3))-
> >getValue();
> + const Value *SrcS = cast(Op.getOperand(4))-
> >getValue();
>
> - SDOperand Val = DAG.getLoad(getPointerTy(), Chain, SrcP,
> - SrcS->getValue(), SrcS->getOffset());
> - SDOperand Result = DAG.getStore(Val.getValue(1), Val, DestP,
> DestS->getValue(),
> - DestS->getOffset());
> + SDOperand Val = DAG.getLoad(getPointerTy(), Chain, SrcP, SrcS,
> 0);
> + SDOperand Result = DAG.getStore(Val.getValue(1), Val, DestP,
> DestS, 0);
> SDOperand NP = DAG.getNode(ISD::ADD, MVT::i64, SrcP,
> DAG.getConstant(8, MVT::i64));
> Val = DAG.getExtLoad(ISD::SEXTLOAD, MVT::i64, Result, NP, NULL,
> 0, MVT::i32);
> @@ -544,12 +541,11 @@
> case ISD::VASTART: {
> SDOperand Chain = Op.getOperand(0);
> SDOperand VAListP = Op.getOperand(1);
> - SrcValueSDNode *VAListS = cast(Op.getOperand(2));
> + const Value *VAListS = cast(Op.getOperand(2))-
> >getValue();
>
> // vastart stores the address of the VarArgsBase and VarArgsOffset
> SDOperand FR = DAG.getFrameIndex(VarArgsBase, MVT::i64);
> - SDOperand S1 = DAG.getStore(Chain, FR, VAListP, VAListS-
> >getValue(),
> - VAListS->getOffset());
> + SDOperand S1 = DAG.getStore(Chain, FR, VAListP, VAListS, 0);
> SDOperand SA2 = DAG.getNode(ISD::ADD, MVT::i64, VAListP,
> DAG.getConstant(8, MVT::i64));
> return DAG.getTruncStore(S1, DAG.getConstant(VarArgsOffset,
> MVT::i64),
>
> Modified: llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp Wed Feb 6
> 16:27:42 2008
> @@ -581,16 +581,16 @@
> }
> case ISD::VAARG: {
> MVT::ValueType VT = getPointerTy();
> - SrcValueSDNode *SV = cast(Op.getOperand(2));
> + const Value *SV = cast(Op.getOperand(2))-
> >getValue();
> SDOperand VAList = DAG.getLoad(VT, Op.getOperand(0),
> Op.getOperand(1),
> - SV->getValue(), SV->getOffset());
> + SV, 0);
> // Increment the pointer, VAList, to the next vaarg
> SDOperand VAIncr = DAG.getNode(ISD::ADD, VT, VAList,
>
> DAG.getConstant(MVT::getSizeInBits(VT)/8,
> VT));
> // Store the incremented VAList to the legalized pointer
> VAIncr = DAG.getStore(VAList.getValue(1), VAIncr,
> - Op.getOperand(1), SV->getValue(), SV-
> >getOffset());
> + Op.getOperand(1), SV, 0);
> // Load the actual argument out of the pointer VAList
> return DAG.getLoad(Op.getValueType(), VAIncr, VAList, NULL, 0);
> }
> @@ -598,9 +598,8 @@
> // vastart just stores the address of the VarArgsFrameIndex slot
> into the
> // memory location argument.
> SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, MVT::i64);
> - SrcValueSDNode *SV = cast(Op.getOperand(2));
> - return DAG.getStore(Op.getOperand(0), FR,
> - Op.getOperand(1), SV->getValue(), SV-
> >getOffset());
> + const Value *SV = cast(Op.getOperand(2))-
> >getValue();
> + return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV,
> 0);
> }
> // Frame & Return address. Currently unimplemented
> case ISD::RETURNADDR: break;
>
> Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Wed Feb 6
> 16:27:42 2008
> @@ -24,6 +24,7 @@
> #include "llvm/CodeGen/MachineFunction.h"
> #include "llvm/CodeGen/MachineInstrBuilder.h"
> #include "llvm/CodeGen/MachineRegisterInfo.h"
> +#include "llvm/CodeGen/PseudoSourceValue.h"
> #include "llvm/CodeGen/SelectionDAG.h"
> #include "llvm/Constants.h"
> #include "llvm/Function.h"
> @@ -1175,9 +1176,8 @@
> // memory location argument.
> MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
> SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, PtrVT);
> - SrcValueSDNode *SV = cast(Op.getOperand(2));
> - return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV-
> >getValue(),
> - SV->getOffset());
> + const Value *SV = cast(Op.getOperand(2))-
> >getValue();
> + return DAG.getStore(Op.getOperand(0), FR, Op.getOperand(1), SV,
> 0);
> }
>
> // For ELF 32 ABI we follow the layout of the va_list struct.
> @@ -1211,37 +1211,41 @@
>
> MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
>
> - SDOperand StackOffset = DAG.getFrameIndex(VarArgsStackOffset,
> PtrVT);
> + SDOperand StackOffsetFI = DAG.getFrameIndex(VarArgsStackOffset,
> PtrVT);
> SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex, PtrVT);
>
> - SDOperand ConstFrameOffset =
> DAG.getConstant(MVT::getSizeInBits(PtrVT)/8,
> - PtrVT);
> - SDOperand ConstStackOffset =
> DAG.getConstant(MVT::getSizeInBits(PtrVT)/8 - 1,
> - PtrVT);
> - SDOperand ConstFPROffset = DAG.getConstant(1, PtrVT);
> + uint64_t FrameOffset = MVT::getSizeInBits(PtrVT)/8;
> + SDOperand ConstFrameOffset = DAG.getConstant(FrameOffset, PtrVT);
> +
> + uint64_t StackOffset = MVT::getSizeInBits(PtrVT)/8 - 1;
> + SDOperand ConstStackOffset = DAG.getConstant(StackOffset, PtrVT);
> +
> + uint64_t FPROffset = 1;
> + SDOperand ConstFPROffset = DAG.getConstant(FPROffset, PtrVT);
>
> - SrcValueSDNode *SV = cast(Op.getOperand(2));
> + const Value *SV = cast(Op.getOperand(2))-
> >getValue();
>
> // Store first byte : number of int regs
> SDOperand firstStore = DAG.getStore(Op.getOperand(0), ArgGPR,
> - Op.getOperand(1), SV-
> >getValue(),
> - SV->getOffset());
> + Op.getOperand(1), SV, 0);
> + uint64_t nextOffset = FPROffset;
> SDOperand nextPtr = DAG.getNode(ISD::ADD, PtrVT, Op.getOperand(1),
> ConstFPROffset);
>
> // Store second byte : number of float regs
> - SDOperand secondStore = DAG.getStore(firstStore, ArgFPR, nextPtr,
> - SV->getValue(), SV-
> >getOffset());
> + SDOperand secondStore =
> + DAG.getStore(firstStore, ArgFPR, nextPtr, SV, nextOffset);
> + nextOffset += StackOffset;
> nextPtr = DAG.getNode(ISD::ADD, PtrVT, nextPtr, ConstStackOffset);
>
> // Store second word : arguments given on stack
> - SDOperand thirdStore = DAG.getStore(secondStore, StackOffset,
> nextPtr,
> - SV->getValue(), SV-
> >getOffset());
> + SDOperand thirdStore =
> + DAG.getStore(secondStore, StackOffsetFI, nextPtr, SV,
> nextOffset);
> + nextOffset += FrameOffset;
> nextPtr = DAG.getNode(ISD::ADD, PtrVT, nextPtr, ConstFrameOffset);
>
> // Store third word : arguments given in registers
> - return DAG.getStore(thirdStore, FR, nextPtr, SV->getValue(),
> - SV->getOffset());
> + return DAG.getStore(thirdStore, FR, nextPtr, SV, nextOffset);
>
> }
>
> @@ -2199,9 +2203,11 @@
> Op.getOperand(0));
>
> // STD the extended value into the stack slot.
> + MemOperand MO(&PseudoSourceValue::getFixedStack(),
> + MemOperand::MOStore, FrameIdx, 8, 8);
> SDOperand Store = DAG.getNode(PPCISD::STD_32, MVT::Other,
> DAG.getEntryNode(), Ext64, FIdx,
> - DAG.getSrcValue(NULL));
> + DAG.getMemOperand(MO));
> // Load the value as a double.
> SDOperand Ld = DAG.getLoad(MVT::f64, Store, FIdx, NULL, 0);
>
> @@ -3300,11 +3306,11 @@
> std::vector VTs;
> VTs.push_back(MVT::i32);
> VTs.push_back(MVT::Other);
> - SDOperand SV = DAG.getSrcValue(LD->getSrcValue(), LD-
> >getSrcValueOffset());
> + SDOperand MO = DAG.getMemOperand(LD->getMemOperand());
> SDOperand Ops[] = {
> LD->getChain(), // Chain
> LD->getBasePtr(), // Ptr
> - SV, // SrcValue
> + MO, // MemOperand
> DAG.getValueType(N->getValueType(0)) // VT
> };
> SDOperand BSLoad = DAG.getNode(PPCISD::LBRX, VTs, Ops, 4);
>
> Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original)
> +++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Wed Feb 6
> 16:27:42 2008
> @@ -805,25 +805,23 @@
> SDOperand Offset = DAG.getNode(ISD::ADD, MVT::i32,
> DAG.getRegister(SP::I6, MVT::i32),
> DAG.getConstant(VarArgsFrameOffset,
> MVT::i32));
> - SrcValueSDNode *SV = cast(Op.getOperand(2));
> - return DAG.getStore(Op.getOperand(0), Offset,
> - Op.getOperand(1), SV->getValue(), SV-
> >getOffset());
> + const Value *SV = cast(Op.getOperand(2))-
> >getValue();
> + return DAG.getStore(Op.getOperand(0), Offset, Op.getOperand(1),
> SV, 0);
> }
> case ISD::VAARG: {
> SDNode *Node = Op.Val;
> MVT::ValueType VT = Node->getValueType(0);
> SDOperand InChain = Node->getOperand(0);
> SDOperand VAListPtr = Node->getOperand(1);
> - SrcValueSDNode *SV = cast(Node->getOperand(2));
> - SDOperand VAList = DAG.getLoad(getPointerTy(), InChain,
> VAListPtr,
> - SV->getValue(), SV->getOffset());
> + const Value *SV = cast(Node->getOperand(2))-
> >getValue();
> + SDOperand VAList = DAG.getLoad(getPointerTy(), InChain,
> VAListPtr, SV, 0);
> // Increment the pointer, VAList, to the next vaarg
> SDOperand NextPtr = DAG.getNode(ISD::ADD, getPointerTy(), VAList,
>
> DAG.getConstant(MVT::getSizeInBits(VT)/8,
> getPointerTy()));
> // Store the incremented VAList to the legalized pointer
> InChain = DAG.getStore(VAList.getValue(1), NextPtr,
> - VAListPtr, SV->getValue(), SV-
> >getOffset());
> + VAListPtr, SV, 0);
> // Load the actual argument out of the pointer VAList, unless
> this is an
> // f64 load.
> if (VT != MVT::f64) {
>
> Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Feb 6
> 16:27:42 2008
> @@ -32,6 +32,7 @@
> #include "llvm/CodeGen/MachineInstrBuilder.h"
> #include "llvm/CodeGen/MachineModuleInfo.h"
> #include "llvm/CodeGen/MachineRegisterInfo.h"
> +#include "llvm/CodeGen/PseudoSourceValue.h"
> #include "llvm/CodeGen/SelectionDAG.h"
> #include "llvm/Support/MathExtras.h"
> #include "llvm/Support/Debug.h"
> @@ -1089,7 +1090,8 @@
> SDOperand FIN = DAG.getFrameIndex(FI, getPointerTy());
> if (isByVal)
> return FIN;
> - return DAG.getLoad(VA.getValVT(), Root, FIN, NULL, 0);
> + return DAG.getLoad(VA.getValVT(), Root, FIN,
> + &PseudoSourceValue::getFixedStack(), FI);
> }
>
> SDOperand
> @@ -1217,7 +1219,10 @@
> unsigned VReg = AddLiveIn(MF, GPR64ArgRegs[NumIntRegs],
> X86::GR64RegisterClass);
> SDOperand Val = DAG.getCopyFromReg(Root, VReg, MVT::i64);
> - SDOperand Store = DAG.getStore(Val.getValue(1), Val, FIN,
> NULL, 0);
> + SDOperand Store =
> + DAG.getStore(Val.getValue(1), Val, FIN,
> + &PseudoSourceValue::getFixedStack(),
> + RegSaveFrameIndex);
> MemOps.push_back(Store);
> FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN,
> DAG.getIntPtrConstant(8));
> @@ -1230,7 +1235,10 @@
> unsigned VReg = AddLiveIn(MF, XMMArgRegs[NumXMMRegs],
> X86::VR128RegisterClass);
> SDOperand Val = DAG.getCopyFromReg(Root, VReg, MVT::v4f32);
> - SDOperand Store = DAG.getStore(Val.getValue(1), Val, FIN,
> NULL, 0);
> + SDOperand Store =
> + DAG.getStore(Val.getValue(1), Val, FIN,
> + &PseudoSourceValue::getFixedStack(),
> + RegSaveFrameIndex);
> MemOps.push_back(Store);
> FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN,
> DAG.getIntPtrConstant(16));
> @@ -1559,7 +1567,9 @@
> Flags,
> DAG));
> } else {
> // Store relative to framepointer.
> - MemOpChains2.push_back(DAG.getStore(Chain, Source, FIN,
> NULL, 0));
> + MemOpChains2.push_back(
> + DAG.getStore(Chain, Source, FIN,
> + &PseudoSourceValue::getFixedStack(), FI));
> }
> }
> }
> @@ -3788,7 +3798,8 @@
> // the GV offset field. Platform check is inside
> GVRequiresExtraLoad() call
> // The same applies for external symbols during PIC codegen
> if (Subtarget->GVRequiresExtraLoad(GV, getTargetMachine(), false))
> - Result = DAG.getLoad(getPointerTy(), DAG.getEntryNode(),
> Result, NULL, 0);
> + Result = DAG.getLoad(getPointerTy(), DAG.getEntryNode(), Result,
> + &PseudoSourceValue::getGOT(), 0);
>
> return Result;
> }
> @@ -3846,7 +3857,8 @@
> SDOperand Offset = DAG.getNode(X86ISD::Wrapper, PtrVT, TGA);
>
> if (GA->getGlobal()->isDeclaration()) // initial exec TLS model
> - Offset = DAG.getLoad(PtrVT, DAG.getEntryNode(), Offset, NULL, 0);
> + Offset = DAG.getLoad(PtrVT, DAG.getEntryNode(), Offset,
> + &PseudoSourceValue::getGOT(), 0);
>
> // The address of the thread local variable is the add of the thread
> // pointer with the offset of the variable.
> @@ -3978,7 +3990,9 @@
> int SSFI = MF.getFrameInfo()->CreateStackObject(Size, Size);
> SDOperand StackSlot = DAG.getFrameIndex(SSFI, getPointerTy());
> SDOperand Chain = DAG.getStore(DAG.getEntryNode(), Op.getOperand(0),
> - StackSlot, NULL, 0);
> + StackSlot,
> + &PseudoSourceValue::getFixedStack(),
> + SSFI);
>
> // These are really Legal; caller falls through into that case.
> if (SrcVT == MVT::i32 && isScalarFPTypeInSSEReg(Op.getValueType()))
> @@ -4019,7 +4033,8 @@
> Ops.push_back(DAG.getValueType(Op.getValueType()));
> Ops.push_back(InFlag);
> Chain = DAG.getNode(X86ISD::FST, Tys, &Ops[0], Ops.size());
> - Result = DAG.getLoad(Op.getValueType(), Chain, StackSlot, NULL,
> 0);
> + Result = DAG.getLoad(Op.getValueType(), Chain, StackSlot,
> + &PseudoSourceValue::getFixedStack(), SSFI);
> }
>
> return Result;
> @@ -4057,7 +4072,8 @@
> SDOperand Value = Op.getOperand(0);
> if (isScalarFPTypeInSSEReg(Op.getOperand(0).getValueType())) {
> assert(Op.getValueType() == MVT::i64 && "Invalid FP_TO_SINT to
> lower!");
> - Chain = DAG.getStore(Chain, Value, StackSlot, NULL, 0);
> + Chain = DAG.getStore(Chain, Value, StackSlot,
> + &PseudoSourceValue::getFixedStack(), SSFI);
> SDVTList Tys = DAG.getVTList(Op.getOperand(0).getValueType(),
> MVT::Other);
> SDOperand Ops[] = {
> Chain, StackSlot,
> DAG.getValueType(Op.getOperand(0).getValueType())
> @@ -4116,7 +4132,8 @@
> }
> Constant *C = ConstantVector::get(CV);
> SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
> - SDOperand Mask = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx, NULL,
> 0,
> + SDOperand Mask = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
> +
> &PseudoSourceValue::getConstantPool(), 0,
> false, 16);
> return DAG.getNode(X86ISD::FAND, VT, Op.getOperand(0), Mask);
> }
> @@ -4144,7 +4161,8 @@
> }
> Constant *C = ConstantVector::get(CV);
> SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
> - SDOperand Mask = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx, NULL,
> 0,
> + SDOperand Mask = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
> +
> &PseudoSourceValue::getConstantPool(), 0,
> false, 16);
> if (MVT::isVector(VT)) {
> return DAG.getNode(ISD::BIT_CONVERT, VT,
> @@ -4192,7 +4210,8 @@
> }
> Constant *C = ConstantVector::get(CV);
> SDOperand CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
> - SDOperand Mask1 = DAG.getLoad(SrcVT, DAG.getEntryNode(), CPIdx,
> NULL, 0,
> + SDOperand Mask1 = DAG.getLoad(SrcVT, DAG.getEntryNode(), CPIdx,
> +
> &PseudoSourceValue::getConstantPool(), 0,
> false, 16);
> SDOperand SignBit = DAG.getNode(X86ISD::FAND, SrcVT, Op1, Mask1);
>
> @@ -4220,7 +4239,8 @@
> }
> C = ConstantVector::get(CV);
> CPIdx = DAG.getConstantPool(C, getPointerTy(), 4);
> - SDOperand Mask2 = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
> NULL, 0,
> + SDOperand Mask2 = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx,
> +
> &PseudoSourceValue::getConstantPool(), 0,
> false, 16);
> SDOperand Val = DAG.getNode(X86ISD::FAND, VT, Op0, Mask2);
>
> @@ -4676,14 +4696,13 @@
> }
>
> SDOperand X86TargetLowering::LowerVASTART(SDOperand Op, SelectionDAG
> &DAG) {
> - SrcValueSDNode *SV = cast(Op.getOperand(2));
> + const Value *SV = cast(Op.getOperand(2))-
> >getValue();
>
> if (!Subtarget->is64Bit()) {
> // vastart just stores the address of the VarArgsFrameIndex slot
> into the
> // memory location argument.
> SDOperand FR = DAG.getFrameIndex(VarArgsFrameIndex,
> getPointerTy());
> - return DAG.getStore(Op.getOperand(0), FR,Op.getOperand(1), SV-
> >getValue(),
> - SV->getOffset());
> + return DAG.getStore(Op.getOperand(0), FR,Op.getOperand(1), SV,
> 0);
> }
>
> // __va_list_tag:
> @@ -4696,28 +4715,26 @@
> // Store gp_offset
> SDOperand Store = DAG.getStore(Op.getOperand(0),
> DAG.getConstant(VarArgsGPOffset,
> MVT::i32),
> - FIN, SV->getValue(), SV-
> >getOffset());
> + FIN, SV, 0);
> MemOps.push_back(Store);
>
> // Store fp_offset
> FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN,
> DAG.getIntPtrConstant(4));
> Store = DAG.getStore(Op.getOperand(0),
> DAG.getConstant(VarArgsFPOffset, MVT::i32),
> - FIN, SV->getValue(), SV->getOffset());
> + FIN, SV, 0);
> MemOps.push_back(Store);
>
> // Store ptr to overflow_arg_area
> FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN,
> DAG.getIntPtrConstant(4));
> SDOperand OVFIN = DAG.getFrameIndex(VarArgsFrameIndex,
> getPointerTy());
> - Store = DAG.getStore(Op.getOperand(0), OVFIN, FIN, SV->getValue(),
> - SV->getOffset());
> + Store = DAG.getStore(Op.getOperand(0), OVFIN, FIN, SV, 0);
> MemOps.push_back(Store);
>
> // Store ptr to reg_save_area.
> FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN,
> DAG.getIntPtrConstant(8));
> SDOperand RSFIN = DAG.getFrameIndex(RegSaveFrameIndex,
> getPointerTy());
> - Store = DAG.getStore(Op.getOperand(0), RSFIN, FIN, SV->getValue(),
> - SV->getOffset());
> + Store = DAG.getStore(Op.getOperand(0), RSFIN, FIN, SV, 0);
> MemOps.push_back(Store);
> return DAG.getNode(ISD::TokenFactor, MVT::Other, &MemOps[0],
> MemOps.size());
> }
> @@ -4727,18 +4744,15 @@
> SDOperand Chain = Op.getOperand(0);
> SDOperand DstPtr = Op.getOperand(1);
> SDOperand SrcPtr = Op.getOperand(2);
> - SrcValueSDNode *DstSV = cast(Op.getOperand(3));
> - SrcValueSDNode *SrcSV = cast(Op.getOperand(4));
> + const Value *DstSV = cast(Op.getOperand(3))-
> >getValue();
> + const Value *SrcSV = cast(Op.getOperand(4))-
> >getValue();
>
> - SrcPtr = DAG.getLoad(getPointerTy(), Chain, SrcPtr,
> - SrcSV->getValue(), SrcSV->getOffset());
> + SrcPtr = DAG.getLoad(getPointerTy(), Chain, SrcPtr, SrcSV, 0);
> Chain = SrcPtr.getValue(1);
> for (unsigned i = 0; i < 3; ++i) {
> - SDOperand Val = DAG.getLoad(MVT::i64, Chain, SrcPtr,
> - SrcSV->getValue(), SrcSV-
> >getOffset());
> + SDOperand Val = DAG.getLoad(MVT::i64, Chain, SrcPtr, SrcSV, 0);
> Chain = Val.getValue(1);
> - Chain = DAG.getStore(Chain, Val, DstPtr,
> - DstSV->getValue(), DstSV->getOffset());
> + Chain = DAG.getStore(Chain, Val, DstPtr, DstSV, 0);
> if (i == 2)
> break;
> SrcPtr = DAG.getNode(ISD::ADD, getPointerTy(), SrcPtr,
> @@ -4918,7 +4932,7 @@
> SDOperand FPtr = Op.getOperand(2); // nested function
> SDOperand Nest = Op.getOperand(3); // 'nest' parameter value
>
> - SrcValueSDNode *TrmpSV = cast(Op.getOperand(4));
> + const Value *TrmpAddr = cast(Op.getOperand(4))-
> >getValue();
>
> const X86InstrInfo *TII =
> ((X86TargetMachine&)getTargetMachine()).getInstrInfo();
> @@ -4942,33 +4956,31 @@
> unsigned OpCode = ((MOV64ri | N86R11) << 8) | REX_WB; // movabsq
> r11
> SDOperand Addr = Trmp;
> OutChains[0] = DAG.getStore(Root, DAG.getConstant(OpCode,
> MVT::i16), Addr,
> - TrmpSV->getValue(), TrmpSV-
> >getOffset());
> + TrmpAddr, 0);
>
> Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(2,
> MVT::i64));
> - OutChains[1] = DAG.getStore(Root, FPtr, Addr, TrmpSV->getValue(),
> - TrmpSV->getOffset() + 2, false, 2);
> + OutChains[1] = DAG.getStore(Root, FPtr, Addr, TrmpAddr, 2,
> false, 2);
>
> // Load the 'nest' parameter value into R10.
> // R10 is specified in X86CallingConv.td
> OpCode = ((MOV64ri | N86R10) << 8) | REX_WB; // movabsq r10
> Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(10,
> MVT::i64));
> OutChains[2] = DAG.getStore(Root, DAG.getConstant(OpCode,
> MVT::i16), Addr,
> - TrmpSV->getValue(), TrmpSV-
> >getOffset() + 10);
> + TrmpAddr, 10);
>
> Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(12,
> MVT::i64));
> - OutChains[3] = DAG.getStore(Root, Nest, Addr, TrmpSV->getValue(),
> - TrmpSV->getOffset() + 12, false, 2);
> + OutChains[3] = DAG.getStore(Root, Nest, Addr, TrmpAddr, 12,
> false, 2);
>
> // Jump to the nested function.
> OpCode = (JMP64r << 8) | REX_WB; // jmpq *...
> Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(20,
> MVT::i64));
> OutChains[4] = DAG.getStore(Root, DAG.getConstant(OpCode,
> MVT::i16), Addr,
> - TrmpSV->getValue(), TrmpSV-
> >getOffset() + 20);
> + TrmpAddr, 20);
>
> unsigned char ModRM = N86R11 | (4 << 3) | (3 << 6); // ...r11
> Addr = DAG.getNode(ISD::ADD, MVT::i64, Trmp, DAG.getConstant(22,
> MVT::i64));
> OutChains[5] = DAG.getStore(Root, DAG.getConstant(ModRM,
> MVT::i8), Addr,
> - TrmpSV->getValue(), TrmpSV-
> >getOffset() + 22);
> + TrmpAddr, 22);
>
> SDOperand Ops[] =
> { Trmp, DAG.getNode(ISD::TokenFactor, MVT::Other, OutChains,
> 6) };
> @@ -5026,20 +5038,18 @@
> const unsigned char N86Reg =
> ((X86RegisterInfo*)RegInfo)->getX86RegNum(NestReg);
> OutChains[0] = DAG.getStore(Root, DAG.getConstant(MOV32ri|
> N86Reg, MVT::i8),
> - Trmp, TrmpSV->getValue(), TrmpSV-
> >getOffset());
> + Trmp, TrmpAddr, 0);
>
> Addr = DAG.getNode(ISD::ADD, MVT::i32, Trmp, DAG.getConstant(1,
> MVT::i32));
> - OutChains[1] = DAG.getStore(Root, Nest, Addr, TrmpSV->getValue(),
> - TrmpSV->getOffset() + 1, false, 1);
> + OutChains[1] = DAG.getStore(Root, Nest, Addr, TrmpAddr, 1,
> false, 1);
>
> const unsigned char JMP = TII->getBaseOpcodeFor(X86::JMP);
> Addr = DAG.getNode(ISD::ADD, MVT::i32, Trmp, DAG.getConstant(5,
> MVT::i32));
> OutChains[2] = DAG.getStore(Root, DAG.getConstant(JMP, MVT::i8),
> Addr,
> - TrmpSV->getValue() + 5, TrmpSV-
> >getOffset());
> + TrmpAddr, 5, false, 1);
>
> Addr = DAG.getNode(ISD::ADD, MVT::i32, Trmp, DAG.getConstant(6,
> MVT::i32));
> - OutChains[3] = DAG.getStore(Root, Disp, Addr, TrmpSV->getValue(),
> - TrmpSV->getOffset() + 6, false, 1);
> + OutChains[3] = DAG.getStore(Root, Disp, Addr, TrmpAddr, 6,
> false, 1);
>
> SDOperand Ops[] =
> { Trmp, DAG.getNode(ISD::TokenFactor, MVT::Other, OutChains,
> 4) };
>
> Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=46827&r1=46826&r2=46827&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
> +++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Wed Feb 6 16:27:42
> 2008
> @@ -313,6 +313,12 @@
> std::vector > OrigChains;
> std::set Duplicates;
>
> + /// LSI - Load/Store information.
> + /// Save loads/stores matched by a pattern, and generate a
> MemOperandSDNode
> + /// for each memory access. This facilitates the use of
> AliasAnalysis in
> + /// the backend.
> + std::vector LSI;
> +
> /// GeneratedCode - This is the buffer that we emit code to. The
> first int
> /// indicates whether this is an exit predicate (something that
> should be
> /// tested, and if true, the match fails) [when 1], or normal code
> to emit
> @@ -373,6 +379,16 @@
> void EmitMatchCode(TreePatternNode *N, TreePatternNode *P,
> const std::string &RootName, const std::string
> &ChainSuffix,
> bool &FoundChain) {
> +
> + // Save loads/stores matched by a pattern.
> + if (!N->isLeaf() && N->getName().empty()) {
> + std::string EnumName = N->getOperator()-
> >getValueAsString("Opcode");
> + if (EnumName == "ISD::LOAD" ||
> + EnumName == "ISD::STORE") {
> + LSI.push_back(RootName);
> + }
> + }
> +
> bool isRoot = (P == NULL);
> // Emit instruction predicates. Each predicate is just a string
> for now.
> if (isRoot) {
> @@ -944,6 +960,18 @@
> }
> }
>
> + // Generate MemOperandSDNodes nodes for each memory accesses
> covered by this
> + // pattern.
> + if (isRoot) {
> + std::vector::const_iterator mi, mie;
> + for (mi = LSI.begin(), mie = LSI.end(); mi != mie; ++mi) {
> + emitCode("SDOperand LSI_" + *mi + " = "
> + "CurDAG->getMemOperand(cast(" +
> + *mi + ")->getMemOperand());");
> + AllOps.push_back("LSI_" + *mi);
> + }
> + }
> +
> // Emit all the chain and CopyToReg stuff.
> bool ChainEmitted = NodeHasChain;
> if (NodeHasChain)
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From evan.cheng at apple.com Thu Feb 7 02:53:49 2008
From: evan.cheng at apple.com (Evan Cheng)
Date: Thu, 07 Feb 2008 08:53:49 -0000
Subject: [llvm-commits] [llvm] r46850 - in /llvm/trunk:
lib/Target/X86/X86ISelDAGToDAG.cpp lib/Target/X86/X86Instr64bit.td
lib/Target/X86/X86InstrInfo.td lib/Target/X86/X86Subtarget.cpp
lib/Target/X86/X86Subtarget.h test/CodeGen/X86/pic_jumptable.ll
test/CodeGen/X86/x86-64-gv-offset.ll
Message-ID: <200802070853.m178rosx029306@zion.cs.uiuc.edu>
Author: evancheng
Date: Thu Feb 7 02:53:49 2008
New Revision: 46850
URL: http://llvm.org/viewvc/llvm-project?rev=46850&view=rev
Log:
Fix a x86-64 codegen deficiency. Allow gv + offset when using rip addressing mode.
Before:
_main:
subq $8, %rsp
leaq _X(%rip), %rax
movsd 8(%rax), %xmm1
movss _X(%rip), %xmm0
call _t
xorl %ecx, %ecx
movl %ecx, %eax
addq $8, %rsp
ret
Now:
_main:
subq $8, %rsp
movsd _X+8(%rip), %xmm1
movss _X(%rip), %xmm0
call _t
xorl %ecx, %ecx
movl %ecx, %eax
addq $8, %rsp
ret
Notice there is another idiotic codegen issue that needs to be fixed asap:
xorl %ecx, %ecx
movl %ecx, %eax
Added:
llvm/trunk/test/CodeGen/X86/x86-64-gv-offset.ll
Modified:
llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/trunk/lib/Target/X86/X86Instr64bit.td
llvm/trunk/lib/Target/X86/X86InstrInfo.td
llvm/trunk/lib/Target/X86/X86Subtarget.cpp
llvm/trunk/lib/Target/X86/X86Subtarget.h
llvm/trunk/test/CodeGen/X86/pic_jumptable.ll
Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=46850&r1=46849&r2=46850&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Thu Feb 7 02:53:49 2008
@@ -63,7 +63,7 @@
int FrameIndex;
} Base;
- bool isRIPRel; // RIP relative?
+ bool isRIPRel; // RIP as base?
unsigned Scale;
SDOperand IndexReg;
unsigned Disp;
@@ -664,7 +664,9 @@
case X86ISD::Wrapper: {
bool is64Bit = Subtarget->is64Bit();
// Under X86-64 non-small code model, GV (and friends) are 64-bits.
- if (is64Bit && TM.getCodeModel() != CodeModel::Small)
+ // Also, base and index reg must be 0 in order to use rip as base.
+ if (is64Bit && (TM.getCodeModel() != CodeModel::Small ||
+ AM.Base.Reg.Val || AM.IndexReg.Val))
break;
if (AM.GV != 0 || AM.CP != 0 || AM.ES != 0 || AM.JT != -1)
break;
@@ -672,39 +674,27 @@
// been picked, we can't fit the result available in the register in the
// addressing mode. Duplicate GlobalAddress or ConstantPool as displacement.
if (!AlreadySelected || (AM.Base.Reg.Val && AM.IndexReg.Val)) {
- bool isStatic = TM.getRelocationModel() == Reloc::Static;
SDOperand N0 = N.getOperand(0);
- // Mac OS X X86-64 lower 4G address is not available.
- bool isAbs32 = !is64Bit ||
- (isStatic && Subtarget->hasLow4GUserSpaceAddress());
if (GlobalAddressSDNode *G = dyn_cast(N0)) {
GlobalValue *GV = G->getGlobal();
- if (isAbs32 || isRoot) {
- AM.GV = GV;
- AM.Disp += G->getOffset();
- AM.isRIPRel = !isAbs32;
- return false;
- }
+ AM.GV = GV;
+ AM.Disp += G->getOffset();
+ AM.isRIPRel = is64Bit;
+ return false;
} else if (ConstantPoolSDNode *CP = dyn_cast(N0)) {
- if (isAbs32 || isRoot) {
- AM.CP = CP->getConstVal();
- AM.Align = CP->getAlignment();
- AM.Disp += CP->getOffset();
- AM.isRIPRel = !isAbs32;
- return false;
- }
+ AM.CP = CP->getConstVal();
+ AM.Align = CP->getAlignment();
+ AM.Disp += CP->getOffset();
+ AM.isRIPRel = is64Bit;
+ return false;
} else if (ExternalSymbolSDNode *S =dyn_cast(N0)) {
- if (isAbs32 || isRoot) {
- AM.ES = S->getSymbol();
- AM.isRIPRel = !isAbs32;
- return false;
- }
+ AM.ES = S->getSymbol();
+ AM.isRIPRel = is64Bit;
+ return false;
} else if (JumpTableSDNode *J = dyn_cast(N0)) {
- if (isAbs32 || isRoot) {
- AM.JT = J->getIndex();
- AM.isRIPRel = !isAbs32;
- return false;
- }
+ AM.JT = J->getIndex();
+ AM.isRIPRel = is64Bit;
+ return false;
}
}
break;
@@ -719,7 +709,7 @@
break;
case ISD::SHL:
- if (AlreadySelected || AM.IndexReg.Val != 0 || AM.Scale != 1)
+ if (AlreadySelected || AM.IndexReg.Val != 0 || AM.Scale != 1 || AM.isRIPRel)
break;
if (ConstantSDNode *CN = dyn_cast(N.Val->getOperand(1))) {
@@ -759,7 +749,8 @@
if (!AlreadySelected &&
AM.BaseType == X86ISelAddressMode::RegBase &&
AM.Base.Reg.Val == 0 &&
- AM.IndexReg.Val == 0) {
+ AM.IndexReg.Val == 0 &&
+ !AM.isRIPRel) {
if (ConstantSDNode *CN = dyn_cast(N.Val->getOperand(1)))
if (CN->getValue() == 3 || CN->getValue() == 5 || CN->getValue() == 9) {
AM.Scale = unsigned(CN->getValue())-1;
@@ -834,6 +825,9 @@
// Scale must not be used already.
if (AM.IndexReg.Val != 0 || AM.Scale != 1) break;
+
+ // Not when RIP is used as the base.
+ if (AM.isRIPRel) break;
ConstantSDNode *C2 = dyn_cast(N.getOperand(1));
ConstantSDNode *C1 = dyn_cast(Shift.getOperand(1));
@@ -874,7 +868,7 @@
// Is the base register already occupied?
if (AM.BaseType != X86ISelAddressMode::RegBase || AM.Base.Reg.Val) {
// If so, check to see if the scale index register is set.
- if (AM.IndexReg.Val == 0) {
+ if (AM.IndexReg.Val == 0 && !AM.isRIPRel) {
AM.IndexReg = N;
AM.Scale = 1;
return false;
Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=46850&r1=46849&r2=46850&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original)
+++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Thu Feb 7 02:53:49 2008
@@ -1125,16 +1125,16 @@
def : Pat<(store (i64 (X86Wrapper tconstpool:$src)), addr:$dst),
(MOV64mi32 addr:$dst, tconstpool:$src)>,
- Requires<[SmallCode, HasLow4G, IsStatic]>;
+ Requires<[SmallCode, IsStatic]>;
def : Pat<(store (i64 (X86Wrapper tjumptable:$src)), addr:$dst),
(MOV64mi32 addr:$dst, tjumptable:$src)>,
- Requires<[SmallCode, HasLow4G, IsStatic]>;
+ Requires<[SmallCode, IsStatic]>;
def : Pat<(store (i64 (X86Wrapper tglobaladdr:$src)), addr:$dst),
(MOV64mi32 addr:$dst, tglobaladdr:$src)>,
- Requires<[SmallCode, HasLow4G, IsStatic]>;
+ Requires<[SmallCode, IsStatic]>;
def : Pat<(store (i64 (X86Wrapper texternalsym:$src)), addr:$dst),
(MOV64mi32 addr:$dst, texternalsym:$src)>,
- Requires<[SmallCode, HasLow4G, IsStatic]>;
+ Requires<[SmallCode, IsStatic]>;
// Calls
// Direct PC relative function call for small code model. 32-bit displacement
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=46850&r1=46849&r2=46850&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Thu Feb 7 02:53:49 2008
@@ -172,7 +172,6 @@
def FPStackf64 : Predicate<"!Subtarget->hasSSE2()">;
def In32BitMode : Predicate<"!Subtarget->is64Bit()">;
def In64BitMode : Predicate<"Subtarget->is64Bit()">;
-def HasLow4G : Predicate<"Subtarget->hasLow4GUserSpaceAddress()">;
def SmallCode : Predicate<"TM.getCodeModel() == CodeModel::Small">;
def NotSmallCode : Predicate<"TM.getCodeModel() != CodeModel::Small">;
def IsStatic : Predicate<"TM.getRelocationModel() == Reloc::Static">;
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=46850&r1=46849&r2=46850&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Thu Feb 7 02:53:49 2008
@@ -228,7 +228,6 @@
// FIXME: this is a known good value for Yonah. How about others?
, MaxInlineSizeThreshold(128)
, Is64Bit(is64Bit)
- , HasLow4GUserAddress(true)
, TargetType(isELF) { // Default to ELF unless otherwise specified.
// Determine default and user specified characteristics
@@ -300,9 +299,6 @@
? X86Subtarget::Intel : X86Subtarget::ATT;
}
- if (TargetType == isDarwin && Is64Bit)
- HasLow4GUserAddress = false;
-
if (TargetType == isDarwin ||
TargetType == isCygwin ||
TargetType == isMingw ||
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=46850&r1=46849&r2=46850&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.h (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.h Thu Feb 7 02:53:49 2008
@@ -82,10 +82,6 @@
/// pointer size is 64 bit.
bool Is64Bit;
- /// HasLow4GUserAddress - True if the low 4G user-space address is available.
- ///
- bool HasLow4GUserAddress;
-
public:
enum {
isELF, isCygwin, isDarwin, isWindows, isMingw
@@ -115,10 +111,6 @@
bool is64Bit() const { return Is64Bit; }
- /// hasLow4GUserSpaceAddress - True if lower 4G user-space address is
- /// available.
- bool hasLow4GUserSpaceAddress() const { return HasLow4GUserAddress; }
-
PICStyle::Style getPICStyle() const { return PICStyle; }
void setPICStyle(PICStyle::Style Style) { PICStyle = Style; }
Modified: llvm/trunk/test/CodeGen/X86/pic_jumptable.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/pic_jumptable.ll?rev=46850&r1=46849&r2=46850&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/pic_jumptable.ll (original)
+++ llvm/trunk/test/CodeGen/X86/pic_jumptable.ll Thu Feb 7 02:53:49 2008
@@ -1,36 +1,35 @@
-; RUN: llvm-upgrade < %s | llvm-as | llc -relocation-model=pic -mtriple=i386-linux-gnu | not grep -F .text
-; RUN: llvm-upgrade < %s | llvm-as | llc -relocation-model=pic -mtriple=i686-apple-darwin | not grep lea
+; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i386-linux-gnu | not grep -F .text
+; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin | not grep lea
+; RUN: llvm-as < %s | llc -relocation-model=pic -mtriple=i686-apple-darwin | grep add | count 2
-implementation ; Functions:
+declare void @_Z3bari(i32)
-declare void %_Z3bari( int )
-
-linkonce void %_Z3fooILi1EEvi(int %Y) {
+define linkonce void @_Z3fooILi1EEvi(i32 %Y) {
entry:
- %Y_addr = alloca int ; [#uses=2]
- "alloca point" = cast int 0 to int ; [#uses=0]
- store int %Y, int* %Y_addr
- %tmp = load int* %Y_addr ; [#uses=1]
- switch int %tmp, label %bb10 [
- int 0, label %bb3
- int 1, label %bb
- int 2, label %bb
- int 3, label %bb
- int 4, label %bb
- int 5, label %bb
- int 6, label %bb
- int 7, label %bb
- int 8, label %bb
- int 9, label %bb
- int 10, label %bb
- int 12, label %bb1
- int 13, label %bb5
- int 14, label %bb6
- int 16, label %bb2
- int 17, label %bb4
- int 23, label %bb8
- int 27, label %bb7
- int 34, label %bb9
+ %Y_addr = alloca i32 ;